Skip to content

Commit 4a8abe5

Browse files
committed
🐳 chore(build): Wrap quotes for paths in build commands
Wrap quotes for paths in build commands to improve cross-platform compatibility.
1 parent 4330b21 commit 4a8abe5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
"bench": "vitest bench --run",
3131
"bench:watch": "vitest bench",
3232
"build": "rimraf dist && npm run typecheck && npm run test-types && npm run test && npm run compile && node -e \"import fs from 'node:fs'; fs.cpSync('package.json', 'dist/package.json')\" && json -I -f dist/package.json -e \"delete this.private; delete this.scripts; delete this.devDependencies\" && node -e \"import fs from 'node:fs'; ['LICENSE', 'COMMERCIAL_LICENSE.md', 'README.md'].forEach((name) => fs.cpSync(name, 'dist/' + name))\"",
33-
"compile": "tsc --emitDeclarationOnly --composite false -p tsconfig.build.json && node -e \"import fs from 'node:fs'; fs.cpSync('src', 'dist', { recursive: true })\" dist && node -e \"import path from 'node:path'; import fs from 'node:fs'; import tsBlankSpace from 'ts-blank-space'; fs.readdirSync('dist', { recursive: true }).map((file) => path.join('dist', file)).filter((file) => file.endsWith('.ts') && !file.endsWith('.d.ts') && fs.statSync(file).isFile()).forEach((file) => { fs.writeFileSync(file.substring(0, file.lastIndexOf('.')) + '.js', tsBlankSpace(fs.readFileSync(file, 'utf-8'))); fs.rmSync(file); })\" && tsc-alias -p tsconfig.build.json && node -e \"import { replaceInFileSync } from 'replace-in-file'; [/ *\\/\\/ eslint-disable-next-line [^\\n]+\\n/g, / *\\/\\* eslint-(disable|enable) [^\\n]+ \\*\\/\\n/g, /^\\s*\\/\\/ @ts-.+$/gm].forEach((regex) => replaceInFileSync({ files: 'dist/**/*.js', from: regex, to: '' }))\" && prettier --log-level=silent --print-width 80 --write dist/**/* --ignore-path !dist/**/* && node -e \"import { replaceInFileSync } from 'replace-in-file'; replaceInFileSync({ files: 'dist/**/*.js', from: /^ *\\*\\/\\n\\n/gm, to: '*/\\n' }); for (let i = 0; i < 10; i++) replaceInFileSync({ files: 'dist/**/*.js', from: /^ *\\/\\*\\*\\n(( \\*( [^\\n]*)?\\n)+) *\\*\\/\\n( *\\/)/gm, to: '$4' })\" && prettier --log-level=silent --print-width 80 --write dist/**/* --ignore-path !dist/**/*",
34-
"format": "prettier --no-error-on-unmatched-pattern --write **/*.{js,ts,json,md} *.{cjs,mjs,cts,mts}",
35-
"lint": "eslint **/*.{js,ts} *.{cjs,mjs,cts,mts} --no-error-on-unmatched-pattern --report-unused-disable-directives-severity error --max-warnings 0",
36-
"lint:fix": "eslint --fix **/*.{js,ts} *.{cjs,mjs,cts,mts} --no-error-on-unmatched-pattern --report-unused-disable-directives-severity error --max-warnings 0",
33+
"compile": "tsc --emitDeclarationOnly --composite false -p tsconfig.build.json && node -e \"import fs from 'node:fs'; fs.cpSync('src', 'dist', { recursive: true })\" dist && node -e \"import path from 'node:path'; import fs from 'node:fs'; import tsBlankSpace from 'ts-blank-space'; fs.readdirSync('dist', { recursive: true }).map((file) => path.join('dist', file)).filter((file) => file.endsWith('.ts') && !file.endsWith('.d.ts') && fs.statSync(file).isFile()).forEach((file) => { fs.writeFileSync(file.substring(0, file.lastIndexOf('.')) + '.js', tsBlankSpace(fs.readFileSync(file, 'utf-8'))); fs.rmSync(file); })\" && tsc-alias -p tsconfig.build.json && node -e \"import { replaceInFileSync } from 'replace-in-file'; [/ *\\/\\/ eslint-disable-next-line [^\\n]+\\n/g, / *\\/\\* eslint-(disable|enable) [^\\n]+ \\*\\/\\n/g, /^\\s*\\/\\/ @ts-.+$/gm].forEach((regex) => replaceInFileSync({ files: 'dist/**/*.js', from: regex, to: '' }))\" && prettier --log-level=silent --print-width 80 --write \"dist/**/*\" --ignore-path \"!dist/**/*\" && node -e \"import { replaceInFileSync } from 'replace-in-file'; replaceInFileSync({ files: 'dist/**/*.js', from: /^ *\\*\\/\\n\\n/gm, to: '*/\\n' }); for (let i = 0; i < 10; i++) replaceInFileSync({ files: 'dist/**/*.js', from: /^ *\\/\\*\\*\\n(( \\*( [^\\n]*)?\\n)+) *\\*\\/\\n( *\\/)/gm, to: '$4' })\" && prettier --log-level=silent --print-width 80 --write \"dist/**/*\" --ignore-path \"!dist/**/*\"",
34+
"format": "prettier --no-error-on-unmatched-pattern --write \"**/*.{js,ts,json,md}\" \"*.{cjs,mjs,cts,mts}\"",
35+
"lint": "eslint \"**/*.{js,ts}\" \"*.{cjs,mjs,cts,mts}\" --no-error-on-unmatched-pattern --report-unused-disable-directives-severity error --max-warnings 0",
36+
"lint:fix": "eslint --fix \"**/*.{js,ts}\" \"*.{cjs,mjs,cts,mts}\" --no-error-on-unmatched-pattern --report-unused-disable-directives-severity error --max-warnings 0",
3737
"measure-size": "rimraf dist && npm run compile && esbuild --bundle --minify --platform=neutral --log-level=silent --outfile=dist/kind-adt.min.js dist/index.js && node -e \"import fs from 'node:fs'; import prettyBytes from 'pretty-bytes'; import { gzipSizeSync } from 'gzip-size'; import brotliSize from 'brotli-size'; const fixed = 3; const content = fs.readFileSync('dist/kind-adt.min.js', 'utf-8'); console.log('gzip: ', `\\x1b[33m${prettyBytes(content.length, { maximumFractionDigits: fixed })}\\x1b[0m (bundled+minified)`, '→', `\\x1b[36m${prettyBytes(gzipSizeSync(content), { maximumFractionDigits: fixed })}\\x1b[0m`); console.log('brotli:', `\\x1b[33m${prettyBytes(content.length, { maximumFractionDigits: fixed })}\\x1b[0m (bundled+minified)`, '→', `\\x1b[36m${prettyBytes(brotliSize.sync(content), { maximumFractionDigits: fixed })}\\x1b[0m`)\" && rimraf dist",
3838
"prepare": "node -e \"import fs from 'node:fs'; import path from 'node:path'; const hooksDir = path.join(process.cwd(), '.githooks'); const gitHooksDir = path.join(process.cwd(), '.git/hooks'); if (fs.existsSync(gitHooksDir)) { fs.readdirSync(hooksDir).forEach(file => { const srcFile = path.join(hooksDir, file); const destFile = path.join(gitHooksDir, file); fs.copyFileSync(srcFile, destFile); if (process.platform !== 'win32' && !file.endsWith('.cmd')) { fs.chmodSync(destFile, 0o755); } }); }\"",
3939
"test": "vitest run",

0 commit comments

Comments
 (0)