|
9 | 9 | "main": "./index.js", |
10 | 10 | "types": "./index.d.ts", |
11 | 11 | "typesVersions": { |
12 | | - "<4.5": { |
| 12 | + ">=4.5": { |
13 | 13 | "esm/*": [ |
14 | | - "ts3.4/*" |
| 14 | + "esm/*" |
15 | 15 | ], |
16 | 16 | "*": [ |
17 | | - "ts3.4/*" |
| 17 | + "*" |
| 18 | + ] |
| 19 | + }, |
| 20 | + "*": { |
| 21 | + "esm/*": [ |
| 22 | + "ts_version_4.5_and_above_is_required.d.ts" |
| 23 | + ], |
| 24 | + "*": [ |
| 25 | + "ts_version_4.5_and_above_is_required.d.ts" |
18 | 26 | ] |
19 | 27 | } |
20 | 28 | }, |
|
65 | 73 | "build:react_utils": "rollup -c --config-react_utils", |
66 | 74 | "build:macro": "rollup -c --config-macro", |
67 | 75 | "build:macro_vite": "rollup -c --config-macro_vite", |
68 | | - "postbuild": "yarn patch-d-ts && yarn copy && yarn patch-macro-vite && yarn patch-ts3.4 && yarn patch-esm-ts", |
| 76 | + "postbuild": "yarn patch-d-ts && yarn copy && yarn patch-macro-vite && yarn patch-old-ts && yarn patch-esm-ts", |
69 | 77 | "prettier": "prettier '*.{js,json,md}' '{src,tests,docs}/**/*.{ts,tsx,md,mdx}' --write", |
70 | 78 | "prettier:ci": "prettier '*.{js,json,md}' '{src,tests,docs}/**/*.{ts,tsx,md,mdx}' --list-different", |
71 | 79 | "eslint": "eslint --no-eslintrc --c .eslintrc.json --fix '*.{js,json,ts}' '{src,tests}/**/*.{ts,tsx}'", |
|
74 | 82 | "test": "vitest --ui --coverage", |
75 | 83 | "test:ci": "vitest", |
76 | 84 | "patch-d-ts": "node -e \"var {entries}=require('./rollup.config.js');require('shelljs').find('dist/**/*.d.ts').forEach(f=>{entries.forEach(({find,replacement})=>require('shelljs').sed('-i',new RegExp(' from \\''+find.source.slice(0,-1)+'\\';$'),' from \\''+replacement+'\\';',f));require('shelljs').sed('-i',/ from '(\\.[^']+)\\.ts';$/,' from \\'\\$1\\';',f)})\"", |
77 | | - "copy": "shx cp -r dist/src/* dist/esm && shx cp -r dist/src/* dist && shx rm -rf dist/{src,tests} && downlevel-dts dist dist/ts3.4 && shx cp package.json readme.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.prettier=undefined;\"", |
78 | | - "patch-macro-vite": "shx cp dist/esm/macro/vite.d.ts dist/macro/ && shx cp dist/ts3.4/esm/macro/vite.d.ts dist/ts3.4/macro/", |
79 | | - "patch-ts3.4": "node -e \"require('shelljs').find('dist/ts3.4/**/*.d.ts').forEach(f=>{require('fs').appendFileSync(f,'declare type Awaited<T> = T extends Promise<infer V> ? V : T;');require('shelljs').sed('-i',/^declare type Snapshot<T> =/,'declare type Snapshot<T> = T extends SnapshotIgnore ? T : T extends Promise<unknown> ? Awaited<T> : T extends object ? { readonly [K in keyof T]: Snapshot2<T[K]> } : T; declare type Snapshot2<T> = T extends SnapshotIgnore ? T : T extends Promise<unknown> ? Awaited<T> : T extends object ? { readonly [K in keyof T]: T[K] } : T;;declare type _Snapshot<T> =',f)})\"", |
| 85 | + "copy": "shx cp -r dist/src/* dist/esm && shx cp -r dist/src/* dist && shx rm -rf dist/{src,tests} && shx cp package.json readme.md LICENSE dist && json -I -f dist/package.json -e \"this.private=false; this.devDependencies=undefined; this.optionalDependencies=undefined; this.scripts=undefined; this.prettier=undefined;\"", |
| 86 | + "patch-macro-vite": "shx cp dist/esm/macro/vite.d.ts dist/macro/", |
| 87 | + "patch-old-ts": "shx touch dist/ts_version_4.5_and_above_is_required.d.ts", |
80 | 88 | "patch-esm-ts": "node -e \"require('shelljs').find('dist/esm/**/*.d.ts').forEach(f=>{var f2=f.replace(/\\.ts$/,'.mts');require('fs').copyFileSync(f,f2);require('shelljs').sed('-i',/ from '(\\.[^']+)';$/,' from \\'\\$1.mjs\\';',f2);require('shelljs').sed('-i',/^declare module '(\\.[^']+)'/,'declare module \\'\\$1.mjs\\'',f2)})\"" |
81 | 89 | }, |
82 | 90 | "engines": { |
|
143 | 151 | "babel-plugin-macros": "^3.1.0", |
144 | 152 | "babel-plugin-tester": "10.1.0", |
145 | 153 | "concurrently": "^8.2.2", |
146 | | - "downlevel-dts": "^0.11.0", |
147 | 154 | "esbuild": "^0.19.5", |
148 | 155 | "eslint": "^8.52.0", |
149 | 156 | "eslint-config-prettier": "^9.0.0", |
|
0 commit comments