kreftjs 0.0.5-beta → 0.0.7-beta
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 +1 -1
- package/bin/build.js +24 -2
- package/bin/kreftjs.js +1 -0
- package/bin/no-auth.js +3 -1
- package/docs/README.md +48 -2
- package/kreftjs.d.ts +1 -1
- package/kreftjs.js +2 -2
- package/package.json +1 -1
- package/templates/app/README.md +1 -1
- package/templates/app/_env.example +2 -0
- package/templates/app/frontend/errors/ErrorMonitor.kreftjs +5 -3
- package/templates/app/frontend/kreftjs.d.ts +1 -1
- package/templates/app/frontend/kreftjs.js +2 -2
- package/templates/app/frontend/layouts/app.kreftjs +7 -1
- package/templates/app/frontend/pages/Dashboard.kreftjs +4 -2
- package/templates/app/frontend/pages/Home.kreftjs +8 -7
- package/templates/errors/ErrorMonitor.kreftjs +5 -3
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ Views are escaped, logins use HttpOnly cookies with CSRF protection, passwords u
|
|
|
75
75
|
|
|
76
76
|
## Migrating from Som.js
|
|
77
77
|
|
|
78
|
-
Kreft is Som.js under a new name: the package is `kreftjs` (version 0.0.
|
|
78
|
+
Kreft is Som.js under a new name: the package is `kreftjs` (version 0.0.7-beta), the command is `kreft` (`kreftjs` works too), the global is `Kreftjs` and component files end in `.kreftjs`. The old names keep working, so an existing project runs without edits. New files and everything the tools write use the new names. Move over when it suits you. (`kreft` was an earlier spelling of the new name; it is accepted in the same places.)
|
|
79
79
|
|
|
80
80
|
| Som.js | Kreft | Still works? |
|
|
81
81
|
|---|---|---|
|
package/bin/build.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* kreft build --prerender also save every page as ready HTML (needs: npm i -D jsdom)
|
|
9
9
|
* kreft build --prerender --urls urls.js ... and the addresses in that file (pages that come from your data)
|
|
10
10
|
* kreft build --include docs also copy another folder into the output
|
|
11
|
+
* kreft build --no-htaccess do not write dist/.htaccess (the Apache / Hostinger page-address rules)
|
|
11
12
|
*
|
|
12
13
|
* What it does:
|
|
13
14
|
* 1. Compiles every .kreftjs file ahead of time into app.js (no .kreftjs files are downloaded in production).
|
|
@@ -30,14 +31,15 @@ const deps = require('./deps.js');
|
|
|
30
31
|
// component files: .kreftjs, or .kreft / .som in an older project
|
|
31
32
|
const isComp = (f) => /\.(?:kreftjs|kreft|som)$/i.test(f);
|
|
32
33
|
const SERVER_DIRS = new Set();
|
|
33
|
-
const SKIP = new Set(['node_modules', '.git', '.vscode', '.idea', 'package.json', 'package-lock.json', '.DS_Store']);
|
|
34
|
+
const SKIP = new Set(['node_modules', 'dist', 'dist-electron', '.git', '.vscode', '.idea', 'package.json', 'package-lock.json', '.DS_Store']);
|
|
34
35
|
|
|
35
36
|
module.exports = function build(args) {
|
|
36
|
-
let folder = null, out = null, base = null, prerender = null, urlsFile = null;
|
|
37
|
+
let folder = null, out = null, base = null, prerender = null, urlsFile = null, htaccess = true;
|
|
37
38
|
const include = [];
|
|
38
39
|
for (let i = 0; i < args.length; i++) {
|
|
39
40
|
if (args[i] === '--out' || args[i] === '-o') out = args[++i];
|
|
40
41
|
else if (args[i] === '--base') base = args[++i];
|
|
42
|
+
else if (args[i] === '--no-htaccess') htaccess = false;
|
|
41
43
|
else if (args[i] === '--include') include.push(args[++i]); // another folder to copy in, like the docs
|
|
42
44
|
else if (args[i] === '--prerender') prerender = args[i + 1] && !args[i + 1].startsWith('-') && args[i + 1].includes('/') ? args[++i].split(',') : [];
|
|
43
45
|
else if (args[i] === '--urls') urlsFile = args[++i]; // a file with more addresses to prerender (pages from your data)
|
|
@@ -227,6 +229,7 @@ ${indent(components.join('\n\n'))}
|
|
|
227
229
|
: html.replace(/<head>/i, `<head>\n <base href="${b}">`);
|
|
228
230
|
}
|
|
229
231
|
write(dist, 'index.html', html);
|
|
232
|
+
if (htaccess) writeHtaccess(dist, html);
|
|
230
233
|
|
|
231
234
|
const report = () => {
|
|
232
235
|
const files = walk(dist, null).map((f) => [path.relative(dist, f), fs.statSync(f).size]);
|
|
@@ -249,6 +252,25 @@ ${indent(components.join('\n\n'))}
|
|
|
249
252
|
report();
|
|
250
253
|
};
|
|
251
254
|
|
|
255
|
+
// Apache (Hostinger, cPanel …) answers /docs with a 404, because only index.html exists on disk. These rules send every address
|
|
256
|
+
// that is not a real file or folder to index.html, so reloading a page works. An .htaccess you keep in public/ is left alone;
|
|
257
|
+
// a relative base (./, as the desktop build uses) has no server and gets no file.
|
|
258
|
+
function writeHtaccess(dist, html) {
|
|
259
|
+
const m = /<base\b[^>]*\bhref="([^"]*)"/i.exec(html);
|
|
260
|
+
const base = m ? m[1] : '/';
|
|
261
|
+
if (!base.startsWith('/') || fs.existsSync(path.join(dist, '.htaccess'))) return;
|
|
262
|
+
write(dist, '.htaccess', `# Written by kreft build: every address that is not a file or a folder opens index.html (turn off: kreft build --no-htaccess)
|
|
263
|
+
<IfModule mod_rewrite.c>
|
|
264
|
+
RewriteEngine On
|
|
265
|
+
RewriteBase ${base}
|
|
266
|
+
RewriteRule ^index\\.html$ - [L]
|
|
267
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
|
268
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
|
269
|
+
RewriteRule . ${base}index.html [L]
|
|
270
|
+
</IfModule>
|
|
271
|
+
`);
|
|
272
|
+
}
|
|
273
|
+
|
|
252
274
|
// a frontend .ts file → the browser's JavaScript (types removed); its own './x.ts' imports become './x.js'
|
|
253
275
|
function tsToJs(file, project) {
|
|
254
276
|
const { transpileTs } = require('./backend/typescript.js');
|
package/bin/kreftjs.js
CHANGED
|
@@ -163,6 +163,7 @@ function help() {
|
|
|
163
163
|
--base <path> Change the <base href> (for example /)
|
|
164
164
|
--prerender [paths] Also save every page as ready HTML (needs: npm i -D jsdom)
|
|
165
165
|
--include <folder> Also copy this folder into the output (for example docs)
|
|
166
|
+
--no-htaccess Do not write dist/.htaccess (page-address rules for Apache and Hostinger)
|
|
166
167
|
kreft add <packages...> Install npm packages with strict security gatekeeper (alias: kreft install, kreft i)
|
|
167
168
|
-D, --dev Install as devDependency
|
|
168
169
|
-y, --yes Auto-confirm unverified community packages in CI/CD
|
package/bin/no-auth.js
CHANGED
|
@@ -75,6 +75,8 @@ Route.prefix('/tests').name('tests.').group(() => {
|
|
|
75
75
|
`;
|
|
76
76
|
|
|
77
77
|
const LAYOUT = (todos) => `<!-- The default layout: a slim bar and the page. Every route without .layout(…) uses it (see index.html). -->
|
|
78
|
+
state docs = (Kreftjs.env.PUBLIC_DOCS_URL || 'http://kreftjs.com').replace(/\\/+$/, '') // where "Documentation" links go: PUBLIC_DOCS_URL in .env
|
|
79
|
+
|
|
78
80
|
<view>
|
|
79
81
|
<header>
|
|
80
82
|
<kreft-link to="/" class="brand"><span class="mark" aria-hidden="true"></span>{env.PUBLIC_APP_NAME || 'My app'}</kreft-link>
|
|
@@ -83,7 +85,7 @@ const LAYOUT = (todos) => `<!-- The default layout: a slim bar and the page. Eve
|
|
|
83
85
|
<kreft-link to="/todos" exact-class="here">Todos</kreft-link>` : ''}
|
|
84
86
|
<kreft-link to="/error-monitor" exact-class="here">Error monitor</kreft-link>
|
|
85
87
|
<kreft-link to="/tests" exact-class="here">Tests</kreft-link>
|
|
86
|
-
<
|
|
88
|
+
<a href={docs + '/docs'} target="_blank" rel="noopener">Docs</a>
|
|
87
89
|
<button type="button" class="theme" @click="theme.toggle()" aria-label="Toggle theme" title="Toggle theme">
|
|
88
90
|
<span k-if="theme.dark">☀</span><span k-else>🌙</span>
|
|
89
91
|
</button>
|
package/docs/README.md
CHANGED
|
@@ -82,7 +82,7 @@ npx kreftjs dev
|
|
|
82
82
|
### Check that it works
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
|
-
kreft --version # for example 0.0.
|
|
85
|
+
kreft --version # for example 0.0.7-beta
|
|
86
86
|
kreft about # Kreft and Node.js versions, this project's settings and drivers
|
|
87
87
|
kreft list # every command your version has
|
|
88
88
|
```
|
|
@@ -1737,7 +1737,52 @@ What you get:
|
|
|
1737
1737
|
- **A strict Content-Security-Policy works.** Every expression becomes a real function, so the built app never uses `eval` or `new Function`.
|
|
1738
1738
|
- **Errors before you deploy.** A mistake in any `.kreftjs` file stops the build and names the file and line.
|
|
1739
1739
|
|
|
1740
|
-
Options: `kreft build ./site --out public` builds another folder, and `--base /` changes `<base href>`.
|
|
1740
|
+
Options: `kreft build ./site --out public` builds another folder, and `--base /` changes `<base href>`. `--no-htaccess` skips the `.htaccess` file described below.
|
|
1741
|
+
|
|
1742
|
+
### Upload to a host
|
|
1743
|
+
|
|
1744
|
+
**Static hosting: Hostinger, cPanel, any Apache host.** Upload what is *inside* `dist/` (not the `dist` folder itself) to the folder the website is served from, normally `public_html`. In Hostinger's hPanel: **Files → File Manager → public_html → Upload**, or use FTP. Do not use the "framework" or "Node.js app" importers for this: they look for a `package.json` and say *Unsupported framework or invalid project structure*, because `dist/` holds only finished files.
|
|
1745
|
+
|
|
1746
|
+
`kreft build` also writes `dist/.htaccess`:
|
|
1747
|
+
|
|
1748
|
+
```apache
|
|
1749
|
+
RewriteEngine On
|
|
1750
|
+
RewriteBase /
|
|
1751
|
+
RewriteRule ^index\.html$ - [L]
|
|
1752
|
+
RewriteCond %{REQUEST_FILENAME} !-f
|
|
1753
|
+
RewriteCond %{REQUEST_FILENAME} !-d
|
|
1754
|
+
RewriteRule . /index.html [L]
|
|
1755
|
+
```
|
|
1756
|
+
|
|
1757
|
+
Apache only knows the files on disk, so without these rules `/docs` or any other clean address gives a 404 when someone opens or reloads it. With them, every address that is not a real file or folder opens `index.html` and the router takes over. Upload the file too (it starts with a dot, so some file managers hide it; turn on "show hidden files"). If the site lives in a folder, build with `--base /folder/` and the rules follow it. An `.htaccess` you keep in `public/` is used as it is. A relative base (`--base ./`, used by the desktop build) gets no file.
|
|
1758
|
+
|
|
1759
|
+
> [!NOTE]
|
|
1760
|
+
> This hosts the front end only. Login, the database and everything under `/api` need the Node.js server, which Apache does not run.
|
|
1761
|
+
|
|
1762
|
+
**A Node.js plan or a VPS.** Upload the whole project (without `node_modules`), not `dist/`. Add Kreft to its dependencies with `npm i kreftjs`, build with `npm run build`, and start the server with `npm run serve` (it reads the `PORT` your host sets). The generated `start` script runs the development server, so do not use it in production.
|
|
1763
|
+
|
|
1764
|
+
|
|
1765
|
+
On a VPS, keep it running with PM2 and put nginx in front of it for your domain and HTTPS:
|
|
1766
|
+
|
|
1767
|
+
```bash
|
|
1768
|
+
npm install && npm run build
|
|
1769
|
+
npm i -g pm2
|
|
1770
|
+
pm2 start "npm run serve" --name my-app && pm2 save
|
|
1771
|
+
```
|
|
1772
|
+
|
|
1773
|
+
```nginx
|
|
1774
|
+
server {
|
|
1775
|
+
server_name example.com;
|
|
1776
|
+
location / {
|
|
1777
|
+
proxy_pass http://127.0.0.1:8000;
|
|
1778
|
+
proxy_set_header Host $host;
|
|
1779
|
+
proxy_set_header X-Forwarded-Proto $scheme;
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
```
|
|
1783
|
+
|
|
1784
|
+
Then `sudo certbot --nginx -d example.com` adds HTTPS. Set `APP_ENV=production` and a real `APP_KEY` in `.env` first, and read the [Production checklist](#production-checklist).
|
|
1785
|
+
|
|
1741
1786
|
|
|
1742
1787
|
### Ready HTML for every page: `--prerender`
|
|
1743
1788
|
|
|
@@ -2222,6 +2267,7 @@ Set these in `.env` (never commit it). Variables that start with `PUBLIC_` are c
|
|
|
2222
2267
|
| `LOGIN_MAX_FAILURES`, `LOGIN_WINDOW_SECONDS` | 10, 900 | Wrong passwords per account before a lockout. |
|
|
2223
2268
|
| `TWO_FACTOR_MAX_FAILURES` | 8 | Wrong two-factor codes per account before a lockout. |
|
|
2224
2269
|
| `PUBLIC_SESSION_TIMEOUT`, `PUBLIC_SESSION_WARNING` | 15, 2 | Minutes of page inactivity before sign-out, and the warning before it. |
|
|
2270
|
+
| `PUBLIC_DOCS_URL` | `http://kreftjs.com` | Where the "Documentation" links of a new app's pages go. Change it to `https://…` or to your own site. |
|
|
2225
2271
|
|
|
2226
2272
|
### Network and tools
|
|
2227
2273
|
|
package/kreftjs.d.ts
CHANGED
package/kreftjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Kreft v0.0.
|
|
2
|
+
* Kreft v0.0.7-beta — reactive by nature
|
|
3
3
|
* The .kreftjs component language (state · derive · action · when · watch · on),
|
|
4
4
|
* { } views with k-if / k-each / k-model, components, slots, router, stores,
|
|
5
5
|
* share / receive, event bus and a template engine.
|
|
@@ -5032,7 +5032,7 @@
|
|
|
5032
5032
|
stores, storeLog, busLog,
|
|
5033
5033
|
};
|
|
5034
5034
|
|
|
5035
|
-
const VERSION = '0.0.
|
|
5035
|
+
const VERSION = '0.0.7-beta';
|
|
5036
5036
|
const Kreftjs = {
|
|
5037
5037
|
version: VERSION,
|
|
5038
5038
|
// PUBLIC_ values from .env (kreft dev and kreft build put them here); never secrets
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kreftjs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7-beta",
|
|
4
4
|
"description": "A tiny reactive framework with its own component language (.kreftjs files): router with nested routes, stores, saved data, animations, an API client, hot reload, DevTools and a template engine.",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
6
|
"main": "kreftjs.js",
|
package/templates/app/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Your project cleanly isolates client-side UI (`frontend/`) from server-side busi
|
|
|
28
28
|
│ ├── pages/ # Route views (Home, Dashboard, Users, Profile, auth/*)
|
|
29
29
|
│ ├── components/ # Reusable widgets (Field.kreftjs, StatCard.kreftjs, profile/*)
|
|
30
30
|
│ ├── errors/ # Custom HTTP error views (404.kreftjs, 500.kreftjs, ErrorMonitor.kreftjs)
|
|
31
|
-
│ ├── docs/ # Built-in documentation (
|
|
31
|
+
│ ├── docs/ # Built-in copy of the documentation (at /docs); the pages link to PUBLIC_DOCS_URL, http://kreftjs.com
|
|
32
32
|
│ └── ui.css # Design system tokens & component styles
|
|
33
33
|
│
|
|
34
34
|
├── backend/ # Private server engine (never exposed or built into dist/)
|
|
@@ -11,6 +11,8 @@ APP_URL=http://localhost:8000
|
|
|
11
11
|
# Only values that start with PUBLIC_ also reach the browser: {env.PUBLIC_APP_NAME} in any .kreftjs file.
|
|
12
12
|
# Never put a password or a secret key in a PUBLIC_ value.
|
|
13
13
|
PUBLIC_APP_NAME="${APP_NAME}"
|
|
14
|
+
# Where the "Documentation" links of the pages go
|
|
15
|
+
PUBLIC_DOCS_URL="http://kreftjs.com"
|
|
14
16
|
|
|
15
17
|
# The database: sqlite:file.db, mysql://user:password@host:3306/name or postgres://user:password@host:5432/name
|
|
16
18
|
DATABASE_URL=sqlite:backend/database/app.db
|
|
@@ -82,6 +82,8 @@ action copyReport() {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
state docs = (Kreftjs.env.PUBLIC_DOCS_URL || 'http://kreftjs.com').replace(/\/+$/, '') // where "Documentation" links go: PUBLIC_DOCS_URL in .env
|
|
86
|
+
|
|
85
87
|
<view>
|
|
86
88
|
<div class="kreft-inspector">
|
|
87
89
|
<!-- Header Card -->
|
|
@@ -90,11 +92,11 @@ action copyReport() {
|
|
|
90
92
|
<div class="badges">
|
|
91
93
|
<span class="badge danger-badge">HTTP {status}</span>
|
|
92
94
|
<span class="badge solid">{currentTitle}</span>
|
|
93
|
-
<span class="badge">Kreft {Kreftjs.version || '0.0.
|
|
95
|
+
<span class="badge">Kreft {Kreftjs.version || '0.0.7-beta'}</span>
|
|
94
96
|
</div>
|
|
95
97
|
<div class="actions">
|
|
96
98
|
<button class="sm" @click={copyReport}>{copied ? 'Copied Markdown' : 'Copy Report'}</button>
|
|
97
|
-
<
|
|
99
|
+
<a href={docs + '/docs'} class="btn sm ghost" target="_blank" rel="noopener">Docs</a>
|
|
98
100
|
</div>
|
|
99
101
|
</div>
|
|
100
102
|
|
|
@@ -187,7 +189,7 @@ action copyReport() {
|
|
|
187
189
|
<h3>Kreft Runtime</h3>
|
|
188
190
|
<table>
|
|
189
191
|
<tbody>
|
|
190
|
-
<tr><th>Engine</th><td><code>Kreft v{Kreftjs.version || '0.0.
|
|
192
|
+
<tr><th>Engine</th><td><code>Kreft v{Kreftjs.version || '0.0.7-beta'}</code></td></tr>
|
|
191
193
|
<tr><th>Sanitizer</th><td><code>Active (cleanHtml / SafeHtml)</code></td></tr>
|
|
192
194
|
<tr><th>Environment</th><td><code>development (APP_DEBUG=true)</code></td></tr>
|
|
193
195
|
</tbody>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Kreft v0.0.
|
|
2
|
+
* Kreft v0.0.7-beta — reactive by nature
|
|
3
3
|
* The .kreftjs component language (state · derive · action · when · watch · on),
|
|
4
4
|
* { } views with k-if / k-each / k-model, components, slots, router, stores,
|
|
5
5
|
* share / receive, event bus and a template engine.
|
|
@@ -5032,7 +5032,7 @@
|
|
|
5032
5032
|
stores, storeLog, busLog,
|
|
5033
5033
|
};
|
|
5034
5034
|
|
|
5035
|
-
const VERSION = '0.0.
|
|
5035
|
+
const VERSION = '0.0.7-beta';
|
|
5036
5036
|
const Kreftjs = {
|
|
5037
5037
|
version: VERSION,
|
|
5038
5038
|
// PUBLIC_ values from .env (kreft dev and kreft build put them here); never secrets
|
|
@@ -11,6 +11,7 @@ state remainingMinutes = 5
|
|
|
11
11
|
state inactivityTimer = null
|
|
12
12
|
|
|
13
13
|
// SVG vector icon paths (24x24)
|
|
14
|
+
state docs = (Kreftjs.env.PUBLIC_DOCS_URL || 'http://kreftjs.com').replace(/\/+$/, '') // where "Documentation" links go: PUBLIC_DOCS_URL in .env
|
|
14
15
|
state icons = {
|
|
15
16
|
dashboard: 'M3 13h8V3H3v10zm0 8h8v-6H3v6zm10 0h8V11h-8v10zm0-18v6h8V3h-8z',
|
|
16
17
|
users: 'M16 19v-1a4 4 0 0 0-4-4H7a4 4 0 0 0-4 4v1M9.5 10a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7M21 19v-1a4 4 0 0 0-3-3.87M15.5 3.13a3.5 3.5 0 0 1 0 6.75',
|
|
@@ -33,7 +34,7 @@ state navGroups = [
|
|
|
33
34
|
{ label: 'Platform', links: [
|
|
34
35
|
{ to: 'welcome', label: 'Showcase', icon: 'showcase' },
|
|
35
36
|
{ to: 'error-monitor', label: 'Error Monitor', icon: 'panel' },
|
|
36
|
-
{
|
|
37
|
+
{ docs: '/docs', label: 'Documentation', icon: 'docs' },
|
|
37
38
|
{ to: 'tests.index', label: 'Test Suite', icon: 'tests' },
|
|
38
39
|
] },
|
|
39
40
|
]
|
|
@@ -130,7 +131,12 @@ action extendSession() {
|
|
|
130
131
|
<ul class="nav-list">
|
|
131
132
|
{for link in group.links}
|
|
132
133
|
<li>
|
|
134
|
+
<a k-if="link.docs" href={docs + link.docs} target="_blank" rel="noopener" title={collapsed ? link.label : null} class="nav-item">
|
|
135
|
+
<svg viewBox="0 0 24 24" aria-hidden="true" class="nav-icon"><path d={icons[link.icon] || icons.panel}></path></svg>
|
|
136
|
+
<span class="nav-label">{link.label}</span>
|
|
137
|
+
</a>
|
|
133
138
|
<kreft-link
|
|
139
|
+
k-else
|
|
134
140
|
to={link.to}
|
|
135
141
|
exact-class={link.exact ? 'active-link' : 'kreft-link-exact'}
|
|
136
142
|
active-class={link.exact ? 'kreft-link-active' : 'active-link'}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
load stats = api.get('/api/admin/stats')
|
|
6
6
|
load board = api.get('/api/dashboard')
|
|
7
7
|
|
|
8
|
+
state docs = (Kreftjs.env.PUBLIC_DOCS_URL || 'http://kreftjs.com').replace(/\/+$/, '') // where "Documentation" links go: PUBLIC_DOCS_URL in .env
|
|
9
|
+
|
|
8
10
|
<view>
|
|
9
11
|
<div class="dashboard-page">
|
|
10
12
|
<div class="dashboard-header">
|
|
@@ -110,7 +112,7 @@ load board = api.get('/api/dashboard')
|
|
|
110
112
|
<div class="info-list">
|
|
111
113
|
<div class="info-item">
|
|
112
114
|
<span class="info-label">Framework Engine</span>
|
|
113
|
-
<span class="info-value">Kreft {Kreftjs.version || '0.0.
|
|
115
|
+
<span class="info-value">Kreft {Kreftjs.version || '0.0.7-beta'}</span>
|
|
114
116
|
</div>
|
|
115
117
|
<div class="info-item">
|
|
116
118
|
<span class="info-label">Active Database</span>
|
|
@@ -128,7 +130,7 @@ load board = api.get('/api/dashboard')
|
|
|
128
130
|
|
|
129
131
|
<div class="quick-nav-group">
|
|
130
132
|
<kreft-link to="/profile" class="btn secondary sm w-full">Edit Profile Settings</kreft-link>
|
|
131
|
-
<
|
|
133
|
+
<a href={docs + '/docs'} class="btn ghost sm w-full" target="_blank" rel="noopener">API Documentation</a>
|
|
132
134
|
<kreft-link to="/welcome" class="btn ghost sm w-full">Landing Page Showcase</kreft-link>
|
|
133
135
|
</div>
|
|
134
136
|
</section>
|
|
@@ -6,6 +6,7 @@ state count = 0
|
|
|
6
6
|
state copied = false
|
|
7
7
|
derive double = count * 2
|
|
8
8
|
|
|
9
|
+
state docs = (Kreftjs.env.PUBLIC_DOCS_URL || 'http://kreftjs.com').replace(/\/+$/, '') // where "Documentation" links go: PUBLIC_DOCS_URL in .env
|
|
9
10
|
state words = [
|
|
10
11
|
{ word: 'state', says: 'a value that can change', to: '/docs#components-and-the-kreftjs-file' },
|
|
11
12
|
{ word: 'saved', says: 'a value kept after a reload', to: '/docs#saving-data-in-the-browser' },
|
|
@@ -49,7 +50,7 @@ action copy() {
|
|
|
49
50
|
<header class="site-bar">
|
|
50
51
|
<kreft-link to="/" class="site-brand"><span class="site-mark" aria-hidden="true"></span>{env.PUBLIC_APP_NAME || 'Kreft'}</kreft-link>
|
|
51
52
|
<nav class="site-nav">
|
|
52
|
-
<
|
|
53
|
+
<a href={docs + '/docs'} target="_blank" rel="noopener">Documentation</a>
|
|
53
54
|
<kreft-link k-if="$store.auth.user" to="/dashboard">Dashboard</kreft-link>
|
|
54
55
|
<kreft-link k-if="!$store.auth.user" to="/login">Log in</kreft-link>
|
|
55
56
|
<kreft-link k-if="!$store.auth.user" to="/register" class="site-cta">Sign up</kreft-link>
|
|
@@ -77,10 +78,10 @@ action copy() {
|
|
|
77
78
|
|
|
78
79
|
<!-- CTA Buttons -->
|
|
79
80
|
<div class="cta-actions">
|
|
80
|
-
<
|
|
81
|
+
<a href={docs + '/docs'} class="pill-btn primary" target="_blank" rel="noopener">Read the docs</a>
|
|
81
82
|
<kreft-link k-if="$store.auth.user" to="/dashboard" class="pill-btn ghost">Open dashboard</kreft-link>
|
|
82
83
|
<kreft-link k-if="!$store.auth.user" to="/register" class="pill-btn ghost">Sign up</kreft-link>
|
|
83
|
-
<
|
|
84
|
+
<a href={docs + '/docs#your-first-app'} class="pill-btn ghost" target="_blank" rel="noopener">Quick start</a>
|
|
84
85
|
</div>
|
|
85
86
|
|
|
86
87
|
<!-- Badges Row -->
|
|
@@ -177,7 +178,7 @@ action copy() {
|
|
|
177
178
|
<h2>The whole language fits on one screen</h2>
|
|
178
179
|
<dl>
|
|
179
180
|
{for w in words key w.word}
|
|
180
|
-
<div><dt><
|
|
181
|
+
<div><dt><a href={docs + w.to} target="_blank" rel="noopener">{w.word}</a></dt><dd>{w.says}</dd></div>
|
|
181
182
|
{/for}
|
|
182
183
|
</dl>
|
|
183
184
|
</section>
|
|
@@ -186,7 +187,7 @@ action copy() {
|
|
|
186
187
|
<h2>Also in the box</h2>
|
|
187
188
|
<ul>
|
|
188
189
|
{for p in parts key p.title}
|
|
189
|
-
<li><
|
|
190
|
+
<li><a href={docs + p.to} target="_blank" rel="noopener"><strong>{p.title}</strong><span>{p.text}</span></a></li>
|
|
190
191
|
{/for}
|
|
191
192
|
</ul>
|
|
192
193
|
</section>
|
|
@@ -197,12 +198,12 @@ action copy() {
|
|
|
197
198
|
<code>kreft new my-app --db sqlite</code>
|
|
198
199
|
<button class="sm" @click={copy} aria-label="Copy the command">{copied ? 'Copied' : 'Copy'}</button>
|
|
199
200
|
</div>
|
|
200
|
-
<p>Then <code>cd my-app</code> and <code>npm run dev</code>. Coming from Vue? The <
|
|
201
|
+
<p>Then <code>cd my-app</code> and <code>npm run dev</code>. Coming from Vue? The <a href={docs + '/docs'} target="_blank" rel="noopener">docs</a> have a table with the Kreft name for every Vue feature.</p>
|
|
201
202
|
</section>
|
|
202
203
|
|
|
203
204
|
<footer class="site-foot">
|
|
204
205
|
<span>Kreft {Kreftjs.version}</span>
|
|
205
|
-
<
|
|
206
|
+
<a href={docs + '/docs'} target="_blank" rel="noopener">Docs</a>
|
|
206
207
|
<kreft-link to="/error-monitor">Error monitor</kreft-link>
|
|
207
208
|
</footer>
|
|
208
209
|
</div>
|
|
@@ -79,6 +79,8 @@ action copyReport() {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
+
state docs = (Kreftjs.env.PUBLIC_DOCS_URL || 'http://kreftjs.com').replace(/\/+$/, '') // where "Documentation" links go: PUBLIC_DOCS_URL in .env
|
|
83
|
+
|
|
82
84
|
<view>
|
|
83
85
|
<div class="error-monitor-wrapper">
|
|
84
86
|
<!-- Top Navigation Bar -->
|
|
@@ -99,10 +101,10 @@ action copyReport() {
|
|
|
99
101
|
</div>
|
|
100
102
|
|
|
101
103
|
<div class="nav-meta">
|
|
102
|
-
<
|
|
104
|
+
<a href={docs + '/docs'} class="nav-link-docs" target="_blank" rel="noopener">
|
|
103
105
|
<span class="tab-icon">📖</span>
|
|
104
106
|
<span>DOCS</span>
|
|
105
|
-
</
|
|
107
|
+
</a>
|
|
106
108
|
<button class="btn-copy-report" @click={copyReport}>
|
|
107
109
|
{copiedToast ? '✓ Copied' : 'Copy Report'}
|
|
108
110
|
</button>
|
|
@@ -116,7 +118,7 @@ action copyReport() {
|
|
|
116
118
|
<div class="hero-badges">
|
|
117
119
|
<span class="badge-exception">{currentTitle}</span>
|
|
118
120
|
<span class="badge-env">Node.js {typeof process !== 'undefined' ? process.version : 'v22.0.0'}</span>
|
|
119
|
-
<span class="badge-env">Kreft v0.0.
|
|
121
|
+
<span class="badge-env">Kreft v0.0.7-beta</span>
|
|
120
122
|
</div>
|
|
121
123
|
<h1 class="hero-error-message">{currentMessage}</h1>
|
|
122
124
|
</div>
|