@storm-software/workspace-tools 1.13.0 → 1.13.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": "@storm-software/workspace-tools",
3
- "version": "1.13.0",
3
+ "version": "1.13.2",
4
4
  "private": false,
5
5
  "description": "⚡ A Nx plugin package that contains various executors and generators used in a Storm workspaces.",
6
6
  "keywords": [
@@ -37426,9 +37426,9 @@ var require_brace_expansion2 = __commonJS({
37426
37426
  }
37427
37427
  });
37428
37428
 
37429
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-EPAEWGCP.js
37429
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-EPAEWGCP.js
37430
37430
  var require_chunk_EPAEWGCP = __commonJS({
37431
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
37431
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
37432
37432
  "use strict";
37433
37433
  Object.defineProperty(exports, "__esModule", { value: true });
37434
37434
  var version = "8.0.0";
@@ -39075,9 +39075,9 @@ var require_resolve_from = __commonJS({
39075
39075
  }
39076
39076
  });
39077
39077
 
39078
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-GQ77QZBO.js
39078
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-GQ77QZBO.js
39079
39079
  var require_chunk_GQ77QZBO = __commonJS({
39080
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
39080
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
39081
39081
  "use strict";
39082
39082
  Object.defineProperty(exports, "__esModule", { value: true });
39083
39083
  function _interopRequireDefault(obj) {
@@ -39355,9 +39355,9 @@ var require_chunk_GQ77QZBO = __commonJS({
39355
39355
  }
39356
39356
  });
39357
39357
 
39358
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-UIX4URMV.js
39358
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-UIX4URMV.js
39359
39359
  var require_chunk_UIX4URMV = __commonJS({
39360
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
39360
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
39361
39361
  "use strict";
39362
39362
  Object.defineProperty(exports, "__esModule", { value: true });
39363
39363
  function _interopRequireWildcard(obj) {
@@ -40291,9 +40291,9 @@ var require_dist2 = __commonJS({
40291
40291
  }
40292
40292
  });
40293
40293
 
40294
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-7G76EW2R.js
40294
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-7G76EW2R.js
40295
40295
  var require_chunk_7G76EW2R = __commonJS({
40296
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
40296
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
40297
40297
  "use strict";
40298
40298
  Object.defineProperty(exports, "__esModule", { value: true });
40299
40299
  function _interopRequireDefault(obj) {
@@ -95291,9 +95291,9 @@ var require_chokidar = __commonJS({
95291
95291
  }
95292
95292
  });
95293
95293
 
95294
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/index.js
95294
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/index.js
95295
95295
  var require_dist6 = __commonJS({
95296
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/index.js"(exports) {
95296
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/index.js"(exports) {
95297
95297
  "use strict";
95298
95298
  Object.defineProperty(exports, "__esModule", { value: true });
95299
95299
  function _interopRequireDefault(obj) {
@@ -97669,12 +97669,12 @@ var require_dist6 = __commonJS({
97669
97669
  const program = _typescript2.default.createProgram({
97670
97670
  rootNames: [...fsMap.keys()],
97671
97671
  options: parsedTsconfig.options,
97672
- host
97672
+ host: host.compilerHost
97673
97673
  });
97674
97674
  logger.info("tsc", "Created program");
97675
97675
  logger.info("tsc", "Emitting DTS files with the following options: ");
97676
97676
  logger.info("tsc", parsedTsconfig.options);
97677
- let fileMapping = emitDtsFiles(program, host, options);
97677
+ let fileMapping = emitDtsFiles(program, host.compilerHost, options);
97678
97678
  logger.info("tsc", fileMapping);
97679
97679
  return getExports(options, program, fileMapping);
97680
97680
  }
@@ -104542,12 +104542,9 @@ function useDirectory(directory, { create = true }) {
104542
104542
  }
104543
104543
  function getNodeModuleDirectory(workspaceRoot) {
104544
104544
  const nodeModules = (0, import_node_path.join)(workspaceRoot, "node_modules");
104545
- if (!isWritable2(nodeModules)) {
104545
+ if ((0, import_node_fs.existsSync)(nodeModules) && !isWritable2(nodeModules)) {
104546
104546
  throw new Error("Cannot write to node_modules directory");
104547
104547
  }
104548
- if ((0, import_node_fs.existsSync)(nodeModules) || !isWritable2((0, import_node_path.join)(workspaceRoot))) {
104549
- return void 0;
104550
- }
104551
104548
  return nodeModules;
104552
104549
  }
104553
104550
  function findCacheDirectory({
@@ -104783,14 +104780,15 @@ function workerConfig({
104783
104780
  entry,
104784
104781
  format: ["esm"],
104785
104782
  target: ["chrome95"],
104783
+ bundle: true,
104786
104784
  tsconfig,
104787
104785
  projectRoot,
104788
104786
  workspaceRoot,
104789
- outDir: (0, import_path2.join)(outDir, "dist", "worker"),
104787
+ outDir: (0, import_path2.join)(outDir, "dist"),
104790
104788
  silent: !verbose,
104791
104789
  metafile: true,
104792
104790
  shims: true,
104793
- minify: false,
104791
+ minify: true,
104794
104792
  external,
104795
104793
  platform: "browser",
104796
104794
  banner,
@@ -104871,11 +104869,10 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
104871
104869
  }),
104872
104870
  options
104873
104871
  };
104874
- const config = [modernConfig(params), legacyConfig(params)];
104875
- if (platform === "node") {
104876
- config.push(workerConfig(params));
104872
+ if (platform === "worker") {
104873
+ return (0, import_tsup.defineConfig)(workerConfig(params));
104877
104874
  }
104878
- return (0, import_tsup.defineConfig)(config);
104875
+ return (0, import_tsup.defineConfig)([modernConfig(params), legacyConfig(params)]);
104879
104876
  }
104880
104877
  var outExtension = ({ options, format: format2, pkgType }) => {
104881
104878
  console.log(options);
@@ -240,9 +240,9 @@ var require_brace_expansion = __commonJS({
240
240
  }
241
241
  });
242
242
 
243
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-EPAEWGCP.js
243
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-EPAEWGCP.js
244
244
  var require_chunk_EPAEWGCP = __commonJS({
245
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
245
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-EPAEWGCP.js"(exports) {
246
246
  "use strict";
247
247
  Object.defineProperty(exports, "__esModule", { value: true });
248
248
  var version = "8.0.0";
@@ -6549,9 +6549,9 @@ var require_resolve_from = __commonJS({
6549
6549
  }
6550
6550
  });
6551
6551
 
6552
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-GQ77QZBO.js
6552
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-GQ77QZBO.js
6553
6553
  var require_chunk_GQ77QZBO = __commonJS({
6554
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
6554
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-GQ77QZBO.js"(exports) {
6555
6555
  "use strict";
6556
6556
  Object.defineProperty(exports, "__esModule", { value: true });
6557
6557
  function _interopRequireDefault(obj) {
@@ -6829,9 +6829,9 @@ var require_chunk_GQ77QZBO = __commonJS({
6829
6829
  }
6830
6830
  });
6831
6831
 
6832
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-UIX4URMV.js
6832
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-UIX4URMV.js
6833
6833
  var require_chunk_UIX4URMV = __commonJS({
6834
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
6834
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-UIX4URMV.js"(exports) {
6835
6835
  "use strict";
6836
6836
  Object.defineProperty(exports, "__esModule", { value: true });
6837
6837
  function _interopRequireWildcard(obj) {
@@ -7765,9 +7765,9 @@ var require_dist2 = __commonJS({
7765
7765
  }
7766
7766
  });
7767
7767
 
7768
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-7G76EW2R.js
7768
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-7G76EW2R.js
7769
7769
  var require_chunk_7G76EW2R = __commonJS({
7770
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
7770
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/chunk-7G76EW2R.js"(exports) {
7771
7771
  "use strict";
7772
7772
  Object.defineProperty(exports, "__esModule", { value: true });
7773
7773
  function _interopRequireDefault(obj) {
@@ -62765,9 +62765,9 @@ var require_chokidar = __commonJS({
62765
62765
  }
62766
62766
  });
62767
62767
 
62768
- // node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/index.js
62768
+ // node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/index.js
62769
62769
  var require_dist6 = __commonJS({
62770
- "node_modules/.pnpm/tsup@8.0.0_patch_hash=bdmmeb65mxmlm3kvyzuv2k735y_@microsoft+api-extractor@7.38.3_@swc+core@1._ouje7emwty7ylyoyeco6ncv4mi/node_modules/tsup/dist/index.js"(exports) {
62770
+ "node_modules/.pnpm/tsup@8.0.0_patch_hash=b3lvsbr3cg5bef7gdgqpxudpfe_@microsoft+api-extractor@7.38.3_@swc+core@1._saifcdpatwoyxueo2hy2mqtlvu/node_modules/tsup/dist/index.js"(exports) {
62771
62771
  "use strict";
62772
62772
  Object.defineProperty(exports, "__esModule", { value: true });
62773
62773
  function _interopRequireDefault(obj) {
@@ -65143,12 +65143,12 @@ var require_dist6 = __commonJS({
65143
65143
  const program = _typescript2.default.createProgram({
65144
65144
  rootNames: [...fsMap.keys()],
65145
65145
  options: parsedTsconfig.options,
65146
- host
65146
+ host: host.compilerHost
65147
65147
  });
65148
65148
  logger.info("tsc", "Created program");
65149
65149
  logger.info("tsc", "Emitting DTS files with the following options: ");
65150
65150
  logger.info("tsc", parsedTsconfig.options);
65151
- let fileMapping = emitDtsFiles(program, host, options);
65151
+ let fileMapping = emitDtsFiles(program, host.compilerHost, options);
65152
65152
  logger.info("tsc", fileMapping);
65153
65153
  return getExports(options, program, fileMapping);
65154
65154
  }
@@ -71969,12 +71969,9 @@ function useDirectory(directory, { create = true }) {
71969
71969
  }
71970
71970
  function getNodeModuleDirectory(workspaceRoot) {
71971
71971
  const nodeModules = (0, import_node_path.join)(workspaceRoot, "node_modules");
71972
- if (!isWritable2(nodeModules)) {
71972
+ if ((0, import_node_fs.existsSync)(nodeModules) && !isWritable2(nodeModules)) {
71973
71973
  throw new Error("Cannot write to node_modules directory");
71974
71974
  }
71975
- if ((0, import_node_fs.existsSync)(nodeModules) || !isWritable2((0, import_node_path.join)(workspaceRoot))) {
71976
- return void 0;
71977
- }
71978
71975
  return nodeModules;
71979
71976
  }
71980
71977
  function findCacheDirectory({
@@ -72210,14 +72207,15 @@ function workerConfig({
72210
72207
  entry,
72211
72208
  format: ["esm"],
72212
72209
  target: ["chrome95"],
72210
+ bundle: true,
72213
72211
  tsconfig,
72214
72212
  projectRoot,
72215
72213
  workspaceRoot,
72216
- outDir: (0, import_path2.join)(outDir, "dist", "worker"),
72214
+ outDir: (0, import_path2.join)(outDir, "dist"),
72217
72215
  silent: !verbose,
72218
72216
  metafile: true,
72219
72217
  shims: true,
72220
- minify: false,
72218
+ minify: true,
72221
72219
  external,
72222
72220
  platform: "browser",
72223
72221
  banner,
@@ -72298,11 +72296,10 @@ function getConfig(workspaceRoot, projectRoot, sourceRoot, {
72298
72296
  }),
72299
72297
  options
72300
72298
  };
72301
- const config = [modernConfig(params), legacyConfig(params)];
72302
- if (platform === "node") {
72303
- config.push(workerConfig(params));
72299
+ if (platform === "worker") {
72300
+ return (0, import_tsup.defineConfig)(workerConfig(params));
72304
72301
  }
72305
- return (0, import_tsup.defineConfig)(config);
72302
+ return (0, import_tsup.defineConfig)([modernConfig(params), legacyConfig(params)]);
72306
72303
  }
72307
72304
  var outExtension = ({ options, format, pkgType }) => {
72308
72305
  console.log(options);
@@ -1,6 +1,8 @@
1
1
  import { EsBuildExecutorOptions } from "@nx/esbuild/src/executors/esbuild/schema.d.ts";
2
2
  import { Options } from "tsup";
3
3
 
4
+ export type Platform = "browser" | "neutral" | "node" | "worker";
5
+
4
6
  export type TsupExecutorSchema = Omit<
5
7
  EsBuildExecutorOptions,
6
8
  | "main"
@@ -15,6 +17,7 @@ export type TsupExecutorSchema = Omit<
15
17
  | "skipTypeCheck"
16
18
  | "esbuildOptions"
17
19
  | "esbuildConfig"
20
+ | "platform"
18
21
  > & {
19
22
  entry?: string;
20
23
  options: Options;
@@ -28,4 +31,5 @@ export type TsupExecutorSchema = Omit<
28
31
  docModel?: boolean;
29
32
  tsdocMetadata?: boolean;
30
33
  includeSrc?: boolean;
34
+ platform?: Platform;
31
35
  };
@@ -78,7 +78,7 @@
78
78
  "platform": {
79
79
  "type": "string",
80
80
  "description": "Platform target for outputs.",
81
- "enum": ["browser", "node", "neutral"],
81
+ "enum": ["browser", "neutral", "node", "worker"],
82
82
  "default": "neutral"
83
83
  },
84
84
  "banner": {
@@ -122,12 +122,9 @@ function useDirectory(directory, { create = true }) {
122
122
  }
123
123
  function getNodeModuleDirectory(workspaceRoot) {
124
124
  const nodeModules = (0, import_node_path2.join)(workspaceRoot, "node_modules");
125
- if (!isWritable(nodeModules)) {
125
+ if ((0, import_node_fs.existsSync)(nodeModules) && !isWritable(nodeModules)) {
126
126
  throw new Error("Cannot write to node_modules directory");
127
127
  }
128
- if ((0, import_node_fs.existsSync)(nodeModules) || !isWritable((0, import_node_path2.join)(workspaceRoot))) {
129
- return void 0;
130
- }
131
128
  return nodeModules;
132
129
  }
133
130
  function findCacheDirectory({