@nx/expo 23.0.0-beta.12 → 23.0.0-beta.14
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/package.json +8 -8
- package/plugins/metro-resolver.js +2 -2
- package/plugins/plugin.js +2 -2
- package/src/generators/application/application.d.ts.map +1 -1
- package/src/generators/application/application.js +5 -6
- package/src/generators/application/lib/add-e2e.d.ts.map +1 -1
- package/src/generators/application/lib/add-e2e.js +3 -3
- package/src/generators/application/lib/normalize-options.js +2 -2
- package/src/generators/component/component.js +2 -2
- package/src/generators/component/lib/normalize-options.js +2 -2
- package/src/generators/library/lib/normalize-options.js +2 -2
- package/src/generators/library/library.js +5 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/expo",
|
|
3
|
-
"version": "23.0.0-beta.
|
|
3
|
+
"version": "23.0.0-beta.14",
|
|
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": [
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"type": "commonjs",
|
|
30
30
|
"types": "index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@nx/devkit": "23.0.0-beta.
|
|
33
|
-
"@nx/eslint": "23.0.0-beta.
|
|
34
|
-
"@nx/js": "23.0.0-beta.
|
|
35
|
-
"@nx/react": "23.0.0-beta.
|
|
32
|
+
"@nx/devkit": "23.0.0-beta.14",
|
|
33
|
+
"@nx/eslint": "23.0.0-beta.14",
|
|
34
|
+
"@nx/js": "23.0.0-beta.14",
|
|
35
|
+
"@nx/react": "23.0.0-beta.14",
|
|
36
36
|
"enhanced-resolve": "^5.8.3",
|
|
37
37
|
"picocolors": "^1.1.0",
|
|
38
38
|
"semver": "^7.6.3",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"metro-resolver": ">= 0.82.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"nx": "23.0.0-beta.
|
|
47
|
+
"nx": "23.0.0-beta.14"
|
|
48
48
|
},
|
|
49
49
|
"optionalDependencies": {
|
|
50
|
-
"@nx/detox": "23.0.0-beta.
|
|
51
|
-
"@nx/rollup": "23.0.0-beta.
|
|
50
|
+
"@nx/detox": "23.0.0-beta.14",
|
|
51
|
+
"@nx/rollup": "23.0.0-beta.14"
|
|
52
52
|
},
|
|
53
53
|
"executors": "./executors.json",
|
|
54
54
|
"ng-update": {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getResolveRequest = getResolveRequest;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const tsconfig_paths_1 = require("tsconfig-paths");
|
|
6
|
-
const
|
|
6
|
+
const js_1 = require("@nx/js");
|
|
7
7
|
const pc = tslib_1.__importStar(require("picocolors"));
|
|
8
8
|
const enhanced_resolve_1 = require("enhanced-resolve");
|
|
9
9
|
const path_1 = require("path");
|
|
@@ -120,7 +120,7 @@ function getMatcher(debug) {
|
|
|
120
120
|
if (!matcher) {
|
|
121
121
|
const result = (0, tsconfig_paths_1.loadConfig)();
|
|
122
122
|
if (result.resultType === 'success') {
|
|
123
|
-
absoluteBaseUrl = (0,
|
|
123
|
+
absoluteBaseUrl = (0, js_1.resolvePathsBaseUrl)(result.configFileAbsolutePath);
|
|
124
124
|
paths = result.paths;
|
|
125
125
|
if (debug) {
|
|
126
126
|
console.log(pc.cyan(`[Nx] Located tsconfig at ${pc.bold(absoluteBaseUrl)}`));
|
package/plugins/plugin.js
CHANGED
|
@@ -8,7 +8,7 @@ const js_1 = require("@nx/js");
|
|
|
8
8
|
const fs_1 = require("fs");
|
|
9
9
|
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
10
10
|
const devkit_internals_1 = require("nx/src/devkit-internals");
|
|
11
|
-
const
|
|
11
|
+
const internal_2 = require("@nx/js/internal");
|
|
12
12
|
exports.createNodes = [
|
|
13
13
|
'**/app.{json,config.js,config.ts}',
|
|
14
14
|
async (configFiles, options, context) => {
|
|
@@ -100,7 +100,7 @@ function buildExpoTargets(projectRoot, options, context, pmc) {
|
|
|
100
100
|
options: { cwd: projectRoot },
|
|
101
101
|
},
|
|
102
102
|
};
|
|
103
|
-
(0,
|
|
103
|
+
(0, internal_2.addBuildAndWatchDepsTargets)(context.workspaceRoot, projectRoot, targets, options, pmc);
|
|
104
104
|
return targets;
|
|
105
105
|
}
|
|
106
106
|
function getAppConfig(configFilePath, context) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/expo/src/generators/application/application.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAiBpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/expo/src/generators/application/application.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,iBAAiB,EAGjB,IAAI,EACL,MAAM,YAAY,CAAC;AAiBpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,gCAAgC,CACpD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAmF5B;AAED,eAAe,wBAAwB,CAAC"}
|
|
@@ -6,7 +6,7 @@ const tslib_1 = require("tslib");
|
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
const devkit_1 = require("@nx/devkit");
|
|
8
8
|
const js_1 = require("@nx/js");
|
|
9
|
-
const
|
|
9
|
+
const internal_2 = require("@nx/js/internal");
|
|
10
10
|
const add_linting_1 = require("../../utils/add-linting");
|
|
11
11
|
const add_jest_1 = require("../../utils/jest/add-jest");
|
|
12
12
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
@@ -17,7 +17,6 @@ const add_eas_scripts_1 = require("./lib/add-eas-scripts");
|
|
|
17
17
|
const add_e2e_1 = require("./lib/add-e2e");
|
|
18
18
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
19
19
|
const init_root_babel_config_1 = require("../../utils/init-root-babel-config");
|
|
20
|
-
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
21
20
|
async function expoApplicationGenerator(host, schema) {
|
|
22
21
|
return await expoApplicationGeneratorInternal(host, {
|
|
23
22
|
addPlugin: false,
|
|
@@ -27,7 +26,7 @@ async function expoApplicationGenerator(host, schema) {
|
|
|
27
26
|
}
|
|
28
27
|
async function expoApplicationGeneratorInternal(host, schema) {
|
|
29
28
|
const tasks = [];
|
|
30
|
-
const addTsPlugin = (0,
|
|
29
|
+
const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host, schema.addPlugin, schema.useTsSolution);
|
|
31
30
|
const jsInitTask = await (0, js_1.initGenerator)(host, {
|
|
32
31
|
...schema,
|
|
33
32
|
skipFormat: true,
|
|
@@ -48,7 +47,7 @@ async function expoApplicationGeneratorInternal(host, schema) {
|
|
|
48
47
|
// If we are using the new TS solution
|
|
49
48
|
// We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
|
|
50
49
|
if (options.isTsSolutionSetup) {
|
|
51
|
-
await (0,
|
|
50
|
+
await (0, internal_2.addProjectToTsSolutionWorkspace)(host, options.appProjectRoot);
|
|
52
51
|
}
|
|
53
52
|
const lintTask = await (0, add_linting_1.addLinting)(host, {
|
|
54
53
|
...options,
|
|
@@ -63,7 +62,7 @@ async function expoApplicationGeneratorInternal(host, schema) {
|
|
|
63
62
|
const e2eTask = await (0, add_e2e_1.addE2e)(host, options);
|
|
64
63
|
tasks.push(e2eTask);
|
|
65
64
|
(0, add_eas_scripts_1.addEasScripts)(host);
|
|
66
|
-
(0,
|
|
65
|
+
(0, internal_2.updateTsconfigFiles)(host, options.appProjectRoot, 'tsconfig.app.json', {
|
|
67
66
|
jsx: 'react-jsx',
|
|
68
67
|
module: 'esnext',
|
|
69
68
|
moduleResolution: 'bundler',
|
|
@@ -71,7 +70,7 @@ async function expoApplicationGeneratorInternal(host, schema) {
|
|
|
71
70
|
}, options.linter === 'eslint'
|
|
72
71
|
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
73
72
|
: undefined);
|
|
74
|
-
(0,
|
|
73
|
+
(0, internal_2.sortPackageJsonFields)(host, options.appProjectRoot);
|
|
75
74
|
if (!options.skipFormat) {
|
|
76
75
|
await (0, devkit_1.formatFiles)(host);
|
|
77
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-e2e.d.ts","sourceRoot":"","sources":["../../../../../../../packages/expo/src/generators/application/lib/add-e2e.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add-e2e.d.ts","sourceRoot":"","sources":["../../../../../../../packages/expo/src/generators/application/lib/add-e2e.ts"],"names":[],"mappings":"AAIA,OAAO,EAGL,iBAAiB,EAGjB,IAAI,EAEL,MAAM,YAAY,CAAC;AAIpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,wBAAsB,MAAM,CAC1B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAiJ5B"}
|
|
@@ -122,9 +122,9 @@ async function addE2e(tree, options) {
|
|
|
122
122
|
async function getExpoE2EWebServerInfo(tree, projectName, configFilePath, isPluginBeingAdded) {
|
|
123
123
|
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
124
124
|
let e2ePort = isPluginBeingAdded ? 8081 : 4200;
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
e2ePort =
|
|
125
|
+
const serveTargetOptions = (0, internal_1.readTargetDefaultsForTarget)('serve', nxJson.targetDefaults)?.options;
|
|
126
|
+
if (serveTargetOptions?.port) {
|
|
127
|
+
e2ePort = serveTargetOptions.port;
|
|
128
128
|
}
|
|
129
129
|
return (0, internal_1.getE2EWebServerInfo)(tree, projectName, {
|
|
130
130
|
plugin: '@nx/expo/plugin',
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
-
const
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
async function normalizeOptions(host, options) {
|
|
8
8
|
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
9
9
|
const { projectName, names: projectNames, projectRoot: appProjectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
@@ -20,7 +20,7 @@ async function normalizeOptions(host, options) {
|
|
|
20
20
|
? options.tags.split(',').map((s) => s.trim())
|
|
21
21
|
: [];
|
|
22
22
|
const rootProject = appProjectRoot === '.';
|
|
23
|
-
const isTsSolutionSetup = (0,
|
|
23
|
+
const isTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)(host);
|
|
24
24
|
const appProjectName = !isTsSolutionSetup || options.name ? projectName : importPath;
|
|
25
25
|
const useProjectJson = options.useProjectJson ?? !isTsSolutionSetup;
|
|
26
26
|
const e2eProjectName = rootProject ? 'e2e' : `${appProjectName}-e2e`;
|
|
@@ -7,7 +7,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
7
7
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
8
8
|
const add_import_1 = require("./lib/add-import");
|
|
9
9
|
const path_1 = require("path");
|
|
10
|
-
const
|
|
10
|
+
const internal_1 = require("@nx/js/internal");
|
|
11
11
|
async function expoComponentGenerator(host, schema) {
|
|
12
12
|
const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
|
|
13
13
|
createComponentFiles(host, options);
|
|
@@ -28,7 +28,7 @@ function createComponentFiles(host, options) {
|
|
|
28
28
|
function addExportsToBarrel(host, options) {
|
|
29
29
|
const workspace = (0, devkit_1.getProjects)(host);
|
|
30
30
|
const proj = workspace.get(options.projectName);
|
|
31
|
-
const isApp = (0,
|
|
31
|
+
const isApp = (0, internal_1.getProjectType)(host, proj.root, proj.projectType) === 'application';
|
|
32
32
|
if (options.export && !isApp) {
|
|
33
33
|
const indexFilePath = (0, devkit_1.joinPathFragments)(...(options.projectSourceRoot
|
|
34
34
|
? [options.projectSourceRoot]
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
-
const
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
async function normalizeOptions(host, options) {
|
|
8
8
|
const { artifactName: name, fileName, fileExtension, fileExtensionType, filePath, directory, project: projectName, } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(host, {
|
|
9
9
|
name: options.name,
|
|
@@ -15,7 +15,7 @@ async function normalizeOptions(host, options) {
|
|
|
15
15
|
const project = (0, devkit_1.getProjects)(host).get(projectName);
|
|
16
16
|
const { root, sourceRoot: projectSourceRoot, projectType } = project;
|
|
17
17
|
if (options.export &&
|
|
18
|
-
(0,
|
|
18
|
+
(0, internal_2.getProjectType)(host, root, projectType) === 'application') {
|
|
19
19
|
devkit_1.logger.warn(`The "--export" option should not be used with applications and will do nothing.`);
|
|
20
20
|
}
|
|
21
21
|
options.classComponent = options.classComponent ?? false;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
-
const
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
async function normalizeOptions(host, options) {
|
|
8
8
|
await (0, internal_1.ensureRootProjectName)(options, 'library');
|
|
9
9
|
const { projectName, names: projectNames, projectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
@@ -19,7 +19,7 @@ async function normalizeOptions(host, options) {
|
|
|
19
19
|
const parsedTags = options.tags
|
|
20
20
|
? options.tags.split(',').map((s) => s.trim())
|
|
21
21
|
: [];
|
|
22
|
-
const isUsingTsSolutionConfig = (0,
|
|
22
|
+
const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
|
|
23
23
|
const useProjectJson = options.useProjectJson ?? !isUsingTsSolutionConfig;
|
|
24
24
|
const normalized = {
|
|
25
25
|
...options,
|
|
@@ -12,8 +12,7 @@ const add_jest_1 = require("../../utils/jest/add-jest");
|
|
|
12
12
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
13
13
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
14
14
|
const init_root_babel_config_1 = require("../../utils/init-root-babel-config");
|
|
15
|
-
const
|
|
16
|
-
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
15
|
+
const internal_2 = require("@nx/js/internal");
|
|
17
16
|
const add_rollup_build_target_1 = require("@nx/react/src/generators/library/lib/add-rollup-build-target");
|
|
18
17
|
const component_1 = require("../component/component");
|
|
19
18
|
const path_1 = require("path");
|
|
@@ -27,7 +26,7 @@ async function expoLibraryGenerator(host, schema) {
|
|
|
27
26
|
}
|
|
28
27
|
async function expoLibraryGeneratorInternal(host, schema) {
|
|
29
28
|
const tasks = [];
|
|
30
|
-
const addTsPlugin = (0,
|
|
29
|
+
const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host, schema.addPlugin);
|
|
31
30
|
const jsInitTask = await (0, js_1.initGenerator)(host, {
|
|
32
31
|
...schema,
|
|
33
32
|
addTsPlugin,
|
|
@@ -39,7 +38,7 @@ async function expoLibraryGeneratorInternal(host, schema) {
|
|
|
39
38
|
throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
|
|
40
39
|
}
|
|
41
40
|
if (options.isUsingTsSolutionConfig) {
|
|
42
|
-
await (0,
|
|
41
|
+
await (0, internal_2.addProjectToTsSolutionWorkspace)(host, options.projectRoot);
|
|
43
42
|
}
|
|
44
43
|
const initTask = await (0, init_1.default)(host, { ...options, skipFormat: true });
|
|
45
44
|
tasks.push(initTask);
|
|
@@ -74,7 +73,7 @@ async function expoLibraryGeneratorInternal(host, schema) {
|
|
|
74
73
|
(0, devkit_1.joinPathFragments)(options.projectRoot, options.js ? './src/index.js' : './src/index.ts'),
|
|
75
74
|
]);
|
|
76
75
|
}
|
|
77
|
-
(0,
|
|
76
|
+
(0, internal_2.updateTsconfigFiles)(host, options.projectRoot, 'tsconfig.lib.json', {
|
|
78
77
|
jsx: 'react-jsx',
|
|
79
78
|
module: 'esnext',
|
|
80
79
|
moduleResolution: 'bundler',
|
|
@@ -86,7 +85,7 @@ async function expoLibraryGeneratorInternal(host, schema) {
|
|
|
86
85
|
const jestTask = await (0, add_jest_1.addJest)(host, options.unitTestRunner, options.projectName, options.projectRoot, options.js, options.skipPackageJson, options.addPlugin);
|
|
87
86
|
tasks.push(jestTask);
|
|
88
87
|
}
|
|
89
|
-
(0,
|
|
88
|
+
(0, internal_2.sortPackageJsonFields)(host, options.projectRoot);
|
|
90
89
|
if (!options.skipFormat) {
|
|
91
90
|
await (0, devkit_1.formatFiles)(host);
|
|
92
91
|
}
|