@nx/plugin 0.0.0-pr-29156-c171bae → 0.0.0-pr-29314-e664f92

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": "0.0.0-pr-29156-c171bae",
3
+ "version": "0.0.0-pr-29314-e664f92",
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": {
@@ -28,10 +28,10 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "tslib": "^2.3.0",
31
- "@nx/devkit": "0.0.0-pr-29156-c171bae",
32
- "@nx/jest": "0.0.0-pr-29156-c171bae",
33
- "@nx/js": "0.0.0-pr-29156-c171bae",
34
- "@nx/eslint": "0.0.0-pr-29156-c171bae"
31
+ "@nx/devkit": "0.0.0-pr-29314-e664f92",
32
+ "@nx/jest": "0.0.0-pr-29314-e664f92",
33
+ "@nx/js": "0.0.0-pr-29314-e664f92",
34
+ "@nx/eslint": "0.0.0-pr-29314-e664f92"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public"
@@ -140,7 +140,7 @@ function addE2eProject(host, options) {
140
140
  (0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, './files/e2e'), e2eProjectConfiguration.sourceRoot, {
141
141
  pluginName: options.project,
142
142
  cliName: options.name,
143
- packageManagerCommands: (0, devkit_1.getPackageManagerCommand)('npm'),
143
+ packageManagerCommands: (0, devkit_1.getPackageManagerCommand)(),
144
144
  pluginPackageName,
145
145
  tmpl: '',
146
146
  });
@@ -6,11 +6,13 @@ describe('<%= cliName %>', () => {
6
6
  let projectDirectory: string;
7
7
 
8
8
  afterAll(() => {
9
- // Cleanup the test project
10
- rmSync(projectDirectory, {
11
- recursive: true,
12
- force: true,
13
- });
9
+ if (projectDirectory) {
10
+ // Cleanup the test project
11
+ rmSync(projectDirectory, {
12
+ recursive: true,
13
+ force: true,
14
+ });
15
+ }
14
16
  });
15
17
 
16
18
 
@@ -43,7 +45,7 @@ function createTestProject(extraArgs = '') {
43
45
  });
44
46
 
45
47
  execSync(
46
- `<%= packageManagerCommands.exec %> --yes <%= cliName %>@e2e ${projectName} ${extraArgs}`,
48
+ `<%= packageManagerCommands.dlx %> <%= cliName %>@e2e ${projectName} ${extraArgs}`,
47
49
  {
48
50
  cwd: dirname(projectDirectory),
49
51
  stdio: 'inherit',
@@ -57,7 +57,7 @@ function addFiles(host, options) {
57
57
  ...options,
58
58
  tmpl: '',
59
59
  rootTsConfigPath: (0, js_1.getRelativePathToRootTsConfig)(host, options.projectRoot),
60
- packageManagerCommands: (0, devkit_1.getPackageManagerCommand)('npm'),
60
+ packageManagerCommands: (0, devkit_1.getPackageManagerCommand)(),
61
61
  pluginPackageName,
62
62
  });
63
63
  }
@@ -10,7 +10,7 @@ describe('<%= pluginName %>', () => {
10
10
 
11
11
  // The plugin has been built and published to a local registry in the jest globalSetup
12
12
  // Install the plugin built with the latest source code into the test repo
13
- execSync(`<%= packageManagerCommands.install %> <%= pluginPackageName %>@e2e`, {
13
+ execSync(`<%= packageManagerCommands.addDev %> <%= pluginPackageName %>@e2e`, {
14
14
  cwd: projectDirectory,
15
15
  stdio: 'inherit',
16
16
  env: process.env,
@@ -18,11 +18,13 @@ describe('<%= pluginName %>', () => {
18
18
  });
19
19
 
20
20
  afterAll(() => {
21
- // Cleanup the test project
22
- rmSync(projectDirectory, {
23
- recursive: true,
24
- force: true,
25
- });
21
+ if (projectDirectory) {
22
+ // Cleanup the test project
23
+ rmSync(projectDirectory, {
24
+ recursive: true,
25
+ force: true,
26
+ });
27
+ }
26
28
  });
27
29
 
28
30
 
@@ -53,7 +55,7 @@ function createTestProject() {
53
55
  });
54
56
 
55
57
  execSync(
56
- `<%= packageManagerCommands.exec %> --yes create-nx-workspace@latest ${projectName} --preset apps --nxCloud=skip --no-interactive`,
58
+ `<%= packageManagerCommands.dlx %> create-nx-workspace@latest ${projectName} --preset apps --nxCloud=skip --no-interactive`,
57
59
  {
58
60
  cwd: dirname(projectDirectory),
59
61
  stdio: 'inherit',
@@ -87,6 +87,8 @@ async function normalizeOptions(tree, options) {
87
87
  const { artifactName: name, directory, fileName, project, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
88
88
  path: options.path,
89
89
  name: options.name,
90
+ allowedFileExtensions: ['ts'],
91
+ fileExtension: 'ts',
90
92
  });
91
93
  const { className, propertyName } = (0, devkit_1.names)(name);
92
94
  const { root: projectRoot, sourceRoot: projectSourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
@@ -9,7 +9,7 @@
9
9
  "properties": {
10
10
  "path": {
11
11
  "type": "string",
12
- "description": "The file path to the executor without the file extension. Relative to the current working directory.",
12
+ "description": "The file path to the executor. Relative to the current working directory.",
13
13
  "x-prompt": "What is the executor file path?",
14
14
  "$default": {
15
15
  "$source": "argv",
@@ -14,6 +14,8 @@ async function normalizeOptions(tree, options) {
14
14
  const { artifactName: name, directory, fileName, project, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
15
15
  path: options.path,
16
16
  name: options.name,
17
+ allowedFileExtensions: ['ts'],
18
+ fileExtension: 'ts',
17
19
  });
18
20
  const { className, propertyName } = (0, devkit_1.names)(name);
19
21
  const { root: projectRoot, sourceRoot: projectSourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
@@ -8,6 +8,10 @@
8
8
  "examples": [
9
9
  {
10
10
  "description": "Generate a generator exported with the name matching the file name. It results in the generator `foo` at `mylib/src/generators/foo.ts`",
11
+ "command": "nx g @nx/plugin:generator mylib/src/generators/foo.ts"
12
+ },
13
+ {
14
+ "description": "Generate a generator without providing the file extension. It results in the generator `foo` at `mylib/src/generators/foo.ts`",
11
15
  "command": "nx g @nx/plugin:generator mylib/src/generators/foo"
12
16
  },
13
17
  {
@@ -18,7 +22,7 @@
18
22
  "properties": {
19
23
  "path": {
20
24
  "type": "string",
21
- "description": "The file path to the generator without the file extension. Relative to the current working directory.",
25
+ "description": "The file path to the generator. Relative to the current working directory.",
22
26
  "$default": {
23
27
  "$source": "argv",
24
28
  "index": 0
@@ -13,6 +13,8 @@ async function normalizeOptions(tree, options) {
13
13
  const { artifactName: name, directory, fileName, project, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(tree, {
14
14
  path: options.path,
15
15
  name: options.name,
16
+ allowedFileExtensions: ['ts'],
17
+ fileExtension: 'ts',
16
18
  });
17
19
  const { root: projectRoot, sourceRoot: projectSourceRoot } = (0, devkit_1.readProjectConfiguration)(tree, project);
18
20
  const description = options.description ?? `Migration for v${options.packageVersion}`;
@@ -8,6 +8,10 @@
8
8
  "examples": [
9
9
  {
10
10
  "description": "Generate a migration exported with the name matching the file name, which will be triggered when migrating to version 1.0.0 or above from a previous version. It results in the migration `foo` at `mylib/src/migrations/foo.ts`",
11
+ "command": "nx g @nx/plugin:migration mylib/src/migrations/foo.ts -v=1.0.0"
12
+ },
13
+ {
14
+ "description": "Generate a migration without providing the file extension, which will be triggered when migrating to version 1.0.0 or above from a previous version. It results in the migration `foo` at `mylib/src/migrations/foo.ts`",
11
15
  "command": "nx g @nx/plugin:migration mylib/src/migrations/foo -v=1.0.0"
12
16
  },
13
17
  {