@tarojs/rn-runner 3.6.0-canary.1 → 3.6.0-canary.11

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/dist/index.js CHANGED
@@ -33,6 +33,8 @@ function confirmFiles() {
33
33
  });
34
34
  });
35
35
  }
36
+ const isWin = /^win/.test(process.platform);
37
+ const npxCmd = isWin ? 'npx.cmd' : 'npx';
36
38
  function build(_appPath, config) {
37
39
  return __awaiter(this, void 0, void 0, function* () {
38
40
  process.env.TARO_ENV = 'rn';
@@ -44,7 +46,7 @@ function build(_appPath, config) {
44
46
  cliParams.push('--reset-cache');
45
47
  }
46
48
  if (config.publicPath) {
47
- cliParams.push('--public-path', config.publicPath);
49
+ process.env.PUBLIC_PATH = config.publicPath;
48
50
  }
49
51
  const onFinish = function (error) {
50
52
  if (typeof config.onBuildFinish === 'function') {
@@ -65,7 +67,7 @@ function build(_appPath, config) {
65
67
  cliParams.push('--port', config.port);
66
68
  }
67
69
  try {
68
- (0, child_process_1.spawn)('npx', ['react-native', 'start'].concat(cliParams), {
70
+ (0, child_process_1.spawn)(npxCmd, ['react-native', 'start'].concat(cliParams), {
69
71
  stdio: 'inherit'
70
72
  });
71
73
  if (config.qr) {
@@ -82,9 +84,9 @@ function build(_appPath, config) {
82
84
  else {
83
85
  const defaultOutputDir = (0, path_1.join)(process.cwd(), config.outputRoot || 'dist');
84
86
  const defaultBundleOutput = (0, path_1.join)(defaultOutputDir, 'index.bundle');
85
- const bundleOutput = config.bundleOutput ? config.bundleOutput : (isIos ? config.output.ios : config.output.android);
87
+ const bundleOutput = (config.bundleOutput ? config.bundleOutput : (isIos ? config.output.ios : config.output.android)) || defaultBundleOutput;
86
88
  fse.ensureDirSync((0, path_1.dirname)(bundleOutput));
87
- cliParams.push('--bundle-output', bundleOutput || defaultBundleOutput);
89
+ cliParams.push('--bundle-output', bundleOutput);
88
90
  const sourcemapOutput = config.sourcemapOutput ? config.sourcemapOutput : (isIos ? config.output.iosSourcemapOutput : config.output.androidSourcemapOutput);
89
91
  if (sourcemapOutput) {
90
92
  cliParams.push('--sourcemap-output', sourcemapOutput);
@@ -97,10 +99,11 @@ function build(_appPath, config) {
97
99
  if (sourcemapSourcesRoot) {
98
100
  cliParams.push('--sourcemap-sources-root', sourcemapSourcesRoot);
99
101
  }
100
- const assetsDest = config.assetsDest ? config.assetsDest : (isIos ? config.output.iosAssetsDest : config.output.androidAssetsDest);
101
- cliParams.push('--assets-dest', assetsDest || defaultOutputDir);
102
+ const assetsDest = (config.assetsDest ? config.assetsDest : (isIos ? config.output.iosAssetsDest : config.output.androidAssetsDest)) || defaultOutputDir;
103
+ cliParams.push('--assets-dest', assetsDest);
104
+ fse.ensureDirSync(assetsDest);
102
105
  try {
103
- (0, child_process_1.spawn)('npx', [
106
+ (0, child_process_1.spawn)(npxCmd, [
104
107
  'react-native',
105
108
  'bundle',
106
109
  '--platform',
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uDAA8D;AAC9D,iDAAqC;AACrC,2BAAwC;AACxC,gCAA+B;AAC/B,+BAAoC;AAEpC,8DAAqD;AAErD,uCAAuC;AACvC,MAAM,KAAK,GAAG,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAA;AAC7C,SAAS,YAAY;IACnB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACnB,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,CAAA;QAC1C,IAAA,aAAQ,EAAC,IAAA,WAAI,EAAC,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,CAAC,EAAE,QAAQ,EAAE,cAAS,CAAC,aAAa,EAAE,GAAG,CAAC,EAAE;YAC1F,IAAI,GAAG,EAAE;gBACP,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ,EAA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ACP,cAAc;oBACd,UAAU;iBACX,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE;oBACnB,KAAK,EAAE,SAAS;iBACjB,CAAC,CAAA;gBACF,IAAG,MAAM,CAAC,EAAE,EAAE;oBACZ,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;wBAC5B,IAAA,0BAAW,EAAC;4BACV,GAAG,EAAE,YAAY;4BACjB,QAAQ,EAAE,MAAM,CAAC,UAAU;4BAC3B,UAAU,EAAE,UAAU;yBACvB,CAAC,CAAA;oBACJ,CAAC,CAAC,CAAA;iBACH;gBACD,QAAQ,CAAC,IAAI,CAAC,CAAA;aACf;YAAC,OAAM,CAAC,EAAE;gBACT,QAAQ,CAAC,CAAC,CAAC,CAAA;aACZ;SACF;IACH,CAAC;CAAA;AAjGD,wBAiGC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/rn-runner",
3
- "version": "3.6.0-canary.1",
3
+ "version": "3.6.0-canary.11",
4
4
  "description": "ReactNative build tool for taro",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -26,24 +26,24 @@
26
26
  "@rollup/plugin-json": "^4.1.0",
27
27
  "@rollup/plugin-node-resolve": "^13.3.0",
28
28
  "@rollup/plugin-replace": "^4.0.0",
29
- "@tarojs/helper": "3.6.0-canary.1",
30
- "@tarojs/rn-style-transformer": "3.6.0-canary.1",
31
- "@tarojs/rn-supporter": "3.6.0-canary.1",
32
- "@tarojs/rn-transformer": "3.6.0-canary.1",
33
29
  "acorn-jsx": "^5.3.2",
34
30
  "fs-extra": "^8.0.1",
35
31
  "lodash": "^4.17.21",
36
- "rollup-plugin-image-file": "^1.0.2"
32
+ "rollup-plugin-image-file": "^1.0.2",
33
+ "@tarojs/helper": "3.6.0-canary.11",
34
+ "@tarojs/rn-style-transformer": "3.6.0-canary.11",
35
+ "@tarojs/rn-supporter": "3.6.0-canary.11",
36
+ "@tarojs/rn-transformer": "3.6.0-canary.11"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@babel/core": "^7.14.5",
40
40
  "@babel/preset-env": "^7.14.5",
41
41
  "acorn": "^8.0.4",
42
- "expo": "~47.0.1",
42
+ "expo": "~47.0.3",
43
43
  "expo-file-system": "~15.1.1",
44
44
  "react": "18.1.0",
45
45
  "react-is": "^16.13.0",
46
- "react-native": "^0.70.4",
46
+ "react-native": "^0.70.5",
47
47
  "react-native-root-siblings": "^4.1.1",
48
48
  "react-test-renderer": "18.1.0",
49
49
  "rollup": "^2.79.0"
package/src/index.ts CHANGED
@@ -24,6 +24,9 @@ function confirmFiles () {
24
24
  })
25
25
  }
26
26
 
27
+ const isWin = /^win/.test(process.platform)
28
+ const npxCmd = isWin ? 'npx.cmd' : 'npx'
29
+
27
30
  export default async function build (_appPath: string, config: any): Promise<any> {
28
31
  process.env.TARO_ENV = 'rn'
29
32
  const isIos = config.deviceType === 'ios'
@@ -34,7 +37,7 @@ export default async function build (_appPath: string, config: any): Promise<any
34
37
  cliParams.push('--reset-cache')
35
38
  }
36
39
  if (config.publicPath) {
37
- cliParams.push('--public-path', config.publicPath)
40
+ process.env.PUBLIC_PATH = config.publicPath
38
41
  }
39
42
  const onFinish = function (error?) {
40
43
  if (typeof config.onBuildFinish === 'function') {
@@ -57,7 +60,7 @@ export default async function build (_appPath: string, config: any): Promise<any
57
60
  cliParams.push('--port', config.port)
58
61
  }
59
62
  try {
60
- spawn('npx', ['react-native', 'start'].concat(cliParams), {
63
+ spawn(npxCmd, ['react-native', 'start'].concat(cliParams), {
61
64
  stdio: 'inherit'
62
65
  })
63
66
  if(config.qr) {
@@ -72,9 +75,9 @@ export default async function build (_appPath: string, config: any): Promise<any
72
75
  } else {
73
76
  const defaultOutputDir = join(process.cwd(), config.outputRoot || 'dist')
74
77
  const defaultBundleOutput = join(defaultOutputDir, 'index.bundle')
75
- const bundleOutput = config.bundleOutput ? config.bundleOutput : (isIos ? config.output.ios : config.output.android)
78
+ const bundleOutput = (config.bundleOutput ? config.bundleOutput : (isIos ? config.output.ios : config.output.android)) || defaultBundleOutput
76
79
  fse.ensureDirSync(dirname(bundleOutput))
77
- cliParams.push('--bundle-output', bundleOutput || defaultBundleOutput)
80
+ cliParams.push('--bundle-output', bundleOutput)
78
81
 
79
82
  const sourcemapOutput = config.sourcemapOutput ? config.sourcemapOutput : (isIos ? config.output.iosSourcemapOutput : config.output.androidSourcemapOutput)
80
83
  if (sourcemapOutput) {
@@ -90,11 +93,12 @@ export default async function build (_appPath: string, config: any): Promise<any
90
93
  cliParams.push('--sourcemap-sources-root', sourcemapSourcesRoot)
91
94
  }
92
95
 
93
- const assetsDest = config.assetsDest ? config.assetsDest : (isIos ? config.output.iosAssetsDest : config.output.androidAssetsDest)
94
- cliParams.push('--assets-dest', assetsDest || defaultOutputDir)
96
+ const assetsDest = (config.assetsDest ? config.assetsDest : (isIos ? config.output.iosAssetsDest : config.output.androidAssetsDest)) || defaultOutputDir
97
+ cliParams.push('--assets-dest', assetsDest)
98
+ fse.ensureDirSync(assetsDest)
95
99
 
96
100
  try {
97
- spawn('npx', [
101
+ spawn(npxCmd, [
98
102
  'react-native',
99
103
  'bundle',
100
104
  '--platform',