Skip to content

Commit

Permalink
[meta] copy LICENSE file to all npm packages on prepublish
Browse files Browse the repository at this point in the history
  • Loading branch information
opichals authored and ljharb committed Jan 6, 2020
1 parent cd25d9d commit ed41b9c
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ coverage
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Copied from ./LICENSE for the npm module releases
memo-parser/LICENSE
resolvers/node/LICENSE
resolvers/webpack/LICENSE
utils/LICENSE
memo-parser/.npmrc
resolvers/node/.npmrc
resolvers/webpack/.npmrc
utils/.npmrc

# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ matrix:

before_install:
- 'nvm install-latest-npm'
- 'npm run copy-metafiles'
- 'if [ -n "${PACKAGE-}" ]; then cd "${PACKAGE}"; fi'
install:
- npm install
- 'npm install'
- 'if [ -n "${ESLINT_VERSION}" ]; then ./tests/dep-time-travel.sh; fi'

script:
Expand Down
1 change: 1 addition & 0 deletions memo-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"description": "Memoizing wrapper for any ESLint-compatible parser module.",
"main": "index.js",
"scripts": {
"prepublishOnly": "cp ../{LICENSE,.npmrc} ./",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
"memo-parser"
],
"scripts": {
"build": "babel --quiet --out-dir lib src",
"prebuild": "rimraf lib",
"build": "babel --quiet --out-dir lib src",
"postbuild": "npm run copy-metafiles",
"copy-metafiles": "for DIR in memo-parser resolvers/node resolvers/webpack utils; do cp LICENSE .npmrc \"${DIR}/\"; done",
"watch": "npm run mocha -- --watch tests/src",
"pretest": "linklocal",
"posttest": "eslint .",
Expand Down
1 change: 0 additions & 1 deletion resolvers/node/.npmrc

This file was deleted.

1 change: 1 addition & 0 deletions resolvers/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"index.js"
],
"scripts": {
"prepublishOnly": "cp ../{LICENSE,.npmrc} ./",
"test": "nyc mocha",
"coveralls": "nyc report --reporter lcovonly && cd ../.. && coveralls < ./resolvers/node/coverage/lcov.info"
},
Expand Down
1 change: 0 additions & 1 deletion resolvers/webpack/.npmrc

This file was deleted.

1 change: 1 addition & 0 deletions resolvers/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Resolve paths to dependencies, given a webpack.config.js. Plugin for eslint-plugin-import.",
"main": "index.js",
"scripts": {
"prepublishOnly": "cp ../{LICENSE,.npmrc} ./",
"test": "nyc mocha -t 5s",
"report": "nyc report --reporter=html",
"coveralls": "nyc report --reporter lcovonly && cd ../.. && coveralls < ./resolvers/webpack/coverage/lcov.info"
Expand Down
1 change: 0 additions & 1 deletion utils/.npmrc

This file was deleted.

1 change: 1 addition & 0 deletions utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"node": ">=4"
},
"scripts": {
"prepublishOnly": "cp ../{LICENSE,.npmrc} ./",
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
Expand Down

0 comments on commit ed41b9c

Please sign in to comment.