@nan0web/core 1.1.3 → 3.1.0

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 CHANGED
@@ -8,16 +8,19 @@ DB‑backed state container with built‑in internationalisation.
8
8
  ## Installation
9
9
 
10
10
  How to install with npm?
11
+
11
12
  ```bash
12
13
  npm install @nan0web/core
13
14
  ```
14
15
 
15
16
  How to install with pnpm?
17
+
16
18
  ```bash
17
19
  pnpm add @nan0web/core
18
20
  ```
19
21
 
20
22
  How to install with yarn?
23
+
21
24
  ```bash
22
25
  yarn add @nan0web/core
23
26
  ```
@@ -27,6 +30,7 @@ yarn add @nan0web/core
27
30
  Create an `AppCore` instance with a mock DB and inspect its state.
28
31
 
29
32
  How to instantiate AppCore?
33
+
30
34
  ```js
31
35
  import { AppCore } from "@nan0web/core"
32
36
  const db = new DB()
@@ -39,6 +43,7 @@ console.info(core.uri) // ← /demo
39
43
  Load translation JSON from the DB and obtain a translation function.
40
44
 
41
45
  How does bootstrapI18n load translations?
46
+
42
47
  ```js
43
48
  const db = new DB({
44
49
  predefined: [['i18n/uk.json', { hello: 'Вітаю!' }]],
@@ -52,6 +57,7 @@ console.info(result) // ← Вітаю!
52
57
  ## State inspection
53
58
 
54
59
  How to retrieve current state?
60
+
55
61
  ```js
56
62
  const db = new DB()
57
63
  const core = new AppCore({ db })
@@ -60,6 +66,7 @@ const state = core.state()
60
66
  ## AppResult helper
61
67
 
62
68
  How to create an AppResult instance?
69
+
63
70
  ```js
64
71
  import { AppResult } from "@nan0web/core"
65
72
  const res = new AppResult({ content: 'Done', priority: 2, meta: { ok: true } })
@@ -70,6 +77,7 @@ console.info(res.content[0]) // ← Done
70
77
  The base `run` method throws an error – subclasses must implement it.
71
78
 
72
79
  How does run() behave when not overridden?
80
+
73
81
  ```js
74
82
  const db = new DB()
75
83
  const core = new AppCore({ db })
@@ -81,6 +89,7 @@ Core components like `AppCore` and `ProjectModel` implement a `static UI`
81
89
  metadata block defining their semantic display defaults according to the system contract.
82
90
 
83
91
  How to get semantic static UI data?
92
+
84
93
  ```js
85
94
  import { AppCore, ProjectModel } from "@nan0web/core"
86
95
  console.info(`${AppCore.UI.icon} ${AppCore.UI.title}`) // ← ⚙️ Application Core
@@ -92,3 +101,5 @@ How to contribute? - [check here](./CONTRIBUTING.md)
92
101
  ## License
93
102
 
94
103
  How to license ISC? - [check here](./LICENSE)
104
+
105
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nan0web/core",
3
- "version": "1.1.3",
3
+ "version": "3.1.0",
4
4
  "description": "Core application framework for nan0web with database handling, internationalization, and interface connectivity",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -27,14 +27,19 @@
27
27
  "devDependencies": {
28
28
  "husky": "^9.1.7",
29
29
  "knip": "^5.86.0",
30
- "@nan0web/test": "1.1.3",
31
- "@nan0web/release": "1.0.3"
30
+ "@nan0web/release": "3.1.0",
31
+ "@nan0web/test": "3.1.0"
32
+ },
33
+ "exports": {
34
+ ".": {
35
+ "import": "./src/index.js",
36
+ "types": "./types/index.d.ts"
37
+ }
32
38
  },
33
39
  "dependencies": {
34
- "@nan0web/db": "1.4.6",
35
- "@nan0web/i18n": "1.5.0",
36
- "@nan0web/protocol": "2.0.0",
37
- "@nan0web/types": "1.7.1"
40
+ "@nan0web/db": "3.1.0",
41
+ "@nan0web/i18n": "3.1.0",
42
+ "@nan0web/types": "3.1.0"
38
43
  },
39
44
  "scripts": {
40
45
  "build": "rm -rf types && tsc",
@@ -1,4 +1,4 @@
1
- import { Model } from './Model.js'
1
+ import { Model } from '@nan0web/types'
2
2
 
3
3
  const LANGS = ['en', 'uk', 'de', 'fr', 'es', 'pl']
4
4
 
package/src/index.js CHANGED
@@ -1,6 +1,4 @@
1
- export { ExecutableCommand } from '@nan0web/protocol'
2
- export { ModelError } from '@nan0web/types'
3
- export { Model } from './Model.js'
1
+ export { Model, ModelError } from '@nan0web/types'
4
2
  export { ProjectModel } from './ProjectModel.js'
5
3
  export { default as AppResult } from './AppResult.js'
6
4
  export { default as AppCore, default } from './AppCore.js'
@@ -59,4 +59,4 @@ export class ProjectModel extends Model {
59
59
  constructor(data?: Partial<ProjectModel>, options?: object);
60
60
  tags: string[] | undefined;
61
61
  }
62
- import { Model } from './Model.js';
62
+ import { Model } from '@nan0web/types';
package/types/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- export { ExecutableCommand } from "@nan0web/protocol";
2
- export { ModelError } from "@nan0web/types";
3
- export { Model } from "./Model.js";
4
1
  export { ProjectModel } from "./ProjectModel.js";
5
2
  export { default as AppResult } from "./AppResult.js";
6
3
  export type Language = import("./AppCore.js").Language;
4
+ export { Model, ModelError } from "@nan0web/types";
7
5
  export { default as AppCore, default } from "./AppCore.js";
package/src/Model.js DELETED
@@ -1,3 +0,0 @@
1
- import { Model } from '@nan0web/types'
2
-
3
- export { Model }
package/types/Model.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export { Model };
2
- import { Model } from '@nan0web/types';