@nx/vue 20.5.0-rc.0 → 20.5.0-rc.2

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/vue",
3
- "version": "20.5.0-rc.0",
3
+ "version": "20.5.0-rc.2",
4
4
  "private": false,
5
5
  "description": "The Vue plugin for Nx contains executors and generators for managing Vue applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Vitest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -31,11 +31,11 @@
31
31
  "dependencies": {
32
32
  "minimatch": "9.0.3",
33
33
  "tslib": "^2.3.0",
34
- "@nx/devkit": "20.5.0-rc.0",
35
- "@nx/js": "20.5.0-rc.0",
36
- "@nx/eslint": "20.5.0-rc.0",
37
- "@nx/vite": "20.5.0-rc.0",
38
- "@nx/web": "20.5.0-rc.0"
34
+ "@nx/devkit": "20.5.0-rc.2",
35
+ "@nx/js": "20.5.0-rc.2",
36
+ "@nx/eslint": "20.5.0-rc.2",
37
+ "@nx/vite": "20.5.0-rc.2",
38
+ "@nx/web": "20.5.0-rc.2"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public"
@@ -17,15 +17,15 @@ function createLibraryFiles(host, options) {
17
17
  if (!options.isUsingTsSolutionConfig &&
18
18
  (options.publishable || options.bundler !== 'none')) {
19
19
  (0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), {
20
- name: options.name,
20
+ name: options.importPath ?? options.projectName,
21
21
  version: '0.0.1',
22
22
  main: './index.js',
23
23
  types: './index.d.ts',
24
24
  exports: {
25
25
  '.': {
26
+ types: './index.d.ts',
26
27
  import: './index.mjs',
27
28
  require: './index.js',
28
- types: './index.d.ts',
29
29
  },
30
30
  },
31
31
  });
@@ -32,7 +32,7 @@ async function normalizeOptions(host, options) {
32
32
  addPlugin,
33
33
  ...options,
34
34
  projectName: isUsingTsSolutionConfig
35
- ? (0, get_import_path_1.getImportPath)(host, projectName)
35
+ ? importPath ?? (0, get_import_path_1.getImportPath)(host, projectName)
36
36
  : projectName,
37
37
  bundler,
38
38
  fileName,
@@ -15,20 +15,20 @@ const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
15
15
  const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
16
16
  const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
17
17
  const path_1 = require("path");
18
- const get_import_path_1 = require("@nx/js/src/utils/get-import-path");
19
18
  const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
20
19
  const determine_entry_fields_1 = require("./lib/determine-entry-fields");
21
20
  const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
21
+ const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
22
22
  function libraryGenerator(tree, schema) {
23
23
  return libraryGeneratorInternal(tree, { addPlugin: false, ...schema });
24
24
  }
25
25
  async function libraryGeneratorInternal(tree, schema) {
26
26
  const tasks = [];
27
- tasks.push(await (0, js_1.initGenerator)(tree, { ...schema, skipFormat: true }));
28
27
  const options = await (0, normalize_options_1.normalizeOptions)(tree, schema);
29
28
  if (options.publishable === true && !schema.importPath) {
30
29
  throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
31
30
  }
31
+ tasks.push(await (0, js_1.initGenerator)(tree, { ...options, skipFormat: true }));
32
32
  // If we are using the new TS solution
33
33
  // We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
34
34
  if (options.isUsingTsSolutionConfig) {
@@ -36,9 +36,8 @@ async function libraryGeneratorInternal(tree, schema) {
36
36
  }
37
37
  if (options.isUsingTsSolutionConfig) {
38
38
  (0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), {
39
- name: (0, get_import_path_1.getImportPath)(tree, options.name),
39
+ name: options.projectName,
40
40
  version: '0.0.1',
41
- private: true,
42
41
  ...(0, determine_entry_fields_1.determineEntryFields)(options),
43
42
  files: options.publishable ? ['dist', '!**/*.tsbuildinfo'] : undefined,
44
43
  nx: options.parsedTags?.length
@@ -49,7 +48,7 @@ async function libraryGeneratorInternal(tree, schema) {
49
48
  });
50
49
  }
51
50
  else {
52
- (0, devkit_1.addProjectConfiguration)(tree, options.name, {
51
+ (0, devkit_1.addProjectConfiguration)(tree, options.projectName, {
53
52
  root: options.projectRoot,
54
53
  sourceRoot: (0, devkit_1.joinPathFragments)(options.projectRoot, 'src'),
55
54
  projectType: 'library',
@@ -82,13 +81,6 @@ async function libraryGeneratorInternal(tree, schema) {
82
81
  skipFormat: true,
83
82
  });
84
83
  }
85
- if (!options.isUsingTsSolutionConfig &&
86
- (options.publishable || options.bundler !== 'none')) {
87
- (0, devkit_1.updateJson)(tree, `${options.projectRoot}/package.json`, (json) => {
88
- json.name = options.importPath;
89
- return json;
90
- });
91
- }
92
84
  if (!options.skipTsConfig && !options.isUsingTsSolutionConfig) {
93
85
  (0, js_1.addTsConfigPath)(tree, options.importPath, [
94
86
  (0, devkit_1.joinPathFragments)(options.projectRoot, './src', 'index.' + (options.js ? 'js' : 'ts')),
@@ -108,6 +100,17 @@ async function libraryGeneratorInternal(tree, schema) {
108
100
  : undefined);
109
101
  }
110
102
  (0, sort_fields_1.sortPackageJsonFields)(tree, options.projectRoot);
103
+ if (options.publishable) {
104
+ const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.projectName);
105
+ if (options.isUsingTsSolutionConfig) {
106
+ await (0, add_release_config_1.addReleaseConfigForTsSolution)(tree, options.projectName, projectConfig);
107
+ }
108
+ else {
109
+ await (0, add_release_config_1.addReleaseConfigForNonTsSolution)(tree, options.projectName, projectConfig);
110
+ }
111
+ (0, devkit_1.updateProjectConfiguration)(tree, options.projectName, projectConfig);
112
+ tasks.push(await (0, add_release_config_1.releaseTasks)(tree));
113
+ }
111
114
  if (!options.skipFormat)
112
115
  await (0, devkit_1.formatFiles)(tree);
113
116
  // Always run install to link packages.