@superblocksteam/sdk 2.0.105 → 2.0.106-next.1
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/.turbo/turbo-build.log +1 -1
- package/dist/cli-replacement/dev.d.mts +3 -0
- package/dist/cli-replacement/dev.d.mts.map +1 -1
- package/dist/cli-replacement/dev.mjs +1 -0
- package/dist/cli-replacement/dev.mjs.map +1 -1
- package/dist/client.d.ts +6 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -5
- package/dist/client.js.map +1 -1
- package/dist/collect-sdk-apis.d.mts +3 -2
- package/dist/collect-sdk-apis.d.mts.map +1 -1
- package/dist/collect-sdk-apis.mjs +10 -7
- package/dist/collect-sdk-apis.mjs.map +1 -1
- package/dist/collect-sdk-apis.test.mjs +35 -0
- package/dist/collect-sdk-apis.test.mjs.map +1 -1
- package/dist/dev-utils/dev-server.d.mts +18 -1
- package/dist/dev-utils/dev-server.d.mts.map +1 -1
- package/dist/dev-utils/dev-server.mjs +113 -42
- package/dist/dev-utils/dev-server.mjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/parse-sdk-registry.d.mts +9 -1
- package/dist/parse-sdk-registry.d.mts.map +1 -1
- package/dist/parse-sdk-registry.mjs +10 -1
- package/dist/parse-sdk-registry.mjs.map +1 -1
- package/dist/parse-sdk-registry.test.mjs +13 -1
- package/dist/parse-sdk-registry.test.mjs.map +1 -1
- package/dist/vite-plugin-generate-api-build-manifest.d.mts.map +1 -1
- package/dist/vite-plugin-generate-api-build-manifest.mjs.map +1 -1
- package/package.json +6 -6
- package/src/cli-replacement/dev.mts +5 -0
- package/src/client.ts +11 -6
- package/src/collect-sdk-apis.mts +11 -7
- package/src/collect-sdk-apis.test.mts +38 -0
- package/src/dev-utils/dev-server.mts +135 -47
- package/src/index.ts +1 -1
- package/src/parse-sdk-registry.mts +23 -1
- package/src/parse-sdk-registry.test.mts +19 -1
- package/src/vite-plugin-generate-api-build-manifest.mts +1 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-sdk-registry.test.mjs","sourceRoot":"","sources":["../src/parse-sdk-registry.test.mts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,MAAM,IAAI,GAAG,MAAM,CAAC;IACpB,MAAM,WAAW,GAAG,kBAAkB,CAAC;IACvC,MAAM,UAAU,GAAG,KAAK,EAAE,CAAS,EAAE,EAAE;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACvD,OAAO,CACL,GAAG,KAAK,6BAA6B;YACrC,GAAG,KAAK,gCAAgC;YACxC,GAAG,KAAK,gCAAgC;YACxC,GAAG,KAAK,2BAA2B,
|
|
1
|
+
{"version":3,"file":"parse-sdk-registry.test.mjs","sourceRoot":"","sources":["../src/parse-sdk-registry.test.mts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAChC,MAAM,IAAI,GAAG,MAAM,CAAC;IACpB,MAAM,WAAW,GAAG,kBAAkB,CAAC;IACvC,MAAM,UAAU,GAAG,KAAK,EAAE,CAAS,EAAE,EA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AM,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QACvE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;QAC1E,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin-generate-api-build-manifest.d.mts","sourceRoot":"","sources":["../src/vite-plugin-generate-api-build-manifest.mts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAqBnC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"vite-plugin-generate-api-build-manifest.d.mts","sourceRoot":"","sources":["../src/vite-plugin-generate-api-build-manifest.mts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAqBnC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,8BAA8B,CAAC,IAAI,EAAE,MAAM,GAuGpD,MAAM,CACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite-plugin-generate-api-build-manifest.mjs","sourceRoot":"","sources":["../src/vite-plugin-generate-api-build-manifest.mts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,MAAM,WAAW,CAAC;AAC3B,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,IAAI,MAAM,MAAM,C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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superblocksteam/sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.106-next.1",
|
|
4
4
|
"description": "Superblocks JS SDK",
|
|
5
5
|
"homepage": "https://www.superblocks.com",
|
|
6
6
|
"license": "Superblocks Community Software License",
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"vite-tsconfig-paths": "^6.0.4",
|
|
49
49
|
"winston": "^3.17.0",
|
|
50
50
|
"yaml": "^2.7.1",
|
|
51
|
-
"@superblocksteam/library-shared": "2.0.
|
|
52
|
-
"@superblocksteam/shared": "0.
|
|
53
|
-
"@superblocksteam/telemetry": "2.0.
|
|
54
|
-
"@superblocksteam/util": "2.0.
|
|
55
|
-
"@superblocksteam/vite-plugin-file-sync": "2.0.
|
|
51
|
+
"@superblocksteam/library-shared": "2.0.106-next.1",
|
|
52
|
+
"@superblocksteam/shared": "0.9578.1",
|
|
53
|
+
"@superblocksteam/telemetry": "2.0.106-next.1",
|
|
54
|
+
"@superblocksteam/util": "2.0.106-next.1",
|
|
55
|
+
"@superblocksteam/vite-plugin-file-sync": "2.0.106-next.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@eslint/js": "^9.39.2",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as child_process from "node:child_process";
|
|
2
2
|
import * as nodeFs from "node:fs/promises";
|
|
3
|
+
import type { Server as HttpServer } from "node:http";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import * as readline from "node:readline";
|
|
5
6
|
import { promisify } from "node:util";
|
|
@@ -284,6 +285,9 @@ export async function dev(options: {
|
|
|
284
285
|
|
|
285
286
|
/** Pre-fetched application data from the CLI validation step (avoids a duplicate network call). */
|
|
286
287
|
prefetchedApplication?: MultiPageApplicationWrapper;
|
|
288
|
+
|
|
289
|
+
/** Pre-existing HTTP server from warm standby mode (avoids port gap on transition). */
|
|
290
|
+
existingServer?: HttpServer;
|
|
287
291
|
}) {
|
|
288
292
|
const {
|
|
289
293
|
cwd,
|
|
@@ -886,6 +890,7 @@ export async function dev(options: {
|
|
|
886
890
|
logger: options.logger,
|
|
887
891
|
sdk,
|
|
888
892
|
superblocksBaseUrl: tokenConfig.superblocksBaseUrl,
|
|
893
|
+
existingServer: options.existingServer,
|
|
889
894
|
} as unknown as Parameters<typeof createDevServer>[0];
|
|
890
895
|
const result = await createDevServer(createDevServerOptions);
|
|
891
896
|
span.end();
|
package/src/client.ts
CHANGED
|
@@ -2169,13 +2169,18 @@ export interface IntegrationSummary {
|
|
|
2169
2169
|
created: string;
|
|
2170
2170
|
updated: string;
|
|
2171
2171
|
ownerEmail?: string;
|
|
2172
|
+
creator?: {
|
|
2173
|
+
id: string;
|
|
2174
|
+
email: string;
|
|
2175
|
+
name: string;
|
|
2176
|
+
};
|
|
2177
|
+
isUserConfigured: boolean;
|
|
2172
2178
|
}
|
|
2173
2179
|
|
|
2174
2180
|
export interface IntegrationDetail extends IntegrationSummary {
|
|
2175
2181
|
configurations?: unknown[];
|
|
2176
2182
|
demoIntegrationId?: string;
|
|
2177
2183
|
enabledForV2?: boolean;
|
|
2178
|
-
isUserConfigured?: boolean;
|
|
2179
2184
|
}
|
|
2180
2185
|
|
|
2181
2186
|
export interface IntegrationMutationPayload {
|
|
@@ -2195,13 +2200,13 @@ export async function fetchIntegrations({
|
|
|
2195
2200
|
}): Promise<IntegrationSummary[]> {
|
|
2196
2201
|
try {
|
|
2197
2202
|
const url = new URL(
|
|
2198
|
-
`${BASE_SERVER_API_URL_V1}/integrations`,
|
|
2203
|
+
`${BASE_SERVER_API_URL_V1}/integrations/superset`,
|
|
2199
2204
|
superblocksBaseUrl,
|
|
2200
2205
|
);
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2206
|
+
const ALL_INTEGRATION_KINDS = ["PLUGIN", "SECRET"]; // superset endpoint requires `kind`; these cover all IntegrationKind values
|
|
2207
|
+
const kinds = filters?.kind?.length ? filters.kind : ALL_INTEGRATION_KINDS;
|
|
2208
|
+
for (const k of kinds) {
|
|
2209
|
+
url.searchParams.append("kind", k);
|
|
2205
2210
|
}
|
|
2206
2211
|
if (filters?.slug) {
|
|
2207
2212
|
for (const s of filters.slug) {
|
package/src/collect-sdk-apis.mts
CHANGED
|
@@ -4,10 +4,11 @@ import {
|
|
|
4
4
|
extractIntegrationsFromSource,
|
|
5
5
|
type IntegrationInfo,
|
|
6
6
|
} from "./extract-api-integrations.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import { parseSdkRegistryWithExportNames } from "./parse-sdk-registry.mjs";
|
|
8
8
|
|
|
9
9
|
export type SdkApiEntry = {
|
|
10
10
|
entryPoint: string;
|
|
11
|
+
exportName?: string;
|
|
11
12
|
integrations?: IntegrationInfo[];
|
|
12
13
|
};
|
|
13
14
|
|
|
@@ -25,8 +26,8 @@ export type CollectSdkApisFs = {
|
|
|
25
26
|
*
|
|
26
27
|
* @param root - App root directory
|
|
27
28
|
* @param fs - File system operations (pathExists, readFile)
|
|
28
|
-
* @returns Map of API name → { entryPoint, integrations? } or
|
|
29
|
-
* if no registry exists
|
|
29
|
+
* @returns Map of API name → { entryPoint, exportName?, integrations? } or
|
|
30
|
+
* empty object if no registry exists
|
|
30
31
|
*/
|
|
31
32
|
export async function collectSdkApisFromRegistry(
|
|
32
33
|
root: string,
|
|
@@ -39,7 +40,7 @@ export async function collectSdkApisFromRegistry(
|
|
|
39
40
|
|
|
40
41
|
const registryContent = await fs.readFile(sdkRegistryPath, "utf-8");
|
|
41
42
|
const registryDir = path.dirname(sdkRegistryPath);
|
|
42
|
-
const
|
|
43
|
+
const keyToEntry = await parseSdkRegistryWithExportNames(
|
|
43
44
|
registryContent,
|
|
44
45
|
registryDir,
|
|
45
46
|
root,
|
|
@@ -47,9 +48,12 @@ export async function collectSdkApisFromRegistry(
|
|
|
47
48
|
);
|
|
48
49
|
|
|
49
50
|
const sdkApis: SdkApisResult = {};
|
|
50
|
-
for (const [apiName,
|
|
51
|
-
const entry: SdkApiEntry = { entryPoint };
|
|
52
|
-
|
|
51
|
+
for (const [apiName, registryEntry] of keyToEntry) {
|
|
52
|
+
const entry: SdkApiEntry = { entryPoint: registryEntry.entryPoint };
|
|
53
|
+
if (registryEntry.exportName) {
|
|
54
|
+
entry.exportName = registryEntry.exportName;
|
|
55
|
+
}
|
|
56
|
+
const absolutePath = path.join(root, registryEntry.entryPoint);
|
|
53
57
|
|
|
54
58
|
try {
|
|
55
59
|
const source = await fs.readFile(absolutePath, "utf-8");
|
|
@@ -12,6 +12,7 @@ describe("collectSdkApisFromRegistry", () => {
|
|
|
12
12
|
return (
|
|
13
13
|
rel === "server/apis/index.ts" ||
|
|
14
14
|
rel === "server/apis/GetUsers/api.ts" ||
|
|
15
|
+
rel === "server/apis/orders.ts" ||
|
|
15
16
|
rel === "server/apis/v2/GetUsers/api.ts" ||
|
|
16
17
|
rel === "server/apis/CreateOrder/api.ts"
|
|
17
18
|
);
|
|
@@ -104,6 +105,43 @@ export default apis;
|
|
|
104
105
|
});
|
|
105
106
|
});
|
|
106
107
|
|
|
108
|
+
it("captures exportName for named and aliased imports", async () => {
|
|
109
|
+
const registryContent = `
|
|
110
|
+
import { CreateOrder, GetOrders as ListOrders } from './orders.js';
|
|
111
|
+
const apis = { CreateOrder, ListOrders } as const;
|
|
112
|
+
export default apis;
|
|
113
|
+
`;
|
|
114
|
+
const readFile = vi.fn(async (filePath: string) => {
|
|
115
|
+
const rel = path.relative(root, filePath).replace(/\\/g, "/");
|
|
116
|
+
if (rel === "server/apis/index.ts") {
|
|
117
|
+
return registryContent;
|
|
118
|
+
}
|
|
119
|
+
if (rel === "server/apis/orders.ts") {
|
|
120
|
+
return `
|
|
121
|
+
export const CreateOrder = api({});
|
|
122
|
+
export const GetOrders = api({});
|
|
123
|
+
`;
|
|
124
|
+
}
|
|
125
|
+
throw new Error(`Unexpected read: ${rel}`);
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
const result = await collectSdkApisFromRegistry(root, {
|
|
129
|
+
pathExists,
|
|
130
|
+
readFile,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
expect(result).toEqual({
|
|
134
|
+
CreateOrder: {
|
|
135
|
+
entryPoint: "server/apis/orders.ts",
|
|
136
|
+
exportName: "CreateOrder",
|
|
137
|
+
},
|
|
138
|
+
ListOrders: {
|
|
139
|
+
entryPoint: "server/apis/orders.ts",
|
|
140
|
+
exportName: "GetOrders",
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
|
|
107
145
|
it("keeps entryPoint when integration extraction fails", async () => {
|
|
108
146
|
const registryContent = `
|
|
109
147
|
import GetUsers from './GetUsers/api.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
1
2
|
import type http from "node:http";
|
|
2
3
|
import net from "node:net";
|
|
3
4
|
import os from "node:os";
|
|
@@ -112,6 +113,13 @@ interface CreateDevServerOptions {
|
|
|
112
113
|
sdk?: SuperblocksSdk;
|
|
113
114
|
/** Explicitly provided base URL from the CLI; preferred over auth-file reads. */
|
|
114
115
|
superblocksBaseUrl?: string;
|
|
116
|
+
/**
|
|
117
|
+
* Pre-existing HTTP server from warm standby mode. When provided, the dev
|
|
118
|
+
* server attaches its Express app as a request handler on this server instead
|
|
119
|
+
* of creating a new one and calling listen(). This avoids the port gap that
|
|
120
|
+
* causes 502s from the gateway during the warm → full server transition.
|
|
121
|
+
*/
|
|
122
|
+
existingServer?: http.Server;
|
|
115
123
|
}
|
|
116
124
|
|
|
117
125
|
let httpServer: http.Server;
|
|
@@ -131,6 +139,7 @@ export async function createDevServer({
|
|
|
131
139
|
port,
|
|
132
140
|
sdk,
|
|
133
141
|
superblocksBaseUrl: explicitBaseUrl,
|
|
142
|
+
existingServer,
|
|
134
143
|
}: CreateDevServerOptions) {
|
|
135
144
|
const logger = getLogger(loggerOverride);
|
|
136
145
|
if (httpServer) {
|
|
@@ -384,50 +393,21 @@ export async function createDevServer({
|
|
|
384
393
|
}
|
|
385
394
|
}
|
|
386
395
|
|
|
387
|
-
logger.info("
|
|
388
|
-
|
|
389
|
-
|
|
396
|
+
logger.info("Received connect request, waiting for vite server...");
|
|
397
|
+
// Vite is started eagerly after HTTP server listen (see below).
|
|
398
|
+
// Wait for it to be ready before responding.
|
|
399
|
+
try {
|
|
400
|
+
await vitePromise;
|
|
390
401
|
res.send(JSON.stringify(healthResponse));
|
|
391
|
-
|
|
402
|
+
} catch (e) {
|
|
403
|
+
logger.error(
|
|
404
|
+
"Vite server failed to initialize",
|
|
405
|
+
getErrorMeta(e as Error),
|
|
406
|
+
);
|
|
407
|
+
res
|
|
408
|
+
.status(500)
|
|
409
|
+
.send(JSON.stringify({ error: "Dev server failed to initialize" }));
|
|
392
410
|
}
|
|
393
|
-
logger.info("Starting dev server");
|
|
394
|
-
isViteServerInitialized = true;
|
|
395
|
-
|
|
396
|
-
const featureFlags = await sdk?.getFeatureFlagsForCurrentUser();
|
|
397
|
-
|
|
398
|
-
// TODO(code-mode): should this include any validation checks, such as getting a token?
|
|
399
|
-
|
|
400
|
-
startVite({
|
|
401
|
-
port,
|
|
402
|
-
app,
|
|
403
|
-
root,
|
|
404
|
-
mode,
|
|
405
|
-
fsOperationQueue,
|
|
406
|
-
syncService,
|
|
407
|
-
lockService,
|
|
408
|
-
aiService,
|
|
409
|
-
gitService,
|
|
410
|
-
activateGitService,
|
|
411
|
-
snapshotManager,
|
|
412
|
-
checkAuthorization,
|
|
413
|
-
logger: loggerOverride,
|
|
414
|
-
httpServer,
|
|
415
|
-
superblocksBaseUrl: explicitBaseUrl || localToken?.superblocksBaseUrl,
|
|
416
|
-
features: {
|
|
417
|
-
enableSessionRecording: featureFlags?.enableSessionRecording() ?? false,
|
|
418
|
-
},
|
|
419
|
-
}).then(
|
|
420
|
-
(result) => {
|
|
421
|
-
logger.info("Dev server initialized");
|
|
422
|
-
viteResolve();
|
|
423
|
-
viteCreationResults = result;
|
|
424
|
-
res.send(JSON.stringify(healthResponse));
|
|
425
|
-
},
|
|
426
|
-
(e) => {
|
|
427
|
-
logger.error("Error initializing dev server", getErrorMeta(e));
|
|
428
|
-
viteReject(e);
|
|
429
|
-
},
|
|
430
|
-
);
|
|
431
411
|
});
|
|
432
412
|
|
|
433
413
|
app.post("/_sb_disconnect", authHandler, async (req, res) => {
|
|
@@ -500,8 +480,13 @@ export async function createDevServer({
|
|
|
500
480
|
timeSinceLastActivityMs: lockService.timeSinceLastActivity,
|
|
501
481
|
});
|
|
502
482
|
} else {
|
|
503
|
-
|
|
504
|
-
|
|
483
|
+
// Lock service may be undefined when skipSync=true (warm pool activation).
|
|
484
|
+
// Return a safe default instead of rejecting vitePromise which would crash the server.
|
|
485
|
+
res.send({
|
|
486
|
+
isUserActive: false,
|
|
487
|
+
connectedUsers: [],
|
|
488
|
+
timeSinceLastActivityMs: 0,
|
|
489
|
+
});
|
|
505
490
|
}
|
|
506
491
|
});
|
|
507
492
|
|
|
@@ -533,9 +518,64 @@ export async function createDevServer({
|
|
|
533
518
|
);
|
|
534
519
|
});
|
|
535
520
|
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
521
|
+
if (existingServer) {
|
|
522
|
+
// Warm standby mode: reuse the pre-existing HTTP server to avoid a port gap.
|
|
523
|
+
// Replace the warm server's request handler with the full Express app.
|
|
524
|
+
existingServer.removeAllListeners("request");
|
|
525
|
+
existingServer.on("request", app);
|
|
526
|
+
httpServer = existingServer;
|
|
527
|
+
logger.info(
|
|
528
|
+
`Attached full dev server to existing HTTP server on port ${port}`,
|
|
529
|
+
);
|
|
530
|
+
} else {
|
|
531
|
+
logger.info(`Starting HTTP server on port ${port}`);
|
|
532
|
+
httpServer = await app.listen(port);
|
|
533
|
+
logger.info(`HTTP server started successfully on port ${port}`);
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
// Start vite eagerly so it's ready (or nearly ready) by the time the editor
|
|
537
|
+
// connects via /_sb_connect. Previously vite was started lazily on first
|
|
538
|
+
// /_sb_connect, adding ~5s to perceived connection time.
|
|
539
|
+
if (!isViteServerInitialized) {
|
|
540
|
+
isViteServerInitialized = true;
|
|
541
|
+
logger.info("Eagerly starting vite server...");
|
|
542
|
+
|
|
543
|
+
const featureFlags = await sdk
|
|
544
|
+
?.getFeatureFlagsForCurrentUser()
|
|
545
|
+
.catch(() => undefined);
|
|
546
|
+
|
|
547
|
+
startVite({
|
|
548
|
+
port,
|
|
549
|
+
app,
|
|
550
|
+
root,
|
|
551
|
+
mode,
|
|
552
|
+
fsOperationQueue,
|
|
553
|
+
syncService,
|
|
554
|
+
lockService,
|
|
555
|
+
aiService,
|
|
556
|
+
gitService,
|
|
557
|
+
activateGitService,
|
|
558
|
+
snapshotManager,
|
|
559
|
+
checkAuthorization,
|
|
560
|
+
logger: loggerOverride,
|
|
561
|
+
httpServer,
|
|
562
|
+
superblocksBaseUrl: explicitBaseUrl || localToken?.superblocksBaseUrl,
|
|
563
|
+
features: {
|
|
564
|
+
enableSessionRecording: featureFlags?.enableSessionRecording() ?? false,
|
|
565
|
+
},
|
|
566
|
+
}).then(
|
|
567
|
+
(result) => {
|
|
568
|
+
logger.info("Vite server initialized eagerly");
|
|
569
|
+
viteResolve();
|
|
570
|
+
viteCreationResults = result;
|
|
571
|
+
},
|
|
572
|
+
(e) => {
|
|
573
|
+
logger.error("Error initializing vite server", getErrorMeta(e));
|
|
574
|
+
viteReject(e);
|
|
575
|
+
},
|
|
576
|
+
);
|
|
577
|
+
}
|
|
578
|
+
|
|
539
579
|
return httpServer;
|
|
540
580
|
}
|
|
541
581
|
|
|
@@ -744,6 +784,54 @@ async function startVite({
|
|
|
744
784
|
});
|
|
745
785
|
}
|
|
746
786
|
|
|
787
|
+
/**
|
|
788
|
+
* Pre-warm the Vite dependency cache by creating and immediately closing a
|
|
789
|
+
* minimal Vite server. This populates `node_modules/.vite/deps` with
|
|
790
|
+
* pre-bundled dependencies so that `createDevServer` starts ~1-2s faster.
|
|
791
|
+
*
|
|
792
|
+
* Call this during warm standby phase while waiting for activation.
|
|
793
|
+
* Non-fatal — if it fails the activation-time Vite start still works,
|
|
794
|
+
* just without the cache benefit.
|
|
795
|
+
*/
|
|
796
|
+
export async function preWarmViteCache(root: string): Promise<void> {
|
|
797
|
+
const start = Date.now();
|
|
798
|
+
console.log("[warm] Pre-warming Vite dependency cache...");
|
|
799
|
+
try {
|
|
800
|
+
// Create a Vite server with optimizeDeps.noDiscovery so it only processes
|
|
801
|
+
// the deps listed in optimizeDeps.include (from vite.config) without
|
|
802
|
+
// scanning source files. This is faster and avoids hanging on HMR setup.
|
|
803
|
+
const server = await createServer({
|
|
804
|
+
root,
|
|
805
|
+
mode: "development",
|
|
806
|
+
server: { middlewareMode: true, hmr: false },
|
|
807
|
+
plugins: [tsconfigPaths()],
|
|
808
|
+
logLevel: "warn",
|
|
809
|
+
optimizeDeps: { noDiscovery: true },
|
|
810
|
+
});
|
|
811
|
+
// Poll for the dep cache directory instead of sleeping a fixed 500ms.
|
|
812
|
+
// Vite renames a temp dir to node_modules/.vite/deps once optimization
|
|
813
|
+
// completes; polling avoids both under-waiting (cache not committed) and
|
|
814
|
+
// over-waiting (wasted time on fast disks).
|
|
815
|
+
const depsDir = path.join(root, "node_modules", ".vite", "deps");
|
|
816
|
+
const maxWaitMs = 5_000;
|
|
817
|
+
const pollMs = 50;
|
|
818
|
+
const deadline = Date.now() + maxWaitMs;
|
|
819
|
+
while (!existsSync(depsDir) && Date.now() < deadline) {
|
|
820
|
+
await new Promise((r) => setTimeout(r, pollMs));
|
|
821
|
+
}
|
|
822
|
+
await server.close();
|
|
823
|
+
const cached = existsSync(depsDir);
|
|
824
|
+
console.log(
|
|
825
|
+
`[warm] Vite cache ${cached ? "warmed" : "not committed (timed out)"} in ${Date.now() - start}ms`,
|
|
826
|
+
);
|
|
827
|
+
} catch (error) {
|
|
828
|
+
console.warn(
|
|
829
|
+
`[warm] Vite cache pre-warm failed (non-fatal, ${Date.now() - start}ms):`,
|
|
830
|
+
error,
|
|
831
|
+
);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
747
835
|
const DEFAULT_HMR_PORT = 24678;
|
|
748
836
|
|
|
749
837
|
function getFreePort() {
|
package/src/index.ts
CHANGED
|
@@ -64,7 +64,7 @@ export {
|
|
|
64
64
|
export { AUTO_UPGRADE_EXIT_CODE } from "./cli-replacement/automatic-upgrades.js";
|
|
65
65
|
export { RESTART_EXIT_CODE } from "./dev-utils/dev-server.mjs";
|
|
66
66
|
|
|
67
|
-
export { createDevServer } from "./dev-utils/dev-server.mjs";
|
|
67
|
+
export { createDevServer, preWarmViteCache } from "./dev-utils/dev-server.mjs";
|
|
68
68
|
|
|
69
69
|
export { TokenManager } from "./dev-utils/token-manager.js";
|
|
70
70
|
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
parseSdkRegistryFromContent,
|
|
5
|
+
parseSdkRegistryEntries,
|
|
6
|
+
type RegistryKeyToEntry,
|
|
7
|
+
} from "@superblocksteam/vite-plugin-file-sync/parsing";
|
|
4
8
|
|
|
5
9
|
export type RegistryKeyToPath = Map<string, string>;
|
|
10
|
+
export type { RegistryKeyToEntry };
|
|
6
11
|
|
|
7
12
|
type PathExists = (p: string) => Promise<boolean>;
|
|
8
13
|
const RESOLUTION_EXTENSIONS = [".ts", ".tsx", ".js"] as const;
|
|
@@ -14,6 +19,8 @@ const RESOLUTION_EXTENSIONS = [".ts", ".tsx", ".js"] as const;
|
|
|
14
19
|
*
|
|
15
20
|
* Supports:
|
|
16
21
|
* - import X from './Path/api.js'; const apis = { X }; export default apis;
|
|
22
|
+
* - import { A, B } from './Path/apis.js'; export default { A, B };
|
|
23
|
+
* - import X, { Y } from './Path/apis.js'; export default { X, Y };
|
|
17
24
|
* - const apis = { X: () => import('./Path/api') }; export default apis;
|
|
18
25
|
* - export default { X, Y: () => import('./Path/api') };
|
|
19
26
|
*
|
|
@@ -33,6 +40,21 @@ export async function parseSdkRegistry(
|
|
|
33
40
|
);
|
|
34
41
|
}
|
|
35
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Parse server/apis/index.ts to extract rich metadata including exportName.
|
|
45
|
+
* Used by the build manifest generator to include exportName for named imports.
|
|
46
|
+
*/
|
|
47
|
+
export async function parseSdkRegistryWithExportNames(
|
|
48
|
+
registryContent: string,
|
|
49
|
+
registryDir: string,
|
|
50
|
+
root: string,
|
|
51
|
+
pathExists: PathExists,
|
|
52
|
+
): Promise<RegistryKeyToEntry> {
|
|
53
|
+
return parseSdkRegistryEntries(registryContent, (importPath) =>
|
|
54
|
+
resolveImportPath(importPath, registryDir, root, pathExists),
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
36
58
|
async function resolveImportPath(
|
|
37
59
|
importPath: string,
|
|
38
60
|
registryDir: string,
|
|
@@ -13,7 +13,8 @@ describe("parseSdkRegistry", () => {
|
|
|
13
13
|
rel === "server/apis/GetUsers/api.ts" ||
|
|
14
14
|
rel === "server/apis/v2/GetUsers/api.ts" ||
|
|
15
15
|
rel === "server/apis/CreateOrder/api.ts" ||
|
|
16
|
-
rel === "server/apis/JsOnly/api.js"
|
|
16
|
+
rel === "server/apis/JsOnly/api.js" ||
|
|
17
|
+
rel === "server/apis/shared/user-apis.ts"
|
|
17
18
|
);
|
|
18
19
|
};
|
|
19
20
|
|
|
@@ -148,4 +149,21 @@ export default { JsOnly };
|
|
|
148
149
|
expect(result.get("JsOnly")).toBe("server/apis/JsOnly/api.js");
|
|
149
150
|
expect(result.size).toBe(1);
|
|
150
151
|
});
|
|
152
|
+
|
|
153
|
+
it("resolves named imports from a shared entrypoint file", async () => {
|
|
154
|
+
const content = `
|
|
155
|
+
import { GetUsers, CreateOrder } from './shared/user-apis.js';
|
|
156
|
+
const apis = { GetUsers, CreateOrder } as const;
|
|
157
|
+
export default apis;
|
|
158
|
+
`;
|
|
159
|
+
const result = await parseSdkRegistry(
|
|
160
|
+
content,
|
|
161
|
+
registryDir,
|
|
162
|
+
root,
|
|
163
|
+
pathExists,
|
|
164
|
+
);
|
|
165
|
+
expect(result.get("GetUsers")).toBe("server/apis/shared/user-apis.ts");
|
|
166
|
+
expect(result.get("CreateOrder")).toBe("server/apis/shared/user-apis.ts");
|
|
167
|
+
expect(result.size).toBe(2);
|
|
168
|
+
});
|
|
151
169
|
});
|