{"id":27102564,"url":"https://github.com/arthuro555/gdexporter","last_synced_at":"2025-04-06T15:52:52.379Z","repository":{"id":55399159,"uuid":"240557362","full_name":"arthuro555/gdexporter","owner":"arthuro555","description":"A CLI to export a GDevelop Game without the IDE with plugins support.","archived":false,"fork":false,"pushed_at":"2024-01-30T17:49:38.000Z","size":8367,"stargazers_count":19,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-22T14:02:20.185Z","etag":null,"topics":["build-tool","ci","cli","exporter","gdevelop"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arthuro555.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-14T16:57:11.000Z","updated_at":"2024-12-16T23:31:58.000Z","dependencies_parsed_at":"2024-06-20T23:30:24.557Z","dependency_job_id":"b7175360-5759-4e17-bddf-492d45fb3b92","html_url":"https://github.com/arthuro555/gdexporter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthuro555%2Fgdexporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthuro555%2Fgdexporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthuro555%2Fgdexporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthuro555%2Fgdexporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arthuro555","download_url":"https://codeload.github.com/arthuro555/gdexporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247509164,"owners_count":20950233,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["build-tool","ci","cli","exporter","gdevelop"],"created_at":"2025-04-06T15:52:51.941Z","updated_at":"2025-04-06T15:52:52.369Z","avatar_url":"https://github.com/arthuro555.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gdexporter\nA CLI to export a [GDevelop](https://github.com/4ian/GDevelop) game without the IDE (For example for CI).\n\n## Installation\nThe installation is done via npm, `npm install gdexporter`.\n\n## Usage\n`gdexport \u003coptions\u003e`\n\n#### Parameters\n| Option | Aliases | Description |\n| :-: | :-: | :-- |\n| `--project` | `-p`, `--in` | Path to the game.json. Defaults to `\"./Project/game.json\"`. |\n| `--out` | `-o` | Path to the output direcory, where the game will be exported. Defaults to `\"./Exported\"`. |\n| `--build` | `-b` | The build type. It can be `\"electron\"`, `\"cordova\"` or `\"facebook\"`. If not specified or invalid, will export to HTML5. |\n| `--version` | `--tag`, `-v`, `-t` | The GDevelop version to use for exporting. It uses the github release tag (for example `v5.0.0-beta103`). Uses the latest release by default. |\n| `--verbose` | None | This flag enables showing logs from GDCore. |\n\n#### Configuration file\nYou can add a configuration file to specify the gdexporter options. It has to be named `gdexport.config.js` and to be in the directory of execution of gdexporter. It is the recommended way to specify plugins.\n\nExample configuration file:\n```js\nmodule.exports = {\n  project: \"./game.json\",\n  output: \"./dist\",\n  buildType: \"electron\",\n  gdevelopVersion: \"v5.0.0-beta105\",\n  plugins: [\n    require(\"myPlugin\"),\n    {\n      plugin: require(\"./myOtherPlugin\"),\n      options: {\n        foo: \"bar\",\n      },\n    },\n  ],\n}\n```\n\n## Programmatic API\nYou can import the module to export a game programatically.  \nExample:\n```js\nconst exporter = require(\"gdexporter\");\n\nexporter(\"path/to/game.json\", \"path/to/export/directory\", {\n  buildType: \"electron\",\n  gdevelopVersion: \"v5.0.0-beta103\",\n  plugins: [\n    require(\"myPlugin\"),\n    {\n      plugin: require(\"./myOtherPlugin\"),\n      options: {\n        foo: \"bar\",\n      },\n    },\n  ],\n}).then(() =\u003e console.log(\"Done!\"));\n```\n\n## Plugins\nIt is possible to make plugins for gdexporter easily. A gdexporter plugin is a function that returns an object containing callback functions to call at certain points of the exportation. Plugin options are passed to the function. Here is an example plugin that modifies the project name:\n```js\nmodule.exports = ({ name }) =\u003e ({\n  preExport: (project) =\u003e project.setName(name || \"ProjectName\"),\n})\n```\nIf this plugin is used like this:\n```js\nmodule.exports = {\n  buildType: \"electron\",\n  gdevelopVersion: \"v5.0.0-beta105\",\n  plugins: [\n    {\n      plugin: require(\"./myPlugin\"),\n      options: {\n        name: \"Awesome Project\"\n      }\n    },\n  ],\n}\n```\nThen the exported project would have as name \"Awesome Project\".\n\n\nThe available callbacks functions are:\n\n#### `preExport(project: gd.Project)`\nCalled with the gd.Project before exporting to preprocess the project.\n\n#### `document(document: JSDom.window.Document)`\nCalled with a fake `document` after the export to modify the index.html. Using this to modify the index.html reduces the chances of a conflict between plugins.\n\n#### `postExport(exportPath: string)`\nCalled with the path to the exported files after all other operations.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthuro555%2Fgdexporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthuro555%2Fgdexporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthuro555%2Fgdexporter/lists"}