Skip to content
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

0.20.0 release branch (ESM migration) #815

Merged
merged 11 commits into from
Dec 18, 2021
Prev Previous commit
Next Next commit
have init lock step initial version to current Greenwood version (#816)
* have init lock step initial version to current Greenwood version

* set minimum version as formality in template package.json

* grammar
thescientist13 committed Dec 9, 2021
commit 0ee47ad94f0d0305a8912244b91626746c7e70e9
5 changes: 5 additions & 0 deletions packages/init/src/index.js
Original file line number Diff line number Diff line change
@@ -48,6 +48,11 @@ const npmInit = async () => {
// use installation path's folder name for packages
appPkg.name = path.basename(process.cwd());

// make sure users get latest and greatest version of Greenwood
// https://github.com/ProjectEvergreen/greenwood/issues/781
// https://github.com/ProjectEvergreen/greenwood/issues/809
appPkg.devDependencies['@greenwood/cli'] = `~${scriptPkg.version}`;

await fs.writeFileSync(
path.join(TARGET_DIR, 'package.json'),
JSON.stringify(appPkg, null, 2) + os.EOL
2 changes: 1 addition & 1 deletion packages/init/src/template/package.json
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
"serve": "greenwood serve"
},
"devDependencies": {
"@greenwood/cli": "^0.18.0"
"@greenwood/cli": "^0.20.0"
},
"license": "ISC"
}
4 changes: 3 additions & 1 deletion packages/init/test/cases/init.default/init.default.spec.js
Original file line number Diff line number Diff line change
@@ -86,7 +86,9 @@ describe('Scaffold Greenwood With Default Template: ', function() {
});

it('the should have the correct Greenwood devDependency', function() {
expect(pkgJson.devDependencies['@greenwood/cli']).to.equal('^0.18.0');
const scriptPkg = JSON.parse(fs.readFileSync(fileURLToPath(new URL('../../../package.json', import.meta.url)), 'utf-8'));

expect(pkgJson.devDependencies['@greenwood/cli']).to.equal(`~${scriptPkg.version}`);
});
});