@nx/expo 17.0.0-beta.2 → 17.0.0-beta.4
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/executors.json +0 -67
- package/generators.json +0 -28
- package/index.d.ts +0 -1
- package/index.js +1 -3
- package/package.json +11 -13
- package/plugins/with-nx-metro.d.ts +0 -4
- package/src/executors/build/build.impl.js +0 -15
- package/src/executors/run/schema.d.ts +0 -4
- package/src/executors/run/schema.json +0 -7
- package/src/executors/start/schema.d.ts +0 -5
- package/src/executors/start/schema.json +0 -6
- package/src/generators/application/application.d.ts +0 -1
- package/src/generators/application/application.js +1 -2
- package/src/generators/application/lib/add-project.js +0 -9
- package/src/generators/component/component.d.ts +0 -1
- package/src/generators/component/component.js +1 -2
- package/src/generators/init/init.d.ts +0 -1
- package/src/generators/init/init.js +1 -2
- package/src/generators/library/library.d.ts +0 -1
- package/src/generators/library/library.js +1 -2
- package/src/executors/build/compat.d.ts +0 -2
- package/src/executors/build/compat.js +0 -5
- package/src/executors/build-list/compat.d.ts +0 -2
- package/src/executors/build-list/compat.js +0 -5
- package/src/executors/download/compat.d.ts +0 -2
- package/src/executors/download/compat.js +0 -5
- package/src/executors/download/download.impl.d.ts +0 -16
- package/src/executors/download/download.impl.js +0 -102
- package/src/executors/download/schema.d.ts +0 -3
- package/src/executors/download/schema.json +0 -59
- package/src/executors/ensure-symlink/compat.d.ts +0 -2
- package/src/executors/ensure-symlink/compat.js +0 -5
- package/src/executors/export/compat.d.ts +0 -2
- package/src/executors/export/compat.js +0 -5
- package/src/executors/install/compat.d.ts +0 -2
- package/src/executors/install/compat.js +0 -5
- package/src/executors/prebuild/compat.d.ts +0 -2
- package/src/executors/prebuild/compat.js +0 -5
- package/src/executors/run/compat.d.ts +0 -2
- package/src/executors/run/compat.js +0 -5
- package/src/executors/start/compat.d.ts +0 -2
- package/src/executors/start/compat.js +0 -5
- package/src/executors/submit/compat.d.ts +0 -2
- package/src/executors/submit/compat.js +0 -5
- package/src/executors/sync-deps/compat.d.ts +0 -2
- package/src/executors/sync-deps/compat.js +0 -5
- package/src/executors/update/compat.d.ts +0 -2
- package/src/executors/update/compat.js +0 -5
package/executors.json
CHANGED
|
@@ -15,11 +15,6 @@
|
|
|
15
15
|
"schema": "./src/executors/build-list/schema.json",
|
|
16
16
|
"description": "List all EAS builds for your Expo project"
|
|
17
17
|
},
|
|
18
|
-
"download": {
|
|
19
|
-
"implementation": "./src/executors/download/download.impl",
|
|
20
|
-
"schema": "./src/executors/download/schema.json",
|
|
21
|
-
"description": "Download an EAS build"
|
|
22
|
-
},
|
|
23
18
|
"run": {
|
|
24
19
|
"implementation": "./src/executors/run/run.impl",
|
|
25
20
|
"schema": "./src/executors/run/schema.json",
|
|
@@ -60,67 +55,5 @@
|
|
|
60
55
|
"schema": "./src/executors/submit/schema.json",
|
|
61
56
|
"description": "Submit app binary to App Store and/or Play Store"
|
|
62
57
|
}
|
|
63
|
-
},
|
|
64
|
-
"builders": {
|
|
65
|
-
"update": {
|
|
66
|
-
"implementation": "./src/executors/update/compat",
|
|
67
|
-
"schema": "./src/executors/update/schema.json",
|
|
68
|
-
"description": "Start an EAS update for your expo project"
|
|
69
|
-
},
|
|
70
|
-
"build": {
|
|
71
|
-
"implementation": "./src/executors/build/compat",
|
|
72
|
-
"schema": "./src/executors/build/schema.json",
|
|
73
|
-
"description": "Start an EAS build for your expo project"
|
|
74
|
-
},
|
|
75
|
-
"build-list": {
|
|
76
|
-
"implementation": "./src/executors/build-list/compat",
|
|
77
|
-
"schema": "./src/executors/build-list/schema.json",
|
|
78
|
-
"description": "List all EAS builds for your Expo project"
|
|
79
|
-
},
|
|
80
|
-
"download": {
|
|
81
|
-
"implementation": "./src/executors/download/compat",
|
|
82
|
-
"schema": "./src/executors/download/schema.json",
|
|
83
|
-
"description": "Download an EAS build"
|
|
84
|
-
},
|
|
85
|
-
"run": {
|
|
86
|
-
"implementation": "./src/executors/run/compat",
|
|
87
|
-
"schema": "./src/executors/run/schema.json",
|
|
88
|
-
"description": "Run the Android app binary locally or run the iOS app binary locally"
|
|
89
|
-
},
|
|
90
|
-
"start": {
|
|
91
|
-
"implementation": "./src/executors/start/compat",
|
|
92
|
-
"schema": "./src/executors/start/schema.json",
|
|
93
|
-
"description": "Start a local dev server for the app or start a Webpack dev server for the web app"
|
|
94
|
-
},
|
|
95
|
-
"sync-deps": {
|
|
96
|
-
"implementation": "./src/executors/sync-deps/compat",
|
|
97
|
-
"schema": "./src/executors/sync-deps/schema.json",
|
|
98
|
-
"description": "Syncs dependencies to package.json (required for autolinking)."
|
|
99
|
-
},
|
|
100
|
-
"ensure-symlink": {
|
|
101
|
-
"implementation": "./src/executors/ensure-symlink/compat",
|
|
102
|
-
"schema": "./src/executors/ensure-symlink/schema.json",
|
|
103
|
-
"description": "Ensure workspace node_modules is symlink under app's node_modules folder."
|
|
104
|
-
},
|
|
105
|
-
"prebuild": {
|
|
106
|
-
"implementation": "./src/executors/prebuild/compat",
|
|
107
|
-
"schema": "./src/executors/prebuild/schema.json",
|
|
108
|
-
"description": "Create native iOS and Android project files for building natively."
|
|
109
|
-
},
|
|
110
|
-
"install": {
|
|
111
|
-
"implementation": "./src/executors/install/compat",
|
|
112
|
-
"schema": "./src/executors/install/schema.json",
|
|
113
|
-
"description": "Install a module or other package to a project."
|
|
114
|
-
},
|
|
115
|
-
"export": {
|
|
116
|
-
"implementation": "./src/executors/export/compat",
|
|
117
|
-
"schema": "./src/executors/export/schema.json",
|
|
118
|
-
"description": "Export the JavaScript and assets for your app using Metro/webpack bundler"
|
|
119
|
-
},
|
|
120
|
-
"submit": {
|
|
121
|
-
"implementation": "./src/executors/submit/compat",
|
|
122
|
-
"schema": "./src/executors/submit/schema.json",
|
|
123
|
-
"description": "Submit app binary to App Store and/or Play Store"
|
|
124
|
-
}
|
|
125
58
|
}
|
|
126
59
|
}
|
package/generators.json
CHANGED
|
@@ -2,34 +2,6 @@
|
|
|
2
2
|
"name": "Nx Expo",
|
|
3
3
|
"version": "0.1",
|
|
4
4
|
"extends": ["@nx/workspace"],
|
|
5
|
-
"schematics": {
|
|
6
|
-
"init": {
|
|
7
|
-
"factory": "./src/generators/init/init#expoInitSchematic",
|
|
8
|
-
"schema": "./src/generators/init/schema.json",
|
|
9
|
-
"description": "Initialize the @nrwl/expo plugin",
|
|
10
|
-
"hidden": true
|
|
11
|
-
},
|
|
12
|
-
"application": {
|
|
13
|
-
"factory": "./src/generators/application/application#expoApplicationSchematic",
|
|
14
|
-
"schema": "./src/generators/application/schema.json",
|
|
15
|
-
"aliases": ["app"],
|
|
16
|
-
"x-type": "application",
|
|
17
|
-
"description": "Create an application"
|
|
18
|
-
},
|
|
19
|
-
"library": {
|
|
20
|
-
"factory": "./src/generators/library/library#expoLibrarySchematic",
|
|
21
|
-
"schema": "./src/generators/library/schema.json",
|
|
22
|
-
"aliases": ["lib"],
|
|
23
|
-
"x-type": "library",
|
|
24
|
-
"description": "Create a library"
|
|
25
|
-
},
|
|
26
|
-
"component": {
|
|
27
|
-
"factory": "./src/generators/component/component#expoComponentSchematic",
|
|
28
|
-
"schema": "./src/generators/component/schema.json",
|
|
29
|
-
"description": "Create a component",
|
|
30
|
-
"aliases": ["c"]
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
5
|
"generators": {
|
|
34
6
|
"init": {
|
|
35
7
|
"factory": "./src/generators/init/init#expoInitGenerator",
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.withNxMetro = exports.expoApplicationGenerator = exports.expoInitGenerator = void 0;
|
|
4
4
|
var init_1 = require("./src/generators/init/init");
|
|
5
5
|
Object.defineProperty(exports, "expoInitGenerator", { enumerable: true, get: function () { return init_1.expoInitGenerator; } });
|
|
6
6
|
var application_1 = require("./src/generators/application/application");
|
|
7
7
|
Object.defineProperty(exports, "expoApplicationGenerator", { enumerable: true, get: function () { return application_1.expoApplicationGenerator; } });
|
|
8
8
|
var with_nx_metro_1 = require("./plugins/with-nx-metro");
|
|
9
9
|
Object.defineProperty(exports, "withNxMetro", { enumerable: true, get: function () { return with_nx_metro_1.withNxMetro; } });
|
|
10
|
-
var with_nx_webpack_1 = require("./plugins/with-nx-webpack");
|
|
11
|
-
Object.defineProperty(exports, "withNxWebpack", { enumerable: true, get: function () { return with_nx_webpack_1.withNxWebpack; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/expo",
|
|
3
|
-
"version": "17.0.0-beta.
|
|
3
|
+
"version": "17.0.0-beta.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Expo Plugin for Nx contains executors and generators for managing and developing an expo application within your workspace. For example, you can directly build for different target platforms as well as generate projects and publish your code.",
|
|
6
6
|
"keywords": [
|
|
@@ -31,31 +31,29 @@
|
|
|
31
31
|
"fs-extra": "^11.1.0",
|
|
32
32
|
"metro-config": "0.76.7",
|
|
33
33
|
"metro-resolver": "0.76.7",
|
|
34
|
-
"node-fetch": "^2.6.7",
|
|
35
|
-
"tar-fs": "^2.1.1",
|
|
36
34
|
"tslib": "^2.3.0",
|
|
37
35
|
"tsconfig-paths": "^4.1.2",
|
|
38
36
|
"tsconfig-paths-webpack-plugin": "^4.0.0",
|
|
39
|
-
"@nx/detox": "17.0.0-beta.
|
|
40
|
-
"@nx/devkit": "17.0.0-beta.
|
|
41
|
-
"@nx/jest": "17.0.0-beta.
|
|
42
|
-
"@nx/js": "17.0.0-beta.
|
|
43
|
-
"@nx/linter": "17.0.0-beta.
|
|
44
|
-
"@nx/react": "17.0.0-beta.
|
|
45
|
-
"@nx/webpack": "17.0.0-beta.
|
|
46
|
-
"@nrwl/expo": "17.0.0-beta.
|
|
37
|
+
"@nx/detox": "17.0.0-beta.4",
|
|
38
|
+
"@nx/devkit": "17.0.0-beta.4",
|
|
39
|
+
"@nx/jest": "17.0.0-beta.4",
|
|
40
|
+
"@nx/js": "17.0.0-beta.4",
|
|
41
|
+
"@nx/linter": "17.0.0-beta.4",
|
|
42
|
+
"@nx/react": "17.0.0-beta.4",
|
|
43
|
+
"@nx/webpack": "17.0.0-beta.4",
|
|
44
|
+
"@nrwl/expo": "17.0.0-beta.4"
|
|
47
45
|
},
|
|
48
46
|
"peerDependencies": {
|
|
49
47
|
"expo": ">= 49.0.0",
|
|
50
48
|
"@expo/cli": ">= 0.10.0",
|
|
51
49
|
"eas-cli": ">= 3.15.0"
|
|
52
50
|
},
|
|
53
|
-
"
|
|
51
|
+
"executors": "./executors.json",
|
|
54
52
|
"ng-update": {
|
|
55
53
|
"requirements": {},
|
|
56
54
|
"migrations": "./migrations.json"
|
|
57
55
|
},
|
|
58
|
-
"
|
|
56
|
+
"generators": "./generators.json",
|
|
59
57
|
"publishConfig": {
|
|
60
58
|
"access": "public"
|
|
61
59
|
},
|
|
@@ -2,10 +2,6 @@ import type { MetroConfig } from 'metro-config';
|
|
|
2
2
|
interface WithNxOptions {
|
|
3
3
|
debug?: boolean;
|
|
4
4
|
extensions?: string[];
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated TODO(v17) in the metro.config.js, pass in to the getDefaultConfig instead: getDefaultConfig(__dirname)
|
|
7
|
-
*/
|
|
8
|
-
projectRoot?: string;
|
|
9
5
|
watchFolders?: string[];
|
|
10
6
|
}
|
|
11
7
|
export declare function withNxMetro(userConfig: MetroConfig, opts?: WithNxOptions): Promise<import("metro-config").ConfigT>;
|
|
@@ -3,26 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const devkit_1 = require("@nx/devkit");
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
|
-
const download_impl_1 = require("../download/download.impl");
|
|
7
|
-
const fs_extra_1 = require("fs-extra");
|
|
8
6
|
let childProcess;
|
|
9
7
|
async function* buildExecutor(options, context) {
|
|
10
8
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
11
9
|
try {
|
|
12
|
-
// remove the output app if it already existed
|
|
13
|
-
if (options.local && options.output) {
|
|
14
|
-
(0, fs_extra_1.removeSync)(options.output);
|
|
15
|
-
if (options.output.endsWith('.tar.gz')) {
|
|
16
|
-
// remove unzipped app if it already existed
|
|
17
|
-
(0, fs_extra_1.removeSync)(options.output.replace('.tar.gz', '.app'));
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
10
|
await runCliBuild(context.root, projectRoot, options);
|
|
21
|
-
// unzip the build if it's a tar.gz
|
|
22
|
-
if (options.local && options.output && options.output.endsWith('.tar.gz')) {
|
|
23
|
-
const outputDirectory = (0, path_1.dirname)(options.output);
|
|
24
|
-
await (0, download_impl_1.unzipBuild)(options.output, outputDirectory);
|
|
25
|
-
}
|
|
26
11
|
yield { success: true };
|
|
27
12
|
}
|
|
28
13
|
finally {
|
|
@@ -6,10 +6,6 @@
|
|
|
6
6
|
export interface ExpoRunOptions {
|
|
7
7
|
// nx options
|
|
8
8
|
platform: 'ios' | 'android';
|
|
9
|
-
/**
|
|
10
|
-
* @deprecated TODO(v17) Add sync-deps to dependsOn in project.json for this target instead
|
|
11
|
-
*/
|
|
12
|
-
sync: boolean; // default is true
|
|
13
9
|
install?: boolean; // default is true
|
|
14
10
|
clean?: boolean; // default is false
|
|
15
11
|
|
|
@@ -35,13 +35,6 @@
|
|
|
35
35
|
"description": "Device name or UDID to build the app on. The value is not required if you have a single device connected.",
|
|
36
36
|
"alias": "d"
|
|
37
37
|
},
|
|
38
|
-
"sync": {
|
|
39
|
-
"type": "boolean",
|
|
40
|
-
"description": "Syncs npm dependencies to package.json (for React Native autolink).",
|
|
41
|
-
"default": true,
|
|
42
|
-
"x-deprecated": "Add sync-deps to dependsOn in project.json for this target instead",
|
|
43
|
-
"x-priority": "internal"
|
|
44
|
-
},
|
|
45
38
|
"port": {
|
|
46
39
|
"type": "number",
|
|
47
40
|
"description": "Port to start the Metro bundler on",
|
|
@@ -87,12 +87,6 @@
|
|
|
87
87
|
"offline": {
|
|
88
88
|
"type": "boolean",
|
|
89
89
|
"description": "Allows this command to run while offline"
|
|
90
|
-
},
|
|
91
|
-
"sync": {
|
|
92
|
-
"type": "boolean",
|
|
93
|
-
"description": "Syncs npm dependencies to package.json (for React Native autolink).",
|
|
94
|
-
"x-deprecated": "Add sync-deps to dependsOn in project.json for this target instead",
|
|
95
|
-
"default": true
|
|
96
90
|
}
|
|
97
91
|
},
|
|
98
92
|
"examplesFile": "../../../docs/start-examples.md"
|
|
@@ -3,4 +3,3 @@ import { Schema } from './schema';
|
|
|
3
3
|
export declare function expoApplicationGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export declare function expoApplicationGeneratorInternal(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
5
5
|
export default expoApplicationGenerator;
|
|
6
|
-
export declare const expoApplicationSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.expoApplicationGeneratorInternal = exports.expoApplicationGenerator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const symlink_task_1 = require("../../utils/symlink-task");
|
|
6
6
|
const add_linting_1 = require("../../utils/add-linting");
|
|
@@ -41,4 +41,3 @@ async function expoApplicationGeneratorInternal(host, schema) {
|
|
|
41
41
|
}
|
|
42
42
|
exports.expoApplicationGeneratorInternal = expoApplicationGeneratorInternal;
|
|
43
43
|
exports.default = expoApplicationGenerator;
|
|
44
|
-
exports.expoApplicationSchematic = (0, devkit_1.convertNxGenerator)(expoApplicationGenerator);
|
|
@@ -54,15 +54,6 @@ function getTargets(options) {
|
|
|
54
54
|
executor: '@nx/expo:build-list',
|
|
55
55
|
options: {},
|
|
56
56
|
};
|
|
57
|
-
/**
|
|
58
|
-
* @deprecated TODO(v17) this executor is no longer used, to be removed in v17
|
|
59
|
-
*/
|
|
60
|
-
architect['download'] = {
|
|
61
|
-
executor: '@nx/expo:download',
|
|
62
|
-
options: {
|
|
63
|
-
output: `${options.appProjectRoot}/dist`,
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
57
|
architect['sync-deps'] = {
|
|
67
58
|
executor: '@nx/expo:sync-deps',
|
|
68
59
|
options: {},
|
|
@@ -2,4 +2,3 @@ import { Schema } from './schema';
|
|
|
2
2
|
import { Tree } from '@nx/devkit';
|
|
3
3
|
export declare function expoComponentGenerator(host: Tree, schema: Schema): Promise<void>;
|
|
4
4
|
export default expoComponentGenerator;
|
|
5
|
-
export declare const expoComponentSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.expoComponentGenerator = void 0;
|
|
4
4
|
const ts = require("typescript");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
@@ -48,4 +48,3 @@ function addExportsToBarrel(host, options) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
exports.default = expoComponentGenerator;
|
|
51
|
-
exports.expoComponentSchematic = (0, devkit_1.convertNxGenerator)(expoComponentGenerator);
|
|
@@ -3,4 +3,3 @@ import { Schema } from './schema';
|
|
|
3
3
|
export declare function expoInitGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export declare function updateDependencies(host: Tree): GeneratorCallback;
|
|
5
5
|
export default expoInitGenerator;
|
|
6
|
-
export declare const expoInitSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.updateDependencies = exports.expoInitGenerator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const versions_1 = require("../../utils/versions");
|
|
6
6
|
const jest_1 = require("@nx/jest");
|
|
@@ -68,4 +68,3 @@ function moveDependency(host) {
|
|
|
68
68
|
return (0, devkit_1.removeDependenciesFromPackageJson)(host, ['@nx/react-native'], []);
|
|
69
69
|
}
|
|
70
70
|
exports.default = expoInitGenerator;
|
|
71
|
-
exports.expoInitSchematic = (0, devkit_1.convertNxGenerator)(expoInitGenerator);
|
|
@@ -3,4 +3,3 @@ import { Schema } from './schema';
|
|
|
3
3
|
export declare function expoLibraryGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export declare function expoLibraryGeneratorInternal(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
5
5
|
export default expoLibraryGenerator;
|
|
6
|
-
export declare const expoLibrarySchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.expoLibraryGeneratorInternal = exports.expoLibraryGenerator = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const js_1 = require("@nx/js");
|
|
6
6
|
const init_1 = require("../init/init");
|
|
@@ -143,4 +143,3 @@ function maybeJs(options, path) {
|
|
|
143
143
|
: path;
|
|
144
144
|
}
|
|
145
145
|
exports.default = expoLibraryGenerator;
|
|
146
|
-
exports.expoLibrarySchematic = (0, devkit_1.convertNxGenerator)(expoLibraryGenerator);
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
-
* @deprecated TODO(v17) this executor is to be removed in NX 17. It is no longer used.
|
|
9
|
-
* This executor downloads the latest EAS build.
|
|
10
|
-
* It calls the build list executor to list EAS builds with options passed in.
|
|
11
|
-
*/
|
|
12
|
-
export default function downloadExecutor(options: ExpoEasDownloadOptions, context: ExecutorContext): AsyncGenerator<ReactNativeDownloadOutput>;
|
|
13
|
-
export declare function getBuild(workspaceRoot: string, projectRoot: string, options: ExpoEasDownloadOptions): Promise<BuildFragment>;
|
|
14
|
-
export declare function getAppExtension(platform: string, downloadFileName: string): string;
|
|
15
|
-
export declare function unzipBuild(downloadFilePath: string, outputDirectoryPath: string): any;
|
|
16
|
-
export declare function copyBuildFile(downloadFilePath: string, outputFilePath: string): Promise<void>;
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.copyBuildFile = exports.unzipBuild = exports.getAppExtension = exports.getBuild = void 0;
|
|
4
|
-
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const fs_extra_1 = require("fs-extra");
|
|
6
|
-
const node_fetch_1 = require("node-fetch");
|
|
7
|
-
const util_1 = require("util");
|
|
8
|
-
const stream_1 = require("stream");
|
|
9
|
-
const chalk = require("chalk");
|
|
10
|
-
const path_1 = require("path");
|
|
11
|
-
const tar = require("tar-fs");
|
|
12
|
-
const zlib_1 = require("zlib");
|
|
13
|
-
const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
|
|
14
|
-
const build_list_impl_1 = require("../build-list/build-list.impl");
|
|
15
|
-
const streamPipeline = (0, util_1.promisify)(stream_1.pipeline);
|
|
16
|
-
/**
|
|
17
|
-
* @deprecated TODO(v17) this executor is to be removed in NX 17. It is no longer used.
|
|
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
|
-
async function* downloadExecutor(options, context) {
|
|
22
|
-
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
23
|
-
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
|
|
24
|
-
const build = await getBuild(context.root, projectRoot, options);
|
|
25
|
-
const buildUrl = build?.artifacts?.buildUrl;
|
|
26
|
-
if (!buildUrl) {
|
|
27
|
-
throw new Error(`No build URL found.`);
|
|
28
|
-
}
|
|
29
|
-
if (!(0, fs_extra_1.existsSync)(options.output)) {
|
|
30
|
-
(0, fs_extra_1.mkdirSync)(options.output, { recursive: true });
|
|
31
|
-
}
|
|
32
|
-
const downloadFileName = buildUrl.split('/').pop();
|
|
33
|
-
const downloadFilePath = (0, path_1.join)(options.output, downloadFileName);
|
|
34
|
-
await downloadBuild(buildUrl, downloadFilePath);
|
|
35
|
-
const appExtension = getAppExtension(build.platform, downloadFileName);
|
|
36
|
-
const appName = `${(0, devkit_1.names)(build.project?.name).className}${appExtension}`;
|
|
37
|
-
const outputFilePath = (0, path_1.join)(options.output, appName);
|
|
38
|
-
if ((0, fs_extra_1.existsSync)(outputFilePath)) {
|
|
39
|
-
(0, fs_extra_1.removeSync)(outputFilePath);
|
|
40
|
-
}
|
|
41
|
-
if (downloadFileName.endsWith('.tar.gz')) {
|
|
42
|
-
await unzipBuild(downloadFilePath, options.output);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
await copyBuildFile(downloadFilePath, outputFilePath);
|
|
46
|
-
}
|
|
47
|
-
devkit_1.logger.info(`Successfully download the build to ${outputFilePath}`);
|
|
48
|
-
yield { success: true };
|
|
49
|
-
}
|
|
50
|
-
exports.default = downloadExecutor;
|
|
51
|
-
async function downloadBuild(buildUrl, output) {
|
|
52
|
-
const response = await (0, node_fetch_1.default)(buildUrl);
|
|
53
|
-
if (!response.ok)
|
|
54
|
-
throw new Error(`Unable to download the build ${buildUrl}. Error: ${response.statusText}`);
|
|
55
|
-
return streamPipeline(response.body, (0, fs_extra_1.createWriteStream)(output));
|
|
56
|
-
}
|
|
57
|
-
async function getBuild(workspaceRoot, projectRoot, options) {
|
|
58
|
-
const buildList = await (0, build_list_impl_1.runCliBuildList)(workspaceRoot, projectRoot, {
|
|
59
|
-
...options,
|
|
60
|
-
interactive: false,
|
|
61
|
-
json: true,
|
|
62
|
-
status: 'finished',
|
|
63
|
-
limit: 1,
|
|
64
|
-
});
|
|
65
|
-
const builds = JSON.parse(buildList);
|
|
66
|
-
if (!builds.length) {
|
|
67
|
-
throw new Error(`No EAS build found. Please check expo.dev to make sure your build is finished.`);
|
|
68
|
-
}
|
|
69
|
-
devkit_1.logger.info(`${chalk.bold.cyan('info')} Found build: ${buildList}`);
|
|
70
|
-
return builds[0];
|
|
71
|
-
}
|
|
72
|
-
exports.getBuild = getBuild;
|
|
73
|
-
function getAppExtension(platform, downloadFileName) {
|
|
74
|
-
platform = platform.toLowerCase();
|
|
75
|
-
if (platform === 'ios') {
|
|
76
|
-
return '.app';
|
|
77
|
-
}
|
|
78
|
-
if (downloadFileName.includes('.')) {
|
|
79
|
-
return `.${downloadFileName.split('.').pop()}`;
|
|
80
|
-
}
|
|
81
|
-
throw new Error(`Invalid build name found: ${downloadFileName}`);
|
|
82
|
-
}
|
|
83
|
-
exports.getAppExtension = getAppExtension;
|
|
84
|
-
function unzipBuild(downloadFilePath, outputDirectoryPath) {
|
|
85
|
-
const unzip = (0, zlib_1.createUnzip)();
|
|
86
|
-
const extract = tar.extract(outputDirectoryPath);
|
|
87
|
-
return streamPipeline((0, fs_extra_1.createReadStream)(downloadFilePath), unzip, extract);
|
|
88
|
-
}
|
|
89
|
-
exports.unzipBuild = unzipBuild;
|
|
90
|
-
function copyBuildFile(downloadFilePath, outputFilePath) {
|
|
91
|
-
return new Promise((resolve, reject) => {
|
|
92
|
-
(0, fs_extra_1.copyFile)(downloadFilePath, outputFilePath, (error) => {
|
|
93
|
-
if (error) {
|
|
94
|
-
reject(error);
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
resolve();
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
exports.copyBuildFile = copyBuildFile;
|
|
@@ -1,59 +0,0 @@
|
|
|
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
|
-
}
|