@nrwl/react 14.4.3 → 14.5.0-beta.2
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/CHANGELOG.md +1 -1
- package/generators.json +28 -0
- package/index.d.ts +2 -0
- package/index.js +5 -1
- package/index.js.map +1 -1
- package/migrations.json +21 -0
- package/package.json +11 -11
- package/plugins/component-testing/index.d.ts +29 -0
- package/plugins/component-testing/index.js +167 -0
- package/plugins/component-testing/index.js.map +1 -0
- package/plugins/storybook/index.js +1 -1
- package/plugins/storybook/index.js.map +1 -1
- package/src/generators/component/component.d.ts +1 -1
- package/src/generators/component/component.js +4 -4
- package/src/generators/component/component.js.map +1 -1
- package/src/generators/component-cypress-spec/component-cypress-spec.d.ts +1 -1
- package/src/generators/component-cypress-spec/component-cypress-spec.js +10 -4
- package/src/generators/component-cypress-spec/component-cypress-spec.js.map +1 -1
- package/src/generators/component-cypress-spec/files/{__componentName__.spec.__fileExt__ → __componentName__.__fileExt__} +0 -0
- package/src/generators/component-story/component-story.d.ts +0 -1
- package/src/generators/component-story/component-story.js +3 -40
- package/src/generators/component-story/component-story.js.map +1 -1
- package/src/generators/component-test/component-test.d.ts +4 -0
- package/src/generators/component-test/component-test.js +66 -0
- package/src/generators/component-test/component-test.js.map +1 -0
- package/src/generators/component-test/files/__fileName__.cy__ext__ +22 -0
- package/src/generators/component-test/schema.d.ts +4 -0
- package/src/generators/component-test/schema.js +3 -0
- package/src/generators/component-test/schema.js.map +1 -0
- package/src/generators/component-test/schema.json +30 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +9 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +108 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js.map +1 -0
- package/src/generators/cypress-component-configuration/files/cypress.config.ts__tpl__ +6 -0
- package/src/generators/cypress-component-configuration/schema.d.ts +5 -0
- package/src/generators/cypress-component-configuration/schema.js +3 -0
- package/src/generators/cypress-component-configuration/schema.js.map +1 -0
- package/src/generators/cypress-component-configuration/schema.json +39 -0
- package/src/generators/library/schema.d.ts +1 -1
- package/src/utils/component-props.d.ts +15 -0
- package/src/utils/component-props.js +54 -0
- package/src/utils/component-props.js.map +1 -0
- package/src/utils/versions.d.ts +4 -4
- package/src/utils/versions.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
# [14.5.0-beta.2](https://github.com/nrwl/nx/compare/14.4.2...14.5.0-beta.2) (2022-07-18)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/react
|
package/generators.json
CHANGED
|
@@ -74,6 +74,20 @@
|
|
|
74
74
|
"schema": "./src/generators/hook/schema.json",
|
|
75
75
|
"description": "Create a hook.",
|
|
76
76
|
"aliases": ["h"]
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
"cypress-component-configuration": {
|
|
80
|
+
"factory": "./src/generators/cypress-component-configuration/cypress-component-configuration#cypressComponentConfigGenerator",
|
|
81
|
+
"schema": "./src/generators/cypress-component-configuration/schema.json",
|
|
82
|
+
"description": "Setup Cypress component testing for a React project",
|
|
83
|
+
"hidden": false
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
"component-test": {
|
|
87
|
+
"factory": "./src/generators/component-test/component-test#componentTestGenerator",
|
|
88
|
+
"schema": "./src/generators/component-test/schema.json",
|
|
89
|
+
"description": "Generate a Cypress component test for a React component",
|
|
90
|
+
"hidden": false
|
|
77
91
|
}
|
|
78
92
|
},
|
|
79
93
|
"generators": {
|
|
@@ -162,6 +176,20 @@
|
|
|
162
176
|
"schema": "./src/generators/remote/schema.json",
|
|
163
177
|
"x-type": "application",
|
|
164
178
|
"description": "Generate a remote react application"
|
|
179
|
+
},
|
|
180
|
+
|
|
181
|
+
"cypress-component-configuration": {
|
|
182
|
+
"factory": "./src/generators/cypress-component-configuration/cypress-component-configuration#cypressComponentConfigGenerator",
|
|
183
|
+
"schema": "./src/generators/cypress-component-configuration/schema.json",
|
|
184
|
+
"description": "Setup Cypress component testing for a React project",
|
|
185
|
+
"hidden": false
|
|
186
|
+
},
|
|
187
|
+
|
|
188
|
+
"component-test": {
|
|
189
|
+
"factory": "./src/generators/component-test/component-test#componentTestGenerator",
|
|
190
|
+
"schema": "./src/generators/component-test/schema.json",
|
|
191
|
+
"description": "Generate a Cypress component test for a React component",
|
|
192
|
+
"hidden": false
|
|
165
193
|
}
|
|
166
194
|
}
|
|
167
195
|
}
|
package/index.d.ts
CHANGED
|
@@ -13,4 +13,6 @@ export { reduxGenerator } from './src/generators/redux/redux';
|
|
|
13
13
|
export { storiesGenerator } from './src/generators/stories/stories';
|
|
14
14
|
export { storybookConfigurationGenerator } from './src/generators/storybook-configuration/configuration';
|
|
15
15
|
export { hostGenerator } from './src/generators/host/host';
|
|
16
|
+
export { cypressComponentConfigGenerator } from './src/generators/cypress-component-configuration/cypress-component-configuration';
|
|
17
|
+
export { componentTestGenerator } from './src/generators/component-test/component-test';
|
|
16
18
|
export type { SupportedStyles } from './typings/style';
|
package/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hostGenerator = exports.storybookConfigurationGenerator = exports.storiesGenerator = exports.reduxGenerator = exports.reactInitGenerator = exports.libraryGenerator = exports.componentStoryGenerator = exports.componentCypressGenerator = exports.hookGenerator = exports.componentGenerator = exports.applicationGenerator = exports.reactVersion = exports.reactDomVersion = exports.assertValidStyle = exports.CSS_IN_JS_DEPENDENCIES = exports.createReactEslintJson = exports.extraEslintDependencies = void 0;
|
|
3
|
+
exports.componentTestGenerator = exports.cypressComponentConfigGenerator = exports.hostGenerator = exports.storybookConfigurationGenerator = exports.storiesGenerator = exports.reduxGenerator = exports.reactInitGenerator = exports.libraryGenerator = exports.componentStoryGenerator = exports.componentCypressGenerator = exports.hookGenerator = exports.componentGenerator = exports.applicationGenerator = exports.reactVersion = exports.reactDomVersion = exports.assertValidStyle = exports.CSS_IN_JS_DEPENDENCIES = exports.createReactEslintJson = exports.extraEslintDependencies = void 0;
|
|
4
4
|
var lint_1 = require("./src/utils/lint");
|
|
5
5
|
Object.defineProperty(exports, "extraEslintDependencies", { enumerable: true, get: function () { return lint_1.extraEslintDependencies; } });
|
|
6
6
|
Object.defineProperty(exports, "createReactEslintJson", { enumerable: true, get: function () { return lint_1.createReactEslintJson; } });
|
|
@@ -33,4 +33,8 @@ var configuration_1 = require("./src/generators/storybook-configuration/configur
|
|
|
33
33
|
Object.defineProperty(exports, "storybookConfigurationGenerator", { enumerable: true, get: function () { return configuration_1.storybookConfigurationGenerator; } });
|
|
34
34
|
var host_1 = require("./src/generators/host/host");
|
|
35
35
|
Object.defineProperty(exports, "hostGenerator", { enumerable: true, get: function () { return host_1.hostGenerator; } });
|
|
36
|
+
var cypress_component_configuration_1 = require("./src/generators/cypress-component-configuration/cypress-component-configuration");
|
|
37
|
+
Object.defineProperty(exports, "cypressComponentConfigGenerator", { enumerable: true, get: function () { return cypress_component_configuration_1.cypressComponentConfigGenerator; } });
|
|
38
|
+
var component_test_1 = require("./src/generators/component-test/component-test");
|
|
39
|
+
Object.defineProperty(exports, "componentTestGenerator", { enumerable: true, get: function () { return component_test_1.componentTestGenerator; } });
|
|
36
40
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/react/index.ts"],"names":[],"mappings":";;;AAAA,yCAG0B;AAFxB,+GAAA,uBAAuB,OAAA;AACvB,6GAAA,qBAAqB,OAAA;AAEvB,6CAA4D;AAAnD,gHAAA,sBAAsB,OAAA;AAC/B,mDAAyD;AAAhD,6GAAA,gBAAgB,OAAA;AACzB,iDAAqE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AAAhG,gIAAA,+BAA+B,OAAA;AACxC,mDAA2D;AAAlD,qGAAA,aAAa,OAAA;AACtB,oIAAmI;AAA1H,kJAAA,+BAA+B,OAAA;AACxC,iFAAwF;AAA/E,wHAAA,sBAAsB,OAAA"}
|
package/migrations.json
CHANGED
|
@@ -534,6 +534,27 @@
|
|
|
534
534
|
"alwaysAddToPackageJson": false
|
|
535
535
|
}
|
|
536
536
|
}
|
|
537
|
+
},
|
|
538
|
+
"14.4.3": {
|
|
539
|
+
"version": "14.4.3-beta.0",
|
|
540
|
+
"packages": {
|
|
541
|
+
"@types/react": {
|
|
542
|
+
"version": "18.0.15",
|
|
543
|
+
"alwaysAddToPackageJson": false
|
|
544
|
+
},
|
|
545
|
+
"@types/react-dom": {
|
|
546
|
+
"version": "18.0.6",
|
|
547
|
+
"alwaysAddToPackageJson": false
|
|
548
|
+
},
|
|
549
|
+
"@types/node": {
|
|
550
|
+
"version": "18.0.4",
|
|
551
|
+
"alwaysAddToPackageJson": false
|
|
552
|
+
},
|
|
553
|
+
"@reduxjs/toolkit": {
|
|
554
|
+
"version": "1.8.3",
|
|
555
|
+
"alwaysAddToPackageJson": false
|
|
556
|
+
}
|
|
557
|
+
}
|
|
537
558
|
}
|
|
538
559
|
}
|
|
539
560
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/react",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.5.0-beta.2",
|
|
4
4
|
"description": "The React plugin 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.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/core": "^7.15.0",
|
|
34
34
|
"@babel/preset-react": "^7.14.5",
|
|
35
|
-
"@nrwl/cypress": "14.
|
|
36
|
-
"@nrwl/devkit": "14.
|
|
37
|
-
"@nrwl/jest": "14.
|
|
38
|
-
"@nrwl/js": "14.
|
|
39
|
-
"@nrwl/linter": "14.
|
|
40
|
-
"@nrwl/storybook": "14.
|
|
41
|
-
"@nrwl/web": "14.
|
|
42
|
-
"@nrwl/workspace": "14.
|
|
43
|
-
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.
|
|
35
|
+
"@nrwl/cypress": "14.5.0-beta.2",
|
|
36
|
+
"@nrwl/devkit": "14.5.0-beta.2",
|
|
37
|
+
"@nrwl/jest": "14.5.0-beta.2",
|
|
38
|
+
"@nrwl/js": "14.5.0-beta.2",
|
|
39
|
+
"@nrwl/linter": "14.5.0-beta.2",
|
|
40
|
+
"@nrwl/storybook": "14.5.0-beta.2",
|
|
41
|
+
"@nrwl/web": "14.5.0-beta.2",
|
|
42
|
+
"@nrwl/workspace": "14.5.0-beta.2",
|
|
43
|
+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.7",
|
|
44
44
|
"@storybook/node-logger": "6.1.20",
|
|
45
45
|
"@svgr/webpack": "^6.1.2",
|
|
46
46
|
"chalk": "4.1.0",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"webpack": "^5.58.1",
|
|
55
55
|
"webpack-merge": "^5.8.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "38a2d95d9d654c89f58ed6700ec7b6cc01ddf74b"
|
|
58
58
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Configuration } from 'webpack';
|
|
2
|
+
/**
|
|
3
|
+
* React nx preset for Cypress Component Testing
|
|
4
|
+
*
|
|
5
|
+
* This preset contains the base configuration
|
|
6
|
+
* for your component tests that nx recommends.
|
|
7
|
+
* including a devServer that supports nx workspaces.
|
|
8
|
+
* you can easily extend this within your cypress config via spreading the preset
|
|
9
|
+
* @example
|
|
10
|
+
* export default defineConfig({
|
|
11
|
+
* component: {
|
|
12
|
+
* ...nxComponentTestingPreset(__dirname)
|
|
13
|
+
* // add your own config here
|
|
14
|
+
* }
|
|
15
|
+
* })
|
|
16
|
+
*
|
|
17
|
+
* @param pathToConfig will be used to construct the output paths for videos and screenshots
|
|
18
|
+
*/
|
|
19
|
+
export declare function nxComponentTestingPreset(pathToConfig: string): {
|
|
20
|
+
devServer: {
|
|
21
|
+
readonly framework: "react";
|
|
22
|
+
readonly bundler: "webpack";
|
|
23
|
+
readonly webpackConfig: Configuration;
|
|
24
|
+
};
|
|
25
|
+
videosFolder: string;
|
|
26
|
+
screenshotsFolder: string;
|
|
27
|
+
video: boolean;
|
|
28
|
+
chromeWebSecurity: boolean;
|
|
29
|
+
};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nxComponentTestingPreset = void 0;
|
|
4
|
+
const cypress_preset_1 = require("@nrwl/cypress/plugins/cypress-preset");
|
|
5
|
+
const web_config_1 = require("@nrwl/web/src/utils/web.config");
|
|
6
|
+
const tsconfig_paths_webpack_plugin_1 = require("tsconfig-paths-webpack-plugin");
|
|
7
|
+
/**
|
|
8
|
+
* React nx preset for Cypress Component Testing
|
|
9
|
+
*
|
|
10
|
+
* This preset contains the base configuration
|
|
11
|
+
* for your component tests that nx recommends.
|
|
12
|
+
* including a devServer that supports nx workspaces.
|
|
13
|
+
* you can easily extend this within your cypress config via spreading the preset
|
|
14
|
+
* @example
|
|
15
|
+
* export default defineConfig({
|
|
16
|
+
* component: {
|
|
17
|
+
* ...nxComponentTestingPreset(__dirname)
|
|
18
|
+
* // add your own config here
|
|
19
|
+
* }
|
|
20
|
+
* })
|
|
21
|
+
*
|
|
22
|
+
* @param pathToConfig will be used to construct the output paths for videos and screenshots
|
|
23
|
+
*/
|
|
24
|
+
function nxComponentTestingPreset(pathToConfig) {
|
|
25
|
+
return Object.assign(Object.assign({}, (0, cypress_preset_1.nxBaseCypressPreset)(pathToConfig)), { devServer: {
|
|
26
|
+
// cypress uses string union type,
|
|
27
|
+
// need to use const to prevent typing to string
|
|
28
|
+
framework: 'react',
|
|
29
|
+
bundler: 'webpack',
|
|
30
|
+
webpackConfig: buildBaseWebpackConfig({
|
|
31
|
+
tsConfigPath: 'tsconfig.cy.json',
|
|
32
|
+
compiler: 'babel',
|
|
33
|
+
}),
|
|
34
|
+
} });
|
|
35
|
+
}
|
|
36
|
+
exports.nxComponentTestingPreset = nxComponentTestingPreset;
|
|
37
|
+
// TODO(caleb): use the webpack utils to build the config
|
|
38
|
+
// can't seem to get css modules to play nice when using it 🤔
|
|
39
|
+
function buildBaseWebpackConfig({ tsConfigPath = 'tsconfig.cy.json', compiler = 'babel', }) {
|
|
40
|
+
const extensions = ['.ts', '.tsx', '.mjs', '.js', '.jsx'];
|
|
41
|
+
const config = {
|
|
42
|
+
target: 'web',
|
|
43
|
+
resolve: {
|
|
44
|
+
extensions,
|
|
45
|
+
plugins: [
|
|
46
|
+
new tsconfig_paths_webpack_plugin_1.TsconfigPathsPlugin({
|
|
47
|
+
configFile: tsConfigPath,
|
|
48
|
+
extensions,
|
|
49
|
+
}),
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
mode: 'development',
|
|
53
|
+
devtool: false,
|
|
54
|
+
output: {
|
|
55
|
+
publicPath: '/',
|
|
56
|
+
chunkFilename: '[name].bundle.js',
|
|
57
|
+
},
|
|
58
|
+
module: {
|
|
59
|
+
rules: [
|
|
60
|
+
{
|
|
61
|
+
test: /\.(bmp|png|jpe?g|gif|webp|avif)$/,
|
|
62
|
+
type: 'asset',
|
|
63
|
+
parser: {
|
|
64
|
+
dataUrlCondition: {
|
|
65
|
+
maxSize: 10000, // 10 kB
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
CSS_MODULES_LOADER,
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
if (compiler === 'swc') {
|
|
74
|
+
config.module.rules.push({
|
|
75
|
+
test: /\.([jt])sx?$/,
|
|
76
|
+
loader: require.resolve('swc-loader'),
|
|
77
|
+
exclude: /node_modules/,
|
|
78
|
+
options: {
|
|
79
|
+
jsc: {
|
|
80
|
+
parser: {
|
|
81
|
+
syntax: 'typescript',
|
|
82
|
+
decorators: true,
|
|
83
|
+
tsx: true,
|
|
84
|
+
},
|
|
85
|
+
transform: {
|
|
86
|
+
react: {
|
|
87
|
+
runtime: 'automatic',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
loose: true,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (compiler === 'babel') {
|
|
96
|
+
config.module.rules.push({
|
|
97
|
+
test: /\.(js|jsx|mjs|ts|tsx)$/,
|
|
98
|
+
loader: require.resolve('babel-loader'),
|
|
99
|
+
options: {
|
|
100
|
+
presets: [`@nrwl/react/babel`],
|
|
101
|
+
rootMode: 'upward',
|
|
102
|
+
babelrc: true,
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return config;
|
|
107
|
+
}
|
|
108
|
+
const loaderModulesOptions = {
|
|
109
|
+
modules: {
|
|
110
|
+
mode: 'local',
|
|
111
|
+
getLocalIdent: web_config_1.getCSSModuleLocalIdent,
|
|
112
|
+
},
|
|
113
|
+
importLoaders: 1,
|
|
114
|
+
};
|
|
115
|
+
const commonLoaders = [
|
|
116
|
+
{
|
|
117
|
+
loader: require.resolve('style-loader'),
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
loader: require.resolve('css-loader'),
|
|
121
|
+
options: loaderModulesOptions,
|
|
122
|
+
},
|
|
123
|
+
];
|
|
124
|
+
const CSS_MODULES_LOADER = {
|
|
125
|
+
test: /\.css$|\.scss$|\.sass$|\.less$|\.styl$/,
|
|
126
|
+
oneOf: [
|
|
127
|
+
{
|
|
128
|
+
test: /\.module\.css$/,
|
|
129
|
+
use: commonLoaders,
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
test: /\.module\.(scss|sass)$/,
|
|
133
|
+
use: [
|
|
134
|
+
...commonLoaders,
|
|
135
|
+
{
|
|
136
|
+
loader: require.resolve('sass-loader'),
|
|
137
|
+
options: {
|
|
138
|
+
implementation: require('sass'),
|
|
139
|
+
sassOptions: {
|
|
140
|
+
fiber: false,
|
|
141
|
+
precision: 8,
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
test: /\.module\.less$/,
|
|
149
|
+
use: [
|
|
150
|
+
...commonLoaders,
|
|
151
|
+
{
|
|
152
|
+
loader: require.resolve('less-loader'),
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
test: /\.module\.styl$/,
|
|
158
|
+
use: [
|
|
159
|
+
...commonLoaders,
|
|
160
|
+
{
|
|
161
|
+
loader: require.resolve('stylus-loader'),
|
|
162
|
+
},
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
};
|
|
167
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/react/plugins/component-testing/index.ts"],"names":[],"mappings":";;;AAAA,yEAA2E;AAC3E,+DAAwE;AACxE,iFAAoE;AAGpE;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,wBAAwB,CAAC,YAAoB;IAC3D,uCACK,IAAA,oCAAmB,EAAC,YAAY,CAAC,KACpC,SAAS,EAAE;YACT,kCAAkC;YAClC,gDAAgD;YAChD,SAAS,EAAE,OAAO;YAClB,OAAO,EAAE,SAAS;YAClB,aAAa,EAAE,sBAAsB,CAAC;gBACpC,YAAY,EAAE,kBAAkB;gBAChC,QAAQ,EAAE,OA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;iBACvC;aACF;SACF;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,GAAG,EAAE;gBACH,GAAG,aAAa;gBAChB;oBACE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC;iBACzC;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -20,7 +20,7 @@ function getClientEnvironment(mode) {
|
|
|
20
20
|
// Grab NODE_ENV and NX_* and STORYBOOK_* environment variables and prepare them to be
|
|
21
21
|
// injected into the application via DefinePlugin in webpack configuration.
|
|
22
22
|
const NX_PREFIX = /^NX_/i;
|
|
23
|
-
const STORYBOOK_PREFIX = /^
|
|
23
|
+
const STORYBOOK_PREFIX = /^STORYBOOK_/i;
|
|
24
24
|
const raw = Object.keys(process.env)
|
|
25
25
|
.filter((key) => NX_PREFIX.test(key) || STORYBOOK_PREFIX.test(key))
|
|
26
26
|
.reduce((env, key) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/react/plugins/storybook/index.ts"],"names":[],"mappings":";;;;AAAA,yCAA+D;AAC/D,yCAA6C;AAC7C,uDAAmE;AACnE,+DAAkE;AAClE,+EAAsF;AACtF,wDAAgD;AAChD,+BAA4B;AAC5B,mCAA6B;AAC7B,qCAA6E;AAC7E,8CAA8C;AAC9C,mDAA+C;AAE/C,MAAM,kBAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAEjD,6DAA6D;AAC7D,sIAAsI;AACtI,SAAS,oBAAoB,CAAC,IAAI;IAChC,sFAAsF;IACtF,2EAA2E;IAC3E,MAAM,SAAS,GAAG,OAAO,CAAC;IAC1B,MAAM,gBAAgB,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/react/plugins/storybook/index.ts"],"names":[],"mappings":";;;;AAAA,yCAA+D;AAC/D,yCAA6C;AAC7C,uDAAmE;AACnE,+DAAkE;AAClE,+EAAsF;AACtF,wDAAgD;AACh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C,MAAA,sBAAsB,CAAC,OAAO,mCAAI,EAAE,CAAC,EACzC,GAAG,CAAC,MAAA,WAAW,CAAC,OAAO,mCAAI,EAAE,CAAC,CAC/B,KAEH,sBAAsB,CACvB,CAAC;AACJ,CAAC,CAAA,CAAC;AA7HW,QAAA,OAAO,WA6HlB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Schema } from './schema';
|
|
2
1
|
import { GeneratorCallback, Tree } from '@nrwl/devkit';
|
|
2
|
+
import { Schema } from './schema';
|
|
3
3
|
export declare function componentGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export default componentGenerator;
|
|
5
5
|
export declare const componentSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.componentSchematic = exports.componentGenerator = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const ts = require("typescript");
|
|
6
|
-
const versions_1 = require("../../utils/versions");
|
|
7
|
-
const assertion_1 = require("../../utils/assertion");
|
|
8
|
-
const add_styled_dependencies_1 = require("../../rules/add-styled-dependencies");
|
|
9
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
10
6
|
const run_tasks_in_serial_1 = require("@nrwl/workspace/src/utilities/run-tasks-in-serial");
|
|
7
|
+
const ts = require("typescript");
|
|
8
|
+
const add_styled_dependencies_1 = require("../../rules/add-styled-dependencies");
|
|
9
|
+
const assertion_1 = require("../../utils/assertion");
|
|
11
10
|
const ast_utils_1 = require("../../utils/ast-utils");
|
|
11
|
+
const versions_1 = require("../../utils/versions");
|
|
12
12
|
function componentGenerator(host, schema) {
|
|
13
13
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
14
14
|
const options = yield normalizeOptions(host, schema);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/component/component.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/component/component.ts"],"names":[],"mappings":";;;;AAAA,yCAasB;AACtB,2FAAqF;AACrF,iCAAiC;AACjC,iFAAkF;AAClF,qDAAyD;AACzD,qDAAkD;AAClD,mDAG8B;AAW9B,SAAsB,kBAAkB,CAAC,IAAU,EAAE,MAAc;;QACjE,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACrD,oBAAoB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAEpC,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,MAAM,UAAU,GAAG,IAAA,qDAA2B,EAAC,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;QAC3E,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAEvB,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAElC,IAAI,OAAO,CAAC,OAAO,EAAE;YACnB,MAAM,WAAW,GAAG,IAAA,qCAA4B,EAC9C,IAAI,EACJ,EAAE,kBAAkB,EAAE,gCAAqB,EAAE,EAC7C,EAAE,yBAAyB,EAAE,qCAA0B,EAAE,CAC1D,CAAC;YACF,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACzB;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,IAAA,sCAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAvBD,gDAuBC;AAED,SAAS,oBAAoB,CAAC,IAAU,EAAE,OAAyB;IACjE,MAAM,YAAY,GAAG,IAAA,0BAAiB,EACpC,OAAO,CAAC,iBAAiB,EACzB,OAAO,CAAC,SAAS,CAClB,CAAC;IAEF,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,SAAS,EAAE,SAAS,CA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.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.componentCypressSchematic = exports.createComponentSpecFile = exports.getArgsDefaultValue = exports.componentCypressGenerator = void 0;
|
|
4
|
-
const ast_utils_1 = require("../../utils/ast-utils");
|
|
5
|
-
const ts = require("typescript");
|
|
6
4
|
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const path_1 = require("path");
|
|
6
|
+
const ts = require("typescript");
|
|
7
|
+
const ast_utils_1 = require("../../utils/ast-utils");
|
|
7
8
|
function componentCypressGenerator(host, schema) {
|
|
8
9
|
createComponentSpecFile(host, schema);
|
|
9
10
|
}
|
|
@@ -30,7 +31,10 @@ exports.getArgsDefaultValue = getArgsDefaultValue;
|
|
|
30
31
|
function createComponentSpecFile(tree, { project, componentPath, js, cypressProject }) {
|
|
31
32
|
const e2eProjectName = cypressProject || `${project}-e2e`;
|
|
32
33
|
const projects = (0, devkit_1.getProjects)(tree);
|
|
33
|
-
const
|
|
34
|
+
const e2eProject = projects.get(e2eProjectName);
|
|
35
|
+
// cypress >= v10 will have a cypress.config.ts < v10 will have a cypress.json
|
|
36
|
+
const isCypressV10 = tree.exists((0, path_1.join)(e2eProject.root, 'cypress.config.ts'));
|
|
37
|
+
const e2eLibIntegrationFolderPath = (0, path_1.join)(e2eProject.sourceRoot, isCypressV10 ? 'e2e' : 'integration');
|
|
34
38
|
const proj = projects.get(project);
|
|
35
39
|
const componentFilePath = (0, devkit_1.joinPathFragments)(proj.sourceRoot, componentPath);
|
|
36
40
|
const componentName = componentFilePath
|
|
@@ -71,6 +75,8 @@ function findPropsAndGenerateFileForCypress(tree, sourceFile, cmpDeclaration, e2
|
|
|
71
75
|
};
|
|
72
76
|
});
|
|
73
77
|
}
|
|
78
|
+
const isCypressV10 = (0, path_1.basename)(e2eLibIntegrationFolderPath) === 'e2e';
|
|
79
|
+
const cyFilePrefix = isCypressV10 ? 'cy' : 'spec';
|
|
74
80
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, './files'), `${e2eLibIntegrationFolderPath}/${fromNodeArray
|
|
75
81
|
? componentName + '--' + cmpDeclaration.name.text
|
|
76
82
|
: componentName}`, {
|
|
@@ -78,7 +84,7 @@ function findPropsAndGenerateFileForCypress(tree, sourceFile, cmpDeclaration, e2
|
|
|
78
84
|
componentName,
|
|
79
85
|
componentSelector: cmpDeclaration.name.text,
|
|
80
86
|
props,
|
|
81
|
-
fileExt: js ?
|
|
87
|
+
fileExt: js ? `${cyFilePrefix}.js` : `${cyFilePrefix}.ts`,
|
|
82
88
|
});
|
|
83
89
|
}
|
|
84
90
|
exports.default = componentCypressGenerator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-cypress-spec.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/component-cypress-spec/component-cypress-spec.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"component-cypress-spec.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/component-cypress-spec/component-cypress-spec.ts"],"names":[],"mappings":";;;AAAA,yCAMsB;AACtB,+BAAsC;AACtC,iCAAiC;AACjC,qDAI+B;AAS/B,SAAgB,yBAAyB,CACvC,IAAU,EACV,MAAqC;IAErC,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACxC,CAAC;AALD,8DAKC;AAED,+DAA+D;AAC/D,SAAgB,mBAAmB,CAAC,QAAuB;IACzD,MAAM,iBAAiB,GAAwB;QAC7C,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,EAAE;QACjC,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAChC,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,KAAK;KACtC,CAAC;IAEF,MAAM,aAAa,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,OAAO,aAAa,KAAK,SAAS,EAAE;QACtC,OAAO,EAAE,CAAC;KACX;S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AC,IAAsB,CAAC,IAAI;gBACzC,YAAY,EAAE,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;aACpD,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,YAAY,GAAG,IAAA,eAAQ,EAAC,2BAA2B,CAAC,KAAK,KAAK,CAAC;IACrE,MAAM,YAAY,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IAElD,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,SAAS,CAAC,EACvC,GAAG,2BAA2B,IAC5B,aAAa;QACX,CAAC,CAAC,aAAa,GAAG,IAAI,GAAI,cAAsB,CAAC,IAAI,CAAC,IAAI;QAC1D,CAAC,CAAC,aACN,EAAE,EACF;QACE,WAAW,EAAE,OAAO;QACpB,aAAa;QACb,iBAAiB,EAAG,cAAsB,CAAC,IAAI,CAAC,IAAI;QACpD,KAAK;QACL,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,YAAY,KAAK;KAC1D,CACF,CAAC;AACJ,CAAC;AAED,kBAAe,yBAAyB,CAAC;AAC5B,QAAA,yBAAyB,GAAG,IAAA,2BAAkB,EACzD,yBAAyB,CAC1B,CAAC"}
|
|
File without changes
|
|
@@ -4,7 +4,6 @@ export interface CreateComponentStoriesFileSchema {
|
|
|
4
4
|
project: string;
|
|
5
5
|
componentPath: string;
|
|
6
6
|
}
|
|
7
|
-
export declare function getArgsDefaultValue(property: ts.SyntaxKind): string;
|
|
8
7
|
export declare function createComponentStoriesFile(host: Tree, { project, componentPath }: CreateComponentStoriesFileSchema): void;
|
|
9
8
|
export declare function findPropsAndGenerateFile(host: Tree, sourceFile: ts.SourceFile, cmpDeclaration: ts.Node, componentDirectory: string, name: string, isPlainJs: boolean, fileExt: string, fromNodeArray?: boolean): void;
|
|
10
9
|
export declare function componentStoryGenerator(host: Tree, schema: CreateComponentStoriesFileSchema): Promise<void>;
|
|
@@ -1,26 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.componentStorySchematic = exports.componentStoryGenerator = exports.findPropsAndGenerateFile = exports.createComponentStoriesFile =
|
|
3
|
+
exports.componentStorySchematic = exports.componentStoryGenerator = exports.findPropsAndGenerateFile = exports.createComponentStoriesFile = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
6
|
const ts = require("typescript");
|
|
7
7
|
const ast_utils_1 = require("../../utils/ast-utils");
|
|
8
|
-
|
|
9
|
-
function getArgsDefaultValue(property) {
|
|
10
|
-
const typeNameToDefault = {
|
|
11
|
-
[ts.SyntaxKind.StringKeyword]: "''",
|
|
12
|
-
[ts.SyntaxKind.NumberKeyword]: 0,
|
|
13
|
-
[ts.SyntaxKind.BooleanKeyword]: false,
|
|
14
|
-
};
|
|
15
|
-
const resolvedValue = typeNameToDefault[property];
|
|
16
|
-
if (typeof resolvedValue === undefined) {
|
|
17
|
-
return "''";
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
return resolvedValue;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.getArgsDefaultValue = getArgsDefaultValue;
|
|
8
|
+
const component_props_1 = require("../../utils/component-props");
|
|
24
9
|
function createComponentStoriesFile(host, { project, componentPath }) {
|
|
25
10
|
const proj = (0, devkit_1.getProjects)(host).get(project);
|
|
26
11
|
const sourceRoot = proj.sourceRoot;
|
|
@@ -63,29 +48,7 @@ function createComponentStoriesFile(host, { project, componentPath }) {
|
|
|
63
48
|
}
|
|
64
49
|
exports.createComponentStoriesFile = createComponentStoriesFile;
|
|
65
50
|
function findPropsAndGenerateFile(host, sourceFile, cmpDeclaration, componentDirectory, name, isPlainJs, fileExt, fromNodeArray) {
|
|
66
|
-
const
|
|
67
|
-
let propsTypeName = null;
|
|
68
|
-
let props = [];
|
|
69
|
-
let argTypes = [];
|
|
70
|
-
if (propsInterface) {
|
|
71
|
-
propsTypeName = propsInterface.name.text;
|
|
72
|
-
props = propsInterface.members.map((member) => {
|
|
73
|
-
if (member.type.kind === ts.SyntaxKind.FunctionType) {
|
|
74
|
-
argTypes.push({
|
|
75
|
-
name: member.name.text,
|
|
76
|
-
type: 'action',
|
|
77
|
-
actionText: `${member.name.text} executed!`,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
return {
|
|
82
|
-
name: member.name.text,
|
|
83
|
-
defaultValue: getArgsDefaultValue(member.type.kind),
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
props = props.filter((p) => p && p.defaultValue !== undefined);
|
|
88
|
-
}
|
|
51
|
+
const { propsTypeName, props, argTypes } = (0, component_props_1.getDefaultsForComponent)(sourceFile, cmpDeclaration);
|
|
89
52
|
(0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, './files'), (0, devkit_1.normalizePath)(componentDirectory), {
|
|
90
53
|
componentFileName: fromNodeArray
|
|
91
54
|
? `${name}--${cmpDeclaration.name.text}`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-story.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/component-story/component-story.ts"],"names":[],"mappings":";;;;AAAA,yCAQsB;AACtB,iCAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"component-story.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/component-story/component-story.ts"],"names":[],"mappings":";;;;AAAA,yCAQsB;AACtB,iCAAiC;AACjC,qDAG+B;AAC/B,iEAAsE;AAOtE,SAAgB,0BAA0B,CACxC,IAAU,EACV,EAAE,OAAO,EAAE,aAAa,EAAoC;IAE5D,MAAM,IAAI,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;I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,IAAI,CAAC,IAAI;QAChD,SAAS;QACT,OAAO;KACR,CACF,CAAC;AACJ,CAAC;AAhCD,4DAgCC;AAED,SAAsB,uBAAuB,CAC3C,IAAU,EACV,MAAwC;;QAExC,0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACzC,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IAC1B,CAAC;CAAA;AAND,0DAMC;AAED,kBAAe,uBAAuB,CAAC;AAC1B,QAAA,uBAAuB,GAAG,IAAA,2BAAkB,EACvD,uBAAuB,CACxB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.componentTestGenerator = void 0;
|
|
4
|
+
const cypress_version_1 = require("@nrwl/cypress/src/utils/cypress-version");
|
|
5
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const ts = require("typescript");
|
|
8
|
+
const ast_utils_1 = require("../../utils/ast-utils");
|
|
9
|
+
const component_props_1 = require("../../utils/component-props");
|
|
10
|
+
function componentTestGenerator(tree, options) {
|
|
11
|
+
(0, cypress_version_1.assertMinimumCypressVersion)(10);
|
|
12
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
13
|
+
const normalizedPath = options.componentPath.startsWith(projectConfig.sourceRoot)
|
|
14
|
+
? (0, path_1.relative)(projectConfig.sourceRoot, options.componentPath)
|
|
15
|
+
: options.componentPath;
|
|
16
|
+
const componentPath = (0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, normalizedPath);
|
|
17
|
+
if (tree.exists(componentPath)) {
|
|
18
|
+
generateSpecsForComponents(tree, componentPath);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.componentTestGenerator = componentTestGenerator;
|
|
22
|
+
function generateSpecsForComponents(tree, filePath) {
|
|
23
|
+
const sourceFile = ts.createSourceFile(filePath, tree.read(filePath, 'utf-8'), ts.ScriptTarget.Latest, true);
|
|
24
|
+
const cmpNodes = (0, ast_utils_1.findExportDeclarationsForJsx)(sourceFile);
|
|
25
|
+
const componentDir = (0, path_1.dirname)(filePath);
|
|
26
|
+
const ext = (0, path_1.extname)(filePath);
|
|
27
|
+
const fileName = (0, path_1.basename)(filePath, ext);
|
|
28
|
+
const defaultExport = (0, ast_utils_1.getComponentNode)(sourceFile);
|
|
29
|
+
if (cmpNodes === null || cmpNodes === void 0 ? void 0 : cmpNodes.length) {
|
|
30
|
+
const components = cmpNodes.map((cmp) => {
|
|
31
|
+
const defaults = (0, component_props_1.getDefaultsForComponent)(sourceFile, cmp);
|
|
32
|
+
const isDefaultExport = defaultExport
|
|
33
|
+
? defaultExport.name.text === cmp.name.text
|
|
34
|
+
: false;
|
|
35
|
+
return {
|
|
36
|
+
isDefaultExport,
|
|
37
|
+
props: [...defaults.props, ...defaults.argTypes],
|
|
38
|
+
name: cmp.name.text,
|
|
39
|
+
typeName: defaults.propsTypeName,
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
const namedImports = components
|
|
43
|
+
.reduce((imports, cmp) => {
|
|
44
|
+
if (cmp.typeName) {
|
|
45
|
+
imports.push(cmp.typeName);
|
|
46
|
+
}
|
|
47
|
+
if (cmp.isDefaultExport) {
|
|
48
|
+
return imports;
|
|
49
|
+
}
|
|
50
|
+
imports.push(cmp.name);
|
|
51
|
+
return imports;
|
|
52
|
+
}, [])
|
|
53
|
+
.join(', ');
|
|
54
|
+
const namedImportStatement = namedImports.length > 0 ? `, { ${namedImports} }` : '';
|
|
55
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), componentDir, {
|
|
56
|
+
fileName,
|
|
57
|
+
components,
|
|
58
|
+
importStatement: defaultExport
|
|
59
|
+
? `import ${defaultExport.name.text}${namedImportStatement} from './${fileName}'`
|
|
60
|
+
: `import { ${namedImports} } from './${fileName}'`,
|
|
61
|
+
ext,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.default = componentTestGenerator;
|
|
66
|
+
//# sourceMappingURL=component-test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-test.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/component-test/component-test.ts"],"names":[],"mappings":";;;AAAA,6EAAsF;AACtF,yCAKsB;AACtB,+BAA4D;AAC5D,iCAAiC;AACjC,qDAG+B;AAC/B,iEAAsE;AAGtE,SAAgB,sBAAsB,CACpC,IAAU,EACV,OAA4B;IAE5B,IAAA,6CAA2B,EAAC,EAAE,CAAC,CAAC;IAEhC,MAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAEtE,MAAM,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,UAAU,CACrD,aAAa,CAAC,UAAU,CACzB;QACC,CAAC,CAAC,IAAA,eAAQ,EAAC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,aAAa,CAAC;QAC3D,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAE1B,MAAM,aAAa,GAAG,IAAA,0BAAiB,EACrC,aAAa,CAAC,UAAU,EACxB,cAAc,CACf,CAAC;IAEF,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;QAC9B,0BAA0B,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;KACjD;AACH,CAAC;AAtBD,wDAsBC;AAED,SAAS,0BAA0B,CAAC,IAAU,EAAE,QAAgB;IAC9D,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CACpC,QAAQ,EACR,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,EAC5B,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IAEF,MAAM,QAAQ,GAAG,IAAA,wCAA4B,EAAC,UAAU,CAAC,CAAC;IAC1D,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,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,MAAM,oBAAoB,GACxB,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,YAAY,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAEzD,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE;YACvE,QAAQ;YACR,UAAU;YACV,eAAe,EAAE,aAAa;gBAC5B,CAAC,CAAC,UACG,aAAqB,CAAC,IAAI,CAAC,IAC9B,GAAG,oBAAoB,YAAY,QAAQ,GAAG;gBAChD,CAAC,CAAC,YAAY,YAAY,cAAc,QAAQ,GAAG;YACrD,GAAG;SACJ,CAAC,CAAC;KACJ;AACH,CAAC;AAED,kBAAe,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
import { mount } from 'cypress/react'
|
|
3
|
+
<%- importStatement %>
|
|
4
|
+
|
|
5
|
+
<% for (let cmp of components) { %>
|
|
6
|
+
describe(<%= cmp.name %>.name, () => {<% if (cmp.typeName) { %>
|
|
7
|
+
let props: <%= cmp.typeName%>;
|
|
8
|
+
|
|
9
|
+
beforeEach(() => {
|
|
10
|
+
props = {<% for (let prop of cmp.props) { %>
|
|
11
|
+
<%- prop.name %>: <% if(prop.type === 'action') { %>undefined<% } else { %><%- prop.defaultValue %>,<% } %><% }%>
|
|
12
|
+
}
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
it('renders', () => {
|
|
16
|
+
mount(<<%= cmp.name %> {...props}/>)
|
|
17
|
+
})<% } else { %>
|
|
18
|
+
it('renders', () => {
|
|
19
|
+
mount(<<%= cmp.name %> />)
|
|
20
|
+
})<% } %>
|
|
21
|
+
})
|
|
22
|
+
<% } %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/component-test/schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "NxReactCypressComponentTest",
|
|
5
|
+
"title": "Add Cypress component test",
|
|
6
|
+
"description": "Add a Cypress component test for a component.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"examples": [
|
|
9
|
+
{
|
|
10
|
+
"command": "nx g @nrwl/react:component-test --project=my-react-project --component-path=src/lib/fancy-component.tsx",
|
|
11
|
+
"description": "Create a cypress component test for FancyComponent"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"properties": {
|
|
15
|
+
"project": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The name of the project the component is apart of",
|
|
18
|
+
"$default": {
|
|
19
|
+
"$source": "projectName"
|
|
20
|
+
},
|
|
21
|
+
"x-prompt": "What project is this component apart of?"
|
|
22
|
+
},
|
|
23
|
+
"componentPath": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"description": "Path to component, from the project source root",
|
|
26
|
+
"x-prompt": "What is the path to the component?"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"required": ["project", "componentPath"]
|
|
30
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Tree } from '@nrwl/devkit';
|
|
2
|
+
import { CypressComponentConfigurationSchema } from './schema';
|
|
3
|
+
/**
|
|
4
|
+
* This is for using cypresses own Component testing, if you want to use test
|
|
5
|
+
* storybook components then use componentCypressGenerator instead.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
export declare function cypressComponentConfigGenerator(tree: Tree, options: CypressComponentConfigurationSchema): Promise<() => void>;
|
|
9
|
+
export default cypressComponentConfigGenerator;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cypressComponentConfigGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const cypress_1 = require("@nrwl/cypress");
|
|
6
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
+
const ts = require("typescript");
|
|
8
|
+
const ast_utils_1 = require("../../utils/ast-utils");
|
|
9
|
+
const component_test_1 = require("../component-test/component-test");
|
|
10
|
+
const allowedFileExt = new RegExp(/\.[jt]sx?/g);
|
|
11
|
+
const isSpecFile = new RegExp(/(spec|test)\./g);
|
|
12
|
+
/**
|
|
13
|
+
* This is for using cypresses own Component testing, if you want to use test
|
|
14
|
+
* storybook components then use componentCypressGenerator instead.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
function cypressComponentConfigGenerator(tree, options) {
|
|
18
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
20
|
+
const installTask = yield (0, cypress_1.cypressComponentProject)(tree, {
|
|
21
|
+
project: options.project,
|
|
22
|
+
skipFormat: true,
|
|
23
|
+
});
|
|
24
|
+
addFiles(tree, projectConfig, options);
|
|
25
|
+
updateTsConfig(tree, projectConfig);
|
|
26
|
+
if (options.skipFormat) {
|
|
27
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
28
|
+
}
|
|
29
|
+
return () => {
|
|
30
|
+
installTask();
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
exports.cypressComponentConfigGenerator = cypressComponentConfigGenerator;
|
|
35
|
+
function addFiles(tree, projectConfig, options) {
|
|
36
|
+
const cypressConfigPath = (0, devkit_1.joinPathFragments)(projectConfig.root, 'cypress.config.ts');
|
|
37
|
+
if (tree.exists(cypressConfigPath)) {
|
|
38
|
+
tree.delete(cypressConfigPath);
|
|
39
|
+
}
|
|
40
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), projectConfig.root, {
|
|
41
|
+
tpl: '',
|
|
42
|
+
});
|
|
43
|
+
if (options.generateTests) {
|
|
44
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, projectConfig.sourceRoot, (filePath) => {
|
|
45
|
+
if (isComponent(tree, filePath)) {
|
|
46
|
+
(0, component_test_1.default)(tree, {
|
|
47
|
+
project: options.project,
|
|
48
|
+
componentPath: filePath,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function updateTsConfig(tree, projectConfig) {
|
|
55
|
+
const tsConfigPath = (0, devkit_1.joinPathFragments)(projectConfig.root, projectConfig.projectType === 'library'
|
|
56
|
+
? 'tsconfig.lib.json'
|
|
57
|
+
: 'tsconfig.app.json');
|
|
58
|
+
if (tree.exists(tsConfigPath)) {
|
|
59
|
+
(0, devkit_1.updateJson)(tree, tsConfigPath, (json) => {
|
|
60
|
+
const excluded = new Set([
|
|
61
|
+
...(json.exclude || []),
|
|
62
|
+
'cypress/**/*',
|
|
63
|
+
'cypress.config.ts',
|
|
64
|
+
'**/*.cy.ts',
|
|
65
|
+
'**/*.cy.js',
|
|
66
|
+
'**/*.cy.tsx',
|
|
67
|
+
'**/*.cy.jsx',
|
|
68
|
+
]);
|
|
69
|
+
json.exclude = Array.from(excluded);
|
|
70
|
+
return json;
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const projectBaseTsConfig = (0, devkit_1.joinPathFragments)(projectConfig.root, 'tsconfig.json');
|
|
74
|
+
if (tree.exists(projectBaseTsConfig)) {
|
|
75
|
+
(0, devkit_1.updateJson)(tree, projectBaseTsConfig, (json) => {
|
|
76
|
+
if (json.references) {
|
|
77
|
+
const hasCyTsConfig = json.references.some((r) => r.path === './tsconfig.cy.json');
|
|
78
|
+
if (!hasCyTsConfig) {
|
|
79
|
+
json.references.push({ path: './tsconfig.cy.json' });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
const excluded = new Set([
|
|
84
|
+
...(json.exclude || []),
|
|
85
|
+
'cypress/**/*',
|
|
86
|
+
'cypress.config.ts',
|
|
87
|
+
'**/*.cy.ts',
|
|
88
|
+
'**/*.cy.js',
|
|
89
|
+
'**/*.cy.tsx',
|
|
90
|
+
'**/*.cy.jsx',
|
|
91
|
+
]);
|
|
92
|
+
json.exclude = Array.from(excluded);
|
|
93
|
+
}
|
|
94
|
+
return json;
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function isComponent(tree, filePath) {
|
|
99
|
+
if (isSpecFile.test(filePath) || !allowedFileExt.test(filePath)) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
const content = tree.read(filePath, 'utf-8');
|
|
103
|
+
const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);
|
|
104
|
+
const cmpDeclaration = (0, ast_utils_1.getComponentNode)(sourceFile);
|
|
105
|
+
return !!cmpDeclaration;
|
|
106
|
+
}
|
|
107
|
+
exports.default = cypressComponentConfigGenerator;
|
|
108
|
+
//# sourceMappingURL=cypress-component-configuration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cypress-component-configuration.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.ts"],"names":[],"mappings":";;;;AAAA,2CAAwD;AACxD,yCASsB;AACtB,iCAAiC;AACjC,qDAAyD;AACzD,qEAAsE;AAGtE,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC;AAChD,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAEhD;;;;GAIG;AACH,SAAsB,+BAA+B,CACnD,IAAU,EACV,OAA4C;;QAE5C,MAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACtE,MAAM,WAAW,GAAG,MAAM,IAAA,iCAAuB,EAAC,IAA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Y;oBACZ,YAAY;oBACZ,aAAa;oBACb,aAAa;iBACd,CAAC,CAAC;gBAEH,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;aACrC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;KACJ;AACH,CAAC;AAED,SAAS,WAAW,CAAC,IAAU,EAAE,QAAgB;IAC/C,IAAI,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAC/D,OAAO,KAAK,CAAC;KACd;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,EAAE,CAAC,gBAAgB,CACpC,QAAQ,EACR,OAAO,EACP,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IAEF,MAAM,cAAc,GAAG,IAAA,4BAAgB,EAAC,UAAU,CAAC,CAAC;IACpD,OAAO,CAAC,CAAC,cAAc,CAAC;AAC1B,CAAC;AAED,kBAAe,+BAA+B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/cypress-component-configuration/schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "NxReactCypressComponentTestConfiguration",
|
|
5
|
+
"title": "Add Cypress component testing",
|
|
6
|
+
"description": "Add a Cypress component testing configuration to an existing project.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"examples": [
|
|
9
|
+
{
|
|
10
|
+
"command": "nx g @nrwl/react:cypress-component-configuration --project=my-react-project",
|
|
11
|
+
"description": "Add component testing to your react project"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"command": "nx g @nrwl/react:cypress-component-configuration --project=my-react-project --generate-tests",
|
|
15
|
+
"description": "Add component testing to your react project and generate component tests for your existing components"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"properties": {
|
|
19
|
+
"project": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"description": "The name of the project to add cypress component testing configuration to",
|
|
22
|
+
"$default": {
|
|
23
|
+
"$source": "projectName"
|
|
24
|
+
},
|
|
25
|
+
"x-prompt": "What project should we add Cypress component testing to?"
|
|
26
|
+
},
|
|
27
|
+
"generateTests": {
|
|
28
|
+
"type": "boolean",
|
|
29
|
+
"description": "Generate default component tests for existing components in the project",
|
|
30
|
+
"default": false
|
|
31
|
+
},
|
|
32
|
+
"skipFormat": {
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"description": "Skip formatting files",
|
|
35
|
+
"default": false
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"required": ["project"]
|
|
39
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as ts from 'typescript';
|
|
2
|
+
export declare function getArgsDefaultValue(property: ts.SyntaxKind): string;
|
|
3
|
+
export declare function getDefaultsForComponent(sourceFile: ts.SourceFile, cmpDeclaration: ts.Node): {
|
|
4
|
+
propsTypeName: string;
|
|
5
|
+
props: {
|
|
6
|
+
name: string;
|
|
7
|
+
defaultValue: any;
|
|
8
|
+
}[];
|
|
9
|
+
argTypes: {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
actionText: string;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
export declare function getImportForType(sourceFile: ts.SourceFile, typeName: string): ts.Statement;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getImportForType = exports.getDefaultsForComponent = exports.getArgsDefaultValue = void 0;
|
|
4
|
+
const ts = require("typescript");
|
|
5
|
+
const ast_utils_1 = require("./ast-utils");
|
|
6
|
+
// TODO: candidate to refactor with the angular component story
|
|
7
|
+
function getArgsDefaultValue(property) {
|
|
8
|
+
const typeNameToDefault = {
|
|
9
|
+
[ts.SyntaxKind.StringKeyword]: "''",
|
|
10
|
+
[ts.SyntaxKind.NumberKeyword]: 0,
|
|
11
|
+
[ts.SyntaxKind.BooleanKeyword]: false,
|
|
12
|
+
};
|
|
13
|
+
const resolvedValue = typeNameToDefault[property];
|
|
14
|
+
if (typeof resolvedValue === undefined) {
|
|
15
|
+
return "''";
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
return resolvedValue;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.getArgsDefaultValue = getArgsDefaultValue;
|
|
22
|
+
function getDefaultsForComponent(sourceFile, cmpDeclaration) {
|
|
23
|
+
const propsInterface = (0, ast_utils_1.getComponentPropsInterface)(sourceFile, cmpDeclaration);
|
|
24
|
+
let propsTypeName = null;
|
|
25
|
+
let props = [];
|
|
26
|
+
let argTypes = [];
|
|
27
|
+
if (propsInterface) {
|
|
28
|
+
propsTypeName = propsInterface.name.text;
|
|
29
|
+
props = propsInterface.members.map((member) => {
|
|
30
|
+
if (member.type.kind === ts.SyntaxKind.FunctionType) {
|
|
31
|
+
argTypes.push({
|
|
32
|
+
name: member.name.text,
|
|
33
|
+
type: 'action',
|
|
34
|
+
actionText: `${member.name.text} executed!`,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
return {
|
|
39
|
+
name: member.name.text,
|
|
40
|
+
defaultValue: getArgsDefaultValue(member.type.kind),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
props = props.filter((p) => p && p.defaultValue !== undefined);
|
|
45
|
+
}
|
|
46
|
+
return { propsTypeName, props, argTypes };
|
|
47
|
+
}
|
|
48
|
+
exports.getDefaultsForComponent = getDefaultsForComponent;
|
|
49
|
+
function getImportForType(sourceFile, typeName) {
|
|
50
|
+
return sourceFile.statements.find((statement) => ts.isImportDeclaration(statement) &&
|
|
51
|
+
statement.getText().includes(typeName));
|
|
52
|
+
}
|
|
53
|
+
exports.getImportForType = getImportForType;
|
|
54
|
+
//# sourceMappingURL=component-props.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-props.js","sourceRoot":"","sources":["../../../../../packages/react/src/utils/component-props.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,2CAAyD;AAEzD,+DAA+D;AAC/D,SAAgB,mBAAmB,CAAC,QAAuB;IACzD,MAAM,iBAAiB,GAAwB;QAC7C,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,IAAI;QACnC,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAChC,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,KAAK;KACtC,CAAC;IAEF,MAAM,aAAa,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,OAAO,aAAa,KAAK,SAAS,EAAE;QACtC,OAAO,IAAI,CAAC;KACb;SAAM;QACL,OAAO,aAAa,CAAC;KACtB;AACH,CAAC;AAbD,kDAaC;AAED,SAAgB,uBAAuB,CACrC,UAAyB,EACzB,cAAuB;IAEvB,MAAM,cAAc,GAAG,IAAA,sCAA0B,EAAC,UAAU,EAAE,cAAc,CAAC,CAAC;IAE9E,IAAI,aAAa,GAAW,IAAI,CAAC;IACjC,IAAI,KAAK,GAGH,EAAE,CAAC;IACT,IAAI,QAAQ,GAIN,EAAE,CAAC;IAET,IAAI,cAAc,EAAE;QAClB,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC;QACzC,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAA4B,EAAE,EAAE;YAClE,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,UAAU,CAAC,YAAY,EAAE;gBACnD,QAAQ,CAAC,IAAI,CAAC;oBACZ,IAAI,EAAG,MAAM,CAAC,IAAsB,CAAC,IAAI;oBACzC,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE,GAAI,MAAM,CAAC,IAAsB,CAAC,IAAI,YAAY;iBAC/D,CAAC,CAAC;aACJ;iBAAM;gBACL,OAAO;oBACL,IAAI,EAAG,MAAM,CAAC,IAAsB,CAAC,IAAI;oBACzC,YAAY,EAAE,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;iBACpD,CAAC;aACH;QACH,CAAC,CAAC,CAAC;QACH,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC;KAChE;IACD,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AAC5C,CAAC;AApCD,0DAoCC;AAED,SAAgB,gBAAgB,CAAC,UAAyB,EAAE,QAAgB;IAC1E,OAAO,UAAU,CAAC,UAAU,CAAC,IAAI,CAC/B,CAAC,SAAkB,EAAE,EAAE,CACrB,EAAE,CAAC,mBAAmB,CAAC,SAAS,CAAC;QACjC,SAAS,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CACzC,CAAC;AACJ,CAAC;AAND,4CAMC"}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ export declare const nxVersion: any;
|
|
|
2
2
|
export declare const reactVersion = "18.2.0";
|
|
3
3
|
export declare const reactDomVersion = "18.2.0";
|
|
4
4
|
export declare const reactIsVersion = "18.2.0";
|
|
5
|
-
export declare const typesReactVersion = "18.0.
|
|
6
|
-
export declare const typesReactDomVersion = "18.0.
|
|
5
|
+
export declare const typesReactVersion = "18.0.15";
|
|
6
|
+
export declare const typesReactDomVersion = "18.0.6";
|
|
7
7
|
export declare const typesReactIsVersion = "17.0.3";
|
|
8
|
-
export declare const typesNodeVersion = "18.0.
|
|
8
|
+
export declare const typesNodeVersion = "18.0.4";
|
|
9
9
|
export declare const styledComponentsVersion = "5.3.5";
|
|
10
10
|
export declare const typesStyledComponentsVersion = "5.1.25";
|
|
11
11
|
export declare const emotionStyledVersion = "11.9.3";
|
|
@@ -15,7 +15,7 @@ export declare const styledJsxVersion = "5.0.2";
|
|
|
15
15
|
export declare const reactRouterDomVersion = "6.3.0";
|
|
16
16
|
export declare const typesReactRouterDomVersion = "5.3.3";
|
|
17
17
|
export declare const testingLibraryReactVersion = "13.3.0";
|
|
18
|
-
export declare const reduxjsToolkitVersion = "1.8.
|
|
18
|
+
export declare const reduxjsToolkitVersion = "1.8.3";
|
|
19
19
|
export declare const reactReduxVersion = "8.0.2";
|
|
20
20
|
export declare const reactTestRendererVersion = "18.2.0";
|
|
21
21
|
export declare const eslintPluginImportVersion = "2.26.0";
|
package/src/utils/versions.js
CHANGED
|
@@ -5,10 +5,10 @@ exports.nxVersion = require('../../package.json').version;
|
|
|
5
5
|
exports.reactVersion = '18.2.0';
|
|
6
6
|
exports.reactDomVersion = '18.2.0';
|
|
7
7
|
exports.reactIsVersion = '18.2.0';
|
|
8
|
-
exports.typesReactVersion = '18.0.
|
|
9
|
-
exports.typesReactDomVersion = '18.0.
|
|
8
|
+
exports.typesReactVersion = '18.0.15';
|
|
9
|
+
exports.typesReactDomVersion = '18.0.6';
|
|
10
10
|
exports.typesReactIsVersion = '17.0.3';
|
|
11
|
-
exports.typesNodeVersion = '18.0.
|
|
11
|
+
exports.typesNodeVersion = '18.0.4';
|
|
12
12
|
exports.styledComponentsVersion = '5.3.5';
|
|
13
13
|
exports.typesStyledComponentsVersion = '5.1.25';
|
|
14
14
|
exports.emotionStyledVersion = '11.9.3';
|
|
@@ -19,7 +19,7 @@ exports.styledJsxVersion = '5.0.2';
|
|
|
19
19
|
exports.reactRouterDomVersion = '6.3.0';
|
|
20
20
|
exports.typesReactRouterDomVersion = '5.3.3';
|
|
21
21
|
exports.testingLibraryReactVersion = '13.3.0';
|
|
22
|
-
exports.reduxjsToolkitVersion = '1.8.
|
|
22
|
+
exports.reduxjsToolkitVersion = '1.8.3';
|
|
23
23
|
exports.reactReduxVersion = '8.0.2';
|
|
24
24
|
exports.reactTestRendererVersion = '18.2.0';
|
|
25
25
|
exports.eslintPluginImportVersion = '2.26.0';
|