@nx/plugin 20.0.0-beta.3 → 20.0.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/plugin",
3
- "version": "20.0.0-beta.3",
3
+ "version": "20.0.0-beta.5",
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,13 +27,11 @@
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": "20.0.0-beta.3",
33
- "@nx/jest": "20.0.0-beta.3",
34
- "@nx/js": "20.0.0-beta.3",
35
- "@nx/eslint": "20.0.0-beta.3",
36
- "@nrwl/nx-plugin": "20.0.0-beta.3"
31
+ "@nx/devkit": "20.0.0-beta.5",
32
+ "@nx/jest": "20.0.0-beta.5",
33
+ "@nx/js": "20.0.0-beta.5",
34
+ "@nx/eslint": "20.0.0-beta.5"
37
35
  },
38
36
  "publishConfig": {
39
37
  "access": "public"
@@ -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) {
@@ -66,6 +66,6 @@ function newNxProject(npmPackageName, pluginDistPath) {
66
66
  * It will also copy `@nx` packages to the e2e directory
67
67
  */
68
68
  function ensureNxProject(npmPackageName, pluginDistPath) {
69
- (0, fs_extra_1.ensureDirSync)((0, paths_1.tmpProjPath)());
69
+ (0, node_fs_1.mkdirSync)((0, paths_1.tmpProjPath)(), { recursive: true });
70
70
  newNxProject(npmPackageName, pluginDistPath);
71
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
  }