Skip to content

Commit

Permalink
fix: improve compatibility with Node 12
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Feb 17, 2024
1 parent 99a1254 commit 36d895f
Show file tree
Hide file tree
Showing 25 changed files with 99 additions and 71 deletions.
2 changes: 2 additions & 0 deletions dist/actions/hdi.89f0ed6f.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/actions/hdi.89f0ed6f.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/actions/hdi.a7c9a962.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/actions/hdi.a7c9a962.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions dist/actions/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/actions/setup-cpp.js.map

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions dist/legacy/hdi.069dd8f5.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/legacy/hdi.069dd8f5.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/legacy/hdi.37193ff6.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/legacy/hdi.37193ff6.js.map

This file was deleted.

4 changes: 2 additions & 2 deletions dist/legacy/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js.map

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/modern/hdi.9840a557.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/modern/hdi.9840a557.js.map

This file was deleted.

2 changes: 2 additions & 0 deletions dist/modern/hdi.9d60a332.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/modern/hdi.9d60a332.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/modern/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"build": "run-s clean build.packages && run-p lint.tsc build.parcel copy.matchers",
"build.packages": "pnpm run -r build",
"build.parcel": "cross-env NODE_ENV=production parcel build && babel ./dist --out-dir dist --plugins @upleveled/babel-plugin-remove-node-prefix --compact --no-babelrc --source-maps true",
"bump": "ncu -u -x numerous,execa,prettier && pnpm update",
"bump": "ncu -u -x numerous,execa,prettier,@types/node && pnpm update",
"clean": "shx rm -rf ./dist ./exe ./packages/*/dist/ && shx mkdir -p ./dist/legacy ./dist/actions ./dist/modern ",
"copy.matchers": "run-p copy.matchers.legacy copy.matchers.actions copy.matchers.modern",
"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/",
Expand Down Expand Up @@ -82,7 +82,7 @@
"@types/eslint": "^8.56.2",
"@types/jest": "^29.5.12",
"@types/mri": "^1.1.5",
"@types/node": "^20.11.19",
"@types/node": "^12",
"@types/prettier": "2.7.3",
"@types/semver": "^7.5.7",
"@types/which": "^3.0.3",
Expand Down
86 changes: 43 additions & 43 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 13 additions & 4 deletions src/utils/compat/fs/promises.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { promises } from "fs"
export default promises
import * as fs from "fs"
export default fs.promises

export const {
access,
Expand All @@ -26,5 +26,14 @@ export const {
unlink,
utimes,
writeFile,
rm,
} = promises
} = fs.promises

import { promisify } from "util"
export const rm =
"rm" in fs.promises
? (
fs.promises as typeof fs.promises & {
rm: (path: string, options?: fs.RmDirOptions) => Promise<void>
}
).rm
: promisify(fs.unlink)
Loading

0 comments on commit 36d895f

Please sign in to comment.