Skip to content

Commit c6fc8e7

Browse files
committed
refactor: use 'prepare' instead of 'prepack'
1 parent 93f2907 commit c6fc8e7

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

.github/workflows/build-templates.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ jobs:
9595

9696
- name: Build package
9797
run: |
98-
yarn workspace create-react-native-library prepack
98+
yarn workspace create-react-native-library prepare
9999
100100
- name: Get working directory
101101
run: |
@@ -195,7 +195,7 @@ jobs:
195195
- name: Build library
196196
working-directory: ${{ env.work_dir }}
197197
run: |
198-
yarn prepack
198+
yarn prepare
199199
200200
- name: Build example (Web)
201201
working-directory: ${{ env.work_dir }}

.github/workflows/check-project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ jobs:
2424
run: yarn typecheck
2525

2626
- name: Build packages
27-
run: yarn lerna run prepack
27+
run: yarn lerna run prepare

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ yarn add --dev react-native-builder-bob
7878

7979
See options below for more details.
8080

81-
1. Add `bob` to your `prepack` step:
81+
1. Add `bob` to your `prepare` or `prepack` step:
8282

8383
```js
8484
"scripts": {
85-
"prepack": "bob build"
85+
"prepare": "bob build"
8686
}
8787
```
8888

@@ -226,7 +226,7 @@ This builds the project according to the configuration. This is usually run as p
226226

227227
```json
228228
"scripts": {
229-
"prepack": "bob build"
229+
"prepare": "bob build"
230230
}
231231
```
232232

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"scripts": {
1717
"lint": "eslint \"**/*.{js,ts,tsx}\"",
1818
"typecheck": "tsc --noEmit",
19-
"watch": "concurrently 'yarn typecheck --watch' 'lerna run --parallel prepack -- --watch'"
19+
"watch": "concurrently 'yarn typecheck --watch' 'lerna run --parallel prepare -- --watch'"
2020
},
2121
"devDependencies": {
2222
"@arkweid/lefthook": "^0.7.7",

packages/create-react-native-library/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"registry": "https://registry.npmjs.org/"
3838
},
3939
"scripts": {
40-
"prepack": "babel --extensions .ts,.tsx src --out-dir lib --ignore '**/__tests__/**' --source-maps --delete-dir-on-start"
40+
"prepare": "babel --extensions .ts,.tsx src --out-dir lib --ignore '**/__tests__/**' --source-maps --delete-dir-on-start"
4141
},
4242
"dependencies": {
4343
"cross-spawn": "^7.0.3",

packages/create-react-native-library/templates/common/$.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
uses: ./.github/actions/setup
4646

4747
- name: Build package
48-
run: yarn prepack
48+
run: yarn prepare
4949

5050
<% if (project.native) { -%>
5151
build-android:

packages/create-react-native-library/templates/common/$package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"!**/.*"
2828
],
2929
"scripts": {
30+
"example": "yarn workspace <%- project.slug -%>-example",
3031
"test": "jest",
3132
"typecheck": "tsc --noEmit",
3233
"lint": "eslint \"**/*.{js,ts,tsx}\"",
@@ -35,9 +36,8 @@
3536
<% } else { -%>
3637
"clean": "del-cli lib",
3738
<% } -%>
38-
"prepack": "bob build",
39-
"release": "release-it",
40-
"example": "yarn workspace <%- project.slug -%>-example"
39+
"prepare": "bob build",
40+
"release": "release-it"
4141
},
4242
"keywords": [
4343
"react-native",

packages/react-native-builder-bob/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"registry": "https://registry.npmjs.org/"
3434
},
3535
"scripts": {
36-
"prepack": "babel --extensions .ts,.tsx src --out-dir lib --source-maps --delete-dir-on-start"
36+
"prepare": "babel --extensions .ts,.tsx src --out-dir lib --source-maps --delete-dir-on-start"
3737
},
3838
"dependencies": {
3939
"@babel/core": "^7.18.5",

packages/react-native-builder-bob/src/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ yargs
208208
}
209209
}
210210

211-
const prepack = 'bob build';
211+
const prepare = 'bob build';
212212
const files = [
213213
source,
214214
output,
@@ -236,20 +236,20 @@ yargs
236236
}
237237
}
238238

239-
if (pkg.scripts?.prepack && pkg.scripts.prepack !== prepack) {
239+
if (pkg.scripts?.prepare && pkg.scripts.prepare !== prepare) {
240240
const { replace } = await prompts({
241241
type: 'confirm',
242242
name: 'replace',
243-
message: `Your package.json has the 'scripts.prepack' field set to '${pkg.scripts.prepack}'. Do you want to replace it with '${prepack}'?`,
243+
message: `Your package.json has the 'scripts.prepare' field set to '${pkg.scripts.prepare}'. Do you want to replace it with '${prepare}'?`,
244244
initial: true,
245245
});
246246

247247
if (replace) {
248-
pkg.scripts.prepack = prepack;
248+
pkg.scripts.prepare = prepare;
249249
}
250250
} else {
251251
pkg.scripts = pkg.scripts || {};
252-
pkg.scripts.prepack = prepack;
252+
pkg.scripts.prepare = prepare;
253253
}
254254

255255
if (

0 commit comments

Comments
 (0)