Skip to content

Commit 6b97fbd

Browse files
authored
Merge pull request #1196 from typed-ember/use_prepack_and_postpack
Use prepack and postpack instead of prepublishOnly and postpublish
2 parents 53f2b51 + a8086c7 commit 6b97fbd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ts/blueprints/ember-cli-typescript/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ module.exports = {
191191

192192
let pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
193193

194-
// Really `prepack` and `postpack` would be ideal, but yarn doesn't execute those when publishing
195-
this._addScript(pkg.scripts, 'prepublishOnly', 'ember ts:precompile');
196-
this._addScript(pkg.scripts, 'postpublish', 'ember ts:clean');
194+
// As of https://github.com/yarnpkg/yarn/pull/5712 yarn runs `prepack` and `postpack` when publishing
195+
this._addScript(pkg.scripts, 'prepack', 'ember ts:precompile');
196+
this._addScript(pkg.scripts, 'postpack', 'ember ts:clean');
197197

198198
// avoid being placed in devDependencies
199199
if (pkg.devDependencies[ADDON_NAME]) {

ts/tests/blueprints/ember-cli-typescript-test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ describe('Acceptance: ember-cli-typescript generator', function () {
5252
expect(pkg).to.exist;
5353

5454
const pkgJson = JSON.parse(pkg.content);
55-
expect(pkgJson.scripts.prepublishOnly).to.be.undefined;
56-
expect(pkgJson.scripts.postpublish).to.be.undefined;
55+
expect(pkgJson.scripts.prepack).to.be.undefined;
56+
expect(pkgJson.scripts.postpack).to.be.undefined;
5757
expect(pkgJson.devDependencies).to.include.all.keys('ember-cli-typescript-blueprints');
5858
expect(pkgJson.devDependencies).to.include.all.keys('ember-data');
5959
expect(pkgJson.devDependencies).to.include.all.keys('@types/ember-data');
@@ -97,8 +97,8 @@ describe('Acceptance: ember-cli-typescript generator', function () {
9797
expect(pkg).to.exist;
9898

9999
const pkgJson = JSON.parse(pkg.content);
100-
expect(pkgJson.scripts.prepublishOnly).to.equal('ember ts:precompile');
101-
expect(pkgJson.scripts.postpublish).to.equal('ember ts:clean');
100+
expect(pkgJson.scripts.prepack).to.equal('ember ts:precompile');
101+
expect(pkgJson.scripts.postpack).to.equal('ember ts:clean');
102102
expect(pkgJson.dependencies).to.include.all.keys('ember-cli-typescript');
103103
expect(pkgJson.devDependencies).to.not.include.all.keys('ember-cli-typescript');
104104
expect(pkgJson.devDependencies).to.not.have.any.keys('ember-data');

0 commit comments

Comments
 (0)