feat: add node16 target and use it in the exe and on github

This commit is contained in:
Amin Yahyaabadi 2022-10-19 14:48:10 -07:00
parent 9d1119edc9
commit c82db22da1
24 changed files with 105 additions and 19 deletions

View File

@ -80,8 +80,8 @@ inputs:
required: false required: false
runs: runs:
using: "node12" using: "node16"
main: "dist/setup_cpp.js" main: "dist/node16/setup_cpp.js"
branding: branding:
icon: "award" icon: "award"

View File

@ -11,7 +11,7 @@ RUN pacman -S --noconfirm --needed nodejs
RUN pacman -S --noconfirm --needed curl RUN pacman -S --noconfirm --needed curl
# add setup_cpp.js # add setup_cpp.js
COPY "./dist/" "/" COPY "./dist/node12" "/"
WORKDIR "/" WORKDIR "/"
# run installation # run installation

View File

@ -8,7 +8,7 @@ RUN dnf -y install nodejs
RUN dnf -y install curl RUN dnf -y install curl
# add setup_cpp.js # add setup_cpp.js
COPY "./dist/" "/" COPY "./dist/node12" "/"
WORKDIR "/" WORKDIR "/"
# run installation # run installation

View File

@ -12,7 +12,7 @@ RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
RUN apt-get install -y --no-install-recommends nodejs RUN apt-get install -y --no-install-recommends nodejs
# add setup_cpp.js # add setup_cpp.js
ADD "./dist/" "/" COPY "./dist/node12" "/"
WORKDIR "/" WORKDIR "/"
# run installation # run installation

View File

@ -4,7 +4,7 @@ RUN apt-get update -qq
RUN apt-get install -y --no-install-recommends nodejs RUN apt-get install -y --no-install-recommends nodejs
# add setup_cpp.js # add setup_cpp.js
COPY "./dist/" "/" COPY "./dist/node12" "/"
WORKDIR "/" WORKDIR "/"
# run installation # run installation

View File

@ -27,7 +27,7 @@ function main() {
return Promise.all( return Promise.all(
exes.map((exe) => exes.map((exe) =>
exec( exec(
`./node_modules/.bin/caxa --input ./dist --output ./exe/setup_cpp_${getPlatformName()}${exe} -- "{{caxa}}/node_modules/.bin/node${exe}" "{{caxa}}/setup_cpp.js"` `./node_modules/.bin/caxa --input ./dist/node16 --output ./exe/setup_cpp_${getPlatformName()}${exe} -- "{{caxa}}/node_modules/.bin/node${exe}" "{{caxa}}/setup_cpp.js"`
) )
) )
) )

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

17
dist/node16/gcc_matcher.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "gcc",
"pattern": [
{
"regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}

17
dist/node16/llvm_matcher.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "llvm",
"pattern": [
{
"regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
}

18
dist/node16/msvc_matcher.json vendored Normal file
View File

@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "msvc",
"pattern": [
{
"regexp": "^(?:\\s+\\d+>)?(\\S.*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"code": 5,
"message": 6
}
]
}
]
}

18
dist/node16/python_matcher.json vendored Normal file
View File

@ -0,0 +1,18 @@
{
"problemMatcher": [
{
"owner": "python",
"pattern": [
{
"regexp": "^\\s*File\\s\\\"(.*)\\\",\\sline\\s(\\d+),\\sin\\s(.*)$",
"file": 1,
"line": 2
},
{
"regexp": "^\\s*raise\\s(.*)\\(\\'(.*)\\'\\)$",
"message": 2
}
]
}
]
}

2
dist/node16/setup_cpp.js vendored Normal file

File diff suppressed because one or more lines are too long

1
dist/node16/setup_cpp.js.map vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -6,17 +6,17 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"author": "Amin Yahyaabadi", "author": "Amin Yahyaabadi",
"exports": { "exports": {
"import": "./dist/setup-cpp.mjs", "import": "./dist/node12/setup-cpp.mjs",
"require": "./dist/setup-cpp.js" "require": "./dist/node12/setup-cpp.js"
}, },
"main": "./dist/setup_cpp.js", "main": "./dist/node12/setup_cpp.js",
"source": "./src/main.ts", "source": "./src/main.ts",
"bin": { "bin": {
"setup-cpp": "./dist/setup_cpp.js", "setup-cpp": "./dist/node12/setup_cpp.js",
"setup_cpp": "./dist/setup_cpp.js" "setup_cpp": "./dist/node12/setup_cpp.js"
}, },
"scripts": { "scripts": {
"build": "shx rm -rf dist/ && shx mkdir ./dist && run-p lint.tsc build.parcel copy.matchers", "build": "shx rm -rf dist/ && shx mkdir -p ./dist/node12 ./dist/node16 && run-p lint.tsc build.parcel copy.matchers",
"build.docker": "pnpm build && docker build -f ./dev/docker/ubuntu_node.dockerfile -t setup_cpp .", "build.docker": "pnpm build && docker build -f ./dev/docker/ubuntu_node.dockerfile -t setup_cpp .",
"build.docker.arch": "pnpm build && docker build -f ./dev/docker/arch_node.dockerfile -t setup_cpp:arch .", "build.docker.arch": "pnpm build && docker build -f ./dev/docker/arch_node.dockerfile -t setup_cpp:arch .",
"build.docker.fedora": "pnpm build && docker build -f ./dev/docker/fedora_node.dockerfile -t setup_cpp:fedora .", "build.docker.fedora": "pnpm build && docker build -f ./dev/docker/fedora_node.dockerfile -t setup_cpp:fedora .",
@ -24,7 +24,7 @@
"build.parcel": "cross-env NODE_ENV=production parcel build --detailed-report", "build.parcel": "cross-env NODE_ENV=production parcel build --detailed-report",
"bump": "ncu -u -x execa,numerous && pnpm update", "bump": "ncu -u -x execa,numerous && pnpm update",
"clean": "shx rm -rf .parcel-cache dist exe", "clean": "shx rm -rf .parcel-cache dist exe",
"copy.matchers": "shx cp ./src/gcc/gcc_matcher.json ./dist/ && shx cp ./src/msvc/msvc_matcher.json ./dist && shx cp ./src/python/python_matcher.json ./dist/ && shx cp ./src/llvm/llvm_matcher.json ./dist/ ", "copy.matchers": "shx cp ./src/gcc/gcc_matcher.json ./dist/node12/ && shx cp ./src/msvc/msvc_matcher.json ./dist/node12/ && shx cp ./src/python/python_matcher.json ./dist/node12/ && shx cp ./src/llvm/llvm_matcher.json ./dist/node12/ && shx cp ./dist/node12/*.json ./dist/node16/",
"dev": "cross-env NODE_ENV=development parcel watch", "dev": "cross-env NODE_ENV=development parcel watch",
"docs": "shx rm -rf packages/*/README.md && pnpm -r exec readme --path ../../dev/readme/template.md -y && pnpm -r exec ts-readme", "docs": "shx rm -rf packages/*/README.md && pnpm -r exec readme --path ../../dev/readme/template.md -y && pnpm -r exec ts-readme",
"format": "run-s lint.prettier", "format": "run-s lint.prettier",
@ -127,6 +127,7 @@
"electron": false, "electron": false,
"patha": "patha/dist/index.node.mjs" "patha": "patha/dist/index.node.mjs"
}, },
"main.actions": "./dist/node16/setup_cpp.js",
"pnpm": { "pnpm": {
"overrides": { "overrides": {
"semver": "7.3.8", "semver": "7.3.8",
@ -151,6 +152,15 @@
"includeNodeModules": true, "includeNodeModules": true,
"optimize": true, "optimize": true,
"outputFormat": "commonjs" "outputFormat": "commonjs"
},
"main.actions": {
"context": "node",
"engines": {
"node": ">=16.x"
},
"includeNodeModules": true,
"optimize": true,
"outputFormat": "commonjs"
} }
} }
} }