Skip to content

Commit 6269a8a

Browse files
committed
h
1 parent 474fa52 commit 6269a8a

43 files changed

Lines changed: 4989 additions & 3979 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ pages/utf8/index.html
2121
pages/utf8/Unicode_Chart.html
2222
/pages/windows/winutil.json
2323
/pages/typescript/defaults/defaults/
24-
/gitignore.js
24+
/gitignore.js
25+
/pnpm-lock.yaml

es.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ async function stripTypes(filePath: string): Promise<{ outPath: string | undefin
193193
.replace(/(@es\.ts \*\/\s*)/g, `@es.ts *${SLASH}`);
194194

195195
writeFileSync(file.path, outputText);
196-
196+
197197
if (!firstOutPath) {
198198
firstOutPath = file.path;
199199
}
@@ -340,7 +340,7 @@ const rl = createInterface({
340340
let processedCount: number = 0;
341341
let hasError: boolean = false;
342342
const gitignorePaths: string[] = []; // paths to produce in stdout
343-
const updatePaths: string[] = []; // paths to actually update in .gitignore
343+
const updatePaths: string[] = []; // paths to actually update in .gitignore
344344
const semaphore = new Semaphore(ES_PARALLEL);
345345
const activeTasks = new Set<Promise<void>>();
346346

@@ -361,13 +361,11 @@ for await (const line of rl) {
361361
console.log(`${buildMode === "bundle" ? "Bundled" : "Transpiled"} (esbuild): ${file} -> ${outPath}`);
362362
}
363363

364-
const localArgs = Array.isArray(config.cliarguments)
365-
? config.cliarguments
366-
: args;
367-
364+
const localArgs = Array.isArray(config.cliarguments) ? config.cliarguments : args;
365+
368366
const localProduceGitignore = localArgs.includes("--produce-gitignore");
369367
const localUpdateGitignore = localArgs.includes("--update");
370-
368+
371369
if (localProduceGitignore) {
372370
const relPath = relative(gitRoot, outPath);
373371
gitignorePaths.push(relPath);

esbuild-node.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
//
1+
//
22
// see TRANSPILATION.md
3-
//
3+
//
44
// This script bundles files matching *.node.[js|cjs|mjs] using esbuild.
55
// The list of files to process is passed as a text file path in the first argument.
66
//
77
// WHY THIS SCRIPT EXISTS:
8-
// Raw esbuild typically outputs .js files. However, for Node.js scripts,
8+
// Raw esbuild typically outputs .js files. However, for Node.js scripts,
99
// the extension (.cjs or .mjs) is critical for correct module resolution.
1010
//
1111
// Example Transformation:
@@ -14,7 +14,7 @@
1414
// Script: copies .js to ./pages/bash/xx/xx.node.bundled.gitignored.cjs
1515
// (Note: This results in TWO files: the .js bundle and the .cjs copy)
1616
//
17-
// Without this script, Node.js might fail to run the bundle if it misinterprets
17+
// Without this script, Node.js might fail to run the bundle if it misinterprets
1818
// the module type (ESM vs CJS). This script keeps the target extension in sync.
1919
//
2020
// Usage:
@@ -23,7 +23,6 @@
2323
//
2424
// Typically called by: /bin/bash esbuild-node.sh [watch]
2525

26-
2726
import * as esbuild from "esbuild";
2827

2928
import fs from "fs";

fix.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,22 @@
1-
2-
import { readFileSync, writeFileSync } from 'node:fs';
3-
import { createInterface } from 'node:readline';
1+
import { readFileSync, writeFileSync } from "node:fs";
2+
import { createInterface } from "node:readline";
43

54
const rl = createInterface({
65
input: process.stdin,
76
terminal: false,
87
});
98

10-
rl.on('line', (line) => {
9+
rl.on("line", (line) => {
1110
const filePath = line.trim();
1211
if (!filePath) return;
1312

1413
try {
15-
let content = readFileSync(filePath, 'utf8');
14+
let content = readFileSync(filePath, "utf8");
1615
let changed = false;
1716

1817
// Replace JS
1918
content = content.replace(/\/dist\/([^"]+)\.bundle\.js/g, (match, name) => {
20-
if (name.endsWith('.entry')) {
19+
if (name.endsWith(".entry")) {
2120
return match;
2221
}
2322
changed = true;
@@ -26,7 +25,7 @@ rl.on('line', (line) => {
2625

2726
// Replace CSS
2827
content = content.replace(/\/dist\/([^"]+)\.bundle\.css/g, (match, name) => {
29-
if (name.endsWith('.entry')) {
28+
if (name.endsWith(".entry")) {
3029
return match;
3130
}
3231
changed = true;

0 commit comments

Comments
 (0)