@helloleo/plugins 0.2.6 → 0.2.8
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 +249 -704
- package/dist/templates/tanstack-router-2026-06-15/package.json +1 -1
- package/package.json +1 -1
- package/src/templates/tanstack-router-2026-06-15/package.json +1 -1
- package/src/tools/scaffold.ts +35 -23
- package/src/tools/setup-netsuite.ts +241 -773
- package/dist/templates/tanstack-router-2026-06-15/src/router.tsx +0 -23
- package/src/templates/tanstack-router-2026-06-15/src/router.tsx +0 -23
package/package.json
CHANGED
package/src/tools/scaffold.ts
CHANGED
|
@@ -27,6 +27,19 @@ export type ScaffoldType = keyof typeof SCAFFOLD_TEMPLATES;
|
|
|
27
27
|
/** Default template id, kept for callers that predate the `type` param. */
|
|
28
28
|
export const SCAFFOLD_VERSION = SCAFFOLD_TEMPLATES["tanstack-start"];
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* The container can pin the template via SCAFFOLD_VERSION (a versioned
|
|
32
|
+
* template id, e.g. "tanstack-start-2026-06-18"). Unset or unknown values
|
|
33
|
+
* fall back to the tanstack-router template, so a stale env var can never
|
|
34
|
+
* reproduce the ENOENT-on-missing-template failure.
|
|
35
|
+
*/
|
|
36
|
+
export function resolveTemplateId(): string {
|
|
37
|
+
const version = process.env.SCAFFOLD_VERSION;
|
|
38
|
+
const known: string[] = Object.values(SCAFFOLD_TEMPLATES);
|
|
39
|
+
if (version && known.includes(version)) return version;
|
|
40
|
+
return SCAFFOLD_TEMPLATES["tanstack-router"];
|
|
41
|
+
}
|
|
42
|
+
|
|
30
43
|
/**
|
|
31
44
|
* The project workspace directory is named after the project UUID -- the
|
|
32
45
|
* webapp generates `<slugified-name>-<uuidv4>` (actions.ts createProject)
|
|
@@ -78,7 +91,7 @@ export async function writeBaseScaffold(
|
|
|
78
91
|
{ name, description }: z.infer<typeof scaffoldOptionsSchema>,
|
|
79
92
|
dir: string,
|
|
80
93
|
): Promise<string[]> {
|
|
81
|
-
const templateId =
|
|
94
|
+
const templateId = resolveTemplateId();
|
|
82
95
|
const created = await renderTemplate(
|
|
83
96
|
templateId,
|
|
84
97
|
{
|
|
@@ -110,35 +123,34 @@ export const scaffold = tool({
|
|
|
110
123
|
description: scaffoldOptionsSchema.shape.description,
|
|
111
124
|
},
|
|
112
125
|
async execute(args, context) {
|
|
113
|
-
|
|
126
|
+
const isStart =
|
|
127
|
+
resolveTemplateId() === SCAFFOLD_TEMPLATES["tanstack-start"];
|
|
114
128
|
const created = await writeBaseScaffold(args, context.directory);
|
|
115
129
|
const uiComponents = created.filter((f) =>
|
|
116
130
|
f.startsWith("src/components/ui/"),
|
|
117
131
|
);
|
|
118
132
|
const rest = created.filter((f) => !f.startsWith("src/components/ui/"));
|
|
119
133
|
|
|
120
|
-
const typeNotes =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
"- Fetch data from external APIs only. If the app needs its own persistence or server-side code, it should have been scaffolded as tanstack-start.",
|
|
131
|
-
];
|
|
134
|
+
const typeNotes = isStart
|
|
135
|
+
? [
|
|
136
|
+
"- This is a TanStack Start project. The server entry is src/server.ts. There is no index.html or client entrypoint.",
|
|
137
|
+
"- For JSON/CRUD APIs, add server routes under src/routes/api/. Read src/routes/api/health.ts first, add routes as needed.",
|
|
138
|
+
"- The database schema lives in src/db/schema.ts. Migrations run automatically.",
|
|
139
|
+
]
|
|
140
|
+
: [
|
|
141
|
+
"- This is a TanStack Router SPA. The client entry is index.html -> src/main.tsx. There is no server: no API routes, no server functions, no database.",
|
|
142
|
+
"- Fetch data from external APIs only. If the app needs its own persistence or server-side code, it should have been scaffolded as tanstack-start.",
|
|
143
|
+
];
|
|
132
144
|
|
|
133
|
-
const nextSteps =
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
145
|
+
const nextSteps = isStart
|
|
146
|
+
? [
|
|
147
|
+
"Next: read src/routes/index.tsx and continue with the user's request.",
|
|
148
|
+
"For authentication (password and/or OAuth), call setup_authentication.",
|
|
149
|
+
"For NetSuite projects, call setup_netsuite.",
|
|
150
|
+
]
|
|
151
|
+
: [
|
|
152
|
+
"Next: read src/routes/index.tsx and continue with the user's request.",
|
|
153
|
+
];
|
|
142
154
|
|
|
143
155
|
return [
|
|
144
156
|
`Scaffolded ${created.length} files:`,
|