-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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: Move to npm scripts #20332
Closed
v4: Move to npm scripts #20332
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,328 @@ | ||
{ | ||
"plugins": [ | ||
"stylelint-scss", | ||
"stylelint-selector-no-utility" | ||
], | ||
"rules": { | ||
"at-rule-blacklist": ["extend"], | ||
"at-rule-name-case": "lower", | ||
"at-rule-name-space-after": "always-single-line", | ||
"at-rule-semicolon-newline-after": "always", | ||
"block-closing-brace-newline-after": "always", | ||
"block-closing-brace-newline-before": "always-multi-line", | ||
"block-closing-brace-space-before": "always-single-line", | ||
"block-no-empty": true, | ||
"block-opening-brace-newline-after": "always-multi-line", | ||
"block-opening-brace-space-after": "always-single-line", | ||
"block-opening-brace-space-before": "always", | ||
"color-hex-case": "lower", | ||
"color-hex-length": "short", | ||
"color-named": "never", | ||
"color-no-invalid-hex": true, | ||
"comment-empty-line-before": [ | ||
"always", | ||
{ | ||
"except": [ | ||
"first-nested" | ||
], | ||
"ignore": [ | ||
"stylelint-commands" | ||
] | ||
} | ||
], | ||
"comment-whitespace-inside": "always", | ||
"declaration-bang-space-after": "never", | ||
"declaration-bang-space-before": "always", | ||
"declaration-block-no-duplicate-properties": [ | ||
true, | ||
{ | ||
"ignore": [ | ||
"consecutive-duplicates" | ||
] | ||
} | ||
], | ||
"declaration-block-no-shorthand-property-overrides": true, | ||
"declaration-block-properties-order": [ | ||
"position", | ||
"top", | ||
"right", | ||
"bottom", | ||
"left", | ||
"z-index", | ||
"display", | ||
"float", | ||
"width", | ||
"min-width", | ||
"max-width", | ||
"height", | ||
"min-height", | ||
"max-height", | ||
"box-sizing", | ||
"padding", | ||
"padding-top", | ||
"padding-right", | ||
"padding-bottom", | ||
"padding-left", | ||
"margin", | ||
"margin-top", | ||
"margin-right", | ||
"margin-bottom", | ||
"margin-left", | ||
"overflow", | ||
"overflow-x", | ||
"overflow-y", | ||
"clip", | ||
"clear", | ||
"font", | ||
"font-family", | ||
"font-size", | ||
"font-style", | ||
"font-weight", | ||
"font-variant", | ||
"font-size-adjust", | ||
"font-stretch", | ||
"font-effect", | ||
"font-emphasize", | ||
"font-emphasize-position", | ||
"font-emphasize-style", | ||
"font-smooth", | ||
"hyphens", | ||
"line-height", | ||
"color", | ||
"text-align", | ||
"text-align-last", | ||
"text-emphasis", | ||
"text-emphasis-color", | ||
"text-emphasis-style", | ||
"text-emphasis-position", | ||
"text-decoration", | ||
"text-indent", | ||
"text-justify", | ||
"text-outline", | ||
"text-overflow", | ||
"text-overflow-ellipsis", | ||
"text-overflow-mode", | ||
"text-shadow", | ||
"text-transform", | ||
"text-wrap", | ||
"letter-spacing", | ||
"word-break", | ||
"word-spacing", | ||
"word-wrap", | ||
"tab-size", | ||
"white-space", | ||
"vertical-align", | ||
"list-style", | ||
"list-style-position", | ||
"list-style-type", | ||
"list-style-image", | ||
"pointer-events", | ||
"fill", | ||
"fill-opacity", | ||
"stroke", | ||
"stroke-opacity", | ||
"stroke-width", | ||
"shape-rendering", | ||
"cursor", | ||
"visibility", | ||
"zoom", | ||
"flex-direction", | ||
"flex-order", | ||
"flex-pack", | ||
"flex-align", | ||
"table-layout", | ||
"empty-cells", | ||
"caption-side", | ||
"border-spacing", | ||
"border-collapse", | ||
"content", | ||
"quotes", | ||
"counter-reset", | ||
"counter-increment", | ||
"resize", | ||
"user-select", | ||
"nav-index", | ||
"nav-up", | ||
"nav-right", | ||
"nav-down", | ||
"nav-left", | ||
"background", | ||
"background-color", | ||
"background-image", | ||
"filter", | ||
"background-repeat", | ||
"background-attachment", | ||
"background-position", | ||
"background-position-x", | ||
"background-position-y", | ||
"background-clip", | ||
"background-origin", | ||
"background-size", | ||
"border", | ||
"border-color", | ||
"border-style", | ||
"border-width", | ||
"border-top", | ||
"border-top-color", | ||
"border-top-style", | ||
"border-top-width", | ||
"border-right", | ||
"border-right-color", | ||
"border-right-style", | ||
"border-right-width", | ||
"border-bottom", | ||
"border-bottom-color", | ||
"border-bottom-style", | ||
"border-bottom-width", | ||
"border-left", | ||
"border-left-color", | ||
"border-left-style", | ||
"border-left-width", | ||
"border-radius", | ||
"border-top-left-radius", | ||
"border-top-right-radius", | ||
"border-bottom-right-radius", | ||
"border-bottom-left-radius", | ||
"border-image", | ||
"border-image-source", | ||
"border-image-slice", | ||
"border-image-width", | ||
"border-image-outset", | ||
"border-image-repeat", | ||
"outline", | ||
"outline-width", | ||
"outline-style", | ||
"outline-color", | ||
"outline-offset", | ||
"box-shadow", | ||
"opacity", | ||
"transition", | ||
"transition-delay", | ||
"transition-timing-function", | ||
"transition-duration", | ||
"transition-property", | ||
"transform", | ||
"transform-origin", | ||
"animation", | ||
"animation-name", | ||
"animation-duration", | ||
"animation-fill-mode", | ||
"animation-play-state", | ||
"animation-timing-function", | ||
"animation-delay", | ||
"animation-iteration-count", | ||
"animation-direction" | ||
], | ||
"declaration-block-semicolon-newline-after": "always", | ||
"declaration-block-semicolon-space-before": "never", | ||
"declaration-block-single-line-max-declarations": 1, | ||
"declaration-block-trailing-semicolon": "always", | ||
"declaration-colon-newline-after": "always-multi-line", | ||
"declaration-colon-space-after": "always-single-line", | ||
"declaration-colon-space-before": "never", | ||
"declaration-property-value-blacklist": { | ||
"/^transition/": [ | ||
"/all/" | ||
], | ||
"/^background/": [ | ||
"http:", | ||
"https:" | ||
], | ||
"/^border/": [ | ||
"none" | ||
], | ||
"/.+/": [ | ||
"initial" | ||
] | ||
}, | ||
"font-family-name-quotes": "always-where-recommended", | ||
"function-calc-no-unspaced-operator": true, | ||
"function-comma-newline-after": "always-multi-line", | ||
"function-comma-space-after": "always-single-line", | ||
"function-comma-space-before": "never", | ||
"function-linear-gradient-no-nonstandard-direction": true, | ||
"function-max-empty-lines": 0, | ||
"function-name-case": "lower", | ||
"function-parentheses-newline-inside": "always-multi-line", | ||
"function-parentheses-space-inside": "never-single-line", | ||
"function-url-quotes": "always", | ||
"function-whitespace-after": "always", | ||
"indentation": 2, | ||
"max-empty-lines": 1, | ||
"max-nesting-depth": 3, | ||
"media-feature-colon-space-after": "always", | ||
"media-feature-colon-space-before": "never", | ||
"media-feature-no-missing-punctuation": true, | ||
"media-feature-parentheses-space-inside": "never", | ||
"media-feature-range-operator-space-after": "always", | ||
"media-feature-range-operator-space-before": "always", | ||
"media-query-list-comma-newline-after": "always-multi-line", | ||
"media-query-list-comma-space-after": "always-single-line", | ||
"media-query-list-comma-space-before": "never", | ||
"no-duplicate-selectors": true, | ||
"no-eol-whitespace": true, | ||
"no-extra-semicolons": true, | ||
"no-missing-end-of-source-newline": true, | ||
"no-unsupported-browser-features": [true, { | ||
"browsers": "> 5%, last 2 firefox versions, last 2 chrome versions, last 2 safari versions, last 2 edge versions, ie 11", | ||
"severity": "warning" | ||
}], | ||
"number-leading-zero": "never", | ||
"number-no-trailing-zeros": true, | ||
"property-case": "lower", | ||
"property-no-vendor-prefix": true, | ||
"rule-nested-empty-line-before": [ | ||
"always-multi-line", | ||
{ | ||
"except": [ | ||
"first-nested" | ||
], | ||
"ignore": [ | ||
"after-comment" | ||
] | ||
} | ||
], | ||
"rule-non-nested-empty-line-before": [ | ||
"always-multi-line", | ||
{ | ||
"ignore": [ | ||
"after-comment" | ||
] | ||
} | ||
], | ||
"scss/selector-no-redundant-nesting-selector": true, | ||
"selector-attribute-brackets-space-inside": "never", | ||
"selector-attribute-operator-space-after": "never", | ||
"selector-attribute-operator-space-before": "never", | ||
"selector-class-pattern": [ | ||
"^(?!(js\\-))[a-z\\-0-9]+$", | ||
{ | ||
"message": "Selector should be written in lowercase with hyphens (selector-class-pattern)" | ||
} | ||
], | ||
"selector-combinator-space-after": "always", | ||
"selector-combinator-space-before": "always", | ||
"selector-list-comma-newline-after": "always", | ||
"selector-list-comma-space-before": "never", | ||
"selector-max-compound-selectors": 3, | ||
"selector-max-empty-lines": 0, | ||
"selector-max-specificity": "0,4,0", | ||
"selector-no-id": true, | ||
"selector-no-qualifying-type": true, | ||
"selector-pseudo-class-case": "lower", | ||
"selector-pseudo-class-parentheses-space-inside": "never", | ||
"selector-pseudo-element-case": "lower", | ||
"selector-pseudo-element-colon-notation": "double", | ||
"selector-pseudo-element-no-unknown": true, | ||
"selector-type-case": "lower", | ||
"shorthand-property-no-redundant-values": true, | ||
"string-no-newline": true, | ||
"string-quotes": "double", | ||
"unit-case": "lower", | ||
"unit-no-unknown": true, | ||
"value-list-comma-newline-after": "always-multi-line", | ||
"value-list-comma-space-after": "always-single-line", | ||
"value-list-comma-space-before": "never", | ||
"value-no-vendor-prefix": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node-sass --output-style expanded --source-map true --precision 6 docs/assets/scss/docs.scss docs/assets/css/docs.css | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node-sass docs/assets/scss/docs.scss | cleancss -o docs/assets/css/docs.min.css --source-map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
postcss --use autoprefixer --autoprefixer.browsers "Chrome >= 35, Firefox >= 38, Edge >= 12, Explorer >= 9, iOS >= 8, Safari >= 8, Android 2.3, Android >= 4, Opera >= 12" --replace docs/assets/css/*.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
stylelint scss/**/*.scss --syntax scss --config scss/.stylelintrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
uglifyjs js/src/util.js \ | ||
js/src/alert.js \ | ||
js/src/button.js \ | ||
js/src/carousel.js \ | ||
js/src/collapse.js \ | ||
js/src/dropdown.js \ | ||
js/src/modal.js \ | ||
js/src/scrollspy.js \ | ||
js/src/tab.js \ | ||
js/src/tooltip.js \ | ||
js/src/popover.js \ | ||
--output dist/js/bootstrap.min.js \ | ||
--compress --mangle --comments /^!|@preserve|@license|@cc_on/i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node-sass scss/bootstrap.scss | cleancss -o dist/css/bootstrap.min.css --source-map |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
postcss --use autoprefixer --autoprefixer.browsers "Chrome >= 35, Firefox >= 38, Edge >= 12, Explorer >= 9, iOS >= 8, Safari >= 8, Android 2.3, Android >= 4, Opera >= 12" --replace dist/css/*.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
stylelint docs/assets/scss/**/*.scss --syntax scss --config scss/.stylelintrc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodemon -e scss -x "npm run build-css" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodemon -e js -w public/js -x "npm run build-js" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably better if you reference the local npm installs of these (in
.bin
) so that people don't need global installs 👍There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this whole approach will have issues on Windows. But I'll try it later
or tomorrow to verify this.
On Jul 20, 2016 22:44, "fat" notifications@github.com wrote:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In https://docs.npmjs.com/cli/run-script, it sounded like if the
devDependency
is there,npm run
will do that for us.Reading that, maybe I just need to add
node-sass
todevDependency
? Again, I've no idea so I'm likely wrong 😁.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true for the case where you call the bin via package.json. Not sure
if it will work here since you call it in a js file. I'll try it when im
home and let you know.
On Jul 20, 2016 23:19, "Mark Otto" notifications@github.com wrote:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running these task files using
npm run *
will run them in thenpm
environment. as you mentioned above @mdohttps://docs.npmjs.com/misc/scripts#environment
Dependency versus DevDependency just has to do with what gets installed when someone using the
npm
package runnpm install you-package
. Only dependencies needed at run-time will be installed on the user's system. DevDependencies will only be installed locally whennpm install
is called within the repository. It's useful / helpful to only include run-time dependencies independencies
so devs know what's needed to be installed.FWIW, bootstrap's run-time dependencies are all bundled in the project's files right? So it shouldn't have really have any
dependencies
.More info on that here: https://docs.npmjs.com/files/package.json#devdependencies