@nx/js 0.0.0-pr-30216-16c1f45 → 0.0.0-pr-3-c6ccd0d

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": "0.0.0-pr-30216-16c1f45",
3
+ "version": "0.0.0-pr-3-c6ccd0d",
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": "0.0.0-pr-30216-16c1f45",
43
- "@nx/workspace": "0.0.0-pr-30216-16c1f45",
42
+ "@nx/devkit": "0.0.0-pr-3-c6ccd0d",
43
+ "@nx/workspace": "0.0.0-pr-3-c6ccd0d",
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",
55
56
  "npm-package-arg": "11.0.1",
56
57
  "npm-run-path": "^4.0.1",
57
58
  "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: context.root,
301
+ workspaceRoot: '',
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 picomatch = require("picomatch");
6
+ const minimatch_1 = require("minimatch");
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) => picomatch(normalize(excludePath))(normalize(includePath)) ||
280
- picomatch(normalize(includePath))(normalize(excludePath)))) {
279
+ if (!otherFilesInclude.some((includePath) => (0, minimatch_1.minimatch)(normalize(includePath), normalize(excludePath)) ||
280
+ (0, minimatch_1.minimatch)(normalize(excludePath), normalize(includePath)))) {
281
281
  excludePaths.add(excludePath);
282
282
  }
283
283
  });
@@ -554,7 +554,7 @@ function hasExternalProjectReferences(tsConfigPath, tsConfig, workspaceRoot, pro
554
554
  return false;
555
555
  }
556
556
  function isExternalProjectReference(refTsConfigPath, workspaceRoot, projectRoot) {
557
- const relativePath = posixRelative(workspaceRoot, refTsConfigPath);
557
+ const relativePath = posix.relative(workspaceRoot, refTsConfigPath);
558
558
  if (cache.isExternalProjectReference[relativePath] !== undefined) {
559
559
  return cache.isExternalProjectReference[relativePath];
560
560
  }
@@ -584,7 +584,7 @@ function getTsConfigDirName(tsConfigPath) {
584
584
  : (0, node_path_1.normalize)(tsConfigPath);
585
585
  }
586
586
  function retrieveTsConfigFromCache(tsConfigPath, workspaceRoot) {
587
- const relativePath = posixRelative(workspaceRoot, tsConfigPath);
587
+ const relativePath = posix.relative(workspaceRoot, tsConfigPath);
588
588
  // we don't need to check the hash if it's in the cache, because we've already
589
589
  // checked it when we initially populated the cache
590
590
  return tsConfigCache[relativePath]
@@ -600,7 +600,7 @@ function initializeTsConfigCache(configFilePaths, workspaceRoot) {
600
600
  }
601
601
  }
602
602
  function readTsConfigAndCache(tsConfigPath, workspaceRoot) {
603
- const relativePath = posixRelative(workspaceRoot, tsConfigPath);
603
+ const relativePath = posix.relative(workspaceRoot, tsConfigPath);
604
604
  const hash = getFileHash(tsConfigPath, workspaceRoot);
605
605
  let extendedFilesHash;
606
606
  if (tsConfigCache[relativePath] &&
@@ -716,7 +716,7 @@ function resolveExtendedTsConfigPath(tsConfigPath, directory) {
716
716
  }
717
717
  }
718
718
  function getFileHash(filePath, workspaceRoot) {
719
- const relativePath = posixRelative(workspaceRoot, filePath);
719
+ const relativePath = posix.relative(workspaceRoot, filePath);
720
720
  if (!cache.fileHashes[relativePath]) {
721
721
  const content = readFile(filePath, workspaceRoot);
722
722
  cache.fileHashes[relativePath] = (0, file_hasher_1.hashArray)([content]);
@@ -724,7 +724,7 @@ function getFileHash(filePath, workspaceRoot) {
724
724
  return cache.fileHashes[relativePath];
725
725
  }
726
726
  function readFile(filePath, workspaceRoot) {
727
- const relativePath = posixRelative(workspaceRoot, filePath);
727
+ const relativePath = posix.relative(workspaceRoot, filePath);
728
728
  if (!cache.rawFiles[relativePath]) {
729
729
  const content = (0, node_fs_1.readFileSync)(filePath, 'utf8');
730
730
  cache.rawFiles[relativePath] = content;
@@ -775,29 +775,23 @@ function toRelativePaths(cache, workspaceRoot) {
775
775
  hash,
776
776
  };
777
777
  if (data.options.rootDir) {
778
- updatedCache[key].data.options.rootDir = posixRelative(workspaceRoot, data.options.rootDir);
778
+ updatedCache[key].data.options.rootDir = posix.relative(workspaceRoot, data.options.rootDir);
779
779
  }
780
780
  if (data.options.outDir) {
781
- updatedCache[key].data.options.outDir = posixRelative(workspaceRoot, data.options.outDir);
781
+ updatedCache[key].data.options.outDir = posix.relative(workspaceRoot, data.options.outDir);
782
782
  }
783
783
  if (data.options.outFile) {
784
- updatedCache[key].data.options.outFile = posixRelative(workspaceRoot, data.options.outFile);
784
+ updatedCache[key].data.options.outFile = posix.relative(workspaceRoot, data.options.outFile);
785
785
  }
786
786
  if (data.options.tsBuildInfoFile) {
787
- updatedCache[key].data.options.tsBuildInfoFile = posixRelative(workspaceRoot, data.options.tsBuildInfoFile);
787
+ updatedCache[key].data.options.tsBuildInfoFile = posix.relative(workspaceRoot, data.options.tsBuildInfoFile);
788
788
  }
789
789
  if (data.extendedConfigFile?.filePath) {
790
- updatedCache[key].data.extendedConfigFile.filePath = posixRelative(workspaceRoot, data.extendedConfigFile.filePath);
790
+ updatedCache[key].data.extendedConfigFile.filePath = posix.relative(workspaceRoot, data.extendedConfigFile.filePath);
791
791
  }
792
792
  if (data.projectReferences) {
793
- updatedCache[key].data.projectReferences = data.projectReferences.map((ref) => ({
794
- ...ref,
795
- path: posixRelative(workspaceRoot, ref.path),
796
- }));
793
+ updatedCache[key].data.projectReferences = data.projectReferences.map((ref) => ({ ...ref, path: posix.relative(workspaceRoot, ref.path) }));
797
794
  }
798
795
  }
799
796
  return updatedCache;
800
797
  }
801
- function posixRelative(workspaceRoot, path) {
802
- return posix.normalize((0, node_path_1.relative)(workspaceRoot, path));
803
- }
@@ -27,6 +27,7 @@ function addBuildAndWatchDepsTargets(workspaceRoot, projectRoot, targets, option
27
27
  dependsOn: ['^build'],
28
28
  };
29
29
  targets[options.watchDepsTargetName ?? 'watch-deps'] = {
30
+ continuous: true,
30
31
  dependsOn: [buildDepsTargetName],
31
32
  command: `${pmc.exec} nx watch --projects ${projectName} --includeDependentProjects -- ${pmc.exec} nx ${buildDepsTargetName} ${projectName}`,
32
33
  };
@@ -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 picomatch = require("picomatch");
4
+ const minimatch_1 = require("minimatch");
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 (picomatch(ag.pattern)(pathFromRoot) &&
121
- !ag.ignore?.some((ig) => picomatch(ig)(pathFromRoot)) &&
120
+ if ((0, minimatch_1.minimatch)(pathFromRoot, ag.pattern) &&
121
+ !ag.ignore?.some((ig) => (0, minimatch_1.minimatch)(pathFromRoot, ig)) &&
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) => picomatch(ig)(src)) &&
140
+ if (!assetGlob.ignore?.some((ig) => (0, minimatch_1.minimatch)(src, ig)) &&
141
141
  !this.ignore.ignores(src)) {
142
142
  const relPath = path.relative(assetGlob.input, src);
143
143
  const dest = relPath.startsWith('..') ? src : relPath;
@@ -16,7 +16,6 @@ const fileutils_1 = require("nx/src/utils/fileutils");
16
16
  const output_1 = require("nx/src/utils/output");
17
17
  const path_1 = require("path");
18
18
  const ts_config_1 = require("./typescript/ts-config");
19
- const crypto_1 = require("crypto");
20
19
  function isBuildable(target, node) {
21
20
  return (node.data.targets &&
22
21
  node.data.targets[target] &&
@@ -230,7 +229,7 @@ function computeCompilerOptionsPaths(tsConfig, dependencies) {
230
229
  return paths;
231
230
  }
232
231
  function createTmpTsConfig(tsconfigPath, workspaceRoot, projectRoot, dependencies, useWorkspaceAsBaseUrl = false) {
233
- const tmpTsConfigPath = (0, path_1.join)(workspaceRoot, 'tmp', projectRoot, process.env.NX_TASK_TARGET_TARGET ?? 'build', `tsconfig.generated.${(0, crypto_1.randomUUID)()}.json`);
232
+ const tmpTsConfigPath = (0, path_1.join)(workspaceRoot, 'tmp', projectRoot, process.env.NX_TASK_TARGET_TARGET ?? 'build', 'tsconfig.generated.json');
234
233
  if (tsconfigPath === tmpTsConfigPath) {
235
234
  return tsconfigPath;
236
235
  }
@@ -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 picomatch = require("picomatch");
8
+ const minimatch_1 = require("minimatch");
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) => picomatch(p)((0, posix_1.join)(projectRoot, 'package.json')));
17
+ const isIncluded = patterns.some((p) => (0, minimatch_1.minimatch)((0, posix_1.join)(projectRoot, 'package.json'), p));
18
18
  return isIncluded ? 'included' : 'excluded';
19
19
  }
20
20
  function isUsingPackageManagerWorkspaces(tree) {