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

chore: add grunt build step to npm run release #844

Merged
merged 1 commit into from
May 1, 2018
Merged
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
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,20 @@
],
"main": "axe.js",
"typings": "axe.d.ts",
"standard-version": {
"scripts": {
"postbump": "npm run sri-update"
}
},
"scripts": {
"build": "grunt",
"test": "grunt test",
"test-fast": "grunt test-fast",
"version": "echo \"use 'npm run release' to bump axe-core version\" && exit 1",
"prepublishOnly": "grunt build",
"postinstall": "node build/utils/postinstall.js",
"release": "standard-version && node build/sri-update"
Copy link
Member

Choose a reason for hiding this comment

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

Maybe make grunt build a prerelease step instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There isn't an npm prerelease script, so we'd have to make one...but it would only have one thing in it. We do also call grunt build on prepublishOnly so we don't publish without building first. But honestly I don't see what a custom script would gain us since this is such a simple change.

https://docs.npmjs.com/misc/scripts

Copy link
Member

@stephenmathieson stephenmathieson Apr 16, 2018

Choose a reason for hiding this comment

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

The benefit of using a prerelease here is it's much easier to edit/read since we've already got several commands here.


If you add a pre before a custom script, npm will respect it.

With a package.json that looks like:

  "scripts": {
    "prerelease": "echo prerelease",
    "release": "echo release"
  },

Running npm run release will output both prerelease and release:

∴ npm run release

> foo@1.0.0 prerelease /Users/stephen/foo
> echo prerelease

prerelease

> foo@1.0.0 release /Users/stephen/foo
> echo release

release

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm still not really seeing what this will gain us. It also doesn't address prepublishOnly, which isn't the same context as release

Copy link
Member

Choose a reason for hiding this comment

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

The only reason I'm suggesting this (see previous comment) is that it'll make the release script easier to read/edit.

Really not a big deal tho

"release": "standard-version -a",
"sri-update": "grunt build && node build/sri-update && git add sri-history.json"
},
"devDependencies": {
"angular-precommit": "^1.0.3",
Expand Down Expand Up @@ -91,4 +97,4 @@
"standard-version": "^4.2.0"
},
"dependencies": {}
}
}