@mgamadeus/ddd-web 0.17.0 → 0.17.1

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/CHANGELOG.md +15 -0
  2. package/README.md +5 -0
  3. package/package.json +17 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.17.1
4
+
5
+ ### Fixed
6
+ - A CommonJS script that loads code importing `@mgamadeus/ddd-web/contract` no longer fails with
7
+ `ERR_PACKAGE_PATH_NOT_EXPORTED`: the entries without runtime dependencies (`/contract`, `/query`, `/auth`,
8
+ `/fetch-api-request`, `/issues`, `/issues/browser`, `/issues/node`, `/issues/wire`) have a `default` condition on
9
+ their ES module build, so `require()` loads them on Node ≥ 20.19 / ≥ 22.12 (require of an ES module; no entry uses
10
+ top-level await). On an older Node 20 the error is now `ERR_REQUIRE_ESM`.
11
+ - No CommonJS build: one module instance per entry, no dual-package state. `/api` (RTK Query peer dependency),
12
+ `/vite` and `/codegen` stay import-only.
13
+
14
+ ### Tests
15
+ - The consumer check requires every entry with a `default` condition from a CommonJS script against the packed
16
+ tarball (`test/consumer/smoke-require.cjs`); a manifest test pins which entries are requirable.
17
+
3
18
  ## 0.17.0
4
19
 
5
20
  ### Changed
package/README.md CHANGED
@@ -54,6 +54,11 @@ Subpaths: `@mgamadeus/ddd-web/codegen`, `/query`, `/api`, `/auth`, `/contract`,
54
54
  (pages whose global `Request` is not the Fetch API's, e.g. MooTools or Prototype: `dddFetchApiRequestPlugin()`) and
55
55
  `/issues`, `/issues/browser`, `/issues/node`, `/issues/wire` (client errors, below).
56
56
 
57
+ The package is an ES module. A CommonJS script may `require()` the entries without runtime dependencies — `/contract`,
58
+ `/query`, `/auth`, `/fetch-api-request`, `/issues`, `/issues/browser`, `/issues/node`, `/issues/wire` — on Node
59
+ ≥ 20.19 or ≥ 22.12 (Node's require of an ES module; none of them uses top-level await). `/api` (RTK Query), `/vite`
60
+ and `/codegen` are import-only.
61
+
57
62
  ### File downloads
58
63
 
59
64
  Endpoints whose 2xx responses are files (`application/octet-stream`, `application/zip`, `application/pdf`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mgamadeus/ddd-web",
3
- "version": "0.17.0",
3
+ "version": "0.17.1",
4
4
  "description": "TypeScript web client for backends built with mgamadeus/ddd, the DDD entity framework for Symfony and Doctrine (Composer/Packagist). Generates a typed RTK Query SDK from the backend's OpenAPI document, builds DDD QueryOptions (filters, orderBy, expand, select, paging) and handles JWT auth with token refresh.",
5
5
  "keywords": [
6
6
  "ddd",
@@ -31,11 +31,13 @@
31
31
  "exports": {
32
32
  "./contract": {
33
33
  "types": "./dist/contract/index.d.ts",
34
- "import": "./dist/contract/index.js"
34
+ "import": "./dist/contract/index.js",
35
+ "default": "./dist/contract/index.js"
35
36
  },
36
37
  "./query": {
37
38
  "types": "./dist/query/index.d.ts",
38
- "import": "./dist/query/index.js"
39
+ "import": "./dist/query/index.js",
40
+ "default": "./dist/query/index.js"
39
41
  },
40
42
  "./api": {
41
43
  "types": "./dist/api/index.d.ts",
@@ -43,27 +45,33 @@
43
45
  },
44
46
  "./auth": {
45
47
  "types": "./dist/auth/index.d.ts",
46
- "import": "./dist/auth/index.js"
48
+ "import": "./dist/auth/index.js",
49
+ "default": "./dist/auth/index.js"
47
50
  },
48
51
  "./fetch-api-request": {
49
52
  "types": "./dist/fetch-api-request/index.d.ts",
50
- "import": "./dist/fetch-api-request/index.js"
53
+ "import": "./dist/fetch-api-request/index.js",
54
+ "default": "./dist/fetch-api-request/index.js"
51
55
  },
52
56
  "./issues": {
53
57
  "types": "./dist/issues/index.d.ts",
54
- "import": "./dist/issues/index.js"
58
+ "import": "./dist/issues/index.js",
59
+ "default": "./dist/issues/index.js"
55
60
  },
56
61
  "./issues/browser": {
57
62
  "types": "./dist/issues/browser/index.d.ts",
58
- "import": "./dist/issues/browser/index.js"
63
+ "import": "./dist/issues/browser/index.js",
64
+ "default": "./dist/issues/browser/index.js"
59
65
  },
60
66
  "./issues/node": {
61
67
  "types": "./dist/issues/node/index.d.ts",
62
- "import": "./dist/issues/node/index.js"
68
+ "import": "./dist/issues/node/index.js",
69
+ "default": "./dist/issues/node/index.js"
63
70
  },
64
71
  "./issues/wire": {
65
72
  "types": "./dist/issues/wire/index.d.ts",
66
- "import": "./dist/issues/wire/index.js"
73
+ "import": "./dist/issues/wire/index.js",
74
+ "default": "./dist/issues/wire/index.js"
67
75
  },
68
76
  "./vite": {
69
77
  "types": "./dist/vite/index.d.ts",