kreftjs 0.0.13-beta → 0.0.15-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/bin/db.js CHANGED
@@ -41,11 +41,23 @@ const TEXT = /char|text|clob|string|uuid|enum|json/i;
41
41
  const dateOut = (d) => d.toISOString().slice(0, 19).replace('T', ' ');
42
42
  const BOOL = /^bool/i;
43
43
 
44
+ // a missing table nearly always means a migration has not been run yet, so say so
45
+ const MISSING_TABLE = /no such table|doesn't exist|does not exist|ER_NO_SUCH_TABLE/i;
46
+ function hintMissingTable(e) {
47
+ if (e && typeof e.message === 'string' && MISSING_TABLE.test(e.message) && /table|relation/i.test(e.message) && !e.message.includes('kreft migrate')) {
48
+ e.message += '\n Hint: the table is missing. Run `kreft migrate` to create it.';
49
+ }
50
+ return e;
51
+ }
52
+
44
53
  async function connect(url, { root } = {}) {
45
54
  const cfg = parseUrl(url);
46
- if (cfg.kind === 'sqlite') return sqlite(cfg, root);
47
- if (cfg.kind === 'mysql') return mysql(cfg, root);
48
- return postgres(cfg, root);
55
+ const db = cfg.kind === 'sqlite' ? await sqlite(cfg, root) : cfg.kind === 'mysql' ? await mysql(cfg, root) : await postgres(cfg, root);
56
+ for (const m of ['query', 'run']) {
57
+ const fn = db[m];
58
+ if (typeof fn === 'function') db[m] = async (...a) => { try { return await fn.apply(db, a); } catch (e) { throw hintMissingTable(e); } };
59
+ }
60
+ return db;
49
61
  }
50
62
 
51
63
  /* ---------------------------------------------------------------- SQLite (node:sqlite) */
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.13-beta
85
+ kreft --version # for example 0.0.15-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
  ```
@@ -0,0 +1,4 @@
1
+ .vscode/**
2
+ .gitignore
3
+ *.vsix
4
+ **/*.map
@@ -0,0 +1,6 @@
1
+ # Changelog
2
+
3
+ ## 2.3.0
4
+ - Syntax colors for `.kreft` (and legacy `.kreftjs`) files, including embedded HTML, CSS and JavaScript.
5
+ - Bracket matching, auto-closing pairs, comments (Ctrl+/) and folding for `<view>` and `<style>`.
6
+ - Document formatter and snippets (`kreftjs`, `state`, `action`, `for`, `kreft-wait`, ...).
@@ -0,0 +1,95 @@
1
+ Copyright 2026 Maxamuud Xuseen
2
+
3
+ Elastic License 2.0
4
+
5
+ URL: https://www.elastic.co/licensing/elastic-license
6
+
7
+ ## Acceptance
8
+
9
+ By using the software, you agree to all of the terms and conditions below.
10
+
11
+ ## Copyright License
12
+
13
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
14
+ non-sublicensable, non-transferable license to use, copy, distribute, make
15
+ available, and prepare derivative works of the software, in each case subject to
16
+ the limitations and conditions below.
17
+
18
+ ## Limitations
19
+
20
+ You may not provide the software to third parties as a hosted or managed
21
+ service, where the service provides users with access to any substantial set of
22
+ the features or functionality of the software.
23
+
24
+ You may not move, change, disable, or circumvent the license key functionality
25
+ in the software, and you may not remove or obscure any functionality in the
26
+ software that is protected by the license key.
27
+
28
+ You may not alter, remove, or obscure any licensing, copyright, or other notices
29
+ of the licensor in the software. Any use of the licensor’s trademarks is subject
30
+ to applicable law.
31
+
32
+ ## Patents
33
+
34
+ The licensor grants you a license, under any patent claims the licensor can
35
+ license, or becomes able to license, to make, have made, use, sell, offer for
36
+ sale, import and have imported the software, in each case subject to the
37
+ limitations and conditions in this license. This license does not cover any
38
+ patent claims that you cause to be infringed by modifications or additions to
39
+ the software. If you or your company make any written claim that the software
40
+ infringes or contributes to infringement of any patent, your patent license for
41
+ the software granted under these terms ends immediately. If your company makes
42
+ such a claim, your patent license ends immediately for work on behalf of your
43
+ company.
44
+
45
+ ## Notices
46
+
47
+ You must ensure that anyone who gets a copy of any part of the software from you
48
+ also gets a copy of these terms.
49
+
50
+ If you modify the software, you must include in any modified copies of the
51
+ software prominent notices stating that you have modified the software.
52
+
53
+ ## No Other Rights
54
+
55
+ These terms do not imply any licenses other than those expressly granted in
56
+ these terms.
57
+
58
+ ## Termination
59
+
60
+ If you use the software in violation of these terms, such use is not licensed,
61
+ and your licenses will automatically terminate. If the licensor provides you
62
+ with a notice of your violation, and you cease all violation of this license no
63
+ later than 30 days after you receive that notice, your licenses will be
64
+ reinstated retroactively. However, if you violate these terms after such
65
+ reinstatement, any additional violation of these terms will cause your licenses
66
+ to terminate automatically and permanently.
67
+
68
+ ## No Liability
69
+
70
+ *As far as the law allows, the software comes as is, without any warranty or
71
+ condition, and the licensor will not be liable to you for any damages arising
72
+ out of these terms or the use or nature of the software, under any kind of
73
+ legal claim.*
74
+
75
+ ## Definitions
76
+
77
+ The **licensor** is the entity offering these terms, and the **software** is the
78
+ software the licensor makes available under these terms, including any portion
79
+ of it.
80
+
81
+ **you** refers to the individual or entity agreeing to these terms.
82
+
83
+ **your company** is any legal entity, sole proprietorship, or other kind of
84
+ organization that you work for, plus all organizations that have control over,
85
+ are under the control of, or are under common control with that
86
+ organization. **control** means ownership of substantially all the assets of an
87
+ entity, or the power to direct its management and policies by vote, contract, or
88
+ otherwise. Control can be direct or indirect.
89
+
90
+ **your licenses** are all the licenses granted to you for the software under
91
+ these terms.
92
+
93
+ **use** means anything you do with the software requiring one of your licenses.
94
+
95
+ **trademark** means trademarks, service marks, and similar rights.
@@ -1,13 +1,26 @@
1
1
  # Kreft for VS Code
2
2
 
3
- Colors, bracket matching, comments (Ctrl+/), folding and snippets for `.kreft` files.
3
+ Language support for [Kreft](https://github.com/gadhyare/somjs) `.kreft` component files.
4
4
 
5
- Install from a Kreft project or the Kreft folder:
5
+ ## Features
6
+
7
+ - **Syntax colors** for `<view>`, `<style>` and `<script>` blocks, with HTML, CSS and JavaScript embedded.
8
+ - **Formatting**: format a `.kreft` file with *Format Document* (Shift+Alt+F).
9
+ - **Snippets**: type `kreftjs` in an empty `.kreft` file for a starter component, or `state`, `action`, `for`, `kreft-wait` and more.
10
+ - **Editing helpers**: bracket matching, auto-closing pairs, line comments (Ctrl+/) and folding for `<view>` / `<style>`.
11
+
12
+ Files with the older `.kreftjs` extension get the same support.
13
+
14
+ ## Install
15
+
16
+ Search for **Kreft** in the Extensions view, or from a Kreft project run:
6
17
 
7
18
  ```bash
8
19
  kreftjs vscode
9
20
  ```
10
21
 
11
- Then restart VS Code. Type `kreftjs` in an empty `.kreft` file for a starter component, or `state`, `action`, `for`, `kreft-wait` …
22
+ Then restart VS Code.
23
+
24
+ ## License
12
25
 
13
- Files with the older `.kreftjs` extension get the same colors.
26
+ Elastic License 2.0. See [LICENSE](LICENSE).
Binary file
@@ -4,7 +4,30 @@
4
4
  "description": "Colors, brackets, formatting and snippets for Kreft .kreft component files (and .kreftjs files from the 0.0.x betas).",
5
5
  "version": "2.3.0",
6
6
  "publisher": "kreft",
7
- "license": "MIT",
7
+ "icon": "icon.png",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/gadhyare/somjs.git"
11
+ },
12
+ "homepage": "https://github.com/gadhyare/somjs#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/gadhyare/somjs/issues"
15
+ },
16
+ "galleryBanner": {
17
+ "color": "#1e1b4b",
18
+ "theme": "dark"
19
+ },
20
+ "keywords": [
21
+ "kreft",
22
+ "kreftjs",
23
+ ".kreft",
24
+ "syntax highlighting",
25
+ "snippets",
26
+ "formatter",
27
+ "framework",
28
+ "laravel"
29
+ ],
30
+ "license": "SEE LICENSE IN LICENSE",
8
31
  "engines": {
9
32
  "vscode": "^1.60.0"
10
33
  },
package/kreftjs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for Kreft 0.0.13-beta
1
+ // Type definitions for Kreft 0.0.15-beta
2
2
  // Use from TypeScript or for editor hints in plain JavaScript (// @ts-check).
3
3
 
4
4
  export interface Signal<T> { value: T }
package/kreftjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Kreft v0.0.13-beta — reactive by nature
2
+ * Kreft v0.0.15-beta — reactive by nature
3
3
  * The .kreft 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.
@@ -5036,7 +5036,7 @@
5036
5036
  stores, storeLog, busLog,
5037
5037
  };
5038
5038
 
5039
- const VERSION = '0.0.13-beta';
5039
+ const VERSION = '0.0.15-beta';
5040
5040
  const Kreftjs = {
5041
5041
  version: VERSION,
5042
5042
  // 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.13-beta",
3
+ "version": "0.0.15-beta",
4
4
  "description": "A tiny reactive framework with its own component language (.kreft 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",
@@ -92,7 +92,7 @@ state docs = (Kreftjs.env.PUBLIC_DOCS_URL || 'http://kreftjs.com').replace(/\/+$
92
92
  <div class="badges">
93
93
  <span class="badge danger-badge">HTTP {status}</span>
94
94
  <span class="badge solid">{currentTitle}</span>
95
- <span class="badge">Kreft {Kreftjs.version || '0.0.13-beta'}</span>
95
+ <span class="badge">Kreft {Kreftjs.version || '0.0.15-beta'}</span>
96
96
  </div>
97
97
  <div class="actions">
98
98
  <button class="sm" @click={copyReport}>{copied ? 'Copied Markdown' : 'Copy Report'}</button>
@@ -189,7 +189,7 @@ state docs = (Kreftjs.env.PUBLIC_DOCS_URL || 'http://kreftjs.com').replace(/\/+$
189
189
  <h3>Kreft Runtime</h3>
190
190
  <table>
191
191
  <tbody>
192
- <tr><th>Engine</th><td><code>Kreft v{Kreftjs.version || '0.0.13-beta'}</code></td></tr>
192
+ <tr><th>Engine</th><td><code>Kreft v{Kreftjs.version || '0.0.15-beta'}</code></td></tr>
193
193
  <tr><th>Sanitizer</th><td><code>Active (cleanHtml / SafeHtml)</code></td></tr>
194
194
  <tr><th>Environment</th><td><code>development (APP_DEBUG=true)</code></td></tr>
195
195
  </tbody>
@@ -1,4 +1,4 @@
1
- // Type definitions for Kreft 0.0.13-beta
1
+ // Type definitions for Kreft 0.0.15-beta
2
2
  // Use from TypeScript or for editor hints in plain JavaScript (// @ts-check).
3
3
 
4
4
  export interface Signal<T> { value: T }
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Kreft v0.0.13-beta — reactive by nature
2
+ * Kreft v0.0.15-beta — reactive by nature
3
3
  * The .kreft 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.
@@ -5036,7 +5036,7 @@
5036
5036
  stores, storeLog, busLog,
5037
5037
  };
5038
5038
 
5039
- const VERSION = '0.0.13-beta';
5039
+ const VERSION = '0.0.15-beta';
5040
5040
  const Kreftjs = {
5041
5041
  version: VERSION,
5042
5042
  // PUBLIC_ values from .env (kreft dev and kreft build put them here); never secrets
@@ -112,7 +112,7 @@ state docs = (Kreftjs.env.PUBLIC_DOCS_URL || 'http://kreftjs.com').replace(/\/+$
112
112
  <div class="info-list">
113
113
  <div class="info-item">
114
114
  <span class="info-label">Framework Engine</span>
115
- <span class="info-value">Kreft {Kreftjs.version || '0.0.13-beta'}</span>
115
+ <span class="info-value">Kreft {Kreftjs.version || '0.0.15-beta'}</span>
116
116
  </div>
117
117
  <div class="info-item">
118
118
  <span class="info-label">Active Database</span>
@@ -658,30 +658,49 @@ dd { margin: 0; color: var(--muted); }
658
658
  .inside ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
659
659
  }
660
660
  @media (max-width: 640px) {
661
- .welcome-container { padding: 0 max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); }
662
- .site-bar { height: 56px; }
663
- .site-nav a { padding: 10px 12px; }
664
- .hero-headline { font-size: 32px; min-height: 4.4em; }
665
- .hero-tagline { font-size: 20px; }
666
- .hero-summary { font-size: 15px; }
667
- .cta-actions { flex-direction: column; align-items: stretch; width: 100%; }
668
- .pill-btn { width: 100%; min-height: 46px; text-align: center; }
669
- .feature-badges { gap: 6px; }
670
- .badge { font-size: 11.5px; padding: 5px 10px; }
671
- .terminal-code { font-size: 12.5px; padding: 18px 16px 44px; }
672
- .floating-preview { padding: 18px; }
673
- .language, .inside, .begin { padding: 40px 0; }
674
- .inside ul { grid-template-columns: 1fr; }
675
- dl { grid-template-columns: 1fr; }
676
- dl div { grid-template-columns: 1fr; gap: 4px; }
661
+ .welcome-container { padding: 0 max(14px, env(safe-area-inset-right)) 28px max(14px, env(safe-area-inset-left)); }
662
+ .site-bar { height: 52px; }
663
+ .site-nav a { padding: 8px 10px; font-size: 13px; }
664
+ .site-theme { height: 32px; width: 32px; }
665
+ .hero-meta { gap: 6px; margin-bottom: 14px; }
666
+ .hero-grid { gap: 28px; padding-bottom: 36px; }
667
+ .hero-headline { font-size: 26px; min-height: 3.3em; letter-spacing: -0.03em; }
668
+ .hero-tagline { font-size: 17px; margin: 10px 0 10px; }
669
+ .hero-summary { font-size: 14px; line-height: 1.55; margin-bottom: 20px; }
670
+ /* the main button on its own line, the other two side by side */
671
+ .cta-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; margin-bottom: 18px; }
672
+ .pill-btn.primary { grid-column: 1 / -1; }
673
+ .pill-btn { width: 100%; min-height: 42px; padding: 8px 14px; font-size: 14px; text-align: center; }
674
+ .feature-badges { gap: 5px; }
675
+ .badge { font-size: 11px; padding: 4px 9px; }
676
+ .hero-visual { gap: 14px; }
677
+ .terminal-card { border-radius: 14px; }
678
+ .terminal-code { font-size: 11.5px; line-height: 1.6; padding: 14px 14px 30px; }
679
+ .floating-preview { padding: 14px; border-radius: 14px; }
680
+ .preview-name { font-size: 17px; }
681
+ .preview-metrics { display: none; }
682
+ .language, .inside, .begin { padding: 28px 0; }
683
+ .language h2, .inside h2, .begin h2 { font-size: 19px; margin-bottom: 14px; }
684
+ /* the 12 words and the 9 parts in two columns, not one long list */
685
+ dl { grid-template-columns: 1fr 1fr; column-gap: 16px; font-size: 13px; }
686
+ dl div { grid-template-columns: 1fr; gap: 1px; padding: 8px 0; }
687
+ dl dd { font-size: 12px; line-height: 1.35; }
688
+ .inside ul { grid-template-columns: 1fr 1fr; }
689
+ .inside a { padding: 12px; gap: 3px; }
690
+ .inside a strong { font-size: 13px; }
691
+ .inside a span { font-size: 12px; line-height: 1.35; }
677
692
  .term { max-width: 100%; }
678
- .term code { min-width: 0; overflow-x: auto; white-space: nowrap; }
679
- .site-foot { flex-wrap: wrap; gap: 8px 16px; }
693
+ .term code { min-width: 0; overflow-x: auto; white-space: nowrap; font-size: 12.5px; }
694
+ .begin p { font-size: 13px; }
695
+ .site-foot { flex-wrap: wrap; gap: 6px 14px; padding-top: 16px; font-size: 12px; }
680
696
  }
681
697
  @media (max-width: 380px) {
682
- .hero-headline { font-size: 28px; }
683
- .version-pill, .hero-kicker { font-size: 11.5px; }
684
- .terminal-code { font-size: 11.5px; }
698
+ .hero-headline { font-size: 24px; min-height: 4.3em; }
699
+ .version-pill, .hero-kicker { font-size: 11px; padding: 4px 10px; }
700
+ .terminal-code { font-size: 10.5px; }
685
701
  .preview-badges { flex-wrap: wrap; }
686
702
  }
703
+ @media (max-width: 340px) {
704
+ .inside ul { grid-template-columns: 1fr; }
705
+ }
687
706
  </style>
@@ -118,7 +118,7 @@ state docs = (Kreftjs.env.PUBLIC_DOCS_URL || 'http://kreftjs.com').replace(/\/+$
118
118
  <div class="hero-badges">
119
119
  <span class="badge-exception">{currentTitle}</span>
120
120
  <span class="badge-env">Node.js {typeof process !== 'undefined' ? process.version : 'v22.0.0'}</span>
121
- <span class="badge-env">Kreft v0.0.13-beta</span>
121
+ <span class="badge-env">Kreft v0.0.15-beta</span>
122
122
  </div>
123
123
  <h1 class="hero-error-message">{currentMessage}</h1>
124
124
  </div>