Skip to content

Fix package build scripts for git-deps and npm-link symlinks #481

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

Closed
wants to merge 6 commits into from
Closed
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
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.DS_STORE
node_modules/
/packages/*/optimizely-*.tgz

npm-debug.log
dist
node_modules
lerna-debug.log

coverage/
dist/

# user-specific ignores ought to be defined in user's `core.excludesfile`
.idea/*
.DS_STORE
14 changes: 7 additions & 7 deletions packages/datafile-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
"test": "__test__"
},
"files": [
"lib",
"LICENSE",
"CHANGELOG",
"README.md",
"package.json"
"lib"
],
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -55,9 +51,13 @@
"@react-native-community/async-storage": "^1.2.0"
},
"scripts": {
"clean": "rm -rf lib",
"lint": "tsc --noEmit && eslint --fix 'src/**/*.ts' '__test__/**/*.ts'",
"test": "jest",
"tsc": "rm -rf lib && tsc",
"prepublishOnly": "npm run lint && npm test && npm run tsc"
"posttest": "npm run lint",
"prebuild": "npm run clean",
Copy link
Contributor

Choose a reason for hiding this comment

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

Is "prebuild" a thing? I don't see it documented here. But it does appear to be working as expected when I run locally.

Copy link
Contributor Author

@jasonkarns jasonkarns May 29, 2020

Choose a reason for hiding this comment

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

Pre and post commands with matching names will be run for those as well (e.g. premyscript, myscript, postmyscript)

(That's in the docs linked)

Any pre* script or post* script will run before (or after, respectively) the same-named script.

With the long-standing bug/quirk that a pre* script won't work if the '*' begins with pre. Was meant to disallow preprefoo running before prefoo which runs before foo. However, it has the unfortunate side effect of disallowing preprepare. Regardless, this is the mechanism that makes preinstall, postinstall, prepublish, postpublish, work. Those aren't special scripts. They work because any pre/post script will run before/after the corresponding script.

"build": "tsc",
"prepare": "npm run build",
"prepublishOnly": "npm test"
}
}
13 changes: 6 additions & 7 deletions packages/event-processor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
"test": "test"
},
"files": [
"lib",
"LICENSE",
"CHANGELOG",
"README.md",
"package.json"
"lib"
],
"scripts": {
"tsc": "rm -rf lib && tsc",
"clean": "rm -rf lib",
"prebuild": "npm run clean",
"build": "tsc",
"test": "jest",
"prepublishOnly": "jest && npm run tsc"
"prepare": "npm run build",
"prepublishOnly": "npm test"
},
"repository": {
"type": "git",
Expand Down
File renamed without changes.
13 changes: 6 additions & 7 deletions packages/logging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
"test": "test"
},
"files": [
"lib",
"LICENSE",
"CHANGELOG",
"README.md",
"package.json"
"lib"
],
"scripts": {
"tsc": "rm -rf lib && tsc",
"clean": "rm -rf lib",
"prebuild": "npm run clean",
"build": "tsc",
"test": "jest",
"prepublishOnly": "jest && npm run tsc"
"prepare": "npm run build",
"prepublishOnly": "npm test"
},
"repository": {
"type": "git",
Expand Down
15 changes: 6 additions & 9 deletions packages/optimizely-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
"typings": "lib/index.d.ts",
"scripts": {
"clean": "rm -rf dist",
"lint": "eslint 'lib/**/*.js'",
"test": "mocha ./lib/*.tests.js ./lib/**/*.tests.js ./lib/**/**/*tests.js --recursive --exit --require esm --require lib/tests/exit_on_unhandled_rejection.js",
"test-ci": "npm run test-xbrowser && npm run test-umdbrowser",
"test-xbrowser": "karma start karma.bs.conf.js --single-run",
"test-umdbrowser": "npm run build-browser-umd && karma start karma.umd.conf.js --single-run",
"prebuild": "npm run clean",
"build": "rollup -c",
"build-browser-umd": "rollup -c --config-umd",
"test-ci": "npm run test-xbrowser && npm run test-umdbrowser",
"lint": "eslint 'lib/**/*.js'",
"cover": "istanbul cover _mocha ./lib/*.tests.js ./lib/**/*.tests.js ./lib/**/**/*tests.js",
"coveralls": "npm run cover -- --report lcovonly && cat ./coverage/lcov.info | coveralls",
"prepublishOnly": "npm run build && npm test && npm run test-xbrowser && npm run test-umdbrowser"
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run test-ci"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -76,11 +77,7 @@
"access": "public"
},
"files": [
"dist/",
"lib/",
"LICENSE",
"CHANGELOG",
"README.md",
"package.json"
"dist",
"lib"
]
}
File renamed without changes.
13 changes: 6 additions & 7 deletions packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
"test": "test"
},
"files": [
"lib",
"LICENSE",
"CHANGELOG",
"README.md",
"package.json"
"lib"
],
"scripts": {
"tsc": "rm -rf lib && tsc",
"clean": "rm -rf lib",
"prebuild": "npm run clean",
"build": "tsc",
"test": "jest",
"prepublishOnly": "jest && npm run tsc"
"prepare": "npm run build",
"prepublishOnly": "npm test"
},
"repository": {
"type": "git",
Expand Down