@nx/expo 0.0.0-pr-22179-271588f

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.
Files changed (194) hide show
  1. package/.eslintrc.json +46 -0
  2. package/LICENSE +22 -0
  3. package/README.md +68 -0
  4. package/docs/build-list-examples.md +71 -0
  5. package/docs/export-examples.md +112 -0
  6. package/docs/prebuild-examples.md +70 -0
  7. package/docs/run-examples.md +91 -0
  8. package/docs/start-examples.md +104 -0
  9. package/executors.json +64 -0
  10. package/generators.json +33 -0
  11. package/index.d.ts +3 -0
  12. package/index.js +9 -0
  13. package/migrations.json +689 -0
  14. package/package.json +57 -0
  15. package/plugin.d.ts +1 -0
  16. package/plugin.js +6 -0
  17. package/plugins/jest/svg-mock.d.ts +0 -0
  18. package/plugins/jest/svg-mock.js +3 -0
  19. package/plugins/metro-resolver.d.ts +1 -0
  20. package/plugins/metro-resolver.js +136 -0
  21. package/plugins/plugin.d.ts +14 -0
  22. package/plugins/plugin.js +150 -0
  23. package/plugins/with-nx-metro.d.ts +8 -0
  24. package/plugins/with-nx-metro.js +31 -0
  25. package/plugins/with-nx-webpack.d.ts +5 -0
  26. package/plugins/with-nx-webpack.js +51 -0
  27. package/project.json +61 -0
  28. package/src/executors/build/build.impl.d.ts +6 -0
  29. package/src/executors/build/build.impl.js +70 -0
  30. package/src/executors/build/schema.d.ts +14 -0
  31. package/src/executors/build/schema.json +83 -0
  32. package/src/executors/build-list/build-fragment.d.ts +54 -0
  33. package/src/executors/build-list/build-list.impl.d.ts +7 -0
  34. package/src/executors/build-list/build-list.impl.js +81 -0
  35. package/src/executors/build-list/schema.d.ts +25 -0
  36. package/src/executors/build-list/schema.json +79 -0
  37. package/src/executors/ensure-symlink/ensure-symlink.impl.d.ts +9 -0
  38. package/src/executors/ensure-symlink/ensure-symlink.impl.js +13 -0
  39. package/src/executors/ensure-symlink/schema.json +11 -0
  40. package/src/executors/export/export.impl.d.ts +7 -0
  41. package/src/executors/export/export.impl.js +73 -0
  42. package/src/executors/export/schema.d.ts +13 -0
  43. package/src/executors/export/schema.json +49 -0
  44. package/src/executors/install/install.impl.d.ts +7 -0
  45. package/src/executors/install/install.impl.js +63 -0
  46. package/src/executors/install/schema.d.ts +7 -0
  47. package/src/executors/install/schema.json +34 -0
  48. package/src/executors/prebuild/prebuild.impl.d.ts +7 -0
  49. package/src/executors/prebuild/prebuild.impl.js +69 -0
  50. package/src/executors/prebuild/schema.d.ts +7 -0
  51. package/src/executors/prebuild/schema.json +36 -0
  52. package/src/executors/run/run.impl.d.ts +6 -0
  53. package/src/executors/run/run.impl.js +96 -0
  54. package/src/executors/run/schema.d.ts +24 -0
  55. package/src/executors/run/schema.json +65 -0
  56. package/src/executors/serve/lib/is-packager-running.d.ts +1 -0
  57. package/src/executors/serve/lib/is-packager-running.js +15 -0
  58. package/src/executors/serve/schema.d.ts +7 -0
  59. package/src/executors/serve/schema.json +35 -0
  60. package/src/executors/serve/serve.impl.d.ts +11 -0
  61. package/src/executors/serve/serve.impl.js +105 -0
  62. package/src/executors/start/schema.d.ts +22 -0
  63. package/src/executors/start/schema.json +93 -0
  64. package/src/executors/start/start.impl.d.ts +7 -0
  65. package/src/executors/start/start.impl.js +77 -0
  66. package/src/executors/submit/schema.d.ts +12 -0
  67. package/src/executors/submit/schema.json +57 -0
  68. package/src/executors/submit/submit.impl.d.ts +6 -0
  69. package/src/executors/submit/submit.impl.js +70 -0
  70. package/src/executors/sync-deps/schema.d.ts +5 -0
  71. package/src/executors/sync-deps/schema.json +33 -0
  72. package/src/executors/sync-deps/sync-deps.impl.d.ts +9 -0
  73. package/src/executors/sync-deps/sync-deps.impl.js +78 -0
  74. package/src/executors/update/schema.d.ts +15 -0
  75. package/src/executors/update/schema.json +75 -0
  76. package/src/executors/update/update.impl.d.ts +6 -0
  77. package/src/executors/update/update.impl.js +67 -0
  78. package/src/generators/application/application.d.ts +5 -0
  79. package/src/generators/application/application.js +63 -0
  80. package/src/generators/application/files/.babelrc.js.template +6 -0
  81. package/src/generators/application/files/app.json.template +44 -0
  82. package/src/generators/application/files/assets/adaptive-icon.png +0 -0
  83. package/src/generators/application/files/assets/favicon.png +0 -0
  84. package/src/generators/application/files/assets/icon.png +0 -0
  85. package/src/generators/application/files/assets/splash.png +0 -0
  86. package/src/generators/application/files/eas.json.template +25 -0
  87. package/src/generators/application/files/index.js.template +8 -0
  88. package/src/generators/application/files/metro.config.js.template +33 -0
  89. package/src/generators/application/files/package.json.template +18 -0
  90. package/src/generators/application/files/src/app/App.spec.tsx.template +9 -0
  91. package/src/generators/application/files/src/app/App.tsx.template +731 -0
  92. package/src/generators/application/files/test-setup.ts.template +1 -0
  93. package/src/generators/application/files/tsconfig.app.json.template +10 -0
  94. package/src/generators/application/files/tsconfig.json.template +20 -0
  95. package/src/generators/application/files/webpack.config.js.template +57 -0
  96. package/src/generators/application/lib/add-e2e.d.ts +3 -0
  97. package/src/generators/application/lib/add-e2e.js +87 -0
  98. package/src/generators/application/lib/add-eas-scripts.d.ts +2 -0
  99. package/src/generators/application/lib/add-eas-scripts.js +74 -0
  100. package/src/generators/application/lib/add-project.d.ts +3 -0
  101. package/src/generators/application/lib/add-project.js +91 -0
  102. package/src/generators/application/lib/create-application-files.d.ts +3 -0
  103. package/src/generators/application/lib/create-application-files.js +27 -0
  104. package/src/generators/application/lib/normalize-options.d.ts +13 -0
  105. package/src/generators/application/lib/normalize-options.js +42 -0
  106. package/src/generators/application/schema.d.ts +22 -0
  107. package/src/generators/application/schema.json +94 -0
  108. package/src/generators/component/component.d.ts +5 -0
  109. package/src/generators/component/component.js +62 -0
  110. package/src/generators/component/files/__fileName__.spec.tsx.template +11 -0
  111. package/src/generators/component/files/__fileName__.tsx.template +32 -0
  112. package/src/generators/component/lib/add-import.d.ts +3 -0
  113. package/src/generators/component/lib/add-import.js +29 -0
  114. package/src/generators/component/lib/normalize-options.d.ts +10 -0
  115. package/src/generators/component/lib/normalize-options.js +50 -0
  116. package/src/generators/component/schema.d.ts +25 -0
  117. package/src/generators/component/schema.json +90 -0
  118. package/src/generators/init/init.d.ts +6 -0
  119. package/src/generators/init/init.js +74 -0
  120. package/src/generators/init/lib/add-git-ignore-entry.d.ts +2 -0
  121. package/src/generators/init/lib/add-git-ignore-entry.js +17 -0
  122. package/src/generators/init/lib/gitignore-entries.d.ts +1 -0
  123. package/src/generators/init/lib/gitignore-entries.js +19 -0
  124. package/src/generators/init/schema.d.ts +7 -0
  125. package/src/generators/init/schema.json +33 -0
  126. package/src/generators/library/files/lib/.babelrc.js.template +21 -0
  127. package/src/generators/library/files/lib/README.md +7 -0
  128. package/src/generators/library/files/lib/package.json.template +5 -0
  129. package/src/generators/library/files/lib/src/index.ts.template +0 -0
  130. package/src/generators/library/files/lib/test-setup.ts.template +1 -0
  131. package/src/generators/library/files/lib/tsconfig.json.template +16 -0
  132. package/src/generators/library/files/lib/tsconfig.lib.json.template +9 -0
  133. package/src/generators/library/lib/normalize-options.d.ts +11 -0
  134. package/src/generators/library/lib/normalize-options.js +35 -0
  135. package/src/generators/library/library.d.ts +5 -0
  136. package/src/generators/library/library.js +159 -0
  137. package/src/generators/library/schema.d.ts +25 -0
  138. package/src/generators/library/schema.json +104 -0
  139. package/src/migrations/update-15-0-3/add-new-expo-cli-targets.d.ts +9 -0
  140. package/src/migrations/update-15-0-3/add-new-expo-cli-targets.js +61 -0
  141. package/src/migrations/update-15-0-3/change-jest-preset.d.ts +8 -0
  142. package/src/migrations/update-15-0-3/change-jest-preset.js +69 -0
  143. package/src/migrations/update-15-8-3/change-webpack-to-metro.d.ts +8 -0
  144. package/src/migrations/update-15-8-3/change-webpack-to-metro.js +31 -0
  145. package/src/migrations/update-16-0-0/add-jest-expo.d.ts +6 -0
  146. package/src/migrations/update-16-0-0/add-jest-expo.js +27 -0
  147. package/src/migrations/update-16-0-0/remove-deprecated-targets.d.ts +5 -0
  148. package/src/migrations/update-16-0-0/remove-deprecated-targets.js +32 -0
  149. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
  150. package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +9 -0
  151. package/src/migrations/update-16-1-4/update-eas-scripts.d.ts +5 -0
  152. package/src/migrations/update-16-1-4/update-eas-scripts.js +42 -0
  153. package/src/migrations/update-16-2-2/add-submit-target.d.ts +5 -0
  154. package/src/migrations/update-16-2-2/add-submit-target.js +22 -0
  155. package/src/migrations/update-16-6-0/add-depends-on.d.ts +6 -0
  156. package/src/migrations/update-16-6-0/add-depends-on.js +29 -0
  157. package/src/migrations/update-16-6-0/update-metro-config.d.ts +6 -0
  158. package/src/migrations/update-16-6-0/update-metro-config.js +65 -0
  159. package/src/migrations/update-16-9-0/remove-types-react-native.d.ts +7 -0
  160. package/src/migrations/update-16-9-0/remove-types-react-native.js +13 -0
  161. package/src/migrations/update-16-9-0/update-eas-cli-version.d.ts +2 -0
  162. package/src/migrations/update-16-9-0/update-eas-cli-version.js +17 -0
  163. package/src/migrations/update-18-0-0/change-outputDir-export-target.d.ts +5 -0
  164. package/src/migrations/update-18-0-0/change-outputDir-export-target.js +25 -0
  165. package/src/migrations/update-18-0-0/remove-block-list.d.ts +6 -0
  166. package/src/migrations/update-18-0-0/remove-block-list.js +28 -0
  167. package/src/migrations/update-18-0-0/remove-eas-cli.d.ts +12 -0
  168. package/src/migrations/update-18-0-0/remove-eas-cli.js +18 -0
  169. package/src/migrations/update-18-0-0/remove-symlink-target.d.ts +6 -0
  170. package/src/migrations/update-18-0-0/remove-symlink-target.js +29 -0
  171. package/src/utils/add-jest.d.ts +2 -0
  172. package/src/utils/add-jest.js +47 -0
  173. package/src/utils/add-linting.d.ts +13 -0
  174. package/src/utils/add-linting.js +37 -0
  175. package/src/utils/ensure-dependencies.d.ts +2 -0
  176. package/src/utils/ensure-dependencies.js +24 -0
  177. package/src/utils/ensure-node-modules-symlink.d.ts +9 -0
  178. package/src/utils/ensure-node-modules-symlink.js +28 -0
  179. package/src/utils/find-all-npm-dependencies.d.ts +2 -0
  180. package/src/utils/find-all-npm-dependencies.js +27 -0
  181. package/src/utils/has-expo-plugin.d.ts +2 -0
  182. package/src/utils/has-expo-plugin.js +11 -0
  183. package/src/utils/init-root-babel-config.d.ts +2 -0
  184. package/src/utils/init-root-babel-config.js +13 -0
  185. package/src/utils/pod-install-task.d.ts +16 -0
  186. package/src/utils/pod-install-task.js +66 -0
  187. package/src/utils/resolve-eas.d.ts +1 -0
  188. package/src/utils/resolve-eas.js +36 -0
  189. package/src/utils/versions.d.ts +19 -0
  190. package/src/utils/versions.js +22 -0
  191. package/tsconfig.json +13 -0
  192. package/tsconfig.lib.json +11 -0
  193. package/tsconfig.spec.json +20 -0
  194. package/typings/svg.d.ts +6 -0
@@ -0,0 +1,83 @@
1
+ {
2
+ "version": 2,
3
+ "outputCapture": "direct-nodejs",
4
+ "$schema": "https://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
+ "presets": [
11
+ {
12
+ "name": "Build for a specific platform",
13
+ "keys": ["platform"]
14
+ },
15
+ {
16
+ "name": "Build using a specific profile",
17
+ "keys": ["profile"]
18
+ },
19
+ {
20
+ "name": "Run build locally",
21
+ "keys": ["local"]
22
+ },
23
+ {
24
+ "name": "Clear cache before the build",
25
+ "keys": ["clearCache"]
26
+ }
27
+ ],
28
+ "properties": {
29
+ "platform": {
30
+ "enum": ["ios", "android", "all"],
31
+ "alias": "p",
32
+ "description": "The platform to build the app, exaple values: ios, android, all.",
33
+ "x-priority": "important"
34
+ },
35
+ "json": {
36
+ "type": "boolean",
37
+ "description": "Enable JSON output, non-JSON messages will be printed to stderr",
38
+ "default": false
39
+ },
40
+ "profile": {
41
+ "type": "string",
42
+ "description": "Name of the build profile from eas.json. Defaults to \"production\" if defined in eas.json.",
43
+ "examples": ["production", "development", "preview"],
44
+ "x-priority": "important"
45
+ },
46
+ "interactive": {
47
+ "type": "boolean",
48
+ "description": "Run command in interactive mode",
49
+ "default": true
50
+ },
51
+ "local": {
52
+ "type": "boolean",
53
+ "description": "Run build locally [experimental]",
54
+ "default": false
55
+ },
56
+ "output": {
57
+ "type": "string",
58
+ "description": "Output path for local build",
59
+ "examples": ["../../dist/MyApp.tar.gz", "../../dist"]
60
+ },
61
+ "wait": {
62
+ "type": "boolean",
63
+ "description": "Wait for build(s) to complete",
64
+ "default": true
65
+ },
66
+ "clearCache": {
67
+ "type": "boolean",
68
+ "description": "Clear cache before the build",
69
+ "default": false
70
+ },
71
+ "autoSubmit": {
72
+ "type": "boolean",
73
+ "description": "Submit on build complete using the submit profile with the same name as the build profile",
74
+ "default": false
75
+ },
76
+ "autoSubmitWithProfile": {
77
+ "type": "string",
78
+ "description": "Submit on build complete using the submit profile with provided name",
79
+ "examples": ["production", "development", "preview"]
80
+ }
81
+ },
82
+ "required": []
83
+ }
@@ -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>;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runCliBuildList = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const path_1 = require("path");
6
+ const child_process_1 = require("child_process");
7
+ const resolve_eas_1 = require("../../utils/resolve-eas");
8
+ let childProcess;
9
+ async function* buildListExecutor(options, context) {
10
+ const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
11
+ try {
12
+ if (options.json) {
13
+ // when json is true, interactive has to be false
14
+ options.interactive = false;
15
+ }
16
+ await runCliBuildList(context.root, projectRoot, options);
17
+ yield { success: true };
18
+ }
19
+ finally {
20
+ if (childProcess) {
21
+ childProcess.kill();
22
+ }
23
+ }
24
+ }
25
+ exports.default = buildListExecutor;
26
+ function runCliBuildList(workspaceRoot, projectRoot, options) {
27
+ return new Promise((resolve, reject) => {
28
+ childProcess = (0, child_process_1.fork)((0, resolve_eas_1.resolveEas)(workspaceRoot), ['build:list', ...createBuildListOptions(options)], {
29
+ cwd: (0, path_1.resolve)(workspaceRoot, projectRoot),
30
+ env: process.env,
31
+ stdio: ['inherit', 'pipe', 'inherit', 'ipc'], // only stream stdout on child process
32
+ });
33
+ // Ensure the child process is killed when the parent exits
34
+ process.on('exit', () => childProcess.kill());
35
+ process.on('SIGTERM', () => childProcess.kill());
36
+ let output = '';
37
+ childProcess.stdout.on('data', (message) => {
38
+ output += message.toString();
39
+ devkit_1.logger.info(message.toString());
40
+ // when interactive is false, resolve the promise when the child process exits
41
+ if (options.interactive === false) {
42
+ resolve(message.toString());
43
+ }
44
+ });
45
+ childProcess.on('error', (err) => {
46
+ reject(err);
47
+ });
48
+ childProcess.on('exit', (code) => {
49
+ if (code === 0) {
50
+ resolve(output);
51
+ }
52
+ else {
53
+ reject(code);
54
+ }
55
+ });
56
+ });
57
+ }
58
+ exports.runCliBuildList = runCliBuildList;
59
+ const nxOptions = ['output'];
60
+ function createBuildListOptions(options) {
61
+ return Object.keys(options).reduce((acc, optionKey) => {
62
+ const optionValue = options[optionKey];
63
+ if (!nxOptions.includes(optionKey)) {
64
+ if (optionKey === 'interactive') {
65
+ if (optionValue === false) {
66
+ acc.push(`--non-interactive`);
67
+ }
68
+ }
69
+ else if (typeof optionValue === 'boolean') {
70
+ if (optionValue === true) {
71
+ // when true, does not need to pass the value true, just need to pass the flag in camel case
72
+ acc.push(`--${(0, devkit_1.names)(optionKey).propertyName}`);
73
+ }
74
+ }
75
+ else {
76
+ acc.push(`--${(0, devkit_1.names)(optionKey).propertyName}`, optionValue);
77
+ }
78
+ }
79
+ return acc;
80
+ }, []);
81
+ }
@@ -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": "https://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,9 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ export interface ExpoEnsureSymlinkOutput {
3
+ success: boolean;
4
+ }
5
+ /**
6
+ * TODO (@xiongemi): remove this function in v19.
7
+ * @deprecated It is no longer needed for react native 73.
8
+ */
9
+ export default function ensureSymlinkExecutor(_: any, context: ExecutorContext): AsyncGenerator<ExpoEnsureSymlinkOutput>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
4
+ /**
5
+ * TODO (@xiongemi): remove this function in v19.
6
+ * @deprecated It is no longer needed for react native 73.
7
+ */
8
+ async function* ensureSymlinkExecutor(_, context) {
9
+ const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
10
+ (0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
11
+ yield { success: true };
12
+ }
13
+ exports.default = ensureSymlinkExecutor;
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 2,
3
+ "outputCapture": "direct-nodejs",
4
+ "cli": "nx",
5
+ "$id": "NxExpoEnsureSymlink",
6
+ "$schema": "https://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,7 @@
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>;
7
+ export declare function createExportOptions(options: ExportExecutorSchema, projectRoot: string): any[];
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createExportOptions = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const child_process_1 = require("child_process");
6
+ const path_1 = require("path");
7
+ let childProcess;
8
+ async function* exportExecutor(options, context) {
9
+ const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
10
+ try {
11
+ await exportAsync(context.root, projectRoot, options);
12
+ yield {
13
+ success: true,
14
+ };
15
+ }
16
+ finally {
17
+ if (childProcess) {
18
+ childProcess.kill();
19
+ }
20
+ }
21
+ }
22
+ exports.default = exportExecutor;
23
+ function exportAsync(workspaceRoot, projectRoot, options) {
24
+ return new Promise((resolve, reject) => {
25
+ childProcess = (0, child_process_1.fork)(require.resolve('@expo/cli/build/bin/cli'), [`export`, ...createExportOptions(options, projectRoot)], { cwd: (0, path_1.resolve)(workspaceRoot, projectRoot), env: process.env });
26
+ // Ensure the child process is killed when the parent exits
27
+ process.on('exit', () => childProcess.kill());
28
+ process.on('SIGTERM', () => childProcess.kill());
29
+ childProcess.on('error', (err) => {
30
+ reject(err);
31
+ });
32
+ childProcess.on('exit', (code) => {
33
+ if (code === 0) {
34
+ resolve(code);
35
+ }
36
+ else {
37
+ reject(code);
38
+ }
39
+ });
40
+ });
41
+ }
42
+ const nxOptions = ['bundler', 'interactive']; // interactive is passed in by e2e tests
43
+ // options from https://github.com/expo/expo/blob/main/packages/@expo/cli/src/export/index.ts
44
+ function createExportOptions(options, projectRoot) {
45
+ return Object.keys(options).reduce((acc, k) => {
46
+ if (!nxOptions.includes(k)) {
47
+ const v = options[k];
48
+ switch (k) {
49
+ case 'outputDir':
50
+ const path = (0, devkit_1.joinPathFragments)((0, devkit_1.offsetFromRoot)(projectRoot), v); // need to add offset for the outputDir
51
+ acc.push('--output-dir', path);
52
+ break;
53
+ case 'minify':
54
+ if (v === false) {
55
+ acc.push('--no-minify'); // cli only accpets --no-minify
56
+ }
57
+ break;
58
+ default:
59
+ if (typeof v === 'boolean') {
60
+ if (v === true) {
61
+ // when true, does not need to pass the value true, just need to pass the flag in kebob case
62
+ acc.push(`--${(0, devkit_1.names)(k).fileName}`);
63
+ }
64
+ }
65
+ else {
66
+ acc.push(`--${(0, devkit_1.names)(k).fileName}`, v);
67
+ }
68
+ }
69
+ }
70
+ return acc;
71
+ }, []);
72
+ }
73
+ exports.createExportOptions = createExportOptions;
@@ -0,0 +1,13 @@
1
+ // options form https://github.com/expo/expo/blob/main/packages/%40expo/cli/src/export/resolveOptions.ts
2
+ // https://github.com/expo/expo/blob/main/packages/%40expo/cli/src/export/index.ts
3
+
4
+ export interface ExportExecutorSchema {
5
+ platform?: 'ios' | 'android' | 'all' | 'web'; // default is 'all'
6
+ outputDir?: string;
7
+ clear?: boolean;
8
+ dev?: boolean;
9
+ minify?: boolean;
10
+ maxWorkers?: number;
11
+ dumpAssetmap?: boolean;
12
+ sourcemap?: boolean;
13
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "cli": "nx",
3
+ "version": 2,
4
+ "outputCapture": "direct-nodejs",
5
+ "$id": "NxExpoExport",
6
+ "$schema": "https://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
+ "default": "all",
15
+ "alias": "p",
16
+ "x-priority": "important"
17
+ },
18
+ "dev": {
19
+ "type": "boolean",
20
+ "description": "Configure static files for developing locally using a non-https server"
21
+ },
22
+ "clear": {
23
+ "type": "boolean",
24
+ "description": "Clear the bundler cache before exporting"
25
+ },
26
+ "minify": {
27
+ "type": "boolean",
28
+ "description": "Minify source"
29
+ },
30
+ "outputDir": {
31
+ "type": "string",
32
+ "description": "Relative to workspace root, the directory to export the static files to. Default: dist"
33
+ },
34
+ "maxWorkers": {
35
+ "type": "number",
36
+ "description": "When bundler is metro, the maximum number of tasks to allow the bundler to spawn"
37
+ },
38
+ "dumpAssetmap": {
39
+ "type": "boolean",
40
+ "description": "When bundler is metro, whether to dump the asset map for further processing"
41
+ },
42
+ "sourceMaps": {
43
+ "type": "boolean",
44
+ "description": "When bundler is metro, whether to emit JavaScript source maps"
45
+ }
46
+ },
47
+ "required": ["platform"],
48
+ "examplesFile": "../../../docs/export-examples.md"
49
+ }
@@ -0,0 +1,7 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { ExpoInstallOptions } from './schema';
3
+ export interface ExpoInstallOutput {
4
+ success: boolean;
5
+ }
6
+ export default function installExecutor(options: ExpoInstallOptions, context: ExecutorContext): AsyncGenerator<ExpoInstallOutput>;
7
+ export declare function installAsync(workspaceRoot: string, options: ExpoInstallOptions): Promise<number>;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.installAsync = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const child_process_1 = require("child_process");
6
+ let childProcess;
7
+ async function* installExecutor(options, context) {
8
+ const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
9
+ try {
10
+ await installAsync(context.root, options);
11
+ yield {
12
+ success: true,
13
+ };
14
+ }
15
+ finally {
16
+ if (childProcess) {
17
+ childProcess.kill();
18
+ }
19
+ }
20
+ }
21
+ exports.default = installExecutor;
22
+ function installAsync(workspaceRoot, options) {
23
+ return new Promise((resolve, reject) => {
24
+ childProcess = (0, child_process_1.fork)(require.resolve('@expo/cli/build/bin/cli'), ['install', ...createInstallOptions(options)], { cwd: workspaceRoot, env: process.env });
25
+ // Ensure the child process is killed when the parent exits
26
+ process.on('exit', () => childProcess.kill());
27
+ process.on('SIGTERM', () => childProcess.kill());
28
+ childProcess.on('error', (err) => {
29
+ reject(err);
30
+ });
31
+ childProcess.on('exit', (code) => {
32
+ if (code === 0) {
33
+ resolve(code);
34
+ }
35
+ else {
36
+ reject(code);
37
+ }
38
+ });
39
+ });
40
+ }
41
+ exports.installAsync = installAsync;
42
+ // options from https://github.com/expo/expo/blob/main/packages/%40expo/cli/src/install/index.ts
43
+ function createInstallOptions(options) {
44
+ return Object.keys(options).reduce((acc, k) => {
45
+ const v = options[k];
46
+ if (k === 'packages') {
47
+ const packages = typeof v === 'string' ? v.split(',') : v;
48
+ acc.push(...packages);
49
+ }
50
+ else {
51
+ if (typeof v === 'boolean') {
52
+ if (v === true) {
53
+ // when true, does not need to pass the value true, just need to pass the flag in kebob case
54
+ acc.push(`--${(0, devkit_1.names)(k).fileName}`);
55
+ }
56
+ }
57
+ else {
58
+ acc.push(`--${(0, devkit_1.names)(k).fileName}`, v);
59
+ }
60
+ }
61
+ return acc;
62
+ }, []);
63
+ }
@@ -0,0 +1,7 @@
1
+ // options from https://github.com/expo/expo/blob/main/packages/@expo/cli/src/install/index.ts
2
+
3
+ export interface ExpoInstallOptions {
4
+ packages?: string | string[]; // either a string separated by comma or a string array
5
+ check?: boolean; // default is false
6
+ fix?: boolean; // default is false
7
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "cli": "nx",
3
+ "version": 2,
4
+ "outputCapture": "direct-nodejs",
5
+ "$id": "NxExpoInstall",
6
+ "$schema": "https://json-schema.org/schema",
7
+ "title": "Expo Install",
8
+ "description": "Install a module or other package to a project.",
9
+ "type": "object",
10
+ "properties": {
11
+ "packages": {
12
+ "type": "array",
13
+ "items": {
14
+ "type": "string"
15
+ },
16
+ "default": [],
17
+ "description": "The names of packages to install",
18
+ "$default": {
19
+ "$source": "argv",
20
+ "index": 0
21
+ }
22
+ },
23
+ "check": {
24
+ "type": "boolean",
25
+ "description": "Check which installed packages need to be updated",
26
+ "default": false
27
+ },
28
+ "fix": {
29
+ "type": "boolean",
30
+ "description": "Automatically update any invalid package versions",
31
+ "default": false
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,7 @@
1
+ import { ExecutorContext } from '@nx/devkit';
2
+ import { ExpoPrebuildOptions } from './schema';
3
+ export interface ExpoPrebuildOutput {
4
+ success: boolean;
5
+ }
6
+ export default function prebuildExecutor(options: ExpoPrebuildOptions, context: ExecutorContext): AsyncGenerator<ExpoPrebuildOutput>;
7
+ export declare function prebuildAsync(workspaceRoot: string, projectRoot: string, options: ExpoPrebuildOptions): Promise<number>;