skybridge 0.0.0-dev.5c6cff7 → 0.0.0-dev.5cb0706
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/README.md +144 -0
- package/bin/run.js +0 -4
- package/dist/cli/telemetry.d.ts +3 -35
- package/dist/cli/telemetry.js +17 -78
- package/dist/cli/telemetry.js.map +1 -1
- package/dist/cli/use-execute-steps.d.ts +2 -1
- package/dist/cli/use-execute-steps.js +6 -1
- package/dist/cli/use-execute-steps.js.map +1 -1
- package/dist/cli/use-nodemon.d.ts +6 -0
- package/dist/cli/use-nodemon.js +61 -0
- package/dist/cli/use-nodemon.js.map +1 -0
- package/dist/cli/use-typescript-check.d.ts +8 -0
- package/dist/cli/use-typescript-check.js +59 -0
- package/dist/cli/use-typescript-check.js.map +1 -0
- package/dist/commands/build.js +4 -2
- package/dist/commands/build.js.map +1 -1
- package/dist/commands/dev.d.ts +3 -1
- package/dist/commands/dev.js +20 -9
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/start.js +4 -9
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/telemetry/disable.d.ts +5 -0
- package/dist/commands/telemetry/disable.js +14 -0
- package/dist/commands/telemetry/disable.js.map +1 -0
- package/dist/commands/telemetry/enable.d.ts +5 -0
- package/dist/commands/telemetry/enable.js +14 -0
- package/dist/commands/telemetry/enable.js.map +1 -0
- package/dist/commands/telemetry/status.d.ts +5 -0
- package/dist/commands/telemetry/status.js +14 -0
- package/dist/commands/telemetry/status.js.map +1 -0
- package/dist/server/asset-base-url-transform-plugin.d.ts +11 -0
- package/dist/server/asset-base-url-transform-plugin.js +34 -0
- package/dist/server/asset-base-url-transform-plugin.js.map +1 -0
- package/dist/server/asset-base-url-transform-plugin.test.d.ts +1 -0
- package/dist/server/asset-base-url-transform-plugin.test.js +56 -0
- package/dist/server/asset-base-url-transform-plugin.test.js.map +1 -0
- package/dist/server/server.js +18 -3
- package/dist/server/server.js.map +1 -1
- package/dist/server/templateHelper.d.ts +1 -0
- package/dist/server/templateHelper.js.map +1 -1
- package/dist/server/templates/development.hbs +3 -2
- package/dist/server/templates/production.hbs +1 -2
- package/dist/server/widgetsDevServer.js +11 -1
- package/dist/server/widgetsDevServer.js.map +1 -1
- package/dist/test/widget.test.js +2 -2
- package/dist/test/widget.test.js.map +1 -1
- package/dist/web/bridges/apps-sdk/adaptor.d.ts +9 -1
- package/dist/web/bridges/apps-sdk/adaptor.js +25 -0
- package/dist/web/bridges/apps-sdk/adaptor.js.map +1 -1
- package/dist/web/bridges/apps-sdk/index.d.ts +1 -1
- package/dist/web/bridges/apps-sdk/index.js.map +1 -1
- package/dist/web/bridges/apps-sdk/types.d.ts +8 -14
- package/dist/web/bridges/apps-sdk/types.js.map +1 -1
- package/dist/web/bridges/mcp-app/adaptor.d.ts +18 -1
- package/dist/web/bridges/mcp-app/adaptor.js +40 -0
- package/dist/web/bridges/mcp-app/adaptor.js.map +1 -1
- package/dist/web/bridges/types.d.ts +24 -0
- package/dist/web/components/modal-provider.d.ts +4 -0
- package/dist/web/components/modal-provider.js +47 -0
- package/dist/web/components/modal-provider.js.map +1 -0
- package/dist/web/hooks/index.d.ts +1 -0
- package/dist/web/hooks/index.js +1 -0
- package/dist/web/hooks/index.js.map +1 -1
- package/dist/web/hooks/use-files.d.ts +2 -6
- package/dist/web/hooks/use-files.js +4 -2
- package/dist/web/hooks/use-files.js.map +1 -1
- package/dist/web/hooks/use-files.test.js +1 -0
- package/dist/web/hooks/use-files.test.js.map +1 -1
- package/dist/web/hooks/use-request-modal.d.ts +2 -2
- package/dist/web/hooks/use-request-modal.js +9 -7
- package/dist/web/hooks/use-request-modal.js.map +1 -1
- package/dist/web/hooks/use-set-open-in-app-url.d.ts +1 -0
- package/dist/web/hooks/use-set-open-in-app-url.js +8 -0
- package/dist/web/hooks/use-set-open-in-app-url.js.map +1 -0
- package/dist/web/hooks/use-set-open-in-app-url.test.d.ts +1 -0
- package/dist/web/hooks/use-set-open-in-app-url.test.js +49 -0
- package/dist/web/hooks/use-set-open-in-app-url.test.js.map +1 -0
- package/dist/web/mount-widget.js +9 -1
- package/dist/web/mount-widget.js.map +1 -1
- package/dist/web/plugin/plugin.js +16 -9
- package/dist/web/plugin/plugin.js.map +1 -1
- package/dist/web/proxy.js +0 -1
- package/dist/web/proxy.js.map +1 -1
- package/package.json +21 -19
- package/dist/commands/telemetry.d.ts +0 -9
- package/dist/commands/telemetry.js +0 -40
- package/dist/commands/telemetry.js.map +0 -1
- package/dist/hooks/finally.d.ts +0 -8
- package/dist/hooks/finally.js +0 -19
- package/dist/hooks/finally.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
<img alt="Skybridge" src="https://raw.githubusercontent.com/alpic-ai/skybridge/main/docs/images/github-banner.png" width="100%">
|
|
4
|
+
|
|
5
|
+
<br />
|
|
6
|
+
|
|
7
|
+
# Skybridge
|
|
8
|
+
|
|
9
|
+
**Build ChatGPT & MCP Apps. The Modern TypeScript Way.**
|
|
10
|
+
|
|
11
|
+
The fullstack TypeScript framework for AI-embedded widgets.<br />
|
|
12
|
+
**Type-safe. React-powered. Platform-agnostic.**
|
|
13
|
+
|
|
14
|
+
<br />
|
|
15
|
+
|
|
16
|
+
[](https://www.npmjs.com/package/skybridge)
|
|
17
|
+
[](https://www.npmjs.com/package/skybridge)
|
|
18
|
+
[](https://github.com/alpic-ai/skybridge/blob/main/LICENSE)
|
|
19
|
+
|
|
20
|
+
<br />
|
|
21
|
+
|
|
22
|
+
[Documentation](https://docs.skybridge.tech) · [Quick Start](https://docs.skybridge.tech/quickstart/create-new-app) · [Showcase](https://docs.skybridge.tech/showcase)
|
|
23
|
+
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<br />
|
|
27
|
+
|
|
28
|
+
## ✨ Why Skybridge?
|
|
29
|
+
|
|
30
|
+
ChatGPT Apps and MCP Apps let you embed **rich, interactive UIs** directly in AI conversations. But the raw SDKs are low-level—no hooks, no type safety, no dev tools, and no HMR.
|
|
31
|
+
|
|
32
|
+
**Skybridge fixes that.**
|
|
33
|
+
|
|
34
|
+
| | |
|
|
35
|
+
|:--|:--|
|
|
36
|
+
| 👨💻 **Full Dev Environment** — HMR, debug traces, and local devtools. No more refresh loops. | ✅ **End-to-End Type Safety** — tRPC-style inference from server to widget. Autocomplete everywhere. |
|
|
37
|
+
| 🔄 **Widget-to-Model Sync** — Keep the model aware of UI state with `data-llm`. Dual surfaces, one source of truth. | ⚒️ **React Query-style Hooks** — `isPending`, `isError`, callbacks. State management you already know. |
|
|
38
|
+
| 🌐 **Platform Agnostic** — Write once, run anywhere. Works with ChatGPT (Apps SDK) and MCP-compatible clients. | 📦 **Showcase Examples** — Production-ready examples to learn from and build upon. |
|
|
39
|
+
|
|
40
|
+
<br />
|
|
41
|
+
|
|
42
|
+
## 🚀 Get Started
|
|
43
|
+
|
|
44
|
+
**Create a new app:**
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
npm create skybridge@latest
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Or add to an existing project:**
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm i skybridge
|
|
54
|
+
yarn add skybridge
|
|
55
|
+
pnpm add skybridge
|
|
56
|
+
bun add skybridge
|
|
57
|
+
deno add skybridge
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
<div align="center">
|
|
61
|
+
|
|
62
|
+
**👉 [Read the Docs](https://docs.skybridge.tech) 👈**
|
|
63
|
+
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<br />
|
|
67
|
+
|
|
68
|
+
## 📦 Architecture
|
|
69
|
+
|
|
70
|
+
Skybridge is a fullstack framework with unified server and client modules:
|
|
71
|
+
|
|
72
|
+
- **`skybridge/server`** — Define tools and widgets with full type inference. Extends the MCP SDK.
|
|
73
|
+
- **`skybridge/web`** — React hooks that consume your server types. Works with Apps SDK (ChatGPT) and MCP Apps.
|
|
74
|
+
- **Dev Environment** — Vite plugin with HMR, DevTools emulator, and optimized builds.
|
|
75
|
+
|
|
76
|
+
### Server
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { McpServer } from "skybridge/server";
|
|
80
|
+
|
|
81
|
+
server.registerWidget("flights", {}, {
|
|
82
|
+
inputSchema: { destination: z.string() },
|
|
83
|
+
}, async ({ destination }) => {
|
|
84
|
+
const flights = await searchFlights(destination);
|
|
85
|
+
return { structuredContent: { flights } };
|
|
86
|
+
});
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Widget
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
import { useToolInfo } from "skybridge/web";
|
|
93
|
+
|
|
94
|
+
function FlightsWidget() {
|
|
95
|
+
const { output } = useToolInfo();
|
|
96
|
+
|
|
97
|
+
return output.structuredContent.flights.map(flight =>
|
|
98
|
+
<FlightCard key={flight.id} flight={flight} />
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
<br />
|
|
104
|
+
|
|
105
|
+
## 🎯 Features at a Glance
|
|
106
|
+
|
|
107
|
+
- **Live Reload** — Vite HMR. See changes instantly without reinstalling.
|
|
108
|
+
- **Typed Hooks** — Full autocomplete for tools, inputs, outputs.
|
|
109
|
+
- **Widget → Tool Calls** — Trigger server actions from UI.
|
|
110
|
+
- **Dual Surface Sync** — Keep model aware of what users see with `data-llm`.
|
|
111
|
+
- **React Query-style API** — `isPending`, `isError`, callbacks.
|
|
112
|
+
- **Platform Agnostic** — Works with ChatGPT (Apps SDK) and MCP Apps clients (Goose, VSCode, etc.).
|
|
113
|
+
- **MCP Compatible** — Extends the official SDK. Works with any MCP client.
|
|
114
|
+
|
|
115
|
+
<br />
|
|
116
|
+
|
|
117
|
+
## 📖 Showcase
|
|
118
|
+
|
|
119
|
+
Explore production-ready examples:
|
|
120
|
+
|
|
121
|
+
| Example | Description | Demo | Code |
|
|
122
|
+
|------------------------|----------------------------------------------------------------------------------|-----------------------------------------------------|-------------------------------------------------------------------------------------|
|
|
123
|
+
| **Capitals Explorer** | Interactive world map with geolocation and Wikipedia integration | [Try Demo](https://capitals.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/capitals) |
|
|
124
|
+
| **Ecommerce Carousel** | Product carousel with cart, localization, and modals | [Try Demo](https://ecommerce.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/ecom-carousel) |
|
|
125
|
+
| **Everything** | Comprehensive playground showcasing all hooks and features | [Try Demo](https://everything.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/everything) |
|
|
126
|
+
| **Productivity** | Data visualization dashboard demonstrating Skybridge capabilities for MCP Apps | [Try Demo](https://productivity.skybridge.tech/try) | [View Code](https://github.com/alpic-ai/skybridge/tree/main/examples/productivity) |
|
|
127
|
+
|
|
128
|
+
See all examples in the [Showcase](https://docs.skybridge.tech/showcase) or browse the [examples/](examples/) directory.
|
|
129
|
+
|
|
130
|
+
<br />
|
|
131
|
+
|
|
132
|
+
<div align="center">
|
|
133
|
+
|
|
134
|
+
[](https://github.com/alpic-ai/skybridge/discussions)
|
|
135
|
+
[](https://github.com/alpic-ai/skybridge/issues)
|
|
136
|
+
[](https://discord.com/invite/gNAazGueab)
|
|
137
|
+
|
|
138
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for setup instructions
|
|
139
|
+
|
|
140
|
+
<br />
|
|
141
|
+
|
|
142
|
+
**[MIT License](LICENSE)** · Made with ❤️ by **[Alpic](https://alpic.ai)**
|
|
143
|
+
|
|
144
|
+
</div>
|
package/bin/run.js
CHANGED
package/dist/cli/telemetry.d.ts
CHANGED
|
@@ -1,39 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
* Check if telemetry is enabled.
|
|
3
|
-
* Priority order:
|
|
4
|
-
* 1. Environment variables (highest priority)
|
|
5
|
-
* 2. Config file setting
|
|
6
|
-
* 3. Default: enabled
|
|
7
|
-
*/
|
|
1
|
+
import type { Hook } from "@oclif/core";
|
|
8
2
|
export declare function isEnabled(): boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Check if debug mode is enabled (print telemetry instead of sending)
|
|
11
|
-
*/
|
|
12
3
|
export declare function isDebugMode(): boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Enable or disable telemetry and persist to config file
|
|
15
|
-
*/
|
|
16
4
|
export declare function setEnabled(enabled: boolean): void;
|
|
17
|
-
/**
|
|
18
|
-
* Get the machine ID (creates one if it doesn't exist)
|
|
19
|
-
*/
|
|
20
5
|
export declare function getMachineId(): string;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*/
|
|
24
|
-
export declare function getProjectId(): string;
|
|
25
|
-
/**
|
|
26
|
-
* Get CI information using ci-info package
|
|
27
|
-
*/
|
|
28
|
-
export declare function getCI(): {
|
|
29
|
-
isCI: boolean;
|
|
30
|
-
name: string | null;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Track a command execution
|
|
34
|
-
*/
|
|
35
|
-
export declare function trackCommand(command: string, version: string, outcome?: "success" | "failure"): Promise<void>;
|
|
36
|
-
/**
|
|
37
|
-
* Get the path to the global config file (for display purposes)
|
|
38
|
-
*/
|
|
39
|
-
export declare function getGlobalConfigPath(): string;
|
|
6
|
+
declare const hook: Hook<"finally">;
|
|
7
|
+
export default hook;
|
package/dist/cli/telemetry.js
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
|
-
import { join
|
|
3
|
+
import { join } from "node:path";
|
|
4
4
|
import ci from "ci-info";
|
|
5
5
|
import { PostHog } from "posthog-node";
|
|
6
|
-
|
|
7
|
-
const POSTHOG_API_KEY = "phc_PLACEHOLDER_REPLACE_WITH_ACTUAL_KEY";
|
|
6
|
+
const POSTHOG_API_KEY = "phc_rQdkCYr0DO4NcZBQXZnUwsHAbau9zuNwKIpil9FQP6v";
|
|
8
7
|
const POSTHOG_HOST = "https://us.i.posthog.com";
|
|
9
|
-
// Environment variables for opt-out
|
|
10
8
|
const ENV_TELEMETRY_DISABLED = "SKYBRIDGE_TELEMETRY_DISABLED";
|
|
11
|
-
const ENV_DO_NOT_TRACK = "DO_NOT_TRACK";
|
|
12
9
|
const ENV_TELEMETRY_DEBUG = "SKYBRIDGE_TELEMETRY_DEBUG";
|
|
13
|
-
|
|
10
|
+
const ENV_DO_NOT_TRACK = "DO_NOT_TRACK";
|
|
14
11
|
const GLOBAL_CONFIG_DIR = join(homedir(), ".skybridge");
|
|
15
12
|
const GLOBAL_CONFIG_FILE = join(GLOBAL_CONFIG_DIR, "config.json");
|
|
16
|
-
const PROJECT_TELEMETRY_DIR = ".skybridge";
|
|
17
|
-
const PROJECT_TELEMETRY_FILE = "telemetry.json";
|
|
18
13
|
let posthogClient = null;
|
|
19
14
|
function getPostHogClient() {
|
|
20
15
|
if (!posthogClient) {
|
|
@@ -64,27 +59,7 @@ function getGlobalConfig() {
|
|
|
64
59
|
writeJsonFile(GLOBAL_CONFIG_FILE, config);
|
|
65
60
|
return config;
|
|
66
61
|
}
|
|
67
|
-
function getProjectConfig() {
|
|
68
|
-
const projectConfigPath = resolve(process.cwd(), PROJECT_TELEMETRY_DIR, PROJECT_TELEMETRY_FILE);
|
|
69
|
-
const existing = readJsonFile(projectConfigPath);
|
|
70
|
-
if (existing?.projectId) {
|
|
71
|
-
return existing;
|
|
72
|
-
}
|
|
73
|
-
const config = {
|
|
74
|
-
projectId: crypto.randomUUID(),
|
|
75
|
-
};
|
|
76
|
-
writeJsonFile(projectConfigPath, config);
|
|
77
|
-
return config;
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Check if telemetry is enabled.
|
|
81
|
-
* Priority order:
|
|
82
|
-
* 1. Environment variables (highest priority)
|
|
83
|
-
* 2. Config file setting
|
|
84
|
-
* 3. Default: enabled
|
|
85
|
-
*/
|
|
86
62
|
export function isEnabled() {
|
|
87
|
-
// Check environment variables first (highest priority)
|
|
88
63
|
if (process.env[ENV_TELEMETRY_DISABLED] === "1" ||
|
|
89
64
|
process.env[ENV_TELEMETRY_DISABLED]?.toLowerCase() === "true") {
|
|
90
65
|
return false;
|
|
@@ -93,65 +68,40 @@ export function isEnabled() {
|
|
|
93
68
|
process.env[ENV_DO_NOT_TRACK]?.toLowerCase() === "true") {
|
|
94
69
|
return false;
|
|
95
70
|
}
|
|
96
|
-
|
|
71
|
+
if (ci.isCI) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
97
74
|
const config = getGlobalConfig();
|
|
98
75
|
return config.telemetry.enabled;
|
|
99
76
|
}
|
|
100
|
-
/**
|
|
101
|
-
* Check if debug mode is enabled (print telemetry instead of sending)
|
|
102
|
-
*/
|
|
103
77
|
export function isDebugMode() {
|
|
104
78
|
return (process.env[ENV_TELEMETRY_DEBUG] === "1" ||
|
|
105
79
|
process.env[ENV_TELEMETRY_DEBUG]?.toLowerCase() === "true");
|
|
106
80
|
}
|
|
107
|
-
/**
|
|
108
|
-
* Enable or disable telemetry and persist to config file
|
|
109
|
-
*/
|
|
110
81
|
export function setEnabled(enabled) {
|
|
111
82
|
const config = getGlobalConfig();
|
|
112
83
|
config.telemetry.enabled = enabled;
|
|
113
84
|
writeJsonFile(GLOBAL_CONFIG_FILE, config);
|
|
114
85
|
}
|
|
115
|
-
/**
|
|
116
|
-
* Get the machine ID (creates one if it doesn't exist)
|
|
117
|
-
*/
|
|
118
86
|
export function getMachineId() {
|
|
87
|
+
if (ci.isCI) {
|
|
88
|
+
return ci.name ?? "unknown-ci";
|
|
89
|
+
}
|
|
119
90
|
return getGlobalConfig().machineId;
|
|
120
91
|
}
|
|
121
|
-
|
|
122
|
-
* Get the project ID (creates one if it doesn't exist)
|
|
123
|
-
*/
|
|
124
|
-
export function getProjectId() {
|
|
125
|
-
return getProjectConfig().projectId;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Get CI information using ci-info package
|
|
129
|
-
*/
|
|
130
|
-
export function getCI() {
|
|
131
|
-
return {
|
|
132
|
-
isCI: ci.isCI,
|
|
133
|
-
name: ci.name,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Track a command execution
|
|
138
|
-
*/
|
|
139
|
-
export async function trackCommand(command, version, outcome) {
|
|
92
|
+
const hook = async ({ id: command, config: { version }, error, }) => {
|
|
140
93
|
if (!isEnabled()) {
|
|
141
94
|
return;
|
|
142
95
|
}
|
|
143
|
-
const ciInfo = getCI();
|
|
144
96
|
const event = {
|
|
145
|
-
command,
|
|
146
97
|
version,
|
|
147
98
|
machineId: getMachineId(),
|
|
148
|
-
projectId: getProjectId(),
|
|
149
99
|
sessionId: crypto.randomUUID(),
|
|
150
|
-
isCI:
|
|
151
|
-
ciProvider: ciInfo.name,
|
|
100
|
+
isCI: ci.isCI,
|
|
152
101
|
nodeVersion: process.version,
|
|
153
102
|
platform: process.platform,
|
|
154
|
-
|
|
103
|
+
outcome: error ? "failure" : "success",
|
|
104
|
+
error: error?.message,
|
|
155
105
|
};
|
|
156
106
|
if (isDebugMode()) {
|
|
157
107
|
console.error("[Telemetry Debug] Would send event:", JSON.stringify(event, null, 2));
|
|
@@ -161,24 +111,13 @@ export async function trackCommand(command, version, outcome) {
|
|
|
161
111
|
const client = getPostHogClient();
|
|
162
112
|
client.capture({
|
|
163
113
|
distinctId: event.machineId,
|
|
164
|
-
event:
|
|
165
|
-
properties:
|
|
166
|
-
...event,
|
|
167
|
-
$groups: {
|
|
168
|
-
project: event.projectId,
|
|
169
|
-
},
|
|
170
|
-
},
|
|
114
|
+
event: command,
|
|
115
|
+
properties: event,
|
|
171
116
|
});
|
|
172
|
-
await client.shutdown();
|
|
173
117
|
}
|
|
174
118
|
catch {
|
|
175
119
|
// Silently ignore telemetry errors - never block CLI operation
|
|
176
120
|
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
* Get the path to the global config file (for display purposes)
|
|
180
|
-
*/
|
|
181
|
-
export function getGlobalConfigPath() {
|
|
182
|
-
return GLOBAL_CONFIG_FILE;
|
|
183
|
-
}
|
|
121
|
+
};
|
|
122
|
+
export default hook;
|
|
184
123
|
//# sourceMappingURL=telemetry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/cli/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../../src/cli/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,MAAM,eAAe,GAAG,iDAAiD,CAAC;AAC1E,MAAM,YAAY,GAAG,0BAA0B,CAAC;AAEhD,MAAM,sBAAsB,GAAG,8BAA8B,CAAC;AAC9D,MAAM,mBAAmB,GAAG,2BAA2B,CAAC;AACxD,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAExC,MAAM,iBAAiB,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;AACxD,MAAM,kBAAkB,GAAG,IAAI,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAC;AAoBlE,IAAI,aAAa,GAAmB,IAAI,CAAC;AAEzC,SAAS,gBAAgB;IACvB,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
|
|
13
|
+
if (step.run) {
|
|
14
|
+
await step.run();
|
|
15
|
+
}
|
|
16
|
+
if (step.command) {
|
|
17
|
+
await runCommand(step.command);
|
|
18
|
+
}
|
|
14
19
|
}
|
|
15
20
|
}
|
|
16
21
|
setStatus("success");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-execute-steps.js","sourceRoot":"","sources":["../../src/cli/use-execute-steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"use-execute-steps.js","sourceRoot":"","sources":["../../src/cli/use-execute-steps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAQ9C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAoB,EAAE,EAAE;IACtD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAS,CAAC,CAAC,CAAC;IAC1D,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAClC,SAAS,CACV,CAAC;IACF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAExD,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QACrC,IAAI,CAAC;YACH,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACtC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBACtB,IAAI,IAAI,EAAE,CAAC;oBACT,cAAc,CAAC,CAAC,CAAC,CAAC;oBAClB,IAAI,IAAI,CAAC,GAAG,EAAE,CAAC;wBACb,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;oBACnB,CAAC;oBACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;wBACjB,MAAM,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;oBACjC,CAAC;gBACH,CAAC;YACH,CAAC;YACD,SAAS,CAAC,SAAS,CAAC,CAAC;YACrB,YAAY,CAAC,GAAG,EAAE;gBAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,SAAS,CAAC,OAAO,CAAC,CAAC;YACnB,QAAQ,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;YAC3D,YAAY,CAAC,GAAG,EAAE;gBAChB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AACjD,CAAC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import nodemonOriginal, {} from "nodemon";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
const nodemon = nodemonOriginal;
|
|
4
|
+
export function useNodemon(env) {
|
|
5
|
+
const [messages, setMessages] = useState([]);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
nodemon({
|
|
8
|
+
env,
|
|
9
|
+
configFile: "nodemon.json",
|
|
10
|
+
stdout: false,
|
|
11
|
+
});
|
|
12
|
+
const handleStdoutData = (chunk) => {
|
|
13
|
+
const message = chunk.toString().trim();
|
|
14
|
+
if (message) {
|
|
15
|
+
setMessages((prev) => [...prev, { text: message, type: "log" }]);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
const handleStderrData = (chunk) => {
|
|
19
|
+
const message = chunk.toString().trim();
|
|
20
|
+
if (message) {
|
|
21
|
+
setMessages((prev) => [...prev, { text: message, type: "error" }]);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const setupStdoutListener = () => {
|
|
25
|
+
if (nodemon.stdout) {
|
|
26
|
+
nodemon.stdout.off("data", handleStdoutData);
|
|
27
|
+
nodemon.stdout.on("data", handleStdoutData);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const setupStderrListener = () => {
|
|
31
|
+
if (nodemon.stderr) {
|
|
32
|
+
nodemon.stderr.off("data", handleStderrData);
|
|
33
|
+
nodemon.stderr.on("data", handleStderrData);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
nodemon.on("readable", () => {
|
|
37
|
+
setupStdoutListener();
|
|
38
|
+
setupStderrListener();
|
|
39
|
+
});
|
|
40
|
+
nodemon.on("restart", (files) => {
|
|
41
|
+
const restartMessage = `Server restarted due to file changes: ${files.join(", ")}`;
|
|
42
|
+
setMessages((prev) => [
|
|
43
|
+
...prev,
|
|
44
|
+
{ text: restartMessage, type: "restart" },
|
|
45
|
+
]);
|
|
46
|
+
setupStdoutListener();
|
|
47
|
+
setupStderrListener();
|
|
48
|
+
});
|
|
49
|
+
return () => {
|
|
50
|
+
if (nodemon.stdout) {
|
|
51
|
+
nodemon.stdout.off("data", handleStdoutData);
|
|
52
|
+
}
|
|
53
|
+
if (nodemon.stderr) {
|
|
54
|
+
nodemon.stderr.off("data", handleStderrData);
|
|
55
|
+
}
|
|
56
|
+
nodemon.emit("quit");
|
|
57
|
+
};
|
|
58
|
+
}, [env]);
|
|
59
|
+
return messages;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=use-nodemon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-nodemon.js","sourceRoot":"","sources":["../../src/cli/use-nodemon.ts"],"names":[],"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AAG,CAAC,CAAC,CAAC;IAEV,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { isAbsolute, relative } from "node:path";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
export function useTypeScriptCheck() {
|
|
5
|
+
const tsProcessRef = useRef(null);
|
|
6
|
+
const [tsErrors, setTsErrors] = useState([]);
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const tsProcess = spawn("npx", ["tsc", "--noEmit", "--watch", "--pretty", "false"], {
|
|
9
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
10
|
+
shell: true,
|
|
11
|
+
});
|
|
12
|
+
tsProcessRef.current = tsProcess;
|
|
13
|
+
let outputBuffer = "";
|
|
14
|
+
let currentErrors = [];
|
|
15
|
+
const processOutput = (data) => {
|
|
16
|
+
outputBuffer += data.toString();
|
|
17
|
+
const lines = outputBuffer.split("\n");
|
|
18
|
+
outputBuffer = lines.pop() || ""; // Keep incomplete line in buffer
|
|
19
|
+
for (const line of lines) {
|
|
20
|
+
const trimmed = line.trim();
|
|
21
|
+
// Parse TypeScript error format: file.ts(10,5): error TS2322: message
|
|
22
|
+
// Match pattern: filename(line,col): error code: message
|
|
23
|
+
const errorMatch = trimmed.match(/^(.+?)\((\d+),(\d+)\):\s+error\s+(TS\d+)?\s*:?\s*(.+)$/);
|
|
24
|
+
if (errorMatch) {
|
|
25
|
+
const [, file, lineStr, colStr, , message] = errorMatch;
|
|
26
|
+
if (file && lineStr && colStr && message) {
|
|
27
|
+
let cleanFile = file.trim();
|
|
28
|
+
if (isAbsolute(cleanFile)) {
|
|
29
|
+
cleanFile = relative(process.cwd(), cleanFile);
|
|
30
|
+
}
|
|
31
|
+
currentErrors.push({
|
|
32
|
+
file: cleanFile,
|
|
33
|
+
line: Number.parseInt(lineStr, 10),
|
|
34
|
+
col: Number.parseInt(colStr, 10),
|
|
35
|
+
message: message.trim(),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (trimmed.includes("Found") && trimmed.includes("error")) {
|
|
40
|
+
setTsErrors(trimmed.match(/Found 0 error/) ? [] : [...currentErrors]);
|
|
41
|
+
currentErrors = [];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
if (tsProcess.stdout) {
|
|
46
|
+
tsProcess.stdout.on("data", processOutput);
|
|
47
|
+
}
|
|
48
|
+
if (tsProcess.stderr) {
|
|
49
|
+
tsProcess.stderr.on("data", processOutput);
|
|
50
|
+
}
|
|
51
|
+
return () => {
|
|
52
|
+
if (tsProcessRef.current) {
|
|
53
|
+
tsProcessRef.current.kill();
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
}, []);
|
|
57
|
+
return tsErrors;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=use-typescript-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-typescript-check.js","sourceRoot":"","sources":["../../src/cli/use-typescript-check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AASpD,MAAM,UAAU,kBAAkB;IAChC,MAAM,YAAY,GAAG,MAAM,CAAkC,IAAI,CAAC,CAAC;IACnE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAiB,EAAE,CAAC,CAAC;IAE7D,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,SAAS,GAAG,KAAK,CACrB,KAAK,EACL,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EACnD;YACE,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,E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,OAAO,CAAC,IAAI,EAAE;yBACxB,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;gBAED,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;oBAC3D,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;oBACtE,aAAa,GAAG,EAAE,CAAC;gBACrB,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;YACrB,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;QAC7C,CAAC;QAED,OAAO,GAAG,EAAE;YACV,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;gBACzB,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;YAC9B,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/commands/build.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cpSync, rmSync } from "node:fs";
|
|
2
3
|
import { Command } from "@oclif/core";
|
|
3
4
|
import { Box, render, Text } from "ink";
|
|
4
5
|
import { useEffect } from "react";
|
|
@@ -11,11 +12,12 @@ export const commandSteps = [
|
|
|
11
12
|
},
|
|
12
13
|
{
|
|
13
14
|
label: "Compiling server",
|
|
14
|
-
|
|
15
|
+
run: () => rmSync("dist", { recursive: true, force: true }),
|
|
16
|
+
command: "tsc -p tsconfig.server.json",
|
|
15
17
|
},
|
|
16
18
|
{
|
|
17
19
|
label: "Copying static assets",
|
|
18
|
-
|
|
20
|
+
run: () => cpSync("web/dist", "dist/assets", { recursive: true }),
|
|
19
21
|
},
|
|
20
22
|
];
|
|
21
23
|
export default class Build extends Command {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAoB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEhF,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC;QACE,KAAK,EAAE,kBAAkB;QACzB,OAAO,EAAE,kCAAkC;KAC5C;IACD;QACE,KAAK,EAAE,kBAAkB;QACzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAoB,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEhF,MAAM,CAAC,MAAM,YAAY,GAAkB;IACzC;QACE,KAAK,EAAE,kBAAkB;QACzB,OAAO,EAAE,kCAAkC;KAC5C;IACD;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dist/commands/dev.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { Command } from "@oclif/core";
|
|
|
2
2
|
export default class Dev extends Command {
|
|
3
3
|
static description: string;
|
|
4
4
|
static examples: string[];
|
|
5
|
-
static flags: {
|
|
5
|
+
static flags: {
|
|
6
|
+
"use-forwarded-host": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
6
8
|
run(): Promise<void>;
|
|
7
9
|
}
|