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

[v4] Use prepack and postpack #1196

Merged
merged 3 commits into from
Jul 2, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ts/blueprints/ember-cli-typescript/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ module.exports = {

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the comment on 193 any more? 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, lol, I meant to delete it!

this._addScript(pkg.scripts, 'prepack', 'ember ts:precompile');
this._addScript(pkg.scripts, 'postpack', 'ember ts:clean');

// avoid being placed in devDependencies
if (pkg.devDependencies[ADDON_NAME]) {
Expand Down
8 changes: 4 additions & 4 deletions ts/tests/blueprints/ember-cli-typescript-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ describe('Acceptance: ember-cli-typescript generator', function () {
expect(pkg).to.exist;

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

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