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 CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2026 Machize Contributors
3
+ Copyright (c) 2026 Basalt Contributors
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -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
- imports.push(`import { generatorCommands } from '@basaltkit/generator'`);
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 command, shuts down.
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({ logLevel: 'silent' })
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
@@ -3,7 +3,7 @@ import {
3
3
  TargetNotEmptyError,
4
4
  createProject,
5
5
  detectPackageManager
6
- } from "./chunk-RFS7HGZ6.js";
6
+ } from "./chunk-XV5NMTXT.js";
7
7
 
8
8
  // src/cli.ts
9
9
  import { spawn } from "child_process";
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  TargetNotEmptyError,
3
3
  createProject,
4
4
  detectPackageManager
5
- } from "./chunk-RFS7HGZ6.js";
5
+ } from "./chunk-XV5NMTXT.js";
6
6
  export {
7
7
  TargetNotEmptyError,
8
8
  createProject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-basalt",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "description": "Scaffold a production-shaped Basalt SaaS app: npm create basalt my-saas [--billing] [--ui] [--cli] [--install] [--git]",
5
5
  "license": "MIT",
6
6
  "type": "module",