Skip to content

Commit 474df6b

Browse files
authored
@lavamoat/allow-scripts (#1680)
* Add devDep @lavamoat/allow-scripts * Setup @lavamoat/allow-scripts - https://yarnpkg.com/configuration/yarnrc#enableScripts - https://classic.yarnpkg.com/lang/en/docs/yarnrc - https://classic.yarnpkg.com/lang/en/docs/cli/install/#toc-yarn-install-ignore-scripts * Configure @lavamoat/allow-scripts * Run @lavamoat/allow-scripts in setup npm script after yarn (install) * Run yarn setup npm script in CI * Reconfigure @lavamoat/allow-scripts (fix CI)
1 parent 1df37a1 commit 474df6b

File tree

7 files changed

+577
-21
lines changed

7 files changed

+577
-21
lines changed

β€Ž.github/workflows/android.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
cache: 'gradle'
4040

4141
- name: Install all project dependencies
42-
run: yarn
42+
run: yarn && yarn setup
4343

4444
- name: npx react-native info
4545
run: npx react-native info

β€Ž.github/workflows/ios.ymlβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
build-ios:
1111

1212
runs-on: macos-12
13-
13+
1414
# ruby: 2.7.6, 3.0.4, 3.1.2 (../.ruby-version: 2.7.5)
1515
# CocoaPods: 1.11.3
1616

@@ -24,7 +24,7 @@ jobs:
2424
# node_modules cache
2525

2626
- name: Install all project dependencies
27-
run: yarn
27+
run: yarn && yarn setup
2828

2929
- name: npx react-native info
3030
run: npx react-native info

β€Ž.github/workflows/main.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v3
1818

1919
- name: Install with Yarn
20-
run: yarn
20+
run: yarn && yarn setup
2121

2222
- name: Compile with TypeScript
2323
run: yarn tsc

β€Ž.yarnrcβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ignore-scripts true

β€Ž.yarnrc.ymlβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
nodeLinker: node-modules
22

33
yarnPath: .yarn/releases/yarn-4.0.0-rc.42.cjs
4+
enableScripts: false

β€Žpackage.jsonβ€Ž

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.1",
44
"private": true,
55
"scripts": {
6-
"setup": "yarn",
6+
"setup": "yarn && yarn allow-scripts",
77
"start": "react-native start",
88
"start:reset": "react-native start --reset-cache",
99
"android": "react-native run-android --active-arch-only",
@@ -57,6 +57,8 @@
5757
"@babel/runtime": "7.21.0",
5858
"@curveball/core": "0.21.1",
5959
"@curveball/router": "0.6.0",
60+
"@lavamoat/allow-scripts": "2.3.0",
61+
"@lavamoat/preinstall-always-fail": "1.0.0",
6062
"@react-native-community/cli": "11.1.2",
6163
"@react-native-community/eslint-config": "3.2.0",
6264
"@storybook/addon-actions": "6.5.16",
@@ -153,5 +155,14 @@
153155
"prettier --write"
154156
]
155157
},
156-
"packageManager": "yarn@4.0.0-rc.42"
158+
"packageManager": "yarn@4.0.0-rc.42",
159+
"lavamoat": {
160+
"allowScripts": {
161+
"@lavamoat/preinstall-always-fail": false,
162+
"@storybook/react>@pmmmwh/react-refresh-webpack-plugin>core-js-pure": false,
163+
"@storybook/react>core-js": false,
164+
"@swc/core": false,
165+
"webpack-cli>webpack>watchpack>watchpack-chokidar2>chokidar>fsevents": false
166+
}
167+
}
157168
}

0 commit comments

Comments
Β (0)