create-basalt 1.0.0 → 1.1.0
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 +1 -1
- package/dist/{chunk-RFS7HGZ6.js → chunk-XV5NMTXT.js} +28 -16
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -21,12 +21,22 @@ function packageJson(options) {
|
|
|
21
21
|
if (options.billing) dependencies["@basaltkit/subscriptions"] = BASALT_VERSION;
|
|
22
22
|
if (options.cli) {
|
|
23
23
|
dependencies["@basaltkit/cli"] = BASALT_VERSION;
|
|
24
|
-
dependencies["@basaltkit/generator"] = BASALT_VERSION;
|
|
25
24
|
dependencies["@basaltkit/prisma"] = BASALT_VERSION;
|
|
26
25
|
}
|
|
27
26
|
for (const pkg of Object.keys(dependencies)) {
|
|
28
27
|
if (pkg.startsWith("@basaltkit/")) dependencies[pkg] = versionOf(pkg);
|
|
29
28
|
}
|
|
29
|
+
const devDependencies = {
|
|
30
|
+
"@basaltkit/testing": versionOf("@basaltkit/testing"),
|
|
31
|
+
"@types/node": "^22.15.0",
|
|
32
|
+
"pino-pretty": "^13.0.0",
|
|
33
|
+
tsx: "^4.19.0",
|
|
34
|
+
typescript: "^5.8.0",
|
|
35
|
+
vitest: "^3.1.0"
|
|
36
|
+
};
|
|
37
|
+
if (options.cli) {
|
|
38
|
+
devDependencies["@basaltkit/generator"] = versionOf("@basaltkit/generator");
|
|
39
|
+
}
|
|
30
40
|
return `${JSON.stringify(
|
|
31
41
|
{
|
|
32
42
|
name: options.name,
|
|
@@ -41,14 +51,7 @@ function packageJson(options) {
|
|
|
41
51
|
...options.cli ? { basalt: "tsx bin/basalt.ts" } : {}
|
|
42
52
|
},
|
|
43
53
|
dependencies: Object.fromEntries(Object.entries(dependencies).sort()),
|
|
44
|
-
devDependencies:
|
|
45
|
-
"@basaltkit/testing": versionOf("@basaltkit/testing"),
|
|
46
|
-
"@types/node": "^22.15.0",
|
|
47
|
-
"pino-pretty": "^13.0.0",
|
|
48
|
-
tsx: "^4.19.0",
|
|
49
|
-
typescript: "^5.8.0",
|
|
50
|
-
vitest: "^3.1.0"
|
|
51
|
-
}
|
|
54
|
+
devDependencies: Object.fromEntries(Object.entries(devDependencies).sort())
|
|
52
55
|
},
|
|
53
56
|
null,
|
|
54
57
|
2
|
|
@@ -143,18 +146,19 @@ function appTs(options) {
|
|
|
143
146
|
})`);
|
|
144
147
|
}
|
|
145
148
|
if (options.cli) {
|
|
146
|
-
imports.push(`import { commandsPlugin } from '@basaltkit/cli'`);
|
|
147
|
-
|
|
148
|
-
imports.push(`import { prismaSyncCommand } from '@basaltkit/prisma'`);
|
|
149
|
-
plugins.push(`commandsPlugin([...generatorCommands(), prismaSyncCommand()])`);
|
|
149
|
+
imports.push(`import { commandsPlugin, type CommandDefinition } from '@basaltkit/cli'`);
|
|
150
|
+
plugins.push(`...(options.commands && options.commands.length > 0 ? [commandsPlugin(options.commands)] : [])`);
|
|
150
151
|
}
|
|
151
152
|
plugins.push(`fastifyPlugin({ routes: ${routesExpression} })`);
|
|
153
|
+
const commandsField = options.cli ? `
|
|
154
|
+
/** Dev/CLI commands (make:*, ai:*, prisma:sync) \u2014 passed ONLY by bin/basalt.ts. */
|
|
155
|
+
commands?: CommandDefinition[]` : "";
|
|
152
156
|
return `${imports.join("\n")}
|
|
153
157
|
import { appRoutes } from './routes.js'
|
|
154
158
|
|
|
155
159
|
export interface BuildAppOptions {
|
|
156
160
|
logLevel?: string
|
|
157
|
-
pretty?: boolean
|
|
161
|
+
pretty?: boolean${commandsField}
|
|
158
162
|
}
|
|
159
163
|
|
|
160
164
|
export function buildApp(options: BuildAppOptions = {}) {
|
|
@@ -229,14 +233,22 @@ for (const signal of ['SIGINT', 'SIGTERM'] as const) {
|
|
|
229
233
|
function basaltBin() {
|
|
230
234
|
return `#!/usr/bin/env node
|
|
231
235
|
import { runCli } from '@basaltkit/cli'
|
|
236
|
+
import { generatorCommands } from '@basaltkit/generator'
|
|
237
|
+
import { prismaSyncCommand } from '@basaltkit/prisma'
|
|
232
238
|
import { buildApp } from '../src/app.js'
|
|
233
239
|
|
|
234
|
-
// The 'basalt' CLI: boots the app, runs one
|
|
240
|
+
// The 'basalt' CLI: boots the app WITH the dev/CLI commands, runs one, shuts down.
|
|
241
|
+
// The dev tools (@basaltkit/generator; add @basaltkit/ai for ai:*) are imported
|
|
242
|
+
// ONLY here \u2014 the runtime server (src/server.ts) never loads them, so the SaaS
|
|
243
|
+
// runs without the codegen/AI layer.
|
|
235
244
|
// pnpm basalt list \u2014 show available commands
|
|
236
245
|
// pnpm basalt routes \u2014 list registered HTTP routes
|
|
237
246
|
// pnpm basalt make:resource Project \u2014 generate a full resource vertical
|
|
238
247
|
// pnpm basalt make:service Project \u2014 generate a single artifact (schema/service/\u2026)
|
|
239
|
-
const app = buildApp({
|
|
248
|
+
const app = buildApp({
|
|
249
|
+
logLevel: 'silent',
|
|
250
|
+
commands: [...generatorCommands(), prismaSyncCommand()],
|
|
251
|
+
})
|
|
240
252
|
process.exit(await runCli({ app }))
|
|
241
253
|
`;
|
|
242
254
|
}
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/package.json
CHANGED