-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate manifest.json using package.json data on build? #110
Comments
@lmorchard What fields in manifest.json would be variable?
|
Version's definitely variable - and tracking down errors in the auto-build process & editing the wrong file is what led me to this. As for the rest, the data is all mostly redundant between two JSON files in two different spots. Also potentially inconsistent (e.g. author). Thinking this will all also be useful example stuff for the next Test Pilot experiment. |
Here's a super weak attempt (./bin/sync-manifest.js) which keeps the #!/usr/bin/env node
const { writeFileSync } = require('fs');
const manifestPath = require.resolve('../src/manifest.json');
const { version } = require('../package.json');
const manifest = require(manifestPath);
const data = Object.assign(manifest, { version });
writeFileSync(manifestPath, JSON.stringify(data, null, 2) + '\n'); I imagine it may be easiest to add this to a npm |
We would also want to run it on watch, so that I use the fancy "Load Temporary Add-on" button… 🙂 |
- bin/generate-manifest.js to create dist/manifest.json based on package.json - Remove original src/manifest.json - Move pontoon-to-webext.js into bin/ - NPM script changes to use new scripts Fixes bwinton#110.
- Move most properties of `src/manifest.json` to `webextensionManifest` in `package.json` - `bin/generate-manifest.js` to create `dist/manifest.json` based on `package.json` - Remove original src/manifest.json - Move pontoon-to-webext.js into bin/ - NPM script changes to use new scripts Fixes bwinton#110.
So, with SDK addons, we stick the metadata in
package.json
. For webext, we stick metadata inmanifest.json
. Stubbed my brain on this difference while working on #102 and trying to bump version numbers.Since we have a build process, it might be handy to have
manifest.json
be a templated & generated artifact based on data frompackage.json
.The text was updated successfully, but these errors were encountered: