@nx/react-native 21.4.0-beta.1 → 21.4.0-beta.11

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react-native",
3
- "version": "21.4.0-beta.1",
3
+ "version": "21.4.0-beta.11",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides: \n\n-Integration with libraries such as Jest, Detox, and Storybook.\n-Scaffolding for creating buildable libraries that can be published to npm.\n-Utilities for automatic workspace refactoring.",
6
6
  "keywords": [
@@ -26,14 +26,14 @@
26
26
  "main": "./index.js",
27
27
  "types": "index.d.ts",
28
28
  "dependencies": {
29
- "@nx/detox": "21.4.0-beta.1",
30
- "@nx/devkit": "21.4.0-beta.1",
31
- "@nx/eslint": "21.4.0-beta.1",
32
- "@nx/jest": "21.4.0-beta.1",
33
- "@nx/js": "21.4.0-beta.1",
34
- "@nx/react": "21.4.0-beta.1",
35
- "@nx/rollup": "21.4.0-beta.1",
36
- "@nx/workspace": "21.4.0-beta.1",
29
+ "@nx/detox": "21.4.0-beta.11",
30
+ "@nx/devkit": "21.4.0-beta.11",
31
+ "@nx/eslint": "21.4.0-beta.11",
32
+ "@nx/jest": "21.4.0-beta.11",
33
+ "@nx/js": "21.4.0-beta.11",
34
+ "@nx/react": "21.4.0-beta.11",
35
+ "@nx/rollup": "21.4.0-beta.11",
36
+ "@nx/workspace": "21.4.0-beta.11",
37
37
  "ajv": "^8.12.0",
38
38
  "enhanced-resolve": "^5.8.3",
39
39
  "glob": "7.1.4",
@@ -45,7 +45,7 @@
45
45
  "tslib": "^2.3.0"
46
46
  },
47
47
  "devDependencies": {
48
- "nx": "21.4.0-beta.1"
48
+ "nx": "21.4.0-beta.11"
49
49
  },
50
50
  "executors": "./executors.json",
51
51
  "ng-update": {
@@ -1 +1 @@
1
- {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAKjB,IAAI,EACL,MAAM,YAAY,CAAC;AAepB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAUlC,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,uCAAuC,CAC3D,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CA6F5B;AA4CD,eAAe,+BAA+B,CAAC"}
1
+ {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAKjB,IAAI,EACL,MAAM,YAAY,CAAC;AAepB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAWlC,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,uCAAuC,CAC3D,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAkG5B;AA4CD,eAAe,+BAA+B,CAAC"}
@@ -28,10 +28,11 @@ async function reactNativeApplicationGenerator(host, schema) {
28
28
  }
29
29
  async function reactNativeApplicationGeneratorInternal(host, schema) {
30
30
  const tasks = [];
31
+ const addTsPlugin = (0, ts_solution_setup_1.shouldConfigureTsSolutionSetup)(host, schema.addPlugin, schema.useTsSolution);
31
32
  const jsInitTask = await (0, js_1.initGenerator)(host, {
32
33
  ...schema,
33
34
  skipFormat: true,
34
- addTsPlugin: schema.useTsSolution,
35
+ addTsPlugin,
35
36
  formatter: schema.formatter,
36
37
  platform: 'web',
37
38
  });
@@ -5,5 +5,5 @@ import App from './App';
5
5
 
6
6
  test('renders correctly', () => {
7
7
  const { getByTestId } = render(<App />);
8
- expect(getByTestId('heading')).toHaveTextContent('Welcome');
8
+ expect(getByTestId('heading')).toHaveTextContent(/Welcome/);
9
9
  });
@@ -1 +1 @@
1
- {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAQjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAYpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAclC,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,mCAAmC,CACvD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CA6G5B;AA+JD,eAAe,2BAA2B,CAAC"}
1
+ {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EASjB,IAAI,EAIL,MAAM,YAAY,CAAC;AAYpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAqBlC,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,mCAAmC,CACvD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAmH5B;AA8KD,eAAe,2BAA2B,CAAC"}
@@ -17,6 +17,8 @@ const add_rollup_build_target_1 = require("@nx/react/src/generators/library/lib/
17
17
  const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
18
18
  const path_1 = require("path");
19
19
  const versions_1 = require("../../utils/versions");
20
+ const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
21
+ const use_legacy_versioning_1 = require("nx/src/command-line/release/config/use-legacy-versioning");
20
22
  async function reactNativeLibraryGenerator(host, schema) {
21
23
  return await reactNativeLibraryGeneratorInternal(host, {
22
24
  addPlugin: false,
@@ -26,8 +28,10 @@ async function reactNativeLibraryGenerator(host, schema) {
26
28
  }
27
29
  async function reactNativeLibraryGeneratorInternal(host, schema) {
28
30
  const tasks = [];
31
+ const addTsPlugin = (0, ts_solution_setup_1.shouldConfigureTsSolutionSetup)(host, schema.addPlugin);
29
32
  const jsInitTask = await (0, js_1.initGenerator)(host, {
30
33
  ...schema,
34
+ addTsPlugin,
31
35
  skipFormat: true,
32
36
  });
33
37
  tasks.push(jsInitTask);
@@ -68,6 +72,9 @@ async function reactNativeLibraryGeneratorInternal(host, schema) {
68
72
  js: options.js,
69
73
  });
70
74
  tasks.push(() => componentTask);
75
+ if (options.publishable) {
76
+ tasks.push(await (0, add_release_config_1.releaseTasks)(host));
77
+ }
71
78
  if (!options.skipTsConfig && !options.isUsingTsSolutionConfig) {
72
79
  (0, js_1.addTsConfigPath)(host, options.importPath, [
73
80
  (0, devkit_1.joinPathFragments)(options.projectRoot, './src', 'index.' + (options.js ? 'js' : 'ts')),
@@ -108,7 +115,9 @@ async function addProject(host, options) {
108
115
  if (!options.useProjectJson) {
109
116
  packageJson = {
110
117
  ...packageJson,
111
- ...determineEntryFields(options),
118
+ ...(options.buildable || options.publishable
119
+ ? {}
120
+ : determineEntryFields(options)),
112
121
  files: options.publishable ? ['dist', '!**/*.tsbuildinfo'] : undefined,
113
122
  peerDependencies: {
114
123
  react: versions_1.reactVersion,
@@ -124,6 +133,10 @@ async function addProject(host, options) {
124
133
  }
125
134
  }
126
135
  else {
136
+ if (options.publishable) {
137
+ const nxJson = (0, devkit_1.readJson)(host, 'nx.json');
138
+ await (0, add_release_config_1.addReleaseConfigForNonTsSolution)((0, use_legacy_versioning_1.shouldUseLegacyVersioning)(nxJson.release), host, options.name, project);
139
+ }
127
140
  (0, devkit_1.addProjectConfiguration)(host, options.name, project);
128
141
  }
129
142
  if (!options.useProjectJson ||
@@ -131,6 +144,10 @@ async function addProject(host, options) {
131
144
  options.publishable ||
132
145
  options.buildable) {
133
146
  (0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), packageJson);
147
+ if (options.publishable) {
148
+ await (0, add_release_config_1.addReleaseConfigForTsSolution)(host, options.name, project);
149
+ (0, devkit_1.updateProjectConfiguration)(host, options.name, project);
150
+ }
134
151
  }
135
152
  if (options.publishable || options.buildable) {
136
153
  const external = new Set([