Skip to content

Commit

Permalink
Merge branch 'main' into issue-2931
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi authored Jan 14, 2025
2 parents 8bd0146 + efb4573 commit 29596f2
Show file tree
Hide file tree
Showing 4 changed files with 350 additions and 289 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
"sideEffects": false,
"scripts": {
"prebuild": "shx rm -rf dist",
"build": "pnpm run prebuild && pnpm run '/^build:.*/' && pnpm run postbuild",
"build-watch": "pnpm run '/^build:.*/' --watch",
"build": "pnpm run prebuild && pnpm run \"/^build:.*/\" && pnpm run postbuild",
"build-watch": "pnpm run \"/^build:.*/\" --watch",
"build:base": "rollup -c",
"build:utils": "rollup -c --config-utils",
"build:babel:plugin-debug-label": "rollup -c --config-babel_plugin-debug-label",
Expand All @@ -73,15 +73,15 @@
"build:react": "rollup -c --config-react --client-only",
"build:react:utils": "rollup -c --config-react_utils --client-only",
"postbuild": "pnpm patch-d-ts && pnpm copy && pnpm patch-ts3.8 && pnpm patch-old-ts && pnpm patch-esm-ts && pnpm patch-readme",
"fix:format": "prettier '*.{js,json,md}' '{src,tests,benchmarks,docs}/**/*.{ts,tsx,md,mdx}' --write",
"fix:format": "prettier \"*.{js,json,md}\" \"{src,tests,benchmarks,docs}/**/*.{ts,tsx,md,mdx}\" --write",
"fix:lint": "eslint . --fix",
"test": "pnpm run '/^test:.*/'",
"test:format": "prettier '*.{js,json,md}' '{src,tests,benchmarks,docs}/**/*.{ts,tsx,md,mdx}' --list-different",
"test": "pnpm run \"/^test:.*/\"",
"test:format": "prettier \"*.{js,json,md}\" \"{src,tests,benchmarks,docs}/**/*.{ts,tsx,md,mdx}\" --list-different",
"test:types": "tsc --noEmit",
"test:lint": "eslint .",
"test:spec": "vitest run",
"test-build:spec": "vitest run",
"patch-d-ts": "node --input-type=module -e \"import { entries } from './rollup.config.mjs'; import shelljs from 'shelljs'; const { find, sed } = shelljs; find('dist/**/*.d.ts').forEach(f => { entries.forEach(({ find, replacement }) => sed('-i', new RegExp(' from \\'' + find.source.slice(0, -1) + '\\';$'), ' from \\'' + replacement + '\\';', f)); sed('-i', / from '(\\.[^']+)\\.ts';$/, ' from \\'\\$1\\';', f); });\"",
"patch-d-ts": "node --input-type=module -e \"import { entries } from './rollup.config.mjs'; import shelljs from 'shelljs'; const { find, sed } = shelljs; find('dist/**/*.d.ts').forEach(f => { entries.forEach(({ find, replacement }) => { sed('-i', new RegExp(' from \\'' + find.source.slice(0, -1) + '\\';$'), ' from \\'' + replacement + '\\';', f); }); sed('-i', / from '(\\.[^']+)\\.ts';$/, ' from \\'\\$1\\';', f); });\"",
"copy": "shx cp -r dist/src/* dist/esm && shx cp -r dist/src/* dist && shx rm -rf dist/src && shx rm -rf dist/{src,tests} && downlevel-dts dist dist/ts3.8 --to=3.8 && 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;\"",
"patch-ts3.8": "node -e \"require('shelljs').find('dist/ts3.8/**/*.d.ts').forEach(f=>require('fs').appendFileSync(f,'declare type Awaited<T> = T extends Promise<infer V> ? V : T;'))\"",
"patch-old-ts": "shx touch dist/ts_version_3.8_and_above_is_required.d.ts",
Expand Down
Loading

0 comments on commit 29596f2

Please sign in to comment.