create-wervt 0.2.12 → 0.2.14
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/index.js +2 -1
- package/package.json +1 -1
- package/template/AGENTS.md +9 -0
- package/template/nuxt.config.ts +3 -0
- package/template/package.json +2 -2
package/index.js
CHANGED
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
import { existsSync } from 'node:fs'
|
|
4
4
|
import { cp, readFile, rename, rm, writeFile } from 'node:fs/promises'
|
|
5
5
|
import { dirname, join, relative, resolve } from 'node:path'
|
|
6
|
+
import { fileURLToPath } from 'node:url'
|
|
6
7
|
import * as p from '@clack/prompts'
|
|
7
8
|
import { defineCommand, runMain } from 'citty'
|
|
8
9
|
import { downloadTemplate } from 'giget'
|
|
9
10
|
import { installDependencies } from 'nypm'
|
|
10
11
|
|
|
11
12
|
// templates/app, copied into the package when it's packed (see copy-template.js).
|
|
12
|
-
const BUNDLED_TEMPLATE = new URL('./template', import.meta.url)
|
|
13
|
+
const BUNDLED_TEMPLATE = fileURLToPath(new URL('./template', import.meta.url))
|
|
13
14
|
const NAME_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/
|
|
14
15
|
|
|
15
16
|
// Without a terminal (CI logs, agent shells), clack's spinner prints every frame as text.
|
package/package.json
CHANGED
package/template/AGENTS.md
CHANGED
|
@@ -142,6 +142,15 @@ version polling. For a banner in the app's own design, set `wervt: { updates: 'm
|
|
|
142
142
|
auto-imported) give the signed-in wervt user or nothing. Private apps always have one; public
|
|
143
143
|
apps only when the visitor signed in. It works with `ssr: false` too (no own `/api/me` needed). Link to `wervtLoginUrl(path)` / `wervtLogoutUrl(path)` as
|
|
144
144
|
external links. Never build your own login or OAuth.
|
|
145
|
+
- Private apps show a link preview to visitors without a login (chats unfurling a shared link):
|
|
146
|
+
only the app name and icon unless `wervt: { preview: { title, description, image: '/og.png' } }`
|
|
147
|
+
is set (`true` takes them from `app.head`; `false` turns it off). Put the image (1200×630) in
|
|
148
|
+
`public/`. Ask before adding a description or image to a private app: they're visible to anyone
|
|
149
|
+
with the link.
|
|
150
|
+
- Users inviting others (leagues, rooms, shared boards): make the app invite-only
|
|
151
|
+
(`wervt access <app> --invite`, ask the user first) and call
|
|
152
|
+
`useWervtAccess(event).invite(email)` (`revoke`, `list`) from `@wervt/nuxt/server` in a route.
|
|
153
|
+
The runtime still guards every request; don't build your own member list or invite tokens.
|
|
145
154
|
- For your own state (anonymous visitors too), use `useSession(event, { name })` from
|
|
146
155
|
`nuxt/server`. The secret is set by wervt.
|
|
147
156
|
|
package/template/nuxt.config.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
export default defineNuxtConfig({
|
|
2
2
|
modules: ['@wervt/nuxt'],
|
|
3
|
+
// The link preview anyone sees when a link to this (private) app is shared. Name and icon only
|
|
4
|
+
// until set; see AGENTS.md > Users and sessions.
|
|
5
|
+
// wervt: { preview: { title: '', description: '', image: '/og.png' } },
|
|
3
6
|
compatibilityDate: '2026-10-01',
|
|
4
7
|
})
|
package/template/package.json
CHANGED
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
"postinstall": "nuxt prepare"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@wervt/nuxt": "^0.3.
|
|
12
|
+
"@wervt/nuxt": "^0.3.2",
|
|
13
13
|
"drizzle-orm": "1.0.0-rc.4",
|
|
14
14
|
"nuxt": "npm:nuxt-nightly@5x",
|
|
15
15
|
"valibot": "^1.5.0",
|
|
16
16
|
"vue": "^3.5.43"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@wervt/cli": "^0.2.
|
|
19
|
+
"@wervt/cli": "^0.2.14",
|
|
20
20
|
"drizzle-kit": "1.0.0-rc.4",
|
|
21
21
|
"vite-plus": "^1.0.0"
|
|
22
22
|
}
|