pnpm-plugin-storm-software 0.1.2 → 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.2",
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": "c129c9cf24e2a0b5c79c2670b13da28bb772e0ee"
28
+ "gitHead": "d88e73ed5fbb35c211bf223ea13f759b4ae65134"
29
29
  }
package/pnpmfile.cjs CHANGED
@@ -1,81 +1,71 @@
1
1
  'use strict';
2
2
 
3
- var defu = require('defu');
3
+ var path = require('path');
4
+ var url = require('url');
4
5
 
5
6
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
6
7
 
7
- var defu__default = /*#__PURE__*/_interopDefault(defu);
8
+ var path__default = /*#__PURE__*/_interopDefault(path);
8
9
 
9
- var __create = Object.create;
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __getProtoOf = Object.getPrototypeOf;
14
- var __hasOwnProp = Object.prototype.hasOwnProperty;
15
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
16
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
17
- }) : x)(function(x) {
18
- if (typeof require !== "undefined") return require.apply(this, arguments);
19
- throw Error('Dynamic require of "' + x + '" is not supported');
20
- });
21
- var __esm = (fn, res) => function __init() {
22
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
23
- };
24
- var __commonJS = (cb, mod) => function __require2() {
25
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
26
- };
27
- var __copyProps = (to, from, except, desc) => {
28
- if (from && typeof from === "object" || typeof from === "function") {
29
- for (let key of __getOwnPropNames(from))
30
- if (!__hasOwnProp.call(to, key) && key !== except)
31
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
10
+ // ../../node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs
11
+ function isPlainObject(value) {
12
+ if (value === null || typeof value !== "object") {
13
+ return false;
32
14
  }
33
- return to;
34
- };
35
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
36
- // If the importer is in node compatibility mode or this is not an ESM
37
- // file that has been converted to a CommonJS file using a Babel-
38
- // compatible transform (i.e. "__esModule" has not been set), then set
39
- // "default" to the CommonJS "module.exports" for node compatibility.
40
- __defProp(target, "default", { value: mod, enumerable: true }) ,
41
- mod
42
- ));
43
-
44
- // ../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__43fc91a315b32f908dbbc4137dbe8c2e/node_modules/tsup/assets/cjs_shims.js
45
- var init_cjs_shims = __esm({
46
- "../../node_modules/.pnpm/tsup@8.4.0_patch_hash=751a554d775c3572381af4e7e5fa22eeda6dd6856012fb1cf521d6806eb2dc74__43fc91a315b32f908dbbc4137dbe8c2e/node_modules/tsup/assets/cjs_shims.js"() {
15
+ const prototype = Object.getPrototypeOf(value);
16
+ if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
17
+ return false;
47
18
  }
48
- });
49
-
50
- // ../../node_modules/.pnpm/@pnpm+plugin-esm-node-path@0.1.2/node_modules/@pnpm/plugin-esm-node-path/pnpmfile.cjs
51
- var require_pnpmfile = __commonJS({
52
- "../../node_modules/.pnpm/@pnpm+plugin-esm-node-path@0.1.2/node_modules/@pnpm/plugin-esm-node-path/pnpmfile.cjs"(exports$1, module) {
53
- init_cjs_shims();
54
- var path = __require("path");
55
- var { pathToFileURL } = __require("url");
56
- module.exports = {
57
- hooks: {
58
- updateConfig: (config) => {
59
- const loaderPath = path.resolve(__dirname, "esm_loader.mjs");
60
- const loaderUrl = pathToFileURL(loaderPath).href;
61
- const baseUrl = pathToFileURL(path.resolve("./")).href;
62
- const registrationCode = `import{register}from'node:module';register('${loaderUrl}','${baseUrl}');`;
63
- const importFlag = `--import=data:text/javascript,${encodeURIComponent(registrationCode)}`;
64
- config.extraEnv.NODE_OPTIONS = `${process.env.NODE_OPTIONS ? `${process.env.NODE_OPTIONS} ` : ""}${importFlag}`;
65
- return config;
66
- }
67
- }
68
- };
19
+ if (Symbol.iterator in value) {
20
+ return false;
69
21
  }
70
- });
71
-
72
- // src/pnpmfile.ts
73
- init_cjs_shims();
74
- var import_plugin_esm_node_path = __toESM(require_pnpmfile());
22
+ if (Symbol.toStringTag in value) {
23
+ return Object.prototype.toString.call(value) === "[object Module]";
24
+ }
25
+ return true;
26
+ }
27
+ function _defu(baseObject, defaults, namespace = ".", merger) {
28
+ if (!isPlainObject(defaults)) {
29
+ return _defu(baseObject, {}, namespace, merger);
30
+ }
31
+ const object = Object.assign({}, defaults);
32
+ for (const key in baseObject) {
33
+ if (key === "__proto__" || key === "constructor") {
34
+ continue;
35
+ }
36
+ const value = baseObject[key];
37
+ if (value === null || value === void 0) {
38
+ continue;
39
+ }
40
+ if (merger && merger(object, key, value, namespace)) {
41
+ continue;
42
+ }
43
+ if (Array.isArray(value) && Array.isArray(object[key])) {
44
+ object[key] = [...value, ...object[key]];
45
+ } else if (isPlainObject(value) && isPlainObject(object[key])) {
46
+ object[key] = _defu(
47
+ value,
48
+ object[key],
49
+ (namespace ? `${namespace}.` : "") + key.toString(),
50
+ merger
51
+ );
52
+ } else {
53
+ object[key] = value;
54
+ }
55
+ }
56
+ return object;
57
+ }
58
+ function createDefu(merger) {
59
+ return (...arguments_) => (
60
+ // eslint-disable-next-line unicorn/no-array-reduce
61
+ arguments_.reduce((p, c) => _defu(p, c, "", merger), {})
62
+ );
63
+ }
64
+ var defu = createDefu();
75
65
  var pnpmfile_default = {
76
66
  hooks: {
77
67
  updateConfig(config) {
78
- const result = defu__default.default(config, {
68
+ const result = defu(config, {
79
69
  enableGlobalVirtualStore: true,
80
70
  enablePrePostScripts: false,
81
71
  ignorePatchFailures: false,
@@ -87,7 +77,7 @@ var pnpmfile_default = {
87
77
  catalogMode: "prefer",
88
78
  cleanupUnusedCatalogs: true,
89
79
  linkWorkspacePackages: true,
90
- minimumReleaseAge: 1400,
80
+ minimumReleaseAge: 800,
91
81
  minimumReleaseAgeExclude: [
92
82
  "@storm-software/*",
93
83
  "@stryke/*",
@@ -95,13 +85,15 @@ var pnpmfile_default = {
95
85
  "powerlines",
96
86
  "@earthquake/*",
97
87
  "earthquake"
98
- ],
99
- trustPolicy: "no-downgrade"
88
+ ]
100
89
  });
101
90
  if (result.hoistPattern?.length === 1 && result.hoistPattern[0] === "*") {
102
91
  result.hoistPattern = [];
103
92
  }
104
- 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;
105
97
  },
106
98
  readPackage(pkg) {
107
99
  for (const [devDepName, devDepRange] of Object.entries(