@lark-apaas/fullstack-cli 1.1.59-alpha.20260719094042 → 1.1.59-alpha.20260719124023
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/package.json
CHANGED
package/templates/scripts/dev.js
CHANGED
|
@@ -6,6 +6,7 @@ const path = require('path');
|
|
|
6
6
|
const { spawn, execFileSync, execSync } = require('child_process');
|
|
7
7
|
const readline = require('readline');
|
|
8
8
|
const {
|
|
9
|
+
applyPreviewArtifactHostOverrides,
|
|
9
10
|
buildListeningPortLookupArgs,
|
|
10
11
|
createDeferredTypecheckGate,
|
|
11
12
|
createPreviewPhaseReporter,
|
|
@@ -64,6 +65,7 @@ const previewArtifactPorts = resolvePreviewArtifactPorts({
|
|
|
64
65
|
server_port: configuredServerPort,
|
|
65
66
|
client_port: configuredClientDevPort,
|
|
66
67
|
});
|
|
68
|
+
applyPreviewArtifactHostOverrides(previewArtifactPorts, process.env);
|
|
67
69
|
const SERVER_PORT = previewArtifactPorts.server_port;
|
|
68
70
|
const CLIENT_DEV_PORT = previewArtifactPorts.client_port;
|
|
69
71
|
process.env.SERVER_PORT = String(SERVER_PORT);
|
|
@@ -107,6 +107,16 @@ function resolvePreviewArtifactPorts(options) {
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
function applyPreviewArtifactHostOverrides(ports, environment) {
|
|
111
|
+
if (!ports.cache_active) return false;
|
|
112
|
+
// Cached runtime and switcher use an explicit IPv4 loopback endpoint. Pin
|
|
113
|
+
// both shadow services to the same address family; Linux commonly resolves
|
|
114
|
+
// `localhost` to IPv6-only ::1, which otherwise makes cutover impossible.
|
|
115
|
+
environment.SERVER_HOST = '127.0.0.1';
|
|
116
|
+
environment.CLIENT_DEV_HOST = '127.0.0.1';
|
|
117
|
+
return true;
|
|
118
|
+
}
|
|
119
|
+
|
|
110
120
|
function hasRuntimeCompilerPluginConsumer(projectRoot, sourceRoot) {
|
|
111
121
|
const root = path.resolve(projectRoot, sourceRoot || 'src');
|
|
112
122
|
const stack = [root];
|
|
@@ -437,6 +447,7 @@ async function waitForTcpReady(options) {
|
|
|
437
447
|
}
|
|
438
448
|
|
|
439
449
|
module.exports = {
|
|
450
|
+
applyPreviewArtifactHostOverrides,
|
|
440
451
|
buildListeningPortLookupArgs,
|
|
441
452
|
createDeferredTypecheckGate,
|
|
442
453
|
createPreviewPhaseReporter,
|