pnpm-plugin-storm-software 0.1.3 → 0.1.4

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/esm_loader.mjs ADDED
@@ -0,0 +1,35 @@
1
+ import { createRequire } from "node:module";
2
+ import { delimiter } from "node:path";
3
+ import { pathToFileURL } from "node:url";
4
+
5
+ const extraNodePaths = (process.env.NODE_PATH || "")
6
+ .split(delimiter)
7
+ .filter(Boolean);
8
+
9
+ export async function resolve(specifier, context, defaultResolve) {
10
+ try {
11
+ return await defaultResolve(specifier, context, defaultResolve);
12
+ } catch (originalError) {
13
+ if (
14
+ specifier.startsWith(".") ||
15
+ specifier.startsWith("/") ||
16
+ specifier.match(/^node:/)
17
+ ) {
18
+ // Don't handle relative, absolute, or node: specifiers
19
+ throw originalError;
20
+ }
21
+
22
+ for (const basePath of extraNodePaths) {
23
+ const require = createRequire(pathToFileURL(basePath).href);
24
+ try {
25
+ const resolved = require.resolve(specifier);
26
+ return { url: pathToFileURL(resolved).href };
27
+ } catch {
28
+ // Skip and try next
29
+ }
30
+ }
31
+
32
+ // Re-throw original error if not found
33
+ throw originalError;
34
+ }
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pnpm-plugin-storm-software",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "description": "A [pnpm](https://pnpm.io/) plugin to enhance pnpm functionality for Storm Software projects.",
6
6
  "repository": {
@@ -14,16 +14,16 @@
14
14
  "./package.json": "./package.json",
15
15
  ".": "./pnpmfile.cjs",
16
16
  "./pnpmfile.cjs": "./pnpmfile.cjs",
17
+ "./esm_loader.mjs": "./esm_loader.mjs",
17
18
  "./allow.json": "./allow.json"
18
19
  },
19
- "files": ["./pnpmfile.cjs", "./allow.json"],
20
- "dependencies": { "defu": "6.1.4" },
20
+ "files": ["./pnpmfile.cjs", "./esm_loader.mjs", "./allow.json"],
21
21
  "devDependencies": {
22
- "@pnpm/plugin-esm-node-path": "^0.1.2",
23
22
  "@pnpm/types": "^1001.0.0",
24
23
  "@types/node": "^24.10.1",
24
+ "defu": "6.1.4",
25
25
  "tsup": "8.4.0"
26
26
  },
27
27
  "publishConfig": { "access": "public" },
28
- "gitHead": "c73dd2770b156488a7025a7674d72240e862b5b5"
28
+ "gitHead": "d88e73ed5fbb35c211bf223ea13f759b4ae65134"
29
29
  }
package/pnpmfile.cjs CHANGED
@@ -1,74 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
10
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
11
- }) : x)(function(x) {
12
- if (typeof require !== "undefined") return require.apply(this, arguments);
13
- throw Error('Dynamic require of "' + x + '" is not supported');
14
- });
15
- var __esm = (fn, res) => function __init() {
16
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
17
- };
18
- var __commonJS = (cb, mod) => function __require2() {
19
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
20
- };
21
- var __copyProps = (to, from, except, desc) => {
22
- if (from && typeof from === "object" || typeof from === "function") {
23
- for (let key of __getOwnPropNames(from))
24
- if (!__hasOwnProp.call(to, key) && key !== except)
25
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
26
- }
27
- return to;
28
- };
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
- // If the importer is in node compatibility mode or this is not an ESM
31
- // file that has been converted to a CommonJS file using a Babel-
32
- // compatible transform (i.e. "__esModule" has not been set), then set
33
- // "default" to the CommonJS "module.exports" for node compatibility.
34
- __defProp(target, "default", { value: mod, enumerable: true }) ,
35
- mod
36
- ));
37
-
38
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__43fc91a315b32f908dbbc4137dbe8c2e/node_modules/tsup/assets/cjs_shims.js
39
- var init_cjs_shims = __esm({
40
- "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__43fc91a315b32f908dbbc4137dbe8c2e/node_modules/tsup/assets/cjs_shims.js"() {
41
- }
42
- });
3
+ var path = require('path');
4
+ var url = require('url');
43
5
 
44
- // ../../node_modules/.pnpm/@pnpm+plugin-esm-node-path@0.1.2/node_modules/@pnpm/plugin-esm-node-path/pnpmfile.cjs
45
- var require_pnpmfile = __commonJS({
46
- "../../node_modules/.pnpm/@pnpm+plugin-esm-node-path@0.1.2/node_modules/@pnpm/plugin-esm-node-path/pnpmfile.cjs"(exports$1, module) {
47
- init_cjs_shims();
48
- var path = __require("path");
49
- var { pathToFileURL } = __require("url");
50
- module.exports = {
51
- hooks: {
52
- updateConfig: (config) => {
53
- const loaderPath = path.resolve(__dirname, "esm_loader.mjs");
54
- const loaderUrl = pathToFileURL(loaderPath).href;
55
- const baseUrl = pathToFileURL(path.resolve("./")).href;
56
- const registrationCode = `import{register}from'node:module';register('${loaderUrl}','${baseUrl}');`;
57
- const importFlag = `--import=data:text/javascript,${encodeURIComponent(registrationCode)}`;
58
- config.extraEnv.NODE_OPTIONS = `${process.env.NODE_OPTIONS ? `${process.env.NODE_OPTIONS} ` : ""}${importFlag}`;
59
- return config;
60
- }
61
- }
62
- };
63
- }
64
- });
6
+ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
65
7
 
66
- // src/pnpmfile.ts
67
- init_cjs_shims();
68
- var import_plugin_esm_node_path = __toESM(require_pnpmfile());
8
+ var path__default = /*#__PURE__*/_interopDefault(path);
69
9
 
70
10
  // ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
71
- init_cjs_shims();
72
11
  function isPlainObject(value) {
73
12
  if (value === null || typeof value !== "object") {
74
13
  return false;
@@ -123,8 +62,6 @@ function createDefu(merger) {
123
62
  );
124
63
  }
125
64
  var defu = createDefu();
126
-
127
- // src/pnpmfile.ts
128
65
  var pnpmfile_default = {
129
66
  hooks: {
130
67
  updateConfig(config) {
@@ -140,7 +77,7 @@ var pnpmfile_default = {
140
77
  catalogMode: "prefer",
141
78
  cleanupUnusedCatalogs: true,
142
79
  linkWorkspacePackages: true,
143
- minimumReleaseAge: 1400,
80
+ minimumReleaseAge: 800,
144
81
  minimumReleaseAgeExclude: [
145
82
  "@storm-software/*",
146
83
  "@stryke/*",
@@ -148,14 +85,15 @@ var pnpmfile_default = {
148
85
  "powerlines",
149
86
  "@earthquake/*",
150
87
  "earthquake"
151
- ],
152
- trustPolicy: "no-downgrade",
153
- trustPolicyExclude: ["semver@6.3.1"]
88
+ ]
154
89
  });
155
90
  if (result.hoistPattern?.length === 1 && result.hoistPattern[0] === "*") {
156
91
  result.hoistPattern = [];
157
92
  }
158
- return import_plugin_esm_node_path.default.hooks.updateConfig(result);
93
+ config.extraEnv.NODE_OPTIONS = `${process.env.NODE_OPTIONS ? `${process.env.NODE_OPTIONS} ` : ""}--import=data:text/javascript,${encodeURIComponent(
94
+ `import{register}from'node:module';register('${url.pathToFileURL(path__default.default.resolve(__dirname, "esm_loader.mjs")).href}','${url.pathToFileURL(path__default.default.resolve("./")).href}');`
95
+ )}`;
96
+ return config;
159
97
  },
160
98
  readPackage(pkg) {
161
99
  for (const [devDepName, devDepRange] of Object.entries(