-
Notifications
You must be signed in to change notification settings - Fork 28
Scripts: Add support for lint-pkg-json script #128
Conversation
Codecov Report
@@ Coverage Diff @@
## master #128 +/- ##
========================================
- Coverage 67.53% 67% -0.54%
========================================
Files 57 58 +1
Lines 690 697 +7
Branches 144 145 +1
========================================
+ Hits 466 467 +1
- Misses 182 187 +5
- Partials 42 43 +1
Continue to review full report at Codecov.
|
packages/scripts/README.md
Outdated
### `wp-scripts lint-pkg-json` | ||
|
||
Helps enforce standards for your package.json file. It uses [npm-package-json-lint](https://www.npmjs.com/package/npm-package-json-lint) with the set of default rules provided. You can override them with your own rules as described in [npm-package-json-lint wiki](https://github.com/tclindner/npm-package-json-lint/wiki). | ||
|
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.
Let's include an example here:
"scripts": {
"lint:pkg-json": "wp-scripts lint-pkg-json ."
},
Without the .
at the end of the command this error is displayed: No lint targets provided
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.
Yes, good call. We can make sure it is provided as default instead. What do you think?
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.
By default is a good idea if it can be overridden using packages/
for example with Lerna repos.
Regardless of that though we should include some basic docs here in the readme
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.
Yes, let's start with your example and iterate :)
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.
The docs request isn't a blocker for this to merge.
We should also look add more tests in the future
That's always the hardest part with CLI scripts - more mocking than actual testing :D |
@@ -1,3 +1,7 @@ | |||
## 1.2.0 (2018-05-23) |
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.
I think we will wait for license checker before we release 1.2.0
.
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.
I think we will wait for license checker before we release
1.2.0
.
So will this or won't this be published on 2018-05-23
? I think we should either:
- Not compile
CHANGELOG.md
edits until immediately before a published release.- This is what I thought had been settled upon in a previous core-js meeting (reference)
- Not merge with an explicit date for a version until the date is known (either omit entirely, or a placeholder value like "Unreleased" or "TBD").
Regardless, we should codify this in CONTRIBUTING.md
workflow documentation.
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.
Yes, Unreleased
seems like a good choice in this case. I can publish new version just to make sure it doesn't lie 😄
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.
For the record, it is still unpublished, we should update docs and follow the flow @aduth described 👍
Follow-up for #119.
This PR adds a new script to
@wordpress/scripts
. It follows what we have already fornpm test
and introduceswp-scripts lint-pkg-json
which helps enforce standards for your package.json file.This change is required to make it available in Gutenberg, to make sure that packages published to npm follow the same setup as we have in this repository.
Testing
npm run lint:pkg-json
- it should work as before. To test it try to change anypackage.json
file in thepackages
folder.