kreftjs 0.0.16-beta → 0.0.17-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/electron.js CHANGED
@@ -286,6 +286,26 @@ function dropWebFonts(root) {
286
286
  return path.relative(root, file);
287
287
  }
288
288
 
289
+ // electron-builder needs a description, a homepage, an author with an e-mail and a Linux maintainer (.deb / .rpm).
290
+ // Missing ones are filled from git config (name, e-mail); edit them in package.json.
291
+ function ensureMeta(pkg) {
292
+ const git = (k) => { try { return require('child_process').execSync('git config ' + k, { stdio: ['ignore', 'pipe', 'ignore'] }).toString().trim(); } catch (_) { return ''; } };
293
+ let changed = false;
294
+ if (!pkg.description) { pkg.description = (pkg.build && pkg.build.productName) || pkg.name || 'Kreft desktop app'; changed = true; }
295
+ if (!pkg.homepage) { pkg.homepage = 'https://kreftjs.com'; changed = true; }
296
+ const hasMail = pkg.author && (typeof pkg.author === 'object' ? pkg.author.email : /<[^>]+@[^>]+>/.test(pkg.author));
297
+ if (!hasMail) {
298
+ const name = (pkg.author && (typeof pkg.author === 'object' ? pkg.author.name : String(pkg.author).replace(/<.*>/, '').trim())) || git('user.name') || pkg.name || 'App';
299
+ pkg.author = { name, email: git('user.email') || 'you@example.com' };
300
+ changed = true;
301
+ }
302
+ if (pkg.build) {
303
+ pkg.build.linux = pkg.build.linux || {};
304
+ if (!pkg.build.linux.maintainer) { pkg.build.linux.maintainer = `${pkg.author.name} <${pkg.author.email}>`; changed = true; }
305
+ }
306
+ return changed;
307
+ }
308
+
289
309
  function init(args = []) {
290
310
  const target = typeof args === 'string' ? args : (args[0] && !args[0].startsWith('-') ? args[0] : process.cwd());
291
311
  const root = getProjectRoot(target);
@@ -345,6 +365,7 @@ function init(args = []) {
345
365
  }
346
366
  }
347
367
 
368
+ ensureMeta(pkg);
348
369
  fs.writeFileSync(pkgFile, JSON.stringify(pkg, null, 2) + '\n');
349
370
 
350
371
  const droppedFonts = dropWebFonts(root);
@@ -507,6 +528,15 @@ function build(args = []) {
507
528
  init();
508
529
  }
509
530
 
531
+ try {
532
+ const f = path.join(root, 'package.json');
533
+ const pkg = JSON.parse(fs.readFileSync(f, 'utf8'));
534
+ if (ensureMeta(pkg)) {
535
+ fs.writeFileSync(f, JSON.stringify(pkg, null, 2) + '\n');
536
+ console.log(' Added description / author / Linux maintainer to package.json (needed for installers). Please check them.');
537
+ }
538
+ } catch (_) {}
539
+
510
540
  // 1. Build Kreft frontend for desktop with relative base
511
541
  console.log('\n Step 1: Building Kreft static bundle with relative base (./)…');
512
542
  const kreftCli = path.join(__dirname, 'kreftjs.js');
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.16-beta
85
+ kreft --version # for example 0.0.17-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
  ```
@@ -2015,7 +2015,7 @@ On macOS the menu lives in the top bar of the screen, so `show` and `auto` look
2015
2015
 
2016
2016
  ### The app icon
2017
2017
 
2018
- `kreft electron:init` copies the Kreft logo to `build/icon.png`. Replace it with your own square PNG, 512×512 or bigger. The window uses it, and electron-builder makes the `.icns` (macOS) and `.ico` (Windows) files from it. Set the app name with `build.productName` and `build.appId` in `package.json`, and add `description` and `author` there too (electron-builder warns without them).
2018
+ `kreft electron:init` copies the Kreft logo to `build/icon.png`. Replace it with your own square PNG, 512×512 or bigger. The window uses it, and electron-builder makes the `.icns` (macOS) and `.ico` (Windows) files from it. Set the app name with `build.productName` and `build.appId` in `package.json`, electron-builder also needs `description`, `homepage`, an `author` with an e-mail and `build.linux.maintainer` (for `.deb` and `.rpm`). `kreft electron:init` and `kreft electron:build` fill in the missing ones (from your git name and e-mail); check them before you release.
2019
2019
 
2020
2020
  ### Packaging and installers
2021
2021
 
@@ -2034,7 +2034,7 @@ npm run electron:build:all # all three
2034
2034
  | macOS | `dmg`, `zip` |
2035
2035
  | Linux | `AppImage`, `deb`, `rpm` |
2036
2036
 
2037
- Edit `appId`, `productName` and the targets there. Build for each system on that system: a macOS installer needs a Mac (Windows installers from a Mac need Wine; `.rpm` needs `rpm` installed). Code signing and notarisation (macOS) or a signing certificate (Windows) are set up through electron-builder (electron.build/code-signing) and are needed before you give the app to other people; unsigned macOS apps show a Gatekeeper warning.
2037
+ Edit `appId`, `productName` and the targets there. Build for each system on that system: a macOS installer needs a Mac (on a Mac, the Linux `AppImage` and the Windows installers build, but `.deb` and `.rpm` fail: build those on Linux, or remove them from `build.linux.target`). Code signing and notarisation (macOS) or a signing certificate (Windows) are set up through electron-builder (electron.build/code-signing) and are needed before you give the app to other people; unsigned macOS apps show a Gatekeeper warning.
2038
2038
 
2039
2039
  The packaged app loads the built `dist/index.html` and does not start a backend. A frontend-only app works as is; a full-stack app (login, database) does not work once installed.
2040
2040
 
package/kreftjs.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for Kreft 0.0.16-beta
1
+ // Type definitions for Kreft 0.0.17-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.16-beta — reactive by nature
2
+ * Kreft v0.0.17-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.16-beta';
5039
+ const VERSION = '0.0.17-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.16-beta",
3
+ "version": "0.0.17-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.16-beta'}</span>
95
+ <span class="badge">Kreft {Kreftjs.version || '0.0.17-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.16-beta'}</code></td></tr>
192
+ <tr><th>Engine</th><td><code>Kreft v{Kreftjs.version || '0.0.17-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.16-beta
1
+ // Type definitions for Kreft 0.0.17-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.16-beta — reactive by nature
2
+ * Kreft v0.0.17-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.16-beta';
5039
+ const VERSION = '0.0.17-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.16-beta'}</span>
115
+ <span class="info-value">Kreft {Kreftjs.version || '0.0.17-beta'}</span>
116
116
  </div>
117
117
  <div class="info-item">
118
118
  <span class="info-label">Active Database</span>
@@ -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.16-beta</span>
121
+ <span class="badge-env">Kreft v0.0.17-beta</span>
122
122
  </div>
123
123
  <h1 class="hero-error-message">{currentMessage}</h1>
124
124
  </div>