@nx/react 16.4.0-beta.10 → 16.4.0-beta.13

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",
3
- "version": "16.4.0-beta.10",
3
+ "version": "16.4.0-beta.13",
4
4
  "private": false,
5
5
  "description": "The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -31,11 +31,11 @@
31
31
  "migrations": "./migrations.json"
32
32
  },
33
33
  "dependencies": {
34
- "@nrwl/react": "16.4.0-beta.10",
35
- "@nx/devkit": "16.4.0-beta.10",
36
- "@nx/js": "16.4.0-beta.10",
37
- "@nx/linter": "16.4.0-beta.10",
38
- "@nx/web": "16.4.0-beta.10",
34
+ "@nrwl/react": "16.4.0-beta.13",
35
+ "@nx/devkit": "16.4.0-beta.13",
36
+ "@nx/js": "16.4.0-beta.13",
37
+ "@nx/linter": "16.4.0-beta.13",
38
+ "@nx/web": "16.4.0-beta.13",
39
39
  "@phenomnomnominal/tsquery": "~5.0.1",
40
40
  "@svgr/webpack": "^8.0.1",
41
41
  "chalk": "^4.1.0",
@@ -46,5 +46,5 @@
46
46
  "access": "public"
47
47
  },
48
48
  "types": "./index.d.ts",
49
- "gitHead": "d2bde0605c692a023bc9c28686f3a3037bbd56d3"
49
+ "gitHead": "d81afedfcc8d07db8cdb9b0e9286de0321ee184e"
50
50
  }
@@ -29,10 +29,13 @@ function nxComponentTestingPreset(pathToConfig, options) {
29
29
  const normalizedProjectRootPath = ['.ts', '.js'].some((ext) => pathToConfig.endsWith(ext))
30
30
  ? pathToConfig
31
31
  : (0, path_1.dirname)(pathToConfig);
32
+ const basePresetSettings = (0, cypress_preset_1.nxBaseCypressPreset)(pathToConfig, {
33
+ testingType: 'component',
34
+ });
32
35
  if ((options === null || options === void 0 ? void 0 : options.bundler) === 'vite') {
33
- return Object.assign(Object.assign({}, (0, cypress_preset_1.nxBaseCypressPreset)(pathToConfig)), { specPattern: 'src/**/*.cy.{js,jsx,ts,tsx}', devServer: Object.assign(Object.assign({}, { framework: 'react', bundler: 'vite' }), { viteConfig: () => tslib_1.__awaiter(this, void 0, void 0, function* () {
36
+ return Object.assign(Object.assign({}, basePresetSettings), { specPattern: 'src/**/*.cy.{js,jsx,ts,tsx}', devServer: Object.assign(Object.assign({}, { framework: 'react', bundler: 'vite' }), { viteConfig: () => tslib_1.__awaiter(this, void 0, void 0, function* () {
34
37
  const viteConfigPath = findViteConfig(normalizedProjectRootPath);
35
- const { mergeConfig, loadConfigFromFile, searchForWorkspaceRoot } = (yield Promise.resolve().then(() => require('vite')));
38
+ const { mergeConfig, loadConfigFromFile, searchForWorkspaceRoot } = yield Promise.resolve().then(() => require('vite'));
36
39
  const resolved = yield loadConfigFromFile({
37
40
  mode: 'watch',
38
41
  command: 'serve',
@@ -78,7 +81,7 @@ function nxComponentTestingPreset(pathToConfig, options) {
78
81
  compiler: 'babel',
79
82
  });
80
83
  }
81
- return Object.assign(Object.assign({}, (0, cypress_preset_1.nxBaseCypressPreset)(pathToConfig)), { specPattern: 'src/**/*.cy.{js,jsx,ts,tsx}', devServer: Object.assign(Object.assign({}, { framework: 'react', bundler: 'webpack' }), { webpackConfig }) });
84
+ return Object.assign(Object.assign({}, basePresetSettings), { specPattern: 'src/**/*.cy.{js,jsx,ts,tsx}', devServer: Object.assign(Object.assign({}, { framework: 'react', bundler: 'webpack' }), { webpackConfig }) });
82
85
  }
83
86
  exports.nxComponentTestingPreset = nxComponentTestingPreset;
84
87
  /**
@@ -131,7 +134,11 @@ function buildTargetWebpack(graph, buildTarget, componentTestingProjectName) {
131
134
  return () => tslib_1.__awaiter(this, void 0, void 0, function* () {
132
135
  customWebpack = yield customWebpack;
133
136
  // TODO(jack): Once webpackConfig is always set in @nx/webpack:webpack, we no longer need this default.
134
- const defaultWebpack = getWebpackConfig(context, Object.assign(Object.assign({}, options), { root: devkit_1.workspaceRoot, projectRoot: ctProjectConfig.root, sourceRoot: ctProjectConfig.sourceRoot }));
137
+ const defaultWebpack = getWebpackConfig(context, Object.assign(Object.assign({}, options), {
138
+ // cypress will generate its own index.html from component-index.html
139
+ generateIndexHtml: false,
140
+ // causes issues with buildable libraries with ENOENT: no such file or directory, scandir error
141
+ extractLicenses: false, root: devkit_1.workspaceRoot, projectRoot: ctProjectConfig.root, sourceRoot: ctProjectConfig.sourceRoot }));
135
142
  if (customWebpack) {
136
143
  return yield customWebpack(defaultWebpack, {
137
144
  options,
@@ -60,6 +60,7 @@ function setupSsrGenerator(tree, options) {
60
60
  target: 'node',
61
61
  main: `${projectRoot}/server.ts`,
62
62
  outputPath: (0, devkit_1.joinPathFragments)(originalOutputPath, 'server'),
63
+ outputFileName: 'server.js',
63
64
  tsConfig: `${projectRoot}/tsconfig.server.json`,
64
65
  compiler: 'babel',
65
66
  externalDependencies: 'all',
@@ -9,7 +9,7 @@ export declare function findDefaultExportIdentifier(source: ts.SourceFile): ts.I
9
9
  export declare function findDefaultClassOrFunction(source: ts.SourceFile | null): ts.FunctionDeclaration | ts.ClassDeclaration | null;
10
10
  export declare function findComponentImportPath(componentName: string, source: ts.SourceFile): string;
11
11
  export declare function findElements(source: ts.SourceFile, tagName: string): ts.Node[];
12
- export declare function findClosestOpening(tagName: string, node: ts.Node): any;
12
+ export declare function findClosestOpening(tagName: string, node: ts.Node): ts.Node;
13
13
  export declare function isTag(tagName: string, node: ts.Node): boolean;
14
14
  export declare function addInitialRoutes(sourcePath: string, source: ts.SourceFile): StringChange[];
15
15
  export declare function addRoute(sourcePath: string, source: ts.SourceFile, options: {