create-omg 0.4.30
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 +14 -0
- package/dist/index.mjs +100 -0
- package/dist/template/AGENTS.md +49 -0
- package/dist/template/README.md +18 -0
- package/dist/template/_gitignore +24 -0
- package/dist/template/bun.lock +898 -0
- package/dist/template/eslint.config.js +23 -0
- package/dist/template/functions/.gitkeep +0 -0
- package/dist/template/index.html +20 -0
- package/dist/template/package.json +48 -0
- package/dist/template/public/favicon.svg +1 -0
- package/dist/template/public/icons/apple-touch-icon.png +0 -0
- package/dist/template/public/icons/pwa-192x192.png +0 -0
- package/dist/template/public/icons/pwa-512x512-maskable.png +0 -0
- package/dist/template/public/icons/pwa-512x512.png +0 -0
- package/dist/template/public/icons.svg +24 -0
- package/dist/template/schema.ts +5 -0
- package/dist/template/server/db.ts +103 -0
- package/dist/template/src/App.tsx +128 -0
- package/dist/template/src/components/ui/animated-number.tsx +102 -0
- package/dist/template/src/components/ui/animated-text.tsx +109 -0
- package/dist/template/src/components/ui/bottom-nav.tsx +131 -0
- package/dist/template/src/components/ui/button.tsx +84 -0
- package/dist/template/src/components/ui/card.tsx +70 -0
- package/dist/template/src/components/ui/otp-input.tsx +179 -0
- package/dist/template/src/components/ui/scroll-affordance.tsx +106 -0
- package/dist/template/src/components/ui/sound.ts +182 -0
- package/dist/template/src/components/ui/transitions.tsx +419 -0
- package/dist/template/src/components/ui/vibes-ui-styles.ts +388 -0
- package/dist/template/src/db.drizzle.ts +5 -0
- package/dist/template/src/index.css +1 -0
- package/dist/template/src/lib/utils.ts +6 -0
- package/dist/template/src/main.tsx +10 -0
- package/dist/template/tsconfig.app.json +30 -0
- package/dist/template/tsconfig.json +10 -0
- package/dist/template/tsconfig.node.json +24 -0
- package/dist/template/vite.config.ts +23 -0
- package/package.json +37 -0
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# create-omg
|
|
2
|
+
|
|
3
|
+
Create a new omg.dev app from the official starter:
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
bun create omg my-app
|
|
7
|
+
cd my-app
|
|
8
|
+
bun run dev
|
|
9
|
+
```
|
|
10
|
+
|
|
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.
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
|
|
4
|
+
// src/index.ts
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
|
|
7
|
+
// src/create.ts
|
|
8
|
+
import {
|
|
9
|
+
cpSync,
|
|
10
|
+
existsSync,
|
|
11
|
+
mkdirSync,
|
|
12
|
+
readFileSync,
|
|
13
|
+
readdirSync,
|
|
14
|
+
renameSync,
|
|
15
|
+
writeFileSync
|
|
16
|
+
} from "fs";
|
|
17
|
+
import { basename, resolve } from "path";
|
|
18
|
+
function packageName(destination) {
|
|
19
|
+
const name = basename(resolve(destination)).toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[._-]+|[._-]+$/g, "");
|
|
20
|
+
return name || "omg-app";
|
|
21
|
+
}
|
|
22
|
+
function assertEmpty(destination) {
|
|
23
|
+
if (!existsSync(destination))
|
|
24
|
+
return;
|
|
25
|
+
if (readdirSync(destination).length > 0) {
|
|
26
|
+
throw new Error(`Destination is not empty: ${destination}`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async function createApp(options) {
|
|
30
|
+
const destination = resolve(options.destination);
|
|
31
|
+
const output = options.output ?? console.log;
|
|
32
|
+
assertEmpty(destination);
|
|
33
|
+
mkdirSync(destination, { recursive: true });
|
|
34
|
+
cpSync(options.templateRoot, destination, { recursive: true });
|
|
35
|
+
const packedGitignore = resolve(destination, "_gitignore");
|
|
36
|
+
if (existsSync(packedGitignore)) {
|
|
37
|
+
renameSync(packedGitignore, resolve(destination, ".gitignore"));
|
|
38
|
+
}
|
|
39
|
+
const manifestPath = resolve(destination, "package.json");
|
|
40
|
+
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|
|
41
|
+
manifest.name = packageName(destination);
|
|
42
|
+
writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + `
|
|
43
|
+
`);
|
|
44
|
+
output(`Created ${destination}`);
|
|
45
|
+
if (options.install !== false) {
|
|
46
|
+
output("Installing dependencies...");
|
|
47
|
+
const child = Bun.spawn(["bun", "install"], {
|
|
48
|
+
cwd: destination,
|
|
49
|
+
stdin: "inherit",
|
|
50
|
+
stdout: "inherit",
|
|
51
|
+
stderr: "inherit"
|
|
52
|
+
});
|
|
53
|
+
const code = await child.exited;
|
|
54
|
+
if (code !== 0)
|
|
55
|
+
throw new Error(`bun install exited with code ${code}`);
|
|
56
|
+
}
|
|
57
|
+
output("");
|
|
58
|
+
output(`Next: cd ${options.destination}`);
|
|
59
|
+
if (options.install === false)
|
|
60
|
+
output(" bun install");
|
|
61
|
+
output(" bun run dev");
|
|
62
|
+
output(" omg deploy");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// src/index.ts
|
|
66
|
+
var HELP = `Create a new omg.dev app
|
|
67
|
+
|
|
68
|
+
bun create omg <name>
|
|
69
|
+
npx create-omg <name>
|
|
70
|
+
|
|
71
|
+
Options:
|
|
72
|
+
--no-install create files without installing dependencies
|
|
73
|
+
--help show this help
|
|
74
|
+
`;
|
|
75
|
+
async function main() {
|
|
76
|
+
const args = process.argv.slice(2);
|
|
77
|
+
if (args.includes("--help") || args.includes("-h")) {
|
|
78
|
+
process.stdout.write(HELP);
|
|
79
|
+
return 0;
|
|
80
|
+
}
|
|
81
|
+
const destination = args.find((arg) => !arg.startsWith("-"));
|
|
82
|
+
if (!destination) {
|
|
83
|
+
process.stderr.write(HELP);
|
|
84
|
+
return 1;
|
|
85
|
+
}
|
|
86
|
+
const templateRoot = fileURLToPath(new URL("./template", import.meta.url));
|
|
87
|
+
await createApp({
|
|
88
|
+
destination,
|
|
89
|
+
install: !args.includes("--no-install"),
|
|
90
|
+
templateRoot
|
|
91
|
+
});
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
main().then((code) => process.exit(code)).catch((error) => {
|
|
95
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
96
|
+
process.stderr.write(`
|
|
97
|
+
error: ${message}
|
|
98
|
+
`);
|
|
99
|
+
process.exit(1);
|
|
100
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Design system — non-negotiable
|
|
2
|
+
|
|
3
|
+
This app ships a locked design system (shadcn/ui, Tailwind v4, preset theme).
|
|
4
|
+
Follow these rules on every UI change.
|
|
5
|
+
|
|
6
|
+
## Colors: semantic tokens only
|
|
7
|
+
|
|
8
|
+
Tailwind's default palette is **removed** (see the lock block in
|
|
9
|
+
`src/index.css`). `bg-indigo-600`, `text-zinc-400`, `border-slate-700`, etc.
|
|
10
|
+
compile to **nothing** — if a color class has no visible effect, this is why.
|
|
11
|
+
|
|
12
|
+
- Use: `bg-background`, `bg-card`, `bg-primary`, `bg-secondary`, `bg-muted`,
|
|
13
|
+
`bg-accent`, `bg-destructive`, `text-foreground`, `text-muted-foreground`,
|
|
14
|
+
`border-border`, `ring-ring` (+ their `-foreground` pairs, opacity works:
|
|
15
|
+
`bg-primary/15`).
|
|
16
|
+
- Never hand-edit the token values in `src/index.css`. To change the look,
|
|
17
|
+
switch the whole preset:
|
|
18
|
+
`bunx --bun shadcn@latest init --preset <code> --force`
|
|
19
|
+
(named presets: `nova` `vega` `maia` `lyra` `mira` `luma` `sera`), then
|
|
20
|
+
verify `vite.config.ts` kept `host`/`allowedHosts`/`cors`/`hmr` and the
|
|
21
|
+
`@` alias.
|
|
22
|
+
- Don't force the `.dark` class or invent a dark theme unless the user asks;
|
|
23
|
+
presets already handle light/dark.
|
|
24
|
+
|
|
25
|
+
## Components: use `src/components/ui/` before writing anything
|
|
26
|
+
|
|
27
|
+
The full inventory is pre-installed — **never hand-roll one of these with
|
|
28
|
+
divs** (no div-built tab bars, toggles, sliders, dropdowns, modals):
|
|
29
|
+
|
|
30
|
+
`tabs` `dialog` `sheet` `popover` `tooltip` `dropdown-menu` `select` `input`
|
|
31
|
+
`textarea` `label` `checkbox` `radio-group` `switch` `slider` `toggle-group`
|
|
32
|
+
`badge` `separator` `skeleton` `progress` `avatar` `scroll-area` `accordion`
|
|
33
|
+
— plus the vendored delight primitives: `button`, `card`, `bottom-nav`,
|
|
34
|
+
`otp-input`, `animated-number`, `animated-text`, `scroll-affordance`,
|
|
35
|
+
`transitions` (`.vui-t-*` motion), `sound`.
|
|
36
|
+
|
|
37
|
+
- Import via the alias: `import { Tabs, TabsList } from "@/components/ui/tabs"`.
|
|
38
|
+
- Missing a component? `yes n | bunx --bun shadcn@latest add <name>`
|
|
39
|
+
(answer No to overwrite prompts — the vendored primitives must survive).
|
|
40
|
+
- Never hand-edit files in `src/components/ui/`.
|
|
41
|
+
- Motion: use `transitions.tsx` / `.vui-*` classes and the `animated-*`
|
|
42
|
+
primitives; don't write bespoke keyframe animations for patterns they cover.
|
|
43
|
+
|
|
44
|
+
## Environment
|
|
45
|
+
|
|
46
|
+
- Project dir `/home/user/project`, package manager **bun**.
|
|
47
|
+
- Dev server is already running on 5173 with HMR — never start another.
|
|
48
|
+
- Read `.agents/skills/vibes-create-app` at the start of a new build and the
|
|
49
|
+
`shadcn` skill before composing components.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# omg.dev app
|
|
2
|
+
|
|
3
|
+
<!-- rebake trigger 2026-05-26: flush stale __diag__ from snapshot's agent-server bundle -->
|
|
4
|
+
|
|
5
|
+
This is a regular React + TypeScript app with the public `@omg-dev/*` runtime.
|
|
6
|
+
Install dependencies with `bun install`, develop with `bun run dev`, and create
|
|
7
|
+
a production bundle with `bun run build`. Package installation uses npm and
|
|
8
|
+
does not require an omg.dev registry or token.
|
|
9
|
+
|
|
10
|
+
## Data helpers
|
|
11
|
+
|
|
12
|
+
Declare collections in the root `schema.ts`. The omg plugin generates
|
|
13
|
+
`src/db.drizzle.ts` from that one schema, and `server/db.ts` exposes a lazy
|
|
14
|
+
`getBetterReadDb()` helper for server-side functions that need Better Drizzle
|
|
15
|
+
query APIs. Keep writes on `@omg-dev/server` `db` or auto-CRUD so auth scoping,
|
|
16
|
+
timestamps, and realtime updates stay consistent.
|
|
17
|
+
|
|
18
|
+
The React integration uses `@vitejs/plugin-react` with Oxc.
|
|
@@ -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?
|