fix: use typescript and execa for pack-exe

This commit is contained in:
Amin Yahyaabadi 2022-10-19 20:12:32 -07:00
parent 3d99f05a7b
commit 99bbdbe446
5 changed files with 120 additions and 19 deletions

View File

@ -1,4 +1,4 @@
const { exec } = require("@actions/exec")
import { node } from "execa"
function getPlatformName() {
switch (process.platform) {
@ -26,13 +26,19 @@ function main() {
return Promise.all(
exes.map((exe) =>
exec(
`./node_modules/.bin/caxa --input ./dist/node16 --output ./exe/setup_cpp_${getPlatformName()}${exe} -- "{{caxa}}/node_modules/.bin/node${exe}" "{{caxa}}/setup_cpp.js"`
)
node("./node_modules/caxa/build/index.mjs", [
"--input",
"./dist/node16",
"--output",
`./exe/setup_cpp_${getPlatformName()}${exe}`,
"--",
`{{caxa}}/node_modules/.bin/node${exe}`,
`{{caxa}}/setup_cpp.js`,
])
)
)
}
main().then((exit) => {
process.exit(exit)
main().catch((err) => {
throw err
})

3
dev/scripts/package.json Normal file
View File

@ -0,0 +1,3 @@
{
"type": "module"
}

View File

@ -33,7 +33,7 @@
"lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/ --fix",
"lint.prettier": "prettier --write .",
"lint.tsc": "tsc --noEmit | loose-ts-check",
"pack.exe": "shx rm -rf ./dist/tsconfig.tsbuildinfo && node ./dev/scripts/pack-exe.js",
"pack.exe": "shx rm -rf ./dist/tsconfig.tsbuildinfo && ts-node --esm ./dev/scripts/pack-exe.ts",
"prepare": "pnpm run -r build && pnpm run -w build",
"start.docker": "docker run -t setup_cpp .",
"start.docker.arch": "docker run -t setup_cpp:arch .",
@ -98,6 +98,7 @@
"shx": "0.3.4",
"terser-config-atomic": "^0.1.1",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"ts-readme": "^1.1.3",
"typescript": "^4.8.4"
},

View File

@ -54,6 +54,7 @@ importers:
terser-config-atomic: ^0.1.1
time-delta: github:aminya/time-delta#69d91a41cef28e569be9a2991129f5f7d1f0d00e
ts-jest: ^29.0.3
ts-node: ^10.9.1
ts-readme: ^1.1.3
typescript: ^4.8.4
ubuntu-version: ^2.0.0
@ -97,7 +98,7 @@ importers:
eslint: 8.25.0
eslint-config-atomic: 1.18.1_eslint@8.25.0
gen-readme: 1.6.0
jest: 29.2.1_@types+node@18.11.2
jest: 29.2.1_5uyhgycj63wuqgvl4exdnr442q
loose-ts-check: 1.2.0
npm-check-updates: 16.3.14
npm-run-all2: 6.0.2
@ -108,6 +109,7 @@ importers:
shx: 0.3.4
terser-config-atomic: 0.1.1
ts-jest: 29.0.3_7yfpbkrrkkmtlepb2un4d37cti
ts-node: 10.9.1_id5sxmpllzol2kp2zgqrnepaum
ts-readme: 1.1.3_typescript@4.8.4
typescript: 4.8.4
@ -960,6 +962,13 @@ packages:
resolution: {integrity: sha512-/MB0RS0Gn01s4pgmjy0FvsLfr3RRMrRphEuvTRserNcM8XVtoIVAtrjig/Gg0DPwDrN8Clm0L1j7iQay6S8D0g==}
dev: true
/@cspotcode/source-map-support/0.8.1:
resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==}
engines: {node: '>=12'}
dependencies:
'@jridgewell/trace-mapping': 0.3.9
dev: true
/@eslint/eslintrc/1.3.3:
resolution: {integrity: sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg==}
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
@ -1029,7 +1038,7 @@ packages:
slash: 3.0.0
dev: true
/@jest/core/29.2.1:
/@jest/core/29.2.1_ts-node@10.9.1:
resolution: {integrity: sha512-kuLKYqnqgerXkBUwlHVxeSuhSnd+JMnMCLfU98bpacBSfWEJPegytDh3P2m15/JHzet32hGGld4KR4OzMb6/Tg==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
peerDependencies:
@ -1050,7 +1059,7 @@ packages:
exit: 0.1.2
graceful-fs: 4.2.10
jest-changed-files: 29.2.0
jest-config: 29.2.1_@types+node@18.11.2
jest-config: 29.2.1_5uyhgycj63wuqgvl4exdnr442q
jest-haste-map: 29.2.1
jest-message-util: 29.2.1
jest-regex-util: 29.2.0
@ -1275,6 +1284,13 @@ packages:
'@jridgewell/sourcemap-codec': 1.4.14
dev: true
/@jridgewell/trace-mapping/0.3.9:
resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==}
dependencies:
'@jridgewell/resolve-uri': 3.1.0
'@jridgewell/sourcemap-codec': 1.4.14
dev: true
/@lezer/common/0.15.12:
resolution: {integrity: sha512-edfwCxNLnzq5pBA/yaIhwJ3U3Kz8VAUOTRg0hhxaizaI1N+qxV7EXDv/kLCkLeq2RzSFvxexlaj5Mzfn2kY0Ig==}
dev: true
@ -2251,6 +2267,22 @@ packages:
engines: {node: '>=10.13.0'}
dev: true
/@tsconfig/node10/1.0.9:
resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==}
dev: true
/@tsconfig/node12/1.0.11:
resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==}
dev: true
/@tsconfig/node14/1.0.3:
resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==}
dev: true
/@tsconfig/node16/1.0.3:
resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==}
dev: true
/@types/babel__core/7.1.19:
resolution: {integrity: sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==}
dependencies:
@ -2593,6 +2625,11 @@ packages:
acorn: 8.8.0
dev: true
/acorn-walk/8.2.0:
resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==}
engines: {node: '>=0.4.0'}
dev: true
/acorn/8.8.0:
resolution: {integrity: sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==}
engines: {node: '>=0.4.0'}
@ -2748,6 +2785,10 @@ packages:
readable-stream: 3.6.0
dev: true
/arg/4.1.3:
resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==}
dev: true
/argparse/1.0.10:
resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==}
dependencies:
@ -3578,6 +3619,10 @@ packages:
capture-stack-trace: 1.0.2
dev: true
/create-require/1.1.1:
resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==}
dev: true
/cross-env/7.0.3:
resolution: {integrity: sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==}
engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'}
@ -3919,6 +3964,11 @@ packages:
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
dev: true
/diff/4.0.2:
resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==}
engines: {node: '>=0.3.1'}
dev: true
/diff/5.1.0:
resolution: {integrity: sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==}
engines: {node: '>=0.3.1'}
@ -5884,7 +5934,7 @@ packages:
- supports-color
dev: true
/jest-cli/29.2.1_@types+node@18.11.2:
/jest-cli/29.2.1_5uyhgycj63wuqgvl4exdnr442q:
resolution: {integrity: sha512-UIMD5aNqvPKpdlJSaeUAoLfxsh9TZvOkaMETx5qXnkboc317bcbb0eLHbIj8sFBHdcJAIAM+IRKnIU7Wi61MBw==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
hasBin: true
@ -5894,14 +5944,14 @@ packages:
node-notifier:
optional: true
dependencies:
'@jest/core': 29.2.1
'@jest/core': 29.2.1_ts-node@10.9.1
'@jest/test-result': 29.2.1
'@jest/types': 29.2.1
chalk: 4.1.2
exit: 0.1.2
graceful-fs: 4.2.10
import-local: 3.1.0
jest-config: 29.2.1_@types+node@18.11.2
jest-config: 29.2.1_5uyhgycj63wuqgvl4exdnr442q
jest-util: 29.2.1
jest-validate: 29.2.1
prompts: 2.4.2
@ -5912,7 +5962,7 @@ packages:
- ts-node
dev: true
/jest-config/29.2.1_@types+node@18.11.2:
/jest-config/29.2.1_5uyhgycj63wuqgvl4exdnr442q:
resolution: {integrity: sha512-EV5F1tQYW/quZV2br2o88hnYEeRzG53Dfi6rSG3TZBuzGQ6luhQBux/RLlU5QrJjCdq3LXxRRM8F1LP6DN1ycA==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
peerDependencies:
@ -5947,6 +5997,7 @@ packages:
pretty-format: 29.2.1
slash: 3.0.0
strip-json-comments: 3.1.1
ts-node: 10.9.1_id5sxmpllzol2kp2zgqrnepaum
transitivePeerDependencies:
- supports-color
dev: true
@ -6238,7 +6289,7 @@ packages:
supports-color: 8.1.1
dev: true
/jest/29.2.1_@types+node@18.11.2:
/jest/29.2.1_5uyhgycj63wuqgvl4exdnr442q:
resolution: {integrity: sha512-K0N+7rx+fv3Us3KhuwRSJt55MMpZPs9Q3WSO/spRZSnsalX8yEYOTQ1PiSN7OvqzoRX4JEUXCbOJRlP4n8m5LA==}
engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0}
hasBin: true
@ -6248,10 +6299,10 @@ packages:
node-notifier:
optional: true
dependencies:
'@jest/core': 29.2.1
'@jest/core': 29.2.1_ts-node@10.9.1
'@jest/types': 29.2.1
import-local: 3.1.0
jest-cli: 29.2.1_@types+node@18.11.2
jest-cli: 29.2.1_5uyhgycj63wuqgvl4exdnr442q
transitivePeerDependencies:
- '@types/node'
- supports-color
@ -8954,7 +9005,7 @@ packages:
dependencies:
bs-logger: 0.2.6
fast-json-stable-stringify: 2.1.0
jest: 29.2.1_@types+node@18.11.2
jest: 29.2.1_5uyhgycj63wuqgvl4exdnr442q
jest-util: 29.2.1
json5: 2.2.1
lodash.memoize: 4.1.2
@ -8964,6 +9015,37 @@ packages:
yargs-parser: 21.1.1
dev: true
/ts-node/10.9.1_id5sxmpllzol2kp2zgqrnepaum:
resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==}
hasBin: true
peerDependencies:
'@swc/core': '>=1.2.50'
'@swc/wasm': '>=1.2.50'
'@types/node': '*'
typescript: '>=2.7'
peerDependenciesMeta:
'@swc/core':
optional: true
'@swc/wasm':
optional: true
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.9
'@tsconfig/node12': 1.0.11
'@tsconfig/node14': 1.0.3
'@tsconfig/node16': 1.0.3
'@types/node': 18.11.2
acorn: 8.8.0
acorn-walk: 8.2.0
arg: 4.1.3
create-require: 1.1.1
diff: 4.0.2
make-error: 1.3.6
typescript: 4.8.4
v8-compile-cache-lib: 3.0.1
yn: 3.1.1
dev: true
/ts-readme/1.1.3_typescript@4.8.4:
resolution: {integrity: sha512-GvI+Vu3m/LGBlgrWwzSmvslnz8msJLNrZ7hQ3Ko2B6PMxeXidqsn6fi20IWgepFjOzhKGw/WlG8NmM7jl3DWeg==}
hasBin: true
@ -9280,6 +9362,10 @@ packages:
sade: 1.8.1
dev: true
/v8-compile-cache-lib/3.0.1:
resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
dev: true
/v8-compile-cache/2.3.0:
resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==}
dev: true
@ -9575,6 +9661,11 @@ packages:
yargs-parser: 21.1.1
dev: true
/yn/3.1.1:
resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==}
engines: {node: '>=6'}
dev: true
/yocto-queue/0.1.0:
resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
engines: {node: '>=10'}

View File

@ -28,5 +28,5 @@
"outDir": "./dist"
},
"compileOnSave": false,
"include": ["./src", "packages/untildify-user/untildify.ts"]
"include": ["./src", "dev/scripts", "packages/untildify-user/untildify.ts"]
}