@somewhere-cloud/cli 0.38.186 → 0.38.187
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 +6 -0
- package/dist/lib/bundle.js +7 -5
- package/dist/lib/bundle.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.38.187
|
|
4
|
+
|
|
5
|
+
- Test output distinguishes allowed control reads from the requests it expects to refuse.
|
|
6
|
+
- The starter guide explains how to choose team access rules and where to find guidance on server-rendered pages and sitemaps.
|
|
7
|
+
- The starter guide gives the current timing for changes to published rows.
|
|
8
|
+
|
|
3
9
|
## 0.38.186
|
|
4
10
|
|
|
5
11
|
- The starter guide explains team access, publishing drafts and handling updates that change no rows.
|
package/dist/lib/bundle.js
CHANGED
|
@@ -44301,14 +44301,15 @@ var init_init_agent_guide = __esm({
|
|
|
44301
44301
|
|
|
44302
44302
|
| Does your app verify emails? | Choose the declared access rule |
|
|
44303
44303
|
| --- | --- |
|
|
44304
|
-
|
|
|
44305
|
-
|
|
|
44304
|
+
| Either, teams people join | Use \`group()\` and \`sw.groups\` for invitations, membership and owner/admin permissions, whether or not sign-up verifies emails: an invitee joins by opening the emailed link, which proves the address. See \`somewhere docs sw.groups --section team-example\`. |
|
|
44305
|
+
| Either, a roster the app keeps itself | Only for a relationship that is not a team people join. Use \`member()\` over your own roster table. Scope the roster and the team table with \`member()\` as well, so members read both without server code. For "author or team owner edits", add a second \`member()\` branch with \`where: { role: 'owner' }\`. Creating a team and changing its roster still need a function with \`sw.db.server\`. See \`somewhere docs declared-data --section teams-without-email-verification\`. |
|
|
44306
44306
|
| Yes, staff by domain | Use \`appRole()\` and \`appRoles: { staff: { emailDomain: 'staff.example' } }\`. The address must be verified. |
|
|
44307
|
+
| No, staff by domain | Anyone can sign up with an address they do not own, so tell whoever set the rule. If it stays, declare \`appRoles: { staff: { assignedBy: 'server' } }\`, grant the role once in the sign-up route with \`sw.auth.server.setRoles\`, and keep every staff table on \`appRole()\`. Never compare the address in each handler. See \`somewhere docs sw.auth --section server-assigned-app-roles-setroles\`. |
|
|
44307
44308
|
| No, staff by invitation | Use \`appRole()\` and \`assignedBy: 'server'\`. Redeem an app-issued invitation and call \`sw.auth.server.setRoles\` inside the sign-up route. See \`somewhere docs sw.auth --section server-assigned-app-roles-setroles\`. |
|
|
44308
44309
|
| Either, personal rows | Use \`owner()\`. The platform stamps the owner from the signed-in user. |
|
|
44309
44310
|
| Either, shared private row | Use a read-only \`grant()\` for a known app-user ID. Adding the grant widens existing caller-scoped reads. See \`somewhere docs declared-data --section read-only-sharing-without-email-verification\`. |
|
|
44310
44311
|
| No, share by email address | Without verification, whoever signs up first with an address owns it. Match the existing account, tell the sharer plainly when none exists, and show the sharer that the recipient's address is unverified so they can revoke. For private data, grant the share only after the recipient opens an \`sw.auth.invite\` link sent to that address. See \`somewhere docs declared-data --section sharing-by-email-without-verification\`. |
|
|
44311
|
-
| Either, public pages from private drafts | Use conditional \`client.publicRead: { where: { published: true } }\`.
|
|
44312
|
+
| Either, public pages from private drafts | Use conditional \`client.publicRead: { where: { published: true } }\`. A change, an unpublish included, reaches signed-out readers within about a minute, usually within seconds. Publish from a function with caller-scoped \`sw.db.update\`, so the table's update rule decides who may publish. |
|
|
44312
44313
|
|
|
44313
44314
|
### Schema and data
|
|
44314
44315
|
|
|
@@ -44328,6 +44329,7 @@ Use \`client.intake\` for public submissions to a private parent row. See
|
|
|
44328
44329
|
### Routes and auth
|
|
44329
44330
|
|
|
44330
44331
|
- Add React pages where your app handles navigation. To serve a dynamic endpoint such as \`/api/notes/:id\`, create \`api/notes/[id].ts\`. A root \`[...path].ts\` handles document routes, including \`/\`. Underscore-prefixed files are import-only helpers.
|
|
44332
|
+
- A page search engines and link previews must read (an article, a public profile) is server-rendered: return its HTML from the root \`[...path].ts\`. The generated sitemap lists only deployed HTML files, so supply a sitemap with those URLs. See \`somewhere docs recipe-seo --section 5-server-rendered-pages-and-redirects\` and \`--section 3-sitemap-and-robots\`.
|
|
44331
44333
|
- JSON routes use \`sw.endpoint({ auth, body, rateLimit, handler })\`. Set \`auth\` to \`'required'\`, \`'optional'\` or \`'none'\`. Use a limit like \`'30/minute'\`. Read route parameters from the handler's \`params\`. Use a default handler or named HTTP method exports. For streaming, webhooks or custom responses, use a bare \`(req, sw)\` handler and \`sw.params\`. See \`somewhere docs functions\`.
|
|
44332
44334
|
- Keep the SDK auth handler at \`api/auth/[...path].ts\` when your app uses sign-in. Gate private UI on auth state. Password sign-up starts unverified, and signed-in unverified users pass \`auth: 'required'\`. See \`somewhere docs auth-client\`.
|
|
44333
44335
|
- Mail from the app's built-in address reaches only the owner and app users who verified their email and signed in. Password sign-up starts unverified: if the app emails its users (confirmations, reminders), keep the starter's "Verify your email" step, or verify your own sender domain. See \`somewhere docs sw.email\`.
|
|
@@ -78819,7 +78821,7 @@ function formatChecksReport(check) {
|
|
|
78819
78821
|
const coverage = check?.not_checked ?? null;
|
|
78820
78822
|
if (coverage) {
|
|
78821
78823
|
if (typeof check?.routes_discovered === "number")
|
|
78822
|
-
lines.push(check.routes_checked ? `${check.routes_checked} of ${check.routes_discovered} app routes had a completed read check.` : `This check called none of your ${check.routes_discovered} app routes
|
|
78824
|
+
lines.push(check.routes_checked ? `${check.routes_checked} of ${check.routes_discovered} app routes had a completed read check.` : `This check called none of your ${check.routes_discovered} app routes. To have it call them after every deploy, add them as steps to a checks/<name>.json list: ${cliInvocation()} docs test --section the-after-deploy-check-list.`);
|
|
78823
78825
|
const { routes_without_read_check: reads, routes_without_write_check: writes, schedules_not_run: schedules, other } = coverage;
|
|
78824
78826
|
if (reads === null || writes === null)
|
|
78825
78827
|
lines.push("App route coverage could not be listed.");
|
|
@@ -139566,7 +139568,7 @@ async function openTestApp(options2 = {}) {
|
|
|
139566
139568
|
const reads = requests.filter((request2) => request2[0] === "GET" || request2[0] === "DATA" && (request2[2].operation === "get" || request2[2].operation === "list"));
|
|
139567
139569
|
const controls = await Promise.allSettled(reads.map((request2) => send(options3.control, request2)));
|
|
139568
139570
|
controls.forEach((settled, i) => {
|
|
139569
|
-
const line = `${label}: control ${options3.control.name} ${named2(reads[i])}`;
|
|
139571
|
+
const line = `${label}: control ${options3.control.name} was allowed ${named2(reads[i])}`;
|
|
139570
139572
|
if (settled.status === "rejected") {
|
|
139571
139573
|
all = results.check(line, false, settled.reason) && all;
|
|
139572
139574
|
return;
|