@nx/expo 16.8.0-beta.4 → 16.8.0-beta.5
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 +10 -10
- package/plugins/metro-resolver.js +4 -5
- package/plugins/with-nx-metro.js +23 -27
- package/plugins/with-nx-webpack.js +34 -38
- package/src/executors/build/build.impl.js +21 -24
- package/src/executors/build-list/build-list.impl.js +14 -17
- package/src/executors/download/download.impl.js +46 -48
- package/src/executors/ensure-symlink/ensure-symlink.impl.js +4 -7
- package/src/executors/export/export.impl.js +12 -15
- package/src/executors/install/install.impl.js +13 -16
- package/src/executors/prebuild/prebuild.impl.js +17 -20
- package/src/executors/run/run.impl.js +25 -28
- package/src/executors/start/start.impl.js +15 -18
- package/src/executors/submit/submit.impl.js +10 -13
- package/src/executors/sync-deps/sync-deps.impl.js +32 -37
- package/src/executors/update/update.impl.js +13 -16
- package/src/generators/application/application.js +23 -21
- package/src/generators/application/lib/add-detox.js +16 -7
- package/src/generators/application/lib/add-project.js +1 -1
- package/src/generators/application/lib/create-application-files.js +6 -2
- package/src/generators/application/lib/normalize-options.js +24 -17
- package/src/generators/component/component.js +11 -11
- package/src/generators/component/lib/normalize-options.js +36 -37
- package/src/generators/init/init.js +27 -24
- package/src/generators/init/lib/add-git-ignore-entry.js +1 -2
- package/src/generators/library/lib/normalize-options.js +23 -20
- package/src/generators/library/library.js +95 -79
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js +18 -22
- package/src/migrations/update-14-1-2/add-eject-target-14-1-2.js +11 -15
- package/src/migrations/update-14-4-3/add-eas-build-target.js +26 -30
- package/src/migrations/update-14-5-1/add-eas-update-target.js +12 -16
- package/src/migrations/update-15-0-3/add-new-expo-cli-targets.js +44 -48
- package/src/migrations/update-15-0-3/change-jest-preset.js +17 -21
- package/src/migrations/update-15-8-3/change-webpack-to-metro.js +18 -23
- package/src/migrations/update-16-0-0/add-jest-expo.js +15 -19
- package/src/migrations/update-16-0-0/remove-deprecated-targets.js +23 -27
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +3 -6
- package/src/migrations/update-16-1-4/add-detox-app-json.js +20 -24
- package/src/migrations/update-16-1-4/update-eas-scripts.js +9 -7
- package/src/migrations/update-16-2-2/add-submit-target.js +12 -16
- package/src/migrations/update-16-6-0/add-depends-on.js +11 -15
- package/src/migrations/update-16-6-0/update-metro-config.js +11 -15
- package/src/utils/add-jest.js +19 -22
- package/src/utils/add-linting.js +27 -30
- package/src/utils/find-all-npm-dependencies.js +1 -2
- package/src/utils/symlink-task.js +1 -1
package/src/utils/add-jest.js
CHANGED
|
@@ -1,26 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addJest = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const jest_1 = require("@nx/jest");
|
|
6
|
-
function addJest(host, unitTestRunner, projectName, appProjectRoot, js, skipPackageJson) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const content = `module.exports = {
|
|
5
|
+
async function addJest(host, unitTestRunner, projectName, appProjectRoot, js, skipPackageJson) {
|
|
6
|
+
if (unitTestRunner !== 'jest') {
|
|
7
|
+
return () => { };
|
|
8
|
+
}
|
|
9
|
+
const jestTask = await (0, jest_1.configurationGenerator)(host, {
|
|
10
|
+
js,
|
|
11
|
+
project: projectName,
|
|
12
|
+
supportTsx: true,
|
|
13
|
+
skipSerializers: true,
|
|
14
|
+
setupFile: 'none',
|
|
15
|
+
compiler: 'babel',
|
|
16
|
+
skipPackageJson,
|
|
17
|
+
skipFormat: true,
|
|
18
|
+
});
|
|
19
|
+
// overwrite the jest.config.ts file because react native needs to have special transform property
|
|
20
|
+
const configPath = `${appProjectRoot}/jest.config.${js ? 'js' : 'ts'}`;
|
|
21
|
+
const content = `module.exports = {
|
|
24
22
|
displayName: '${projectName}',
|
|
25
23
|
resolver: '@nx/jest/plugins/resolver',
|
|
26
24
|
preset: 'jest-expo',
|
|
@@ -33,8 +31,7 @@ function addJest(host, unitTestRunner, projectName, appProjectRoot, js, skipPack
|
|
|
33
31
|
'\\\\.svg$': '@nx/expo/plugins/jest/svg-mock'
|
|
34
32
|
}
|
|
35
33
|
};`;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
});
|
|
34
|
+
host.write(configPath, content);
|
|
35
|
+
return jestTask;
|
|
39
36
|
}
|
|
40
37
|
exports.addJest = addJest;
|
package/src/utils/add-linting.js
CHANGED
|
@@ -1,40 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addLinting = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const linter_1 = require("@nx/linter");
|
|
6
5
|
const devkit_1 = require("@nx/devkit");
|
|
7
6
|
const lint_1 = require("@nx/react/src/utils/lint");
|
|
8
7
|
const eslint_file_1 = require("@nx/linter/src/generators/utils/eslint-file");
|
|
9
|
-
function addLinting(host, options) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
skipPackageJson: options.skipPackageJson,
|
|
22
|
-
});
|
|
23
|
-
tasks.push(lintTask);
|
|
24
|
-
if ((0, eslint_file_1.isEslintConfigSupported)(host)) {
|
|
25
|
-
(0, eslint_file_1.addExtendsToLintConfig)(host, options.projectRoot, 'plugin:@nx/react');
|
|
26
|
-
(0, eslint_file_1.addIgnoresToLintConfig)(host, options.projectRoot, [
|
|
27
|
-
'.expo',
|
|
28
|
-
'web-build',
|
|
29
|
-
'cache',
|
|
30
|
-
'dist',
|
|
31
|
-
]);
|
|
32
|
-
}
|
|
33
|
-
if (!options.skipPackageJson) {
|
|
34
|
-
const installTask = yield (0, devkit_1.addDependenciesToPackageJson)(host, lint_1.extraEslintDependencies.dependencies, lint_1.extraEslintDependencies.devDependencies);
|
|
35
|
-
tasks.push(installTask);
|
|
36
|
-
}
|
|
37
|
-
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
8
|
+
async function addLinting(host, options) {
|
|
9
|
+
if (options.linter === linter_1.Linter.None) {
|
|
10
|
+
return () => { };
|
|
11
|
+
}
|
|
12
|
+
const tasks = [];
|
|
13
|
+
const lintTask = await (0, linter_1.lintProjectGenerator)(host, {
|
|
14
|
+
linter: options.linter,
|
|
15
|
+
project: options.projectName,
|
|
16
|
+
tsConfigPaths: options.tsConfigPaths,
|
|
17
|
+
eslintFilePatterns: [`${options.projectRoot}/**/*.{ts,tsx,js,jsx}`],
|
|
18
|
+
skipFormat: true,
|
|
19
|
+
skipPackageJson: options.skipPackageJson,
|
|
38
20
|
});
|
|
21
|
+
tasks.push(lintTask);
|
|
22
|
+
if ((0, eslint_file_1.isEslintConfigSupported)(host)) {
|
|
23
|
+
(0, eslint_file_1.addExtendsToLintConfig)(host, options.projectRoot, 'plugin:@nx/react');
|
|
24
|
+
(0, eslint_file_1.addIgnoresToLintConfig)(host, options.projectRoot, [
|
|
25
|
+
'.expo',
|
|
26
|
+
'web-build',
|
|
27
|
+
'cache',
|
|
28
|
+
'dist',
|
|
29
|
+
]);
|
|
30
|
+
}
|
|
31
|
+
if (!options.skipPackageJson) {
|
|
32
|
+
const installTask = await (0, devkit_1.addDependenciesToPackageJson)(host, lint_1.extraEslintDependencies.dependencies, lint_1.extraEslintDependencies.devDependencies);
|
|
33
|
+
tasks.push(installTask);
|
|
34
|
+
}
|
|
35
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
39
36
|
}
|
|
40
37
|
exports.addLinting = addLinting;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.findAllNpmDependencies = void 0;
|
|
4
4
|
function findAllNpmDependencies(graph, projectName, list = [], seen = new Set()) {
|
|
5
|
-
var _a;
|
|
6
5
|
// In case of bad circular dependencies
|
|
7
6
|
if (seen.has(projectName)) {
|
|
8
7
|
return list;
|
|
@@ -19,7 +18,7 @@ function findAllNpmDependencies(graph, projectName, list = [], seen = new Set())
|
|
|
19
18
|
}
|
|
20
19
|
else {
|
|
21
20
|
// it's workspace project, search for it's dependencies
|
|
22
|
-
|
|
21
|
+
graph.dependencies[projectName]?.forEach((dep) => findAllNpmDependencies(graph, dep.target, list, seen));
|
|
23
22
|
}
|
|
24
23
|
return list;
|
|
25
24
|
}
|
|
@@ -10,7 +10,7 @@ function runSymlink(workspaceRoot, projectRoot) {
|
|
|
10
10
|
try {
|
|
11
11
|
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(workspaceRoot, projectRoot);
|
|
12
12
|
}
|
|
13
|
-
catch
|
|
13
|
+
catch {
|
|
14
14
|
throw new Error(`Failed to create symlinks for ${chalk.bold(projectRoot)}`);
|
|
15
15
|
}
|
|
16
16
|
};
|