@nx/devkit 17.0.0-beta.8 → 17.0.0-rc.0

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/devkit",
3
- "version": "17.0.0-beta.8",
3
+ "version": "17.0.0-rc.0",
4
4
  "private": false,
5
5
  "description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.",
6
6
  "repository": {
@@ -34,7 +34,7 @@
34
34
  "tmp": "~0.2.1",
35
35
  "tslib": "^2.3.0",
36
36
  "semver": "7.5.3",
37
- "@nrwl/devkit": "17.0.0-beta.8"
37
+ "@nrwl/devkit": "17.0.0-rc.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "nx": ">= 16 <= 18"
@@ -6,7 +6,7 @@ export type ArtifactGenerationOptions = {
6
6
  name: string;
7
7
  directory?: string;
8
8
  disallowPathInNameForDerived?: boolean;
9
- fileExtension?: 'js' | 'jsx' | 'ts' | 'tsx';
9
+ fileExtension?: 'js' | 'jsx' | 'ts' | 'tsx' | 'vue';
10
10
  fileName?: string;
11
11
  flat?: boolean;
12
12
  nameAndDirectoryFormat?: NameAndDirectoryFormat;
@@ -85,20 +85,19 @@ async function determineFormat(tree, formats, callingGenerator) {
85
85
  return result;
86
86
  }
87
87
  function getProjectNameAndRootFormats(tree, options) {
88
- const name = (0, names_1.names)(options.name).fileName;
89
88
  const directory = options.directory
90
89
  ? normalizePath(options.directory.replace(/^\.?\//, ''))
91
90
  : undefined;
92
- const asProvidedProjectName = name;
91
+ const asProvidedProjectName = options.name;
93
92
  let asProvidedProjectDirectory;
94
93
  const relativeCwd = normalizePath((0, path_1.relative)(workspaceRoot, getCwd())).replace(/\/$/, '');
95
94
  if (directory) {
96
95
  // append the directory to the current working directory if it doesn't start with it
97
96
  if (directory === relativeCwd || directory.startsWith(`${relativeCwd}/`)) {
98
- asProvidedProjectDirectory = (0, names_1.names)(directory).fileName;
97
+ asProvidedProjectDirectory = directory;
99
98
  }
100
99
  else {
101
- asProvidedProjectDirectory = joinPathFragments(relativeCwd, (0, names_1.names)(directory).fileName);
100
+ asProvidedProjectDirectory = joinPathFragments(relativeCwd, directory);
102
101
  }
103
102
  }
104
103
  else if (options.rootProject) {
@@ -112,7 +111,7 @@ function getProjectNameAndRootFormats(tree, options) {
112
111
  asProvidedProjectDirectory = joinPathFragments(relativeCwd, asProvidedProjectName);
113
112
  }
114
113
  }
115
- if (name.startsWith('@')) {
114
+ if (asProvidedProjectName.startsWith('@')) {
116
115
  const nameWithoutScope = asProvidedProjectName.split('/')[1];
117
116
  return {
118
117
  'as-provided': {
@@ -139,6 +138,7 @@ function getProjectNameAndRootFormats(tree, options) {
139
138
  : getImportPath(npmScope, asProvidedProjectName);
140
139
  }
141
140
  }
141
+ const name = (0, names_1.names)(options.name).fileName;
142
142
  let { projectDirectory, layoutDirectory } = getDirectories(tree, directory, options.projectType);
143
143
  const derivedProjectDirectoryWithoutLayout = projectDirectory
144
144
  ? `${(0, names_1.names)(projectDirectory).fileName}/${name}`