@nx/angular 16.6.0-beta.1 → 16.6.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/package.json +10 -12
- package/src/builders/utilities/module-federation.js +18 -5
- package/src/builders/utilities/webpack.js +3 -22
- package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +1 -1
- package/src/generators/storybook-configuration/schema.d.ts +1 -1
- package/src/generators/storybook-configuration/schema.json +13 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "16.6.0-beta.
|
|
3
|
+
"version": "16.6.0-beta.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
"migrations": "./migrations.json"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@nrwl/angular": "16.6.0-beta.
|
|
70
|
-
"@nx/cypress": "16.6.0-beta.
|
|
71
|
-
"@nx/devkit": "16.6.0-beta.
|
|
72
|
-
"@nx/jest": "16.6.0-beta.
|
|
73
|
-
"@nx/js": "16.6.0-beta.
|
|
74
|
-
"@nx/linter": "16.6.0-beta.
|
|
75
|
-
"@nx/webpack": "16.6.0-beta.
|
|
76
|
-
"@nx/workspace": "16.6.0-beta.
|
|
69
|
+
"@nrwl/angular": "16.6.0-beta.2",
|
|
70
|
+
"@nx/cypress": "16.6.0-beta.2",
|
|
71
|
+
"@nx/devkit": "16.6.0-beta.2",
|
|
72
|
+
"@nx/jest": "16.6.0-beta.2",
|
|
73
|
+
"@nx/js": "16.6.0-beta.2",
|
|
74
|
+
"@nx/linter": "16.6.0-beta.2",
|
|
75
|
+
"@nx/webpack": "16.6.0-beta.2",
|
|
76
|
+
"@nx/workspace": "16.6.0-beta.2",
|
|
77
77
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
78
78
|
"@typescript-eslint/type-utils": "^5.36.1",
|
|
79
79
|
"chalk": "^4.1.0",
|
|
@@ -85,8 +85,6 @@
|
|
|
85
85
|
"magic-string": "~0.26.2",
|
|
86
86
|
"minimatch": "3.0.5",
|
|
87
87
|
"semver": "7.5.3",
|
|
88
|
-
"ts-node": "10.9.1",
|
|
89
|
-
"tsconfig-paths": "^4.1.2",
|
|
90
88
|
"tslib": "^2.3.0",
|
|
91
89
|
"webpack": "^5.80.0",
|
|
92
90
|
"webpack-merge": "5.7.3"
|
|
@@ -110,5 +108,5 @@
|
|
|
110
108
|
"module": "fesm2022/nx-angular.mjs",
|
|
111
109
|
"typings": "index.d.ts",
|
|
112
110
|
"sideEffects": false,
|
|
113
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "c3d31711b71d648cedeff688fce9334d393b586b"
|
|
114
112
|
}
|
|
@@ -4,6 +4,7 @@ exports.validateDevRemotes = exports.getStaticRemotes = exports.getDynamicRemote
|
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
+
const tsnode_register_1 = require("@nx/js/src/utils/typescript/tsnode-register");
|
|
7
8
|
function getDynamicRemotes(project, context, workspaceProjects, remotesToSkip, pathToManifestFile = (0, path_1.join)(context.workspaceRoot, project.sourceRoot, 'assets/module-federation.manifest.json')) {
|
|
8
9
|
// check for dynamic remotes
|
|
9
10
|
// we should only check for dynamic based on what we generate
|
|
@@ -40,15 +41,27 @@ function getDynamicRemotes(project, context, workspaceProjects, remotesToSkip, p
|
|
|
40
41
|
return dynamicRemotes;
|
|
41
42
|
}
|
|
42
43
|
exports.getDynamicRemotes = getDynamicRemotes;
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
|
|
44
|
+
function getModuleFederationConfig(tsconfigPath, workspaceRoot, projectRoot) {
|
|
45
|
+
const moduleFederationConfigPathJS = (0, path_1.join)(workspaceRoot, projectRoot, 'module-federation.config.js');
|
|
46
|
+
const moduleFederationConfigPathTS = (0, path_1.join)(workspaceRoot, projectRoot, 'module-federation.config.ts');
|
|
47
|
+
let moduleFederationConfigPath = moduleFederationConfigPathJS;
|
|
48
|
+
if ((0, fs_1.existsSync)(moduleFederationConfigPathTS)) {
|
|
49
|
+
(0, tsnode_register_1.tsNodeRegister)(moduleFederationConfigPathTS, tsconfigPath);
|
|
50
|
+
moduleFederationConfigPath = moduleFederationConfigPathTS;
|
|
51
|
+
}
|
|
46
52
|
try {
|
|
47
|
-
|
|
53
|
+
const config = require(moduleFederationConfigPath);
|
|
54
|
+
return {
|
|
55
|
+
mfeConfig: config.default || config,
|
|
56
|
+
mfConfigPath: moduleFederationConfigPath,
|
|
57
|
+
};
|
|
48
58
|
}
|
|
49
59
|
catch (_a) {
|
|
50
|
-
throw new Error(`Could not load ${
|
|
60
|
+
throw new Error(`Could not load ${moduleFederationConfigPath}. Was this project generated with "@nx/angular:host"?`);
|
|
51
61
|
}
|
|
62
|
+
}
|
|
63
|
+
function getStaticRemotes(project, context, workspaceProjects, remotesToSkip) {
|
|
64
|
+
const { mfeConfig, mfConfigPath } = getModuleFederationConfig(project.targets.build.options.tsConfig, context.workspaceRoot, project.root);
|
|
52
65
|
const remotesConfig = Array.isArray(mfeConfig.remotes) && mfeConfig.remotes.length > 0
|
|
53
66
|
? mfeConfig.remotes
|
|
54
67
|
: [];
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.resolveIndexHtmlTransformer = exports.resolveCustomWebpackConfig = exports.mergeCustomWebpackConfig = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const webpack_merge_1 = require("webpack-merge");
|
|
6
|
+
const tsnode_register_1 = require("@nx/js/src/utils/typescript/tsnode-register");
|
|
6
7
|
function mergeCustomWebpackConfig(baseWebpackConfig, pathToWebpackConfig, options, target) {
|
|
7
8
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
9
|
const customWebpackConfiguration = resolveCustomWebpackConfig(pathToWebpackConfig, options.tsConfig);
|
|
@@ -23,7 +24,7 @@ function mergeCustomWebpackConfig(baseWebpackConfig, pathToWebpackConfig, option
|
|
|
23
24
|
exports.mergeCustomWebpackConfig = mergeCustomWebpackConfig;
|
|
24
25
|
function resolveCustomWebpackConfig(path, tsConfig) {
|
|
25
26
|
var _a;
|
|
26
|
-
tsNodeRegister(path, tsConfig);
|
|
27
|
+
(0, tsnode_register_1.tsNodeRegister)(path, tsConfig);
|
|
27
28
|
const customWebpackConfig = require(path);
|
|
28
29
|
// If the user provides a configuration in TS file
|
|
29
30
|
// then there are 2 cases for exporting an object. The first one is:
|
|
@@ -35,29 +36,9 @@ function resolveCustomWebpackConfig(path, tsConfig) {
|
|
|
35
36
|
exports.resolveCustomWebpackConfig = resolveCustomWebpackConfig;
|
|
36
37
|
function resolveIndexHtmlTransformer(path, tsConfig, target) {
|
|
37
38
|
var _a;
|
|
38
|
-
tsNodeRegister(path, tsConfig);
|
|
39
|
+
(0, tsnode_register_1.tsNodeRegister)(path, tsConfig);
|
|
39
40
|
const indexTransformer = require(path);
|
|
40
41
|
const transform = (_a = indexTransformer.default) !== null && _a !== void 0 ? _a : indexTransformer;
|
|
41
42
|
return (indexHtml) => transform(target, indexHtml);
|
|
42
43
|
}
|
|
43
44
|
exports.resolveIndexHtmlTransformer = resolveIndexHtmlTransformer;
|
|
44
|
-
function tsNodeRegister(file, tsConfig) {
|
|
45
|
-
if (!(file === null || file === void 0 ? void 0 : file.endsWith('.ts')))
|
|
46
|
-
return;
|
|
47
|
-
// Register TS compiler lazily
|
|
48
|
-
require('ts-node').register({
|
|
49
|
-
project: tsConfig,
|
|
50
|
-
compilerOptions: {
|
|
51
|
-
module: 'CommonJS',
|
|
52
|
-
types: ['node'],
|
|
53
|
-
},
|
|
54
|
-
});
|
|
55
|
-
if (!tsConfig)
|
|
56
|
-
return;
|
|
57
|
-
// Register paths in tsConfig
|
|
58
|
-
const tsconfigPaths = require('tsconfig-paths');
|
|
59
|
-
const { absoluteBaseUrl: baseUrl, paths } = tsconfigPaths.loadConfig(tsConfig);
|
|
60
|
-
if (baseUrl && paths) {
|
|
61
|
-
tsconfigPaths.register({ baseUrl, paths });
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -14,7 +14,7 @@ function generateStorybookConfiguration(tree, options) {
|
|
|
14
14
|
linter: options.linter,
|
|
15
15
|
cypressDirectory: options.cypressDirectory,
|
|
16
16
|
tsConfiguration: options.tsConfiguration,
|
|
17
|
-
|
|
17
|
+
interactionTests: options.interactionTests,
|
|
18
18
|
configureStaticServe: options.configureStaticServe,
|
|
19
19
|
skipFormat: true,
|
|
20
20
|
});
|
|
@@ -18,12 +18,18 @@
|
|
|
18
18
|
"x-dropdown": "projects",
|
|
19
19
|
"x-priority": "important"
|
|
20
20
|
},
|
|
21
|
+
"interactionTests": {
|
|
22
|
+
"type": "boolean",
|
|
23
|
+
"description": "Set up Storybook interaction tests.",
|
|
24
|
+
"x-prompt": "Do you want to set up Storybook interaction tests?",
|
|
25
|
+
"alias": ["configureTestRunner"],
|
|
26
|
+
"x-priority": "important",
|
|
27
|
+
"default": true
|
|
28
|
+
},
|
|
21
29
|
"configureCypress": {
|
|
22
30
|
"type": "boolean",
|
|
23
31
|
"description": "Specifies whether to configure Cypress or not.",
|
|
24
|
-
"x-
|
|
25
|
-
"default": true,
|
|
26
|
-
"x-priority": "important"
|
|
32
|
+
"x-deprecated": "Please use Storybook interaction tests instead."
|
|
27
33
|
},
|
|
28
34
|
"generateStories": {
|
|
29
35
|
"type": "boolean",
|
|
@@ -35,9 +41,7 @@
|
|
|
35
41
|
"generateCypressSpecs": {
|
|
36
42
|
"type": "boolean",
|
|
37
43
|
"description": "Specifies whether to automatically generate test files in the generated Cypress e2e app.",
|
|
38
|
-
"x-
|
|
39
|
-
"default": true,
|
|
40
|
-
"x-priority": "important"
|
|
44
|
+
"x-deprecated": "Please use Storybook interaction tests instead."
|
|
41
45
|
},
|
|
42
46
|
"configureStaticServe": {
|
|
43
47
|
"type": "boolean",
|
|
@@ -48,7 +52,8 @@
|
|
|
48
52
|
},
|
|
49
53
|
"cypressDirectory": {
|
|
50
54
|
"type": "string",
|
|
51
|
-
"description": "A directory where the Cypress project will be placed. Placed at the root by default."
|
|
55
|
+
"description": "A directory where the Cypress project will be placed. Placed at the root by default.",
|
|
56
|
+
"x-deprecated": "Please use Storybook interaction tests instead."
|
|
52
57
|
},
|
|
53
58
|
"linter": {
|
|
54
59
|
"description": "The tool to use for running lint checks.",
|
|
@@ -59,7 +64,7 @@
|
|
|
59
64
|
"tsConfiguration": {
|
|
60
65
|
"type": "boolean",
|
|
61
66
|
"description": "Configure your project with TypeScript. Generate main.ts and preview.ts files, instead of main.js and preview.js.",
|
|
62
|
-
"default":
|
|
67
|
+
"default": true,
|
|
63
68
|
"x-priority": "important"
|
|
64
69
|
},
|
|
65
70
|
"skipFormat": {
|
|
@@ -82,10 +87,6 @@
|
|
|
82
87
|
"**/**/src/**/*.other.*",
|
|
83
88
|
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
|
|
84
89
|
]
|
|
85
|
-
},
|
|
86
|
-
"configureTestRunner": {
|
|
87
|
-
"type": "boolean",
|
|
88
|
-
"description": "Add a Storybook Test-Runner target."
|
|
89
90
|
}
|
|
90
91
|
},
|
|
91
92
|
"additionalProperties": false,
|