@cldmv/wisp 1.0.8 → 1.0.9
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/README.md +9 -5
- package/dist/index.cjs +5 -4
- package/package.json +29 -18
package/README.md
CHANGED
|
@@ -14,17 +14,18 @@ Relative paths resolve from the file that calls wisp, not from wisp's own locati
|
|
|
14
14
|
|
|
15
15
|
## ✨ What's New
|
|
16
16
|
|
|
17
|
-
### Latest: v1.0.
|
|
17
|
+
### Latest: v1.0.9 (November 2026)
|
|
18
18
|
|
|
19
|
-
- **
|
|
20
|
-
-
|
|
19
|
+
- **Node.js support unchanged** — `engines.node` stays `>=16.0.0`; the CommonJS entry's `ERR_REQUIRE_ESM` message now names the `require()` range, `^20.19.0` or `>=22.13.0`. Developing wisp needs Node.js 22.22.0, declared in `devEngines` so it never applies to consumers. JSON loading is unchanged ([#65](https://github.com/CLDMV/wisp/pull/65), [#70](https://github.com/CLDMV/wisp/pull/70)).
|
|
20
|
+
- **CommonJS entry renamed in source** — `src/cjs-shim.cjs` is now `src/index.cjs`, matching the published `dist/index.cjs`, with new tests that relative paths still resolve against the calling file through the CommonJS entry ([#65](https://github.com/CLDMV/wisp/pull/65)).
|
|
21
|
+
- [View full v1.0.9 Changelog](https://github.com/CLDMV/wisp/blob/master/docs/changelog/v1/v1.0.9.md)
|
|
21
22
|
|
|
22
23
|
### Recent Releases
|
|
23
24
|
|
|
25
|
+
- **v1.0.8** (October 2026) — Development-dependency patch (`@types/node` 26.6.4); no runtime change ([Changelog](https://github.com/CLDMV/wisp/blob/master/docs/changelog/v1/v1.0.8.md))
|
|
24
26
|
- **v1.0.7** (October 2026) — `require()` works inside esbuild and webpack bundles and fails clearly on older Node.js; a failed `validate` throws instead of loading the `fallback`; the package is now built into `dist/` and relicensed under Apache-2.0 ([Changelog](https://github.com/CLDMV/wisp/blob/master/docs/changelog/v1/v1.0.7.md))
|
|
25
27
|
- **v1.0.6** (October 2026) — Uniform file headers via `@cldmv/fix-headers`, a CI fix and a development-dependency security update; no runtime change ([Changelog](https://github.com/CLDMV/wisp/blob/master/docs/changelog/v1/v1.0.6.md))
|
|
26
28
|
- **v1.0.5** (October 2026) — First npm release since v1.0.1; TypeScript 6, chai 6 and `@types/node` 26 for development, v4 workflow syncs; no runtime change ([Changelog](https://github.com/CLDMV/wisp/blob/master/docs/changelog/v1/v1.0.5.md))
|
|
27
|
-
- **v1.0.4** (September 2026) — Thrown errors now carry the original error as `cause`; ESLint wired up; mocha 12 ([Changelog](https://github.com/CLDMV/wisp/blob/master/docs/changelog/v1/v1.0.4.md))
|
|
28
29
|
|
|
29
30
|
📚 **For complete version history and detailed release notes, see the [docs/changelog/](https://github.com/CLDMV/wisp/tree/master/docs/changelog/) folder.**
|
|
30
31
|
|
|
@@ -57,7 +58,8 @@ Relative paths resolve from the file that calls wisp, not from wisp's own locati
|
|
|
57
58
|
### Requirements
|
|
58
59
|
|
|
59
60
|
- **Node.js 16 or higher** for `import` (ESM).
|
|
60
|
-
- **`require()` needs Node.js ^20.19.0 or >=22.
|
|
61
|
+
- **`require()` needs Node.js ^20.19.0 or >=22.13.0** (synchronous `require(esm)`). On older Node.js versions, load the package with `import()` instead.
|
|
62
|
+
- **Developing wisp needs Node.js 22.22.0 or later** (enforced via `devEngines`), while the package itself runs on Node.js 16+.
|
|
61
63
|
|
|
62
64
|
### Install
|
|
63
65
|
|
|
@@ -222,6 +224,8 @@ try {
|
|
|
222
224
|
|
|
223
225
|
Contributions are welcome — open an [issue](https://github.com/CLDMV/wisp/issues) or a pull request.
|
|
224
226
|
|
|
227
|
+
In a checkout, the package name resolves to the built `dist/` (run `npm run build` first). The `wisp-dev` export condition switches it to the source in `src/`: `src/index.mjs` for `import`, `src/index.cjs` for `require()`. Pass it per command (`node --conditions=wisp-dev app.mjs`) or once per shell (`export NODE_OPTIONS=--conditions=wisp-dev`). The test scripts set it themselves.
|
|
228
|
+
|
|
225
229
|
[![Contributors]][contributors_url] [![Sponsor shinrai]][sponsor_url]
|
|
226
230
|
|
|
227
231
|
---
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
3
|
* @Project: @cldmv/wisp
|
|
4
|
-
* @Filename: /src/
|
|
4
|
+
* @Filename: /src/index.cjs
|
|
5
5
|
* @Date: 2025-10-30T15:06:33-07:00 (1761861993)
|
|
6
6
|
* @Author: Nate Corcoran <CLDMV>
|
|
7
7
|
* @Email: <Shinrai@users.noreply.github.com>
|
|
8
8
|
* -----
|
|
9
9
|
* @Last modified by: Nate Corcoran <CLDMV> (Shinrai@users.noreply.github.com)
|
|
10
|
-
* @Last modified time: 2026-
|
|
10
|
+
* @Last modified time: 2026-11-01T16:21:38-08:00 (1793578898)
|
|
11
11
|
* -----
|
|
12
12
|
* @Copyright: Copyright (c) 2013-2026 Catalyzed Motivation Inc. All rights reserved.
|
|
13
13
|
*
|
|
@@ -35,10 +35,11 @@
|
|
|
35
35
|
|
|
36
36
|
// This is a thin wrapper: it loads ./index.mjs through Node's synchronous require(esm).
|
|
37
37
|
// Node.js versions without require(esm) would fail with a bare ERR_REQUIRE_ESM, so fail
|
|
38
|
-
// early with a message that says what to do instead.
|
|
38
|
+
// early with a message that says what to do instead. The floor is 22.13 rather than 22.12
|
|
39
|
+
// because Node.js 22.12 has require(esm) but prints an ExperimentalWarning on every use.
|
|
39
40
|
if (!process.features?.require_module) {
|
|
40
41
|
const error = new Error(
|
|
41
|
-
`@cldmv/wisp: require() needs Node.js ^20.19.0 or >=22.
|
|
42
|
+
`@cldmv/wisp: require() needs Node.js ^20.19.0 or >=22.13.0 (this is ${process.version}). On older Node.js, load the package with import() instead.`
|
|
42
43
|
);
|
|
43
44
|
error.code = "ERR_REQUIRE_ESM";
|
|
44
45
|
throw error;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cldmv/wisp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Version-agnostic JSON importing for Node.js with fallback handling and caller path resolution.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"wisp-dev": {
|
|
12
12
|
"types": "./types/index.d.mts",
|
|
13
13
|
"import": "./src/index.mjs",
|
|
14
|
-
"require": "./src/
|
|
14
|
+
"require": "./src/index.cjs"
|
|
15
15
|
},
|
|
16
16
|
"types": "./types/index.d.mts",
|
|
17
17
|
"import": "./dist/index.mjs",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"prepack": "npm run types:build && npm run build",
|
|
25
25
|
"prepare": "node -e \"import('./.githooks/install.mjs').catch(()=>{})\"",
|
|
26
26
|
"test": "node tests/run-vitest.mjs && npm run test:cjs",
|
|
27
|
-
"test:cjs": "npm run build && node --test tests/cjs/entry.test.cjs tests/bundle/caller-resolution.test.mjs",
|
|
27
|
+
"test:cjs": "npm run build && node --conditions=wisp-dev --test tests/cjs/entry.test.cjs tests/bundle/caller-resolution.test.mjs",
|
|
28
28
|
"test:watch": "vitest --config .configs/vitest.config.mjs",
|
|
29
29
|
"coverage": "node tests/run-vitest.mjs --coverage-quiet && npm run test:cjs",
|
|
30
30
|
"ci:coverage": "npm run coverage",
|
|
@@ -82,24 +82,28 @@
|
|
|
82
82
|
"LICENSE"
|
|
83
83
|
],
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@cldmv/configs": "^1.
|
|
86
|
-
"@cldmv/eslint-plugin-jsonv": "^1.0.
|
|
87
|
-
"@cldmv/fix-headers": "^2.2.
|
|
88
|
-
"@cldmv/jsonv": "^1.1.
|
|
89
|
-
"@cldmv/prettier-plugin-jsonv": "^1.1.
|
|
90
|
-
"@cldmv/vitest-runner": "^1.5.
|
|
91
|
-
"@eslint/css": "^2.0.
|
|
85
|
+
"@cldmv/configs": "^1.3.0",
|
|
86
|
+
"@cldmv/eslint-plugin-jsonv": "^1.0.17",
|
|
87
|
+
"@cldmv/fix-headers": "^2.2.4",
|
|
88
|
+
"@cldmv/jsonv": "^1.1.5",
|
|
89
|
+
"@cldmv/prettier-plugin-jsonv": "^1.1.4",
|
|
90
|
+
"@cldmv/vitest-runner": "^1.5.6",
|
|
91
|
+
"@eslint/css": "^2.0.1",
|
|
92
92
|
"@eslint/js": "^10.0.1",
|
|
93
|
-
"@eslint/json": "^2.1.
|
|
93
|
+
"@eslint/json": "^2.1.1",
|
|
94
94
|
"@eslint/markdown": "^8.0.3",
|
|
95
|
-
"@types/node": "^26.6.
|
|
96
|
-
"@vitest/coverage-v8": "^5.0.
|
|
97
|
-
"eslint": "^10.
|
|
98
|
-
"globals": "^17.
|
|
99
|
-
"prettier": "^3.9.
|
|
100
|
-
"tsup": "^
|
|
95
|
+
"@types/node": "^26.6.6",
|
|
96
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
97
|
+
"eslint": "^10.14.0",
|
|
98
|
+
"globals": "^17.14.0",
|
|
99
|
+
"prettier": "^3.9.10",
|
|
100
|
+
"tsup": "^9.0.0",
|
|
101
101
|
"typescript": "^6.0.3",
|
|
102
|
-
"vitest": "^5.0.
|
|
102
|
+
"vitest": "^5.0.5"
|
|
103
|
+
},
|
|
104
|
+
"overrides": {
|
|
105
|
+
"katex": ">=0.19.1 <1.0.0",
|
|
106
|
+
"minimatch": "^11.0.3"
|
|
103
107
|
},
|
|
104
108
|
"publishConfig": {
|
|
105
109
|
"access": "public"
|
|
@@ -107,5 +111,12 @@
|
|
|
107
111
|
"engines": {
|
|
108
112
|
"node": ">=16.0.0"
|
|
109
113
|
},
|
|
114
|
+
"devEngines": {
|
|
115
|
+
"runtime": {
|
|
116
|
+
"name": "node",
|
|
117
|
+
"version": ">=22.22.0",
|
|
118
|
+
"onFail": "error"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
110
121
|
"sideEffects": false
|
|
111
122
|
}
|