Skip to content

Commit a4b28aa

Browse files
authored
Merge pull request #258 from aminya/packages
2 parents 5962369 + 9d12380 commit a4b28aa

File tree

146 files changed

+2512
-1620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+2512
-1620
lines changed

.github/workflows/CI.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,14 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
os:
25-
- ubuntu-24.04
25+
- ubuntu-22.04
2626
node:
27-
- 22
27+
- 22.6.0
2828
pnpm:
29-
- 9
29+
- 9.6.0
3030
steps:
3131
- uses: actions/checkout@v4
3232

33-
- name: Cache
34-
uses: actions/cache@v4
35-
with:
36-
path: |
37-
~/.pnpm-store
38-
D:\.pnpm-store
39-
key: "setupcpp-cache-OS:${{ matrix.os }}-node:${{ matrix.node }}-pnpm:${{ matrix.pnpm }}-${{ hashFiles('./.npmrc') }}-deps:${{ hashFiles('./package.json') }}"
40-
restore-keys: |
41-
"setupcpp-cache-OS:${{ matrix.os }}-"
42-
4333
- name: Setup Node
4434
uses: actions/setup-node@v4
4535
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ exe/
1919
.cache/
2020

2121
coverage
22+
.turbo

.npmrc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
11
package-lock=false
22
lockfile=true
3-
node-linker=hoisted
4-
prefer-frozen-lockfile=true
5-
side-effects-cache=true

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
"files.insertFinalNewline": true,
6767
"files.trimFinalNewlines": true,
6868
"hadolint.hadolintPath": "./target/bin/hadolint",
69-
// use dprint instead
70-
"prettier.enable": false
69+
"prettier.enable": false,
70+
"javascript.preferences.importModuleSpecifierEnding": "js",
71+
"typescript.preferences.importModuleSpecifierEnding": "js"
7172
}

biome.jsonc

Lines changed: 49 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,54 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.7.3/schema.json",
3-
"files": {
4-
"ignore": [
5-
"**/node_modules/**",
6-
"**/.pnpm-store/**",
7-
"**/dist/**",
8-
"dev/cpp_vcpkg_project/**/*",
9-
"**/.venv/",
10-
"**/.*cache/",
11-
"**/coverage/"
12-
],
13-
"ignoreUnknown": true
14-
},
15-
"organizeImports": {
16-
"enabled": true
17-
},
18-
"linter": {
19-
"enabled": true,
20-
"rules": {
21-
"recommended": true,
22-
"style": {
23-
"noInferrableTypes": "off",
24-
"noUselessElse": "off",
25-
"noNonNullAssertion": "off",
26-
"useNodejsImportProtocol": "off"
27-
},
28-
"complexity": {
29-
"useLiteralKeys": "off"
30-
},
31-
"suspicious": {
32-
"noConfusingVoidType": "off"
33-
}
34-
}
35-
},
2+
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3+
"files": {
4+
"ignore": [
5+
"**/node_modules/**",
6+
"**/.pnpm-store/**",
7+
"**/dist/**",
8+
"dev/cpp_vcpkg_project/**/*",
9+
"**/.venv/",
10+
"**/.*cache/",
11+
"**/coverage/"
12+
],
13+
"ignoreUnknown": true
14+
},
15+
"organizeImports": {
16+
"enabled": true
17+
},
18+
"linter": {
19+
"enabled": true,
20+
"rules": {
21+
"recommended": true,
22+
"style": {
23+
"noInferrableTypes": "off",
24+
"noUselessElse": "off",
25+
"noNonNullAssertion": "off",
26+
"useNodejsImportProtocol": "off"
27+
},
28+
"complexity": {
29+
"useLiteralKeys": "off"
30+
},
31+
"suspicious": {
32+
"noConfusingVoidType": "off"
33+
},
34+
"nursery": {
35+
"useImportExtensions": "warn"
36+
}
37+
}
38+
},
39+
"formatter": {
40+
"enabled": false,
41+
"indentWidth": 4,
42+
"indentStyle": "space"
43+
},
44+
"json": {
3645
"formatter": {
37-
"enabled": false,
38-
"indentWidth": 4,
39-
"indentStyle": "space"
46+
"enabled": false,
47+
"trailingCommas": "none"
4048
},
41-
"json": {
42-
"formatter": {
43-
"enabled": false,
44-
"trailingCommas": "none"
45-
},
46-
"parser": {
47-
"allowComments": true,
48-
"allowTrailingCommas": true
49-
}
49+
"parser": {
50+
"allowComments": true,
51+
"allowTrailingCommas": true
5052
}
53+
}
5154
}

cspell.config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ words:
2525
- choco
2626
- clangd
2727
- cmake
28+
- iarna
2829
- cobertura
2930
- copr
3031
- CPATH

dist/actions/actions_python.21d1fd22.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/actions/actions_python.21d1fd22.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/actions/actions_python.60e051e1.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/actions/actions_python.60e051e1.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/hdi.c45e802a.js renamed to dist/actions/hdi.647acde1.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/actions/hdi.647acde1.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/actions/hdi.c45e802a.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/actions/setup-cpp.js

Lines changed: 39 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/actions/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/actions_python.2c5f2ae4.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/legacy/actions_python.2c5f2ae4.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/legacy/actions_python.895b8a50.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/actions_python.895b8a50.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/hdi.d0d1f24f.js renamed to dist/legacy/hdi.619de66c.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/hdi.619de66c.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/hdi.d0d1f24f.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/legacy/setup-cpp.js

Lines changed: 41 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/legacy/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/actions_python.21d1fd22.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/modern/actions_python.21d1fd22.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/modern/actions_python.60e051e1.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/actions_python.60e051e1.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/actions/hdi.c45e802a.js renamed to dist/modern/hdi.647acde1.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/hdi.647acde1.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/hdi.c45e802a.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/modern/setup-cpp.js

Lines changed: 39 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/modern/setup-cpp.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dprint.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"module.sortImportDeclarations": "maintain",
1212
"importDeclaration.sortNamedImports": "maintain"
1313
},
14-
"json": {},
14+
"json": {
15+
"trailingCommas": "never"
16+
},
1517
"markdown": {},
1618
"dockerfile": {},
1719
"exec": {
@@ -26,7 +28,7 @@
2628
]
2729
},
2830
"includes": [
29-
"**/*{.ts,.tsx,.mts,.cts,.js,.jsx,.cjs,.mjs,.json,.md,.yaml,.yml,.dockerfile}"
31+
"**/*{.ts,.tsx,.mts,.cts,.js,.jsx,.cjs,.mjs,.json,.jsonc,.md,.yaml,.yml,.dockerfile}"
3032
],
3133
"excludes": [
3234
"**/node_modules",

jest.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ const jestConfig: Config = {
88
transform: {
99
"^.+\\.(t|j)sx?$": "@swc/jest",
1010
},
11+
// resolve js files from ts files
12+
moduleNameMapper: {
13+
"(.+)\\.js": "$1",
14+
},
1115
// coverage
1216
collectCoverageFrom: ["src/**/*.{ts,tsx,js,jsx}"],
1317
coveragePathIgnorePatterns: ["assets", ".css.d.ts"],

lefthook.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
pre-commit:
2+
parallel: false
3+
commands:
4+
test.lint:
5+
run: pnpm run test.lint
6+
build:
7+
run: pnpm run clean && pnpm i && pnpm run build -- --no-color && git add ./dist

package.json

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,29 @@
2727
"tsconfig.json"
2828
],
2929
"scripts": {
30-
"build": "run-s clean build.packages && run-p lint.tsc build.parcel copy.matchers",
31-
"build.packages": "pnpm run -r build",
32-
"build.parcel": "cross-env NODE_ENV=production parcel build && run-s build.babel && shx cp -r ./dist/actions/* ./dist/modern",
30+
"build": "turbo build && run-p lint.root.tsc build.parcel copy.matchers && run-s build.babel build.modern",
31+
"build.parcel": "cross-env NODE_ENV=production parcel build",
3332
"build.babel": "babel ./dist --out-dir dist --plugins @upleveled/babel-plugin-remove-node-prefix --plugins @babel/plugin-transform-private-methods --compact --no-babelrc --source-maps true",
33+
"build.modern": "shx cp -r ./dist/actions/* ./dist/modern",
3434
"bump": "ncu -u -x numerous,execa,prettier,@types/node,eslint,@types/eslint && pnpm update && pnpx typesync && pnpm run clean",
35-
"clean": "shx rm -rf ./dist ./exe ./packages/*/dist/ ./.parcel-cache && shx mkdir -p ./dist/legacy ./dist/actions ./dist/modern ",
35+
"clean": "shx rm -rf ./dist ./exe ./.parcel-cache && shx mkdir -p ./dist/legacy ./dist/actions ./dist/modern ",
3636
"copy.matchers": "run-p copy.matchers.legacy copy.matchers.actions",
3737
"copy.matchers.legacy": "shx cp ./src/gcc/gcc_matcher.json ./dist/legacy/ && shx cp ./src/msvc/msvc_matcher.json ./dist/legacy/ && shx cp ./src/python/python_matcher.json ./dist/legacy/ && shx cp ./src/llvm/llvm_matcher.json ./dist/legacy/",
3838
"copy.matchers.actions": "shx cp ./src/gcc/gcc_matcher.json ./dist/actions/ && shx cp ./src/msvc/msvc_matcher.json ./dist/actions/ && shx cp ./src/python/python_matcher.json ./dist/actions/ && shx cp ./src/llvm/llvm_matcher.json ./dist/actions/",
3939
"dev": "cross-env NODE_ENV=development parcel watch",
4040
"docs": "shx rm -rf packages/*/README.md && pnpm -r exec readme --path ../../dev/readme/template.md -y && pnpm -r exec ts-readme",
4141
"format": "run-s lint.dprint",
42-
"lint": "run-p --aggregate-output --continue-on-error lint.cspell lint.eslint lint.dprint lint.tsc lint.biome",
42+
"lint": "turbo lint && run-p --aggregate-output --continue-on-error lint.**",
4343
"lint.cspell": "cspell lint --no-progress --show-suggestions --cache --cache-location ./.cache/cspell/.cspellcache",
44-
"lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/ --fix",
4544
"lint.biome": "biome check --write --unsafe",
4645
"lint.dprint": "dprint fmt",
47-
"lint.tsc": "tsc --noEmit --pretty",
46+
"lint.root.tsc": "tsc --noEmit --pretty",
47+
"lint.root.eslint": "eslint ./{src,dev}/**/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/ --fix",
4848
"pack.exe": "shx rm -rf ./dist/tsconfig.tsbuildinfo && node ./dev/scripts/pack-exe.mjs",
49-
"prepublishOnly": "rm ./dist/tsconfig.tsbuildinfo",
50-
"test.lint": "run-p --aggregate-output --continue-on-error lint.cspell test.lint.eslint test.lint.dprint lint.tsc test.lint.biome",
51-
"test.lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
49+
"publish.all": "pnpm -r publish && pnpm publish",
50+
"prepublishOnly": "run-s build && shx rm ./dist/tsconfig.tsbuildinfo",
51+
"test.lint": "run-p --aggregate-output --continue-on-error test.lint.** lint.cspell lint.root.tsc",
52+
"test.lint.root.eslint": "eslint ./{src,dev}/**/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
5253
"test.lint.biome": "biome check",
5354
"test.lint.dprint": "dprint check",
5455
"test": "jest --runInBand --forceExit --coverage",
@@ -57,15 +58,18 @@
5758
"devDependencies": {
5859
"@actions/core": "^1.10.1",
5960
"@actions/exec": "^1.1.1",
61+
"@actions/http-client": "^2.2.1",
6062
"@actions/io": "^1.1.3",
6163
"@actions/tool-cache": "^2.0.1",
6264
"@babel/cli": "^7.24.8",
6365
"@babel/plugin-transform-private-methods": "^7.24.7",
6466
"@biomejs/biome": "^1.8.3",
67+
"@iarna/toml": "^2.2.5",
6568
"@shockpkg/archive-files": "github:aminya/archive-files#54ec59fad46aca736ac6feb6c7bb526528141b9d",
6669
"@swc/jest": "^0.2.36",
6770
"@types/cross-spawn": "^6.0.6",
6871
"@types/eslint": "^8.56.11",
72+
"@types/iarna__toml": "~2.0.5",
6973
"@types/jest": "^29.5.12",
7074
"@types/node": "^12.20.55",
7175
"@types/semver": "^7.5.8",
@@ -77,26 +81,29 @@
7781
"ci-log": "workspace:*",
7882
"cross-env": "7.0.3",
7983
"cross-spawn": "^7.0.3",
80-
"cspell": "^8.13.1",
84+
"cspell": "^8.13.3",
8185
"diagnostics_channel": "^1.1.0",
8286
"dprint": "^0.47.2",
8387
"escape-path-with-spaces": "^1.0.2",
8488
"escape-quotes": "^1.0.2",
8589
"escape-string-regexp": "^5.0.0",
90+
"setup-apt": "workspace:*",
8691
"eslint": "^8.57.0",
87-
"eslint-config-atomic": "^1.22.0",
92+
"eslint-config-atomic": "^1.22.1",
8893
"exec-powershell": "workspace:*",
8994
"execa": "^7.2.0",
9095
"is-url-online": "^1.5.0",
9196
"jest": "^29.7.0",
97+
"lefthook": "^1.7.12",
9298
"macos-release": "^3.3.0",
9399
"micro-memoize": "^4.1.2",
94100
"mkdirp": "^3.0.1",
95101
"mri": "^1.2.0",
96102
"msvc-dev-cmd": "github:aminya/msvc-dev-cmd#c01f519bd995460228ed3dec4df51df92dc290fd",
97-
"npm-check-updates": "^17.0.3",
103+
"npm-check-updates": "^17.0.6",
98104
"npm-run-all2": "^6.2.2",
99105
"numerous": "1.0.3",
106+
"os-env": "workspace:*",
100107
"p-timeout": "^6.1.2",
101108
"parcel": "2.12.0",
102109
"path-exists": "^5.0.0",
@@ -113,6 +120,7 @@
113120
"time-delta": "github:aminya/time-delta#69d91a41cef28e569be9a2991129f5f7d1f0d00e",
114121
"ts-node": "^10.9.2",
115122
"ts-readme": "^1.1.3",
123+
"turbo": "2.0.14",
116124
"typescript": "^5.5.4",
117125
"ubuntu-version": "^2.0.0",
118126
"untildify-user": "workspace:*",
@@ -123,11 +131,14 @@
123131
"productionDependencies": [
124132
"@actions/core",
125133
"@actions/exec",
134+
"@actions/http-client",
126135
"@actions/io",
127136
"@actions/tool-cache",
137+
"@iarna/toml",
128138
"admina",
129139
"ci-info",
130140
"ci-log",
141+
"diagnostics_channel",
131142
"escape-path-with-spaces",
132143
"escape-quotes",
133144
"escape-string-regexp",
@@ -138,23 +149,28 @@
138149
"mri",
139150
"msvc-dev-cmd",
140151
"numerous",
152+
"os-env",
141153
"path-exists",
142154
"patha",
143155
"retry-as-promised",
144156
"semver",
157+
"setup-apt",
145158
"setup-python",
146159
"simple-update-notifier",
147160
"time-delta",
148161
"ubuntu-version",
149162
"untildify-user",
150-
"web-streams-polyfill",
151163
"util.types",
152-
"diagnostics_channel"
164+
"web-streams-polyfill"
153165
],
154166
"engines": {
155167
"node": ">=12.x",
156168
"pnpm": "^9"
157169
},
170+
"packageManager": "[email protected]",
171+
"workspaces": [
172+
"packages/*"
173+
],
158174
"keywords": [
159175
"github-actions",
160176
"actions",

packages/ci-log/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../../.eslintrc.json"
3+
}

packages/ci-log/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@
22
"name": "ci-log",
33
"version": "1.0.0",
44
"description": "Colorful logging and print for any environment including GitHub Actions",
5-
"homepage": "https://github.com/aminya/setup-cpp",
5+
"repository": "https://github.com/aminya/setup-cpp",
6+
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/ci-log",
67
"license": "Apache-2.0",
78
"author": "Amin Yahyaabadi",
89
"main": "./dist/index.js",
910
"source": "./src/index.ts",
1011
"scripts": {
11-
"build": "tsc"
12+
"build": "tsc --pretty",
13+
"lint.tsc": "tsc --noEmit --pretty",
14+
"lint.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/ --fix",
15+
"prepublishOnly": "pnpm run build"
1216
},
1317
"dependencies": {
1418
"@actions/core": "^1.10.1",

packages/ci-log/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"outDir": "./dist"
4+
"outDir": "./dist",
5+
"noEmit": false,
6+
"allowImportingTsExtensions": false
57
},
68
"include": ["./src"]
79
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "../../.eslintrc.json"
3+
}

0 commit comments

Comments
 (0)