@nx/js 20.5.0-beta.4 → 20.5.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/js",
3
- "version": "20.5.0-beta.4",
3
+ "version": "20.5.0-beta.5",
4
4
  "private": false,
5
5
  "description": "The JS plugin for Nx contains executors and generators that provide the best experience for developing JavaScript and TypeScript projects. ",
6
6
  "repository": {
@@ -39,8 +39,8 @@
39
39
  "@babel/preset-env": "^7.23.2",
40
40
  "@babel/preset-typescript": "^7.22.5",
41
41
  "@babel/runtime": "^7.22.6",
42
- "@nx/devkit": "20.5.0-beta.4",
43
- "@nx/workspace": "20.5.0-beta.4",
42
+ "@nx/devkit": "20.5.0-beta.5",
43
+ "@nx/workspace": "20.5.0-beta.5",
44
44
  "@zkochan/js-yaml": "0.0.7",
45
45
  "babel-plugin-const-enum": "^1.0.1",
46
46
  "babel-plugin-macros": "^3.1.0",
@@ -52,10 +52,10 @@
52
52
  "ignore": "^5.0.4",
53
53
  "js-tokens": "^4.0.0",
54
54
  "jsonc-parser": "3.2.0",
55
- "minimatch": "9.0.3",
56
55
  "npm-package-arg": "11.0.1",
57
56
  "npm-run-path": "^4.0.1",
58
57
  "ora": "5.3.0",
58
+ "picomatch": "4.0.2",
59
59
  "semver": "^7.5.3",
60
60
  "source-map-support": "0.5.19",
61
61
  "tinyglobby": "^0.2.10",
@@ -298,7 +298,7 @@ function getFileToRun(context, project, buildOptions, buildTargetExecutor) {
298
298
  const outputFilePath = (0, utils_1.interpolate)(outputPath, {
299
299
  projectName: project.name,
300
300
  projectRoot: project.data.root,
301
- workspaceRoot: '',
301
+ workspaceRoot: context.root,
302
302
  });
303
303
  return path.join(outputFilePath, 'main.js');
304
304
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createNodes = exports.createNodesV2 = exports.PLUGIN_NAME = exports.createDependencies = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const get_named_inputs_1 = require("@nx/devkit/src/utils/get-named-inputs");
6
- const minimatch_1 = require("minimatch");
6
+ const picomatch = require("picomatch");
7
7
  const node_fs_1 = require("node:fs");
8
8
  const node_path_1 = require("node:path");
9
9
  const posix = require("node:path/posix");
@@ -276,8 +276,8 @@ function getInputs(namedInputs, configFilePath, tsConfig, internalProjectReferen
276
276
  });
277
277
  const normalize = (p) => (p.startsWith('./') ? p.slice(2) : p);
278
278
  config.raw.exclude.forEach((excludePath) => {
279
- if (!otherFilesInclude.some((includePath) => (0, minimatch_1.minimatch)(normalize(includePath), normalize(excludePath)) ||
280
- (0, minimatch_1.minimatch)(normalize(excludePath), normalize(includePath)))) {
279
+ if (!otherFilesInclude.some((includePath) => picomatch(normalize(excludePath))(normalize(includePath)) ||
280
+ picomatch(normalize(includePath))(normalize(excludePath)))) {
281
281
  excludePaths.add(excludePath);
282
282
  }
283
283
  });
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CopyAssetsHandler = exports.defaultFileEventHandler = void 0;
4
- const minimatch_1 = require("minimatch");
4
+ const picomatch = require("picomatch");
5
5
  const node_fs_1 = require("node:fs");
6
6
  const pathPosix = require("node:path/posix");
7
7
  const path = require("node:path");
@@ -117,8 +117,8 @@ class CopyAssetsHandler {
117
117
  for (const event of events) {
118
118
  const pathFromRoot = path.relative(this.rootDir, event.path);
119
119
  for (const ag of this.assetGlobs) {
120
- if ((0, minimatch_1.minimatch)(pathFromRoot, ag.pattern) &&
121
- !ag.ignore?.some((ig) => (0, minimatch_1.minimatch)(pathFromRoot, ig)) &&
120
+ if (picomatch(ag.pattern)(pathFromRoot) &&
121
+ !ag.ignore?.some((ig) => picomatch(ig)(pathFromRoot)) &&
122
122
  !this.ignore.ignores(pathFromRoot)) {
123
123
  const relPath = path.relative(ag.input, pathFromRoot);
124
124
  const destPath = relPath.startsWith('..') ? pathFromRoot : relPath;
@@ -137,7 +137,7 @@ class CopyAssetsHandler {
137
137
  }
138
138
  filesToEvent(files, assetGlob) {
139
139
  return files.reduce((acc, src) => {
140
- if (!assetGlob.ignore?.some((ig) => (0, minimatch_1.minimatch)(src, ig)) &&
140
+ if (!assetGlob.ignore?.some((ig) => picomatch(ig)(src)) &&
141
141
  !this.ignore.ignores(src)) {
142
142
  const relPath = path.relative(assetGlob.input, src);
143
143
  const dest = relPath.startsWith('..') ? src : relPath;
@@ -5,7 +5,7 @@ exports.isUsingPackageManagerWorkspaces = isUsingPackageManagerWorkspaces;
5
5
  exports.isWorkspacesEnabled = isWorkspacesEnabled;
6
6
  exports.getProjectPackageManagerWorkspaceStateWarningTask = getProjectPackageManagerWorkspaceStateWarningTask;
7
7
  const devkit_1 = require("@nx/devkit");
8
- const minimatch_1 = require("minimatch");
8
+ const picomatch = require("picomatch");
9
9
  const posix_1 = require("node:path/posix");
10
10
  const package_json_1 = require("nx/src/plugins/package-json");
11
11
  const semver_1 = require("semver");
@@ -14,7 +14,7 @@ function getProjectPackageManagerWorkspaceState(tree, projectRoot) {
14
14
  return 'no-workspaces';
15
15
  }
16
16
  const patterns = (0, package_json_1.getGlobPatternsFromPackageManagerWorkspaces)(tree.root, (path) => (0, devkit_1.readJson)(tree, path, { expectComments: true }));
17
- const isIncluded = patterns.some((p) => (0, minimatch_1.minimatch)((0, posix_1.join)(projectRoot, 'package.json'), p));
17
+ const isIncluded = patterns.some((p) => picomatch(p)((0, posix_1.join)(projectRoot, 'package.json')));
18
18
  return isIncluded ? 'included' : 'excluded';
19
19
  }
20
20
  function isUsingPackageManagerWorkspaces(tree) {