create-rindle 0.1.6
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/LICENSE +201 -0
- package/README.md +70 -0
- package/index.mjs +124 -0
- package/lib/scaffold.mjs +169 -0
- package/package.json +38 -0
- package/templates/minimal/README.md +72 -0
- package/templates/minimal/_gitignore +7 -0
- package/templates/minimal/migrations/0001_init.sql +21 -0
- package/templates/minimal/package.json +44 -0
- package/templates/minimal/server/app-api.ts +115 -0
- package/templates/minimal/server/auth-dev.ts +22 -0
- package/templates/minimal/server/dev.ts +148 -0
- package/templates/minimal/server/migrate.ts +47 -0
- package/templates/minimal/server/rindle-http.ts +38 -0
- package/templates/minimal/server/seed.ts +70 -0
- package/templates/minimal/shared/app-def.ts +100 -0
- package/templates/minimal/shared/auth.ts +18 -0
- package/templates/minimal/shared/schema.gen.ts +29 -0
- package/templates/minimal/src/RindleApp.tsx +47 -0
- package/templates/minimal/src/components/Composer.tsx +38 -0
- package/templates/minimal/src/components/MessageCard.queries.ts +13 -0
- package/templates/minimal/src/components/MessageCard.tsx +20 -0
- package/templates/minimal/src/components/NewRoomForm.tsx +30 -0
- package/templates/minimal/src/components/RoomCard.queries.ts +20 -0
- package/templates/minimal/src/components/RoomCard.tsx +23 -0
- package/templates/minimal/src/components/RoomView.queries.ts +26 -0
- package/templates/minimal/src/components/Toaster.tsx +31 -0
- package/templates/minimal/src/components/TopBar.tsx +36 -0
- package/templates/minimal/src/devtools.tsx +27 -0
- package/templates/minimal/src/lib/format.ts +8 -0
- package/templates/minimal/src/lib/use-handle.ts +16 -0
- package/templates/minimal/src/rindle-client.ts +94 -0
- package/templates/minimal/src/routeTree.gen.ts +147 -0
- package/templates/minimal/src/router.tsx +20 -0
- package/templates/minimal/src/routes/__root.tsx +64 -0
- package/templates/minimal/src/routes/api.rindle.mutate.tsx +16 -0
- package/templates/minimal/src/routes/api.rindle.query.tsx +16 -0
- package/templates/minimal/src/routes/api.rindle.read.tsx +16 -0
- package/templates/minimal/src/routes/index.tsx +51 -0
- package/templates/minimal/src/routes/r.$id.tsx +60 -0
- package/templates/minimal/src/ssr.ts +51 -0
- package/templates/minimal/src/styles.css +220 -0
- package/templates/minimal/src/tanstack-start.d.ts +6 -0
- package/templates/minimal/tsconfig.json +17 -0
- package/templates/minimal/vite-env.d.ts +15 -0
- package/templates/minimal/vite.config.ts +29 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"strict": true,
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"jsx": "react-jsx",
|
|
11
|
+
"verbatimModuleSyntax": true,
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"erasableSyntaxOnly": true,
|
|
14
|
+
"types": ["node", "vite/client"]
|
|
15
|
+
},
|
|
16
|
+
"include": ["src", "shared", "server", "vite-env.d.ts", "vite.config.ts"]
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
|
|
3
|
+
declare module "rindle-wasm-bin?url" {
|
|
4
|
+
const url: string;
|
|
5
|
+
export default url;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface ImportMetaEnv {
|
|
9
|
+
/** The daemon's PUBLIC subscription ws (server/dev.ts injects it). */
|
|
10
|
+
readonly VITE_DAEMON_WS?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface ImportMeta {
|
|
14
|
+
readonly env: ImportMetaEnv;
|
|
15
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
|
|
4
|
+
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
|
|
5
|
+
import react from "@vitejs/plugin-react";
|
|
6
|
+
import { defineConfig } from "vite";
|
|
7
|
+
|
|
8
|
+
// The in-process wasm IVM engine ships prebuilt inside the @rindle/wasm package (pkg/rindle_bg.wasm).
|
|
9
|
+
// Alias `rindle-wasm-bin?url` to that file so the client can `import url from "rindle-wasm-bin?url"`
|
|
10
|
+
// without relying on a package subpath export. We resolve it off the package's main entry so it works
|
|
11
|
+
// wherever the package manager installed it.
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
const wasmBin = resolve(dirname(require.resolve("@rindle/wasm")), "..", "pkg", "rindle_bg.wasm");
|
|
14
|
+
|
|
15
|
+
export default defineConfig({
|
|
16
|
+
build: { target: "es2022" },
|
|
17
|
+
resolve: {
|
|
18
|
+
alias: [
|
|
19
|
+
// Regex find so the `?url` suffix survives the rewrite in both dev and build.
|
|
20
|
+
{ find: /^rindle-wasm-bin/, replacement: wasmBin },
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
// Keep the @rindle/* graph bundled through the SSR/prerender pass (the wasm engine itself is a
|
|
24
|
+
// client-only dynamic import in src/rindle-client.ts, so it never loads in the shell pass).
|
|
25
|
+
ssr: { noExternal: [/^@rindle\//] },
|
|
26
|
+
// No `server.proxy`: /api/rindle/* is now a Start server route (src/routes/api/rindle/$.ts) served
|
|
27
|
+
// by this same dev server. The daemon ws is still connected to directly (ws://127.0.0.1:7601).
|
|
28
|
+
plugins: [tanstackStart(), react()],
|
|
29
|
+
});
|