create-mikstack 0.1.18 → 0.1.20
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
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import * as p from "@clack/prompts";
|
|
3
|
-
import { execSync } from "node:child_process";
|
|
3
|
+
import { execFile, execSync } from "node:child_process";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { parseArgs } from "node:util";
|
|
5
|
+
import { parseArgs, promisify } from "node:util";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
|
|
8
8
|
//#region src/config.ts
|
|
@@ -174,6 +174,8 @@ function scaffold(config, onStatus) {
|
|
|
174
174
|
recursive: true,
|
|
175
175
|
force: true
|
|
176
176
|
});
|
|
177
|
+
fs.rmSync(path.join(target, "agents.md"), { force: true });
|
|
178
|
+
fs.rmSync(path.join(target, ".npmrc"), { force: true });
|
|
177
179
|
onStatus?.("Applying templates...");
|
|
178
180
|
const overlay = (dir) => {
|
|
179
181
|
copyDir(dir, target);
|
|
@@ -320,6 +322,7 @@ function renderDir(dir, context) {
|
|
|
320
322
|
|
|
321
323
|
//#endregion
|
|
322
324
|
//#region src/cli.ts
|
|
325
|
+
promisify(execFile);
|
|
323
326
|
async function cli() {
|
|
324
327
|
const { values, positionals } = parseArgs({
|
|
325
328
|
allowPositionals: true,
|
|
@@ -356,10 +359,7 @@ async function cli() {
|
|
|
356
359
|
p.log.info(`Scaffolding ${config.projectName} with recommended defaults (non-interactive)...`);
|
|
357
360
|
} else config = await runPrompts(projectName, packageManager);
|
|
358
361
|
const cwd = path.resolve(process.cwd(), config.targetDir);
|
|
359
|
-
const run = (cmd) =>
|
|
360
|
-
cwd,
|
|
361
|
-
stdio: "pipe"
|
|
362
|
-
});
|
|
362
|
+
const run = (cmd, args) => execFileAsync(cmd, args, { cwd });
|
|
363
363
|
await p.tasks([
|
|
364
364
|
{
|
|
365
365
|
title: "Scaffolding project",
|
|
@@ -372,7 +372,7 @@ async function cli() {
|
|
|
372
372
|
{
|
|
373
373
|
title: "Installing dependencies",
|
|
374
374
|
task: async () => {
|
|
375
|
-
run(
|
|
375
|
+
await run(packageManager, ["install"]);
|
|
376
376
|
return "Dependencies installed";
|
|
377
377
|
}
|
|
378
378
|
},
|
|
@@ -380,7 +380,7 @@ async function cli() {
|
|
|
380
380
|
title: "Formatting project",
|
|
381
381
|
task: async () => {
|
|
382
382
|
try {
|
|
383
|
-
run(
|
|
383
|
+
await run(packageManager, ["run", "format"]);
|
|
384
384
|
} catch {}
|
|
385
385
|
return "Project formatted";
|
|
386
386
|
}
|
|
@@ -388,9 +388,13 @@ async function cli() {
|
|
|
388
388
|
{
|
|
389
389
|
title: "Initializing git repository",
|
|
390
390
|
task: async () => {
|
|
391
|
-
run("git init");
|
|
392
|
-
run("git add .");
|
|
393
|
-
run("git
|
|
391
|
+
await run("git", ["init"]);
|
|
392
|
+
await run("git", ["add", "."]);
|
|
393
|
+
await run("git", [
|
|
394
|
+
"commit",
|
|
395
|
+
"-m",
|
|
396
|
+
"the future is now"
|
|
397
|
+
]);
|
|
394
398
|
return "Git repository initialized";
|
|
395
399
|
}
|
|
396
400
|
}
|
package/package.json
CHANGED
|
@@ -17,8 +17,18 @@ FROM base AS build
|
|
|
17
17
|
WORKDIR /app
|
|
18
18
|
COPY --from=deps /app/node_modules ./node_modules
|
|
19
19
|
COPY . .
|
|
20
|
+
# {{#if:pmIsNpm}}
|
|
20
21
|
RUN npm run build
|
|
21
22
|
RUN npm prune --omit=dev
|
|
23
|
+
# {{/if:pmIsNpm}}
|
|
24
|
+
# {{#if:pmIsPnpm}}
|
|
25
|
+
RUN corepack enable && pnpm run build
|
|
26
|
+
RUN pnpm prune --prod
|
|
27
|
+
# {{/if:pmIsPnpm}}
|
|
28
|
+
# {{#if:pmIsBun}}
|
|
29
|
+
RUN npm i -g bun && bun run build
|
|
30
|
+
RUN bun install --production
|
|
31
|
+
# {{/if:pmIsBun}}
|
|
22
32
|
|
|
23
33
|
FROM base
|
|
24
34
|
WORKDIR /app
|
package/templates/base/agents.md
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Agent Guidelines for {{projectName}}
|
|
2
|
-
|
|
3
|
-
## Architecture Overview
|
|
4
|
-
|
|
5
|
-
This is a SvelteKit application using:
|
|
6
|
-
|
|
7
|
-
- **Drizzle ORM** for database schema and migrations
|
|
8
|
-
- **Zero** (@rocicorp/zero) for real-time client-side data sync
|
|
9
|
-
- **better-auth** for authentication (magic link flow)
|
|
10
|
-
|
|
11
|
-
## File Conventions
|
|
12
|
-
|
|
13
|
-
- Server-only code: `src/lib/server/` (enforced by SvelteKit)
|
|
14
|
-
- Zero schema/queries/mutators: `src/lib/zero/`
|
|
15
|
-
- Auth client: `src/lib/auth-client.ts`
|
|
16
|
-
- Zero client context: `src/lib/z.svelte.ts`
|
|
17
|
-
- API routes for Zero: `src/routes/api/zero/`
|
|
18
|
-
|
|
19
|
-
## When Modifying the Schema
|
|
20
|
-
|
|
21
|
-
1. Update Drizzle schema in `src/lib/server/db/schema.ts`
|
|
22
|
-
2. Run `{{pmRun}} db:push` (dev) or `{{pmRun}} db:generate` + `{{pmRun}} db:migrate` (production)
|
|
23
|
-
3. Run `{{pmRun}} zero:generate` to regenerate Zero schema
|
|
24
|
-
4. Update queries/mutators in `src/lib/zero/` as needed
|
|
25
|
-
|
|
26
|
-
## Testing
|
|
27
|
-
|
|
28
|
-
Run `{{pmRun}} check` for type checking and `{{pmRun}} lint` for linting before committing.
|