@nx/react-native 19.2.0-canary.20240604-0594deb → 19.2.0-rc.0
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/plugin.js +1 -1
- package/project.json +1 -1
- package/src/executors/build-android/build-android.impl.ts +0 -69
- package/src/executors/build-ios/build-ios.impl.ts +0 -77
- package/src/executors/bundle/bundle.impl.ts +0 -77
- package/src/executors/ensure-symlink/ensure-symlink.impl.ts +0 -22
- package/src/executors/pod-install/pod-install.impl.ts +0 -21
- package/src/executors/run-android/run-android.impl.ts +0 -94
- package/src/executors/run-ios/run-ios.impl.ts +0 -92
- package/src/executors/start/start.impl.ts +0 -111
- package/src/executors/storybook/storybook.impl.ts +0 -93
- package/src/executors/sync-deps/sync-deps.impl.ts +0 -140
- package/src/executors/upgrade/upgrade.impl.ts +0 -64
- package/src/generators/application/application.spec.ts +0 -260
- package/src/generators/application/lib/normalize-options.spec.ts +0 -211
- package/src/generators/component/component.spec.ts +0 -129
- package/src/generators/init/init.spec.ts +0 -40
- package/src/generators/library/library.spec.ts +0 -423
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts +0 -37
- package/src/migrations/update-18-0-0/add-web-configuration.spec.ts +0 -39
- package/src/migrations/update-18-0-0/remove-block-list.spec.ts +0 -68
- package/src/migrations/update-18-0-0/remove-symlink-target.spec.ts +0 -40
- package/src/utils/add-linting.spec.ts +0 -42
- package/src/utils/ensure-node-modules-symlink.spec.ts +0 -108
- package/src/utils/find-all-npm-dependencies.spec.ts +0 -103
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { tmpdir } from 'os';
|
|
2
|
-
import { join } from 'path';
|
|
3
|
-
import * as fs from 'fs-extra';
|
|
4
|
-
import { ensureNodeModulesSymlink } from './ensure-node-modules-symlink';
|
|
5
|
-
|
|
6
|
-
const workspaceDir = join(tmpdir(), 'nx-react-native-test');
|
|
7
|
-
const appDir = 'apps/myapp';
|
|
8
|
-
const appDirAbsolutePath = join(workspaceDir, appDir);
|
|
9
|
-
|
|
10
|
-
describe('ensureNodeModulesSymlink', () => {
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
if (fs.existsSync(workspaceDir)) fs.removeSync(workspaceDir);
|
|
13
|
-
fs.mkdirSync(workspaceDir);
|
|
14
|
-
fs.mkdirSync(appDirAbsolutePath, { recursive: true });
|
|
15
|
-
fs.mkdirSync(appDirAbsolutePath, { recursive: true });
|
|
16
|
-
fs.writeFileSync(
|
|
17
|
-
join(appDirAbsolutePath, 'package.json'),
|
|
18
|
-
JSON.stringify({
|
|
19
|
-
name: 'myapp',
|
|
20
|
-
dependencies: { 'react-native': '*' },
|
|
21
|
-
})
|
|
22
|
-
);
|
|
23
|
-
fs.writeFileSync(
|
|
24
|
-
join(workspaceDir, 'package.json'),
|
|
25
|
-
JSON.stringify({
|
|
26
|
-
name: 'workspace',
|
|
27
|
-
dependencies: {
|
|
28
|
-
'@nx/react-native': '9999.9.9',
|
|
29
|
-
'@react-native-community/cli-platform-ios': '7777.7.7',
|
|
30
|
-
'@react-native-community/cli-platform-android': '7777.7.7',
|
|
31
|
-
'react-native': '0.9999.0',
|
|
32
|
-
},
|
|
33
|
-
})
|
|
34
|
-
);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
afterEach(() => {
|
|
38
|
-
if (fs.existsSync(workspaceDir)) fs.removeSync(workspaceDir);
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
it('should create symlinks', () => {
|
|
42
|
-
createNpmDirectory('@nx/react-native', '9999.9.9');
|
|
43
|
-
createNpmDirectory(
|
|
44
|
-
'@react-native-community/cli-platform-android',
|
|
45
|
-
'7777.7.7'
|
|
46
|
-
);
|
|
47
|
-
createNpmDirectory('@react-native-community/cli-platform-ios', '7777.7.7');
|
|
48
|
-
createNpmDirectory('hermes-engine', '3333.3.3');
|
|
49
|
-
createNpmDirectory('react-native', '0.9999.0');
|
|
50
|
-
createNpmDirectory('jsc-android', '888888.0.0');
|
|
51
|
-
createNpmDirectory('@babel/runtime', '5555.0.0');
|
|
52
|
-
|
|
53
|
-
ensureNodeModulesSymlink(workspaceDir, appDir);
|
|
54
|
-
|
|
55
|
-
expectSymlinkToExist('@nx/react-native');
|
|
56
|
-
expectSymlinkToExist('react-native');
|
|
57
|
-
expectSymlinkToExist('jsc-android');
|
|
58
|
-
expectSymlinkToExist('hermes-engine');
|
|
59
|
-
expectSymlinkToExist('@react-native-community/cli-platform-ios');
|
|
60
|
-
expectSymlinkToExist('@react-native-community/cli-platform-android');
|
|
61
|
-
expectSymlinkToExist('@babel/runtime');
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it('should add packages listed in workspace package.json', () => {
|
|
65
|
-
fs.writeFileSync(
|
|
66
|
-
join(workspaceDir, 'package.json'),
|
|
67
|
-
JSON.stringify({
|
|
68
|
-
name: 'workspace',
|
|
69
|
-
dependencies: {
|
|
70
|
-
random: '9999.9.9',
|
|
71
|
-
},
|
|
72
|
-
})
|
|
73
|
-
);
|
|
74
|
-
createNpmDirectory('@nx/react-native', '9999.9.9');
|
|
75
|
-
createNpmDirectory(
|
|
76
|
-
'@react-native-community/cli-platform-android',
|
|
77
|
-
'7777.7.7'
|
|
78
|
-
);
|
|
79
|
-
createNpmDirectory('@react-native-community/cli-platform-ios', '7777.7.7');
|
|
80
|
-
createNpmDirectory('hermes-engine', '3333.3.3');
|
|
81
|
-
createNpmDirectory('react-native', '0.9999.0');
|
|
82
|
-
createNpmDirectory('jsc-android', '888888.0.0');
|
|
83
|
-
createNpmDirectory('@babel/runtime', '5555.0.0');
|
|
84
|
-
createNpmDirectory('random', '9999.9.9');
|
|
85
|
-
|
|
86
|
-
ensureNodeModulesSymlink(workspaceDir, appDir);
|
|
87
|
-
|
|
88
|
-
expectSymlinkToExist('random');
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
function createNpmDirectory(packageName, version) {
|
|
92
|
-
const dir = join(workspaceDir, `node_modules/${packageName}`);
|
|
93
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
94
|
-
fs.writeFileSync(
|
|
95
|
-
join(dir, 'package.json'),
|
|
96
|
-
JSON.stringify({ name: packageName, version: version })
|
|
97
|
-
);
|
|
98
|
-
return dir;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
function expectSymlinkToExist(packageName) {
|
|
102
|
-
expect(
|
|
103
|
-
fs.existsSync(
|
|
104
|
-
join(appDirAbsolutePath, `node_modules/${packageName}/package.json`)
|
|
105
|
-
)
|
|
106
|
-
).toBe(true);
|
|
107
|
-
}
|
|
108
|
-
});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { findAllNpmDependencies } from './find-all-npm-dependencies';
|
|
2
|
-
import { DependencyType, ProjectGraph } from '@nx/devkit';
|
|
3
|
-
|
|
4
|
-
test('findAllNpmDependencies', () => {
|
|
5
|
-
const graph: ProjectGraph = {
|
|
6
|
-
nodes: {
|
|
7
|
-
myapp: {
|
|
8
|
-
type: 'app',
|
|
9
|
-
name: 'myapp',
|
|
10
|
-
data: { files: [] },
|
|
11
|
-
},
|
|
12
|
-
lib1: {
|
|
13
|
-
type: 'lib',
|
|
14
|
-
name: 'lib1',
|
|
15
|
-
data: { files: [] },
|
|
16
|
-
},
|
|
17
|
-
lib2: {
|
|
18
|
-
type: 'lib',
|
|
19
|
-
name: 'lib2',
|
|
20
|
-
data: { files: [] },
|
|
21
|
-
},
|
|
22
|
-
lib3: {
|
|
23
|
-
type: 'lib',
|
|
24
|
-
name: 'lib3',
|
|
25
|
-
data: { files: [] },
|
|
26
|
-
},
|
|
27
|
-
} as any,
|
|
28
|
-
externalNodes: {
|
|
29
|
-
'npm:react-native-image-picker': {
|
|
30
|
-
type: 'npm',
|
|
31
|
-
name: 'npm:react-native-image-picker',
|
|
32
|
-
data: {
|
|
33
|
-
version: '1',
|
|
34
|
-
packageName: 'react-native-image-picker',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
'npm:react-native-dialog': {
|
|
38
|
-
type: 'npm',
|
|
39
|
-
name: 'npm:react-native-dialog',
|
|
40
|
-
data: {
|
|
41
|
-
version: '1',
|
|
42
|
-
packageName: 'react-native-dialog',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
'npm:react-native-snackbar': {
|
|
46
|
-
type: 'npm',
|
|
47
|
-
name: 'npm:react-native-snackbar',
|
|
48
|
-
data: {
|
|
49
|
-
version: '1',
|
|
50
|
-
packageName: 'react-native-snackbar',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
'npm:@nx/react-native': {
|
|
54
|
-
type: 'npm',
|
|
55
|
-
name: 'npm:@nx/react-native',
|
|
56
|
-
data: {
|
|
57
|
-
version: '1',
|
|
58
|
-
packageName: '@nx/react-native',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
dependencies: {
|
|
63
|
-
myapp: [
|
|
64
|
-
{ type: DependencyType.static, source: 'myapp', target: 'lib1' },
|
|
65
|
-
{ type: DependencyType.static, source: 'myapp', target: 'lib2' },
|
|
66
|
-
{
|
|
67
|
-
type: DependencyType.static,
|
|
68
|
-
source: 'myapp',
|
|
69
|
-
target: 'npm:react-native-image-picker',
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
type: DependencyType.static,
|
|
73
|
-
source: 'myapp',
|
|
74
|
-
target: 'npm:@nx/react-native',
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
lib1: [
|
|
78
|
-
{ type: DependencyType.static, source: 'lib1', target: 'lib2' },
|
|
79
|
-
{
|
|
80
|
-
type: DependencyType.static,
|
|
81
|
-
source: 'lib3',
|
|
82
|
-
target: 'npm:react-native-snackbar',
|
|
83
|
-
},
|
|
84
|
-
],
|
|
85
|
-
lib2: [{ type: DependencyType.static, source: 'lib2', target: 'lib3' }],
|
|
86
|
-
lib3: [
|
|
87
|
-
{
|
|
88
|
-
type: DependencyType.static,
|
|
89
|
-
source: 'lib3',
|
|
90
|
-
target: 'npm:react-native-dialog',
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const result = findAllNpmDependencies(graph, 'myapp');
|
|
97
|
-
|
|
98
|
-
expect(result).toEqual([
|
|
99
|
-
'react-native-dialog',
|
|
100
|
-
'react-native-snackbar',
|
|
101
|
-
'react-native-image-picker',
|
|
102
|
-
]);
|
|
103
|
-
});
|