Skip to content

Commit

Permalink
Unify a prepack command for packages
Browse files Browse the repository at this point in the history
  • Loading branch information
takameyer committed Oct 31, 2023
1 parent 7c11ceb commit 6154594
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ jobs:
- name: Install node modules
run: npm ci --ignore-scripts

- name: Bundle package
run: npm run bundle --workspace=${{env.PACKAGE_NAME}}
- name: Prepack package
run: npm run prepack --workspace=${{env.PACKAGE_NAME}}

- name: Read version
id: get-version
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"bundle": "wireit",
"prepack": "wireit",
"test": "wireit"
},
"wireit": {
"bundle": {
"prepack": {
"command": "tsc -p tsconfig.build.json",
"files": [
"tsconfig.build.json",
Expand Down
1 change: 1 addition & 0 deletions packages/realm-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"./dist/bundle.d.ts": "./dist/bundle.dom.d.ts"
},
"scripts": {
"prepack": "npm run bundle",
"bundle": "wireit",
"lint": "eslint --ext .js,.ts .",
"test": "mocha 'src/**/*.test.ts'"
Expand Down
3 changes: 2 additions & 1 deletion packages/realm-network-transport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
"./dist/bundle.d.ts": "./dist/bundle.dom.d.ts"
},
"scripts": {
"prepack": "npm run bundle",
"bundle": "wireit",
"lint": "eslint --ext .js,.ts .",
"test": "mocha 'src/**/*.test.ts'"
},
"wireit": {
"bundle": {
"prepack": {
"command": "rollup --config",
"dependencies": [
"generate-types",
Expand Down
12 changes: 12 additions & 0 deletions packages/realm-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"source": "src/index.tsx",
"scripts": {
"bundle": "wireit",
"prepack": "npm run bundle",
"start": "npm run bundle -- --watch",
"test": "wireit",
"lint": "eslint --ext .tsx .",
Expand All @@ -18,6 +19,7 @@
"bundle": {
"command": "rollup --config && tsc -p tsconfig.types.json",
"dependencies": [
"generate-types",
"../realm:bundle",
"../realm-common:bundle"
],
Expand All @@ -30,6 +32,16 @@
"dist"
]
},
"generate-types": {
"command": "tsc -p tsconfig.types.json",
"files": [
"src/**/*.ts"
],
"output": [
"dist/**/*.d.ts",
"dist/**/*.d.ts.map"
]
},
"test": {
"command": "jest --forceExit",
"dependencies": [
Expand Down
4 changes: 2 additions & 2 deletions packages/realm-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"dist"
],
"scripts": {
"build": "wireit",
"prepack": "wireit",
"lint": "eslint --ext .js,.ts .",
"test": "echo \"Error: no test specified\" && exit 1"
},
"wireit": {
"build": {
"prepack": {
"command": "tsc -p tsconfig.build.json",
"dependencies": [
"../realm:bundle"
Expand Down
5 changes: 2 additions & 3 deletions packages/realm-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@
"./dist/bundle.es.js": "./dist/bundle.dom.es.js"
},
"scripts": {
"prepack": "npm run build",
"bundle": "wireit",
"prepack": "wireit",
"start": "npm run build -- --watch",
"lint": "eslint --ext .js,.ts .",
"test": "mocha 'src/tests/**/*.test.ts'",
"postversion": "ts-node --project scripts/tsconfig.json scripts/postversion.ts",
"docs": "wireit"
},
"wireit": {
"bundle": {
"prepack": {
"command": "rollup --config",
"dependencies": [
"generate-types"
Expand Down

0 comments on commit 6154594

Please sign in to comment.