Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing shelljs globals #230

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion data/shelljs.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// This file is autogenerated by scripts
// Do NOT modify this file manually

export default {
cat: false,
cd: false,
Expand All @@ -12,6 +15,7 @@ export default {
exit: false,
find: false,
grep: false,
head: false,
ln: false,
ls: false,
mkdir: false,
Expand All @@ -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,
};
6 changes: 5 additions & 1 deletion globals.json
Original file line number Diff line number Diff line change
Expand Up @@ -2052,6 +2052,7 @@
"exit": false,
"find": false,
"grep": false,
"head": false,
"ln": false,
"ls": false,
"mkdir": false,
Expand All @@ -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": {
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
6 changes: 6 additions & 0 deletions scripts/get-shelljs-globals.mjs
Original file line number Diff line number Diff line change
@@ -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]));
}
5 changes: 5 additions & 0 deletions scripts/update.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -23,6 +24,10 @@ const ALL_JOBS = [
environment: 'worker',
getGlobals: getWebWorkerGlobals,
},
{
environment: 'shelljs',
getGlobals: getShelljsGlobals,
},
];

async function run(options) {
Expand Down