|
2 | 2 | "name": "json-schema-to-typescript", |
3 | 3 | "version": "14.0.5", |
4 | 4 | "description": "compile json schema to typescript typings", |
5 | | - "main": "dist/src/index.js", |
| 5 | + "main": "dist-cjs/src/index.js", |
| 6 | + "exports": { |
| 7 | + "require": "./dist-cjs/src/index.js", |
| 8 | + "import": "./dist-esm/src/index.js" |
| 9 | + }, |
6 | 10 | "bin": { |
7 | | - "json2ts": "dist/src/cli.js" |
| 11 | + "json2ts": "dist-esm/src/cli.js" |
8 | 12 | }, |
9 | | - "typings": "dist/src/index.d.ts", |
| 13 | + "type": "module", |
| 14 | + "typings": "dist-esm/src/index.d.ts", |
10 | 15 | "engines": { |
11 | 16 | "node": ">=16.0.0" |
12 | 17 | }, |
13 | 18 | "scripts": { |
14 | 19 | "build": "npm run lint && npm run clean && npm run build:browser && npm run build:server", |
15 | | - "build:browser": "browserify src/index.ts -s jstt -p tsify > dist/bundle.js", |
16 | | - "build:server": "tsc -d", |
17 | | - "clean": "shx rm -rf dist && mkdir dist", |
| 20 | + "build:browser": "browserify src/index.ts -s jstt -p tsify > dist-esm/bundle.js", |
| 21 | + "build:server": "tsc -p ./tsconfig.cjs.json -d && tsc -p ./tsconfig.esm.json -d", |
| 22 | + "clean": "shx rm -rf dist-cjs && shx rm -rf dist-esm", |
18 | 23 | "format": "prettier \"{src,test}/*.ts\" --write", |
19 | 24 | "format-check": "prettier \"{src,test}/*.ts\" --check", |
20 | 25 | "lint": "eslint src/*.ts test/*.ts", |
|
23 | 28 | "stresstest": "seq 1 10 | xargs -I{} npm test", |
24 | 29 | "prepublishOnly": "npm test", |
25 | 30 | "pre-test": "npm run clean && npm run format-check && npm run build:server", |
26 | | - "watch": "tsc -w", |
| 31 | + "watch": "tsc -p ./tsconfig.esm.json -w", |
27 | 32 | "watch:test": "ava -w" |
28 | 33 | }, |
29 | 34 | "repository": { |
|
50 | 55 | "dependencies": { |
51 | 56 | "@apidevtools/json-schema-ref-parser": "^11.5.5", |
52 | 57 | "@types/json-schema": "^7.0.15", |
53 | | - "@types/lodash": "^4.17.0", |
| 58 | + "@types/lodash-es": "^4.17.12", |
54 | 59 | "cli-color": "^2.0.4", |
55 | 60 | "glob": "^10.3.12", |
56 | 61 | "is-glob": "^4.0.3", |
57 | 62 | "js-yaml": "^4.1.0", |
58 | | - "lodash": "^4.17.21", |
| 63 | + "lodash-es": "^4.17.21", |
59 | 64 | "minimist": "^1.2.8", |
60 | 65 | "mkdirp": "^3.0.1", |
61 | 66 | "node-fetch": "^3.3.2", |
|
85 | 90 | }, |
86 | 91 | "ava": { |
87 | 92 | "files": [ |
88 | | - "./dist/test/test.js" |
| 93 | + "./dist-esm/test/test.js" |
89 | 94 | ], |
90 | 95 | "snapshotDir": "./test/__snapshots__" |
91 | 96 | }, |
|
0 commit comments