|
13 | 13 | "type": "git", |
14 | 14 | "url": "git://github.com/SocketDev/socket-sdk-js.git" |
15 | 15 | }, |
16 | | - "main": "./dist/index.js", |
17 | | - "module": "./dist/esm/index.js", |
18 | | - "types": "./dist/index.d.ts", |
| 16 | + "type": "module", |
| 17 | + "exports": { |
| 18 | + ".": { |
| 19 | + "node": { |
| 20 | + "module-sync": { |
| 21 | + "types": "./dist/index.d.mts", |
| 22 | + "default": "./dist/index.js" |
| 23 | + }, |
| 24 | + "default": { |
| 25 | + "types": "./dist/index.d.cts", |
| 26 | + "default": "./dist/index.cjs" |
| 27 | + } |
| 28 | + }, |
| 29 | + "default": { |
| 30 | + "types": "./dist/index.d.mts", |
| 31 | + "default": "./dist/index.js" |
| 32 | + } |
| 33 | + }, |
| 34 | + "./dist/index.cjs": { |
| 35 | + "types": "./dist/index.d.cts", |
| 36 | + "default": "./dist/index.cjs" |
| 37 | + }, |
| 38 | + "./dist/index.d.cts": "./dist/index.d.cts", |
| 39 | + "./dist/index.d.mts": "./dist/index.d.mts", |
| 40 | + "./package.json": "./package.json" |
| 41 | + }, |
19 | 42 | "scripts": { |
20 | | - "build": "npm run clean && run-p -c --aggregate-output build:*", |
| 43 | + "build": "npm run clean && run-p -c --aggregate-output build:* && run-p -c --aggregate-output build:clean:*", |
21 | 44 | "build:cjs": "tsc", |
22 | 45 | "build:esm": "tsc -p tsconfig.esm.json", |
| 46 | + "build:clean:cjs": "node scripts/rename-dist-cjs-files.mjs", |
| 47 | + "build:clean:esm": "node scripts/rename-dist-esm-files.mjs", |
23 | 48 | "check": "run-p -c --aggregate-output check:*", |
24 | 49 | "check:lint": "eslint --report-unused-disable-directives .", |
25 | 50 | "check:lint:fix": "npm run check:lint -- --fix", |
|
29 | 54 | "coverage:type": "type-coverage --detail", |
30 | 55 | "ci-test": "run-s build test:*", |
31 | 56 | "clean": "run-p clean:*", |
| 57 | + "clean:dist": "del-cli 'dist'", |
32 | 58 | "clean:declarations": "del-cli '*.d.ts' '!api*.d.ts'", |
33 | 59 | "fix": "run-s lint:fix check:lint:fix", |
34 | | - "generate-sdk:0-prettify": "node scripts/prettify-base-json.js", |
35 | | - "generate-sdk:1-generate": "node scripts/generate-types.js > types/api.d.ts", |
| 60 | + "generate-sdk:0-prettify": "node scripts/prettify-base-json.mjs", |
| 61 | + "generate-sdk:1-generate": "node scripts/generate-types.mjs > types/api.d.ts", |
36 | 62 | "generate-sdk": "run-s generate-sdk:*", |
37 | 63 | "knip:dependencies": "knip --dependencies", |
38 | 64 | "knip:exports": "knip --include exports,duplicates", |
|
0 commit comments