create-omg 0.4.41 → 0.4.43

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.
Files changed (81) hide show
  1. package/README.md +16 -6
  2. package/dist/index.mjs +71 -12
  3. package/dist/{template → templates/react-ts}/AGENTS.md +22 -0
  4. package/dist/templates/react-ts/_gitignore +24 -0
  5. package/dist/{template → templates/react-ts}/bun.lock +105 -58
  6. package/dist/templates/react-ts/components.json +25 -0
  7. package/dist/templates/react-ts/eslint.config.js +23 -0
  8. package/dist/templates/react-ts/functions/.gitkeep +0 -0
  9. package/dist/{template → templates/react-ts}/package.json +5 -0
  10. package/dist/templates/react-ts/public/favicon.svg +1 -0
  11. package/dist/templates/react-ts/public/icons/apple-touch-icon.png +0 -0
  12. package/dist/templates/react-ts/public/icons/pwa-192x192.png +0 -0
  13. package/dist/templates/react-ts/public/icons/pwa-512x512-maskable.png +0 -0
  14. package/dist/templates/react-ts/public/icons/pwa-512x512.png +0 -0
  15. package/dist/templates/react-ts/public/icons.svg +24 -0
  16. package/dist/templates/react-ts/schema.ts +5 -0
  17. package/dist/templates/react-ts/server/db.ts +103 -0
  18. package/dist/templates/react-ts/src/App.tsx +128 -0
  19. package/dist/templates/react-ts/src/components/ui/animated-number.tsx +102 -0
  20. package/dist/templates/react-ts/src/components/ui/animated-text.tsx +109 -0
  21. package/dist/templates/react-ts/src/components/ui/bottom-nav.tsx +131 -0
  22. package/dist/templates/react-ts/src/components/ui/button.tsx +84 -0
  23. package/dist/templates/react-ts/src/components/ui/card.tsx +70 -0
  24. package/dist/templates/react-ts/src/components/ui/otp-input.tsx +179 -0
  25. package/dist/templates/react-ts/src/components/ui/scroll-affordance.tsx +106 -0
  26. package/dist/templates/react-ts/src/components/ui/sound.ts +182 -0
  27. package/dist/templates/react-ts/src/components/ui/transitions.tsx +419 -0
  28. package/dist/templates/react-ts/src/components/ui/vibes-ui-styles.ts +388 -0
  29. package/dist/templates/react-ts/src/db.drizzle.ts +5 -0
  30. package/dist/templates/react-ts/src/index.css +168 -0
  31. package/dist/templates/react-ts/src/lib/utils.ts +6 -0
  32. package/dist/templates/react-ts/src/main.tsx +22 -0
  33. package/dist/templates/react-ts/src/routeTree.gen.ts +59 -0
  34. package/dist/templates/react-ts/src/routes/__root.tsx +7 -0
  35. package/dist/templates/react-ts/src/routes/index.tsx +9 -0
  36. package/dist/templates/react-ts/tsconfig.app.json +30 -0
  37. package/dist/templates/react-ts/tsconfig.json +10 -0
  38. package/dist/templates/react-ts/tsconfig.node.json +24 -0
  39. package/dist/{template → templates/react-ts}/vite.config.ts +9 -1
  40. package/dist/templates/react-ts-start/AGENTS.md +75 -0
  41. package/dist/templates/react-ts-start/README.md +58 -0
  42. package/dist/templates/react-ts-start/bun.lock +1688 -0
  43. package/dist/templates/react-ts-start/package.json +58 -0
  44. package/dist/templates/react-ts-start/src/routeTree.gen.ts +68 -0
  45. package/dist/templates/react-ts-start/src/router.tsx +18 -0
  46. package/dist/templates/react-ts-start/src/routes/__root.tsx +40 -0
  47. package/dist/templates/react-ts-start/src/routes/index.tsx +7 -0
  48. package/dist/templates/react-ts-start/vite.config.ts +29 -0
  49. package/package.json +3 -3
  50. package/dist/template/src/main.tsx +0 -10
  51. /package/dist/{template → templates/react-ts}/README.md +0 -0
  52. /package/dist/{template → templates/react-ts}/index.html +0 -0
  53. /package/dist/{template → templates/react-ts-start}/_gitignore +0 -0
  54. /package/dist/{template → templates/react-ts-start}/components.json +0 -0
  55. /package/dist/{template → templates/react-ts-start}/eslint.config.js +0 -0
  56. /package/dist/{template → templates/react-ts-start}/functions/.gitkeep +0 -0
  57. /package/dist/{template → templates/react-ts-start}/public/favicon.svg +0 -0
  58. /package/dist/{template → templates/react-ts-start}/public/icons/apple-touch-icon.png +0 -0
  59. /package/dist/{template → templates/react-ts-start}/public/icons/pwa-192x192.png +0 -0
  60. /package/dist/{template → templates/react-ts-start}/public/icons/pwa-512x512-maskable.png +0 -0
  61. /package/dist/{template → templates/react-ts-start}/public/icons/pwa-512x512.png +0 -0
  62. /package/dist/{template → templates/react-ts-start}/public/icons.svg +0 -0
  63. /package/dist/{template → templates/react-ts-start}/schema.ts +0 -0
  64. /package/dist/{template → templates/react-ts-start}/server/db.ts +0 -0
  65. /package/dist/{template → templates/react-ts-start}/src/App.tsx +0 -0
  66. /package/dist/{template → templates/react-ts-start}/src/components/ui/animated-number.tsx +0 -0
  67. /package/dist/{template → templates/react-ts-start}/src/components/ui/animated-text.tsx +0 -0
  68. /package/dist/{template → templates/react-ts-start}/src/components/ui/bottom-nav.tsx +0 -0
  69. /package/dist/{template → templates/react-ts-start}/src/components/ui/button.tsx +0 -0
  70. /package/dist/{template → templates/react-ts-start}/src/components/ui/card.tsx +0 -0
  71. /package/dist/{template → templates/react-ts-start}/src/components/ui/otp-input.tsx +0 -0
  72. /package/dist/{template → templates/react-ts-start}/src/components/ui/scroll-affordance.tsx +0 -0
  73. /package/dist/{template → templates/react-ts-start}/src/components/ui/sound.ts +0 -0
  74. /package/dist/{template → templates/react-ts-start}/src/components/ui/transitions.tsx +0 -0
  75. /package/dist/{template → templates/react-ts-start}/src/components/ui/vibes-ui-styles.ts +0 -0
  76. /package/dist/{template → templates/react-ts-start}/src/db.drizzle.ts +0 -0
  77. /package/dist/{template → templates/react-ts-start}/src/index.css +0 -0
  78. /package/dist/{template → templates/react-ts-start}/src/lib/utils.ts +0 -0
  79. /package/dist/{template → templates/react-ts-start}/tsconfig.app.json +0 -0
  80. /package/dist/{template → templates/react-ts-start}/tsconfig.json +0 -0
  81. /package/dist/{template → templates/react-ts-start}/tsconfig.node.json +0 -0
package/README.md CHANGED
@@ -1,14 +1,24 @@
1
1
  # create-omg
2
2
 
3
- Create a new omg.dev app from the official starter:
3
+ Copy an official React starter. This is **not** the current product.
4
+
5
+ The current product is the local agent control plane:
6
+
7
+ ```bash
8
+ curl -fsSL https://raw.githubusercontent.com/BennyKok/omg.dev/main/scripts/setup.sh | bash
9
+ ```
10
+
11
+ Then open **http://localhost:8766**. You bring your own agent accounts.
12
+ `lfg` is a compatibility alias.
13
+
14
+ `create-omg` only copies starter files. It does not install the control
15
+ plane and it does not deploy to `*.omgs.app`.
4
16
 
5
17
  ```sh
6
- bun create omg my-app
18
+ npx create-omg my-app
7
19
  cd my-app
8
20
  bun run dev
9
21
  ```
10
22
 
11
- The same generator is available through `npx create-omg my-app` and
12
- `omg create my-app`.
13
-
14
- Use `--no-install` to create the project without installing dependencies.
23
+ `omg create` from `@omg-dev/cli` 0.4.x is retired. The same generator is
24
+ available as `omg-apps create` from `@omg-dev/apps`.
package/dist/index.mjs CHANGED
@@ -2,6 +2,7 @@
2
2
  // @bun
3
3
 
4
4
  // src/index.ts
5
+ import { existsSync as existsSync2 } from "fs";
5
6
  import { fileURLToPath } from "url";
6
7
 
7
8
  // src/create.ts
@@ -59,31 +60,83 @@ async function createApp(options) {
59
60
  if (options.install === false)
60
61
  output(" bun install");
61
62
  output(" bun run dev");
62
- output(" omg deploy");
63
+ output("");
64
+ output("This starter is not the current product.");
65
+ output("Current product: curl -fsSL https://raw.githubusercontent.com/BennyKok/omg.dev/main/scripts/setup.sh | bash");
66
+ output("Then open http://localhost:8766");
63
67
  }
64
68
 
65
69
  // src/index.ts
66
- var HELP = `Create a new omg.dev app
70
+ var TEMPLATES = {
71
+ "react-ts": "React + TanStack Router (SPA, prerendered)",
72
+ "react-ts-start": "React + TanStack Start (SSR) \u2014 experimental"
73
+ };
74
+ var DEFAULT_TEMPLATE = "react-ts";
75
+ var HELP = `create-omg \u2014 copy an omg React starter
76
+
77
+ This is not the current product. The current product is the local
78
+ agent control plane:
79
+
80
+ curl -fsSL https://raw.githubusercontent.com/BennyKok/omg.dev/main/scripts/setup.sh | bash
81
+ open http://localhost:8766
67
82
 
68
- bun create omg <name>
69
83
  npx create-omg <name>
70
84
 
71
85
  Options:
72
- --no-install create files without installing dependencies
73
- --help show this help
86
+ --template <id> starter to use (default: ${DEFAULT_TEMPLATE})
87
+ --no-install create files without installing dependencies
88
+ --help show this help
89
+
90
+ Templates:
91
+ ${Object.entries(TEMPLATES).map(([id, desc]) => ` ${id.padEnd(16)} ${desc}`).join(`
92
+ `)}
74
93
  `;
94
+ function parseTemplate(args) {
95
+ const flagIndex = args.findIndex((arg) => arg === "--template" || arg === "-t");
96
+ if (flagIndex !== -1) {
97
+ const value = args[flagIndex + 1];
98
+ if (!value || value.startsWith("-"))
99
+ throw new Error("--template needs a value");
100
+ if (!(value in TEMPLATES)) {
101
+ throw new Error(`unknown template ${JSON.stringify(value)} (want: ${Object.keys(TEMPLATES).join(", ")})`);
102
+ }
103
+ return value;
104
+ }
105
+ const inline = args.find((arg) => arg.startsWith("--template="));
106
+ if (inline) {
107
+ const value = inline.slice("--template=".length);
108
+ if (!(value in TEMPLATES)) {
109
+ throw new Error(`unknown template ${JSON.stringify(value)} (want: ${Object.keys(TEMPLATES).join(", ")})`);
110
+ }
111
+ return value;
112
+ }
113
+ return DEFAULT_TEMPLATE;
114
+ }
115
+ function parseDestination(args) {
116
+ const flagIndex = args.findIndex((arg) => arg === "--template" || arg === "-t");
117
+ const consumed = flagIndex === -1 ? -1 : flagIndex + 1;
118
+ return args.find((arg, i) => !arg.startsWith("-") && i !== consumed);
119
+ }
75
120
  async function main() {
76
121
  const args = process.argv.slice(2);
77
122
  if (args.includes("--help") || args.includes("-h")) {
78
123
  process.stdout.write(HELP);
79
124
  return 0;
80
125
  }
81
- const destination = args.find((arg) => !arg.startsWith("-"));
126
+ const template = parseTemplate(args);
127
+ const destination = parseDestination(args);
82
128
  if (!destination) {
83
129
  process.stderr.write(HELP);
84
130
  return 1;
85
131
  }
86
- const templateRoot = fileURLToPath(new URL("./template", import.meta.url));
132
+ let templateRoot = fileURLToPath(new URL(`./templates/${template}`, import.meta.url));
133
+ if (!existsSync2(templateRoot)) {
134
+ const legacy = fileURLToPath(new URL("./template", import.meta.url));
135
+ if (template !== DEFAULT_TEMPLATE || !existsSync2(legacy)) {
136
+ throw new Error(`template ${template} is missing from this package`);
137
+ }
138
+ templateRoot = legacy;
139
+ }
87
140
  await createApp({
88
141
  destination,
89
142
  install: !args.includes("--no-install"),
@@ -91,10 +144,16 @@ async function main() {
91
144
  });
92
145
  return 0;
93
146
  }
94
- main().then((code) => process.exit(code)).catch((error) => {
95
- const message = error instanceof Error ? error.message : String(error);
96
- process.stderr.write(`
147
+ if (import.meta.main) {
148
+ main().then((code) => process.exit(code)).catch((error) => {
149
+ const message = error instanceof Error ? error.message : String(error);
150
+ process.stderr.write(`
97
151
  error: ${message}
98
152
  `);
99
- process.exit(1);
100
- });
153
+ process.exit(1);
154
+ });
155
+ }
156
+ export {
157
+ parseTemplate,
158
+ parseDestination
159
+ };
@@ -41,6 +41,28 @@ divs** (no div-built tab bars, toggles, sliders, dropdowns, modals):
41
41
  - Motion: use `transitions.tsx` / `.vui-*` classes and the `animated-*`
42
42
  primitives; don't write bespoke keyframe animations for patterns they cover.
43
43
 
44
+ ## Routing: files in `src/routes/`
45
+
46
+ This app uses TanStack Router with file-based routing. A second screen means a
47
+ second file — **not** a `useState` view-switcher inside `App.tsx`.
48
+
49
+ ```tsx
50
+ // src/routes/pricing.tsx → /pricing
51
+ import { createFileRoute } from "@tanstack/react-router"
52
+
53
+ export const Route = createFileRoute("/pricing")({ component: Pricing })
54
+
55
+ function Pricing() { return <main>...</main> }
56
+ ```
57
+
58
+ - `src/App.tsx` is the `/` route's component — keep the home view there.
59
+ - Params: `posts.$postId.tsx` → `/posts/$postId`, read via `Route.useParams()`.
60
+ - Navigate with `<Link to="/pricing">` from `@tanstack/react-router`. A raw
61
+ `<a href>` full-reloads the page and drops app state.
62
+ - `src/routeTree.gen.ts` is generated from `src/routes/` — never edit it.
63
+ - Static routes are prerendered to static HTML at build time, so real URLs are
64
+ cheap SEO. Param routes fall back to the SPA shell.
65
+
44
66
  ## Environment
45
67
 
46
68
  - Project dir `/home/user/project`, package manager **bun**.
@@ -0,0 +1,24 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?