diff --git a/package.json b/package.json index 8f3ee391..17c3152e 100644 --- a/package.json +++ b/package.json @@ -53,8 +53,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:vanilla": "rollup -c --config-vanilla", @@ -62,14 +62,14 @@ "build:react": "rollup -c --config-react", "build:react_utils": "rollup -c --config-react_utils", "postbuild": "pnpm patch-d-ts && pnpm copy && pnpm patch-old-ts && pnpm patch-esm-ts", - "fix:format": "prettier '*.{js,json,md}' '{src,tests,docs}/**/*.{ts,tsx,md,mdx}' --write", + "fix:format": "prettier \"*.{js,json,md}\" \"{src,tests,docs}/**/*.{ts,tsx,md,mdx}\" --write", "fix:lint": "eslint . --fix", - "test": "pnpm run '/^test:.*/'", - "test:format": "prettier '*.{js,json,md}' '{src,tests,docs}/**/*.{ts,tsx,md,mdx}' --list-different", + "test": "pnpm run \"/^test:.*/\"", + "test:format": "prettier \"*.{js,json,md}\" \"{src,tests,docs}/**/*.{ts,tsx,md,mdx}\" --list-different", "test:types": "tsc --noEmit", "test:lint": "eslint .", "test: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,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;\"", "patch-old-ts": "shx touch dist/ts_version_4.5_and_above_is_required.d.ts", "patch-esm-ts": "node -e \"require('shelljs').find('dist/esm/**/*.d.ts').forEach(f=>{var f2=f.replace(/\\.ts$/,'.mts');require('fs').renameSync(f,f2);require('shelljs').sed('-i',/ from '(\\.[^']+)';$/,' from \\'\\$1.mjs\\';',f2);require('shelljs').sed('-i',/^declare module '(\\.[^']+)'/,'declare module \\'\\$1.mjs\\'',f2)})\""