Skip to content

Commit 09e34ab

Browse files
committed
dev: Development changes
1 parent 9f48e10 commit 09e34ab

8 files changed

Lines changed: 142 additions & 134 deletions

File tree

File renamed without changes.

.github/actions/node-build/dist/index.js renamed to .github/actions/node-build-artifacts/dist/index.js

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ var require_tunnel = __commonJS({
392392
connectOptions.headers = connectOptions.headers || {};
393393
connectOptions.headers["Proxy-Authorization"] = "Basic " + new Buffer(connectOptions.proxyAuth).toString("base64");
394394
}
395-
debug("making CONNECT request");
395+
debug2("making CONNECT request");
396396
var connectReq = self.request(connectOptions);
397397
connectReq.useChunkedEncodingByDefault = false;
398398
connectReq.once("response", onResponse);
@@ -412,7 +412,7 @@ var require_tunnel = __commonJS({
412412
connectReq.removeAllListeners();
413413
socket.removeAllListeners();
414414
if (res.statusCode !== 200) {
415-
debug(
415+
debug2(
416416
"tunneling socket could not be established, statusCode=%d",
417417
res.statusCode
418418
);
@@ -424,21 +424,21 @@ var require_tunnel = __commonJS({
424424
return;
425425
}
426426
if (head.length > 0) {
427-
debug("got illegal response body from proxy");
427+
debug2("got illegal response body from proxy");
428428
socket.destroy();
429429
var error = new Error("got illegal response body from proxy");
430430
error.code = "ECONNRESET";
431431
options.request.emit("error", error);
432432
self.removeSocket(placeholder);
433433
return;
434434
}
435-
debug("tunneling connection has established");
435+
debug2("tunneling connection has established");
436436
self.sockets[self.sockets.indexOf(placeholder)] = socket;
437437
return cb(socket);
438438
}
439439
function onError(cause) {
440440
connectReq.removeAllListeners();
441-
debug(
441+
debug2(
442442
"tunneling socket could not be established, cause=%s\n",
443443
cause.message,
444444
cause.stack
@@ -500,9 +500,9 @@ var require_tunnel = __commonJS({
500500
}
501501
return target;
502502
}
503-
var debug;
503+
var debug2;
504504
if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
505-
debug = function() {
505+
debug2 = function() {
506506
var args = Array.prototype.slice.call(arguments);
507507
if (typeof args[0] === "string") {
508508
args[0] = "TUNNEL: " + args[0];
@@ -512,10 +512,10 @@ var require_tunnel = __commonJS({
512512
console.error.apply(console, args);
513513
};
514514
} else {
515-
debug = function() {
515+
debug2 = function() {
516516
};
517517
}
518-
exports2.debug = debug;
518+
exports2.debug = debug2;
519519
}
520520
});
521521

@@ -17580,12 +17580,12 @@ var require_lib = __commonJS({
1758017580
throw new Error("Client has already been disposed.");
1758117581
}
1758217582
const parsedUrl = new URL(requestUrl);
17583-
let info2 = this._prepareRequest(verb, parsedUrl, headers);
17583+
let info = this._prepareRequest(verb, parsedUrl, headers);
1758417584
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1;
1758517585
let numTries = 0;
1758617586
let response;
1758717587
do {
17588-
response = yield this.requestRaw(info2, data);
17588+
response = yield this.requestRaw(info, data);
1758917589
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
1759017590
let authenticationHandler;
1759117591
for (const handler of this.handlers) {
@@ -17595,7 +17595,7 @@ var require_lib = __commonJS({
1759517595
}
1759617596
}
1759717597
if (authenticationHandler) {
17598-
return authenticationHandler.handleAuthentication(this, info2, data);
17598+
return authenticationHandler.handleAuthentication(this, info, data);
1759917599
} else {
1760017600
return response;
1760117601
}
@@ -17618,8 +17618,8 @@ var require_lib = __commonJS({
1761817618
}
1761917619
}
1762017620
}
17621-
info2 = this._prepareRequest(verb, parsedRedirectUrl, headers);
17622-
response = yield this.requestRaw(info2, data);
17621+
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
17622+
response = yield this.requestRaw(info, data);
1762317623
redirectsRemaining--;
1762417624
}
1762517625
if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) {
@@ -17648,7 +17648,7 @@ var require_lib = __commonJS({
1764817648
* @param info
1764917649
* @param data
1765017650
*/
17651-
requestRaw(info2, data) {
17651+
requestRaw(info, data) {
1765217652
return __awaiter(this, void 0, void 0, function* () {
1765317653
return new Promise((resolve, reject) => {
1765417654
function callbackForResult(err, res) {
@@ -17660,7 +17660,7 @@ var require_lib = __commonJS({
1766017660
resolve(res);
1766117661
}
1766217662
}
17663-
this.requestRawWithCallback(info2, data, callbackForResult);
17663+
this.requestRawWithCallback(info, data, callbackForResult);
1766417664
});
1766517665
});
1766617666
}
@@ -17670,12 +17670,12 @@ var require_lib = __commonJS({
1767017670
* @param data
1767117671
* @param onResult
1767217672
*/
17673-
requestRawWithCallback(info2, data, onResult) {
17673+
requestRawWithCallback(info, data, onResult) {
1767417674
if (typeof data === "string") {
17675-
if (!info2.options.headers) {
17676-
info2.options.headers = {};
17675+
if (!info.options.headers) {
17676+
info.options.headers = {};
1767717677
}
17678-
info2.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
17678+
info.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
1767917679
}
1768017680
let callbackCalled = false;
1768117681
function handleResult(err, res) {
@@ -17684,7 +17684,7 @@ var require_lib = __commonJS({
1768417684
onResult(err, res);
1768517685
}
1768617686
}
17687-
const req = info2.httpModule.request(info2.options, (msg) => {
17687+
const req = info.httpModule.request(info.options, (msg) => {
1768817688
const res = new HttpClientResponse(msg);
1768917689
handleResult(void 0, res);
1769017690
});
@@ -17696,7 +17696,7 @@ var require_lib = __commonJS({
1769617696
if (socket) {
1769717697
socket.end();
1769817698
}
17699-
handleResult(new Error(`Request timeout: ${info2.options.path}`));
17699+
handleResult(new Error(`Request timeout: ${info.options.path}`));
1770017700
});
1770117701
req.on("error", function(err) {
1770217702
handleResult(err);
@@ -17732,27 +17732,27 @@ var require_lib = __commonJS({
1773217732
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
1773317733
}
1773417734
_prepareRequest(method, requestUrl, headers) {
17735-
const info2 = {};
17736-
info2.parsedUrl = requestUrl;
17737-
const usingSsl = info2.parsedUrl.protocol === "https:";
17738-
info2.httpModule = usingSsl ? https : http;
17735+
const info = {};
17736+
info.parsedUrl = requestUrl;
17737+
const usingSsl = info.parsedUrl.protocol === "https:";
17738+
info.httpModule = usingSsl ? https : http;
1773917739
const defaultPort = usingSsl ? 443 : 80;
17740-
info2.options = {};
17741-
info2.options.host = info2.parsedUrl.hostname;
17742-
info2.options.port = info2.parsedUrl.port ? parseInt(info2.parsedUrl.port) : defaultPort;
17743-
info2.options.path = (info2.parsedUrl.pathname || "") + (info2.parsedUrl.search || "");
17744-
info2.options.method = method;
17745-
info2.options.headers = this._mergeHeaders(headers);
17740+
info.options = {};
17741+
info.options.host = info.parsedUrl.hostname;
17742+
info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
17743+
info.options.path = (info.parsedUrl.pathname || "") + (info.parsedUrl.search || "");
17744+
info.options.method = method;
17745+
info.options.headers = this._mergeHeaders(headers);
1774617746
if (this.userAgent != null) {
17747-
info2.options.headers["user-agent"] = this.userAgent;
17747+
info.options.headers["user-agent"] = this.userAgent;
1774817748
}
17749-
info2.options.agent = this._getAgent(info2.parsedUrl);
17749+
info.options.agent = this._getAgent(info.parsedUrl);
1775017750
if (this.handlers) {
1775117751
for (const handler of this.handlers) {
17752-
handler.prepareRequest(info2.options);
17752+
handler.prepareRequest(info.options);
1775317753
}
1775417754
}
17755-
return info2;
17755+
return info;
1775617756
}
1775717757
_mergeHeaders(headers) {
1775817758
if (this.requestOptions && this.requestOptions.headers) {
@@ -19726,10 +19726,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
1972619726
return process.env["RUNNER_DEBUG"] === "1";
1972719727
}
1972819728
exports2.isDebug = isDebug;
19729-
function debug(message) {
19729+
function debug2(message) {
1973019730
(0, command_1.issueCommand)("debug", {}, message);
1973119731
}
19732-
exports2.debug = debug;
19732+
exports2.debug = debug2;
1973319733
function error(message, properties = {}) {
1973419734
(0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
1973519735
}
@@ -19742,10 +19742,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
1974219742
(0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
1974319743
}
1974419744
exports2.notice = notice;
19745-
function info2(message) {
19745+
function info(message) {
1974619746
process.stdout.write(message + os.EOL);
1974719747
}
19748-
exports2.info = info2;
19748+
exports2.info = info;
1974919749
function startGroup2(name) {
1975019750
(0, command_1.issue)("group", name);
1975119751
}
@@ -20038,23 +20038,22 @@ var require_ansi_colors = __commonJS({
2003820038
}
2003920039
});
2004020040

20041-
// .github/actions/node-build/src/index.mjs
20041+
// .github/actions/node-build-artifacts/src/index.mjs
2004220042
var import_node_fs = __toESM(require("node:fs"), 1);
2004320043
var import_node_path = __toESM(require("node:path"), 1);
2004420044
var core = __toESM(require_core(), 1);
2004520045
var import_ansi_colors = __toESM(require_ansi_colors(), 1);
2004620046
async function run() {
2004720047
const packages = JSON.parse(process.env.PACKAGES);
20048-
core.info(packages);
20048+
core.debug(packages);
2004920049
core.startGroup("Preparing directories");
2005020050
const rootDir = process.env.GITHUB_WORKSPACE;
2005120051
const artifactsDir = import_node_path.default.join(rootDir, "__artifacts__");
2005220052
import_node_fs.default.mkdirSync(artifactsDir, { recursive: true });
2005320053
const infoFile = [];
2005420054
for (const pkg of packages) {
20055-
core.info("Preparing", import_ansi_colors.default.magenta(`${pkg.name}`));
20055+
core.debug("Preparing", import_ansi_colors.default.magenta(`${pkg.name}`));
2005620056
const packageDir = import_node_path.default.join(rootDir, pkg.directory);
20057-
pkg.buildDir = "src";
2005820057
const buildDir = import_node_path.default.join(packageDir, pkg.buildDir || "./");
2005920058
if (!import_node_fs.default.existsSync(buildDir)) {
2006020059
core.warning("build directory do not exists. Skipping");
@@ -20066,19 +20065,22 @@ async function run() {
2006620065
directory: pkgDir,
2006720066
buildDir: void 0
2006820067
});
20068+
core.debug("Copying build files to artifacts dir");
2006920069
import_node_fs.default.cpSync(buildDir, import_node_path.default.join(artifactsDir, pkgDir), { recursive: true });
2007020070
}
20071+
core.debug("Writing packages info to json file");
2007120072
import_node_fs.default.writeFileSync(
20072-
import_node_path.default.join(artifactsDir, "packages.json"),
20073+
import_node_path.default.join(artifactsDir, "projects.json"),
2007320074
JSON.stringify(infoFile, null, 2)
2007420075
);
20076+
core.debug("Copying COMMIT_CHANGELOG.md to artifacts dir");
2007520077
import_node_fs.default.cpSync(
2007620078
import_node_path.default.join(rootDir, "COMMIT_CHANGELOG.md"),
2007720079
import_node_path.default.join(artifactsDir, "COMMIT_CHANGELOG.md")
2007820080
);
2007920081
core.endGroup();
2008020082
}
20081-
function sanitizeFilename(filename, replacement = "_") {
20083+
function sanitizeFilename(filename, replacement = "-") {
2008220084
return filename.replace(/[<>:"/\\|?*\x00-\x1F]/g, replacement).trim();
2008320085
}
2008420086
run().catch((error) => {
File renamed without changes.

.github/actions/node-build/src/index.mjs renamed to .github/actions/node-build-artifacts/src/index.mjs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import colors from "ansi-colors";
55

66
async function run() {
77
const packages = JSON.parse(process.env.PACKAGES);
8-
// core.debug(packages);
9-
core.info(packages);
8+
core.debug(packages);
109

1110
core.startGroup("Preparing directories");
1211

@@ -16,9 +15,8 @@ async function run() {
1615

1716
const infoFile = [];
1817
for (const pkg of packages) {
19-
core.info("Preparing", colors.magenta(`${pkg.name}`));
18+
core.debug("Preparing", colors.magenta(`${pkg.name}`));
2019
const packageDir = path.join(rootDir, pkg.directory);
21-
pkg.buildDir = "src";
2220
const buildDir = path.join(packageDir, pkg.buildDir || "./");
2321
if (!fs.existsSync(buildDir)) {
2422
core.warning("build directory do not exists. Skipping");
@@ -32,22 +30,25 @@ async function run() {
3230
});
3331

3432
/** Copy build files to artifacts dir */
33+
core.debug("Copying build files to artifacts dir");
3534
fs.cpSync(buildDir, path.join(artifactsDir, pkgDir), { recursive: true });
3635
}
3736
/** Write package info to json file same basename with zip file */
37+
core.debug("Writing packages info to json file");
3838
fs.writeFileSync(
39-
path.join(artifactsDir, "packages.json"),
39+
path.join(artifactsDir, "projects.json"),
4040
JSON.stringify(infoFile, null, 2),
4141
);
4242
/** Copy COMMIT_CHANGELOG.md to artifacts dir */
43+
core.debug("Copying COMMIT_CHANGELOG.md to artifacts dir");
4344
fs.cpSync(
4445
path.join(rootDir, "COMMIT_CHANGELOG.md"),
4546
path.join(artifactsDir, "COMMIT_CHANGELOG.md"),
4647
);
4748
core.endGroup();
4849
}
4950

50-
function sanitizeFilename(filename, replacement = "_") {
51+
function sanitizeFilename(filename, replacement = "-") {
5152
// eslint-disable-next-line no-control-regex
5253
return filename.replace(/[<>:"/\\|?*\x00-\x1F]/g, replacement).trim();
5354
}

0 commit comments

Comments
 (0)