@nx/workspace 21.4.0-canary.20250725-0359f0d → 21.4.0-canary.20250726-64897b7

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/workspace",
3
- "version": "21.4.0-canary.20250725-0359f0d",
3
+ "version": "21.4.0-canary.20250726-64897b7",
4
4
  "private": false,
5
5
  "description": "The Workspace plugin contains executors and generators that are useful for any Nx workspace. It should be present in every Nx workspace and other plugins build on it.",
6
6
  "repository": {
@@ -38,17 +38,17 @@
38
38
  }
39
39
  },
40
40
  "dependencies": {
41
- "@nx/devkit": "21.4.0-canary.20250725-0359f0d",
41
+ "@nx/devkit": "21.4.0-canary.20250726-64897b7",
42
42
  "@zkochan/js-yaml": "0.0.7",
43
43
  "chalk": "^4.1.0",
44
44
  "enquirer": "~2.3.6",
45
45
  "picomatch": "4.0.2",
46
46
  "tslib": "^2.3.0",
47
47
  "yargs-parser": "21.1.1",
48
- "nx": "21.4.0-canary.20250725-0359f0d"
48
+ "nx": "21.4.0-canary.20250726-64897b7"
49
49
  },
50
50
  "devDependencies": {
51
- "nx": "21.4.0-canary.20250725-0359f0d"
51
+ "nx": "21.4.0-canary.20250726-64897b7"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
@@ -1 +1 @@
1
- {"version":3,"file":"npm-package.d.ts","sourceRoot":"","sources":["../../../../../../packages/workspace/src/generators/npm-package/npm-package.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAEL,MAAM,YAAY,CAAC;AAOpB,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AA4CD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,cAAc,iBAmBzB"}
1
+ {"version":3,"file":"npm-package.d.ts","sourceRoot":"","sources":["../../../../../../packages/workspace/src/generators/npm-package/npm-package.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAEL,MAAM,YAAY,CAAC;AAOpB,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAgDD,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,cAAc,iBAmBzB"}
@@ -23,6 +23,10 @@ function addFiles(projectRoot, tree, options) {
23
23
  (0, devkit_1.writeJson)(tree, packageJsonPath, {
24
24
  name: options.importPath,
25
25
  version: '0.0.0',
26
+ exports: {
27
+ '.': './index.js',
28
+ './package.json': './package.json',
29
+ },
26
30
  scripts: {
27
31
  test: 'node index.js',
28
32
  },
@@ -1 +1 @@
1
- {"version":3,"file":"ts-solution-setup.d.ts","sourceRoot":"","sources":["../../../../../packages/workspace/src/utils/ts-solution-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAGpE,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,SAAS,GAAG,aAAa,GACtC,SAAS,GAAG,aAAa,CAW3B"}
1
+ {"version":3,"file":"ts-solution-setup.d.ts","sourceRoot":"","sources":["../../../../../packages/workspace/src/utils/ts-solution-setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAGpE,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,WAAW,EAAE,MAAM,EACnB,WAAW,CAAC,EAAE,SAAS,GAAG,aAAa,GACtC,SAAS,GAAG,aAAa,CAkB3B"}
@@ -10,12 +10,16 @@ function getProjectType(tree, projectRoot, projectType) {
10
10
  return 'library';
11
11
  if ((0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.app.json'))
12
12
  return 'application';
13
- // If there are no exports, assume it is an application since both buildable and non-buildable libraries have exports.
13
+ // If it doesn't have any common library entry points, assume it is an application
14
14
  const packageJsonPath = (0, devkit_1.joinPathFragments)(projectRoot, 'package.json');
15
15
  const packageJson = tree.exists(packageJsonPath)
16
16
  ? (0, devkit_1.readJson)(tree, (0, devkit_1.joinPathFragments)(projectRoot, 'package.json'))
17
17
  : null;
18
- if (!packageJson?.exports)
18
+ if (!packageJson?.exports &&
19
+ !packageJson?.main &&
20
+ !packageJson?.module &&
21
+ !packageJson?.bin) {
19
22
  return 'application';
23
+ }
20
24
  return 'library';
21
25
  }