@builder.io/dev-tools 1.19.1-dev.202512171713.23dff0c22 → 1.19.2-dev.202512181512.5830fb3b9
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 +40 -34
- package/cli/index.cjs.map +2 -2
- 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 +6 -6
- package/server/index.mjs +6 -6
- package/types/cli/repo-indexing/component-discovery.d.ts +2 -1
- package/types/cli/repo-indexing/component-indexing.d.ts +2 -1
- package/types/cli/repo-indexing/icons.d.ts +2 -1
- package/types/cli/repo-indexing/installation.d.ts +2 -1
- package/types/cli/repo-indexing/repo-indexing-utils.d.ts +5 -1
- package/types/cli/repo-indexing/tokens.d.ts +3 -1
- package/types/cli/utils/dev-server-url-parser.d.ts +12 -0
- package/types/cli/utils/dev-server-url-parser.test.d.ts +1 -0
- package/types/cli/utils/rules-discovery.test.d.ts +1 -0
- package/types/common/ast/component-input-types.d.ts +1 -1
- package/types/common/ast/convert-values.d.ts +1 -1
- package/types/common/utils.d.ts +1 -1
- package/types/tsconfig.tsbuildinfo +1 -1
- package/cli/pkg-entry.cjs +0 -149
package/cli/pkg-entry.cjs
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
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
|
-
}
|