diff --git a/data/shelljs.mjs b/data/shelljs.mjs index cac0aea..bf5ad28 100644 --- a/data/shelljs.mjs +++ b/data/shelljs.mjs @@ -1,3 +1,6 @@ +// This file is autogenerated by scripts +// Do NOT modify this file manually + export default { cat: false, cd: false, @@ -12,6 +15,7 @@ export default { exit: false, find: false, grep: false, + head: false, ln: false, ls: false, mkdir: false, @@ -22,9 +26,12 @@ export default { rm: false, sed: false, set: false, - target: false, + ShellString: false, + sort: false, + tail: false, tempdir: false, test: false, touch: false, + uniq: false, which: false, }; diff --git a/globals.json b/globals.json index 9351183..d898020 100644 --- a/globals.json +++ b/globals.json @@ -2052,6 +2052,7 @@ "exit": false, "find": false, "grep": false, + "head": false, "ln": false, "ls": false, "mkdir": false, @@ -2062,10 +2063,13 @@ "rm": false, "sed": false, "set": false, - "target": false, + "ShellString": false, + "sort": false, + "tail": false, "tempdir": false, "test": false, "touch": false, + "uniq": false, "which": false }, "prototypejs": { diff --git a/package.json b/package.json index 45c3b14..5f69d1c 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "update:builtin": "node scripts/update.mjs --environment=builtin", "update:nodeBuiltin": "node scripts/update.mjs --environment=nodeBuiltin", "update:worker": "node scripts/update.mjs --environment=worker", + "update:shelljs": "node scripts/update.mjs --environment=shelljs", "build": "run-p \"build:*\"", "build:data": "node scripts/generate-data.mjs", "build:types": "node scripts/generate-types.mjs > index.d.ts" @@ -49,6 +50,7 @@ "npm-run-all2": "^6.1.2", "outdent": "^0.8.0", "puppeteer": "^22.1.0", + "shelljs": "^0.8.5", "tsd": "^0.30.4", "type-fest": "^4.10.2", "xo": "^0.57.0" diff --git a/scripts/get-shelljs-globals.mjs b/scripts/get-shelljs-globals.mjs new file mode 100644 index 0000000..7644460 --- /dev/null +++ b/scripts/get-shelljs-globals.mjs @@ -0,0 +1,6 @@ +import shelljs from 'shelljs'; + +// https://github.com/shelljs/shelljs/blob/2ff87eff00456ac5f21c67d3bb0699e5bdfa8851/global.js#L4-L6 +export default function getShelljsGlobals() { + return Object.fromEntries(Object.keys(shelljs).map(name => [name, false])); +} diff --git a/scripts/update.mjs b/scripts/update.mjs index 477df10..9b0a111 100644 --- a/scripts/update.mjs +++ b/scripts/update.mjs @@ -4,6 +4,7 @@ import {execaCommand} from 'execa'; import getBuiltinGlobals from './get-builtin-globals.mjs'; import getNodeBuiltinGlobals from './get-node-builtin-globals.mjs'; import {getBrowserGlobals, getWebWorkerGlobals} from './get-browser-globals.mjs'; +import getShelljsGlobals from './get-shelljs-globals.mjs'; import {updateGlobals} from './utilities.mjs'; const ALL_JOBS = [ @@ -23,6 +24,10 @@ const ALL_JOBS = [ environment: 'worker', getGlobals: getWebWorkerGlobals, }, + { + environment: 'shelljs', + getGlobals: getShelljsGlobals, + }, ]; async function run(options) {