{"id":16209820,"url":"https://github.com/joshdholtz/ionic-configurator","last_synced_at":"2025-03-19T08:31:09.219Z","repository":{"id":141821648,"uuid":"119195914","full_name":"joshdholtz/ionic-configurator","owner":"joshdholtz","description":"Configure Ionic (Cordova) config.xml files for individual environments using Mustache templating","archived":false,"fork":false,"pushed_at":"2018-03-28T19:14:33.000Z","size":7,"stargazers_count":8,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-17T05:21:55.246Z","etag":null,"topics":["ionic-cordova","ionic-framework","ionic-plugin","ionic3"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joshdholtz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2018-01-27T19:34:43.000Z","updated_at":"2020-06-23T07:56:32.000Z","dependencies_parsed_at":"2024-05-17T06:45:40.594Z","dependency_job_id":null,"html_url":"https://github.com/joshdholtz/ionic-configurator","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/joshdholtz%2Fionic-configurator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdholtz%2Fionic-configurator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdholtz%2Fionic-configurator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshdholtz%2Fionic-configurator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshdholtz","download_url":"https://codeload.github.com/joshdholtz/ionic-configurator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244389849,"owners_count":20445014,"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":["ionic-cordova","ionic-framework","ionic-plugin","ionic3"],"created_at":"2024-10-10T10:33:12.176Z","updated_at":"2025-03-19T08:31:09.211Z","avatar_url":"https://github.com/joshdholtz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ionic Configurator\nSomewhat easily reconfigure Ionic's `config.xml` for different environments by running `npm run ionic-config \u003cenvironment\u003e`.\n\nView working example: https://github.com/joshdholtz/ionic-configurator-example\n\n## Installation\n```sh\n$: npm install --save-dev https://github.com/joshdholtz/ionic-configurator.git\n```\n\n## Commands\n\n```sh\n$: npm run ionic-config \u003cenvironment\u003e\n```\nwhere `\u003cenvironment\u003e` environment will look for a file `./ionic-configurator/env.\u003cenvironment\u003e.json`\n\n\n## Setup\n\n\n### package.json\nAdd `ionic-config` to your `package.json` scripts. This will allow you to run `npm run ionic-config \u003cenvironment\u003e` instead of having to run `./node_modules/.bin/ionic-config \u003cenvironment\u003e`\n```json\n\"scripts\": {\n    \"ionic-config\": \"ionic-config\"\n}\n```\n\n### ionic-configurator/config.tmpl.xml\nCreate a `config.tmpl.xml` file in the `ionic-configurator` directory. This is the template `config.xml` file that all environment specific `config.xml` files will be made from.\n\nThe `config.tmpl.xml` file uses [Mustache templating](https://github.com/janl/mustache.js)\n\n```xml\n\u003c?xml version='1.0' encoding='utf-8'?\u003e\n\u003cwidget id=\"{{id}}\" version=\"{{version}}\" xmlns=\"http://www.w3.org/ns/widgets\" xmlns:cdv=\"http://cordova.apache.org/ns/1.0\"\u003e\n    \u003c!--- These hooks are used to modify the config.tmpl.xml file when plugins are added and removed  --\u003e\n    \u003chook src=\"ionic-configurator/hooks.js\" type=\"before_plugin_add\" /\u003e\n    \u003chook src=\"ionic-configurator/hooks.js\" type=\"after_plugin_add\" /\u003e\n    \u003chook src=\"ionic-configurator/hooks.js\" type=\"before_plugin_rm\" /\u003e\n    \u003chook src=\"ionic-configurator/hooks.js\" type=\"after_plugin_rm\" /\u003e\n    \u003cname\u003e{{name}}\u003c/name\u003e\n    \u003cdescription\u003e{{description}}\u003c/description\u003e\n    \u003cauthor email=\"hi@ionicframework\" href=\"http://ionicframework.com/\"\u003eIonic Framework Team\u003c/author\u003e\n    \u003ccontent src=\"index.html\" /\u003e\n    ...\n\u003c/widget\u003e\n```\n\n### Environment file\nCreate environment files using the pattern `env.\u003cenvironment\u003e.json` in `ionic-configurator`. These keys should match up with the Mustache templating used in the `config.tmpl.xml` file.\n\n#### ionic-configurator/env.staging.json\n```json\n{\n  \"id\": \"com.joshholtz.staging.IonicApp\",\n  \"version\": \"1.1.2\",\n  \"name\": \"Ionic App (Staging)\",\n  \"description\": \"This awesome Ionic app description \u003c3\"\n}\n\n```\n\n#### ionic-configurator/env.production.json\n```json\n{\n  \"id\": \"com.joshholtz.IonicApp\",\n  \"version\": \"1.1.2\",\n  \"name\": \"Ionic App\",\n  \"description\": \"This awesome Ionic app description \u003c3\"\n}\n\n```\n\n### ionic-configurator/hooks.js\nThis hooks is used when plugins are added and removed. This will temporarily move the template to `config.xml` and then back to `ionic-configurator/config.tmpl.xml` so that the plugin changes are recorded in our templated.\n\n**NOTE:** This will keep the templated config at `config.xml` so you will need to re-run `ionic-config \u003cenvironment\u003e`\n```js\n#!/usr/bin/env node\nmodule.exports = function(ctx) {\n  var Configurator = require('ionic-configurator');\n  Configurator.hook(ctx.hook);\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdholtz%2Fionic-configurator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshdholtz%2Fionic-configurator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshdholtz%2Fionic-configurator/lists"}