skybridge 0.0.0-dev.f421483 → 0.0.0-dev.f476513
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.
|
@@ -1,27 +1,4 @@
|
|
|
1
1
|
import { transform as dataLlmTransform } from "./transform-data-llm.js";
|
|
2
|
-
// Widget entry point patterns
|
|
3
|
-
const FLAT_WIDGET_REGEX = /src\/widgets\/([^/]+)\.(tsx|jsx)$/;
|
|
4
|
-
const DIR_WIDGET_REGEX = /src\/widgets\/([^/]+)\/index\.(tsx|jsx)$/;
|
|
5
|
-
const isWidgetEntryPoint = (filePath) => {
|
|
6
|
-
if (!filePath) {
|
|
7
|
-
return false;
|
|
8
|
-
}
|
|
9
|
-
return FLAT_WIDGET_REGEX.test(filePath) || DIR_WIDGET_REGEX.test(filePath);
|
|
10
|
-
};
|
|
11
|
-
const getWidgetName = (filePath) => {
|
|
12
|
-
return (filePath.match(FLAT_WIDGET_REGEX)?.[1] ||
|
|
13
|
-
filePath.match(DIR_WIDGET_REGEX)?.[1]);
|
|
14
|
-
};
|
|
15
|
-
const collectWidgetEntryPoints = (moduleNode, visited = new Set()) => {
|
|
16
|
-
if (visited.has(moduleNode)) {
|
|
17
|
-
return [];
|
|
18
|
-
}
|
|
19
|
-
visited.add(moduleNode);
|
|
20
|
-
if (isWidgetEntryPoint(moduleNode.file)) {
|
|
21
|
-
return [moduleNode];
|
|
22
|
-
}
|
|
23
|
-
return Array.from(moduleNode.importers).flatMap((importer) => collectWidgetEntryPoints(importer, visited));
|
|
24
|
-
};
|
|
25
2
|
export function skybridge() {
|
|
26
3
|
return {
|
|
27
4
|
name: "skybridge",
|
|
@@ -32,11 +9,15 @@ export function skybridge() {
|
|
|
32
9
|
const projectRoot = config.root || process.cwd();
|
|
33
10
|
const flatWidgetPattern = resolve(projectRoot, "src/widgets/*.{js,ts,jsx,tsx,html}");
|
|
34
11
|
const dirWidgetPattern = resolve(projectRoot, "src/widgets/*/index.tsx");
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
];
|
|
39
|
-
const
|
|
12
|
+
const flatWidgets = globSync(flatWidgetPattern).map((file) => [
|
|
13
|
+
file.match(/src\/widgets\/([^/]+)\.tsx$/)?.[1],
|
|
14
|
+
file,
|
|
15
|
+
]);
|
|
16
|
+
const dirWidgets = globSync(dirWidgetPattern).map((file) => [
|
|
17
|
+
file.match(/src\/widgets\/([^/]+)\/index\.tsx$/)?.[1],
|
|
18
|
+
file,
|
|
19
|
+
]);
|
|
20
|
+
const input = Object.fromEntries([...flatWidgets, ...dirWidgets]);
|
|
40
21
|
return {
|
|
41
22
|
base: "/assets",
|
|
42
23
|
build: {
|
|
@@ -53,11 +34,6 @@ export function skybridge() {
|
|
|
53
34
|
async transform(code, id) {
|
|
54
35
|
return await dataLlmTransform(code, id);
|
|
55
36
|
},
|
|
56
|
-
handleHotUpdate({ modules }) {
|
|
57
|
-
const visited = new Set();
|
|
58
|
-
const widgetEntryPoints = modules.flatMap((moduleNode) => collectWidgetEntryPoints(moduleNode, visited));
|
|
59
|
-
return [...new Set([...modules, ...widgetEntryPoints])];
|
|
60
|
-
},
|
|
61
37
|
};
|
|
62
38
|
}
|
|
63
39
|
//# sourceMappingURL=plugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/web/plugin/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../src/web/plugin/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAExE,MAAM,UAAU,SAAS;IACvB,OAAO;QACL,IAAI,EAAE,WAAW;QAEjB,KAAK,CAAC,MAAM,CAAC,MAAM;YACjB,4EAA4E;YAC5E,MAAM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.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skybridge",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.f476513",
|
|
4
4
|
"description": "Skybridge is a framework for building ChatGPT apps",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
"@modelcontextprotocol/ext-apps": "^0.2.2",
|
|
57
57
|
"@modelcontextprotocol/sdk": "^1.24.3",
|
|
58
58
|
"@testing-library/dom": "^10.4.1",
|
|
59
|
-
"@testing-library/react": "^16.3.
|
|
59
|
+
"@testing-library/react": "^16.3.1",
|
|
60
60
|
"@total-typescript/tsconfig": "^1.0.4",
|
|
61
61
|
"@types/babel__core": "^7.20.5",
|
|
62
62
|
"@types/cors": "^2.8.19",
|
|
63
63
|
"@types/express": "^5.0.3",
|
|
64
|
-
"@types/jsdom": "^21.1.
|
|
64
|
+
"@types/jsdom": "^21.1.7",
|
|
65
65
|
"@types/node": "^22.15.30",
|
|
66
66
|
"@types/react": "^19.2.2",
|
|
67
67
|
"@types/react-dom": "^19.2.2",
|