notifkit 0.1.12 → 0.1.13

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.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="./favicon.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Notifkit Observability & Admin</title>
8
- <script type="module" crossorigin src="./assets/index-Bsrmo9LE.js"></script>
8
+ <script type="module" crossorigin src="./assets/index-ggpJKZqZ.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="./assets/index-s-SXGIwv.css">
10
10
  </head>
11
11
  <body class="h-screen bg-background text-foreground antialiased overflow-hidden">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "notifkit",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Self-hosted notification infrastructure. One call delivers to email, SMS, push, and webhook — routed by preference, quiet hours, and consent.",
5
5
  "license": "MIT",
6
6
  "author": "devkitshq",
@@ -49,6 +49,7 @@
49
49
  "src",
50
50
  "drizzle",
51
51
  "dashboard/dist",
52
+ "scripts/notifkit.mjs",
52
53
  "scripts/create-project.mjs",
53
54
  "scripts/create-admin.mjs",
54
55
  "scripts/migrate.mjs",
@@ -56,6 +57,7 @@
56
57
  "LICENSE"
57
58
  ],
58
59
  "bin": {
60
+ "notifkit": "./scripts/notifkit.mjs",
59
61
  "notifkit-create-project": "./scripts/create-project.mjs",
60
62
  "notifkit-create-admin": "./scripts/create-admin.mjs",
61
63
  "notifkit-migrate": "./scripts/migrate.mjs"
@@ -59,3 +59,4 @@ const { id, apiKey } = await res.json();
59
59
  console.log(`\nProject "${name}" created. Save the API key now — it is not recoverable.\n`);
60
60
  console.log(`NOTIFKIT_PROJECT_ID=${id}`);
61
61
  console.log(`NOTIFKIT_API_KEY=${apiKey}\n`);
62
+ console.log("✓ Project created. If notifkit saved you time: github.com/devkitshq/notifkit ⭐");
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * The `notifkit` command. Today it has one subcommand, which hands off to
4
+ * create-notifkit so both spellings scaffold the same app:
5
+ *
6
+ * npx notifkit create my-app
7
+ * npm create notifkit@latest my-app
8
+ */
9
+
10
+ import { spawn } from "node:child_process";
11
+
12
+ const [command, ...args] = process.argv.slice(2);
13
+
14
+ if (command !== "create") {
15
+ console.error(
16
+ "Usage: notifkit create [name] [options]\n\n" +
17
+ "Scaffolds a new notifkit app. Run `notifkit create --help` for options.",
18
+ );
19
+ process.exit(command ? 1 : 0);
20
+ }
21
+
22
+ const npmArgs = [
23
+ "exec",
24
+ "--yes",
25
+ "--package=create-notifkit@latest",
26
+ "--",
27
+ "create-notifkit",
28
+ ...args,
29
+ ];
30
+
31
+ // npm is a .cmd shim on Windows, which only runs through a shell.
32
+ const quote = (a) => (/[\s"]/.test(a) ? `"${a.replace(/"/g, '""')}"` : a);
33
+ const child =
34
+ process.platform === "win32"
35
+ ? spawn(["npm", ...npmArgs].map(quote).join(" "), { stdio: "inherit", shell: true })
36
+ : spawn("npm", npmArgs, { stdio: "inherit" });
37
+
38
+ child.on("error", (err) => {
39
+ console.error(`notifkit create: could not run npm (${err.message})`);
40
+ process.exit(1);
41
+ });
42
+ child.on("exit", (code) => process.exit(code ?? 1));