create-jant 0.1.0 → 0.1.2

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/README.md CHANGED
@@ -6,13 +6,13 @@ Bookstrap a new [Jant](https://github.com/jant-me/jant) project.
6
6
 
7
7
  ```bash
8
8
  # Using npm
9
- npm create jant my-site
9
+ npm create jant my-blog
10
10
 
11
11
  # Using pnpm
12
- pnpm create jant my-site
12
+ pnpm create jant my-blog
13
13
 
14
14
  # Using yarn
15
- yarn create jant my-site
15
+ yarn create jant my-blog
16
16
 
17
17
  # Interactive mode (prompts for project name)
18
18
  npm create jant
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { program } from "commander";
3
3
  import * as p from "@clack/prompts";
4
4
  import chalk from "chalk";
5
+ import crypto from "crypto";
5
6
  import fs from "fs-extra";
6
7
  import path from "path";
7
8
  import { fileURLToPath } from "url";
@@ -14,6 +15,9 @@ function isValidProjectName(name) {
14
15
  function toValidProjectName(name) {
15
16
  return name.toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/^-+|-+$/g, "").replace(/-+/g, "-");
16
17
  }
18
+ function generateAuthSecret() {
19
+ return crypto.randomBytes(32).toString("base64");
20
+ }
17
21
  async function copyTemplate(config) {
18
22
  const { projectName, targetDir } = config;
19
23
  await fs.copy(TEMPLATE_DIR, targetDir, {
@@ -59,6 +63,12 @@ async function copyTemplate(config) {
59
63
  content = content.replace(/bucket_name = "jant-site-media"/g, `bucket_name = "${projectName}-media"`);
60
64
  await fs.writeFile(wranglerPath, content, "utf-8");
61
65
  }
66
+ const authSecret = generateAuthSecret();
67
+ const devVarsContent = `# Generated by create-jant
68
+ # AUTH_SECRET is used for session encryption (better-auth)
69
+ AUTH_SECRET=${authSecret}
70
+ `;
71
+ await fs.writeFile(path.join(targetDir, ".dev.vars"), devVarsContent, "utf-8");
62
72
  }
63
73
  async function main() {
64
74
  console.log();
@@ -131,13 +141,7 @@ async function main() {
131
141
  }
132
142
  console.log();
133
143
  p.note(
134
- [
135
- `cd ${projectName}`,
136
- "pnpm install",
137
- "cp .dev.vars.example .dev.vars",
138
- "# Edit .dev.vars with your AUTH_SECRET",
139
- "pnpm dev"
140
- ].join("\n"),
144
+ [`cd ${projectName}`, "pnpm install", "pnpm dev"].join("\n"),
141
145
  "Next steps"
142
146
  );
143
147
  p.outro(chalk.green("Happy coding!"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-jant",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Create a new Jant project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -47,7 +47,8 @@
47
47
  ],
48
48
  "license": "AGPL-3.0",
49
49
  "publishConfig": {
50
- "access": "public"
50
+ "access": "public",
51
+ "provenance": true
51
52
  },
52
53
  "scripts": {
53
54
  "build": "tsup src/index.ts --format esm --clean --outDir dist",
@@ -0,0 +1,7 @@
1
+ # Allow native dependencies to run build scripts
2
+ # Required for: workerd (Cloudflare Workers), esbuild, swc, sharp
3
+ onlyBuiltDependencies:
4
+ - "@swc/core"
5
+ - esbuild
6
+ - sharp
7
+ - workerd