@nx/angular 22.1.0-canary.20251106-e9146c7 → 22.1.0-canary.20251111-647d751
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 +9 -9
- package/src/generators/component-test/component-test.d.ts.map +1 -1
- package/src/generators/component-test/component-test.js +0 -2
- package/src/generators/ng-add/migrators/projects/e2e.migrator.d.ts +1 -3
- package/src/generators/ng-add/migrators/projects/e2e.migrator.d.ts.map +1 -1
- package/src/generators/ng-add/migrators/projects/e2e.migrator.js +13 -69
- package/src/generators/utils/add-vitest.d.ts.map +1 -1
- package/src/generators/utils/add-vitest.js +36 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "22.1.0-canary.
|
|
3
|
+
"version": "22.1.0-canary.20251111-647d751",
|
|
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, Playwright 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- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"migrations": "./migrations.json"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@nx/devkit": "22.1.0-canary.
|
|
62
|
-
"@nx/eslint": "22.1.0-canary.
|
|
63
|
-
"@nx/js": "22.1.0-canary.
|
|
64
|
-
"@nx/module-federation": "22.1.0-canary.
|
|
65
|
-
"@nx/rspack": "22.1.0-canary.
|
|
66
|
-
"@nx/web": "22.1.0-canary.
|
|
67
|
-
"@nx/webpack": "22.1.0-canary.
|
|
68
|
-
"@nx/workspace": "22.1.0-canary.
|
|
61
|
+
"@nx/devkit": "22.1.0-canary.20251111-647d751",
|
|
62
|
+
"@nx/eslint": "22.1.0-canary.20251111-647d751",
|
|
63
|
+
"@nx/js": "22.1.0-canary.20251111-647d751",
|
|
64
|
+
"@nx/module-federation": "22.1.0-canary.20251111-647d751",
|
|
65
|
+
"@nx/rspack": "22.1.0-canary.20251111-647d751",
|
|
66
|
+
"@nx/web": "22.1.0-canary.20251111-647d751",
|
|
67
|
+
"@nx/webpack": "22.1.0-canary.20251111-647d751",
|
|
68
|
+
"@nx/workspace": "22.1.0-canary.20251111-647d751",
|
|
69
69
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
70
70
|
"@typescript-eslint/type-utils": "^8.0.0",
|
|
71
71
|
"enquirer": "~2.3.6",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-test.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/component-test/component-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EACL,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"component-test.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/component-test/component-test.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EACL,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,mBAAmB,iBAuC7B;AAED,eAAe,sBAAsB,CAAC"}
|
|
@@ -6,8 +6,6 @@ const versions_1 = require("../../utils/versions");
|
|
|
6
6
|
const storybook_inputs_1 = require("../utils/storybook-ast/storybook-inputs");
|
|
7
7
|
async function componentTestGenerator(tree, options) {
|
|
8
8
|
(0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
9
|
-
const { assertMinimumCypressVersion } = require('@nx/cypress/src/utils/versions');
|
|
10
|
-
assertMinimumCypressVersion(10);
|
|
11
9
|
const { root } = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
12
10
|
const componentDirPath = (0, devkit_1.joinPathFragments)(root, options.componentDir);
|
|
13
11
|
const componentFilePath = (0, devkit_1.joinPathFragments)(componentDirPath, `${options.componentFileName}.ts`);
|
|
@@ -8,7 +8,6 @@ export declare class E2eMigrator extends ProjectMigrator<SupportedTargets> {
|
|
|
8
8
|
private appConfig;
|
|
9
9
|
private appName;
|
|
10
10
|
private isProjectUsingEsLint;
|
|
11
|
-
private cypressInstalledVersion;
|
|
12
11
|
private cypressPreset;
|
|
13
12
|
constructor(tree: Tree, options: GeneratorOptions, project: MigrationProjectConfiguration, lintTargetName: string | undefined, logger?: Logger);
|
|
14
13
|
migrate(): Promise<void>;
|
|
@@ -19,11 +18,10 @@ export declare class E2eMigrator extends ProjectMigrator<SupportedTargets> {
|
|
|
19
18
|
private updateOrCreateCypressConfigFile;
|
|
20
19
|
private updateCypressProjectConfiguration;
|
|
21
20
|
private updateE2eCypressTarget;
|
|
22
|
-
private updateCypressConfigFilePaths;
|
|
23
21
|
private cypressConfigGlobToNewGlob;
|
|
24
22
|
private cypressConfigSrcPathToNewPath;
|
|
25
23
|
private cypressConfigDistPathToNewPath;
|
|
26
|
-
private
|
|
24
|
+
private updateCypressConfigFile;
|
|
27
25
|
private updateCypressComponentConfig;
|
|
28
26
|
private updateCypressE2EConfig;
|
|
29
27
|
private updateCypressConfigNodeValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e.migrator.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,IAAI,EACL,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"e2e.migrator.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/angular/src/generators/ng-add/migrators/projects/e2e.migrator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,IAAI,EACL,MAAM,YAAY,CAAC;AAuBpB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EACV,MAAM,EACN,6BAA6B,EAE7B,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,KAAK,gBAAgB,GAAG,KAAK,CAAC;AAwB9B,qBAAa,WAAY,SAAQ,eAAe,CAAC,gBAAgB,CAAC;IAU9D,OAAO,CAAC,cAAc;IATxB,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,oBAAoB,CAAU;IACtC,OAAO,CAAC,aAAa,CAAsB;gBAGzC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,6BAA6B,EAC9B,cAAc,EAAE,MAAM,GAAG,SAAS,EAC1C,MAAM,CAAC,EAAE,MAAM;IAeF,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAwC9B,QAAQ,IAAI,gBAAgB;IAiGrC,OAAO,CAAC,UAAU;YAqCJ,2BAA2B;YAoD3B,wBAAwB;IAsDtC,OAAO,CAAC,+BAA+B;IAgBvC,OAAO,CAAC,iCAAiC;IAiCzC,OAAO,CAAC,sBAAsB;IAyB9B,OAAO,CAAC,0BAA0B;IAgBlC,OAAO,CAAC,6BAA6B;IAcrC,OAAO,CAAC,8BAA8B;IAetC,OAAO,CAAC,uBAAuB;IAoD/B,OAAO,CAAC,4BAA4B;IA0BpC,OAAO,CAAC,sBAAsB;IA0I9B,OAAO,CAAC,4BAA4B;IAwCpC,OAAO,CAAC,6CAA6C;IAiDrD,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,2BAA2B;IAcnC,OAAO,CAAC,+BAA+B;IAIvC,OAAO,CAAC,yBAAyB;IAiBjC,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,sBAAsB;CAM/B"}
|
|
@@ -19,16 +19,9 @@ const supportedTargets = {
|
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
21
|
const cypressConfig = {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
globPatterns: ['excludeSpecPattern', 'specPattern'],
|
|
26
|
-
},
|
|
27
|
-
v10OrMore: {
|
|
28
|
-
srcPaths: ['supportFile', 'supportFolder', 'fixturesFolder'],
|
|
29
|
-
distPaths: ['videosFolder', 'screenshotsFolder', 'downloadsFolder'],
|
|
30
|
-
globPatterns: ['excludeSpecPattern', 'specPattern'],
|
|
31
|
-
},
|
|
22
|
+
srcPaths: ['supportFile', 'supportFolder', 'fixturesFolder'],
|
|
23
|
+
distPaths: ['videosFolder', 'screenshotsFolder', 'downloadsFolder'],
|
|
24
|
+
globPatterns: ['excludeSpecPattern', 'specPattern'],
|
|
32
25
|
};
|
|
33
26
|
class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
34
27
|
constructor(tree, options, project, lintTargetName, logger) {
|
|
@@ -112,9 +105,7 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
112
105
|
if (this.isCypressE2eProject()) {
|
|
113
106
|
const configFile = this.projectConfig.targets[this.targetNames.e2e].options?.configFile;
|
|
114
107
|
if (configFile === undefined && !this.getOldCypressConfigFilePath()) {
|
|
115
|
-
const expectedConfigFile =
|
|
116
|
-
? 'cypress.json'
|
|
117
|
-
: 'cypress.config.{ts,js,mjs,cjs}';
|
|
108
|
+
const expectedConfigFile = 'cypress.config.{ts,js,mjs,cjs}';
|
|
118
109
|
return [
|
|
119
110
|
{
|
|
120
111
|
message: `The "e2e" target is using the "@cypress/schematic:cypress" builder but the "configFile" option is not specified ` +
|
|
@@ -173,8 +164,6 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
173
164
|
}
|
|
174
165
|
else if (this.isCypressE2eProject()) {
|
|
175
166
|
(0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
176
|
-
const { getInstalledCypressMajorVersion, } = require('@nx/cypress/src/utils/versions');
|
|
177
|
-
this.cypressInstalledVersion = getInstalledCypressMajorVersion(this.tree);
|
|
178
167
|
this.project = {
|
|
179
168
|
...this.project,
|
|
180
169
|
name,
|
|
@@ -264,7 +253,7 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
264
253
|
return this.getDefaultCypressConfigFilePath();
|
|
265
254
|
}
|
|
266
255
|
const cypressConfigFilePath = (0, devkit_1.joinPathFragments)(this.project.newRoot, (0, path_1.basename)(configFile));
|
|
267
|
-
this.
|
|
256
|
+
this.updateCypressConfigFile(configFile);
|
|
268
257
|
this.tree.delete(cypressConfigFilePath);
|
|
269
258
|
this.moveFile(configFile, cypressConfigFilePath);
|
|
270
259
|
return cypressConfigFilePath;
|
|
@@ -312,44 +301,6 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
312
301
|
}
|
|
313
302
|
return updatedTarget;
|
|
314
303
|
}
|
|
315
|
-
updateCypressConfigFilePaths(configFilePath) {
|
|
316
|
-
if (this.cypressInstalledVersion >= 10) {
|
|
317
|
-
this.updateCypress10ConfigFile(configFilePath);
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
const srcPaths = [
|
|
321
|
-
'integrationFolder',
|
|
322
|
-
'supportFile',
|
|
323
|
-
'pluginsFile',
|
|
324
|
-
'fixturesFolder',
|
|
325
|
-
];
|
|
326
|
-
const distPaths = ['videosFolder', 'screenshotsFolder'];
|
|
327
|
-
const globPatterns = ['ignoreTestFiles', 'testFiles'];
|
|
328
|
-
const cypressConfig = (0, devkit_1.readJson)(this.tree, configFilePath);
|
|
329
|
-
cypressConfig.fileServerFolder = '.';
|
|
330
|
-
srcPaths.forEach((path) => {
|
|
331
|
-
if (cypressConfig[path]) {
|
|
332
|
-
cypressConfig[path] = this.cypressConfigSrcPathToNewPath(cypressConfig[path]);
|
|
333
|
-
}
|
|
334
|
-
});
|
|
335
|
-
distPaths.forEach((path) => {
|
|
336
|
-
if (cypressConfig[path]) {
|
|
337
|
-
cypressConfig[path] = this.cypressConfigDistPathToNewPath(cypressConfig[path]);
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
globPatterns.forEach((stringOrArrayGlob) => {
|
|
341
|
-
if (!cypressConfig[stringOrArrayGlob]) {
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
if (Array.isArray(cypressConfig[stringOrArrayGlob])) {
|
|
345
|
-
cypressConfig[stringOrArrayGlob] = cypressConfig[stringOrArrayGlob].map((glob) => this.cypressConfigGlobToNewGlob(glob));
|
|
346
|
-
}
|
|
347
|
-
else {
|
|
348
|
-
cypressConfig[stringOrArrayGlob] = this.cypressConfigGlobToNewGlob(cypressConfig[stringOrArrayGlob]);
|
|
349
|
-
}
|
|
350
|
-
});
|
|
351
|
-
(0, devkit_1.writeJson)(this.tree, configFilePath, cypressConfig);
|
|
352
|
-
}
|
|
353
304
|
cypressConfigGlobToNewGlob(globPattern) {
|
|
354
305
|
return globPattern
|
|
355
306
|
? globPattern.replace(new RegExp(`^(\\.\\/|\\/)?${(0, path_1.relative)(this.project.oldRoot, this.project.oldSourceRoot)}\\/`), 'src/')
|
|
@@ -365,7 +316,7 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
365
316
|
? (0, devkit_1.joinPathFragments)('../../dist/cypress/', this.project.newRoot, (0, path_1.relative)(this.project.oldSourceRoot, (0, devkit_1.joinPathFragments)(this.project.oldRoot, path)))
|
|
366
317
|
: undefined;
|
|
367
318
|
}
|
|
368
|
-
|
|
319
|
+
updateCypressConfigFile(configFilePath) {
|
|
369
320
|
const { isPropertyAssignment } = (0, ensure_typescript_1.ensureTypescript)();
|
|
370
321
|
const { tsquery } = require('@phenomnomnominal/tsquery');
|
|
371
322
|
const { nxE2EPreset } = require('@nx/cypress/plugins/cypress-preset');
|
|
@@ -455,15 +406,15 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
455
406
|
}
|
|
456
407
|
return { type: 'replace', value: newValue };
|
|
457
408
|
};
|
|
458
|
-
if (this.isValidPathLikePropertyWithStringLiteralValue(node, cypressConfig.
|
|
409
|
+
if (this.isValidPathLikePropertyWithStringLiteralValue(node, cypressConfig.srcPaths)) {
|
|
459
410
|
const newValue = this.cypressConfigSrcPathToNewPath(oldValue);
|
|
460
411
|
change = createChange(newValue);
|
|
461
412
|
}
|
|
462
|
-
else if (this.isValidPathLikePropertyWithStringLiteralValue(node, cypressConfig.
|
|
413
|
+
else if (this.isValidPathLikePropertyWithStringLiteralValue(node, cypressConfig.distPaths)) {
|
|
463
414
|
const newValue = this.cypressConfigDistPathToNewPath(oldValue);
|
|
464
415
|
change = createChange(newValue);
|
|
465
416
|
}
|
|
466
|
-
else if (this.isValidPathLikePropertyWithStringLiteralValue(node, cypressConfig.
|
|
417
|
+
else if (this.isValidPathLikePropertyWithStringLiteralValue(node, cypressConfig.globPatterns)) {
|
|
467
418
|
const newValue = this.cypressConfigGlobToNewGlob(oldValue);
|
|
468
419
|
change = createChange(newValue);
|
|
469
420
|
}
|
|
@@ -504,13 +455,13 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
504
455
|
updateCypressConfigNodeValue(recorder, node, configCollected) {
|
|
505
456
|
let newValue;
|
|
506
457
|
const oldValue = this.normalizeNodeText(node.initializer.getText());
|
|
507
|
-
if (this.isValidPathLikePropertyWithStringLiteralValue(node, cypressConfig.
|
|
458
|
+
if (this.isValidPathLikePropertyWithStringLiteralValue(node, cypressConfig.srcPaths)) {
|
|
508
459
|
newValue = this.cypressConfigSrcPathToNewPath(oldValue);
|
|
509
460
|
}
|
|
510
|
-
else if (this.isValidPathLikePropertyWithStringLiteralValue(node, cypressConfig.
|
|
461
|
+
else if (this.isValidPathLikePropertyWithStringLiteralValue(node, cypressConfig.distPaths)) {
|
|
511
462
|
newValue = this.cypressConfigDistPathToNewPath(oldValue);
|
|
512
463
|
}
|
|
513
|
-
else if (this.isValidPathLikePropertyWithStringLiteralValue(node, cypressConfig.
|
|
464
|
+
else if (this.isValidPathLikePropertyWithStringLiteralValue(node, cypressConfig.globPatterns)) {
|
|
514
465
|
newValue = this.cypressConfigGlobToNewGlob(oldValue);
|
|
515
466
|
}
|
|
516
467
|
if (newValue) {
|
|
@@ -568,16 +519,9 @@ class E2eMigrator extends project_migrator_1.ProjectMigrator {
|
|
|
568
519
|
return cypressConfig;
|
|
569
520
|
}
|
|
570
521
|
getDefaultCypressConfigFilePath() {
|
|
571
|
-
return this.
|
|
572
|
-
? (0, devkit_1.joinPathFragments)(this.project.newRoot, 'cypress.json')
|
|
573
|
-
: (0, devkit_1.joinPathFragments)(this.project.newRoot, 'cypress.config.ts');
|
|
522
|
+
return (0, devkit_1.joinPathFragments)(this.project.newRoot, 'cypress.config.ts');
|
|
574
523
|
}
|
|
575
524
|
findCypressConfigFilePath(dir) {
|
|
576
|
-
if (this.cypressInstalledVersion < 10) {
|
|
577
|
-
return this.tree.exists((0, devkit_1.joinPathFragments)(dir, 'cypress.json'))
|
|
578
|
-
? (0, devkit_1.joinPathFragments)(dir, 'cypress.json')
|
|
579
|
-
: null;
|
|
580
|
-
}
|
|
581
525
|
// https://docs.cypress.io/guides/references/configuration#Configuration-File
|
|
582
526
|
const possibleFiles = [
|
|
583
527
|
(0, devkit_1.joinPathFragments)(dir, 'cypress.config.ts'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-vitest.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/add-vitest.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAIpB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,wBAAsB,SAAS,CAC7B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"add-vitest.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/utils/add-vitest.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAIpB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,wBAAsB,SAAS,CAC7B,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CAyBf"}
|
|
@@ -1,12 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.addVitest = addVitest;
|
|
4
37
|
const devkit_1 = require("@nx/devkit");
|
|
5
38
|
const versions_1 = require("../../utils/versions");
|
|
6
39
|
const version_utils_1 = require("./version-utils");
|
|
7
40
|
async function addVitest(tree, options) {
|
|
8
|
-
|
|
9
|
-
await
|
|
41
|
+
(0, devkit_1.ensurePackage)('@nx/vitest', versions_1.nxVersion);
|
|
42
|
+
const { configurationGenerator } = await Promise.resolve().then(() => __importStar(require('@nx/vitest/generators')));
|
|
43
|
+
await configurationGenerator(tree, {
|
|
10
44
|
project: options.name,
|
|
11
45
|
uiFramework: 'angular',
|
|
12
46
|
testEnvironment: 'jsdom',
|