@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
package/package.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nx/expo",
|
|
3
|
+
"version": "16.0.0-beta.1",
|
|
4
|
+
"private": false,
|
|
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
|
+
"keywords": [
|
|
7
|
+
"Monorepo",
|
|
8
|
+
"Expo",
|
|
9
|
+
"React",
|
|
10
|
+
"Web",
|
|
11
|
+
"Jest",
|
|
12
|
+
"Native",
|
|
13
|
+
"CLI"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://nx.dev",
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/nrwl/nx/issues"
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/nrwl/nx.git",
|
|
22
|
+
"directory": "packages/expo"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"author": "Victor Savkin",
|
|
26
|
+
"main": "./index",
|
|
27
|
+
"types": "index.d.ts",
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@nrwl/expo": "16.0.0-beta.1",
|
|
30
|
+
"@nx/detox": "16.0.0-beta.1",
|
|
31
|
+
"@nx/devkit": "16.0.0-beta.1",
|
|
32
|
+
"@nx/jest": "16.0.0-beta.1",
|
|
33
|
+
"@nx/js": "16.0.0-beta.1",
|
|
34
|
+
"@nx/linter": "16.0.0-beta.1",
|
|
35
|
+
"@nx/react": "16.0.0-beta.1",
|
|
36
|
+
"@nx/webpack": "16.0.0-beta.1",
|
|
37
|
+
"chalk": "^4.1.0",
|
|
38
|
+
"enhanced-resolve": "^5.8.3",
|
|
39
|
+
"fs-extra": "^11.1.0",
|
|
40
|
+
"metro-resolver": "^0.74.1",
|
|
41
|
+
"node-fetch": "^2.6.7",
|
|
42
|
+
"tar-fs": "^2.1.1",
|
|
43
|
+
"tsconfig-paths": "^4.1.2",
|
|
44
|
+
"tsconfig-paths-webpack-plugin": "^4.0.0"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"expo": "^48.0.6"
|
|
48
|
+
},
|
|
49
|
+
"builders": "./executors.json",
|
|
50
|
+
"ng-update": {
|
|
51
|
+
"requirements": {},
|
|
52
|
+
"migrations": "./migrations.json"
|
|
53
|
+
},
|
|
54
|
+
"schematics": "./generators.json",
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"gitHead": "abf534c265f5aa3aac146e55bb31de598ea281d7"
|
|
59
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"svg-mock.js","sourceRoot":"","sources":["../../../../../packages/expo/plugins/jest/svg-mock.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,CAAC,OAAO,GAAG,SAAS,CAAC;AAC3B,MAAM,CAAC,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getResolveRequest(extensions: string[]): (_context: any, realModuleName: string, platform: string | null) => any;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getResolveRequest = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const metroResolver = require("metro-resolver");
|
|
6
|
+
const tsconfig_paths_1 = require("tsconfig-paths");
|
|
7
|
+
const chalk = require("chalk");
|
|
8
|
+
const enhanced_resolve_1 = require("enhanced-resolve");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const fs = require("fs");
|
|
11
|
+
const devkit_1 = require("@nx/devkit");
|
|
12
|
+
/*
|
|
13
|
+
* Use tsconfig to resolve additional workspace libs.
|
|
14
|
+
*
|
|
15
|
+
* This resolve function requires projectRoot to be set to
|
|
16
|
+
* workspace root in order modules and assets to be registered and watched.
|
|
17
|
+
*/
|
|
18
|
+
function getResolveRequest(extensions) {
|
|
19
|
+
return function (_context, realModuleName, platform) {
|
|
20
|
+
const debug = process.env.NX_REACT_NATIVE_DEBUG === 'true';
|
|
21
|
+
if (debug)
|
|
22
|
+
console.log(chalk.cyan(`[Nx] Resolving: ${realModuleName}`));
|
|
23
|
+
const { resolveRequest } = _context, context = tslib_1.__rest(_context, ["resolveRequest"]);
|
|
24
|
+
const resolvedPath = resolveRequestFromContext(resolveRequest, _context, realModuleName, platform, debug) ||
|
|
25
|
+
defaultMetroResolver(context, realModuleName, platform, debug) ||
|
|
26
|
+
tsconfigPathsResolver(context, extensions, realModuleName, platform, debug) ||
|
|
27
|
+
pnpmResolver(extensions, context, realModuleName, debug);
|
|
28
|
+
if (resolvedPath) {
|
|
29
|
+
return resolvedPath;
|
|
30
|
+
}
|
|
31
|
+
throw new Error(`Cannot resolve ${chalk.bold(realModuleName)}`);
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
exports.getResolveRequest = getResolveRequest;
|
|
35
|
+
function resolveRequestFromContext(resolveRequest, context, realModuleName, platform, debug) {
|
|
36
|
+
try {
|
|
37
|
+
return resolveRequest(context, realModuleName, platform);
|
|
38
|
+
}
|
|
39
|
+
catch (_a) {
|
|
40
|
+
if (debug)
|
|
41
|
+
console.log(chalk.cyan(`[Nx] Unable to resolve with default resolveRequest: ${realModuleName}`));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* This function try to resolve path using metro's default resolver
|
|
46
|
+
* @returns path if resolved, else undefined
|
|
47
|
+
*/
|
|
48
|
+
function defaultMetroResolver(context, realModuleName, platform, debug) {
|
|
49
|
+
try {
|
|
50
|
+
return metroResolver.resolve(context, realModuleName, platform);
|
|
51
|
+
}
|
|
52
|
+
catch (_a) {
|
|
53
|
+
if (debug)
|
|
54
|
+
console.log(chalk.cyan(`[Nx] Unable to resolve with default Metro resolver: ${realModuleName}`));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* This resolver try to resolve module for pnpm.
|
|
59
|
+
* @returns path if resolved, else undefined
|
|
60
|
+
* This pnpm resolver is inspired from https://github.com/vjpr/pnpm-react-native-example/blob/main/packages/pnpm-expo-helper/util/make-resolver.js
|
|
61
|
+
*/
|
|
62
|
+
function pnpmResolver(extensions, context, realModuleName, debug) {
|
|
63
|
+
try {
|
|
64
|
+
const pnpmResolve = getPnpmResolver(extensions);
|
|
65
|
+
const lookupStartPath = (0, path_1.dirname)(context.originModulePath);
|
|
66
|
+
const filePath = pnpmResolve.resolveSync({}, lookupStartPath, realModuleName);
|
|
67
|
+
if (filePath) {
|
|
68
|
+
return { type: 'sourceFile', filePath };
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
catch (_a) {
|
|
72
|
+
if (debug)
|
|
73
|
+
console.log(chalk.cyan(`[Nx] Unable to resolve with default PNPM resolver: ${realModuleName}`));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* This function try to resolve files that are specified in tsconfig's paths
|
|
78
|
+
* @returns path if resolved, else undefined
|
|
79
|
+
*/
|
|
80
|
+
function tsconfigPathsResolver(context, extensions, realModuleName, platform, debug) {
|
|
81
|
+
const tsConfigPathMatcher = getMatcher(debug);
|
|
82
|
+
const match = tsConfigPathMatcher(realModuleName, undefined, undefined, extensions.map((ext) => `.${ext}`));
|
|
83
|
+
if (match) {
|
|
84
|
+
return metroResolver.resolve(context, match, platform);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
if (debug) {
|
|
88
|
+
console.log(chalk.red(`[Nx] Failed to resolve ${chalk.bold(realModuleName)}`));
|
|
89
|
+
console.log(chalk.cyan(`[Nx] The following tsconfig paths was used:\n:${chalk.bold(JSON.stringify(paths, null, 2))}`));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
let matcher;
|
|
94
|
+
let absoluteBaseUrl;
|
|
95
|
+
let paths;
|
|
96
|
+
function getMatcher(debug) {
|
|
97
|
+
if (!matcher) {
|
|
98
|
+
const result = (0, tsconfig_paths_1.loadConfig)();
|
|
99
|
+
if (result.resultType === 'success') {
|
|
100
|
+
absoluteBaseUrl = result.absoluteBaseUrl;
|
|
101
|
+
paths = result.paths;
|
|
102
|
+
if (debug) {
|
|
103
|
+
console.log(chalk.cyan(`[Nx] Located tsconfig at ${chalk.bold(absoluteBaseUrl)}`));
|
|
104
|
+
console.log(chalk.cyan(`[Nx] Found the following paths:\n:${chalk.bold(JSON.stringify(paths, null, 2))}`));
|
|
105
|
+
}
|
|
106
|
+
matcher = (0, tsconfig_paths_1.createMatchPath)(absoluteBaseUrl, paths);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
console.log(chalk.cyan(`[Nx] Failed to locate tsconfig}`));
|
|
110
|
+
throw new Error(`Could not load tsconfig for project`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return matcher;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* This function returns resolver for pnpm.
|
|
117
|
+
* It is inspired form https://github.com/vjpr/pnpm-expo-example/blob/main/packages/pnpm-expo-helper/util/make-resolver.js.
|
|
118
|
+
*/
|
|
119
|
+
let resolver;
|
|
120
|
+
function getPnpmResolver(extensions) {
|
|
121
|
+
if (!resolver) {
|
|
122
|
+
const fileSystem = new enhanced_resolve_1.CachedInputFileSystem(fs, 4000);
|
|
123
|
+
resolver = enhanced_resolve_1.ResolverFactory.createResolver({
|
|
124
|
+
fileSystem,
|
|
125
|
+
extensions: extensions.map((extension) => '.' + extension),
|
|
126
|
+
useSyncFileSystemCalls: true,
|
|
127
|
+
modules: [(0, path_1.join)(devkit_1.workspaceRoot, 'node_modules'), 'node_modules'],
|
|
128
|
+
conditionNames: ['native', 'browser', 'require', 'default'],
|
|
129
|
+
mainFields: ['react-native', 'browser', 'main'],
|
|
130
|
+
aliasFields: ['browser'],
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return resolver;
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=metro-resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metro-resolver.js","sourceRoot":"","sources":["../../../../packages/expo/plugins/metro-resolver.ts"],"names":[],"mappings":";;;;AAAA,gDAAgD;AAEhD,mDAA6D;AAC7D,+BAA+B;AAC/B,uDAA0E;AAC1E,+BAAqC;AACrC,yBAAyB;AACzB,uCAA2C;AAE3C;;;;;GAKG;AACH,SAAgB,iBAAiB,CAAC,UAAoB;IACpD,OAAO,UACL,QAAa,EACb,cAAsB,EACtB,QAAuB;QAEvB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,MAAM,CAAC;QAE3D,IAAI,KAAK;YAAE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,mBAAmB,cAAc,EAAE,CAAC,CAAC,CAAC;QAExE,MAAM,EAAE,cAAc,KAAiB,QAAQ,EAApB,OAAO,kBAAK,QAAQ,EAAzC,kBAA8B,CAAW,CAAC;QAEhD,MAAM,YAAY,GAChB,yBAAyB,CACvB,cAAc,EACd,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,KAAK,CACN;YACD,oBAAoB,CAAC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK,CAAC;YAC9D,qBAAqB,CACnB,OAAO,EACP,UAAU,EACV,cAAc,EACd,QAAQ,EACR,KAAK,CACN;YACD,YAAY,CAAC,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,CAAC,CAAC;QAC3D,IAAI,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 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withNxMetro = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const fs_extra_1 = require("fs-extra");
|
|
7
|
+
const metro_resolver_1 = require("./metro-resolver");
|
|
8
|
+
function withNxMetro(config, opts = {}) {
|
|
9
|
+
var _a;
|
|
10
|
+
const extensions = ['', 'ts', 'tsx', 'js', 'jsx', 'json'];
|
|
11
|
+
if (opts.debug)
|
|
12
|
+
process.env.NX_REACT_NATIVE_DEBUG = 'true';
|
|
13
|
+
if (opts.extensions)
|
|
14
|
+
extensions.push(...opts.extensions);
|
|
15
|
+
config.projectRoot = opts.projectRoot || devkit_1.workspaceRoot;
|
|
16
|
+
// Add support for paths specified by tsconfig
|
|
17
|
+
config.resolver = Object.assign(Object.assign({}, config.resolver), { resolveRequest: (0, metro_resolver_1.getResolveRequest)(extensions) });
|
|
18
|
+
let watchFolders = config.watchFolders || [];
|
|
19
|
+
watchFolders = watchFolders.concat([
|
|
20
|
+
(0, path_1.join)(devkit_1.workspaceRoot, 'node_modules'),
|
|
21
|
+
(0, path_1.join)(devkit_1.workspaceRoot, (0, devkit_1.workspaceLayout)().libsDir),
|
|
22
|
+
]);
|
|
23
|
+
if ((_a = opts.watchFolders) === null || _a === void 0 ? void 0 : _a.length) {
|
|
24
|
+
watchFolders = watchFolders.concat(opts.watchFolders);
|
|
25
|
+
}
|
|
26
|
+
watchFolders = watchFolders.filter((folder) => (0, fs_extra_1.existsSync)(folder));
|
|
27
|
+
config.watchFolders = watchFolders;
|
|
28
|
+
return config;
|
|
29
|
+
}
|
|
30
|
+
exports.withNxMetro = withNxMetro;
|
|
31
|
+
//# sourceMappingURL=with-nx-metro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-nx-metro.js","sourceRoot":"","sources":["../../../../packages/expo/plugins/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|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withNxWebpack = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const tsconfig_paths_webpack_plugin_1 = require("tsconfig-paths-webpack-plugin");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated use bundler: 'metro' instead, will be removed in 16.0.0
|
|
9
|
+
* This function add additional rules to expo's webpack config to make expo web working
|
|
10
|
+
*/
|
|
11
|
+
function withNxWebpack(config) {
|
|
12
|
+
var _a;
|
|
13
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
// add additional rule to load files under libs
|
|
15
|
+
const rules = (_a = config.module.rules[1]) === null || _a === void 0 ? void 0 : _a.oneOf;
|
|
16
|
+
if (rules) {
|
|
17
|
+
rules.push({
|
|
18
|
+
test: /\.(mjs|[jt]sx?)$/,
|
|
19
|
+
exclude: /node_modules/,
|
|
20
|
+
use: {
|
|
21
|
+
loader: require.resolve('@nx/webpack/src/utils/web-babel-loader.js'),
|
|
22
|
+
options: {
|
|
23
|
+
presets: [
|
|
24
|
+
[
|
|
25
|
+
'@nrwl/react/babel',
|
|
26
|
+
{
|
|
27
|
+
runtime: 'automatic',
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
],
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
if (!config.resolve) {
|
|
36
|
+
config.resolve = {};
|
|
37
|
+
}
|
|
38
|
+
if (!config.resolve.plugins) {
|
|
39
|
+
config.resolve.plugins = [];
|
|
40
|
+
}
|
|
41
|
+
const extensions = ['.ts', '.tsx', '.mjs', '.js', '.jsx'];
|
|
42
|
+
const tsConfigPath = (0, path_1.resolve)('tsconfig.json');
|
|
43
|
+
config.resolve.plugins.push(new tsconfig_paths_webpack_plugin_1.TsconfigPathsPlugin({
|
|
44
|
+
configFile: tsConfigPath,
|
|
45
|
+
extensions,
|
|
46
|
+
}));
|
|
47
|
+
config.resolve.symlinks = true;
|
|
48
|
+
return config;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
exports.withNxWebpack = withNxWebpack;
|
|
52
|
+
//# sourceMappingURL=with-nx-webpack.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"with-nx-webpack.js","sourceRoot":"","sources":["../../../../packages/expo/plugins/with-nx-webpack.ts"],"names":[],"mappings":";;;;AAAA,iFAAoE;AACpE,+BAA+B;AAE/B;;;GAGG;AACH,SAAsB,aAAa,CAAC,MAAM;;;QACxC,+CAA+C;QAC/C,MAAM,KAAK,GAAG,MAAA,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,0CAAE,KAAK,CAAC;QAC5C,IAAI,KAAK,EAAE;YACT,KAAK,CAAC,IAAI,CAAC;gBACT,IAAI,EAAE,kBAAkB;gBACxB,OAAO,EAAE,cAAc;gBACvB,GAAG,EAAE;oBACH,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,2CAA2C,CAAC;oBACpE,OAAO,EAAE;wBACP,OAAO,EAAE;4BACP;gCACE,mBAAmB;gCACnB;oCACE,OAAO,EAAE,WAAW;iCACrB;6BACF;yBACF;qBACF;iBACF;aACF,CAAC,CAAC;SACJ;QAED,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE;YACnB,MAAM,CAAC,OAAO,GAAG,EAAE,CAAC;SACrB;QACD,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE;YAC3B,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,EAAE,CAAC;SAC7B;QAED,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,YAAY,GAAG,IAAA,cAAO,EAAC,eAAe,CAAC,CAAC;QAE9C,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CACzB,IAAI,mDAAmB,CAAC;YACtB,UAAU,EAAE,YAAY;YACxB,UAAU;SACX,CAAC,CACH,CAAC;QAEF,MAAM,CAAC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC;QAC/B,OAAO,MAAM,CAAC;;CACf;AA1CD,sCA0CC"}
|
package/project.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "expo",
|
|
3
|
+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
+
"sourceRoot": "packages/expo/src",
|
|
5
|
+
"projectType": "library",
|
|
6
|
+
"targets": {
|
|
7
|
+
"lint": {},
|
|
8
|
+
"test": {},
|
|
9
|
+
"build-base": {
|
|
10
|
+
"executor": "@nrwl/js:tsc",
|
|
11
|
+
"options": {
|
|
12
|
+
"assets": [
|
|
13
|
+
"packages/expo/*.md",
|
|
14
|
+
{
|
|
15
|
+
"input": "packages/expo",
|
|
16
|
+
"glob": "**/!(*.ts)",
|
|
17
|
+
"output": "/"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"input": "packages/expo",
|
|
21
|
+
"glob": "**/*.d.ts",
|
|
22
|
+
"output": "/"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"input": "packages/expo",
|
|
26
|
+
"glob": "**/files/**",
|
|
27
|
+
"output": "/"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"input": "packages/expo",
|
|
31
|
+
"glob": "**/files/**/.gitkeep",
|
|
32
|
+
"output": "/"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"input": "packages/expo",
|
|
36
|
+
"glob": "**/files/**/.babelrc.js.template",
|
|
37
|
+
"output": "/"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"input": "packages/expo",
|
|
41
|
+
"glob": "**/*.json",
|
|
42
|
+
"ignore": ["**/tsconfig*.json", "**/project.json"],
|
|
43
|
+
"output": "/"
|
|
44
|
+
},
|
|
45
|
+
"LICENSE"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"build": {
|
|
50
|
+
"executor": "nx:run-commands",
|
|
51
|
+
"outputs": ["{workspaceRoot}/build/packages/expo"],
|
|
52
|
+
"options": {
|
|
53
|
+
"commands": [
|
|
54
|
+
"node ./scripts/copy-readme.js expo",
|
|
55
|
+
"node ./scripts/add-dependency-to-build.js expo @nrwl/expo"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"tags": []
|
|
61
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { ExpoEasBuildOptions } from './schema';
|
|
3
|
+
export interface ReactNativeBuildOutput {
|
|
4
|
+
success: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default function buildExecutor(options: ExpoEasBuildOptions, context: ExecutorContext): AsyncGenerator<ReactNativeBuildOutput>;
|
|
@@ -0,0 +1,62 @@
|
|
|
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 path_1 = require("path");
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
|
|
8
|
+
let childProcess;
|
|
9
|
+
function buildExecutor(options, context) {
|
|
10
|
+
return tslib_1.__asyncGenerator(this, arguments, function* buildExecutor_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(runCliBuild(context.root, projectRoot, options));
|
|
15
|
+
yield yield tslib_1.__await({ success: true });
|
|
16
|
+
}
|
|
17
|
+
finally {
|
|
18
|
+
if (childProcess) {
|
|
19
|
+
childProcess.kill();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
exports.default = buildExecutor;
|
|
25
|
+
function runCliBuild(workspaceRoot, projectRoot, options) {
|
|
26
|
+
return new Promise((resolve, reject) => {
|
|
27
|
+
childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/eas-cli/bin/run'), ['build', ...createBuildOptions(options)], { cwd: (0, path_1.join)(workspaceRoot, projectRoot), env: process.env });
|
|
28
|
+
// Ensure the child process is killed when the parent exits
|
|
29
|
+
process.on('exit', () => childProcess.kill());
|
|
30
|
+
process.on('SIGTERM', () => childProcess.kill());
|
|
31
|
+
childProcess.on('error', (err) => {
|
|
32
|
+
reject(err);
|
|
33
|
+
});
|
|
34
|
+
childProcess.on('exit', (code) => {
|
|
35
|
+
if (code === 0) {
|
|
36
|
+
resolve(code);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
reject(code);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function createBuildOptions(options) {
|
|
45
|
+
return Object.keys(options).reduce((acc, k) => {
|
|
46
|
+
const v = options[k];
|
|
47
|
+
if (typeof v === 'boolean') {
|
|
48
|
+
if (v === true) {
|
|
49
|
+
// when true, does not need to pass the value true, just need to pass the flag in kebob case
|
|
50
|
+
acc.push(`--${(0, devkit_1.names)(k).fileName}`);
|
|
51
|
+
}
|
|
52
|
+
if (v === false && k === 'wait') {
|
|
53
|
+
acc.push('--no-wait');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
acc.push(`--${(0, devkit_1.names)(k).fileName}`, v);
|
|
58
|
+
}
|
|
59
|
+
return acc;
|
|
60
|
+
}, []);
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=build.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.impl.js","sourceRoot":"","sources":["../../../../../../packages/expo/src/executors/build/build.impl.ts"],"names":[],"mappings":";;;AAAA,uCAAoD;AACpD,+BAA4B;AAC5B,iDAAmD;AAEnD,yFAAmF;AAQnF,IAAI,YAA0B,CAAC;AAE/B,SAA+B,aAAa,CAC1C,OAA4B,EAC5B,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,sBAAM,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA,CAAC;YACtD,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;AAhBD,gCAgBC;AAED,SAAS,WAAW,CAClB,aAAqB,EACrB,WAAmB,EACnB,OAA4B;IAE5B,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,OAAO,EAAE,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC,EACzC,EAAE,GAAG,EAAE,IAAA,WAAI,EAAC,aAAa,EAAE,WAAW,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAC5D,CAAC;QAEF,2DAA2D;QAC3D,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;QAC9C,OAAO,CAAC,EAAE,CAAC,SAAS,EAA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const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const build_impl_1 = require("./build.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(build_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/expo/src/executors/build/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,6CAAyC;AAEzC,kBAAe,IAAA,0BAAiB,EAAC,oBAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// command to run https://github.com/expo/eas-cli/tree/main#eas-build
|
|
2
|
+
// options from github.com/expo/eas-cli/blob/main/packages/eas-cli/src/commands/build/index.ts
|
|
3
|
+
export interface ExpoEasBuildOptions {
|
|
4
|
+
platform: 'ios' | 'android' | 'all';
|
|
5
|
+
profile?: string;
|
|
6
|
+
nonInteractive: boolean; // default is false
|
|
7
|
+
local: boolean; // default is false
|
|
8
|
+
output?: string;
|
|
9
|
+
wait: boolean; // default is true
|
|
10
|
+
clearCache: boolean; // default is false
|
|
11
|
+
json: boolean; // default is false
|
|
12
|
+
autoSubmit: boolean; // default is false
|
|
13
|
+
autoSubmitWithProfile?: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"$schema": "http://json-schema.org/schema",
|
|
5
|
+
"$id": "NxExpoEasBuild",
|
|
6
|
+
"cli": "nx",
|
|
7
|
+
"title": "Expo EAS Build executor",
|
|
8
|
+
"description": "Start an EAS build 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, exaple values: ios, android, all.",
|
|
15
|
+
"x-priority": "important"
|
|
16
|
+
},
|
|
17
|
+
"json": {
|
|
18
|
+
"type": "boolean",
|
|
19
|
+
"description": "Enable JSON output, non-JSON messages will be printed to stderr",
|
|
20
|
+
"default": false
|
|
21
|
+
},
|
|
22
|
+
"profile": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "Name of the build profile from eas.json. Defaults to \"production\" if defined in eas.json.",
|
|
25
|
+
"examples": ["production", "development", "preview"],
|
|
26
|
+
"x-priority": "important"
|
|
27
|
+
},
|
|
28
|
+
"nonInteractive": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "Run command in non-interactive mode",
|
|
31
|
+
"default": false
|
|
32
|
+
},
|
|
33
|
+
"local": {
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"description": "Run build locally [experimental]",
|
|
36
|
+
"default": false
|
|
37
|
+
},
|
|
38
|
+
"wait": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"description": "Wait for build(s) to complete",
|
|
41
|
+
"default": true
|
|
42
|
+
},
|
|
43
|
+
"clearCache": {
|
|
44
|
+
"type": "boolean",
|
|
45
|
+
"description": "Clear cache before the build",
|
|
46
|
+
"default": false
|
|
47
|
+
},
|
|
48
|
+
"autoSubmit": {
|
|
49
|
+
"type": "boolean",
|
|
50
|
+
"description": "Submit on build complete using the submit profile with the same name as the build profile",
|
|
51
|
+
"default": false
|
|
52
|
+
},
|
|
53
|
+
"autoSubmitWithProfile": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "Submit on build complete using the submit profile with provided name",
|
|
56
|
+
"examples": ["production", "development", "preview"]
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"required": []
|
|
60
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// build fragment from https://github.com/expo/eas-cli/blob/main/packages/eas-cli/src/graphql/generated.ts
|
|
2
|
+
|
|
3
|
+
export interface BuildFragment {
|
|
4
|
+
__typename?: 'Build';
|
|
5
|
+
id: string;
|
|
6
|
+
status: BuildStatus;
|
|
7
|
+
platform: AppPlatform;
|
|
8
|
+
channel?: string | null;
|
|
9
|
+
releaseChannel?: string | null;
|
|
10
|
+
distribution?: DistributionType | null;
|
|
11
|
+
iosEnterpriseProvisioning?: BuildIosEnterpriseProvisioning | null;
|
|
12
|
+
buildProfile?: string | null;
|
|
13
|
+
sdkVersion?: string | null;
|
|
14
|
+
appVersion?: string | null;
|
|
15
|
+
appBuildVersion?: string | null;
|
|
16
|
+
runtimeVersion?: string | null;
|
|
17
|
+
gitCommitHash?: string | null;
|
|
18
|
+
gitCommitMessage?: string | null;
|
|
19
|
+
initialQueuePosition?: number | null;
|
|
20
|
+
queuePosition?: number | null;
|
|
21
|
+
estimatedWaitTimeLeftSeconds?: number | null;
|
|
22
|
+
priority: BuildPriority;
|
|
23
|
+
createdAt: any;
|
|
24
|
+
updatedAt: any;
|
|
25
|
+
message?: string | null;
|
|
26
|
+
completedAt?: any | null;
|
|
27
|
+
resourceClass: BuildResourceClass;
|
|
28
|
+
error?: {
|
|
29
|
+
__typename?: 'BuildError';
|
|
30
|
+
errorCode: string;
|
|
31
|
+
message: string;
|
|
32
|
+
docsUrl?: string | null;
|
|
33
|
+
} | null;
|
|
34
|
+
artifacts?: {
|
|
35
|
+
__typename?: 'BuildArtifacts';
|
|
36
|
+
buildUrl?: string | null;
|
|
37
|
+
xcodeBuildLogsUrl?: string | null;
|
|
38
|
+
applicationArchiveUrl?: string | null;
|
|
39
|
+
} | null;
|
|
40
|
+
initiatingActor?:
|
|
41
|
+
| { __typename: 'Robot'; id: string; displayName: string }
|
|
42
|
+
| { __typename: 'SSOUser'; id: string; displayName: string }
|
|
43
|
+
| { __typename: 'User'; id: string; displayName: string }
|
|
44
|
+
| null;
|
|
45
|
+
project:
|
|
46
|
+
| {
|
|
47
|
+
__typename: 'App';
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
slug: string;
|
|
51
|
+
ownerAccount: { __typename?: 'Account'; id: string; name: string };
|
|
52
|
+
}
|
|
53
|
+
| { __typename: 'Snack'; id: string; name: string; slug: string };
|
|
54
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { ExpoEasBuildListOptions } from './schema';
|
|
3
|
+
export interface ReactNativeBuildListOutput {
|
|
4
|
+
success: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default function buildListExecutor(options: ExpoEasBuildListOptions, context: ExecutorContext): AsyncGenerator<ReactNativeBuildListOutput>;
|
|
7
|
+
export declare function runCliBuildList(workspaceRoot: string, projectRoot: string, options: ExpoEasBuildListOptions): Promise<string>;
|