create-raredays-app 0.1.6 → 0.1.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/bin/index.js CHANGED
@@ -110,8 +110,7 @@ Options:
110
110
  config file pointing at the local install.
111
111
  --deploy <target> Scaffold deploy config for a target host.
112
112
  One of: vercel, none (default).
113
- Writes vercel.json, .env.example, docs/DEPLOY.md, and
114
- (full-stack only) .github/workflows/deploy-migrations.yml.
113
+ Writes vercel.json, .env.example, and docs/DEPLOY.md.
115
114
  -h, --help Show this help
116
115
 
117
116
  Presets:
@@ -724,14 +723,12 @@ async function applyDeploy(targetDir, opts) {
724
723
  if (!existsSync(docsDir)) await mkdir(docsDir, { recursive: true });
725
724
  await writeFile(resolve(docsDir, "DEPLOY.md"), buildDeployMd(opts));
726
725
 
727
- // 4. Migrations workflow — only for full-stack (static/client don't have a DB).
728
- if (isFullStack) {
729
- const workflowsDir = resolve(targetDir, ".github", "workflows");
730
- if (!existsSync(workflowsDir)) await mkdir(workflowsDir, { recursive: true });
731
- await writeFile(resolve(workflowsDir, "deploy-migrations.yml"), buildMigrationsWorkflow());
732
- }
726
+ // The full-stack template already ships .github/workflows/db-migrate.yml
727
+ // (production migrate on push to main, path-filtered, with a concurrency
728
+ // lock). We must NOT generate a second deploy-migrations.yml — that would run
729
+ // prod migrations twice and drift on Node/pnpm versions. See docs/DEPLOY.md.
733
730
 
734
- // 5. scripts/setup-vercel.sh — interactive linker.
731
+ // 4. scripts/setup-vercel.sh — interactive linker.
735
732
  const scriptsDir = resolve(targetDir, "scripts");
736
733
  if (!existsSync(scriptsDir)) await mkdir(scriptsDir, { recursive: true });
737
734
  const scriptPath = resolve(scriptsDir, "setup-vercel.sh");
@@ -739,7 +736,7 @@ async function applyDeploy(targetDir, opts) {
739
736
  const { chmod } = await import("node:fs/promises");
740
737
  await chmod(scriptPath, 0o755);
741
738
 
742
- // 6. Return the extra env-vars deploy implies.
739
+ // 5. Return the extra env-vars deploy implies.
743
740
  const extra = [];
744
741
  if (isFullStack) extra.push("DATABASE_URL");
745
742
  for (const m of opts.selectedModules ?? []) {
@@ -772,8 +769,9 @@ pairs well with Vercel.
772
769
  ? `
773
770
  ## 6. Run migrations
774
771
 
775
- The repo ships a workflow at \`.github/workflows/deploy-migrations.yml\` that
776
- runs \`pnpm db:migrate\` on push to \`main\`, gated behind a manual approval.
772
+ The full-stack template ships a workflow at \`.github/workflows/db-migrate.yml\`
773
+ that runs \`pnpm db:migrate\` on push to \`main\` when files under
774
+ \`db/migrations/**\` change, gated behind the \`production\` environment.
777
775
 
778
776
  To enable it:
779
777
 
@@ -864,45 +862,6 @@ This app is plain Next.js — it'll also run on:
864
862
  `;
865
863
  }
866
864
 
867
- function buildMigrationsWorkflow() {
868
- return `# Runs database migrations against the production database after a manual
869
- # approval. Requires a GitHub Environment named "production" with DATABASE_URL
870
- # as a secret and a required reviewer.
871
- #
872
- # See docs/DEPLOY.md for setup instructions.
873
- name: Deploy migrations
874
-
875
- on:
876
- push:
877
- branches: [main]
878
- workflow_dispatch:
879
-
880
- jobs:
881
- migrate:
882
- name: Apply pending migrations
883
- runs-on: ubuntu-latest
884
- environment: production
885
- steps:
886
- - uses: actions/checkout@v4
887
-
888
- - uses: pnpm/action-setup@v4
889
- with:
890
- version: 9
891
-
892
- - uses: actions/setup-node@v4
893
- with:
894
- node-version: 20
895
- cache: pnpm
896
-
897
- - run: pnpm install --frozen-lockfile
898
-
899
- - name: Run migrations
900
- env:
901
- DATABASE_URL: \${{ secrets.DATABASE_URL }}
902
- run: pnpm db:migrate
903
- `;
904
- }
905
-
906
865
  function buildSetupVercelScript() {
907
866
  return `#!/usr/bin/env bash
908
867
  # Interactive helper: links this repo to a new Vercel project.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-raredays-app",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Scaffold a new RareDays Next.js app.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Jeremy Harper <jeremy@raredays.com>",
@@ -23,7 +23,7 @@
23
23
  "devDependencies": {
24
24
  "typescript": "5.9.3",
25
25
  "vitest": "4.1.9",
26
- "@raredays/lint": "0.2.0"
26
+ "@raredays/lint": "0.2.1"
27
27
  },
28
28
  "engines": {
29
29
  "node": ">=20"
@@ -5,7 +5,7 @@
5
5
  // `Request`, which preserves arbitrary headers.
6
6
 
7
7
  import { describe, expect, it } from "vitest";
8
- import { app, SEEDED } from "./runtime.js";
8
+ import { app, SEEDED } from "./runtime.ts";
9
9
 
10
10
  // Sample test demonstrating how to test app code against the framework's
11
11
  // port contracts. The composition root provides the wired ports; tests
@@ -33,9 +33,9 @@
33
33
  "@raredays/style": "^0.1.0",
34
34
  "lucide-react": "1.14.0",
35
35
  "msw": "2.11.5",
36
- "next": "16.2.4",
37
- "react": "19.2.5",
38
- "react-dom": "19.2.5"
36
+ "next": "16.2.9",
37
+ "react": "19.2.7",
38
+ "react-dom": "19.2.7"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@raredays/lint": "^0.1.0",
@@ -5,7 +5,7 @@
5
5
  // `Request`, which preserves arbitrary headers.
6
6
 
7
7
  import { describe, expect, it } from "vitest";
8
- import { app, SEEDED } from "./runtime.js";
8
+ import { app, SEEDED } from "./runtime.ts";
9
9
 
10
10
  // Sample test demonstrating how to test app code against the framework's
11
11
  // port contracts. The composition root provides the wired ports; tests
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import { resolve } from "node:path";
15
15
  import { dryRun } from "@raredays/postgres/migrations";
16
- import * as appSchema from "./schema.js";
16
+ import * as appSchema from "./schema.ts";
17
17
 
18
18
  const migrationsFolder = resolve(import.meta.dirname, "migrations");
19
19
  const databaseUrl = process.env.DATABASE_URL;
@@ -26,7 +26,7 @@
26
26
  // doesn't require DATABASE_URL.
27
27
  import { createDb, type RaredaysDatabase as NeonDb } from "@raredays/postgres-neon";
28
28
  import { createPglite, type RaredaysDatabase as PgliteDb } from "@raredays/postgres-pglite";
29
- import * as appSchema from "./schema.js";
29
+ import * as appSchema from "./schema.ts";
30
30
 
31
31
  export type Db = NeonDb<typeof appSchema> | PgliteDb<typeof appSchema>;
32
32
 
@@ -20,7 +20,7 @@
20
20
  */
21
21
  import { resolve } from "node:path";
22
22
  import { safeMigrate } from "@raredays/postgres/migrations";
23
- import * as appSchema from "./schema.js";
23
+ import * as appSchema from "./schema.ts";
24
24
 
25
25
  const migrationsFolder = resolve(import.meta.dirname, "migrations");
26
26
  const appKey = process.env.npm_package_name ?? "raredays-app";
@@ -43,9 +43,9 @@
43
43
  "drizzle-orm": "0.45.2",
44
44
  "lucide-react": "1.14.0",
45
45
  "msw": "2.11.5",
46
- "next": "16.2.4",
47
- "react": "19.2.5",
48
- "react-dom": "19.2.5"
46
+ "next": "16.2.9",
47
+ "react": "19.2.7",
48
+ "react-dom": "19.2.7"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@raredays/lint": "^0.1.0",
@@ -26,9 +26,9 @@
26
26
  "@raredays/core": "^0.1.0",
27
27
  "@raredays/style": "^0.1.0",
28
28
  "lucide-react": "1.14.0",
29
- "next": "16.2.4",
30
- "react": "19.2.5",
31
- "react-dom": "19.2.5"
29
+ "next": "16.2.9",
30
+ "react": "19.2.7",
31
+ "react-dom": "19.2.7"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@raredays/lint": "^0.1.0",