kreftjs 0.0.6-beta → 0.0.9-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 +5 -31
- package/bin/artisan-more.js +2 -0
- package/bin/artisan.js +51 -49
- package/bin/backend/config.js +2 -2
- package/bin/backend/http.js +5 -5
- package/bin/backend/index.js +2 -2
- package/bin/backend/mcp.js +3 -5
- package/bin/backend/migrator.js +1 -3
- package/bin/backend/query.js +1 -1
- package/bin/backend/queue.js +8 -9
- package/bin/backend/redis.js +1 -1
- package/bin/backend/typescript.js +1 -1
- package/bin/build.js +23 -19
- package/bin/db-api.js +2 -2
- package/bin/db.js +4 -4
- package/bin/deps.js +1 -1
- package/bin/electron.js +3 -5
- package/bin/kreftjs-config.js +1 -6
- package/bin/kreftjs.js +34 -35
- package/bin/layout.js +1 -1
- package/bin/no-auth.js +21 -19
- package/bin/prerender.js +1 -1
- package/bin/ssr.js +3 -3
- package/bin/update.js +10 -10
- package/docs/{Docs.kreftjs → Docs.kreft} +1 -1
- package/docs/README.md +90 -102
- package/editors/vscode/README.md +3 -3
- package/editors/vscode/package.json +3 -4
- package/editors/vscode/snippets/kreftjs.json +2 -2
- package/kreftjs.d.ts +15 -27
- package/kreftjs.js +69 -79
- package/package.json +4 -4
- package/templates/app/README.md +11 -11
- package/templates/app/_env.example +4 -2
- package/templates/app/_vscode/settings.json +3 -2
- package/templates/app/backend/app/Http/Controllers/Admin/DashboardController.js +2 -2
- package/templates/app/backend/app/Http/Controllers/Admin/UserController.js +1 -1
- package/templates/app/backend/app/Http/Controllers/Auth/ApiTokenController.js +1 -1
- package/templates/app/backend/app/Http/Controllers/Auth/AuthenticatedSessionController.js +1 -1
- package/templates/app/backend/app/Http/Controllers/Auth/ConfirmablePasswordController.js +1 -1
- package/templates/app/backend/app/Http/Controllers/Auth/EmailVerificationController.js +1 -1
- package/templates/app/backend/app/Http/Controllers/Auth/NewPasswordController.js +1 -1
- package/templates/app/backend/app/Http/Controllers/Auth/PasswordResetLinkController.js +1 -1
- package/templates/app/backend/app/Http/Controllers/Auth/RegisteredUserController.js +1 -1
- package/templates/app/backend/app/Http/Controllers/Auth/SessionController.js +1 -1
- package/templates/app/backend/app/Http/Controllers/Auth/TwoFactorController.js +1 -1
- package/templates/app/backend/app/Http/Controllers/ProfileController.js +1 -1
- package/templates/app/backend/app/Http/Middleware/RequirePassword.js +1 -1
- package/templates/app/frontend/{App.kreftjs → App.kreft} +1 -1
- package/templates/app/frontend/components/profile/{ApiTokens.kreftjs → ApiTokens.kreft} +1 -1
- package/templates/app/frontend/components/profile/{Sessions.kreftjs → Sessions.kreft} +1 -1
- package/templates/app/frontend/components/profile/{TwoFactor.kreftjs → TwoFactor.kreft} +1 -1
- package/templates/app/frontend/errors/{ErrorMonitor.kreftjs → ErrorMonitor.kreft} +6 -4
- package/templates/app/frontend/index.html +8 -8
- package/templates/app/frontend/kreftjs.d.ts +15 -27
- package/templates/app/frontend/kreftjs.js +69 -79
- package/templates/app/frontend/layouts/{app.kreftjs → app.kreft} +7 -1
- package/templates/app/frontend/layouts/{docs.kreftjs → docs.kreft} +1 -1
- package/templates/app/frontend/pages/{Dashboard.kreftjs → Dashboard.kreft} +4 -2
- package/templates/app/frontend/pages/{ErrorMonitor.kreftjs → ErrorMonitor.kreft} +2 -2
- package/templates/app/frontend/pages/{Home.kreftjs → Home.kreft} +10 -9
- package/templates/app/frontend/pages/{Profile.kreftjs → Profile.kreft} +3 -3
- package/templates/app/frontend/routes/web.kreft +34 -0
- package/templates/app/frontend/tests/components/{Counter.kreftjs → Counter.kreft} +1 -1
- package/templates/app/frontend/tests/pages/About.kreft +12 -0
- package/templates/app/frontend/tests/pages/{Test.kreftjs → Test.kreft} +1 -1
- package/templates/errors/{401.kreftjs → 401.kreft} +2 -2
- package/templates/errors/{402.kreftjs → 402.kreft} +2 -2
- package/templates/errors/{403.kreftjs → 403.kreft} +2 -2
- package/templates/errors/{404.kreftjs → 404.kreft} +2 -2
- package/templates/errors/{419.kreftjs → 419.kreft} +2 -2
- package/templates/errors/{429.kreftjs → 429.kreft} +2 -2
- package/templates/errors/{500.kreftjs → 500.kreft} +2 -2
- package/templates/errors/{503.kreftjs → 503.kreft} +2 -2
- package/templates/errors/{ErrorMonitor.kreftjs → ErrorMonitor.kreft} +17 -14
- package/templates/errors/{error.kreftjs → error.kreft} +2 -2
- package/templates/errors/{minimal.kreftjs → minimal.kreft} +1 -1
- package/tools/dev-client.js +2 -2
- package/tools/vite-plugin-kreftjs.d.ts +3 -5
- package/tools/vite-plugin-kreftjs.js +12 -14
- package/templates/app/frontend/routes/web.kreftjs +0 -34
- package/templates/app/frontend/tests/pages/About.kreftjs +0 -12
- /package/templates/app/frontend/components/{Field.kreftjs → Field.kreft} +0 -0
- /package/templates/app/frontend/components/{StatCard.kreftjs → StatCard.kreft} +0 -0
- /package/templates/app/frontend/layouts/{guest.kreftjs → guest.kreft} +0 -0
- /package/templates/app/frontend/pages/{Users.kreftjs → Users.kreft} +0 -0
- /package/templates/app/frontend/pages/auth/{ConfirmPassword.kreftjs → ConfirmPassword.kreft} +0 -0
- /package/templates/app/frontend/pages/auth/{ForgotPassword.kreftjs → ForgotPassword.kreft} +0 -0
- /package/templates/app/frontend/pages/auth/{Login.kreftjs → Login.kreft} +0 -0
- /package/templates/app/frontend/pages/auth/{Register.kreftjs → Register.kreft} +0 -0
- /package/templates/app/frontend/pages/auth/{ResetPassword.kreftjs → ResetPassword.kreft} +0 -0
- /package/templates/app/frontend/pages/auth/{VerifyEmail.kreftjs → VerifyEmail.kreft} +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!-- /tests/about: a second test page. Add more: a .kreft file here, then one line in the routes in index.html. -->
|
|
2
|
+
<view>
|
|
3
|
+
<section class="page">
|
|
4
|
+
<h1>About</h1>
|
|
5
|
+
<p class="lead">Edit <code>tests/pages/About.kreft</code> and save: the page updates by itself.</p>
|
|
6
|
+
<p><kreft-link to="/tests">Back to the test pages</kreft-link></p>
|
|
7
|
+
</section>
|
|
8
|
+
</view>
|
|
9
|
+
|
|
10
|
+
<style scoped>
|
|
11
|
+
.page { padding: 40px 0; max-width: 40em; }
|
|
12
|
+
</style>
|
|
@@ -10,7 +10,7 @@ load hello = api.get('/api/hello', { query: { name: name || undefined } })
|
|
|
10
10
|
|
|
11
11
|
<div class="card">
|
|
12
12
|
<h2>A component</h2>
|
|
13
|
-
<p class="muted"><code>tests/components/Counter.
|
|
13
|
+
<p class="muted"><code>tests/components/Counter.kreft</code></p>
|
|
14
14
|
<counter start={1}></counter>
|
|
15
15
|
</div>
|
|
16
16
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!-- errors/401.
|
|
2
|
-
layout 'errors/minimal.
|
|
1
|
+
<!-- errors/401.kreft: shown after abort(401), for example when the API says the visitor isn't signed in. Change the words as you like. -->
|
|
2
|
+
layout 'errors/minimal.kreft'
|
|
3
3
|
prop status = 401
|
|
4
4
|
prop title = ''
|
|
5
5
|
prop message = ''
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!-- errors/402.
|
|
2
|
-
layout 'errors/minimal.
|
|
1
|
+
<!-- errors/402.kreft: shown after abort(402). Change the words as you like. -->
|
|
2
|
+
layout 'errors/minimal.kreft'
|
|
3
3
|
prop status = 402
|
|
4
4
|
prop title = ''
|
|
5
5
|
prop message = ''
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!-- errors/403.
|
|
2
|
-
layout 'errors/minimal.
|
|
1
|
+
<!-- errors/403.kreft: shown after abort(403), or abort(403, 'Only the owner can see this.'). Change the words as you like. -->
|
|
2
|
+
layout 'errors/minimal.kreft'
|
|
3
3
|
prop status = 403
|
|
4
4
|
prop title = ''
|
|
5
5
|
prop message = ''
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!-- errors/404.
|
|
2
|
-
layout 'errors/minimal.
|
|
1
|
+
<!-- errors/404.kreft: shown for an address no route knows, and after abort(404). Change the words as you like. -->
|
|
2
|
+
layout 'errors/minimal.kreft'
|
|
3
3
|
prop status = 404
|
|
4
4
|
prop title = ''
|
|
5
5
|
prop message = ''
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!-- errors/419.
|
|
2
|
-
layout 'errors/minimal.
|
|
1
|
+
<!-- errors/419.kreft: shown after abort(419), for example when the CSRF token is too old. Change the words as you like. -->
|
|
2
|
+
layout 'errors/minimal.kreft'
|
|
3
3
|
prop status = 419
|
|
4
4
|
prop title = ''
|
|
5
5
|
prop message = ''
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!-- errors/429.
|
|
2
|
-
layout 'errors/minimal.
|
|
1
|
+
<!-- errors/429.kreft: shown after abort(429). Change the words as you like. -->
|
|
2
|
+
layout 'errors/minimal.kreft'
|
|
3
3
|
prop status = 429
|
|
4
4
|
prop title = ''
|
|
5
5
|
prop message = ''
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!-- errors/500.
|
|
2
|
-
layout 'errors/minimal.
|
|
1
|
+
<!-- errors/500.kreft: shown when a page can't be loaded, and after abort(500). The details are in the browser console. Change the words as you like. -->
|
|
2
|
+
layout 'errors/minimal.kreft'
|
|
3
3
|
prop status = 500
|
|
4
4
|
prop title = ''
|
|
5
5
|
prop message = ''
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!-- errors/503.
|
|
2
|
-
layout 'errors/minimal.
|
|
1
|
+
<!-- errors/503.kreft: shown after abort(503), for example during maintenance. Change the words as you like. -->
|
|
2
|
+
layout 'errors/minimal.kreft'
|
|
3
3
|
prop status = 503
|
|
4
4
|
prop title = ''
|
|
5
5
|
prop message = ''
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
-
ErrorMonitor.
|
|
2
|
+
ErrorMonitor.kreft: Enterprise-Grade Interactive Error Monitoring & Debugging UI for Kreft
|
|
3
3
|
Provides stack traces, interactive code inspectors, context variables, and smart solution suggestions.
|
|
4
4
|
-->
|
|
5
5
|
prop error = null
|
|
@@ -18,12 +18,12 @@ state copiedToast = false
|
|
|
18
18
|
derive currentTitle = title || (error && error.name) || 'UnhandledException'
|
|
19
19
|
derive currentMessage = message || (error && error.message) || 'An unexpected error occurred during execution.'
|
|
20
20
|
derive frameList = (frames && frames.length) ? frames : (error && error.frames ? error.frames : [
|
|
21
|
-
{ fn: 'HomeController.__invoke', file: 'app/Http/Controllers/Discovery/HomeController.
|
|
21
|
+
{ fn: 'HomeController.__invoke', file: 'app/Http/Controllers/Discovery/HomeController.kreft', line: 14, col: 5, isApp: true, snippet: [
|
|
22
22
|
{ num: 10, code: 'class HomeController {' },
|
|
23
23
|
{ num: 11, code: ' action index() {' },
|
|
24
24
|
{ num: 12, code: ' // Query active records' },
|
|
25
25
|
{ num: 13, code: ' load posts = Post.qquery()' },
|
|
26
|
-
{ num: 14, code: ' return view("pages/Home.
|
|
26
|
+
{ num: 14, code: ' return view("pages/Home.kreft", { posts })', isTarget: true },
|
|
27
27
|
{ num: 15, code: ' }' },
|
|
28
28
|
{ num: 16, code: '}' }
|
|
29
29
|
]},
|
|
@@ -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.9-beta</span>
|
|
120
122
|
</div>
|
|
121
123
|
<h1 class="hero-error-message">{currentMessage}</h1>
|
|
122
124
|
</div>
|
|
@@ -141,14 +143,15 @@ action copyReport() {
|
|
|
141
143
|
</div>
|
|
142
144
|
|
|
143
145
|
<div class="frames-list">
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
146
|
+
{for (frame, idx) in frameList}
|
|
147
|
+
<div
|
|
148
|
+
k-if="frame.isApp || showAllVendorFrames"
|
|
149
|
+
class={'frame-card' + (selectedFrameIndex === idx ? ' active' : '') + (frame.isApp ? ' is-app' : ' is-vendor')}
|
|
150
|
+
@click="selectFrame(idx)">
|
|
151
|
+
<div class="frame-file-line">{frame.file}:{frame.line || 1}</div>
|
|
152
|
+
<div class="frame-fn-name">{frame.fn || '<anonymous>'}</div>
|
|
153
|
+
</div>
|
|
154
|
+
{/for}
|
|
152
155
|
</div>
|
|
153
156
|
</aside>
|
|
154
157
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<!-- errors/error.
|
|
2
|
-
layout 'errors/minimal.
|
|
1
|
+
<!-- errors/error.kreft: any other status, like abort(409) or abort(422, 'That name is taken.') -->
|
|
2
|
+
layout 'errors/minimal.kreft'
|
|
3
3
|
prop status = 400
|
|
4
4
|
prop title = 'Error'
|
|
5
5
|
prop message = ''
|
package/tools/dev-client.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* Kreft dev client — `kreftjs dev` adds this to every page while you work.
|
|
3
|
-
* • hot reload: a changed .
|
|
3
|
+
* • hot reload: a changed .kreft file is swapped in place and keeps its state;
|
|
4
4
|
* a changed .css file is reloaded; anything else reloads the page
|
|
5
|
-
* • error overlay: .
|
|
5
|
+
* • error overlay: .kreft mistakes and runtime errors show on the page
|
|
6
6
|
* • DevTools: the "K" button (or Alt+Shift+D) opens the Kreft DevTools panel
|
|
7
7
|
* Not part of your app: `kreftjs build` never includes it.
|
|
8
8
|
*/
|
|
@@ -3,7 +3,7 @@ import type { Plugin } from 'vite';
|
|
|
3
3
|
export interface KreftPluginOptions {
|
|
4
4
|
/**
|
|
5
5
|
* Include filter pattern (RegExp, glob or string).
|
|
6
|
-
* @default /\.
|
|
6
|
+
* @default /\.kreft$/
|
|
7
7
|
*/
|
|
8
8
|
include?: string | RegExp | (string | RegExp)[];
|
|
9
9
|
|
|
@@ -21,7 +21,7 @@ export interface KreftPluginOptions {
|
|
|
21
21
|
precompile?: boolean;
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
|
-
* Enable Hot Module Replacement (HMR) for .
|
|
24
|
+
* Enable Hot Module Replacement (HMR) for .kreft components while preserving component state.
|
|
25
25
|
* @default true
|
|
26
26
|
*/
|
|
27
27
|
hmr?: boolean;
|
|
@@ -29,7 +29,7 @@ export interface KreftPluginOptions {
|
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Official Vite plugin for Kreft.
|
|
32
|
-
* Provides compilation of .
|
|
32
|
+
* Provides compilation of .kreft Single File Components, scoped CSS extraction,
|
|
33
33
|
* route file transformation, and state-preserving Hot Module Replacement.
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
@@ -47,6 +47,4 @@ export function kreftjs(options?: KreftPluginOptions): Plugin;
|
|
|
47
47
|
/** the earlier name of `kreftjs` */
|
|
48
48
|
export function kreft(options?: KreftPluginOptions): Plugin;
|
|
49
49
|
export function kreftPlugin(options?: KreftPluginOptions): Plugin;
|
|
50
|
-
/** @deprecated the Som.js name of `kreftjs` */
|
|
51
|
-
export function som(options?: KreftPluginOptions): Plugin;
|
|
52
50
|
export default kreftjs;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Kreft Vite Plugin
|
|
3
3
|
*
|
|
4
4
|
* Full-featured Vite.js support for Kreft:
|
|
5
|
-
* • Compiles .
|
|
5
|
+
* • Compiles .kreft components into native ES modules
|
|
6
6
|
* • Scoped CSS (<style scoped>) extracted into Vite virtual CSS modules with instant HMR
|
|
7
|
-
* • Route files (routes/*.
|
|
7
|
+
* • Route files (routes/*.kreft) automatically transformed and registered
|
|
8
8
|
* • Component HMR preserves live state and reactivity
|
|
9
9
|
* • Precompiles view expressions ahead of time (zero eval / CSP-safe)
|
|
10
|
-
* • Automatically resolves and aliases 'kreftjs' (and 'kreft'
|
|
10
|
+
* • Automatically resolves and aliases 'kreftjs' (and 'kreft', the earlier name)
|
|
11
11
|
*
|
|
12
12
|
* Usage (vite.config.js):
|
|
13
13
|
* import { defineConfig } from 'vite';
|
|
@@ -186,10 +186,10 @@ function scanHtml(html, on) {
|
|
|
186
186
|
|
|
187
187
|
/* ------------------------------------------------------------------ the plugin */
|
|
188
188
|
function kreftPlugin(options = {}) {
|
|
189
|
-
const include = options.include || /\.(?:kreftjs|kreft
|
|
189
|
+
const include = options.include || /\.(?:kreftjs|kreft)$/; // .kreftjs: files of a project from the 0.0.x betas
|
|
190
190
|
const exclude = options.exclude || /node_modules/;
|
|
191
191
|
const precompile = options.precompile !== false;
|
|
192
|
-
const isComponentFile = (f) => /\.(?:kreftjs|kreft
|
|
192
|
+
const isComponentFile = (f) => /\.(?:kreftjs|kreft)$/.test(f);
|
|
193
193
|
const kreftRuntimePath = path.resolve(__dirname, '..', 'kreftjs.js');
|
|
194
194
|
|
|
195
195
|
const filter = (id) => {
|
|
@@ -213,11 +213,11 @@ function kreftPlugin(options = {}) {
|
|
|
213
213
|
return {
|
|
214
214
|
resolve: {
|
|
215
215
|
alias: [
|
|
216
|
-
{ find: /^(?:kreftjs|kreft
|
|
216
|
+
{ find: /^(?:kreftjs|kreft)$/, replacement: kreftRuntimePath }, // kreft: the earlier name
|
|
217
217
|
],
|
|
218
218
|
},
|
|
219
219
|
optimizeDeps: {
|
|
220
|
-
exclude: ['kreftjs', 'kreft'
|
|
220
|
+
exclude: ['kreftjs', 'kreft'],
|
|
221
221
|
},
|
|
222
222
|
};
|
|
223
223
|
},
|
|
@@ -277,7 +277,7 @@ function kreftPlugin(options = {}) {
|
|
|
277
277
|
if (query && query.includes('type=style')) return null;
|
|
278
278
|
if (!filter(filePath)) return null;
|
|
279
279
|
|
|
280
|
-
// 1. Route files: routes/web.
|
|
280
|
+
// 1. Route files: routes/web.kreft or any .kreft file without <view>
|
|
281
281
|
if (!/<view(\s[^>]*)?>([\s\S]*)<\/view>/i.test(code)) {
|
|
282
282
|
const baseName = path.basename(filePath);
|
|
283
283
|
return {
|
|
@@ -329,12 +329,12 @@ export default routes;
|
|
|
329
329
|
const m = stmt.match(/^import\s+(?:([\s\S]+?)\s+from\s+)?(['"])(.+?)\2/);
|
|
330
330
|
if (!m) continue;
|
|
331
331
|
const [, what, , spec] = m;
|
|
332
|
-
if (/^(?:kreftjs|kreft
|
|
332
|
+
if (/^(?:kreftjs|kreft)(\.js)?$/.test(spec)) continue;
|
|
333
333
|
if (/\.css(?:[?#].*)?$/i.test(spec)) {
|
|
334
334
|
topImports.push(`import ${JSON.stringify(spec)};`);
|
|
335
335
|
continue;
|
|
336
336
|
}
|
|
337
|
-
if (/\.(?:kreftjs|kreft
|
|
337
|
+
if (/\.(?:kreftjs|kreft)$/i.test(spec)) {
|
|
338
338
|
topImports.push(`import ${what} from ${JSON.stringify(spec)};`);
|
|
339
339
|
const names = extractImportedNames(what);
|
|
340
340
|
names.forEach((name) => {
|
|
@@ -393,7 +393,7 @@ var __def = Kreftjs.__makeDef({
|
|
|
393
393
|
if (typeof window !== 'undefined' && window.Kreftjs && window.Kreftjs.__registerDef) {
|
|
394
394
|
window.Kreftjs.__registerDef(${JSON.stringify(filePath)}, __def);
|
|
395
395
|
window.Kreftjs.__registerDef(${JSON.stringify(baseName)}, __def);
|
|
396
|
-
window.Kreftjs.__registerDef(${JSON.stringify(sp.name + '.
|
|
396
|
+
window.Kreftjs.__registerDef(${JSON.stringify(sp.name + '.kreft')}, __def);
|
|
397
397
|
}
|
|
398
398
|
|
|
399
399
|
if (import.meta.hot) {
|
|
@@ -401,7 +401,7 @@ if (import.meta.hot) {
|
|
|
401
401
|
if (newMod && newMod.default && typeof window !== 'undefined' && window.Kreftjs && window.Kreftjs.__hotDef) {
|
|
402
402
|
window.Kreftjs.__hotDef(${JSON.stringify(filePath)}, newMod.default);
|
|
403
403
|
window.Kreftjs.__hotDef(${JSON.stringify(baseName)}, newMod.default);
|
|
404
|
-
window.Kreftjs.__hotDef(${JSON.stringify(sp.name + '.
|
|
404
|
+
window.Kreftjs.__hotDef(${JSON.stringify(sp.name + '.kreft')}, newMod.default);
|
|
405
405
|
}
|
|
406
406
|
});
|
|
407
407
|
}
|
|
@@ -461,6 +461,4 @@ module.exports = kreftPlugin;
|
|
|
461
461
|
module.exports.default = kreftPlugin;
|
|
462
462
|
module.exports.kreftjs = kreftPlugin;
|
|
463
463
|
module.exports.kreft = kreftPlugin; // the earlier Kreft name
|
|
464
|
-
module.exports.som = kreftPlugin; // the Som.js names
|
|
465
|
-
module.exports.somPlugin = kreftPlugin;
|
|
466
464
|
module.exports.kreftPlugin = kreftPlugin;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// Application Web Routes.
|
|
2
|
-
// Developers can attach custom auth guards directly: .middleware('auth', 'admin') or custom guards.
|
|
3
|
-
|
|
4
|
-
// Public Welcome & Showcase Page (shows first with links to Sign Up, Log In, Docs)
|
|
5
|
-
Route.view('/', 'pages/Home.kreftjs').layout('none').name('home').title('Welcome')
|
|
6
|
-
Route.view('/welcome', 'pages/Home.kreftjs').layout('none').name('welcome').title('Welcome')
|
|
7
|
-
|
|
8
|
-
// Protected Dashboard & management pages (requires signed-in user)
|
|
9
|
-
Route.middleware('auth').group(() => {
|
|
10
|
-
Route.view('/dashboard', 'pages/Dashboard.kreftjs').name('dashboard').title('Dashboard')
|
|
11
|
-
Route.view('/users', 'pages/Users.kreftjs').name('users').title('Users')
|
|
12
|
-
Route.view('/profile', 'pages/Profile.kreftjs').name('profile').title('Profile')
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
// Authentication routes (pages/auth/), wrapped in guest layout
|
|
16
|
-
Route.layout('guest').group(() => {
|
|
17
|
-
Route.middleware('guest').group(() => {
|
|
18
|
-
Route.view('/login', 'pages/auth/Login.kreftjs').name('login').title('Log In')
|
|
19
|
-
Route.view('/register', 'pages/auth/Register.kreftjs').name('register').title('Register')
|
|
20
|
-
Route.view('/forgot-password', 'pages/auth/ForgotPassword.kreftjs').name('password.request').title('Forgot Password')
|
|
21
|
-
})
|
|
22
|
-
Route.view('/reset-password/:token', 'pages/auth/ResetPassword.kreftjs').name('password.reset').title('Reset Password')
|
|
23
|
-
Route.view('/verify-email/:id?/:hash?', 'pages/auth/VerifyEmail.kreftjs').name('verification.notice').title('Verify Email')
|
|
24
|
-
Route.view('/confirm-password', 'pages/auth/ConfirmPassword.kreftjs').name('password.confirm').title('Confirm Password').middleware('auth')
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
// Documentation (docs/) and test suite (tests/)
|
|
28
|
-
Route.view('/docs', 'docs/Docs.kreftjs').name('docs').title('Documentation').layout('docs') // its own slim bar, not the dashboard sidebar
|
|
29
|
-
Route.view('/error-monitor', 'pages/ErrorMonitor.kreftjs').name('error-monitor').title('Error Monitor')
|
|
30
|
-
Route.prefix('/tests').name('tests.').group(() => {
|
|
31
|
-
Route.view('/', 'tests/pages/Test.kreftjs').name('index').title('Test Suite')
|
|
32
|
-
Route.view('/about', 'tests/pages/About.kreftjs').name('about').title('About · Tests')
|
|
33
|
-
})
|
|
34
|
-
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<!-- /tests/about: a second test page. Add more: a .kreftjs file here, then one line in the routes in index.html. -->
|
|
2
|
-
<view>
|
|
3
|
-
<section class="page">
|
|
4
|
-
<h1>About</h1>
|
|
5
|
-
<p class="lead">Edit <code>tests/pages/About.kreftjs</code> and save: the page updates by itself.</p>
|
|
6
|
-
<p><kreft-link to="/tests">Back to the test pages</kreft-link></p>
|
|
7
|
-
</section>
|
|
8
|
-
</view>
|
|
9
|
-
|
|
10
|
-
<style scoped>
|
|
11
|
-
.page { padding: 40px 0; max-width: 40em; }
|
|
12
|
-
</style>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/templates/app/frontend/pages/auth/{ConfirmPassword.kreftjs → ConfirmPassword.kreft}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|