@nx/plugin 0.0.0-pr-27957-a99d5ea → 0.0.0-pr-28218-5048fd1

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/generators.json CHANGED
@@ -4,12 +4,12 @@
4
4
  "extends": ["@nx/workspace"],
5
5
  "generators": {
6
6
  "plugin": {
7
- "factory": "./src/generators/plugin/plugin#pluginGeneratorInternal",
7
+ "factory": "./src/generators/plugin/plugin",
8
8
  "schema": "./src/generators/plugin/schema.json",
9
9
  "description": "Create a Nx Plugin."
10
10
  },
11
11
  "create-package": {
12
- "factory": "./src/generators/create-package/create-package#createPackageGeneratorInternal",
12
+ "factory": "./src/generators/create-package/create-package",
13
13
  "schema": "./src/generators/create-package/schema.json",
14
14
  "description": "Create a package which can be used by npx to create a new workspace"
15
15
  },
@@ -19,17 +19,17 @@
19
19
  "description": "Create a E2E application for a Nx Plugin."
20
20
  },
21
21
  "migration": {
22
- "factory": "./src/generators/migration/migration#migrationGeneratorInternal",
22
+ "factory": "./src/generators/migration/migration",
23
23
  "schema": "./src/generators/migration/schema.json",
24
24
  "description": "Create a migration for an Nx Plugin."
25
25
  },
26
26
  "generator": {
27
- "factory": "./src/generators/generator/generator#generatorGeneratorInternal",
27
+ "factory": "./src/generators/generator/generator",
28
28
  "schema": "./src/generators/generator/schema.json",
29
29
  "description": "Create a generator for an Nx Plugin."
30
30
  },
31
31
  "executor": {
32
- "factory": "./src/generators/executor/executor#executorGeneratorInternal",
32
+ "factory": "./src/generators/executor/executor",
33
33
  "schema": "./src/generators/executor/schema.json",
34
34
  "description": "Create an executor for an Nx Plugin."
35
35
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/plugin",
3
- "version": "0.0.0-pr-27957-a99d5ea",
3
+ "version": "0.0.0-pr-28218-5048fd1",
4
4
  "private": false,
5
5
  "description": "This plugin is used to create Nx plugins! It contains generators for generating common plugin features like generators, executors, migrations and more.",
6
6
  "repository": {
@@ -27,16 +27,14 @@
27
27
  "migrations": "./migrations.json"
28
28
  },
29
29
  "dependencies": {
30
- "fs-extra": "^11.1.0",
31
30
  "tslib": "^2.3.0",
32
- "@nx/devkit": "0.0.0-pr-27957-a99d5ea",
33
- "@nx/jest": "0.0.0-pr-27957-a99d5ea",
34
- "@nx/js": "0.0.0-pr-27957-a99d5ea",
35
- "@nx/eslint": "0.0.0-pr-27957-a99d5ea",
36
- "@nrwl/nx-plugin": "0.0.0-pr-27957-a99d5ea"
31
+ "@nx/devkit": "0.0.0-pr-28218-5048fd1",
32
+ "@nx/jest": "0.0.0-pr-28218-5048fd1",
33
+ "@nx/js": "0.0.0-pr-28218-5048fd1",
34
+ "@nx/eslint": "0.0.0-pr-28218-5048fd1"
37
35
  },
38
36
  "publishConfig": {
39
37
  "access": "public"
40
38
  },
41
39
  "type": "commonjs"
42
- }
40
+ }
@@ -1,5 +1,4 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import { CreatePackageSchema } from './schema';
3
3
  export declare function createPackageGenerator(host: Tree, schema: CreatePackageSchema): Promise<GeneratorCallback>;
4
- export declare function createPackageGeneratorInternal(host: Tree, schema: CreatePackageSchema): Promise<GeneratorCallback>;
5
4
  export default createPackageGenerator;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createPackageGenerator = createPackageGenerator;
4
- exports.createPackageGeneratorInternal = createPackageGeneratorInternal;
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const js_1 = require("@nx/js");
7
6
  const add_tslib_dependencies_1 = require("@nx/js/src/utils/typescript/add-tslib-dependencies");
@@ -12,12 +11,6 @@ const has_generator_1 = require("../../utils/has-generator");
12
11
  const path_1 = require("path");
13
12
  const versions_2 = require("@nx/js/src/utils/versions");
14
13
  async function createPackageGenerator(host, schema) {
15
- return await createPackageGeneratorInternal(host, {
16
- projectNameAndRootFormat: 'derived',
17
- ...schema,
18
- });
19
- }
20
- async function createPackageGeneratorInternal(host, schema) {
21
14
  const tasks = [];
22
15
  const options = await (0, normalize_schema_1.normalizeSchema)(host, schema);
23
16
  const pluginPackageName = await addPresetGenerator(host, options);
@@ -12,14 +12,17 @@ async function main() {
12
12
 
13
13
  // This assumes "<%= preset %>" and "<%= projectName %>" are at the same version
14
14
  // eslint-disable-next-line @typescript-eslint/no-var-requires
15
- const presetVersion = require('../package.json').version,
15
+ const presetVersion = require('../package.json').version;
16
16
 
17
17
  // TODO: update below to customize the workspace
18
- const { directory } = await createWorkspace(`<%= preset %>@${presetVersion}`, {
19
- name,
20
- nxCloud: 'skip',
21
- packageManager: 'npm',
22
- });
18
+ const { directory } = await createWorkspace(
19
+ `<%= preset %>@${presetVersion}`,
20
+ {
21
+ name,
22
+ nxCloud: 'skip',
23
+ packageManager: 'npm',
24
+ }
25
+ );
23
26
 
24
27
  console.log(`Successfully created the workspace: ${directory}.`);
25
28
  }
@@ -8,7 +8,6 @@ async function normalizeSchema(host, schema) {
8
8
  projectType: 'library',
9
9
  directory: schema.directory,
10
10
  projectNameAndRootFormat: schema.projectNameAndRootFormat,
11
- callingGenerator: '@nx/plugin:create-package',
12
11
  });
13
12
  schema.projectNameAndRootFormat = projectNameAndRootFormat;
14
13
  return {
@@ -25,7 +25,6 @@ async function normalizeOptions(host, options) {
25
25
  ? projectName
26
26
  : `${options.projectDirectory}-e2e`,
27
27
  projectNameAndRootFormat: `as-provided`,
28
- callingGenerator: '@nx/plugin:e2e-project',
29
28
  });
30
29
  projectRoot = projectNameAndRootOptions.projectRoot;
31
30
  }
@@ -117,7 +116,6 @@ async function addLintingToApplication(tree, options) {
117
116
  async function e2eProjectGenerator(host, schema) {
118
117
  return await e2eProjectGeneratorInternal(host, {
119
118
  addPlugin: false,
120
- projectNameAndRootFormat: 'derived',
121
119
  ...schema,
122
120
  });
123
121
  }
@@ -1,6 +1,5 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { Schema } from './schema';
3
3
  export declare function createExecutorsJson(host: Tree, projectRoot: string, projectName: string, skipLintChecks?: boolean): Promise<void>;
4
- export declare function executorGenerator(tree: Tree, rawOptions: Schema): Promise<void>;
5
- export declare function executorGeneratorInternal(host: Tree, schema: Schema): Promise<void>;
4
+ export declare function executorGenerator(host: Tree, schema: Schema): Promise<void>;
6
5
  export default executorGenerator;
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createExecutorsJson = createExecutorsJson;
4
4
  exports.executorGenerator = executorGenerator;
5
- exports.executorGeneratorInternal = executorGeneratorInternal;
6
5
  const devkit_1 = require("@nx/devkit");
7
6
  const path = require("path");
8
7
  const generator_1 = require("../lint-checks/generator");
@@ -76,14 +75,10 @@ async function updateExecutorJson(host, options) {
76
75
  }
77
76
  async function normalizeOptions(tree, options) {
78
77
  const { project, artifactName, filePath, directory } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
79
- artifactType: 'executor',
80
- callingGenerator: '@nx/plugin:executor',
81
78
  name: options.name,
82
79
  nameAndDirectoryFormat: options.nameAndDirectoryFormat,
83
- project: options.project,
84
80
  directory: options.directory,
85
81
  fileName: 'executor',
86
- derivedDirectory: 'executors',
87
82
  });
88
83
  const { className, propertyName } = (0, devkit_1.names)(artifactName);
89
84
  const { root: projectRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
@@ -105,13 +100,7 @@ async function normalizeOptions(tree, options) {
105
100
  projectRoot,
106
101
  };
107
102
  }
108
- async function executorGenerator(tree, rawOptions) {
109
- await executorGeneratorInternal(tree, {
110
- nameAndDirectoryFormat: 'derived',
111
- ...rawOptions,
112
- });
113
- }
114
- async function executorGeneratorInternal(host, schema) {
103
+ async function executorGenerator(host, schema) {
115
104
  const options = await normalizeOptions(host, schema);
116
105
  addFiles(host, options);
117
106
  if (options.includeHasher) {
@@ -9,9 +9,4 @@ export interface Schema {
9
9
  nameAndDirectoryFormat?: NameAndDirectoryFormat;
10
10
  skipLintChecks?: boolean;
11
11
  skipFormat?: boolean;
12
-
13
- /**
14
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
15
- */
16
- project?: string;
17
12
  }
@@ -55,15 +55,6 @@
55
55
  "type": "string",
56
56
  "enum": ["as-provided", "derived"]
57
57
  },
58
- "project": {
59
- "type": "string",
60
- "description": "The name of the project.",
61
- "alias": "p",
62
- "$default": {
63
- "$source": "projectName"
64
- },
65
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
66
- },
67
58
  "skipFormat": {
68
59
  "type": "boolean",
69
60
  "description": "Skip formatting files.",
@@ -1,6 +1,5 @@
1
1
  import { Tree } from '@nx/devkit';
2
2
  import type { Schema } from './schema';
3
3
  export declare function createGeneratorsJson(host: Tree, projectRoot: string, projectName: string, skipLintChecks?: boolean, skipFormat?: boolean): Promise<void>;
4
- export declare function generatorGenerator(tree: Tree, rawOptions: Schema): Promise<void>;
5
- export declare function generatorGeneratorInternal(host: Tree, schema: Schema): Promise<void>;
4
+ export declare function generatorGenerator(host: Tree, schema: Schema): Promise<void>;
6
5
  export default generatorGenerator;
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createGeneratorsJson = createGeneratorsJson;
4
4
  exports.generatorGenerator = generatorGenerator;
5
- exports.generatorGeneratorInternal = generatorGeneratorInternal;
6
5
  const devkit_1 = require("@nx/devkit");
7
6
  const has_generator_1 = require("../../utils/has-generator");
8
7
  const generator_1 = require("../lint-checks/generator");
@@ -11,14 +10,10 @@ const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/a
11
10
  const path_1 = require("path");
12
11
  async function normalizeOptions(tree, options) {
13
12
  const { project, fileName, artifactName, filePath, directory } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
14
- artifactType: 'generator',
15
- callingGenerator: '@nx/plugin:generator',
16
13
  name: options.name,
17
14
  nameAndDirectoryFormat: options.nameAndDirectoryFormat,
18
- project: options.project,
19
15
  directory: options.directory,
20
16
  fileName: 'generator',
21
- derivedDirectory: 'generators',
22
17
  });
23
18
  const { className, propertyName } = (0, devkit_1.names)(artifactName);
24
19
  const { root: projectRoot, sourceRoot: projectSourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
@@ -106,13 +101,7 @@ async function updateGeneratorJson(host, options) {
106
101
  return json;
107
102
  });
108
103
  }
109
- async function generatorGenerator(tree, rawOptions) {
110
- await generatorGeneratorInternal(tree, {
111
- nameAndDirectoryFormat: 'derived',
112
- ...rawOptions,
113
- });
114
- }
115
- async function generatorGeneratorInternal(host, schema) {
104
+ async function generatorGenerator(host, schema) {
116
105
  const options = await normalizeOptions(host, schema);
117
106
  if ((0, has_generator_1.hasGenerator)(host, options.project, options.name)) {
118
107
  throw new Error(`Generator ${options.name} already exists.`);
@@ -8,9 +8,4 @@ export interface Schema {
8
8
  skipLintChecks?: boolean;
9
9
  skipFormat?: boolean;
10
10
  nameAndDirectoryFormat?: NameAndDirectoryFormat;
11
-
12
- /**
13
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
14
- */
15
- project?: string;
16
11
  }
@@ -44,15 +44,6 @@
44
44
  "default": false,
45
45
  "description": "Do not add an eslint configuration for plugin json files."
46
46
  },
47
- "project": {
48
- "type": "string",
49
- "description": "The name of the project.",
50
- "alias": "p",
51
- "$default": {
52
- "$source": "projectName"
53
- },
54
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
55
- },
56
47
  "skipFormat": {
57
48
  "type": "boolean",
58
49
  "default": false,
@@ -1,5 +1,4 @@
1
1
  import type { Tree } from '@nx/devkit';
2
2
  import type { Schema } from './schema';
3
- export declare function migrationGenerator(tree: Tree, rawOptions: Schema): Promise<void>;
4
- export declare function migrationGeneratorInternal(host: Tree, schema: Schema): Promise<void>;
3
+ export declare function migrationGenerator(host: Tree, schema: Schema): Promise<void>;
5
4
  export default migrationGenerator;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.migrationGenerator = migrationGenerator;
4
- exports.migrationGeneratorInternal = migrationGeneratorInternal;
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const path = require("path");
7
6
  const path_1 = require("path");
@@ -18,16 +17,11 @@ async function normalizeOptions(tree, options) {
18
17
  name = (0, devkit_1.names)(`update-${options.packageVersion}`).fileName;
19
18
  }
20
19
  const { project, fileName, artifactName, filePath, directory } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
21
- artifactType: 'migration',
22
- callingGenerator: '@nx/plugin:migration',
23
20
  name: name,
24
21
  nameAndDirectoryFormat: options.nameAndDirectoryFormat,
25
- project: options.project,
26
22
  directory: options.directory,
27
23
  fileName: name,
28
- derivedDirectory: 'migrations',
29
24
  });
30
- const { className, propertyName } = (0, devkit_1.names)(artifactName);
31
25
  const { root: projectRoot, sourceRoot: projectSourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
32
26
  const description = options.description ?? `Migration for v${options.packageVersion}`;
33
27
  // const { root: projectRoot, sourceRoot: projectSourceRoot } =
@@ -110,13 +104,7 @@ function updateProjectConfig(host, options) {
110
104
  (0, devkit_1.updateProjectConfiguration)(host, options.project, project);
111
105
  }
112
106
  }
113
- async function migrationGenerator(tree, rawOptions) {
114
- await migrationGeneratorInternal(tree, {
115
- nameAndDirectoryFormat: 'derived',
116
- ...rawOptions,
117
- });
118
- }
119
- async function migrationGeneratorInternal(host, schema) {
107
+ async function migrationGenerator(host, schema) {
120
108
  const options = await normalizeOptions(host, schema);
121
109
  addFiles(host, options);
122
110
  updateMigrationsJson(host, options);
@@ -8,9 +8,4 @@ export interface Schema {
8
8
  packageJsonUpdates?: boolean;
9
9
  skipFormat?: boolean;
10
10
  nameAndDirectoryFormat?: NameAndDirectoryFormat;
11
-
12
- /**
13
- * @deprecated Provide the `directory` option instead. The project will be determined from the directory provided. It will be removed in Nx v20.
14
- */
15
- project?: string;
16
11
  }
@@ -37,15 +37,6 @@
37
37
  "x-prompt": "What version would you like to use for the migration?",
38
38
  "x-priority": "important"
39
39
  },
40
- "project": {
41
- "type": "string",
42
- "description": "The name of the project.",
43
- "alias": "p",
44
- "$default": {
45
- "$source": "projectName"
46
- },
47
- "x-deprecated": "Provide the `directory` option instead and use the `as-provided` format. The project will be determined from the directory provided. It will be removed in Nx v20."
48
- },
49
40
  "packageJsonUpdates": {
50
41
  "type": "boolean",
51
42
  "description": "Whether or not to include `package.json` updates.",
@@ -1,5 +1,4 @@
1
1
  import { GeneratorCallback, Tree } from '@nx/devkit';
2
2
  import type { Schema } from './schema';
3
3
  export declare function pluginGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
4
- export declare function pluginGeneratorInternal(host: Tree, schema: Schema): Promise<GeneratorCallback>;
5
4
  export default pluginGenerator;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.pluginGenerator = pluginGenerator;
4
- exports.pluginGeneratorInternal = pluginGeneratorInternal;
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const js_1 = require("@nx/js");
7
6
  const add_swc_dependencies_1 = require("@nx/js/src/utils/swc/add-swc-dependencies");
@@ -52,12 +51,6 @@ function updatePluginConfig(host, options) {
52
51
  }
53
52
  }
54
53
  async function pluginGenerator(host, schema) {
55
- return await pluginGeneratorInternal(host, {
56
- projectNameAndRootFormat: 'derived',
57
- ...schema,
58
- });
59
- }
60
- async function pluginGeneratorInternal(host, schema) {
61
54
  const options = await (0, normalize_schema_1.normalizeOptions)(host, schema);
62
55
  const tasks = [];
63
56
  tasks.push(await (0, js_1.libraryGenerator)(host, {
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = normalizeOptions;
4
- const devkit_1 = require("@nx/devkit");
5
4
  const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
6
5
  async function normalizeOptions(host, options) {
7
6
  const { projectName, projectRoot, importPath: npmPackageName, projectNameAndRootFormat, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
@@ -11,21 +10,10 @@ async function normalizeOptions(host, options) {
11
10
  importPath: options.importPath,
12
11
  projectNameAndRootFormat: options.projectNameAndRootFormat,
13
12
  rootProject: options.rootProject,
14
- callingGenerator: '@nx/plugin:plugin',
15
13
  });
16
14
  options.projectNameAndRootFormat = projectNameAndRootFormat;
17
15
  options.rootProject = projectRoot === '.';
18
- let projectDirectory = projectRoot;
19
- if (options.projectNameAndRootFormat === 'derived') {
20
- let { layoutDirectory } = (0, devkit_1.extractLayoutDirectory)(options.directory);
21
- if (!layoutDirectory) {
22
- const { libsDir } = (0, devkit_1.getWorkspaceLayout)(host);
23
- layoutDirectory = libsDir;
24
- }
25
- if (projectRoot.startsWith(`${layoutDirectory}/`)) {
26
- projectDirectory = projectRoot.replace(`${layoutDirectory}/`, '');
27
- }
28
- }
16
+ const projectDirectory = projectRoot;
29
17
  const parsedTags = options.tags
30
18
  ? options.tags.split(',').map((s) => s.trim())
31
19
  : [];
@@ -25,7 +25,7 @@ async function default_1(tree, options) {
25
25
  publishable: true,
26
26
  // when creating a CLI package, the plugin will be in the packages folder
27
27
  directory: options.createPackageName && options.createPackageName !== 'false'
28
- ? 'packages'
28
+ ? `packages/${pluginProjectName}`
29
29
  : undefined,
30
30
  rootProject: options.createPackageName ? false : true,
31
31
  });
@@ -34,7 +34,7 @@ async function default_1(tree, options) {
34
34
  if (options.createPackageName) {
35
35
  const e2eProject = `${options.pluginName}-e2e`;
36
36
  const cliTask = await (0, create_package_1.default)(tree, {
37
- directory: 'packages',
37
+ directory: `packages/${options.createPackageName}`,
38
38
  name: options.createPackageName,
39
39
  e2eProject: e2eProject,
40
40
  project: options.pluginName,
@@ -19,6 +19,7 @@ function runCommandAsync(command, opts = {
19
19
  (0, child_process_1.exec)(command, {
20
20
  cwd: opts.cwd ?? (0, paths_1.tmpProjPath)(),
21
21
  env: { ...process.env, ...opts.env },
22
+ windowsHide: true,
22
23
  }, (err, stdout, stderr) => {
23
24
  if (!opts.silenceError && err) {
24
25
  reject(err);
@@ -21,6 +21,7 @@ function runNxCommand(command, opts = {
21
21
  const execSyncOptions = {
22
22
  cwd,
23
23
  env: { ...process.env, ...opts.env },
24
+ windowsHide: true,
24
25
  };
25
26
  if ((0, utils_1.fileExists)((0, paths_1.tmpProjPath)('package.json'))) {
26
27
  const pmc = (0, devkit_1.getPackageManagerCommand)((0, devkit_1.detectPackageManager)(cwd));
@@ -8,8 +8,8 @@ exports.ensureNxProject = ensureNxProject;
8
8
  const devkit_1 = require("@nx/devkit");
9
9
  const devkit_2 = require("@nx/devkit");
10
10
  const child_process_1 = require("child_process");
11
+ const node_fs_1 = require("node:fs");
11
12
  const path_1 = require("path");
12
- const fs_extra_1 = require("fs-extra");
13
13
  const paths_1 = require("./paths");
14
14
  const utils_1 = require("./utils");
15
15
  function runNxNewCommand(args, silent) {
@@ -17,6 +17,7 @@ function runNxNewCommand(args, silent) {
17
17
  return (0, child_process_1.execSync)(`node ${require.resolve('nx')} new proj --nx-workspace-root=${localTmpDir} --no-interactive --skip-install --collection=@nx/workspace --npmScope=proj --preset=apps ${args || ''}`, {
18
18
  cwd: localTmpDir,
19
19
  ...(silent && false ? { stdio: ['ignore', 'ignore', 'ignore'] } : {}),
20
+ windowsHide: true,
20
21
  });
21
22
  }
22
23
  function patchPackageJsonForPlugin(npmPackageName, distPath) {
@@ -44,6 +45,7 @@ function runPackageManagerInstall(silent = true) {
44
45
  const install = (0, child_process_1.execSync)(pmc.install, {
45
46
  cwd,
46
47
  ...(silent ? { stdio: ['ignore', 'ignore', 'ignore'] } : {}),
48
+ windowsHide: true,
47
49
  });
48
50
  return install ? install.toString() : '';
49
51
  }
@@ -64,6 +66,6 @@ function newNxProject(npmPackageName, pluginDistPath) {
64
66
  * It will also copy `@nx` packages to the e2e directory
65
67
  */
66
68
  function ensureNxProject(npmPackageName, pluginDistPath) {
67
- (0, fs_extra_1.ensureDirSync)((0, paths_1.tmpProjPath)());
69
+ (0, node_fs_1.mkdirSync)((0, paths_1.tmpProjPath)(), { recursive: true });
68
70
  newNxProject(npmPackageName, pluginDistPath);
69
71
  }
@@ -15,7 +15,7 @@ exports.removeTmpProject = removeTmpProject;
15
15
  exports.getCwd = getCwd;
16
16
  exports.exists = exists;
17
17
  exports.getSize = getSize;
18
- const fs_extra_1 = require("fs-extra");
18
+ const node_fs_1 = require("node:fs");
19
19
  const path_1 = require("path");
20
20
  const paths_1 = require("./paths");
21
21
  const devkit_1 = require("@nx/devkit");
@@ -28,8 +28,11 @@ Object.defineProperty(exports, "fileExists", { enumerable: true, get: function (
28
28
  */
29
29
  function copyNodeModules(modules) {
30
30
  modules.forEach((module) => {
31
- (0, fs_extra_1.removeSync)(`${(0, paths_1.tmpProjPath)()}/node_modules/${module}`);
32
- (0, fs_extra_1.copySync)(`./node_modules/${module}`, `${(0, paths_1.tmpProjPath)()}/node_modules/${module}`);
31
+ (0, node_fs_1.rmSync)(`${(0, paths_1.tmpProjPath)()}/node_modules/${module}`, {
32
+ recursive: true,
33
+ force: true,
34
+ });
35
+ (0, node_fs_1.cpSync)(`./node_modules/${module}`, `${(0, paths_1.tmpProjPath)()}/node_modules/${module}`, { recursive: true });
33
36
  });
34
37
  }
35
38
  /**
@@ -51,12 +54,12 @@ function expectTestsPass(output) {
51
54
  * @param content Content to replace the original content with
52
55
  */
53
56
  function updateFile(file, content) {
54
- (0, fs_extra_1.ensureDirSync)((0, path_1.dirname)((0, paths_1.tmpProjPath)(file)));
57
+ (0, node_fs_1.mkdirSync)((0, path_1.dirname)((0, paths_1.tmpProjPath)(file)), { recursive: true });
55
58
  if (typeof content === 'string') {
56
- (0, fs_extra_1.writeFileSync)((0, paths_1.tmpProjPath)(file), content);
59
+ (0, node_fs_1.writeFileSync)((0, paths_1.tmpProjPath)(file), content);
57
60
  }
58
61
  else {
59
- (0, fs_extra_1.writeFileSync)((0, paths_1.tmpProjPath)(file), content((0, fs_extra_1.readFileSync)((0, paths_1.tmpProjPath)(file)).toString()));
62
+ (0, node_fs_1.writeFileSync)((0, paths_1.tmpProjPath)(file), content((0, node_fs_1.readFileSync)((0, paths_1.tmpProjPath)(file)).toString()));
60
63
  }
61
64
  }
62
65
  /**
@@ -65,8 +68,8 @@ function updateFile(file, content) {
65
68
  * @param newPath New path
66
69
  */
67
70
  function renameFile(path, newPath) {
68
- (0, fs_extra_1.ensureDirSync)((0, path_1.dirname)((0, paths_1.tmpProjPath)(newPath)));
69
- (0, fs_extra_1.renameSync)((0, paths_1.tmpProjPath)(path), (0, paths_1.tmpProjPath)(newPath));
71
+ (0, node_fs_1.mkdirSync)((0, path_1.dirname)((0, paths_1.tmpProjPath)(newPath)), { recursive: true });
72
+ (0, node_fs_1.renameSync)((0, paths_1.tmpProjPath)(path), (0, paths_1.tmpProjPath)(newPath));
70
73
  }
71
74
  /**
72
75
  * Check if the file or directory exists.
@@ -89,7 +92,7 @@ function checkFilesExist(...expectedPaths) {
89
92
  * @param dirName Directory name within the e2e directory.
90
93
  */
91
94
  function listFiles(dirName) {
92
- return (0, fs_extra_1.readdirSync)((0, paths_1.tmpProjPath)(dirName));
95
+ return (0, node_fs_1.readdirSync)((0, paths_1.tmpProjPath)(dirName));
93
96
  }
94
97
  /**
95
98
  * Read a JSON file.
@@ -105,22 +108,22 @@ function readJson(path, options) {
105
108
  */
106
109
  function readFile(path) {
107
110
  const filePath = (0, path_1.isAbsolute)(path) ? path : (0, paths_1.tmpProjPath)(path);
108
- return (0, fs_extra_1.readFileSync)(filePath, 'utf-8');
111
+ return (0, node_fs_1.readFileSync)(filePath, 'utf-8');
109
112
  }
110
113
  /**
111
114
  * Deletes the e2e directory
112
115
  */
113
116
  function cleanup() {
114
- (0, fs_extra_1.removeSync)((0, paths_1.tmpProjPath)());
117
+ (0, node_fs_1.rmSync)((0, paths_1.tmpProjPath)(), { recursive: true, force: true });
115
118
  }
116
119
  /**
117
120
  * Remove the dist folder from the e2e directory
118
121
  */
119
122
  function rmDist() {
120
- (0, fs_extra_1.removeSync)(`${(0, paths_1.tmpProjPath)()}/dist`);
123
+ (0, node_fs_1.rmSync)(`${(0, paths_1.tmpProjPath)()}/dist`, { recursive: true, force: true });
121
124
  }
122
125
  function removeTmpProject(project) {
123
- (0, fs_extra_1.removeSync)(`${(0, paths_1.tmpFolder)()}/${project}`);
126
+ (0, node_fs_1.rmSync)(`${(0, paths_1.tmpFolder)()}/${project}`, { recursive: true, force: true });
124
127
  }
125
128
  /**
126
129
  * Get the currend `cwd` in the process
@@ -140,5 +143,5 @@ function exists(path) {
140
143
  * @param filePath Path to the file
141
144
  */
142
145
  function getSize(filePath) {
143
- return (0, fs_extra_1.statSync)(filePath).size;
146
+ return (0, node_fs_1.statSync)(filePath).size;
144
147
  }