update node to v20

pull/132/head
Ben Miner 10 months ago
parent aeb0d936a7
commit 8ebe3fc9ae

@ -30,5 +30,5 @@ inputs:
required: false
default: "2"
runs:
using: "node16"
using: "node20"
main: "index.js"

@ -21112,8 +21112,8 @@ var __publicField2 = (obj, key, value) => {
return value;
};
var Shell = class {
process;
constructor(env_passthrough = ["PATH"]) {
__publicField(this, "process");
const env2 = { PS1: "" };
env_passthrough.forEach((key) => {
env2[key] = process.env[key];
@ -21150,6 +21150,21 @@ var trimFinalNewline = (input) => {
return input;
};
var Command = class {
shell;
cmd;
cwd;
interactive;
exec;
runningState;
pipe_logs;
exit_expected;
retCode;
promiseResolve;
promiseReject;
promise;
timer;
stdout;
stderr;
constructor({
cwd,
shell,
@ -21158,22 +21173,23 @@ var Command = class {
pipe_logs = false,
exit_expected = false
}) {
__publicField(this, "shell");
__publicField(this, "cmd");
__publicField(this, "cwd");
__publicField(this, "interactive");
__publicField(this, "exec");
__publicField(this, "runningState");
__publicField(this, "pipe_logs");
__publicField(this, "exit_expected");
__publicField(this, "retCode");
__publicField(this, "promiseResolve");
__publicField(this, "promiseReject");
__publicField(this, "promise");
__publicField(this, "timer");
__publicField(this, "stdout");
__publicField(this, "stderr");
__publicField(this, "handleStdoutData", (data) => {
this.shell = shell;
this.cmd = cmd;
this.cwd = cwd;
this.interactive = interactive;
this.exit_expected = exit_expected;
this.exec = `cd "${cwd}" &&
${this.cmd};echo __END_OF_COMMAND_[$?]__
`;
this.shell.process.on("exit", this.finish);
this.shell.getStdout().on("data", this.handleStdoutData);
this.shell.getStderr().on("data", this.handleStderrData);
this.runningState = 0;
this.pipe_logs = pipe_logs;
this.stdout = "";
this.stderr = "";
}
handleStdoutData = (data) => {
const lines = trimFinalNewline(data).split(/\r?\n/);
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
@ -21191,17 +21207,17 @@ var Command = class {
this.interactive(line, this.handleStdinData);
}
}
});
__publicField(this, "handleStderrData", (data) => {
};
handleStderrData = (data) => {
if (this.pipe_logs)
process.stderr.write(data);
this.stderr += data;
});
__publicField(this, "handleStdinData", (data) => {
};
handleStdinData = (data) => {
this.shell.getStdin().write(`${data}
`);
});
__publicField(this, "run", () => {
};
run = () => {
let promiseResolve, promiseReject;
const promise = new Promise((resolve, reject) => {
promiseResolve = resolve;
@ -21243,8 +21259,8 @@ ${this.stderr}
this.shell.exit();
throw e;
});
});
__publicField(this, "finish", () => {
};
finish = () => {
this.runningState = 2;
clearTimeout(this.timer);
this.shell.getStdout().removeListener("data", this.handleStdoutData);
@ -21273,24 +21289,8 @@ ${this.stderr}
}
}
return this.promiseResolve(obj);
});
__publicField(this, "log", Shell.logger);
this.shell = shell;
this.cmd = cmd;
this.cwd = cwd;
this.interactive = interactive;
this.exit_expected = exit_expected;
this.exec = `cd "${cwd}" &&
${this.cmd};echo __END_OF_COMMAND_[$?]__
`;
this.shell.process.on("exit", this.finish);
this.shell.getStdout().on("data", this.handleStdoutData);
this.shell.getStderr().on("data", this.handleStderrData);
this.runningState = 0;
this.pipe_logs = pipe_logs;
this.stdout = "";
this.stderr = "";
}
};
log = Shell.logger;
};
async function IfStatement(chunk, context2) {
const { interps, last_cmd } = context2;
@ -22060,7 +22060,7 @@ var src_default = shellac;
// src/index.ts
var import_undici = __toESM(require_undici());
var import_process = require("process");
var import_node_path = __toESM(require("path"));
var import_node_path = __toESM(require("node:path"));
try {
const apiToken = (0, import_core.getInput)("apiToken", { required: true });
const accountId = (0, import_core.getInput)("accountId", { required: true });

36
package-lock.json generated

@ -16,7 +16,7 @@
"undici": "^5.11.0"
},
"devDependencies": {
"@types/node": "^18.11.3",
"@types/node": "^20.14.8",
"esbuild": "^0.15.12",
"husky": "^8.0.1",
"prettier": "^2.8.1",
@ -214,10 +214,13 @@
}
},
"node_modules/@types/node": {
"version": "18.11.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.3.tgz",
"integrity": "sha512-fNjDQzzOsZeKZu5NATgXUPsaFaTxeRgFXoosrHivTl8RGeV733OLawXsGfEk9a8/tySyZUyiZ6E8LcjPFZ2y1A==",
"dev": true
"version": "20.14.8",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.8.tgz",
"integrity": "sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==",
"dev": true,
"dependencies": {
"undici-types": "~5.26.4"
}
},
"node_modules/before-after-hook": {
"version": "2.2.3",
@ -773,6 +776,12 @@
"node": ">=12.18"
}
},
"node_modules/undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
},
"node_modules/universal-user-agent": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",
@ -969,10 +978,13 @@
}
},
"@types/node": {
"version": "18.11.3",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.3.tgz",
"integrity": "sha512-fNjDQzzOsZeKZu5NATgXUPsaFaTxeRgFXoosrHivTl8RGeV733OLawXsGfEk9a8/tySyZUyiZ6E8LcjPFZ2y1A==",
"dev": true
"version": "20.14.8",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.8.tgz",
"integrity": "sha512-DO+2/jZinXfROG7j7WKFn/3C6nFwxy2lLpgLjEXJz+0XKphZlTLJ14mo8Vfg8X5BWN6XjyESXq+LcYdT7tR3bA==",
"dev": true,
"requires": {
"undici-types": "~5.26.4"
}
},
"before-after-hook": {
"version": "2.2.3",
@ -1279,6 +1291,12 @@
"busboy": "^1.6.0"
}
},
"undici-types": {
"version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
"dev": true
},
"universal-user-agent": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz",

@ -1,10 +1,10 @@
{
"name": "pages-action",
"version": "1.5.0",
"version": "1.6.0",
"description": "Publish to Cloudflare Pages",
"main": "index.js",
"scripts": {
"build": "npx esbuild src/index.ts --bundle --platform=node --target=es2021 --outfile=index.js",
"build": "npx esbuild src/index.ts --bundle --platform=node --target=node20 --outfile=index.js",
"prepare": "husky install",
"prettify": "prettier . --write --ignore-unknown"
},
@ -29,7 +29,7 @@
"undici": "^5.11.0"
},
"devDependencies": {
"@types/node": "^18.11.3",
"@types/node": "^20.14.8",
"esbuild": "^0.15.12",
"husky": "^8.0.1",
"prettier": "^2.8.1",

Loading…
Cancel
Save