create-disposabl-app 0.3.0 → 0.3.2
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/dist/index.js +36 -8
- package/dist/templates/default/.github/README.md +99 -56
- package/dist/templates/default/.github/actionlint.yaml +6 -0
- package/dist/templates/default/.github/workflows/pipeline.yml.example +492 -0
- package/dist/templates/default/apps/desktop/README.md +44 -14
- package/dist/templates/default/apps/desktop/build-ci.mjs +56 -0
- package/dist/templates/default/apps/desktop/forge.config.mts +36 -17
- package/dist/templates/default/apps/desktop/package.json +5 -5
- package/dist/templates/default/apps/mobile/README.md +127 -0
- package/dist/templates/default/apps/mobile/app.config.js +78 -0
- package/dist/templates/default/apps/mobile/assets/expo.icon/icon.json +21 -26
- package/dist/templates/default/apps/mobile/eas.json +22 -0
- package/dist/templates/default/apps/mobile/eslint.config.js +3 -3
- package/dist/templates/default/apps/mobile/package.json +5 -3
- package/dist/templates/default/apps/mobile/plugins/with-android-signing.js +29 -0
- package/dist/templates/default/apps/mobile/scripts/android-config.test.mjs +128 -0
- package/dist/templates/default/apps/mobile/tsconfig.json +3 -12
- package/dist/templates/default/apps/web/src/index.css +124 -73
- package/dist/templates/default/apps/web/src/routeTree.gen.ts +0 -9
- package/dist/templates/default/bun.lock +121 -11
- package/dist/templates/default/bunfig.toml +8 -1
- package/dist/templates/default/disposabl.json +9 -4
- package/dist/templates/default/gitignore +2 -0
- package/dist/templates/default/package.json +1 -0
- package/dist/templates/default/packages/backend/convex/todos/internal.ts +3 -3
- package/dist/templates/default/packages/backend/package.json +2 -3
- package/dist/templates/default/packages/disposabl-kit/client/styles/globals.css +43 -43
- package/dist/templates/default/packages/disposabl-kit/eslint.config.js +2 -2
- package/dist/templates/default/packages/disposabl-kit/package.json +2 -1
- package/dist/templates/default/packages/disposabl-kit/platforms.ts +87 -0
- package/dist/templates/default/packages/disposabl-kit/server/http.ts +20 -7
- package/dist/templates/default/packages/disposabl-kit/server/lib/functions.ts +1 -10
- package/dist/templates/default/packages/disposabl-kit/server/lib/platform-spec.ts +137 -0
- package/dist/templates/default/turbo.json +16 -5
- package/package.json +1 -1
- package/dist/templates/default/.github/workflows/pipeline.yml +0 -139
- package/dist/templates/default/packages/disposabl-kit/server/dev-setup.mjs +0 -39
- package/dist/templates/default/packages/disposabl-kit/server/lib/mcp-tools.ts +0 -47
- package/dist/templates/default/packages/disposabl-kit/server/lib/platforms.ts +0 -20
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { tool, type ToolDefinition } from "@convex-dev/mcp";
|
|
2
|
-
import { makeFunctionReference as reference } from "convex/server";
|
|
3
|
-
import type { GenericValidator, PropertyValidators } from "convex/values";
|
|
4
|
-
|
|
5
|
-
type PlatformFunction = {
|
|
6
|
-
isInternal?: boolean;
|
|
7
|
-
isQuery?: boolean;
|
|
8
|
-
isMutation?: boolean;
|
|
9
|
-
mcp?: boolean;
|
|
10
|
-
args: PropertyValidators;
|
|
11
|
-
returns: GenericValidator;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/** Adapt opted-in internal functions without duplicating their validators. */
|
|
15
|
-
export function createMcpTools(
|
|
16
|
-
modules: Record<string, Record<string, unknown>>,
|
|
17
|
-
) {
|
|
18
|
-
const tools: Record<string, ToolDefinition> = Object.create(null);
|
|
19
|
-
for (const [path, exports] of Object.entries(modules)) {
|
|
20
|
-
for (const [exportName, value] of Object.entries(exports)) {
|
|
21
|
-
const fn = value as PlatformFunction | null;
|
|
22
|
-
if (!fn?.isInternal || !fn.mcp) continue;
|
|
23
|
-
const id = `${path}:${exportName}`;
|
|
24
|
-
const name = id.replace(/[^A-Za-z0-9_.-]/g, "_");
|
|
25
|
-
if (Object.hasOwn(tools, name))
|
|
26
|
-
throw new Error(`Duplicate MCP tool name: ${name}`);
|
|
27
|
-
const { userId, ...args } = fn.args;
|
|
28
|
-
tools[name] = tool({
|
|
29
|
-
description: `Call ${id}.`,
|
|
30
|
-
...(fn.isQuery ? { annotations: { readOnlyHint: true } } : {}),
|
|
31
|
-
args,
|
|
32
|
-
returns: fn.returns,
|
|
33
|
-
handler: async (ctx, input, user) => {
|
|
34
|
-
const params = {
|
|
35
|
-
...input,
|
|
36
|
-
...(userId ? { userId: user.userId } : {}),
|
|
37
|
-
};
|
|
38
|
-
if (fn.isQuery) return ctx.runQuery(reference<"query">(id), params);
|
|
39
|
-
if (fn.isMutation)
|
|
40
|
-
return ctx.runMutation(reference<"mutation">(id), params);
|
|
41
|
-
return ctx.runAction(reference<"action">(id), params);
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return tools;
|
|
47
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import config from "../../../../disposabl.json";
|
|
2
|
-
|
|
3
|
-
export type Platforms = boolean | { api?: boolean; mcp?: boolean };
|
|
4
|
-
|
|
5
|
-
/** The generated app config is the source of truth for enabled transports. */
|
|
6
|
-
export function getPlatforms() {
|
|
7
|
-
const enabled = new Set(config.platforms);
|
|
8
|
-
return {
|
|
9
|
-
isApiEnabled:
|
|
10
|
-
enabled.has("api") ||
|
|
11
|
-
enabled.has("cli") ||
|
|
12
|
-
enabled.has("python-sdk") ||
|
|
13
|
-
enabled.has("typescript-sdk"),
|
|
14
|
-
isCliEnabled: enabled.has("cli"),
|
|
15
|
-
isMcpEnabled: enabled.has("mcp"),
|
|
16
|
-
isSdkEnabled: enabled.has("python-sdk") || enabled.has("typescript-sdk"),
|
|
17
|
-
isOpenaiPluginEnabled: enabled.has("openai-plugin"),
|
|
18
|
-
isClaudePluginEnabled: enabled.has("claude-code-plugin"),
|
|
19
|
-
};
|
|
20
|
-
}
|