create-nifra 2.2.0 → 2.4.0
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 +4 -4
- package/dist/agent-files.d.ts +14 -14
- package/dist/agent-files.js +29 -29
- package/dist/agents.d.ts +4 -4
- package/dist/agents.js +63 -63
- package/dist/auth.d.ts +2 -2
- package/dist/auth.js +8 -8
- package/dist/cli.d.ts +6 -6
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +56 -35
- package/dist/cli.js.map +1 -1
- package/dist/db.d.ts +6 -6
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +138 -41
- package/dist/db.js.map +1 -1
- package/dist/scaffold/features.d.ts +41 -0
- package/dist/scaffold/features.d.ts.map +1 -0
- package/dist/scaffold/features.js +48 -0
- package/dist/scaffold/features.js.map +1 -0
- package/dist/scaffold/frameworks.d.ts +73 -0
- package/dist/scaffold/frameworks.d.ts.map +1 -0
- package/dist/scaffold/frameworks.js +100 -0
- package/dist/scaffold/frameworks.js.map +1 -0
- package/dist/scaffold/site-build.d.ts +60 -0
- package/dist/scaffold/site-build.d.ts.map +1 -0
- package/dist/scaffold/site-build.js +198 -0
- package/dist/scaffold/site-build.js.map +1 -0
- package/dist/scaffold/site-files.d.ts +16 -0
- package/dist/scaffold/site-files.d.ts.map +1 -0
- package/dist/scaffold/site-files.js +112 -0
- package/dist/scaffold/site-files.js.map +1 -0
- package/dist/scaffold/site.d.ts +33 -0
- package/dist/scaffold/site.d.ts.map +1 -0
- package/dist/scaffold/site.js +99 -0
- package/dist/scaffold/site.js.map +1 -0
- package/package.json +4 -3
- package/src/agent-files.ts +29 -29
- package/template/README.md +3 -3
- package/template/nifra.assurance.ts +80 -0
- package/template/package.json +5 -3
- package/template/src/app.ts +10 -11
- package/template/src/routes.ts +13 -0
- package/template-isr/README.md +1 -1
- package/template-isr/backend.ts +11 -15
- package/template-isr/nifra.assurance.ts +81 -0
- package/template-isr/package.json +8 -7
- package/template-isr/page.ts +12 -0
- package/template-isr/routes/_404.tsx +1 -1
- package/template-isr/routes/_layout.tsx +1 -1
- package/template-isr/routes/index.tsx +2 -2
- package/template-isr/server.ts +1 -1
- package/template-isr/worker.ts +2 -2
- package/template-isr/wrangler.toml +2 -2
- package/template-site/Dockerfile +1 -1
- package/template-site/README.md +6 -6
- package/template-site/backend.ts +11 -13
- package/template-site/counter.ts +16 -0
- package/template-site/nifra.assurance.ts +83 -0
- package/template-site/nifra.config.ts +1 -1
- package/template-site/routes/index.tsx +1 -1
- package/template-site/server-node.ts +1 -1
- package/template-site/server-vercel.ts +1 -1
- package/template-site-preact/README.md +7 -7
- package/template-site-preact/nifra.config.ts +1 -1
- package/template-site-preact/routes/index.tsx +1 -1
- package/template-site-solid/README.md +7 -7
- package/template-site-solid/nifra.config.ts +2 -2
- package/template-site-solid/routes/index.tsx +1 -1
- package/template-site-svelte/README.md +7 -7
- package/template-site-svelte/nifra.config.ts +2 -2
- package/template-site-svelte/routes/_layout.svelte +1 -1
- package/template-site-svelte/routes/index.svelte +1 -1
- package/template-site-vue/README.md +7 -7
- package/template-site-vue/nifra.config.ts +2 -2
- package/template-site-vue/routes/_layout.vue +2 -2
- package/template-site-vue/routes/index.vue +3 -3
- package/template-site/build-bun.ts +0 -27
- package/template-site/build-deno.ts +0 -25
- package/template-site/build-node.ts +0 -26
- package/template-site/build-vercel.ts +0 -45
- package/template-site/build.ts +0 -29
- package/template-site/framework.ts +0 -6
- package/template-site/package.json +0 -38
- package/template-site/tsconfig.json +0 -37
- package/template-site-preact/.dockerignore +0 -14
- package/template-site-preact/Dockerfile +0 -20
- package/template-site-preact/_worker.ts +0 -17
- package/template-site-preact/backend.ts +0 -15
- package/template-site-preact/build-bun.ts +0 -27
- package/template-site-preact/build-deno.ts +0 -25
- package/template-site-preact/build-node.ts +0 -26
- package/template-site-preact/build-vercel.ts +0 -45
- package/template-site-preact/build.ts +0 -29
- package/template-site-preact/deno.json +0 -7
- package/template-site-preact/framework.ts +0 -6
- package/template-site-preact/gitignore +0 -16
- package/template-site-preact/package.json +0 -35
- package/template-site-preact/server-bun.ts +0 -35
- package/template-site-preact/server-deno.ts +0 -38
- package/template-site-preact/server-node.ts +0 -40
- package/template-site-preact/server-vercel.ts +0 -17
- package/template-site-preact/tsconfig.json +0 -38
- package/template-site-preact/wrangler.toml +0 -4
- package/template-site-solid/.dockerignore +0 -14
- package/template-site-solid/Dockerfile +0 -20
- package/template-site-solid/_worker.ts +0 -17
- package/template-site-solid/backend.ts +0 -15
- package/template-site-solid/build-bun.ts +0 -33
- package/template-site-solid/build-deno.ts +0 -32
- package/template-site-solid/build-node.ts +0 -33
- package/template-site-solid/build-vercel.ts +0 -47
- package/template-site-solid/build.ts +0 -36
- package/template-site-solid/deno.json +0 -7
- package/template-site-solid/framework.ts +0 -6
- package/template-site-solid/gitignore +0 -16
- package/template-site-solid/package.json +0 -35
- package/template-site-solid/server-bun.ts +0 -35
- package/template-site-solid/server-deno.ts +0 -38
- package/template-site-solid/server-node.ts +0 -40
- package/template-site-solid/server-vercel.ts +0 -17
- package/template-site-solid/tsconfig.json +0 -38
- package/template-site-solid/wrangler.toml +0 -4
- package/template-site-svelte/.dockerignore +0 -14
- package/template-site-svelte/Dockerfile +0 -20
- package/template-site-svelte/_worker.ts +0 -17
- package/template-site-svelte/backend.ts +0 -15
- package/template-site-svelte/build-bun.ts +0 -32
- package/template-site-svelte/build-deno.ts +0 -31
- package/template-site-svelte/build-node.ts +0 -32
- package/template-site-svelte/build-vercel.ts +0 -46
- package/template-site-svelte/build.ts +0 -35
- package/template-site-svelte/deno.json +0 -7
- package/template-site-svelte/framework.ts +0 -6
- package/template-site-svelte/gitignore +0 -16
- package/template-site-svelte/package.json +0 -35
- package/template-site-svelte/server-bun.ts +0 -35
- package/template-site-svelte/server-deno.ts +0 -38
- package/template-site-svelte/server-node.ts +0 -40
- package/template-site-svelte/server-vercel.ts +0 -17
- package/template-site-svelte/tsconfig.json +0 -37
- package/template-site-svelte/wrangler.toml +0 -4
- package/template-site-vue/.dockerignore +0 -14
- package/template-site-vue/Dockerfile +0 -20
- package/template-site-vue/_worker.ts +0 -17
- package/template-site-vue/backend.ts +0 -15
- package/template-site-vue/build-bun.ts +0 -37
- package/template-site-vue/build-deno.ts +0 -36
- package/template-site-vue/build-node.ts +0 -37
- package/template-site-vue/build-vercel.ts +0 -54
- package/template-site-vue/build.ts +0 -40
- package/template-site-vue/deno.json +0 -7
- package/template-site-vue/framework.ts +0 -6
- package/template-site-vue/gitignore +0 -16
- package/template-site-vue/package.json +0 -36
- package/template-site-vue/server-bun.ts +0 -35
- package/template-site-vue/server-deno.ts +0 -38
- package/template-site-vue/server-node.ts +0 -40
- package/template-site-vue/server-vercel.ts +0 -17
- package/template-site-vue/tsconfig.json +0 -37
- package/template-site-vue/wrangler.toml +0 -4
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
node_modules
|
|
2
|
-
dist
|
|
3
|
-
dist-bun
|
|
4
|
-
dist-node
|
|
5
|
-
dist-deno
|
|
6
|
-
.vercel
|
|
7
|
-
.build
|
|
8
|
-
.build-bun
|
|
9
|
-
.build-node
|
|
10
|
-
.build-deno
|
|
11
|
-
.build-vercel
|
|
12
|
-
.wrangler
|
|
13
|
-
# generated by buildServer next to the entry
|
|
14
|
-
server-manifest.ts
|
|
15
|
-
# generated by `nifra dev` (the Vite dev client entry) at the project root
|
|
16
|
-
.nifra-vite-entry.tsx
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "nifra-site",
|
|
3
|
-
"version": "0.0.0",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"private": true,
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "nifra dev",
|
|
8
|
-
"preview": "bunx wrangler pages dev dist",
|
|
9
|
-
"build": "bun run build.ts",
|
|
10
|
-
"build:bun": "bun run build-bun.ts",
|
|
11
|
-
"build:node": "bun run build-node.ts",
|
|
12
|
-
"build:deno": "bun run build-deno.ts",
|
|
13
|
-
"build:vercel": "bun run build-vercel.ts",
|
|
14
|
-
"start": "bun dist-bun/server-bun.js",
|
|
15
|
-
"start:node": "node dist-node/server-node.js",
|
|
16
|
-
"deploy:cf": "wrangler pages deploy dist",
|
|
17
|
-
"deploy:vercel": "vercel deploy --prebuilt"
|
|
18
|
-
},
|
|
19
|
-
"dependencies": {
|
|
20
|
-
"@nifrajs/client": "^2.2.0",
|
|
21
|
-
"@nifrajs/core": "^2.2.0",
|
|
22
|
-
"@nifrajs/schema": "^2.2.0",
|
|
23
|
-
"@nifrajs/deno": "^2.2.0",
|
|
24
|
-
"@nifrajs/node": "^2.2.0",
|
|
25
|
-
"@nifrajs/web": "^2.2.0",
|
|
26
|
-
"@nifrajs/web-vue": "^2.2.0",
|
|
27
|
-
"vue": "^3.5.0"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@nifrajs/cli": "^2.2.0",
|
|
31
|
-
"@vitejs/plugin-vue": "^5.2.0",
|
|
32
|
-
"@vue/compiler-sfc": "^3.5.0",
|
|
33
|
-
"typescript": "^6.0.3",
|
|
34
|
-
"vite": "^8.0.0"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { inProcessClient } from "@nifrajs/client"
|
|
2
|
-
import { createWebApp } from "@nifrajs/web"
|
|
3
|
-
import { backend } from "./backend"
|
|
4
|
-
import { adapter } from "./framework"
|
|
5
|
-
import { clientEntry, manifest } from "./server-manifest"
|
|
6
|
-
|
|
7
|
-
const app = createWebApp({
|
|
8
|
-
adapter,
|
|
9
|
-
manifest,
|
|
10
|
-
clientEntry,
|
|
11
|
-
api: inProcessClient(backend),
|
|
12
|
-
title: "nifra site",
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
// Bun (nifra's flagship runtime): Bun.serve handles app.fetch; serve the client bundle (/assets/*)
|
|
16
|
-
// from disk with Bun.file. Assets live next to this file in the built dist-bun/ output.
|
|
17
|
-
const ASSETS = new URL("./assets/", import.meta.url)
|
|
18
|
-
const TYPES: Readonly<Record<string, string>> = { js: "text/javascript", css: "text/css" }
|
|
19
|
-
|
|
20
|
-
const server = Bun.serve({
|
|
21
|
-
port: Number(Bun.env.PORT ?? 3000),
|
|
22
|
-
async fetch(req) {
|
|
23
|
-
const { pathname } = new URL(req.url)
|
|
24
|
-
if (pathname.startsWith("/assets/")) {
|
|
25
|
-
const name = pathname.slice("/assets/".length)
|
|
26
|
-
if (!/^[A-Za-z0-9._-]+$/.test(name)) return new Response("bad request", { status: 400 })
|
|
27
|
-
const file = Bun.file(new URL(name, ASSETS))
|
|
28
|
-
if (!(await file.exists())) return new Response("not found", { status: 404 })
|
|
29
|
-
const ext = name.slice(name.lastIndexOf(".") + 1)
|
|
30
|
-
return new Response(file, { headers: { "content-type": TYPES[ext] ?? "application/octet-stream" } })
|
|
31
|
-
}
|
|
32
|
-
return app.fetch(req)
|
|
33
|
-
},
|
|
34
|
-
})
|
|
35
|
-
console.log(`nifra (Bun) → http://localhost:${server.port}`)
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { inProcessClient } from "@nifrajs/client"
|
|
2
|
-
import { serve } from "@nifrajs/deno"
|
|
3
|
-
import { createWebApp } from "@nifrajs/web"
|
|
4
|
-
import { backend } from "./backend"
|
|
5
|
-
import { adapter } from "./framework"
|
|
6
|
-
import { clientEntry, manifest } from "./server-manifest"
|
|
7
|
-
|
|
8
|
-
const app = createWebApp({
|
|
9
|
-
adapter,
|
|
10
|
-
manifest,
|
|
11
|
-
clientEntry,
|
|
12
|
-
api: inProcessClient(backend),
|
|
13
|
-
title: "nifra site",
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
const ASSETS = new URL("./assets/", import.meta.url)
|
|
17
|
-
const TYPES: Readonly<Record<string, string>> = { js: "text/javascript", css: "text/css" }
|
|
18
|
-
|
|
19
|
-
await serve(
|
|
20
|
-
{
|
|
21
|
-
async fetch(req) {
|
|
22
|
-
const { pathname } = new URL(req.url)
|
|
23
|
-
if (pathname.startsWith("/assets/")) {
|
|
24
|
-
const name = pathname.slice("/assets/".length)
|
|
25
|
-
if (!/^[A-Za-z0-9._-]+$/.test(name)) return new Response("bad request", { status: 400 })
|
|
26
|
-
try {
|
|
27
|
-
const body = await Deno.readFile(new URL(name, ASSETS))
|
|
28
|
-
const ext = name.slice(name.lastIndexOf(".") + 1)
|
|
29
|
-
return new Response(body, { headers: { "content-type": TYPES[ext] ?? "application/octet-stream" } })
|
|
30
|
-
} catch {
|
|
31
|
-
return new Response("not found", { status: 404 })
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
return app.fetch(req)
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{ port: Number(Deno.env.get("PORT") ?? "3000") },
|
|
38
|
-
)
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { readFile } from "node:fs/promises"
|
|
2
|
-
import { inProcessClient } from "@nifrajs/client"
|
|
3
|
-
import { serve } from "@nifrajs/node"
|
|
4
|
-
import { createWebApp } from "@nifrajs/web"
|
|
5
|
-
import { backend } from "./backend"
|
|
6
|
-
import { adapter } from "./framework"
|
|
7
|
-
import { clientEntry, manifest } from "./server-manifest"
|
|
8
|
-
|
|
9
|
-
const app = createWebApp({
|
|
10
|
-
adapter,
|
|
11
|
-
manifest,
|
|
12
|
-
clientEntry,
|
|
13
|
-
api: inProcessClient(backend),
|
|
14
|
-
title: "nifra site",
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
// @nifrajs/node serves app.fetch only — so serve /assets/* (the client bundle) from disk here.
|
|
18
|
-
const ASSETS = new URL("./assets/", import.meta.url)
|
|
19
|
-
const TYPES: Readonly<Record<string, string>> = { js: "text/javascript", css: "text/css" }
|
|
20
|
-
|
|
21
|
-
await serve(
|
|
22
|
-
{
|
|
23
|
-
async fetch(req) {
|
|
24
|
-
const { pathname } = new URL(req.url)
|
|
25
|
-
if (pathname.startsWith("/assets/")) {
|
|
26
|
-
const name = pathname.slice("/assets/".length)
|
|
27
|
-
if (!/^[A-Za-z0-9._-]+$/.test(name)) return new Response("bad request", { status: 400 })
|
|
28
|
-
try {
|
|
29
|
-
const body = await readFile(new URL(name, ASSETS))
|
|
30
|
-
const ext = name.slice(name.lastIndexOf(".") + 1)
|
|
31
|
-
return new Response(body, { headers: { "content-type": TYPES[ext] ?? "application/octet-stream" } })
|
|
32
|
-
} catch {
|
|
33
|
-
return new Response("not found", { status: 404 })
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return app.fetch(req)
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
{ port: Number(process.env.PORT ?? 3000) },
|
|
40
|
-
)
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { inProcessClient } from "@nifrajs/client"
|
|
2
|
-
import { createWebApp } from "@nifrajs/web"
|
|
3
|
-
import { backend } from "./backend"
|
|
4
|
-
import { adapter } from "./framework"
|
|
5
|
-
import { clientEntry, manifest } from "./server-manifest"
|
|
6
|
-
|
|
7
|
-
const app = createWebApp({
|
|
8
|
-
adapter,
|
|
9
|
-
manifest,
|
|
10
|
-
clientEntry,
|
|
11
|
-
api: inProcessClient(backend),
|
|
12
|
-
title: "nifra site",
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
// Vercel Edge Function — Vercel serves /assets/* from its CDN, so this only SSRs page routes.
|
|
16
|
-
export const config = { runtime: "edge" }
|
|
17
|
-
export default (req: Request): Response | Promise<Response> => app.fetch(req)
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
-
"jsx": "preserve",
|
|
8
|
-
"strict": true,
|
|
9
|
-
"noUncheckedIndexedAccess": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"noEmit": true,
|
|
12
|
-
"verbatimModuleSyntax": true
|
|
13
|
-
},
|
|
14
|
-
"include": ["**/*.ts", "**/*.tsx"],
|
|
15
|
-
"exclude": [
|
|
16
|
-
"node_modules",
|
|
17
|
-
"dist",
|
|
18
|
-
"dist-bun",
|
|
19
|
-
"dist-node",
|
|
20
|
-
"dist-deno",
|
|
21
|
-
"dist-vercel",
|
|
22
|
-
".nifra",
|
|
23
|
-
".wrangler",
|
|
24
|
-
".vercel",
|
|
25
|
-
"server-manifest.ts",
|
|
26
|
-
"server-bun.ts",
|
|
27
|
-
"server-node.ts",
|
|
28
|
-
"server-deno.ts",
|
|
29
|
-
"server-vercel.ts",
|
|
30
|
-
"_worker.ts",
|
|
31
|
-
"build.ts",
|
|
32
|
-
"build-bun.ts",
|
|
33
|
-
"build-node.ts",
|
|
34
|
-
"build-deno.ts",
|
|
35
|
-
"build-vercel.ts"
|
|
36
|
-
]
|
|
37
|
-
}
|