nextjs-studio 0.4.0 → 1.0.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 +3 -1
- package/dist/bin/nextjs-studio.js +286 -34
- package/dist/bin/nextjs-studio.js.map +1 -1
- package/dist/cli/ui/.next/BUILD_ID +1 -0
- package/dist/cli/ui/.next/app-path-routes-manifest.json +12 -0
- package/dist/cli/ui/.next/build-manifest.json +20 -0
- package/dist/cli/ui/.next/export-marker.json +6 -0
- package/dist/cli/ui/.next/images-manifest.json +67 -0
- package/dist/cli/ui/.next/next-minimal-server.js.nft.json +1 -0
- package/dist/cli/ui/.next/next-server.js.nft.json +1 -0
- package/dist/cli/ui/.next/package.json +1 -0
- package/dist/cli/ui/.next/prerender-manifest.json +61 -0
- package/dist/cli/ui/.next/react-loadable-manifest.json +286 -0
- package/dist/cli/ui/.next/required-server-files.js +338 -0
- package/dist/cli/ui/.next/required-server-files.json +338 -0
- package/dist/cli/ui/.next/routes-manifest.json +125 -0
- package/dist/cli/ui/.next/server/app/_global-error/page.js +3 -0
- package/dist/cli/ui/.next/server/app/_global-error/page.js.nft.json +1 -0
- package/dist/cli/ui/.next/server/app/_global-error/page_client-reference-manifest.js +1 -0
- package/dist/cli/ui/.next/server/app/_global-error.html +2 -0
- package/dist/cli/ui/.next/server/app/_global-error.meta +16 -0
- package/dist/cli/ui/.next/server/app/_global-error.rsc +12 -0
- package/dist/cli/ui/.next/server/app/_global-error.segments/_full.segment.rsc +12 -0
- package/dist/cli/ui/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +5 -0
- package/dist/cli/ui/.next/server/app/_global-error.segments/_global-error.segment.rsc +4 -0
- package/dist/cli/ui/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
- package/dist/cli/ui/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
- package/dist/cli/ui/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
- package/dist/cli/ui/.next/server/app/_not-found/page.js +2 -0
- package/dist/cli/ui/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/dist/cli/ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/dist/cli/ui/.next/server/app/_not-found.html +1 -0
- package/dist/cli/ui/.next/server/app/_not-found.meta +16 -0
- package/dist/cli/ui/.next/server/app/_not-found.rsc +15 -0
- package/dist/cli/ui/.next/server/app/_not-found.segments/_full.segment.rsc +15 -0
- package/dist/cli/ui/.next/server/app/_not-found.segments/_head.segment.rsc +5 -0
- package/dist/cli/ui/.next/server/app/_not-found.segments/_index.segment.rsc +7 -0
- package/dist/cli/ui/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
- package/dist/cli/ui/.next/server/app/_not-found.segments/_not-found.segment.rsc +4 -0
- package/dist/cli/ui/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
- package/dist/cli/ui/.next/server/app/api/media/[collection]/[filename]/route.js +1 -0
- package/dist/cli/ui/.next/server/app/api/media/[collection]/[filename]/route.js.nft.json +1 -0
- package/dist/cli/ui/.next/server/app/api/media/[collection]/[filename]/route_client-reference-manifest.js +1 -0
- package/dist/cli/ui/.next/server/app/api/media/[collection]/route.js +1 -0
- package/dist/cli/ui/.next/server/app/api/media/[collection]/route.js.nft.json +1 -0
- package/dist/cli/ui/.next/server/app/api/media/[collection]/route_client-reference-manifest.js +1 -0
- package/dist/cli/ui/.next/server/app/api/public/[...path]/route.js +1 -0
- package/dist/cli/ui/.next/server/app/api/public/[...path]/route.js.nft.json +1 -0
- package/dist/cli/ui/.next/server/app/api/public/[...path]/route_client-reference-manifest.js +1 -0
- package/dist/cli/ui/.next/server/app/api/sync/[collection]/route.js +1 -0
- package/dist/cli/ui/.next/server/app/api/sync/[collection]/route.js.nft.json +1 -0
- package/dist/cli/ui/.next/server/app/api/sync/[collection]/route_client-reference-manifest.js +1 -0
- package/dist/cli/ui/.next/server/app/api/watch/route.js +3 -0
- package/dist/cli/ui/.next/server/app/api/watch/route.js.nft.json +1 -0
- package/dist/cli/ui/.next/server/app/api/watch/route_client-reference-manifest.js +1 -0
- package/dist/cli/ui/.next/server/app/collection/[name]/[slug]/page.js +99 -0
- package/dist/cli/ui/.next/server/app/collection/[name]/[slug]/page.js.nft.json +1 -0
- package/dist/cli/ui/.next/server/app/collection/[name]/[slug]/page_client-reference-manifest.js +1 -0
- package/dist/cli/ui/.next/server/app/collection/[name]/page.js +5 -0
- package/dist/cli/ui/.next/server/app/collection/[name]/page.js.nft.json +1 -0
- package/dist/cli/ui/.next/server/app/collection/[name]/page_client-reference-manifest.js +1 -0
- package/dist/cli/ui/.next/server/app/page.js +2 -0
- package/dist/cli/ui/.next/server/app/page.js.nft.json +1 -0
- package/dist/cli/ui/.next/server/app/page_client-reference-manifest.js +1 -0
- package/dist/cli/ui/.next/server/app-paths-manifest.json +12 -0
- package/dist/cli/ui/.next/server/chunks/1875.js +1 -0
- package/dist/cli/ui/.next/server/chunks/2198.js +1 -0
- package/dist/cli/ui/.next/server/chunks/2446.js +36 -0
- package/dist/cli/ui/.next/server/chunks/2474.js +148 -0
- package/dist/cli/ui/.next/server/chunks/2490.js +55 -0
- package/dist/cli/ui/.next/server/chunks/2717.js +56 -0
- package/dist/cli/ui/.next/server/chunks/2729.js +166 -0
- package/dist/cli/ui/.next/server/chunks/2774.js +1 -0
- package/dist/cli/ui/.next/server/chunks/2796.js +1 -0
- package/dist/cli/ui/.next/server/chunks/3145.js +1 -0
- package/dist/cli/ui/.next/server/chunks/3186.js +1 -0
- package/dist/cli/ui/.next/server/chunks/3494.js +24 -0
- package/dist/cli/ui/.next/server/chunks/3610.js +1 -0
- package/dist/cli/ui/.next/server/chunks/3659.js +93 -0
- package/dist/cli/ui/.next/server/chunks/3744.js +1 -0
- package/dist/cli/ui/.next/server/chunks/3806.js +136 -0
- package/dist/cli/ui/.next/server/chunks/408.js +1 -0
- package/dist/cli/ui/.next/server/chunks/4189.js +62 -0
- package/dist/cli/ui/.next/server/chunks/4293.js +1 -0
- package/dist/cli/ui/.next/server/chunks/4469.js +4 -0
- package/dist/cli/ui/.next/server/chunks/4484.js +1 -0
- package/dist/cli/ui/.next/server/chunks/449.js +82 -0
- package/dist/cli/ui/.next/server/chunks/4607.js +22 -0
- package/dist/cli/ui/.next/server/chunks/479.js +5 -0
- package/dist/cli/ui/.next/server/chunks/4931.js +63 -0
- package/dist/cli/ui/.next/server/chunks/528.js +1 -0
- package/dist/cli/ui/.next/server/chunks/5341.js +1 -0
- package/dist/cli/ui/.next/server/chunks/5585.js +29 -0
- package/dist/cli/ui/.next/server/chunks/5677.js +1 -0
- package/dist/cli/ui/.next/server/chunks/5724.js +1 -0
- package/dist/cli/ui/.next/server/chunks/5760.js +174 -0
- package/dist/cli/ui/.next/server/chunks/5784.js +24 -0
- package/dist/cli/ui/.next/server/chunks/6.js +262 -0
- package/dist/cli/ui/.next/server/chunks/6040.js +1 -0
- package/dist/cli/ui/.next/server/chunks/6067.js +13 -0
- package/dist/cli/ui/.next/server/chunks/6553.js +1 -0
- package/dist/cli/ui/.next/server/chunks/6656.js +201 -0
- package/dist/cli/ui/.next/server/chunks/6672.js +1 -0
- package/dist/cli/ui/.next/server/chunks/6872.js +1 -0
- package/dist/cli/ui/.next/server/chunks/7146.js +59 -0
- package/dist/cli/ui/.next/server/chunks/7354.js +1 -0
- package/dist/cli/ui/.next/server/chunks/7677.js +1 -0
- package/dist/cli/ui/.next/server/chunks/7781.js +1 -0
- package/dist/cli/ui/.next/server/chunks/8194.js +215 -0
- package/dist/cli/ui/.next/server/chunks/8231.js +1 -0
- package/dist/cli/ui/.next/server/chunks/8319.js +2 -0
- package/dist/cli/ui/.next/server/chunks/8339.js +1 -0
- package/dist/cli/ui/.next/server/chunks/8775.js +1 -0
- package/dist/cli/ui/.next/server/chunks/9503.js +43 -0
- package/dist/cli/ui/.next/server/chunks/958.js +131 -0
- package/dist/cli/ui/.next/server/chunks/9739.js +1 -0
- package/dist/cli/ui/.next/server/functions-config-manifest.json +4 -0
- package/dist/cli/ui/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/dist/cli/ui/.next/server/middleware-build-manifest.js +1 -0
- package/dist/cli/ui/.next/server/middleware-manifest.json +6 -0
- package/dist/cli/ui/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/dist/cli/ui/.next/server/next-font-manifest.js +1 -0
- package/dist/cli/ui/.next/server/next-font-manifest.json +1 -0
- package/dist/cli/ui/.next/server/pages/404.html +1 -0
- package/dist/cli/ui/.next/server/pages/500.html +2 -0
- package/dist/cli/ui/.next/server/pages-manifest.json +4 -0
- package/dist/cli/ui/.next/server/server-reference-manifest.js +1 -0
- package/dist/cli/ui/.next/server/server-reference-manifest.json +1 -0
- package/dist/cli/ui/.next/server/webpack-runtime.js +1 -0
- package/dist/cli/ui/.next/static/chunks/0937d497-2b220e2d0368e918.js +1 -0
- package/dist/cli/ui/.next/static/chunks/1013.5541c1c75688ef6e.js +1 -0
- package/dist/cli/ui/.next/static/chunks/1039.d26ef6a818f26d70.js +4 -0
- package/dist/cli/ui/.next/static/chunks/1325.cb67348b484ce7a0.js +24 -0
- package/dist/cli/ui/.next/static/chunks/1858-d10f8bead2218ad2.js +2 -0
- package/dist/cli/ui/.next/static/chunks/1882.05c68ab6bdcd8c31.js +1 -0
- package/dist/cli/ui/.next/static/chunks/2011.7e73842f1e8e2cde.js +1 -0
- package/dist/cli/ui/.next/static/chunks/2046.73486ea936c9afd2.js +1 -0
- package/dist/cli/ui/.next/static/chunks/2389.b73d3a1286a228d0.js +1 -0
- package/dist/cli/ui/.next/static/chunks/2430.08df5899978ebf26.js +43 -0
- package/dist/cli/ui/.next/static/chunks/2462-4255d8f51dc56f12.js +1 -0
- package/dist/cli/ui/.next/static/chunks/3098-4269da0468edc350.js +1 -0
- package/dist/cli/ui/.next/static/chunks/317.b4fcc40f219152b1.js +1 -0
- package/dist/cli/ui/.next/static/chunks/3197.d2f3398e552228e4.js +1 -0
- package/dist/cli/ui/.next/static/chunks/3212-1a9c9d110d15abab.js +4 -0
- package/dist/cli/ui/.next/static/chunks/3809.8df186de2ff997f8.js +1 -0
- package/dist/cli/ui/.next/static/chunks/3918.caaf4eb4f6450524.js +1 -0
- package/dist/cli/ui/.next/static/chunks/3987-6d3217e36ae5b4dc.js +1 -0
- package/dist/cli/ui/.next/static/chunks/3c774391-ec08594272867fd5.js +79 -0
- package/dist/cli/ui/.next/static/chunks/4075052f.9006147a6182ed95.js +1 -0
- package/dist/cli/ui/.next/static/chunks/4389.e7a3c58aa62118e3.js +82 -0
- package/dist/cli/ui/.next/static/chunks/46bdbe0e-f5103600b23143b8.js +1 -0
- package/dist/cli/ui/.next/static/chunks/4860.2ba51d1d81857c81.js +1 -0
- package/dist/cli/ui/.next/static/chunks/4882.794e2a9231f129e5.js +55 -0
- package/dist/cli/ui/.next/static/chunks/5149.8de9918b9ace58f5.js +166 -0
- package/dist/cli/ui/.next/static/chunks/5230.b7c87400f0d8516f.js +215 -0
- package/dist/cli/ui/.next/static/chunks/5263.7adc3ade53cd4ed3.js +24 -0
- package/dist/cli/ui/.next/static/chunks/5313.1dfcc2126f85a8f8.js +1 -0
- package/dist/cli/ui/.next/static/chunks/5350-17c792e27bf38c77.js +1 -0
- package/dist/cli/ui/.next/static/chunks/5638.e3a2119354708654.js +1 -0
- package/dist/cli/ui/.next/static/chunks/5758.33b45c6c407ecd94.js +1 -0
- package/dist/cli/ui/.next/static/chunks/589.019158de5d02c262.js +1 -0
- package/dist/cli/ui/.next/static/chunks/6013.e33e73569339afee.js +62 -0
- package/dist/cli/ui/.next/static/chunks/6084.7511ad4ebb4f9df5.js +1 -0
- package/dist/cli/ui/.next/static/chunks/612.d3aeebcaaaf06fb2.js +1 -0
- package/dist/cli/ui/.next/static/chunks/6239.6c0cd99ea36222b6.js +5 -0
- package/dist/cli/ui/.next/static/chunks/6299-79a74877b87acf9f.js +1 -0
- package/dist/cli/ui/.next/static/chunks/6484.d38aa531768c3452.js +148 -0
- package/dist/cli/ui/.next/static/chunks/6505.731f74c28b8980b3.js +1 -0
- package/dist/cli/ui/.next/static/chunks/6584.be94a55391bcdcce.js +262 -0
- package/dist/cli/ui/.next/static/chunks/6800.1066ad1f5add7c75.js +1 -0
- package/dist/cli/ui/.next/static/chunks/7052.89e2de773d10ac20.js +131 -0
- package/dist/cli/ui/.next/static/chunks/7127.360abfa43dc4427e.js +36 -0
- package/dist/cli/ui/.next/static/chunks/7430.2b247d9ac6ef694c.js +149 -0
- package/dist/cli/ui/.next/static/chunks/7444.66c4d6bbc19309b3.js +59 -0
- package/dist/cli/ui/.next/static/chunks/7546.4cb4db4685212384.js +63 -0
- package/dist/cli/ui/.next/static/chunks/7564.7b9271fcf06df80c.js +29 -0
- package/dist/cli/ui/.next/static/chunks/7664.8268c156d8988844.js +174 -0
- package/dist/cli/ui/.next/static/chunks/7722-04e64cc1b26cfa65.js +1 -0
- package/dist/cli/ui/.next/static/chunks/8701.3995b58a75e43147.js +56 -0
- package/dist/cli/ui/.next/static/chunks/8800.548c3da26cfebf06.js +1 -0
- package/dist/cli/ui/.next/static/chunks/8814-7b64110c79ce7209.js +15 -0
- package/dist/cli/ui/.next/static/chunks/9058.a195d15265251194.js +1 -0
- package/dist/cli/ui/.next/static/chunks/9211.91144a0d23e4cf6d.js +1 -0
- package/dist/cli/ui/.next/static/chunks/9690.c1f08c02a675b9ce.js +1 -0
- package/dist/cli/ui/.next/static/chunks/9919.1ccc9ca4a749d9b7.js +93 -0
- package/dist/cli/ui/.next/static/chunks/app/_global-error/page-ad53913b77389472.js +1 -0
- package/dist/cli/ui/.next/static/chunks/app/_not-found/page-202c1e16a4b86ac8.js +1 -0
- package/dist/cli/ui/.next/static/chunks/app/api/media/[collection]/[filename]/route-ad53913b77389472.js +1 -0
- package/dist/cli/ui/.next/static/chunks/app/api/media/[collection]/route-ad53913b77389472.js +1 -0
- package/dist/cli/ui/.next/static/chunks/app/api/public/[...path]/route-ad53913b77389472.js +1 -0
- package/dist/cli/ui/.next/static/chunks/app/api/sync/[collection]/route-ad53913b77389472.js +1 -0
- package/dist/cli/ui/.next/static/chunks/app/api/watch/route-ad53913b77389472.js +1 -0
- package/dist/cli/ui/.next/static/chunks/app/collection/[name]/[slug]/page-7ea9eff252374845.js +6 -0
- package/dist/cli/ui/.next/static/chunks/app/collection/[name]/loading-03fc0b653e7060ae.js +1 -0
- package/dist/cli/ui/.next/static/chunks/app/collection/[name]/page-ad5976bebc9820cf.js +1 -0
- package/dist/cli/ui/.next/static/chunks/app/layout-74cd2ebe3fac00e7.js +1 -0
- package/dist/cli/ui/.next/static/chunks/app/page-ed5acadf20146966.js +1 -0
- package/dist/cli/ui/.next/static/chunks/b1767599.6a816b06e55b02a1.js +1 -0
- package/dist/cli/ui/.next/static/chunks/c6164070.3b9741bce302db0f.js +136 -0
- package/dist/cli/ui/.next/static/chunks/fb2ceba8.7fc23e46ca00cfd1.js +53 -0
- package/dist/cli/ui/.next/static/chunks/framework-ada624c9bf38edc6.js +1 -0
- package/dist/cli/ui/.next/static/chunks/main-0513ff42a7f2e1a0.js +5 -0
- package/dist/cli/ui/.next/static/chunks/main-app-b8d23dfb755744e8.js +1 -0
- package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/app-error-ad53913b77389472.js +1 -0
- package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/forbidden-ad53913b77389472.js +1 -0
- package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/global-error-558ee1074f45044b.js +1 -0
- package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/not-found-ad53913b77389472.js +1 -0
- package/dist/cli/ui/.next/static/chunks/next/dist/client/components/builtin/unauthorized-ad53913b77389472.js +1 -0
- package/dist/cli/ui/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/cli/ui/.next/static/chunks/webpack-acb903cd88aafa6f.js +1 -0
- package/dist/cli/ui/.next/static/css/e143949aa3f17880.css +3 -0
- package/dist/cli/ui/.next/static/media/034d78ad42e9620c-s.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/0484562807a97172-s.p.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/29a4aea02fdee119-s.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/29e7bbdce9332268-s.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/4c285fdca692ea22-s.p.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/6c177e25b87fd9cd-s.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/6c9a125e97d835e1-s.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/8888a3826f4a3af4-s.p.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/a1386beebedccca4-s.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/b957ea75a84b6ea7-s.p.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/c3bc380753a8436c-s.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/db911767852bc875-s.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/eafabf029ad39a43-s.p.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/f10b8e9d91f3edcb-s.woff2 +0 -0
- package/dist/cli/ui/.next/static/media/fe0777f1195381cb-s.woff2 +0 -0
- package/dist/cli/ui/.next/static/zkOuvkSWApTVHCrj7neNk/_buildManifest.js +1 -0
- package/dist/cli/ui/.next/static/zkOuvkSWApTVHCrj7neNk/_ssgManifest.js +1 -0
- package/dist/cli/ui/next.config.js +1 -0
- package/dist/cli/ui/package.json +4 -0
- package/dist/core/index.d.ts +34 -391
- package/dist/core/index.js +112 -338
- package/dist/core/index.js.map +1 -1
- package/dist/core/server.d.ts +135 -0
- package/dist/core/server.js +707 -0
- package/dist/core/server.js.map +1 -0
- package/dist/query-builder-KXz9cPzF.d.ts +330 -0
- package/package.json +31 -10
package/dist/core/index.d.ts
CHANGED
|
@@ -1,411 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @does Defines every field interface, the FieldDefinition union, and CollectionSchema
|
|
4
|
-
* @depends none
|
|
5
|
-
* @do Add new field types here; the UI and type-generator derive behavior from this shape
|
|
6
|
-
* @dont Import from CLI or UI; contain runtime logic beyond fieldLabel utilities
|
|
7
|
-
*/
|
|
8
|
-
declare const __brand: unique symbol;
|
|
9
|
-
type Brand<T, B extends string> = T & {
|
|
10
|
-
readonly [__brand]: B;
|
|
11
|
-
};
|
|
12
|
-
type Email = Brand<string, "Email">;
|
|
13
|
-
type HttpUrl = Brand<string, "HttpUrl">;
|
|
14
|
-
type ISODate = Brand<string, "ISODate">;
|
|
15
|
-
type MediaPath = Brand<string, "MediaPath">;
|
|
16
|
-
type ID = Brand<string, "ID">;
|
|
17
|
-
type Slug = Brand<string, "Slug">;
|
|
18
|
-
interface SelectOption {
|
|
19
|
-
label: string;
|
|
20
|
-
value: string;
|
|
21
|
-
color?: string;
|
|
22
|
-
}
|
|
23
|
-
interface StatusOption {
|
|
24
|
-
label: string;
|
|
25
|
-
value: string;
|
|
26
|
-
/** Semantic color bucket — maps to a badge color in the editor. */
|
|
27
|
-
color?: "gray" | "red" | "yellow" | "green" | "blue" | "purple";
|
|
28
|
-
}
|
|
29
|
-
interface BaseField {
|
|
30
|
-
/** Machine-readable key used in the data object / JSON key. */
|
|
31
|
-
name: string;
|
|
32
|
-
/** Human-readable label shown in the editor. Defaults to `name`. */
|
|
33
|
-
label?: string;
|
|
34
|
-
/** Whether the field must have a non-empty value. */
|
|
35
|
-
required?: boolean;
|
|
36
|
-
/** Helper text shown below the input in the editor. */
|
|
37
|
-
description?: string;
|
|
38
|
-
/** Default value used when creating a new entry. */
|
|
39
|
-
defaultValue?: unknown;
|
|
40
|
-
}
|
|
41
|
-
interface TextField extends BaseField {
|
|
42
|
-
type: "text";
|
|
43
|
-
placeholder?: string;
|
|
44
|
-
maxLength?: number;
|
|
45
|
-
}
|
|
46
|
-
interface LongTextField extends BaseField {
|
|
47
|
-
type: "long-text";
|
|
48
|
-
placeholder?: string;
|
|
49
|
-
/** Minimum visible rows in the textarea. */
|
|
50
|
-
rows?: number;
|
|
51
|
-
}
|
|
52
|
-
interface NumberField extends BaseField {
|
|
53
|
-
type: "number";
|
|
54
|
-
format?: "integer" | "decimal";
|
|
55
|
-
min?: number;
|
|
56
|
-
max?: number;
|
|
57
|
-
step?: number;
|
|
58
|
-
}
|
|
59
|
-
interface BooleanField extends BaseField {
|
|
60
|
-
type: "boolean";
|
|
61
|
-
defaultValue?: boolean;
|
|
62
|
-
}
|
|
63
|
-
interface DateField extends BaseField {
|
|
64
|
-
type: "date";
|
|
65
|
-
/**
|
|
66
|
-
* When `true` the editor renders a datetime-picker (date + time).
|
|
67
|
-
* When `false` or omitted it renders a date-only picker.
|
|
68
|
-
*/
|
|
69
|
-
includeTime?: boolean;
|
|
70
|
-
}
|
|
71
|
-
interface SelectField extends BaseField {
|
|
72
|
-
type: "select";
|
|
73
|
-
options: SelectOption[];
|
|
74
|
-
defaultValue?: string;
|
|
75
|
-
}
|
|
76
|
-
interface MultiSelectField extends BaseField {
|
|
77
|
-
type: "multi-select";
|
|
78
|
-
options: SelectOption[];
|
|
79
|
-
defaultValue?: string[];
|
|
80
|
-
}
|
|
81
|
-
interface UrlField extends BaseField {
|
|
82
|
-
type: "url";
|
|
83
|
-
placeholder?: string;
|
|
84
|
-
}
|
|
85
|
-
interface EmailField extends BaseField {
|
|
86
|
-
type: "email";
|
|
87
|
-
placeholder?: string;
|
|
88
|
-
}
|
|
89
|
-
interface MediaField extends BaseField {
|
|
90
|
-
type: "media";
|
|
91
|
-
/** Accepted MIME types or extensions, e.g. `["image/*"]`. */
|
|
92
|
-
accept?: string[];
|
|
93
|
-
}
|
|
94
|
-
interface ObjectField extends BaseField {
|
|
95
|
-
type: "object";
|
|
96
|
-
/** Nested field definitions rendered as a form. */
|
|
97
|
-
fields: FieldDefinition[];
|
|
98
|
-
}
|
|
99
|
-
interface ArrayField extends BaseField {
|
|
100
|
-
type: "array";
|
|
101
|
-
/** Shape of each item in the array — rendered as a sheet (table). */
|
|
102
|
-
itemFields: FieldDefinition[];
|
|
103
|
-
}
|
|
104
|
-
interface IdField extends BaseField {
|
|
105
|
-
type: "id";
|
|
106
|
-
/** Strategy for auto-generating IDs. Defaults to `"nanoid"`. */
|
|
107
|
-
generate?: "uuid" | "nanoid" | "cuid";
|
|
108
|
-
}
|
|
109
|
-
interface SlugField extends BaseField {
|
|
110
|
-
type: "slug";
|
|
111
|
-
/** Name of the field whose value is used as the slug source. */
|
|
112
|
-
from: string;
|
|
113
|
-
}
|
|
114
|
-
interface RelationField extends BaseField {
|
|
115
|
-
type: "relation";
|
|
116
|
-
/** Target collection name. */
|
|
117
|
-
collection: string;
|
|
118
|
-
/** Allow selecting multiple entries. */
|
|
119
|
-
multiple?: boolean;
|
|
120
|
-
}
|
|
121
|
-
interface FormulaField extends BaseField {
|
|
122
|
-
type: "formula";
|
|
123
|
-
/**
|
|
124
|
-
* Expression string evaluated at read time.
|
|
125
|
-
* Syntax TBD — placeholder for v2.
|
|
126
|
-
*/
|
|
127
|
-
expression: string;
|
|
128
|
-
/** TypeScript type that the expression produces. Used by the type generator. */
|
|
129
|
-
resultType?: "string" | "number" | "boolean";
|
|
130
|
-
}
|
|
131
|
-
interface StatusField extends BaseField {
|
|
132
|
-
type: "status";
|
|
133
|
-
options: StatusOption[];
|
|
134
|
-
defaultValue?: string;
|
|
135
|
-
}
|
|
136
|
-
interface CreatedTimeField extends BaseField {
|
|
137
|
-
type: "created-time";
|
|
138
|
-
}
|
|
139
|
-
interface UpdatedTimeField extends BaseField {
|
|
140
|
-
type: "updated-time";
|
|
141
|
-
}
|
|
142
|
-
type FieldDefinition = TextField | LongTextField | NumberField | BooleanField | DateField | SelectField | MultiSelectField | UrlField | EmailField | MediaField | ObjectField | ArrayField | IdField | SlugField | RelationField | FormulaField | StatusField | CreatedTimeField | UpdatedTimeField;
|
|
143
|
-
type FieldType = FieldDefinition["type"];
|
|
144
|
-
interface CollectionSchema {
|
|
145
|
-
/** Collection name — must match the folder name under /contents. */
|
|
146
|
-
collection: string;
|
|
147
|
-
/**
|
|
148
|
-
* Human-readable label for the collection.
|
|
149
|
-
* Defaults to the collection name with title case.
|
|
150
|
-
*/
|
|
151
|
-
label?: string;
|
|
152
|
-
/** Field definitions that describe the shape of each entry. */
|
|
153
|
-
fields: FieldDefinition[];
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* @context Shared layer — domain types at src/shared/types.ts
|
|
158
|
-
* @does Defines core domain interfaces shared across core, CLI, and UI layers
|
|
159
|
-
* @depends src/shared/fields.ts
|
|
160
|
-
* @do Add new shared domain types here
|
|
161
|
-
* @dont Import from CLI or UI; contain runtime logic; import framework-specific code
|
|
162
|
-
*/
|
|
1
|
+
import { C as ContentEntry, F as FieldDefinition, T as TextField, L as LongTextField, N as NumberField, B as BooleanField, D as DateField, I as ISODate, S as SelectField, M as MultiSelectField, U as UrlField, H as HttpUrl, E as EmailField, a as Email, b as MediaField, c as MediaPath, O as ObjectField, A as ArrayField, d as IdField, e as ID, f as SlugField, g as Slug, R as RelationField, h as FormulaField, i as StatusField, j as CreatedTimeField, k as UpdatedTimeField, l as CollectionSchema, m as BaseField } from '../query-builder-KXz9cPzF.js';
|
|
2
|
+
export { n as Collection, o as CollectionConfig, p as CollectionTypeMap, q as EntryResult, r as FieldType, Q as QueryOptions, s as QueryResult, t as StudioConfig, u as queryCollection } from '../query-builder-KXz9cPzF.js';
|
|
163
3
|
|
|
164
4
|
/**
|
|
165
|
-
* Core
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
/** URL-friendly identifier derived from the filename */
|
|
171
|
-
slug: string;
|
|
172
|
-
/** Full path relative to the contents directory */
|
|
173
|
-
path: string;
|
|
174
|
-
/** Raw body content (MDX string or undefined for JSON) */
|
|
175
|
-
body?: string;
|
|
176
|
-
/** Parsed frontmatter or JSON data */
|
|
177
|
-
data: Record<string, unknown>;
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Collection metadata describing a content collection.
|
|
181
|
-
*/
|
|
182
|
-
interface Collection {
|
|
183
|
-
/** Collection name (folder name) */
|
|
184
|
-
name: string;
|
|
185
|
-
/** Type of content in the collection */
|
|
186
|
-
type: "mdx" | "json-array" | "json-object";
|
|
187
|
-
/** Number of entries in the collection */
|
|
188
|
-
count: number;
|
|
189
|
-
/** Filesystem path to the collection folder */
|
|
190
|
-
basePath: string;
|
|
191
|
-
/** Optional schema that describes the fields in this collection. */
|
|
192
|
-
schema?: CollectionSchema;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Studio configuration from studio.config.ts
|
|
196
|
-
*/
|
|
197
|
-
interface StudioConfig {
|
|
198
|
-
/** Per-collection configuration */
|
|
199
|
-
collections?: Record<string, CollectionConfig>;
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Per-collection configuration options.
|
|
203
|
-
*/
|
|
204
|
-
interface CollectionConfig {
|
|
205
|
-
/** Field schema that describes the shape of each entry. */
|
|
206
|
-
schema?: CollectionSchema;
|
|
207
|
-
/** Import/sync scripts for the collection */
|
|
208
|
-
scripts?: {
|
|
209
|
-
import?: string;
|
|
210
|
-
sync?: string;
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Augmentable map of collection names to their typed entry shapes.
|
|
215
|
-
* Extend this via generated types or manual declaration:
|
|
216
|
-
*
|
|
217
|
-
* @example
|
|
218
|
-
* // .studio/studio.d.ts (auto-generated)
|
|
219
|
-
* declare module 'nextjs-studio' {
|
|
220
|
-
* interface CollectionTypeMap {
|
|
221
|
-
* posts: { title: string; date: string; slug: string };
|
|
222
|
-
* }
|
|
223
|
-
* }
|
|
224
|
-
*/
|
|
225
|
-
interface CollectionTypeMap {
|
|
226
|
-
}
|
|
227
|
-
/**
|
|
228
|
-
* Query options for the content query builder.
|
|
229
|
-
*/
|
|
230
|
-
interface QueryOptions {
|
|
231
|
-
where?: Record<string, unknown>;
|
|
232
|
-
sort?: {
|
|
233
|
-
field: string;
|
|
234
|
-
order: "asc" | "desc";
|
|
235
|
-
};
|
|
236
|
-
limit?: number;
|
|
237
|
-
offset?: number;
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* File metadata returned by the FS adapter.
|
|
241
|
-
*/
|
|
242
|
-
interface FileInfo {
|
|
243
|
-
path: string;
|
|
244
|
-
size: number;
|
|
245
|
-
modifiedAt: Date;
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* A file entry returned by a flat directory listing (non-recursive).
|
|
249
|
-
*/
|
|
250
|
-
interface DirectoryFileEntry {
|
|
251
|
-
name: string;
|
|
252
|
-
relativePath: string;
|
|
253
|
-
size: number;
|
|
254
|
-
modifiedAt: Date;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* @context Core layer — query builder at src/core/query-builder.ts
|
|
259
|
-
* @does Provides a fluent API to filter, sort, and paginate content entries from a collection
|
|
260
|
-
* @depends src/shared/types.ts, src/core/content-store.ts
|
|
261
|
-
* @do Add new query capabilities here (e.g. search, groupBy)
|
|
262
|
-
* @dont Import from CLI or UI; access the filesystem; perform I/O
|
|
263
|
-
*/
|
|
264
|
-
|
|
265
|
-
/**
|
|
266
|
-
* Fluent query builder for content collections.
|
|
267
|
-
*
|
|
268
|
-
* ```ts
|
|
269
|
-
* const posts = queryCollection("blog")
|
|
270
|
-
* .where({ published: true })
|
|
271
|
-
* .sort("date", "desc")
|
|
272
|
-
* .limit(10)
|
|
273
|
-
* .all();
|
|
274
|
-
* ```
|
|
275
|
-
*
|
|
276
|
-
* Supports dot notation for nested properties:
|
|
277
|
-
* ```ts
|
|
278
|
-
* queryCollection("pages").where({ "hero.title": "Welcome" }).all();
|
|
279
|
-
* ```
|
|
280
|
-
*/
|
|
281
|
-
declare class QueryBuilder<T = Record<string, unknown>> {
|
|
282
|
-
private readonly collectionName;
|
|
283
|
-
private options;
|
|
284
|
-
constructor(collection: string);
|
|
285
|
-
where(conditions: Record<string, unknown>): this;
|
|
286
|
-
sort(field: string, order?: "asc" | "desc"): this;
|
|
287
|
-
limit(count: number): this;
|
|
288
|
-
offset(count: number): this;
|
|
289
|
-
all(): T[];
|
|
290
|
-
first(): T | undefined;
|
|
291
|
-
count(): number;
|
|
292
|
-
}
|
|
293
|
-
/**
|
|
294
|
-
* Entry point for querying a content collection.
|
|
5
|
+
* @context Core layer — draft filter at src/core/draft-filter.ts
|
|
6
|
+
* @does Provides utilities to detect and filter draft content entries
|
|
7
|
+
* @depends src/shared/types.ts
|
|
8
|
+
* @do Add new draft detection heuristics here
|
|
9
|
+
* @dont Import from CLI or UI; access filesystem
|
|
295
10
|
*/
|
|
296
|
-
declare function queryCollection<K extends keyof CollectionTypeMap>(name: K): QueryBuilder<CollectionTypeMap[K]>;
|
|
297
|
-
declare function queryCollection(name: string): QueryBuilder<Record<string, unknown>>;
|
|
298
11
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
* @does Convenience function to initialize the content store for Node.js environments
|
|
302
|
-
* @depends src/core/content-store.ts, src/cli/adapters/fs-adapter.ts
|
|
303
|
-
* @do Use this as the entry point for Next.js and other Node.js consumers
|
|
304
|
-
* @dont Import from UI; use in browser environments
|
|
305
|
-
*/
|
|
12
|
+
declare function isDraft(entry: ContentEntry): boolean;
|
|
13
|
+
declare function filterDrafts(entries: ContentEntry[]): ContentEntry[];
|
|
306
14
|
|
|
307
15
|
/**
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
*
|
|
311
|
-
* @
|
|
312
|
-
* @
|
|
313
|
-
*
|
|
314
|
-
* @example
|
|
315
|
-
* ```ts
|
|
316
|
-
* import { initStudio, queryCollection } from "nextjs-studio";
|
|
317
|
-
*
|
|
318
|
-
* await initStudio();
|
|
319
|
-
* const posts = queryCollection("posts").all();
|
|
320
|
-
* ```
|
|
16
|
+
* @context Core layer — frontmatter binder at src/core/frontmatter-binder.ts
|
|
17
|
+
* @does Replaces {frontmatter.X} tokens in MDX body with actual frontmatter values
|
|
18
|
+
* @depends none
|
|
19
|
+
* @do Add new token patterns or transformation rules here
|
|
20
|
+
* @dont Import from CLI or UI; access filesystem
|
|
321
21
|
*/
|
|
322
|
-
declare function initStudio(contentsDir?: string, config?: StudioConfig): Promise<void>;
|
|
323
22
|
/**
|
|
324
|
-
*
|
|
23
|
+
* Replaces `{frontmatter.X}` tokens in the body with values from the data object.
|
|
24
|
+
* Supports dot-notation for nested values (e.g. `{frontmatter.author.name}`).
|
|
325
25
|
*/
|
|
326
|
-
declare function
|
|
26
|
+
declare function bindFrontmatter(body: string, data: Record<string, unknown>): string;
|
|
327
27
|
/**
|
|
328
|
-
*
|
|
329
|
-
* initializes once. Ideal for use at the top of Next.js server components and
|
|
330
|
-
* `generateStaticParams` / `generateMetadata` functions.
|
|
331
|
-
*
|
|
332
|
-
* @param contentsDir - Path to the contents directory. Defaults to `./contents` relative to cwd.
|
|
333
|
-
* @param config - Optional studio config for schemas and scripts.
|
|
334
|
-
*
|
|
335
|
-
* @example
|
|
336
|
-
* ```ts
|
|
337
|
-
* import { ensureContentLoaded, queryCollection } from "nextjs-studio";
|
|
338
|
-
*
|
|
339
|
-
* export default async function Page() {
|
|
340
|
-
* await ensureContentLoaded();
|
|
341
|
-
* const posts = queryCollection("posts");
|
|
342
|
-
* // ...
|
|
343
|
-
* }
|
|
344
|
-
* ```
|
|
28
|
+
* Extracts all frontmatter token paths from the body.
|
|
345
29
|
*/
|
|
346
|
-
declare function
|
|
30
|
+
declare function extractFrontmatterTokens(body: string): string[];
|
|
347
31
|
|
|
348
32
|
/**
|
|
349
|
-
* @context
|
|
350
|
-
* @does
|
|
351
|
-
* @depends
|
|
352
|
-
* @do Add new
|
|
353
|
-
* @dont Import from CLI or UI;
|
|
33
|
+
* @context Core layer — locale parser at src/core/locale-parser.ts
|
|
34
|
+
* @does Extracts locale codes from filenames using the convention `slug.locale.mdx`
|
|
35
|
+
* @depends none
|
|
36
|
+
* @do Add new locale detection strategies here
|
|
37
|
+
* @dont Import from CLI or UI; access filesystem
|
|
354
38
|
*/
|
|
355
|
-
|
|
356
|
-
interface IFsAdapter {
|
|
357
|
-
readFile(filePath: string): Promise<string>;
|
|
358
|
-
writeFile(filePath: string, content: string): Promise<void>;
|
|
359
|
-
deleteFile(filePath: string): Promise<void>;
|
|
360
|
-
exists(filePath: string): Promise<boolean>;
|
|
361
|
-
getStats(filePath: string): Promise<FileInfo>;
|
|
362
|
-
listFiles(dirPath: string, extensions?: readonly string[]): Promise<string[]>;
|
|
363
|
-
listDirectories(dirPath: string): Promise<string[]>;
|
|
364
|
-
readBuffer(filePath: string): Promise<Buffer>;
|
|
365
|
-
writeBuffer(filePath: string, data: Buffer): Promise<void>;
|
|
366
|
-
listAllFiles(dirPath: string): Promise<DirectoryFileEntry[]>;
|
|
367
|
-
join(...segments: string[]): string;
|
|
368
|
-
basename(filePath: string): string;
|
|
369
|
-
extname(filePath: string): string;
|
|
370
|
-
relative(from: string, to: string): string;
|
|
371
|
-
normalizeSlug(relativePath: string, ext: string): string;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
39
|
/**
|
|
375
|
-
*
|
|
376
|
-
*
|
|
377
|
-
*
|
|
378
|
-
* @do Add new file type handling here; extend indexCollection for new collection behaviors
|
|
379
|
-
* @dont Import from CLI or UI; instantiate FsAdapter; access the filesystem directly
|
|
40
|
+
* Parses locale from a filename.
|
|
41
|
+
* Supports `post.pt.mdx`, `post.en-US.mdx` patterns.
|
|
42
|
+
* Returns undefined for files without a locale suffix.
|
|
380
43
|
*/
|
|
381
|
-
|
|
382
|
-
declare class ContentIndex {
|
|
383
|
-
private readonly entries;
|
|
384
|
-
private readonly collections;
|
|
385
|
-
private readonly fs;
|
|
386
|
-
constructor(fsAdapter: IFsAdapter);
|
|
387
|
-
build(config?: StudioConfig): Promise<void>;
|
|
388
|
-
getCollection(name: string): ContentEntry[];
|
|
389
|
-
getCollections(): Collection[];
|
|
390
|
-
clear(): void;
|
|
391
|
-
private indexCollection;
|
|
392
|
-
private scanDir;
|
|
393
|
-
private buildMdxEntry;
|
|
394
|
-
private buildJsonEntries;
|
|
395
|
-
private readOrdering;
|
|
396
|
-
private applyOrdering;
|
|
397
|
-
private detectCollectionType;
|
|
398
|
-
}
|
|
399
|
-
|
|
44
|
+
declare function parseLocaleFromFilename(filename: string): string | undefined;
|
|
400
45
|
/**
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
* @dont Import from CLI or UI; instantiate FsAdapter here; contain parsing or I/O logic
|
|
46
|
+
* Removes the locale suffix from a slug.
|
|
47
|
+
* Handles both pre-slugify (`.pt`) and post-slugify (`-pt`) formats,
|
|
48
|
+
* since `@sindresorhus/slugify` converts dots to dashes.
|
|
49
|
+
* `post.pt` → `post`, `post-pt` → `post`, `post` → `post`
|
|
406
50
|
*/
|
|
407
|
-
|
|
408
|
-
declare function loadContent(fsAdapter: IFsAdapter, config?: StudioConfig): Promise<ContentIndex>;
|
|
51
|
+
declare function stripLocaleFromSlug(slug: string, locale?: string): string;
|
|
409
52
|
|
|
410
53
|
/**
|
|
411
54
|
* @context Shared layer — schema inference types at src/shared/schema-types.ts
|
|
@@ -471,4 +114,4 @@ declare function fieldLabel(field: Pick<BaseField, "name" | "label">): string;
|
|
|
471
114
|
*/
|
|
472
115
|
declare function keyLabel(name: string): string;
|
|
473
116
|
|
|
474
|
-
export {
|
|
117
|
+
export { CollectionSchema, ContentEntry, FieldDefinition, type InferFieldValue, type InferSchemaData, bindFrontmatter, extractFrontmatterTokens, fieldLabel, filterDrafts, isDraft, keyLabel, parseLocaleFromFilename, stripLocaleFromSlug };
|