Skip to content

Commit

Permalink
chore(package.json): DRY up src and dist by using ${npm_package_{src,…
Browse files Browse the repository at this point in the history
…dist}_dir}
  • Loading branch information
ribose-jeffreylau committed May 19, 2023
1 parent d7be547 commit 9000bfb
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,16 @@
"featured": true,
"requiredHostAppVersion": "^1.0.0-beta18"
},
"src_dir": "src",
"dist_dir": "dist",
"scripts": {
"preinstall": "npx only-allow pnpm",
"diagnose": "tsc --diagnostics",
"typecheck": "tsc -p tsconfig.build.json --noEmit",
"build:decl": "tsc -p tsconfig.build.json --emitDeclarationOnly",
"build": "run-script-os",
"build:default": "swc src --sync --ignore '*.test.*' --out-dir ${npm_package_dist_dir} --copy-files --extensions '.ts,.tsx,.js,.jsx,.json' && cp package.json ${npm_package_dist_dir}/",
"build:win32": "mkdirp %npm_package_dist_dir% && swc src --sync --out-dir %npm_package_dist_dir% --copy-files --extensions '.ts,.tsx,.js,.jsx,.json' && copy package.json %npm_package_dist_dir%",
"build:default": "swc ${npm_package_src_dir} --sync --ignore '*.test.*' --out-dir ${npm_package_dist_dir} --copy-files --extensions '.ts,.tsx,.js,.jsx,.json' && cp package.json ${npm_package_dist_dir}/",
"build:win32": "mkdirp %npm_package_dist_dir% && swc %npm_package_src_dir% --sync --out-dir %npm_package_dist_dir% --copy-files --extensions '.ts,.tsx,.js,.jsx,.json' && copy package.json %npm_package_dist_dir%",
"inject": "run-script-os",
"inject:mac": "mkdirp $HOME/'Library/Application Support'/Paneron/plugins/${npm_package_name}; rsync -a ${npm_package_dist_dir}/ $HOME/'Library/Application Support'/Paneron/plugins/${npm_package_name}/",
"inject:win32": "mkdirp \"%appdata%\\Paneron\\plugins\\@paneron\\extension-hls\" && xcopy /e /y %npm_package_dist_dir% \"%appdata%\\Paneron\\plugins\\@paneron\\extension-hls\" > nul",
Expand All @@ -33,8 +34,12 @@
"clean-build-typecheck": "pnpm run clean; pnpm run build-typecheck",
"clean-build-inject": "pnpm run clean; pnpm run build-inject",
"clean-build-typecheck-inject": "pnpm run clean-build-typecheck && pnpm run inject",
"lint": "eslint src/ --ext .ts,.tsx",
"clean": "rimraf dist/* *.tsbuildinfo",
"lint": "run-script-os",
"lint:default": "eslint ${npm_package_src_dir}/ --ext .ts,.tsx",
"lint:win32": "eslint %npm_package_src_dir%/ --ext .ts,.tsx",
"clean": "run-script-os",
"clean:default": "rimraf ${npm_package_dist_dir}/* *.tsbuildinfo",
"clean:win32": "rimraf %npm_package_dist_dir%/* *.tsbuildinfo",
"test:e2e": "codeceptjs run",
"test:e2e:def": "codeceptjs def",
"test:unit": "jest",
Expand Down

0 comments on commit 9000bfb

Please sign in to comment.