@fierst/c7t 1.0.0-beta.1 → 1.0.1
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/CHANGELOG.md +12 -3
- package/README.md +2 -2
- package/bin/create.mjs +7 -0
- package/dist/server.mjs +5 -1
- package/dist/vite.mjs +45 -17
- package/docs/reference.md +1 -1
- package/llms.txt +2 -2
- package/package.json +3 -4
- package/template/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,9 +4,18 @@ All notable changes to **`@fierst/c7t` ("Construct")** are documented in this fi
|
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
## [1.0.
|
|
7
|
+
## [1.0.1] - 2026-11-30
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- **Vite+ Dev Server Routing (`npm run dev` / `vp dev`):** Configure `appType: "custom"` automatically when no root `index.html` is present and resolve dev SSR requests from `req.originalUrl` so Vite's SPA fallback middleware never rewrites `/` or nested routes to `/index.html`.
|
|
12
|
+
- **Dev HMR & Live Route Discovery:** Inject `/@vite/client` in `vp dev` HTML heads for live CSS hot-reloading and error overlays, collect SSR environment styles across Vite 8 module graphs, and automatically invalidate `virtual:c7t/routes` when files are added or removed under `src/routes/**`.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## [1.0.0] - 2026-11-30
|
|
17
|
+
|
|
18
|
+
Initial release of **`c7t` ("Construct" — `@fierst/c7t`)** — Fierst LLC's full-stack generator meta-framework built on `@fierst/blokd` (`>=1.3.0`), Hono, and Vite+ (`vp`).
|
|
10
19
|
|
|
11
20
|
### Added
|
|
12
21
|
|
|
@@ -35,4 +44,4 @@ Initial public beta release of **`c7t` ("Construct" — `@fierst/c7t`)** — Fie
|
|
|
35
44
|
- `@fierst/c7t/ssg` (`prerenderApp`) supporting hybrid `export const prerender = true | false | (() => [...])` and full static `mode: "all"`, cascading `prerender` & `csr` inheritance (`c7t()` config -> `layout.tsx` -> leaf route), automatic `csr: "auto"` default (0 `<script>` tags when 0 islands render; automatic lazy revival when 1+ islands render) plus `csr: "islands"` MPA mode, `<a href>` link crawling, broken-link detection, `__c7t.json` static receipt sidecars, static XML/RSS endpoints, and build-time dynamic cookie guardrails.
|
|
36
45
|
- Unified `c7t` CLI (`c7t create`, `c7t build`, `c7t start`) and programmatic `buildApp()` pipeline.
|
|
37
46
|
- Official adapters: `@fierst/c7t/node`, `@fierst/c7t/cloudflare`, `@fierst/c7t/vercel` (Build Output API v3), `@fierst/c7t/bun`, and `@fierst/c7t/static`.
|
|
38
|
-
- Complete documentation suite (`docs/guides/01–
|
|
47
|
+
- Complete documentation suite (`docs/guides/01–07`, `docs/reference.md`, and generated `llms.txt` handbook) plus end-to-end Chromium production smoke test (`npm run test:smoke`).
|
package/README.md
CHANGED
|
@@ -48,11 +48,11 @@ Browse the [documentation index](./docs/README.md), jump straight into a guide,
|
|
|
48
48
|
7. [07. Databases, `defineDb()`, and Drizzle ORM](./docs/guides/07-databases-and-drizzle.md)
|
|
49
49
|
|
|
50
50
|
- [Complete API Reference & Troubleshooting](./docs/reference.md)
|
|
51
|
-
- [Changelog (`v1.0.
|
|
51
|
+
- [Changelog (`v1.0.1`)](./CHANGELOG.md)
|
|
52
52
|
|
|
53
53
|
---
|
|
54
54
|
|
|
55
|
-
## Repository Commands
|
|
55
|
+
## Repository Commands
|
|
56
56
|
|
|
57
57
|
```bash
|
|
58
58
|
npm run check # Oxfmt + Oxlint + TypeScript type-check (0 warnings, 0 errors)
|
package/bin/create.mjs
CHANGED
|
@@ -14,6 +14,7 @@ import { basename, dirname, join, resolve } from "node:path";
|
|
|
14
14
|
import { fileURLToPath } from "node:url";
|
|
15
15
|
|
|
16
16
|
const pkgRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
17
|
+
const selfPkg = JSON.parse(readFileSync(join(pkgRoot, "package.json"), "utf-8"));
|
|
17
18
|
const VALID_DB_PRESETS = new Set(["sqlite", "postgres", "d1"]);
|
|
18
19
|
|
|
19
20
|
function parseFlag(args, prefix) {
|
|
@@ -297,6 +298,12 @@ export function scaffoldProject(targetDir, options = {}) {
|
|
|
297
298
|
.replace(/^-+|-+$/g, "") || "c7t-app";
|
|
298
299
|
const pkg = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
|
|
299
300
|
pkg.name = rawName;
|
|
301
|
+
if (pkg.dependencies?.["@fierst/c7t"]) {
|
|
302
|
+
pkg.dependencies["@fierst/c7t"] = `^${selfPkg.version}`;
|
|
303
|
+
}
|
|
304
|
+
if (pkg.dependencies?.["@fierst/blokd"] && selfPkg.dependencies?.["@fierst/blokd"]) {
|
|
305
|
+
pkg.dependencies["@fierst/blokd"] = selfPkg.dependencies["@fierst/blokd"];
|
|
306
|
+
}
|
|
300
307
|
if (options.db) {
|
|
301
308
|
writeDbFiles(absTarget, rawName, options.db, pkg);
|
|
302
309
|
}
|
package/dist/server.mjs
CHANGED
|
@@ -715,14 +715,18 @@ function createServer(options = {}) {
|
|
|
715
715
|
const notFoundComp = options.notFoundComponent ?? specialRoutes?.notFound;
|
|
716
716
|
const errorComp = options.errorComponent ?? specialRoutes?.error;
|
|
717
717
|
let devStyles = [];
|
|
718
|
+
let devViteClientScript = "";
|
|
718
719
|
if (!isProductionMode()) {
|
|
719
720
|
const devStyleHeader = c.req.header("x-c7t-dev-styles");
|
|
720
721
|
if (devStyleHeader) try {
|
|
721
722
|
const parsedStyles = JSON.parse(devStyleHeader);
|
|
722
723
|
if (Array.isArray(parsedStyles)) devStyles = parsedStyles;
|
|
723
724
|
} catch {}
|
|
725
|
+
const devViteClientHref = c.req.header("x-c7t-dev-vite-client");
|
|
726
|
+
if (devViteClientHref) devViteClientScript = `<script type="module" src="${escapeTitleHtml(devViteClientHref)}"><\/script>`;
|
|
724
727
|
}
|
|
725
|
-
const
|
|
728
|
+
const styleLinks = renderStylesheetLinks([...options.styles ?? defaultProdStyles, ...devStyles]);
|
|
729
|
+
const baseHead = devViteClientScript + styleLinks + (options.document?.head ?? "");
|
|
726
730
|
const renderCustom404 = async () => {
|
|
727
731
|
const parsed = new URL(c.req.url, "http://c7t.local");
|
|
728
732
|
const leaf = _comp(notFoundComp, { pathname: parsed.pathname });
|
package/dist/vite.mjs
CHANGED
|
@@ -614,17 +614,19 @@ function shouldBypassDevSsr(urlPath) {
|
|
|
614
614
|
}
|
|
615
615
|
function collectDevStylesFromGraph(viteServer) {
|
|
616
616
|
const styles = [];
|
|
617
|
-
const
|
|
618
|
-
if (!idMap) return styles;
|
|
617
|
+
const maps = [viteServer?.moduleGraph?.idToModuleMap, viteServer?.environments?.ssr?.moduleGraph?.idToModuleMap];
|
|
619
618
|
const seen = /* @__PURE__ */ new Set();
|
|
620
|
-
for (const
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
619
|
+
for (const idMap of maps) {
|
|
620
|
+
if (!idMap) continue;
|
|
621
|
+
for (const mod of idMap.values()) {
|
|
622
|
+
const url = mod?.url;
|
|
623
|
+
if (!url || typeof url !== "string") continue;
|
|
624
|
+
if (!url.split("?")[0].endsWith(".css")) continue;
|
|
625
|
+
const directHref = url.includes("?") ? `${url}&direct` : `${url}?direct`;
|
|
626
|
+
if (seen.has(directHref)) continue;
|
|
627
|
+
seen.add(directHref);
|
|
628
|
+
styles.push(directHref);
|
|
629
|
+
}
|
|
628
630
|
}
|
|
629
631
|
return styles;
|
|
630
632
|
}
|
|
@@ -705,12 +707,18 @@ function c7t(options = {}) {
|
|
|
705
707
|
enforce: "pre",
|
|
706
708
|
__c7tOptions: options,
|
|
707
709
|
config(userConfig, env) {
|
|
710
|
+
const cfgRoot = userConfig.root ?? process.cwd();
|
|
711
|
+
const hasIndexHtml = existsSync(join(cfgRoot, "index.html"));
|
|
712
|
+
const mode = userConfig.mode ?? env.mode;
|
|
708
713
|
const patch = { resolve: { dedupe: ["@fierst/blokd", "@fierst/c7t"] } };
|
|
714
|
+
if (mode !== "test" && !hasIndexHtml && !userConfig.appType) patch.appType = "custom";
|
|
715
|
+
if (env.command === "serve" && mode !== "test") {
|
|
716
|
+
const prebundle = ["@fierst/blokd", "@fierst/blokd/revive"];
|
|
717
|
+
if (existsSync(join(cfgRoot, "node_modules", "@fierst", "c7t", "package.json"))) prebundle.push("@fierst/c7t", "@fierst/c7t/client", "@fierst/c7t/router");
|
|
718
|
+
patch.optimizeDeps = { include: prebundle };
|
|
719
|
+
}
|
|
709
720
|
if (env.command === "build" && !env.isSsrBuild && !userConfig.build?.ssr) {
|
|
710
|
-
|
|
711
|
-
const hasInput = Boolean(userConfig.build?.rollupOptions?.input);
|
|
712
|
-
const hasIndexHtml = existsSync(join(cfgRoot, "index.html"));
|
|
713
|
-
if (!hasInput && !hasIndexHtml) patch.build = { rollupOptions: { input: virtualClientEntryId } };
|
|
721
|
+
if (!Boolean(userConfig.build?.rollupOptions?.input) && !hasIndexHtml) patch.build = { rollupOptions: { input: virtualClientEntryId } };
|
|
714
722
|
}
|
|
715
723
|
return patch;
|
|
716
724
|
},
|
|
@@ -811,16 +819,34 @@ function c7t(options = {}) {
|
|
|
811
819
|
},
|
|
812
820
|
configureServer(viteServer) {
|
|
813
821
|
if (!options.serverEntry && viteServer.config?.mode === "test") return;
|
|
822
|
+
const absRoutesPrefix = join(rootDir || process.cwd(), routesDirRel).replace(/\\/g, "/");
|
|
823
|
+
const invalidateVirtualRoutes = (filePath) => {
|
|
824
|
+
if (!filePath.replace(/\\/g, "/").startsWith(absRoutesPrefix)) return;
|
|
825
|
+
for (const graph of [
|
|
826
|
+
viteServer.moduleGraph,
|
|
827
|
+
viteServer.environments?.ssr?.moduleGraph,
|
|
828
|
+
viteServer.environments?.client?.moduleGraph
|
|
829
|
+
]) {
|
|
830
|
+
if (!graph || typeof graph.getModuleById !== "function") continue;
|
|
831
|
+
for (const vid of [resolvedVirtualRoutesId, resolvedVirtualDefaultServerId]) {
|
|
832
|
+
const mod = graph.getModuleById(vid);
|
|
833
|
+
if (mod) graph.invalidateModule(mod);
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
viteServer.ws?.send?.({ type: "full-reload" });
|
|
837
|
+
};
|
|
838
|
+
viteServer.watcher?.on?.("add", invalidateVirtualRoutes);
|
|
839
|
+
viteServer.watcher?.on?.("unlink", invalidateVirtualRoutes);
|
|
814
840
|
return () => {
|
|
815
841
|
viteServer.middlewares.use(async (nodeReq, nodeRes, next) => {
|
|
816
|
-
const
|
|
817
|
-
if (!
|
|
842
|
+
const reqUrl = nodeReq.originalUrl || nodeReq.url || "/";
|
|
843
|
+
if (!reqUrl.startsWith("/_c7t/") && shouldBypassDevSsr(reqUrl)) return next();
|
|
818
844
|
const targetEntry = resolveServerEntryPath();
|
|
819
845
|
if (!targetEntry) return next();
|
|
820
846
|
try {
|
|
821
847
|
const app = (await viteServer.ssrLoadModule(targetEntry)).default;
|
|
822
848
|
if (!app || typeof app.fetch !== "function") return next();
|
|
823
|
-
const url = `${nodeReq.socket?.encrypted ? "https" : "http"}://${nodeReq.headers.host || "localhost"}${
|
|
849
|
+
const url = `${nodeReq.socket?.encrypted ? "https" : "http"}://${nodeReq.headers.host || "localhost"}${reqUrl}`;
|
|
824
850
|
const method = nodeReq.method || "GET";
|
|
825
851
|
const hasBody = method !== "GET" && method !== "HEAD";
|
|
826
852
|
const abortController = new AbortController();
|
|
@@ -830,6 +856,8 @@ function c7t(options = {}) {
|
|
|
830
856
|
const reqHeaders = new Headers(nodeReq.headers);
|
|
831
857
|
const devStyles = collectDevStylesFromGraph(viteServer);
|
|
832
858
|
if (devStyles.length > 0) reqHeaders.set("x-c7t-dev-styles", JSON.stringify(devStyles));
|
|
859
|
+
const cleanBase = base.endsWith("/") ? base : base + "/";
|
|
860
|
+
reqHeaders.set("x-c7t-dev-vite-client", `${cleanBase}@vite/client`);
|
|
833
861
|
const webReq = new Request(url, {
|
|
834
862
|
method,
|
|
835
863
|
headers: reqHeaders,
|
package/docs/reference.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `@fierst/c7t` API Reference
|
|
2
2
|
|
|
3
|
-
`@fierst/c7t` is an ESM-first TypeScript package requiring **Node.js >= 20.19.0** (or Bun / Cloudflare `workerd` with `nodejs_als`) and `@fierst/blokd >= 1.3.0
|
|
3
|
+
`@fierst/c7t` is an ESM-first TypeScript package requiring **Node.js >= 20.19.0** (or Bun / Cloudflare `workerd` with `nodejs_als`) and `@fierst/blokd >= 1.3.0`.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
package/llms.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# c7t (Construct — @fierst/c7t) 1.0.
|
|
1
|
+
# c7t (Construct — @fierst/c7t) 1.0.1
|
|
2
2
|
|
|
3
3
|
---
|
|
4
4
|
|
|
@@ -1515,7 +1515,7 @@ Need the raw unwrapped instance for `instanceof` checks or driver plugins? Acces
|
|
|
1515
1515
|
|
|
1516
1516
|
# `@fierst/c7t` API Reference
|
|
1517
1517
|
|
|
1518
|
-
`@fierst/c7t` is an ESM-first TypeScript package requiring **Node.js >= 20.19.0** (or Bun / Cloudflare `workerd` with `nodejs_als`) and `@fierst/blokd >= 1.3.0
|
|
1518
|
+
`@fierst/c7t` is an ESM-first TypeScript package requiring **Node.js >= 20.19.0** (or Bun / Cloudflare `workerd` with `nodejs_als`) and `@fierst/blokd >= 1.3.0`.
|
|
1519
1519
|
|
|
1520
1520
|
---
|
|
1521
1521
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fierst/c7t",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "c7t (Construct) — Full-stack generator meta-framework built on @fierst/blokd, Hono, and Vite+ with deterministic State Receipts, dual-protocol server() callables, hybrid SSG, and bidirectional NDJSON streaming.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"blokd",
|
|
@@ -92,8 +92,7 @@
|
|
|
92
92
|
"./create": "./bin/create.mjs"
|
|
93
93
|
},
|
|
94
94
|
"publishConfig": {
|
|
95
|
-
"access": "public"
|
|
96
|
-
"tag": "beta"
|
|
95
|
+
"access": "public"
|
|
97
96
|
},
|
|
98
97
|
"scripts": {
|
|
99
98
|
"pack": "vp pack",
|
|
@@ -106,7 +105,7 @@
|
|
|
106
105
|
"fmt": "vp fmt"
|
|
107
106
|
},
|
|
108
107
|
"dependencies": {
|
|
109
|
-
"@fierst/blokd": "^1.3.0
|
|
108
|
+
"@fierst/blokd": "^1.3.0",
|
|
110
109
|
"hono": "^4.7.0",
|
|
111
110
|
"oxc-parser": "0.159.0"
|
|
112
111
|
},
|
package/template/package.json
CHANGED