create-nextly-app 0.0.2-alpha.4 → 0.0.2-alpha.41
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/dist/{chunk-AYJ2RKVJ.mjs → chunk-DDQB5KOQ.mjs} +2672 -2124
- package/dist/chunk-DDQB5KOQ.mjs.map +1 -0
- package/dist/cli.cjs +2755 -2209
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +30 -33
- package/dist/cli.mjs.map +1 -1
- package/dist/index.cjs +2800 -2250
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.mjs +1 -1
- package/package.json +10 -10
- package/templates/base/next.config.ts +11 -17
- package/templates/base/src/app/admin/[[...params]]/page.tsx +0 -9
- package/templates/base/src/app/admin/api/media/[[...path]]/route.ts +26 -0
- package/templates/base/tsconfig.json +1 -0
- package/templates/plugin/README.md +44 -0
- package/templates/plugin/dev/.env.example +8 -0
- package/templates/plugin/dev/instrumentation.ts +10 -0
- package/templates/plugin/dev/next.config.ts +30 -0
- package/templates/plugin/dev/nextly.config.ts +17 -0
- package/templates/plugin/dev/src/app/admin/[[...params]]/page.tsx +9 -0
- package/templates/plugin/dev/src/app/admin/api/[[...params]]/route.ts +19 -0
- package/templates/plugin/dev/src/app/layout.tsx +13 -0
- package/templates/plugin/dev/tsconfig.json +22 -0
- package/templates/plugin/eslint.config.mjs +8 -0
- package/templates/plugin/src/admin/SettingsPage.tsx +13 -0
- package/templates/plugin/src/admin/index.ts +21 -0
- package/templates/plugin/src/collections/example.ts +13 -0
- package/templates/plugin/src/index.ts +6 -0
- package/templates/plugin/src/plugin.test.ts +29 -0
- package/templates/plugin/src/plugin.ts +48 -0
- package/templates/plugin/src/types.ts +17 -0
- package/templates/plugin/template.json +14 -0
- package/templates/plugin/tsconfig.json +18 -0
- package/templates/plugin/tsup.config.ts +22 -0
- package/templates/plugin/vitest.config.ts +8 -0
- package/dist/chunk-AYJ2RKVJ.mjs.map +0 -1
- package/templates/blank/src/access/README.md +0 -22
- package/templates/blank/src/collections/README.md +0 -22
- package/templates/blank/src/lib/README.md +0 -15
- package/templates/blank/src/singles/README.md +0 -19
- /package/templates/blank/src/{components → app/(frontend)/components}/README.md +0 -0
- /package/templates/blank/src/{components → app/(frontend)/components}/ThemeToggle.tsx +0 -0
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Access
|
|
2
|
-
|
|
3
|
-
Access-control functions used by `defineCollection({ access: ... })`
|
|
4
|
-
and `defineSingle({ access: ... })`. Each function decides whether the
|
|
5
|
-
current user can perform an action (read, create, update, delete) on a
|
|
6
|
-
collection or single.
|
|
7
|
-
|
|
8
|
-
Conventions:
|
|
9
|
-
|
|
10
|
-
- One function per file. File name matches the function name.
|
|
11
|
-
- Export the function as a named export.
|
|
12
|
-
- Type signature: `AccessControlFunction` from `nextly`.
|
|
13
|
-
|
|
14
|
-
Common patterns shipped in the blog template (for reference):
|
|
15
|
-
|
|
16
|
-
- `anyone.ts` — always allow (use for public reads).
|
|
17
|
-
- `authenticated.ts` — require any logged-in user.
|
|
18
|
-
- `is-admin.ts` — require the `admin` role.
|
|
19
|
-
- `is-author-or-editor.ts` — require one of several roles.
|
|
20
|
-
|
|
21
|
-
Add your own here as your project grows. Wire them up in your
|
|
22
|
-
collections / singles config.
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# Collections
|
|
2
|
-
|
|
3
|
-
Code-first collections. Each collection is defined via
|
|
4
|
-
`defineCollection({ ... })` from `nextly/config` and wired into the
|
|
5
|
-
root `nextly.config.ts` as part of the `collections: [...]` array.
|
|
6
|
-
|
|
7
|
-
Conventions:
|
|
8
|
-
|
|
9
|
-
- Trivial collections (a few scalar fields, no hooks): single file
|
|
10
|
-
named after the collection (e.g. `Categories.ts`).
|
|
11
|
-
- Complex collections (many fields, hooks, or per-collection helpers):
|
|
12
|
-
folder named after the collection, with `index.ts` exporting the
|
|
13
|
-
collection definition and a `hooks/` subdir for hooks specific to
|
|
14
|
-
that collection (e.g. `Posts/index.ts` + `Posts/hooks/`).
|
|
15
|
-
- Imports inside collection files use relative paths (`../access/...`)
|
|
16
|
-
rather than the `@/` alias because `nextly.config.ts` is loaded by
|
|
17
|
-
the CLI through plain Node.js module resolution, which does not
|
|
18
|
-
honour TypeScript path aliases.
|
|
19
|
-
|
|
20
|
-
Skip this folder if you're using the Visual Schema Builder (admin UI)
|
|
21
|
-
to manage your schemas — UI-built collections live in the database, not
|
|
22
|
-
on disk.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# Lib
|
|
2
|
-
|
|
3
|
-
Project-wide helpers and utilities. Add files here for things that get
|
|
4
|
-
imported across multiple components or routes.
|
|
5
|
-
|
|
6
|
-
Examples (from the blog template, for inspiration):
|
|
7
|
-
|
|
8
|
-
- `format-date.ts` — locale-aware date formatting.
|
|
9
|
-
- `site-url.ts` — resolves canonical URLs for OG / sitemap.
|
|
10
|
-
- `queries/` — cached Direct-API wrappers (e.g. `getPostBySlug`).
|
|
11
|
-
- `rss.ts` — RSS feed builder.
|
|
12
|
-
|
|
13
|
-
Use the `@/` path alias (`import { ... } from "@/lib/foo"`) inside
|
|
14
|
-
your `src/app/`, `src/components/`, etc. Do not use the alias inside
|
|
15
|
-
`nextly.config.ts` or files transitively loaded by it.
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# Singles
|
|
2
|
-
|
|
3
|
-
Code-first singles (formerly "globals"). Each single is defined via
|
|
4
|
-
`defineSingle({ ... })` from `nextly/config` and wired into the root
|
|
5
|
-
`nextly.config.ts` as part of the `singles: [...]` array.
|
|
6
|
-
|
|
7
|
-
A single is a one-of content record — Site Settings, Homepage layout,
|
|
8
|
-
Footer config, etc. Use Singles when there is exactly one record of a
|
|
9
|
-
given type, and use Collections when the type has many records.
|
|
10
|
-
|
|
11
|
-
Conventions:
|
|
12
|
-
|
|
13
|
-
- One file or folder per single. Folder if the single has hooks or
|
|
14
|
-
helpers; flat file if it's a small scalar definition.
|
|
15
|
-
- Imports inside single files use relative paths (`../access/...`)
|
|
16
|
-
rather than the `@/` alias because `nextly.config.ts` is loaded by
|
|
17
|
-
the CLI through plain Node.js module resolution.
|
|
18
|
-
|
|
19
|
-
Skip this folder if you're using the Visual Schema Builder.
|
|
File without changes
|
|
File without changes
|