@nx/expo 16.0.0-beta.1
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/.eslintrc.json +19 -0
- package/CHANGELOG.md +8 -0
- package/LICENSE +22 -0
- package/README.md +63 -0
- package/collection.json +0 -0
- package/docs/build-list-examples.md +71 -0
- package/docs/prebuild-examples.md +70 -0
- package/docs/run-examples.md +91 -0
- package/docs/start-examples.md +98 -0
- package/executors.json +116 -0
- package/generators.json +61 -0
- package/index.d.ts +4 -0
- package/index.js +12 -0
- package/index.js.map +1 -0
- package/migrations.json +734 -0
- package/package.json +59 -0
- package/plugins/jest/svg-mock.d.ts +0 -0
- package/plugins/jest/svg-mock.js +4 -0
- package/plugins/jest/svg-mock.js.map +1 -0
- package/plugins/metro-resolver.d.ts +1 -0
- package/plugins/metro-resolver.js +135 -0
- package/plugins/metro-resolver.js.map +1 -0
- package/plugins/with-nx-metro.d.ts +8 -0
- package/plugins/with-nx-metro.js +31 -0
- package/plugins/with-nx-metro.js.map +1 -0
- package/plugins/with-nx-webpack.d.ts +5 -0
- package/plugins/with-nx-webpack.js +52 -0
- package/plugins/with-nx-webpack.js.map +1 -0
- package/project.json +61 -0
- package/src/executors/build/build.impl.d.ts +6 -0
- package/src/executors/build/build.impl.js +62 -0
- package/src/executors/build/build.impl.js.map +1 -0
- package/src/executors/build/compat.d.ts +2 -0
- package/src/executors/build/compat.js +6 -0
- package/src/executors/build/compat.js.map +1 -0
- package/src/executors/build/schema.d.ts +14 -0
- package/src/executors/build/schema.json +60 -0
- package/src/executors/build-list/build-fragment.d.ts +54 -0
- package/src/executors/build-list/build-list.impl.d.ts +7 -0
- package/src/executors/build-list/build-list.impl.js +86 -0
- package/src/executors/build-list/build-list.impl.js.map +1 -0
- package/src/executors/build-list/compat.d.ts +2 -0
- package/src/executors/build-list/compat.js +6 -0
- package/src/executors/build-list/compat.js.map +1 -0
- package/src/executors/build-list/schema.d.ts +25 -0
- package/src/executors/build-list/schema.json +79 -0
- package/src/executors/download/compat.d.ts +2 -0
- package/src/executors/download/compat.js +6 -0
- package/src/executors/download/compat.js.map +1 -0
- package/src/executors/download/download.impl.d.ts +15 -0
- package/src/executors/download/download.impl.js +101 -0
- package/src/executors/download/download.impl.js.map +1 -0
- package/src/executors/download/schema.d.ts +3 -0
- package/src/executors/download/schema.json +59 -0
- package/src/executors/ensure-symlink/compat.d.ts +2 -0
- package/src/executors/ensure-symlink/compat.js +6 -0
- package/src/executors/ensure-symlink/compat.js.map +1 -0
- package/src/executors/ensure-symlink/ensure-symlink.impl.d.ts +5 -0
- package/src/executors/ensure-symlink/ensure-symlink.impl.js +13 -0
- package/src/executors/ensure-symlink/ensure-symlink.impl.js.map +1 -0
- package/src/executors/ensure-symlink/schema.json +11 -0
- package/src/executors/export/compat.d.ts +2 -0
- package/src/executors/export/compat.js +6 -0
- package/src/executors/export/compat.js.map +1 -0
- package/src/executors/export/export.impl.d.ts +6 -0
- package/src/executors/export/export.impl.js +69 -0
- package/src/executors/export/export.impl.js.map +1 -0
- package/src/executors/export/schema.d.ts +11 -0
- package/src/executors/export/schema.json +48 -0
- package/src/executors/install/compat.d.ts +2 -0
- package/src/executors/install/compat.js +6 -0
- package/src/executors/install/compat.js.map +1 -0
- package/src/executors/install/install.impl.d.ts +7 -0
- package/src/executors/install/install.impl.js +70 -0
- package/src/executors/install/install.impl.js.map +1 -0
- package/src/executors/install/schema.d.ts +7 -0
- package/src/executors/install/schema.json +34 -0
- package/src/executors/prebuild/compat.d.ts +2 -0
- package/src/executors/prebuild/compat.js +6 -0
- package/src/executors/prebuild/compat.js.map +1 -0
- package/src/executors/prebuild/prebuild.impl.d.ts +7 -0
- package/src/executors/prebuild/prebuild.impl.js +70 -0
- package/src/executors/prebuild/prebuild.impl.js.map +1 -0
- package/src/executors/prebuild/schema.d.ts +7 -0
- package/src/executors/prebuild/schema.json +35 -0
- package/src/executors/run/compat.d.ts +2 -0
- package/src/executors/run/compat.js +6 -0
- package/src/executors/run/compat.js.map +1 -0
- package/src/executors/run/run.impl.d.ts +6 -0
- package/src/executors/run/run.impl.js +112 -0
- package/src/executors/run/run.impl.js.map +1 -0
- package/src/executors/run/schema.d.ts +25 -0
- package/src/executors/run/schema.json +71 -0
- package/src/executors/start/compat.d.ts +2 -0
- package/src/executors/start/compat.js +6 -0
- package/src/executors/start/compat.js.map +1 -0
- package/src/executors/start/schema.d.ts +22 -0
- package/src/executors/start/schema.json +93 -0
- package/src/executors/start/start.impl.d.ts +7 -0
- package/src/executors/start/start.impl.js +73 -0
- package/src/executors/start/start.impl.js.map +1 -0
- package/src/executors/sync-deps/compat.d.ts +2 -0
- package/src/executors/sync-deps/compat.js +6 -0
- package/src/executors/sync-deps/compat.js.map +1 -0
- package/src/executors/sync-deps/schema.d.ts +4 -0
- package/src/executors/sync-deps/schema.json +28 -0
- package/src/executors/sync-deps/sync-deps.impl.d.ts +8 -0
- package/src/executors/sync-deps/sync-deps.impl.js +62 -0
- package/src/executors/sync-deps/sync-deps.impl.js.map +1 -0
- package/src/executors/update/compat.d.ts +2 -0
- package/src/executors/update/compat.js +6 -0
- package/src/executors/update/compat.js.map +1 -0
- package/src/executors/update/schema.d.ts +15 -0
- package/src/executors/update/schema.json +65 -0
- package/src/executors/update/update.impl.d.ts +6 -0
- package/src/executors/update/update.impl.js +59 -0
- package/src/executors/update/update.impl.js.map +1 -0
- package/src/generators/application/application.d.ts +5 -0
- package/src/generators/application/application.js +33 -0
- package/src/generators/application/application.js.map +1 -0
- package/src/generators/application/files/app.json.template +33 -0
- package/src/generators/application/files/assets/adaptive-icon.png +0 -0
- package/src/generators/application/files/assets/favicon.png +0 -0
- package/src/generators/application/files/assets/icon.png +0 -0
- package/src/generators/application/files/assets/splash.png +0 -0
- package/src/generators/application/files/babel.config.js.template +6 -0
- package/src/generators/application/files/eas.json.template +28 -0
- package/src/generators/application/files/index.js.template +8 -0
- package/src/generators/application/files/metro.config.js.template +25 -0
- package/src/generators/application/files/package.json.template +17 -0
- package/src/generators/application/files/src/app/App.spec.tsx.template +9 -0
- package/src/generators/application/files/src/app/App.tsx.template +694 -0
- package/src/generators/application/files/test-setup.ts.template +1 -0
- package/src/generators/application/files/tsconfig.app.json.template +9 -0
- package/src/generators/application/files/tsconfig.json.template +26 -0
- package/src/generators/application/lib/add-detox.d.ts +3 -0
- package/src/generators/application/lib/add-detox.js +16 -0
- package/src/generators/application/lib/add-detox.js.map +1 -0
- package/src/generators/application/lib/add-project.d.ts +3 -0
- package/src/generators/application/lib/add-project.js +91 -0
- package/src/generators/application/lib/add-project.js.map +1 -0
- package/src/generators/application/lib/create-application-files.d.ts +3 -0
- package/src/generators/application/lib/create-application-files.js +24 -0
- package/src/generators/application/lib/create-application-files.js.map +1 -0
- package/src/generators/application/lib/normalize-options.d.ts +10 -0
- package/src/generators/application/lib/normalize-options.js +30 -0
- package/src/generators/application/lib/normalize-options.js.map +1 -0
- package/src/generators/application/schema.d.ts +19 -0
- package/src/generators/application/schema.json +88 -0
- package/src/generators/component/component.d.ts +5 -0
- package/src/generators/component/component.js +51 -0
- package/src/generators/component/component.js.map +1 -0
- package/src/generators/component/files/__fileName__.spec.tsx.template +11 -0
- package/src/generators/component/files/__fileName__.tsx.template +32 -0
- package/src/generators/component/lib/add-import.d.ts +3 -0
- package/src/generators/component/lib/add-import.js +30 -0
- package/src/generators/component/lib/add-import.js.map +1 -0
- package/src/generators/component/lib/normalize-options.d.ts +8 -0
- package/src/generators/component/lib/normalize-options.js +58 -0
- package/src/generators/component/lib/normalize-options.js.map +1 -0
- package/src/generators/component/schema.d.ts +15 -0
- package/src/generators/component/schema.json +83 -0
- package/src/generators/init/init.d.ts +6 -0
- package/src/generators/init/init.js +69 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/lib/add-git-ignore-entry.d.ts +2 -0
- package/src/generators/init/lib/add-git-ignore-entry.js +19 -0
- package/src/generators/init/lib/add-git-ignore-entry.js.map +1 -0
- package/src/generators/init/lib/gitignore-entries.d.ts +1 -0
- package/src/generators/init/lib/gitignore-entries.js +20 -0
- package/src/generators/init/lib/gitignore-entries.js.map +1 -0
- package/src/generators/init/lib/init-root-babel-config.d.ts +2 -0
- package/src/generators/init/lib/init-root-babel-config.js +14 -0
- package/src/generators/init/lib/init-root-babel-config.js.map +1 -0
- package/src/generators/init/schema.d.ts +7 -0
- package/src/generators/init/schema.json +38 -0
- package/src/generators/library/files/lib/README.md +7 -0
- package/src/generators/library/files/lib/babel.config.json +17 -0
- package/src/generators/library/files/lib/package.json.template +5 -0
- package/src/generators/library/files/lib/src/index.ts.template +0 -0
- package/src/generators/library/files/lib/test-setup.ts.template +1 -0
- package/src/generators/library/files/lib/tsconfig.json.template +16 -0
- package/src/generators/library/files/lib/tsconfig.lib.json.template +9 -0
- package/src/generators/library/lib/normalize-options.d.ts +12 -0
- package/src/generators/library/lib/normalize-options.js +27 -0
- package/src/generators/library/lib/normalize-options.js.map +1 -0
- package/src/generators/library/library.d.ts +5 -0
- package/src/generators/library/library.js +101 -0
- package/src/generators/library/library.js.map +1 -0
- package/src/generators/library/schema.d.ts +22 -0
- package/src/generators/library/schema.json +99 -0
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.d.ts +6 -0
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js +35 -0
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js.map +1 -0
- package/src/migrations/update-14-1-2/add-eject-target-14-1-2.d.ts +5 -0
- package/src/migrations/update-14-1-2/add-eject-target-14-1-2.js +25 -0
- package/src/migrations/update-14-1-2/add-eject-target-14-1-2.js.map +1 -0
- package/src/migrations/update-14-4-3/add-eas-build-target.d.ts +5 -0
- package/src/migrations/update-14-4-3/add-eas-build-target.js +42 -0
- package/src/migrations/update-14-4-3/add-eas-build-target.js.map +1 -0
- package/src/migrations/update-14-5-1/add-eas-update-target.d.ts +5 -0
- package/src/migrations/update-14-5-1/add-eas-update-target.js +27 -0
- package/src/migrations/update-14-5-1/add-eas-update-target.js.map +1 -0
- package/src/migrations/update-15-0-3/add-new-expo-cli-targets.d.ts +9 -0
- package/src/migrations/update-15-0-3/add-new-expo-cli-targets.js +66 -0
- package/src/migrations/update-15-0-3/add-new-expo-cli-targets.js.map +1 -0
- package/src/migrations/update-15-0-3/change-jest-preset.d.ts +8 -0
- package/src/migrations/update-15-0-3/change-jest-preset.js +74 -0
- package/src/migrations/update-15-0-3/change-jest-preset.js.map +1 -0
- package/src/migrations/update-15-8-3/change-webpack-to-metro.d.ts +8 -0
- package/src/migrations/update-15-8-3/change-webpack-to-metro.js +37 -0
- package/src/migrations/update-15-8-3/change-webpack-to-metro.js.map +1 -0
- package/src/migrations/update-16-0-0/remove-deprecated-targets.d.ts +5 -0
- package/src/migrations/update-16-0-0/remove-deprecated-targets.js +36 -0
- package/src/migrations/update-16-0-0/remove-deprecated-targets.js.map +1 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +13 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
- package/src/utils/add-jest.d.ts +2 -0
- package/src/utils/add-jest.js +39 -0
- package/src/utils/add-jest.js.map +1 -0
- package/src/utils/add-linting.d.ts +3 -0
- package/src/utils/add-linting.js +37 -0
- package/src/utils/add-linting.js.map +1 -0
- package/src/utils/ensure-node-modules-symlink.d.ts +9 -0
- package/src/utils/ensure-node-modules-symlink.js +29 -0
- package/src/utils/ensure-node-modules-symlink.js.map +1 -0
- package/src/utils/find-all-npm-dependencies.d.ts +2 -0
- package/src/utils/find-all-npm-dependencies.js +26 -0
- package/src/utils/find-all-npm-dependencies.js.map +1 -0
- package/src/utils/pod-install-task.d.ts +8 -0
- package/src/utils/pod-install-task.js +53 -0
- package/src/utils/pod-install-task.js.map +1 -0
- package/src/utils/symlink-task.d.ts +2 -0
- package/src/utils/symlink-task.js +19 -0
- package/src/utils/symlink-task.js.map +1 -0
- package/src/utils/versions.d.ts +20 -0
- package/src/utils/versions.js +24 -0
- package/src/utils/versions.js.map +1 -0
- package/tsconfig.json +13 -0
- package/tsconfig.lib.json +11 -0
- package/tsconfig.spec.json +20 -0
- package/typings/svg.d.ts +6 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runCliBuildList = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
|
|
9
|
+
let childProcess;
|
|
10
|
+
function buildListExecutor(options, context) {
|
|
11
|
+
return tslib_1.__asyncGenerator(this, arguments, function* buildListExecutor_1() {
|
|
12
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
13
|
+
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
|
|
14
|
+
try {
|
|
15
|
+
if (options.json) {
|
|
16
|
+
// when json is true, interactive has to be false
|
|
17
|
+
options.interactive = false;
|
|
18
|
+
}
|
|
19
|
+
yield tslib_1.__await(runCliBuildList(context.root, projectRoot, options));
|
|
20
|
+
yield yield tslib_1.__await({ success: true });
|
|
21
|
+
}
|
|
22
|
+
finally {
|
|
23
|
+
if (childProcess) {
|
|
24
|
+
childProcess.kill();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
exports.default = buildListExecutor;
|
|
30
|
+
function runCliBuildList(workspaceRoot, projectRoot, options) {
|
|
31
|
+
return new Promise((resolve, reject) => {
|
|
32
|
+
childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/eas-cli/bin/run'), ['build:list', ...createBuildListOptions(options)], {
|
|
33
|
+
cwd: (0, path_1.join)(workspaceRoot, projectRoot),
|
|
34
|
+
env: process.env,
|
|
35
|
+
stdio: ['inherit', 'pipe', 'inherit', 'ipc'], // only stream stdout on child process
|
|
36
|
+
});
|
|
37
|
+
// Ensure the child process is killed when the parent exits
|
|
38
|
+
process.on('exit', () => childProcess.kill());
|
|
39
|
+
process.on('SIGTERM', () => childProcess.kill());
|
|
40
|
+
let output = '';
|
|
41
|
+
childProcess.stdout.on('data', (message) => {
|
|
42
|
+
output += message.toString();
|
|
43
|
+
devkit_1.logger.info(message.toString());
|
|
44
|
+
// when interactive is false, resolve the promise when the child process exits
|
|
45
|
+
if (options.interactive === false) {
|
|
46
|
+
resolve(message.toString());
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
childProcess.on('error', (err) => {
|
|
50
|
+
reject(err);
|
|
51
|
+
});
|
|
52
|
+
childProcess.on('exit', (code) => {
|
|
53
|
+
if (code === 0) {
|
|
54
|
+
resolve(output);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
reject(code);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
exports.runCliBuildList = runCliBuildList;
|
|
63
|
+
const nxOptions = ['output'];
|
|
64
|
+
function createBuildListOptions(options) {
|
|
65
|
+
return Object.keys(options).reduce((acc, optionKey) => {
|
|
66
|
+
const optionValue = options[optionKey];
|
|
67
|
+
if (!nxOptions.includes(optionKey)) {
|
|
68
|
+
if (optionKey === 'interactive') {
|
|
69
|
+
if (optionValue === false) {
|
|
70
|
+
acc.push(`--non-interactive`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else if (typeof optionValue === 'boolean') {
|
|
74
|
+
if (optionValue === true) {
|
|
75
|
+
// when true, does not need to pass the value true, just need to pass the flag in camel case
|
|
76
|
+
acc.push(`--${(0, devkit_1.names)(optionKey).propertyName}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
acc.push(`--${(0, devkit_1.names)(optionKey).propertyName}`, optionValue);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return acc;
|
|
84
|
+
}, []);
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=build-list.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-list.impl.js","sourceRoot":"","sources":["../../../../../../packages/expo/src/executors/build-list/build-list.impl.ts"],"names":[],"mappings":";;;;AAAA,uCAA4D;AAC5D,+BAA4B;AAC5B,iDAAmD;AAEnD,yFAAmF;AAQnF,IAAI,YAA0B,CAAC;AAE/B,SAA+B,iBAAiB,CAC9C,OAAgC,EAChC,OAAwB;;QAExB,MAAM,WAAW,GACf,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;QACpE,IAAA,sDAAwB,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAEpD,IAAI;YACF,IAAI,OAAO,CAAC,IAAI,EAAE;gBAChB,iDAAiD;gBACjD,OAAO,CAAC,WAAW,GAAG,KAAK,CAAC;aAC7B;YACD,sBAAM,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA,CAAC;YAE1D,4BAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA,CAAC;SACzB;gBAAS;YACR,IAAI,YAAY,EAAE;gBAChB,YAAY,CAAC,IAAI,EAAE,CAAC;aACrB;SACF;IACH,CAAC;CAAA;AArBD,oCAqBC;AAED,SAAgB,eAAe,CAC7B,aAAqB,EACrB,WAAmB,EACnB,OAAgC;IAEhC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,YAAY,GAAG,IAAA,oBAAI,EACjB,IAAA,WAAI,EAAC,aAAa,EAAE,gCAAgC,CAAC,EACrD,CAAC,YAAY,EAAE,GAAG,sBAAsB,C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,CAAC,QAAQ,CAAC,CAAC;AAC7B,SAAS,sBAAsB,CAAC,OAAgC;IAC9D,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,EAAE;QACpD,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QACvC,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;YAClC,IAAI,SAAS,KAAK,aAAa,EAAE;gBAC/B,IAAI,WAAW,KAAK,KAAK,EAAE;oBACzB,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC;iBAC/B;aACF;iBAAM,IAAI,OAAO,WAAW,KAAK,SAAS,EAAE;gBAC3C,IAAI,WAAW,KAAK,IAAI,EAAE;oBACxB,4FAA4F;oBAC5F,GAAG,CAAC,IAAI,CAAC,KAAK,IAAA,cAAK,EAAC,SAAS,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC;iBAChD;aACF;iBAAM;gBACL,GAAG,CAAC,IAAI,CAAC,KAAK,IAAA,cAAK,EAAC,SAAS,CAAC,CAAC,YAAY,EAAE,EAAE,WAAW,CAAC,CAAC;aAC7D;SACF;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const build_list_impl_1 = require("./build-list.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(build_list_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/expo/src/executors/build-list/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,uDAAkD;AAElD,kBAAe,IAAA,0BAAiB,EAAC,yBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// command to run https://github.com/expo/eas-cli/tree/main#eas-buildlist
|
|
2
|
+
// options from https://github.com/expo/eas-cli/blob/main/packages/eas-cli/src/commands/build/list.ts
|
|
3
|
+
export interface ExpoEasBuildListOptions {
|
|
4
|
+
platform?: 'ios' | 'android' | 'all';
|
|
5
|
+
interactive?: boolean;
|
|
6
|
+
json?: boolean;
|
|
7
|
+
// status and distribution enum from https://github.com/expo/eas-cli/blob/main/packages/eas-cli/src/build/types.ts
|
|
8
|
+
status?:
|
|
9
|
+
| 'new'
|
|
10
|
+
| 'in-queue'
|
|
11
|
+
| 'in-progress'
|
|
12
|
+
| 'errored'
|
|
13
|
+
| 'finished'
|
|
14
|
+
| 'canceled';
|
|
15
|
+
distribution?: 'store' | 'internal' | 'simulator';
|
|
16
|
+
channel?: string;
|
|
17
|
+
appVersion?: string;
|
|
18
|
+
appBuildVersion?: string;
|
|
19
|
+
sdkVersion?: string;
|
|
20
|
+
runtimeVersion?: string;
|
|
21
|
+
appIdentifier?: string;
|
|
22
|
+
buildProject?: string;
|
|
23
|
+
gitCommitHash?: string;
|
|
24
|
+
limit?: number;
|
|
25
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"$schema": "http://json-schema.org/schema",
|
|
5
|
+
"$id": "NxExpoEasBuildList",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"title": "Expo EAS Build List executor",
|
|
8
|
+
"description": "List all Expo Application Services (EAS) builds for your Expo project.",
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"platform": {
|
|
12
|
+
"enum": ["ios", "android", "all"],
|
|
13
|
+
"alias": "p",
|
|
14
|
+
"description": "The platform to build the app.",
|
|
15
|
+
"x-priority": "important"
|
|
16
|
+
},
|
|
17
|
+
"json": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"description": "Enable JSON output, non-JSON messages will be printed to stderr"
|
|
20
|
+
},
|
|
21
|
+
"interactive": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"description": "Run the command in interactive mode."
|
|
24
|
+
},
|
|
25
|
+
"status": {
|
|
26
|
+
"enum": [
|
|
27
|
+
"new",
|
|
28
|
+
"in-queue",
|
|
29
|
+
"in-progress",
|
|
30
|
+
"errored",
|
|
31
|
+
"finished",
|
|
32
|
+
"canceled"
|
|
33
|
+
],
|
|
34
|
+
"description": "Status of EAS build"
|
|
35
|
+
},
|
|
36
|
+
"distribution": {
|
|
37
|
+
"enum": ["store", "internal", "simulator"],
|
|
38
|
+
"description": "Distribution of EAS build"
|
|
39
|
+
},
|
|
40
|
+
"channel": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "Channel of EAS build"
|
|
43
|
+
},
|
|
44
|
+
"appVersion": {
|
|
45
|
+
"type": "string",
|
|
46
|
+
"description": "App version of EAS build"
|
|
47
|
+
},
|
|
48
|
+
"appBuildVersion": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"description": "App build version of EAS build"
|
|
51
|
+
},
|
|
52
|
+
"sdkVersion": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "SDK version of EAS build"
|
|
55
|
+
},
|
|
56
|
+
"runtimeVersion": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"description": "Runtime version of EAS build"
|
|
59
|
+
},
|
|
60
|
+
"appIdentifier": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "App identifier of EAS build"
|
|
63
|
+
},
|
|
64
|
+
"buildProfile": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"description": "Build profile of EAS build"
|
|
67
|
+
},
|
|
68
|
+
"gitCommitHash": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"description": "Git commit hash of EAS build"
|
|
71
|
+
},
|
|
72
|
+
"limit": {
|
|
73
|
+
"type": "number",
|
|
74
|
+
"description": "Limit of numbers to list EAS builds"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"required": [],
|
|
78
|
+
"examplesFile": "../../../docs/build-list-examples.md"
|
|
79
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const download_impl_1 = require("./download.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(download_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/expo/src/executors/download/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,mDAA+C;AAE/C,kBAAe,IAAA,0BAAiB,EAAC,uBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { ExpoEasDownloadOptions } from './schema';
|
|
3
|
+
import { BuildFragment } from '../build-list/build-fragment';
|
|
4
|
+
export interface ReactNativeDownloadOutput {
|
|
5
|
+
success: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* This executor downloads the latest EAS build.
|
|
9
|
+
* It calls the build list executor to list EAS builds with options passed in.
|
|
10
|
+
*/
|
|
11
|
+
export default function downloadExecutor(options: ExpoEasDownloadOptions, context: ExecutorContext): AsyncGenerator<ReactNativeDownloadOutput>;
|
|
12
|
+
export declare function getBuild(workspaceRoot: string, projectRoot: string, options: ExpoEasDownloadOptions): Promise<BuildFragment>;
|
|
13
|
+
export declare function getAppExtension(platform: string, downloadFileName: string): string;
|
|
14
|
+
export declare function unzipBuild(downloadFilePath: string, outputDirectoryPath: string): Promise<void> | Promise<unknown>;
|
|
15
|
+
export declare function copyBuildFile(downloadFilePath: string, outputFilePath: string): Promise<void>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.copyBuildFile = exports.unzipBuild = exports.getAppExtension = exports.getBuild = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const node_fetch_1 = require("node-fetch");
|
|
8
|
+
const util_1 = require("util");
|
|
9
|
+
const stream_1 = require("stream");
|
|
10
|
+
const chalk = require("chalk");
|
|
11
|
+
const path_1 = require("path");
|
|
12
|
+
const tar = require("tar-fs");
|
|
13
|
+
const zlib_1 = require("zlib");
|
|
14
|
+
const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
|
|
15
|
+
const build_list_impl_1 = require("../build-list/build-list.impl");
|
|
16
|
+
const streamPipeline = (0, util_1.promisify)(stream_1.pipeline);
|
|
17
|
+
/**
|
|
18
|
+
* This executor downloads the latest EAS build.
|
|
19
|
+
* It calls the build list executor to list EAS builds with options passed in.
|
|
20
|
+
*/
|
|
21
|
+
function downloadExecutor(options, context) {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
return tslib_1.__asyncGenerator(this, arguments, function* downloadExecutor_1() {
|
|
24
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
25
|
+
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
|
|
26
|
+
const build = yield tslib_1.__await(getBuild(context.root, projectRoot, options));
|
|
27
|
+
const buildUrl = (_a = build === null || build === void 0 ? void 0 : build.artifacts) === null || _a === void 0 ? void 0 : _a.buildUrl;
|
|
28
|
+
if (!buildUrl) {
|
|
29
|
+
throw new Error(`No build URL found.`);
|
|
30
|
+
}
|
|
31
|
+
if (!(0, fs_1.existsSync)(options.output)) {
|
|
32
|
+
(0, fs_1.mkdirSync)(options.output, { recursive: true });
|
|
33
|
+
}
|
|
34
|
+
const downloadFileName = buildUrl.split('/').pop();
|
|
35
|
+
const downloadFilePath = (0, path_1.join)(options.output, downloadFileName);
|
|
36
|
+
yield tslib_1.__await(downloadBuild(buildUrl, downloadFilePath));
|
|
37
|
+
const appExtension = getAppExtension(build.platform, downloadFileName);
|
|
38
|
+
const appName = `${(0, devkit_1.names)((_b = build.project) === null || _b === void 0 ? void 0 : _b.name).className}${appExtension}`;
|
|
39
|
+
const outputFilePath = (0, path_1.join)(options.output, appName);
|
|
40
|
+
if (downloadFileName.endsWith('.tar.gz')) {
|
|
41
|
+
yield tslib_1.__await(unzipBuild(downloadFilePath, options.output));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
yield tslib_1.__await(copyBuildFile(downloadFilePath, outputFilePath));
|
|
45
|
+
}
|
|
46
|
+
devkit_1.logger.info(`Successfully download the build to ${outputFilePath}`);
|
|
47
|
+
yield yield tslib_1.__await({ success: true });
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
exports.default = downloadExecutor;
|
|
51
|
+
function downloadBuild(buildUrl, output) {
|
|
52
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
const response = yield (0, node_fetch_1.default)(buildUrl);
|
|
54
|
+
if (!response.ok)
|
|
55
|
+
throw new Error(`Unable to download the build ${buildUrl}. Error: ${response.statusText}`);
|
|
56
|
+
return streamPipeline(response.body, (0, fs_1.createWriteStream)(output));
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function getBuild(workspaceRoot, projectRoot, options) {
|
|
60
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const buildList = yield (0, build_list_impl_1.runCliBuildList)(workspaceRoot, projectRoot, Object.assign(Object.assign({}, options), { interactive: false, json: true, status: 'finished', limit: 1 }));
|
|
62
|
+
const builds = JSON.parse(buildList);
|
|
63
|
+
if (!builds.length) {
|
|
64
|
+
throw new Error(`No EAS build found. Please check expo.dev to make sure your build is finished.`);
|
|
65
|
+
}
|
|
66
|
+
devkit_1.logger.info(`${chalk.bold.cyan('info')} Found build: ${buildList}`);
|
|
67
|
+
return builds[0];
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
exports.getBuild = getBuild;
|
|
71
|
+
function getAppExtension(platform, downloadFileName) {
|
|
72
|
+
platform = platform.toLowerCase();
|
|
73
|
+
if (platform === 'ios') {
|
|
74
|
+
return '.app';
|
|
75
|
+
}
|
|
76
|
+
if (downloadFileName.includes('.')) {
|
|
77
|
+
return `.${downloadFileName.split('.').pop()}`;
|
|
78
|
+
}
|
|
79
|
+
throw new Error(`Invalid build name found: ${downloadFileName}`);
|
|
80
|
+
}
|
|
81
|
+
exports.getAppExtension = getAppExtension;
|
|
82
|
+
function unzipBuild(downloadFilePath, outputDirectoryPath) {
|
|
83
|
+
const unzip = (0, zlib_1.createUnzip)();
|
|
84
|
+
const extract = tar.extract(outputDirectoryPath);
|
|
85
|
+
return streamPipeline((0, fs_1.createReadStream)(downloadFilePath), unzip, extract);
|
|
86
|
+
}
|
|
87
|
+
exports.unzipBuild = unzipBuild;
|
|
88
|
+
function copyBuildFile(downloadFilePath, outputFilePath) {
|
|
89
|
+
return new Promise((resolve, reject) => {
|
|
90
|
+
(0, fs_1.copyFile)(downloadFilePath, outputFilePath, (error) => {
|
|
91
|
+
if (error) {
|
|
92
|
+
reject(error);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
resolve();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
exports.copyBuildFile = copyBuildFile;
|
|
101
|
+
//# sourceMappingURL=download.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.impl.js","sourceRoot":"","sources":["../../../../../../packages/expo/src/executors/download/download.impl.ts"],"names":[],"mappings":";;;;AAAA,uCAA4D;AAC5D,2BAMY;AACZ,2CAA+B;AAC/B,+BAAiC;AACjC,mC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CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAbD,sCAaC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"$schema": "http://json-schema.org/schema",
|
|
5
|
+
"$id": "NxExpoDownloadEasBuild",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"title": "Download EAS Build executor",
|
|
8
|
+
"description": "Download an Expo Application Services (EAS) build.",
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"platform": {
|
|
12
|
+
"enum": ["ios", "android"],
|
|
13
|
+
"alias": "p",
|
|
14
|
+
"description": "The platform to download the app",
|
|
15
|
+
"x-priority": "important"
|
|
16
|
+
},
|
|
17
|
+
"distribution": {
|
|
18
|
+
"enum": ["store", "internal", "simulator"],
|
|
19
|
+
"description": "Distribution of EAS build"
|
|
20
|
+
},
|
|
21
|
+
"channel": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"description": "Channel of EAS build"
|
|
24
|
+
},
|
|
25
|
+
"appVersion": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "App version of EAS build"
|
|
28
|
+
},
|
|
29
|
+
"appBuildVersion": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "App build version of EAS build"
|
|
32
|
+
},
|
|
33
|
+
"sdkVersion": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "SDK version of EAS build"
|
|
36
|
+
},
|
|
37
|
+
"runtimeVersion": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Runtime version of EAS build"
|
|
40
|
+
},
|
|
41
|
+
"appIdentifier": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "App identifier of EAS build"
|
|
44
|
+
},
|
|
45
|
+
"buildProfile": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "Build profile of EAS build"
|
|
48
|
+
},
|
|
49
|
+
"gitCommitHash": {
|
|
50
|
+
"type": "string",
|
|
51
|
+
"description": "Git commit hash of EAS build"
|
|
52
|
+
},
|
|
53
|
+
"output": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "Output directory for the download build"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"required": ["output"]
|
|
59
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const ensure_symlink_impl_1 = require("./ensure-symlink.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(ensure_symlink_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/expo/src/executors/ensure-symlink/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,+DAA0D;AAE1D,kBAAe,IAAA,0BAAiB,EAAC,6BAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
|
|
5
|
+
function ensureSymlinkExecutor(_, context) {
|
|
6
|
+
return tslib_1.__asyncGenerator(this, arguments, function* ensureSymlinkExecutor_1() {
|
|
7
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
8
|
+
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
|
|
9
|
+
yield yield tslib_1.__await({ success: true });
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
exports.default = ensureSymlinkExecutor;
|
|
13
|
+
//# sourceMappingURL=ensure-symlink.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensure-symlink.impl.js","sourceRoot":"","sources":["../../../../../../packages/expo/src/executors/ensure-symlink/ensure-symlink.impl.ts"],"names":[],"mappings":";;;AAEA,yFAAmF;AAMnF,SAA+B,qBAAqB,CAClD,CAAC,EACD,OAAwB;;QAExB,MAAM,WAAW,GACf,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;QAEpE,IAAA,sDAAwB,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAEpD,4BAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA,CAAC;IAC1B,CAAC;CAAA;AAVD,wCAUC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"$id": "NxExpoEnsureSymlink",
|
|
6
|
+
"$schema": "http://json-schema.org/schema",
|
|
7
|
+
"title": "Ensure Symlink for Expo",
|
|
8
|
+
"description": "Ensure workspace node_modules is symlink under app's node_modules folder.",
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {}
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const export_impl_1 = require("./export.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(export_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/expo/src/executors/export/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,+CAA2C;AAE3C,kBAAe,IAAA,0BAAiB,EAAC,qBAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { ExportExecutorSchema } from './schema';
|
|
3
|
+
export interface ExpoExportOutput {
|
|
4
|
+
success: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default function exportExecutor(options: ExportExecutorSchema, context: ExecutorContext): AsyncGenerator<ExpoExportOutput>;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
|
|
8
|
+
let childProcess;
|
|
9
|
+
function exportExecutor(options, context) {
|
|
10
|
+
return tslib_1.__asyncGenerator(this, arguments, function* exportExecutor_1() {
|
|
11
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
12
|
+
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
|
|
13
|
+
try {
|
|
14
|
+
yield tslib_1.__await(exportAsync(context.root, projectRoot, options));
|
|
15
|
+
yield yield tslib_1.__await({
|
|
16
|
+
success: true,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
finally {
|
|
20
|
+
if (childProcess) {
|
|
21
|
+
childProcess.kill();
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
exports.default = exportExecutor;
|
|
27
|
+
function exportAsync(workspaceRoot, projectRoot, options) {
|
|
28
|
+
return new Promise((resolve, reject) => {
|
|
29
|
+
childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/@expo/cli/build/bin/cli'), [
|
|
30
|
+
`export${options.bundler === 'webpack' ? ':web' : ''}`,
|
|
31
|
+
'.',
|
|
32
|
+
...createExportOptions(options),
|
|
33
|
+
], { cwd: (0, path_1.join)(workspaceRoot, projectRoot), env: process.env });
|
|
34
|
+
// Ensure the child process is killed when the parent exits
|
|
35
|
+
process.on('exit', () => childProcess.kill());
|
|
36
|
+
process.on('SIGTERM', () => childProcess.kill());
|
|
37
|
+
childProcess.on('error', (err) => {
|
|
38
|
+
reject(err);
|
|
39
|
+
});
|
|
40
|
+
childProcess.on('exit', (code) => {
|
|
41
|
+
if (code === 0) {
|
|
42
|
+
resolve(code);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
reject(code);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const nxOptions = ['bundler'];
|
|
51
|
+
// options from https://github.com/expo/expo/blob/main/packages/@expo/cli/src/export/index.ts
|
|
52
|
+
function createExportOptions(options) {
|
|
53
|
+
return Object.keys(options).reduce((acc, k) => {
|
|
54
|
+
if (!nxOptions.includes(k)) {
|
|
55
|
+
const v = options[k];
|
|
56
|
+
if (typeof v === 'boolean') {
|
|
57
|
+
if (v === true) {
|
|
58
|
+
// when true, does not need to pass the value true, just need to pass the flag in kebob case
|
|
59
|
+
acc.push(`--${(0, devkit_1.names)(k).fileName}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
acc.push(`--${(0, devkit_1.names)(k).fileName}`, v);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return acc;
|
|
67
|
+
}, []);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=export.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.impl.js","sourceRoot":"","sources":["../../../../../../packages/expo/src/executors/export/export.impl.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AACpD,iDAAmD;AACnD,+BAA4B;AAE5B,yFAAmF;AAOnF,IAAI,YAA0B,CAAC;AAE/B,SAA+B,cAAc,CAC3C,OAA6B,EAC7B,OAAwB;;QAEx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AAC;QACd,CAAC,CAAC,CAAC;QACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YAC/B,IAAI,IAAI,KAAK,CAAC,EAAE;gBACd,OAAO,CAAC,IAAI,CAAC,CAAC;aACf;iBAAM;gBACL,MAAM,CAAC,IAAI,CAAC,CAAC;aACd;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,SAAS,GAAG,CAAC,SAAS,CAAC,CAAC;AAC9B,6FAA6F;AAC7F,SAAS,mBAAmB,CAAC,OAA6B;IACxD,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QAC5C,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE;YAC1B,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACrB,IAAI,OAAO,CAAC,KAAK,SAAS,EAAE;gBAC1B,IAAI,CAAC,KAAK,IAAI,EAAE;oBACd,4FAA4F;oBAC5F,GAAG,CAAC,IAAI,CAAC,KAAK,IAAA,cAAK,EAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;iBACpC;aACF;iBAAM;gBACL,GAAG,CAAC,IAAI,CAAC,KAAK,IAAA,cAAK,EAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC;aACvC;SACF;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// options form https://github.com/expo/expo/blob/main/packages/%40expo/cli/src/export/resolveOptions.ts
|
|
2
|
+
export interface ExportExecutorSchema {
|
|
3
|
+
platform?: 'ios' | 'android' | 'all' | 'web'; // default is 'all'
|
|
4
|
+
outputDir?: string;
|
|
5
|
+
clear?: boolean;
|
|
6
|
+
dev?: boolean;
|
|
7
|
+
maxWorkers?: number;
|
|
8
|
+
dumpAssetmap?: boolean;
|
|
9
|
+
dumpSourcemap?: boolean;
|
|
10
|
+
bundler: 'metro' | 'webpack';
|
|
11
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cli": "nx",
|
|
3
|
+
"version": 2,
|
|
4
|
+
"outputCapture": "direct-nodejs",
|
|
5
|
+
"$id": "NxExpoExport",
|
|
6
|
+
"$schema": "http://json-schema.org/schema",
|
|
7
|
+
"title": "Expo Export",
|
|
8
|
+
"description": "Export the JavaScript and assets for your app using Metro/webpack bundler.",
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"platform": {
|
|
12
|
+
"description": "Choose the platform to compile for",
|
|
13
|
+
"enum": ["ios", "android", "all", "web"],
|
|
14
|
+
"alias": "p",
|
|
15
|
+
"x-priority": "important"
|
|
16
|
+
},
|
|
17
|
+
"dev": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"description": "Bundle for development environments without minifying code or stripping the __DEV__ boolean. Configure static files for developing locally using a non-https server."
|
|
20
|
+
},
|
|
21
|
+
"clear": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"description": "Clear the bundler cache before exporting"
|
|
24
|
+
},
|
|
25
|
+
"outputDir": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "The directory to export the static files to. Default: dist"
|
|
28
|
+
},
|
|
29
|
+
"maxWorkers": {
|
|
30
|
+
"type": "number",
|
|
31
|
+
"description": "Maximum number of tasks to allow Metro to spawn"
|
|
32
|
+
},
|
|
33
|
+
"dumpAssetmap": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"description": "Dump the asset map for further processing"
|
|
36
|
+
},
|
|
37
|
+
"dumpSourcemap": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Dump the source map for debugging the JS bundle"
|
|
40
|
+
},
|
|
41
|
+
"bundler": {
|
|
42
|
+
"enum": ["metro", "webpack"],
|
|
43
|
+
"description": "Choose the bundler to compile for",
|
|
44
|
+
"default": "metro"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": []
|
|
48
|
+
}
|