create-feltkit 0.3.21 → 0.3.22
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-feltkit",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.22",
|
|
4
4
|
"description": "Create a FeltKit application: npm create feltkit@latest my-app (add -- --template managed for Managed FeltDB)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -37,6 +37,6 @@
|
|
|
37
37
|
},
|
|
38
38
|
"homepage": "https://www.npmjs.com/package/create-feltkit",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@feltdb/feltkit": "0.3.
|
|
40
|
+
"@feltdb/feltkit": "0.3.22"
|
|
41
41
|
}
|
|
42
42
|
}
|
package/template/package.json
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The app shell. Sign-in, invitations, workspaces, members and account settings are FeltKit's
|
|
3
3
|
* components, driven by the foundation `feltkit create` composed; this file only arranges them.
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* <DataScreens /> is the generated screens for the entities this application composed — the records, a form
|
|
5
|
+
* that creates one, inline editing and a delete, each through the generated functions. It is regenerated when
|
|
6
|
+
* the composition changes. Your own screens go here beside it, through feltkit/_generated/api (run
|
|
7
|
+
* `npx feltkit codegen` after adding functions under feltkit/).
|
|
6
8
|
*/
|
|
7
9
|
import { useState } from "react";
|
|
10
|
+
import { DataScreens } from "../feltkit/_generated/screens.js";
|
|
8
11
|
import {
|
|
9
12
|
AcceptInvitation, AccountSettings, AuthNotices, CreateTenant, SignIn, TenantSettings, TenantSwitcher, VerifyEmailBanner,
|
|
10
13
|
useAuth, useAuthRedirect, useTenant,
|
|
11
14
|
} from "@feltdb/feltkit/react";
|
|
12
15
|
|
|
13
16
|
type View = "home" | "workspace" | "account";
|
|
17
|
+
/** "an owner", not "a owner": the role is a runtime value, so the article is chosen at runtime. */
|
|
18
|
+
const article = (word: string) => (/^[aeiou]/i.test(word) ? "an" : "a");
|
|
14
19
|
const BRAND = "foundation";
|
|
15
20
|
|
|
16
21
|
export function App() {
|
|
@@ -54,7 +59,8 @@ function Home({ role }: { role: string }) {
|
|
|
54
59
|
return (
|
|
55
60
|
<section>
|
|
56
61
|
<h1>Welcome</h1>
|
|
57
|
-
<p className="muted">You are
|
|
62
|
+
<p className="muted">You are {article(role)} {role} here. Accounts, workspaces, roles and invitations work already.</p>
|
|
63
|
+
<DataScreens />
|
|
58
64
|
</section>
|
|
59
65
|
);
|
|
60
66
|
}
|