@startupjs/cli 0.45.0 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +38 -19
- package/package.json +4 -2
package/index.js
CHANGED
|
@@ -28,6 +28,19 @@ try {
|
|
|
28
28
|
PATCHES_DIR = './patches'
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
let PATCHES_GESTURE_HANDLER_DIR
|
|
32
|
+
try {
|
|
33
|
+
PATCHES_GESTURE_HANDLER_DIR = path.join(
|
|
34
|
+
path.dirname(require.resolve('@startupjs/patches')),
|
|
35
|
+
'patches_gestureHandler'
|
|
36
|
+
)
|
|
37
|
+
// patch-package requires the path to be relative
|
|
38
|
+
PATCHES_GESTURE_HANDLER_DIR = path.relative(process.cwd(), PATCHES_GESTURE_HANDLER_DIR)
|
|
39
|
+
} catch (err) {
|
|
40
|
+
console.error(err)
|
|
41
|
+
console.error('ERROR!!! Gesture handler patches not found.')
|
|
42
|
+
}
|
|
43
|
+
|
|
31
44
|
const LINK = !!process.env.LINK
|
|
32
45
|
const LOCAL_DIR = process.env.LOCAL_DIR || '.'
|
|
33
46
|
|
|
@@ -48,7 +61,7 @@ const DEV_DEPENDENCIES = [
|
|
|
48
61
|
'eslint-config-standard-react',
|
|
49
62
|
'eslint-plugin-import',
|
|
50
63
|
'eslint-plugin-import-helpers',
|
|
51
|
-
'eslint-plugin-
|
|
64
|
+
'eslint-plugin-n',
|
|
52
65
|
'eslint-plugin-promise',
|
|
53
66
|
'eslint-plugin-react',
|
|
54
67
|
'eslint-plugin-react-pug',
|
|
@@ -86,13 +99,13 @@ SCRIPTS_ORIG.web = ({ reset, vite, webpack } = {}) => {
|
|
|
86
99
|
}
|
|
87
100
|
|
|
88
101
|
SCRIPTS_ORIG.webVite = ({ reset } = {}) => oneLine(`
|
|
89
|
-
${reset ? '
|
|
90
|
-
VITE_WEB=1
|
|
102
|
+
${reset ? 'rimraf node_modules/.vite_opt_cache &&' : ''}
|
|
103
|
+
cross-env VITE_WEB=1
|
|
91
104
|
vite
|
|
92
105
|
`)
|
|
93
106
|
|
|
94
107
|
SCRIPTS_ORIG.webWebpack = oneLine(`
|
|
95
|
-
WEBPACK_DEV=1
|
|
108
|
+
cross-env WEBPACK_DEV=1
|
|
96
109
|
webpack-dev-server --config webpack.web.config.cjs
|
|
97
110
|
`)
|
|
98
111
|
|
|
@@ -148,12 +161,12 @@ SCRIPTS_ORIG.testBuild = appName => oneLine(`
|
|
|
148
161
|
`)
|
|
149
162
|
|
|
150
163
|
SCRIPTS_ORIG.testIos = (appName, artifacts, updateScreenshot) => oneLine(`
|
|
151
|
-
${updateScreenshot ? `
|
|
164
|
+
${updateScreenshot ? `rimraf \`find ${ROOT_PATH} -name "__image_snapshots__" -type d\` &&` : ''}
|
|
152
165
|
concurrently
|
|
153
166
|
-s first -k -n "S,T"
|
|
154
167
|
-c white,cyan.bgBlue
|
|
155
168
|
"mongo ${appName}_test --eval 'db.dropDatabase();'
|
|
156
|
-
&& ASYNC=1 startupjs build
|
|
169
|
+
&& cross-env ASYNC=1 startupjs build
|
|
157
170
|
&& PORT=3001 MONGO_URL=mongodb://localhost:27017/${appName}_test startupjs start-production"
|
|
158
171
|
"${SCRIPTS_ORIG.testJsBundle(appName)}
|
|
159
172
|
&& wait-on http://localhost:3001
|
|
@@ -164,7 +177,7 @@ SCRIPTS_ORIG.testIos = (appName, artifacts, updateScreenshot) => oneLine(`
|
|
|
164
177
|
|
|
165
178
|
SCRIPTS_ORIG.testJsBundle = appName => oneLine(`
|
|
166
179
|
mkdir -p ios/build/Build/Products/Release-iphonesimulator/${appName}.app/
|
|
167
|
-
&& APP_ENV=detox react-native bundle
|
|
180
|
+
&& cross-env APP_ENV=detox react-native bundle
|
|
168
181
|
--entry-file="index.js"
|
|
169
182
|
--bundle-output="./ios/build/Build/Products/Release-iphonesimulator/${appName}.app/main.jsbundle"
|
|
170
183
|
--reset-cache --dev=false
|
|
@@ -181,7 +194,7 @@ SCRIPTS_ORIG.server = ({ inspect, vite, webpack, pure } = {}) => {
|
|
|
181
194
|
}
|
|
182
195
|
|
|
183
196
|
SCRIPTS_ORIG.serverPure = ({ inspect, vite } = {}) => oneLine(`
|
|
184
|
-
${vite ? 'VITE=1' : ''}
|
|
197
|
+
${vite ? 'cross-env VITE=1' : ''}
|
|
185
198
|
nodemon
|
|
186
199
|
--experimental-specifier-resolution=node
|
|
187
200
|
${inspect ? '--inspect' : ''}
|
|
@@ -207,14 +220,14 @@ SCRIPTS_ORIG.serverWebpack = (options) => oneLine(`
|
|
|
207
220
|
`)
|
|
208
221
|
|
|
209
222
|
SCRIPTS_ORIG.serverWebpackBuild = oneLine(`
|
|
210
|
-
WEBPACK_DEV=1
|
|
223
|
+
cross-env WEBPACK_DEV=1
|
|
211
224
|
webpack --watch --config webpack.server.config.cjs
|
|
212
225
|
`)
|
|
213
226
|
|
|
214
227
|
SCRIPTS_ORIG.serverWebpackRun = ({ inspect, vite }) => oneLine(`
|
|
215
|
-
|
|
228
|
+
rimraf ./build/server.dev.cjs &&
|
|
216
229
|
just-wait -t 1000 --pattern ./build/server.dev.cjs &&
|
|
217
|
-
${vite ? 'VITE=1' : ''}
|
|
230
|
+
${vite ? 'cross-env VITE=1' : ''}
|
|
218
231
|
nodemon
|
|
219
232
|
--experimental-specifier-resolution=node
|
|
220
233
|
${inspect ? '--inspect' : ''}
|
|
@@ -236,7 +249,7 @@ SCRIPTS_ORIG.start = (options = {}) => {
|
|
|
236
249
|
|
|
237
250
|
SCRIPTS_ORIG.startPure = (...args) => oneLine(`
|
|
238
251
|
concurrently
|
|
239
|
-
-s first -k -n 'Server,
|
|
252
|
+
-s first -k -n 'Server,Web'
|
|
240
253
|
-c cyan.bgBlue,gray
|
|
241
254
|
"${SCRIPTS_ORIG.server(...args)}"
|
|
242
255
|
"${SCRIPTS_ORIG.web(...args)}"
|
|
@@ -245,7 +258,7 @@ SCRIPTS_ORIG.startPure = (...args) => oneLine(`
|
|
|
245
258
|
SCRIPTS_ORIG.startWebpack = (options) => oneLine(`
|
|
246
259
|
concurrently
|
|
247
260
|
-p "{name}:"
|
|
248
|
-
-s first -k -n 'Server,
|
|
261
|
+
-s first -k -n 'Server,ServerBuild,Web'
|
|
249
262
|
-c cyan.bgBlue.bold,gray,gray
|
|
250
263
|
"${SCRIPTS_ORIG.serverWebpackRun(options)}"
|
|
251
264
|
"${SCRIPTS_ORIG.serverWebpackBuild}"
|
|
@@ -255,9 +268,9 @@ SCRIPTS_ORIG.startWebpack = (options) => oneLine(`
|
|
|
255
268
|
// Production build
|
|
256
269
|
|
|
257
270
|
SCRIPTS_ORIG.build = ({ async, pure } = {}) => oneLine(`
|
|
258
|
-
|
|
271
|
+
rimraf ./build &&
|
|
259
272
|
${pure ? '' : 'webpack --config webpack.server.config.cjs &&'}
|
|
260
|
-
${async ? 'ASYNC=1' : ''}
|
|
273
|
+
${async ? 'cross-env ASYNC=1' : ''}
|
|
261
274
|
webpack --config webpack.web.config.cjs
|
|
262
275
|
`)
|
|
263
276
|
|
|
@@ -270,14 +283,14 @@ SCRIPTS_ORIG.startProduction = ({ pure }) => {
|
|
|
270
283
|
}
|
|
271
284
|
|
|
272
285
|
SCRIPTS_ORIG.startProductionPure = oneLine(`
|
|
273
|
-
NODE_ENV=production
|
|
286
|
+
cross-env NODE_ENV=production
|
|
274
287
|
node
|
|
275
288
|
--experimental-specifier-resolution=node
|
|
276
289
|
server.js
|
|
277
290
|
`)
|
|
278
291
|
|
|
279
292
|
SCRIPTS_ORIG.startProductionWebpack = oneLine(`
|
|
280
|
-
NODE_ENV=production
|
|
293
|
+
cross-env NODE_ENV=production
|
|
281
294
|
node
|
|
282
295
|
--experimental-specifier-resolution=node
|
|
283
296
|
-r source-map-support/register
|
|
@@ -288,12 +301,18 @@ SCRIPTS_ORIG.patchPackage = () => oneLine(`
|
|
|
288
301
|
npx patch-package --patch-dir ${PATCHES_DIR}
|
|
289
302
|
`)
|
|
290
303
|
|
|
304
|
+
SCRIPTS_ORIG.patchGestureHandler = () => PATCHES_GESTURE_HANDLER_DIR
|
|
305
|
+
? oneLine(`
|
|
306
|
+
(cat package.json | grep -q react-native-gesture-handler && npx patch-package --patch-dir ${PATCHES_GESTURE_HANDLER_DIR} || true)
|
|
307
|
+
`)
|
|
308
|
+
: 'true'
|
|
309
|
+
|
|
291
310
|
SCRIPTS_ORIG.fonts = () => oneLine(`
|
|
292
311
|
react-native-asset
|
|
293
312
|
`)
|
|
294
313
|
|
|
295
314
|
SCRIPTS_ORIG.postinstall = () => oneLine(`
|
|
296
|
-
${SCRIPTS_ORIG.patchPackage()} && ${SCRIPTS_ORIG.fonts()}
|
|
315
|
+
${SCRIPTS_ORIG.patchPackage()} && ${SCRIPTS_ORIG.fonts()} && ${SCRIPTS_ORIG.patchGestureHandler()}
|
|
297
316
|
`)
|
|
298
317
|
|
|
299
318
|
const SCRIPTS = {
|
|
@@ -339,7 +358,7 @@ const TEMPLATES = {
|
|
|
339
358
|
'@react-native-picker/picker@^1.16.1',
|
|
340
359
|
'react-native-collapsible@^1.6.0',
|
|
341
360
|
'react-native-color-picker@^0.6.0',
|
|
342
|
-
'react-native-gesture-handler
|
|
361
|
+
'react-native-gesture-handler@1.10.3',
|
|
343
362
|
'react-native-pager-view@^5.1.2',
|
|
344
363
|
'react-native-tab-view@^3.0.0'
|
|
345
364
|
// === END UI PEER DEPS ===
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startupjs/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"description": "start, watch and build startupjs project",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {},
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"commander": "^3.0.1",
|
|
13
13
|
"concurrently": "^6.4.0",
|
|
14
|
+
"cross-env": "^7.0.3",
|
|
14
15
|
"execa": "^2.0.4",
|
|
15
16
|
"fonteditor-core": "2.1.3",
|
|
16
17
|
"glob": "^7.1.6",
|
|
@@ -18,11 +19,12 @@
|
|
|
18
19
|
"lodash": "^4.17.20",
|
|
19
20
|
"nodemon": "^1.19.2",
|
|
20
21
|
"react-native-asset": "2.0.1",
|
|
22
|
+
"rimraf": "^3.0.2",
|
|
21
23
|
"source-map-support": "^0.5.19",
|
|
22
24
|
"wait-on": "^5.2.1",
|
|
23
25
|
"webpack": "^5.60.0",
|
|
24
26
|
"webpack-cli": "^4.9.1",
|
|
25
27
|
"webpack-dev-server": "^4.4.0"
|
|
26
28
|
},
|
|
27
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "ed6ce68f7d673bb2dbcc986d49eb7eebcf6f3180"
|
|
28
30
|
}
|