@cldmv/wisp 1.0.7 → 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.
Files changed (3) hide show
  1. package/README.md +10 -8
  2. package/dist/index.cjs +5 -4
  3. package/package.json +29 -18
package/README.md CHANGED
@@ -14,19 +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.7 (October 2026)
17
+ ### Latest: v1.0.9 (November 2026)
18
18
 
19
- - **`require()` works in bundles and fails clearly on older Node.js** — `index.cjs` now loads the ESM entry with a plain `require("./index.mjs")` instead of `createRequire(__filename)`, so `require("@cldmv/wisp")` survives esbuild and webpack bundling. On Node.js versions without synchronous `require(esm)`, where `require()` never worked, it now throws an `ERR_REQUIRE_ESM` error that names the supported versions (`^20.19.0` or `>=22.12.0`) and points to `import()` ([#30](https://github.com/CLDMV/wisp/pull/30)).
20
- - **A failed validation throws instead of loading the fallback** — `fallback` is now used only when the primary file cannot be read or parsed; a `validate` rejection is reported as an error, and a fallback that also fails no longer loops forever ([#35](https://github.com/CLDMV/wisp/pull/35)). On the `import()` paths, a `validate` rejection now throws the validation error once instead of `Unsupported type`, and `reviver` / `validate` on a module without a default export receive a plain-object copy of its exports instead of failing ([#41](https://github.com/CLDMV/wisp/pull/41)). The package is also relicensed under Apache-2.0 ([#34](https://github.com/CLDMV/wisp/pull/34)).
21
- - **Built package in `dist/`** — the published package is now bundled with tsup into `dist/index.mjs`, with `dist/index.cjs` as a thin `require()` wrapper, and ships only `dist/`, `types/`, `README.md` and `LICENSE`. `import` and `require()` of `@cldmv/wisp` work exactly as before; code that loaded the old root `index.mjs` / `index.cjs` or `src/` files by path must use the package specifier ([#40](https://github.com/CLDMV/wisp/pull/40)). The test suite now runs on `@cldmv/vitest-runner` with 100% coverage ([#37](https://github.com/CLDMV/wisp/pull/37)).
22
- - [View full v1.0.7 Changelog](https://github.com/CLDMV/wisp/blob/master/docs/changelog/v1/v1.0.7.md)
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)
23
22
 
24
23
  ### Recent Releases
25
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))
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))
26
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))
27
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))
28
- - **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))
29
- - **v1.0.3** (August 2026) — Development-dependency security update (`picomatch`); no runtime change ([Changelog](https://github.com/CLDMV/wisp/blob/master/docs/changelog/v1/v1.0.3.md))
30
29
 
31
30
  📚 **For complete version history and detailed release notes, see the [docs/changelog/](https://github.com/CLDMV/wisp/tree/master/docs/changelog/) folder.**
32
31
 
@@ -59,7 +58,8 @@ Relative paths resolve from the file that calls wisp, not from wisp's own locati
59
58
  ### Requirements
60
59
 
61
60
  - **Node.js 16 or higher** for `import` (ESM).
62
- - **`require()` needs Node.js ^20.19.0 or >=22.12.0** (synchronous `require(esm)`). On older Node.js versions, load the package with `import()` instead.
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+.
63
63
 
64
64
  ### Install
65
65
 
@@ -224,6 +224,8 @@ try {
224
224
 
225
225
  Contributions are welcome — open an [issue](https://github.com/CLDMV/wisp/issues) or a pull request.
226
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
+
227
229
  [![Contributors]][contributors_url] [![Sponsor shinrai]][sponsor_url]
228
230
 
229
231
  ---
package/dist/index.cjs CHANGED
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  *
3
3
  * @Project: @cldmv/wisp
4
- * @Filename: /src/cjs-shim.cjs
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-03T19:34:10-07:00 (1791081250)
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.12.0 (this is ${process.version}). On older Node.js, load the package with import() instead.`
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.7",
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/cjs-shim.cjs"
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.2.4",
86
- "@cldmv/eslint-plugin-jsonv": "^1.0.15",
87
- "@cldmv/fix-headers": "^2.2.0",
88
- "@cldmv/jsonv": "^1.1.3",
89
- "@cldmv/prettier-plugin-jsonv": "^1.1.3",
90
- "@cldmv/vitest-runner": "^1.5.3",
91
- "@eslint/css": "^2.0.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.0",
93
+ "@eslint/json": "^2.1.1",
94
94
  "@eslint/markdown": "^8.0.3",
95
- "@types/node": "^26.6.2",
96
- "@vitest/coverage-v8": "^5.0.3",
97
- "eslint": "^10.12.0",
98
- "globals": "^17.13.0",
99
- "prettier": "^3.9.9",
100
- "tsup": "^8.5.1",
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.3"
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
  }