@amritk/mjst 0.15.0 → 0.16.0

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 (2) hide show
  1. package/README.md +8 -0
  2. package/package.json +8 -8
package/README.md CHANGED
@@ -125,6 +125,14 @@ NodeNext `./user.js` form and runs `tsc` for you), or generate with `--import-ex
125
125
  the compile-ready form without building. `--import-ext ts` together with `--build` is rejected,
126
126
  since tsc cannot emit from `.ts` specifiers.
127
127
 
128
+ Each `index.ts` re-exports values as `const` aliases (`import { parseUser as parseUser$0 } …;
129
+ export const parseUser = parseUser$0`) rather than `export { parseUser } from './user.js'`.
130
+ The two are equivalent under ESM, but TypeScript lowers a re-export to CommonJS as an
131
+ *accessor*, so a CJS consumer calling through the barrel would pay a property getter on every
132
+ call — measurably, up to ~3.7x on the cheapest predicates. Importing from the barrel and
133
+ importing from the module directly now cost the same in both module formats, and both forms
134
+ tree-shake identically (verified against esbuild and rollup).
135
+
128
136
  > [!NOTE]
129
137
  > **Breaking change (0.9.0):** the root type is no longer always named `Document`. It is derived
130
138
  > from the schema `title`, falling back to the schema filename (`spec-plan.json` → `SpecPlan`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amritk/mjst",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Generate TypeScript parsers and type definitions from JSON Schemas.",
5
5
  "type": "module",
6
6
  "engines": {
@@ -49,13 +49,13 @@
49
49
  "./package.json": "./package.json"
50
50
  },
51
51
  "dependencies": {
52
- "@amritk/adapters": "^0.5.0",
53
- "@amritk/api": "^0.16.0",
54
- "@amritk/generate-examples": "^0.7.0",
55
- "@amritk/generate-parsers": "^0.19.5",
56
- "@amritk/generate-validators": "^0.14.0",
57
- "@amritk/helpers": "^0.16.0",
58
- "@amritk/lint": "^0.5.0",
52
+ "@amritk/adapters": "^0.5.1",
53
+ "@amritk/api": "^0.16.1",
54
+ "@amritk/generate-examples": "^0.8.0",
55
+ "@amritk/generate-parsers": "^0.20.0",
56
+ "@amritk/generate-validators": "^0.15.0",
57
+ "@amritk/helpers": "^0.17.0",
58
+ "@amritk/lint": "^0.5.1",
59
59
  "@amritk/resolve-refs": "^0.7.1",
60
60
  "@amritk/yaml": "^0.7.2",
61
61
  "fast-glob": "^3.3.2",