@builder.io/dev-tools 1.21.6-dev.202601211930.10e037ddf → 1.21.7-dev.202601220544.7c9f878c1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/index.cjs +67 -21
- package/cli/index.cjs.map +3 -3
- package/cli/pkg-entry.cjs +149 -0
- package/core/index.cjs +1 -1
- package/core/index.mjs +1 -1
- package/node/index.cjs +1 -1
- package/node/index.mjs +1 -1
- package/package.json +1 -1
- package/server/index.cjs +2 -2
- package/server/index.mjs +2 -2
- package/types/cli/mcp-local.d.ts +2 -2
- package/types/common/ast/component-input-types.d.ts +1 -1
- package/types/common/utils.d.ts +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* PKG Binary Entry Point
|
|
4
|
+
* This wrapper provides early diagnostics for debugging pkg bundle issues.
|
|
5
|
+
* Debug output is written to both stdout and /tmp/builder-fusion-debug.log
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
var fs = require("fs");
|
|
9
|
+
var path = require("path");
|
|
10
|
+
|
|
11
|
+
// Debug log function that writes to both stdout and a debug file
|
|
12
|
+
var debugLogPath = "/tmp/builder-fusion-debug.log";
|
|
13
|
+
function debugLog(msg) {
|
|
14
|
+
var line = "[PKG] " + msg + "\n";
|
|
15
|
+
try {
|
|
16
|
+
process.stdout.write(line);
|
|
17
|
+
} catch (e) {}
|
|
18
|
+
try {
|
|
19
|
+
fs.appendFileSync(debugLogPath, new Date().toISOString() + " " + line);
|
|
20
|
+
} catch (e) {}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function debugError(msg) {
|
|
24
|
+
var line = "[PKG] ERROR: " + msg + "\n";
|
|
25
|
+
try {
|
|
26
|
+
process.stderr.write(line);
|
|
27
|
+
} catch (e) {}
|
|
28
|
+
try {
|
|
29
|
+
fs.appendFileSync(debugLogPath, new Date().toISOString() + " " + line);
|
|
30
|
+
} catch (e) {}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// Clear previous debug log
|
|
34
|
+
try {
|
|
35
|
+
fs.writeFileSync(debugLogPath, "=== Builder Fusion Debug Log ===\n");
|
|
36
|
+
} catch (e) {}
|
|
37
|
+
|
|
38
|
+
// Immediately log that we're starting
|
|
39
|
+
debugLog("Starting builder-fusion...");
|
|
40
|
+
debugLog("Node version: " + process.version);
|
|
41
|
+
debugLog("Platform: " + process.platform);
|
|
42
|
+
debugLog("Arch: " + process.arch);
|
|
43
|
+
debugLog("Exec path: " + process.execPath);
|
|
44
|
+
debugLog("CWD: " + process.cwd());
|
|
45
|
+
debugLog("Args: " + process.argv.join(" "));
|
|
46
|
+
|
|
47
|
+
// Check if we're running in a pkg bundle
|
|
48
|
+
// @ts-expect-error - process.pkg is defined by pkg at runtime
|
|
49
|
+
var isPkgBundle = !!process.pkg;
|
|
50
|
+
debugLog("Is pkg bundle: " + isPkgBundle);
|
|
51
|
+
if (isPkgBundle) {
|
|
52
|
+
try {
|
|
53
|
+
// @ts-expect-error - process.pkg is defined by pkg at runtime
|
|
54
|
+
debugLog("pkg.entrypoint: " + process.pkg.entrypoint);
|
|
55
|
+
// @ts-expect-error - process.pkg is defined by pkg at runtime
|
|
56
|
+
debugLog("pkg.defaultEntrypoint: " + process.pkg.defaultEntrypoint);
|
|
57
|
+
} catch (e) {
|
|
58
|
+
debugError("Error reading pkg info: " + e);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Version check from main.cjs
|
|
63
|
+
var version = process.version;
|
|
64
|
+
var parts = version.replace("v", "").split(".");
|
|
65
|
+
var majorVersion = Number(parts[0]);
|
|
66
|
+
var minorVersion = Number(parts[1]);
|
|
67
|
+
|
|
68
|
+
if (majorVersion < 18) {
|
|
69
|
+
debugError("Node version too old: " + version);
|
|
70
|
+
console.error(
|
|
71
|
+
"Builder.io Dev Tools requires Node.js 18.11 or higher. You are currently running Node.js " +
|
|
72
|
+
version
|
|
73
|
+
);
|
|
74
|
+
process.exit(1);
|
|
75
|
+
} else if (majorVersion === 18) {
|
|
76
|
+
if (minorVersion < 4) {
|
|
77
|
+
debugError("Node version too old: " + version);
|
|
78
|
+
console.error(
|
|
79
|
+
"Builder.io Dev Tools requires Node.js 18.4 or higher. You are currently running Node.js" +
|
|
80
|
+
version
|
|
81
|
+
);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
} else if (minorVersion < 11) {
|
|
84
|
+
debugLog("Warning: Node 18.11+ recommended, using " + version);
|
|
85
|
+
console.error(
|
|
86
|
+
"Node.js 18.11 or higher is REQUIRED. From Node 18.0.0 to 18.11.0, there is a bug preventing correct behaviour of Builder.io. You are currently running Node.js " +
|
|
87
|
+
version
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
debugLog("Version check passed");
|
|
93
|
+
|
|
94
|
+
// Filter PATH
|
|
95
|
+
if (process.env.PATH) {
|
|
96
|
+
var pathSeparator = process.platform === "win32" ? ";" : ":";
|
|
97
|
+
var pathEntries = process.env.PATH.split(pathSeparator);
|
|
98
|
+
var filteredPaths = pathEntries.filter(function(pathEntry) {
|
|
99
|
+
return !pathEntry.includes("builder-electron-node-bin");
|
|
100
|
+
});
|
|
101
|
+
process.env.PATH = filteredPaths.join(pathSeparator);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
debugLog("PATH filtered");
|
|
105
|
+
|
|
106
|
+
// File polyfill
|
|
107
|
+
debugLog("Installing File polyfill...");
|
|
108
|
+
if (typeof globalThis.File === "undefined") {
|
|
109
|
+
try {
|
|
110
|
+
var buffer = require("node:buffer");
|
|
111
|
+
globalThis.File = buffer.File;
|
|
112
|
+
debugLog("File polyfill installed from node:buffer");
|
|
113
|
+
} catch (e) {
|
|
114
|
+
debugError("File polyfill from node:buffer failed: " + e);
|
|
115
|
+
globalThis.File = class File extends Blob {
|
|
116
|
+
constructor(chunks, name, options) {
|
|
117
|
+
super(chunks, options);
|
|
118
|
+
this.name = name || "";
|
|
119
|
+
this.lastModified = options?.lastModified || Date.now();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
debugLog("File polyfill installed (fallback Blob-based)");
|
|
123
|
+
}
|
|
124
|
+
} else {
|
|
125
|
+
try {
|
|
126
|
+
var buffer = require("node:buffer");
|
|
127
|
+
globalThis.File = buffer.File;
|
|
128
|
+
debugLog("File already exists, updated from node:buffer");
|
|
129
|
+
} catch (e) {
|
|
130
|
+
debugLog("File already exists, keeping existing");
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Now try to load the main CLI
|
|
135
|
+
debugLog("Loading index.cjs...");
|
|
136
|
+
try {
|
|
137
|
+
require("./index.cjs");
|
|
138
|
+
debugLog("index.cjs loaded successfully");
|
|
139
|
+
} catch (e) {
|
|
140
|
+
debugError("FATAL: Failed to load index.cjs");
|
|
141
|
+
debugError("Error name: " + (e.name || "unknown"));
|
|
142
|
+
debugError("Error message: " + (e.message || "unknown"));
|
|
143
|
+
debugError("Error code: " + (e.code || "none"));
|
|
144
|
+
if (e.stack) {
|
|
145
|
+
debugError("Stack trace:\n" + e.stack);
|
|
146
|
+
}
|
|
147
|
+
debugError("Exiting with code 99");
|
|
148
|
+
process.exit(99);
|
|
149
|
+
}
|
package/core/index.cjs
CHANGED
|
@@ -656,7 +656,7 @@ __export(index_exports, {
|
|
|
656
656
|
module.exports = __toCommonJS(index_exports);
|
|
657
657
|
|
|
658
658
|
// packages/dev-tools/cli/version.ts
|
|
659
|
-
var builderVersion = true ? "1.21.
|
|
659
|
+
var builderVersion = true ? "1.21.7-dev.202601220544.7c9f878c1" : "0.0.0";
|
|
660
660
|
var pkgVersion = process.env.OVERRIDE_VERSION ?? builderVersion;
|
|
661
661
|
|
|
662
662
|
// packages/dev-tools/common/fs.ts
|
package/core/index.mjs
CHANGED
|
@@ -636,7 +636,7 @@ var require_dist = __commonJS({
|
|
|
636
636
|
});
|
|
637
637
|
|
|
638
638
|
// packages/dev-tools/cli/version.ts
|
|
639
|
-
var builderVersion = true ? "1.21.
|
|
639
|
+
var builderVersion = true ? "1.21.7-dev.202601220544.7c9f878c1" : "0.0.0";
|
|
640
640
|
var pkgVersion = process.env.OVERRIDE_VERSION ?? builderVersion;
|
|
641
641
|
|
|
642
642
|
// packages/dev-tools/common/fs.ts
|
package/node/index.cjs
CHANGED
|
@@ -25059,7 +25059,7 @@ var builders = {
|
|
|
25059
25059
|
var Sentry = __toESM(require("@sentry/node"), 1);
|
|
25060
25060
|
|
|
25061
25061
|
// packages/dev-tools/cli/version.ts
|
|
25062
|
-
var builderVersion = true ? "1.21.
|
|
25062
|
+
var builderVersion = true ? "1.21.7-dev.202601220544.7c9f878c1" : "0.0.0";
|
|
25063
25063
|
var pkgVersion = process.env.OVERRIDE_VERSION ?? builderVersion;
|
|
25064
25064
|
|
|
25065
25065
|
// packages/dev-tools/node/node-sys.ts
|
package/node/index.mjs
CHANGED
|
@@ -25071,7 +25071,7 @@ var builders = {
|
|
|
25071
25071
|
import * as Sentry from "@sentry/node";
|
|
25072
25072
|
|
|
25073
25073
|
// packages/dev-tools/cli/version.ts
|
|
25074
|
-
var builderVersion = true ? "1.21.
|
|
25074
|
+
var builderVersion = true ? "1.21.7-dev.202601220544.7c9f878c1" : "0.0.0";
|
|
25075
25075
|
var pkgVersion = process.env.OVERRIDE_VERSION ?? builderVersion;
|
|
25076
25076
|
|
|
25077
25077
|
// packages/dev-tools/node/node-sys.ts
|