create-skybridge 0.0.0-dev.6f2d80b → 0.0.0-dev.6f5ad0d
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/LICENSE +21 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +97 -27
- package/dist/index.test.d.ts +1 -0
- package/dist/index.test.js +23 -0
- package/index.js +6 -1
- package/package.json +11 -10
- package/template/README.md +17 -6
- package/template/_gitignore +2 -1
- package/template/alpic.json +1 -2
- package/template/node_modules/.bin/mcp-inspector +21 -0
- package/template/node_modules/.bin/nodemon +21 -0
- package/template/node_modules/.bin/sb +21 -0
- package/template/node_modules/.bin/shx +21 -0
- package/template/node_modules/.bin/skybridge +21 -0
- package/template/node_modules/.bin/tsc +21 -0
- package/template/node_modules/.bin/tsserver +21 -0
- package/template/node_modules/.bin/tsx +21 -0
- package/template/node_modules/.bin/vite +21 -0
- package/template/nodemon.json +5 -0
- package/template/package.json +28 -10
- package/template/server/src/index.ts +16 -8
- package/template/server/src/server.ts +6 -20
- package/template/tsconfig.json +23 -0
- package/template/tsconfig.server.json +11 -0
- package/template/web/src/index.css +1 -0
- package/template/web/src/widgets/magic-8-ball.tsx +5 -3
- package/template/web/vite.config.ts +3 -3
- package/template/pnpm-lock.yaml +0 -317
- package/template/pnpm-workspace.yaml +0 -7
- package/template/server/nodemon.json +0 -5
- package/template/server/package.json +0 -34
- package/template/server/src/env.ts +0 -12
- package/template/server/tsconfig.json +0 -17
- package/template/web/package.json +0 -24
- package/template/web/tsconfig.app.json +0 -34
- package/template/web/tsconfig.json +0 -13
- package/template/web/tsconfig.node.json +0 -26
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Alpic
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function init(args?: string[]): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
1
2
|
import fs from "node:fs";
|
|
2
3
|
import path from "node:path";
|
|
3
4
|
import { fileURLToPath } from "node:url";
|
|
4
5
|
import * as prompts from "@clack/prompts";
|
|
5
6
|
import mri from "mri";
|
|
6
|
-
const argv = mri(process.argv.slice(2), {
|
|
7
|
-
boolean: ["help", "overwrite"],
|
|
8
|
-
alias: { h: "help" },
|
|
9
|
-
});
|
|
10
|
-
const cwd = process.cwd();
|
|
11
7
|
const defaultProjectName = "skybridge-project";
|
|
12
8
|
// prettier-ignore
|
|
13
9
|
const helpMessage = `\
|
|
@@ -18,16 +14,22 @@ Create a new Skybridge project by copying the starter template.
|
|
|
18
14
|
Options:
|
|
19
15
|
-h, --help show this help message
|
|
20
16
|
--overwrite remove existing files in target directory
|
|
17
|
+
--immediate install dependencies and start development server
|
|
21
18
|
|
|
22
19
|
Examples:
|
|
23
20
|
create-skybridge my-app
|
|
24
|
-
create-skybridge . --overwrite
|
|
21
|
+
create-skybridge . --overwrite --immediate
|
|
25
22
|
`;
|
|
26
|
-
async function init() {
|
|
23
|
+
export async function init(args = process.argv.slice(2)) {
|
|
24
|
+
const argv = mri(args, {
|
|
25
|
+
boolean: ["help", "overwrite", "immediate"],
|
|
26
|
+
alias: { h: "help" },
|
|
27
|
+
});
|
|
27
28
|
const argTargetDir = argv._[0]
|
|
28
|
-
?
|
|
29
|
+
? sanitizeTargetDir(String(argv._[0]))
|
|
29
30
|
: undefined;
|
|
30
31
|
const argOverwrite = argv.overwrite;
|
|
32
|
+
const argImmediate = argv.immediate;
|
|
31
33
|
const help = argv.help;
|
|
32
34
|
if (help) {
|
|
33
35
|
console.log(helpMessage);
|
|
@@ -44,14 +46,15 @@ async function init() {
|
|
|
44
46
|
defaultValue: defaultProjectName,
|
|
45
47
|
placeholder: defaultProjectName,
|
|
46
48
|
validate: (value) => {
|
|
47
|
-
return value.length === 0 ||
|
|
49
|
+
return value.length === 0 || sanitizeTargetDir(value).length > 0
|
|
48
50
|
? undefined
|
|
49
51
|
: "Invalid project name";
|
|
50
52
|
},
|
|
51
53
|
});
|
|
52
|
-
if (prompts.isCancel(projectName))
|
|
54
|
+
if (prompts.isCancel(projectName)) {
|
|
53
55
|
return cancel();
|
|
54
|
-
|
|
56
|
+
}
|
|
57
|
+
targetDir = sanitizeTargetDir(projectName);
|
|
55
58
|
}
|
|
56
59
|
else {
|
|
57
60
|
targetDir = defaultProjectName;
|
|
@@ -78,8 +81,9 @@ async function init() {
|
|
|
78
81
|
},
|
|
79
82
|
],
|
|
80
83
|
});
|
|
81
|
-
if (prompts.isCancel(res))
|
|
84
|
+
if (prompts.isCancel(res)) {
|
|
82
85
|
return cancel();
|
|
86
|
+
}
|
|
83
87
|
overwrite = res;
|
|
84
88
|
}
|
|
85
89
|
else {
|
|
@@ -95,34 +99,104 @@ async function init() {
|
|
|
95
99
|
return;
|
|
96
100
|
}
|
|
97
101
|
}
|
|
98
|
-
const root = path.join(cwd, targetDir);
|
|
102
|
+
const root = path.join(process.cwd(), targetDir);
|
|
99
103
|
// 3. Copy the repository
|
|
100
104
|
prompts.log.step(`Copying template...`);
|
|
101
105
|
try {
|
|
102
106
|
const templateDir = fileURLToPath(new URL("../template", import.meta.url));
|
|
103
107
|
// Copy template to target directory
|
|
104
|
-
fs.cpSync(templateDir, root, {
|
|
108
|
+
fs.cpSync(templateDir, root, {
|
|
109
|
+
recursive: true,
|
|
110
|
+
filter: (src) => [".npmrc"].every((file) => !src.endsWith(file)),
|
|
111
|
+
});
|
|
105
112
|
// Rename _gitignore to .gitignore
|
|
106
113
|
fs.renameSync(path.join(root, "_gitignore"), path.join(root, ".gitignore"));
|
|
107
114
|
// Update project name in package.json
|
|
108
115
|
const name = path.basename(root);
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
fs.writeFileSync(pkgPath, fixed);
|
|
114
|
-
}
|
|
116
|
+
const pkgPath = path.join(root, "package.json");
|
|
117
|
+
const pkg = fs.readFileSync(pkgPath, "utf-8");
|
|
118
|
+
const fixed = pkg.replace(/apps-sdk-template/g, name);
|
|
119
|
+
fs.writeFileSync(pkgPath, fixed);
|
|
115
120
|
prompts.log.success(`Project created in ${root}`);
|
|
116
|
-
prompts.outro(`Done! Next steps:\n\n cd ${targetDir}\n pnpm install\n pnpm dev`);
|
|
117
121
|
}
|
|
118
122
|
catch (error) {
|
|
119
123
|
prompts.log.error("Failed to copy repository");
|
|
120
124
|
console.error(error);
|
|
121
125
|
process.exit(1);
|
|
122
126
|
}
|
|
127
|
+
const userAgent = process.env.npm_config_user_agent;
|
|
128
|
+
const pkgManager = userAgent?.split(" ")[0]?.split("/")[0] || "npm";
|
|
129
|
+
// 4. Ask about immediate installation
|
|
130
|
+
let immediate = argImmediate;
|
|
131
|
+
if (immediate === undefined) {
|
|
132
|
+
if (interactive) {
|
|
133
|
+
const immediateResult = await prompts.confirm({
|
|
134
|
+
message: `Install with ${pkgManager} and start now?`,
|
|
135
|
+
});
|
|
136
|
+
if (prompts.isCancel(immediateResult)) {
|
|
137
|
+
return cancel();
|
|
138
|
+
}
|
|
139
|
+
immediate = immediateResult;
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
immediate = false;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const installCmd = [pkgManager, "install"];
|
|
146
|
+
const runCmd = [pkgManager];
|
|
147
|
+
switch (pkgManager) {
|
|
148
|
+
case "yarn":
|
|
149
|
+
case "pnpm":
|
|
150
|
+
case "bun":
|
|
151
|
+
break;
|
|
152
|
+
case "deno":
|
|
153
|
+
runCmd.push("task");
|
|
154
|
+
break;
|
|
155
|
+
default:
|
|
156
|
+
runCmd.push("run");
|
|
157
|
+
}
|
|
158
|
+
runCmd.push("dev");
|
|
159
|
+
if (!immediate) {
|
|
160
|
+
prompts.outro(`Done! Next steps:
|
|
161
|
+
cd ${targetDir}
|
|
162
|
+
${installCmd.join(" ")}
|
|
163
|
+
${runCmd.join(" ")}
|
|
164
|
+
`);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
prompts.log.step(`Installing dependencies with ${pkgManager}...`);
|
|
168
|
+
run(installCmd, {
|
|
169
|
+
stdio: "inherit",
|
|
170
|
+
cwd: root,
|
|
171
|
+
});
|
|
172
|
+
prompts.log.step("Starting dev server...");
|
|
173
|
+
run(runCmd, {
|
|
174
|
+
stdio: "inherit",
|
|
175
|
+
cwd: root,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
function run([command, ...args], options) {
|
|
179
|
+
const { status, error } = spawnSync(command, args, options);
|
|
180
|
+
if (status != null && status > 0) {
|
|
181
|
+
process.exit(status);
|
|
182
|
+
}
|
|
183
|
+
if (error) {
|
|
184
|
+
console.error(`\n${command} ${args.join(" ")} error!`);
|
|
185
|
+
console.error(error);
|
|
186
|
+
process.exit(1);
|
|
187
|
+
}
|
|
123
188
|
}
|
|
124
|
-
function
|
|
125
|
-
return targetDir
|
|
189
|
+
function sanitizeTargetDir(targetDir) {
|
|
190
|
+
return (targetDir
|
|
191
|
+
.trim()
|
|
192
|
+
// Only keep alphanumeric, dash, underscore, dot, @, /
|
|
193
|
+
.replace(/[^a-zA-Z0-9\-_.@/]/g, "")
|
|
194
|
+
// Prevent path traversal
|
|
195
|
+
.replace(/\.\./g, "")
|
|
196
|
+
// Collapse multiple slashes
|
|
197
|
+
.replace(/\/+/g, "/")
|
|
198
|
+
// Remove leading/trailing slashes
|
|
199
|
+
.replace(/^\/+|\/+$/g, ""));
|
|
126
200
|
}
|
|
127
201
|
function isEmpty(path) {
|
|
128
202
|
const files = fs.readdirSync(path);
|
|
@@ -139,7 +213,3 @@ function emptyDir(dir) {
|
|
|
139
213
|
fs.rmSync(path.resolve(dir, file), { recursive: true, force: true });
|
|
140
214
|
}
|
|
141
215
|
}
|
|
142
|
-
init().catch((e) => {
|
|
143
|
-
console.error(e);
|
|
144
|
-
process.exit(1);
|
|
145
|
-
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { randomBytes } from "node:crypto";
|
|
2
|
+
import fs from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
5
|
+
import { init } from "./index.js";
|
|
6
|
+
describe("create-skybridge", () => {
|
|
7
|
+
let tempDirName;
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
tempDirName = `test-${randomBytes(2).toString("hex")}`;
|
|
10
|
+
});
|
|
11
|
+
afterEach(async () => {
|
|
12
|
+
await fs.rm(path.join(process.cwd(), tempDirName), {
|
|
13
|
+
recursive: true,
|
|
14
|
+
force: true,
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
it("should scaffold a new project", async () => {
|
|
18
|
+
const name = `../../${tempDirName}//project$`;
|
|
19
|
+
await init([name]);
|
|
20
|
+
await fs.access(path.join(process.cwd(), tempDirName, "project", ".gitignore"));
|
|
21
|
+
expect(fs.access(path.join(process.cwd(), tempDirName, "project", ".npmrc"))).rejects.toThrowError();
|
|
22
|
+
});
|
|
23
|
+
});
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-skybridge",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.6f5ad0d",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Alpic",
|
|
@@ -16,18 +16,19 @@
|
|
|
16
16
|
"dist",
|
|
17
17
|
"template"
|
|
18
18
|
],
|
|
19
|
-
"scripts": {
|
|
20
|
-
"build": "tsc",
|
|
21
|
-
"test:type": "tsc --noEmit",
|
|
22
|
-
"test:format": "biome ci",
|
|
23
|
-
"prepublishOnly": "pnpm run build"
|
|
24
|
-
},
|
|
25
19
|
"dependencies": {
|
|
26
20
|
"@clack/prompts": "^0.11.0",
|
|
27
21
|
"mri": "^1.2.0"
|
|
28
22
|
},
|
|
29
23
|
"devDependencies": {
|
|
30
|
-
"
|
|
31
|
-
"
|
|
24
|
+
"typescript": "^5.9.3",
|
|
25
|
+
"vitest": "^4.0.17"
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsc",
|
|
29
|
+
"test": "pnpm run test:unit && pnpm run test:type && pnpm run test:format",
|
|
30
|
+
"test:unit": "vitest run",
|
|
31
|
+
"test:type": "tsc --noEmit",
|
|
32
|
+
"test:format": "biome ci"
|
|
32
33
|
}
|
|
33
|
-
}
|
|
34
|
+
}
|
package/template/README.md
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Skybridge Starter
|
|
2
2
|
|
|
3
|
-
A minimal TypeScript template for building
|
|
3
|
+
A minimal TypeScript template for building ChatGPT and MCP Apps with widget rendering.
|
|
4
4
|
|
|
5
5
|
## Getting Started
|
|
6
6
|
|
|
7
7
|
### Prerequisites
|
|
8
8
|
|
|
9
|
-
- Node.js
|
|
10
|
-
- pnpm (install with `npm install -g pnpm`)
|
|
9
|
+
- Node.js 24+
|
|
11
10
|
- HTTP tunnel such as [ngrok](https://ngrok.com/download)
|
|
12
11
|
|
|
13
12
|
### Local Development
|
|
@@ -15,7 +14,13 @@ A minimal TypeScript template for building OpenAI Apps SDK compatible MCP server
|
|
|
15
14
|
#### 1. Install
|
|
16
15
|
|
|
17
16
|
```bash
|
|
17
|
+
npm install
|
|
18
|
+
# or
|
|
19
|
+
yarn install
|
|
20
|
+
# or
|
|
18
21
|
pnpm install
|
|
22
|
+
# or
|
|
23
|
+
bun install
|
|
19
24
|
```
|
|
20
25
|
|
|
21
26
|
#### 2. Start your local server
|
|
@@ -23,13 +28,19 @@ pnpm install
|
|
|
23
28
|
Run the development server from the root directory:
|
|
24
29
|
|
|
25
30
|
```bash
|
|
31
|
+
npm run dev
|
|
32
|
+
# or
|
|
33
|
+
yarn dev
|
|
34
|
+
# or
|
|
26
35
|
pnpm dev
|
|
36
|
+
# or
|
|
37
|
+
bun dev
|
|
27
38
|
```
|
|
28
39
|
|
|
29
40
|
This command starts an Express server on port 3000. This server packages:
|
|
30
41
|
|
|
31
42
|
- an MCP endpoint on `/mcp` (the app backend)
|
|
32
|
-
- a React application on Vite HMR dev server (the UI elements to be displayed in
|
|
43
|
+
- a React application on Vite HMR dev server (the UI elements to be displayed in the host)
|
|
33
44
|
|
|
34
45
|
#### 3. Connect to ChatGPT
|
|
35
46
|
|
|
@@ -48,7 +59,7 @@ ngrok http 3000
|
|
|
48
59
|
|
|
49
60
|
#### 2. Edit widgets with Hot Module Replacement (HMR)
|
|
50
61
|
|
|
51
|
-
Edit and save components in `web/src/widgets/` — changes appear instantly in
|
|
62
|
+
Edit and save components in `web/src/widgets/` — changes appear instantly in the host
|
|
52
63
|
|
|
53
64
|
#### 3. Edit server code
|
|
54
65
|
|
package/template/_gitignore
CHANGED
package/template/alpic.json
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/inspector/cli/build/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/inspector/cli/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/inspector/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/inspector/cli/build/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/inspector/cli/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/inspector/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules/@modelcontextprotocol/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/@modelcontextprotocol+inspector@0.18.0_@types+node@24.10.9_@types+react-dom@19.2.3_@typ_696776bbdd329b13440f0824c223c4c1/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../@modelcontextprotocol/inspector/cli/build/cli.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../@modelcontextprotocol/inspector/cli/build/cli.js" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/nodemon@3.1.11/node_modules/nodemon/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/nodemon@3.1.11/node_modules/nodemon/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/nodemon@3.1.11/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/nodemon@3.1.11/node_modules/nodemon/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/nodemon@3.1.11/node_modules/nodemon/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/nodemon@3.1.11/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../nodemon/bin/nodemon.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../nodemon/bin/nodemon.js" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../skybridge/bin/run.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../skybridge/bin/run.js" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/shx@0.4.0/node_modules/shx/lib/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/shx@0.4.0/node_modules/shx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/shx@0.4.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/shx@0.4.0/node_modules/shx/lib/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/shx@0.4.0/node_modules/shx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/shx@0.4.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../shx/lib/cli.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../shx/lib/cli.js" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules/skybridge/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/skybridge@0.25.0_@modelcontextprotocol+sdk@1.25.3_hono@4.11.3_zod@4.3.5__@types+node@24_7afaa12abc0277aebaa018ea7361abd5/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../skybridge/bin/run.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../skybridge/bin/run.js" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsc" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules/typescript/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/typescript@5.9.3/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../typescript/bin/tsserver" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.21.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/dist/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.21.0/node_modules/tsx/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/tsx@4.21.0/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../tsx/dist/cli.mjs" "$@"
|
|
21
|
+
fi
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
3
|
+
|
|
4
|
+
case `uname` in
|
|
5
|
+
*CYGWIN*|*MINGW*|*MSYS*)
|
|
6
|
+
if command -v cygpath > /dev/null 2>&1; then
|
|
7
|
+
basedir=`cygpath -w "$basedir"`
|
|
8
|
+
fi
|
|
9
|
+
;;
|
|
10
|
+
esac
|
|
11
|
+
|
|
12
|
+
if [ -z "$NODE_PATH" ]; then
|
|
13
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@7.3.1_@types+node@24.10.9_jiti@2.6.1_lightningcss@1.30.2_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@7.3.1_@types+node@24.10.9_jiti@2.6.1_lightningcss@1.30.2_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@7.3.1_@types+node@24.10.9_jiti@2.6.1_lightningcss@1.30.2_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules"
|
|
14
|
+
else
|
|
15
|
+
export NODE_PATH="/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@7.3.1_@types+node@24.10.9_jiti@2.6.1_lightningcss@1.30.2_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/bin/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@7.3.1_@types+node@24.10.9_jiti@2.6.1_lightningcss@1.30.2_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules/vite/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/vite@7.3.1_@types+node@24.10.9_jiti@2.6.1_lightningcss@1.30.2_terser@5.44.1_tsx@4.21.0_yaml@2.8.2/node_modules:/home/runner/work/skybridge/skybridge/node_modules/.pnpm/node_modules:$NODE_PATH"
|
|
16
|
+
fi
|
|
17
|
+
if [ -x "$basedir/node" ]; then
|
|
18
|
+
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
|
19
|
+
else
|
|
20
|
+
exec node "$basedir/../vite/bin/vite.js" "$@"
|
|
21
|
+
fi
|
package/template/package.json
CHANGED
|
@@ -4,18 +4,36 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"description": "Alpic MCP Server Template",
|
|
6
6
|
"type": "module",
|
|
7
|
-
"packageManager": "pnpm@10.18.3",
|
|
8
7
|
"scripts": {
|
|
9
|
-
"dev": "
|
|
10
|
-
"build": "
|
|
11
|
-
"start": "
|
|
12
|
-
"inspector": "
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
8
|
+
"dev": "skybridge dev",
|
|
9
|
+
"build": "skybridge build",
|
|
10
|
+
"start": "skybridge start",
|
|
11
|
+
"inspector": "mcp-inspector http://localhost:3000/mcp"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
15
|
+
"cors": "^2.8.5",
|
|
16
|
+
"express": "^5.2.1",
|
|
17
|
+
"react": "^19.2.3",
|
|
18
|
+
"react-dom": "^19.2.3",
|
|
19
|
+
"skybridge": ">=0.25.0 <1.0.0",
|
|
20
|
+
"vite": "^7.3.1",
|
|
21
|
+
"zod": "^4.3.5"
|
|
17
22
|
},
|
|
18
23
|
"devDependencies": {
|
|
19
|
-
"
|
|
24
|
+
"@modelcontextprotocol/inspector": "^0.18.0",
|
|
25
|
+
"@skybridge/devtools": ">=0.22.0 <1.0.0",
|
|
26
|
+
"@types/cors": "^2.8.19",
|
|
27
|
+
"@types/express": "^5.0.6",
|
|
28
|
+
"@types/react": "^19.2.9",
|
|
29
|
+
"@types/react-dom": "^19.2.3",
|
|
30
|
+
"@vitejs/plugin-react": "^5.1.2",
|
|
31
|
+
"nodemon": "^3.1.11",
|
|
32
|
+
"shx": "^0.4.0",
|
|
33
|
+
"tsx": "^4.21.0",
|
|
34
|
+
"typescript": "^5.9.3"
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=24.13.0"
|
|
20
38
|
}
|
|
21
39
|
}
|