declarative-spec 1.0.0 → 1.2.1

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
@@ -1,79 +1,85 @@
1
- # declarative-spec
2
-
3
- > **Canonical HTML DOM tag specifications, default utility classes, attributes, and interpolation tokens for declarative JSON-to-DOM compilers.**
4
-
5
- Part of the **KeshavSoft Declarative UI Architecture** (Tier 2: DOM Tag Specifications).
6
-
7
- ---
8
-
9
- ## 📖 The Story
10
-
11
- In modern web development, tag structures are often tightly coupled to JavaScript frameworks (JSX, Vue templates, or string templates).
12
-
13
- `declarative-spec` decouples raw HTML elements into **pure, serializable JSON blueprints**:
14
- 1. **Zero Runtime Dependency**: Defines HTML primitives (`<table>`, `<th>`, `<td>`, `<select>`, `<button>`) with serializable attributes and utility classes.
15
- 2. **String Interpolation Tokens**: Supports dynamic placeholder tokens (`${columnName}`) that compilers can hydrate without hardcoding DOM manipulation.
16
- 3. **Engine Agnostic**: Can be compiled into native DOM elements, Virtual DOM nodes, or server-side HTML strings.
17
-
18
- ---
19
-
20
- ## 📦 Installation
21
-
22
- ```bash
23
- npm install declarative-spec
24
- ```
25
-
26
- ---
27
-
28
- ## 🚀 Usage
29
-
30
- ### 1. Import Spec in ES Modules
31
-
32
- ```javascript
33
- import spec from "declarative-spec";
34
-
35
- // Inspect a base tag specification
36
- console.log(spec.tableSimple);
37
- ```
38
-
39
- ### 2. Import Specific Version
40
-
41
- ```javascript
42
- import spec from "declarative-spec/v1";
43
- ```
44
-
45
- ### 3. Direct JSON Import
46
-
47
- ```javascript
48
- import spec from "declarative-spec/spec.json" with { type: "json" };
49
- ```
50
-
51
- ---
52
-
53
- ## 🏛️ Tag Spec Blueprint Example
54
-
55
- ```json
56
- {
57
- "tableSimple": {
58
- "tag": "table",
59
- "attributes": {
60
- "class": "table table-bordered table-striped"
61
- },
62
- "children": []
63
- }
64
- }
65
- ```
66
-
67
- ---
68
-
69
- ## 🌐 Interactive Monaco Studio & Documentation
70
-
71
- Explore, edit, and inspect all tag blueprints live in Monaco:
72
- * **Documentation & Story:** [https://keshavsoft.github.io/declarative-spec/](https://keshavsoft.github.io/declarative-spec/)
73
- * **Monaco Spec Studio:** [https://keshavsoft.github.io/declarative-spec/monaco/v1/](https://keshavsoft.github.io/declarative-spec/monaco/v1/)
74
-
75
- ---
76
-
77
- ## 📄 License
78
-
79
- MIT © [KeshavSoft](https://github.com/keshavsoft)
1
+ # declarative-spec
2
+
3
+ > **Canonical HTML DOM tag specifications, default utility classes, attributes, and interpolation tokens for declarative JSON-to-DOM compilers.**
4
+
5
+ ---
6
+ [![LIVE DOCS](https://img.shields.io/badge/LIVE-DOCUMENTATION-blue?style=for-the-badge)](https://keshavsoft.github.io/declarative-spec/)
7
+ [![NPM](https://img.shields.io/badge/NPM-PACKAGE-CB3837?style=for-the-badge&logo=npm)](https://www.npmjs.com/package/declarative-spec)
8
+ [![GITHUB](https://img.shields.io/badge/GITHUB-REPOSITORY-181717?style=for-the-badge&logo=github)](https://github.com/keshavsoft/declarative-spec)
9
+ ---
10
+
11
+ Part of the **KeshavSoft Declarative UI Architecture** (Tier 2: DOM Tag Specifications).
12
+
13
+ ---
14
+
15
+ ## 📖 The Story
16
+
17
+ In modern web development, tag structures are often tightly coupled to JavaScript frameworks (JSX, Vue templates, or string templates).
18
+
19
+ `declarative-spec` decouples raw HTML elements into **pure, serializable JSON blueprints**:
20
+ 1. **Zero Runtime Dependency**: Defines HTML primitives (`<table>`, `<th>`, `<td>`, `<select>`, `<button>`) with serializable attributes and utility classes.
21
+ 2. **String Interpolation Tokens**: Supports dynamic placeholder tokens (`${columnName}`) that compilers can hydrate without hardcoding DOM manipulation.
22
+ 3. **Engine Agnostic**: Can be compiled into native DOM elements, Virtual DOM nodes, or server-side HTML strings.
23
+
24
+ ---
25
+
26
+ ## 📦 Installation
27
+
28
+ ```bash
29
+ npm install declarative-spec
30
+ ```
31
+
32
+ ---
33
+
34
+ ## 🚀 Usage
35
+
36
+ ### 1. Import Spec in ES Modules
37
+
38
+ ```javascript
39
+ import spec from "declarative-spec";
40
+
41
+ // Inspect a base tag specification
42
+ console.log(spec.tableSimple);
43
+ ```
44
+
45
+ ### 2. Import Specific Version
46
+
47
+ ```javascript
48
+ import spec from "declarative-spec/v1";
49
+ ```
50
+
51
+ ### 3. Direct JSON Import
52
+
53
+ ```javascript
54
+ import spec from "declarative-spec/spec.json" with { type: "json" };
55
+ ```
56
+
57
+ ---
58
+
59
+ ## 🏛️ Tag Spec Blueprint Example
60
+
61
+ ```json
62
+ {
63
+ "tableSimple": {
64
+ "tag": "table",
65
+ "attributes": {
66
+ "class": "table table-bordered table-striped"
67
+ },
68
+ "children": []
69
+ }
70
+ }
71
+ ```
72
+
73
+ ---
74
+
75
+ ## 🌐 Interactive Monaco Studio & Documentation
76
+
77
+ Explore, edit, and inspect all tag blueprints live in Monaco:
78
+ * **Documentation & Story:** [https://keshavsoft.github.io/declarative-spec/](https://keshavsoft.github.io/declarative-spec/)
79
+ * **Monaco Spec Studio:** [https://keshavsoft.github.io/declarative-spec/monaco/v1/](https://keshavsoft.github.io/declarative-spec/monaco/v1/)
80
+
81
+ ---
82
+
83
+ ## 📄 License
84
+
85
+ MIT © [KeshavSoft](https://github.com/keshavsoft)
package/package.json CHANGED
@@ -1,38 +1,35 @@
1
- {
2
- "name": "declarative-spec",
3
- "version": "1.0.0",
4
- "description": "Canonical HTML DOM tag specifications, default utility classes, attributes, and interpolation tokens for declarative JSON-to-DOM compilers.",
5
- "type": "module",
6
- "main": "./src/index.js",
7
- "module": "./src/index.js",
8
- "exports": {
9
- ".": {
10
- "import": "./src/index.js",
11
- "default": "./src/index.js"
12
- },
13
- "./v1": {
14
- "import": "./src/v1/index.js",
15
- "default": "./src/v1/index.js"
16
- },
17
- "./spec.json": "./src/v1/spec.json"
18
- },
19
- "files": [
20
- "src",
21
- "README.md"
22
- ],
23
- "repository": {
24
- "type": "git",
25
- "url": "git+https://github.com/keshavsoft/declarative-spec.git"
26
- },
27
- "keywords": [
28
- "declarative-ui",
29
- "dom-spec",
30
- "html-templates",
31
- "tag-specifications",
32
- "dom-compiler",
33
- "zero-dependency"
34
- ],
35
- "author": "KeshavSoft",
36
- "license": "MIT",
37
- "homepage": "https://keshavsoft.github.io/declarative-spec/"
38
- }
1
+ {
2
+ "name": "declarative-spec",
3
+ "version": "1.2.1",
4
+ "description": "High-level declarative UI component blueprints, option configurations, and assembly contracts for JSON-to-DOM compilers.",
5
+ "type": "module",
6
+ "main": "./src/index.js",
7
+ "module": "./src/index.js",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./src/index.js",
11
+ "default": "./src/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "src",
16
+ "README.md"
17
+ ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "git+https://github.com/keshavsoft/declarative-spec.git"
21
+ },
22
+ "scripts": {
23
+ "build": "npx @keshavsoft/build-cli"
24
+ },
25
+ "keywords": [
26
+ "declarative-ui",
27
+ "component-blueprints",
28
+ "ui-contracts",
29
+ "dom-compiler",
30
+ "zero-dependency"
31
+ ],
32
+ "author": "KeshavSoft",
33
+ "license": "MIT",
34
+ "homepage": "https://keshavsoft.github.io/declarative-spec/"
35
+ }
package/src/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { default } from "./v1/index.js";
2
- export * from "./v1/index.js";
1
+ export { default } from "./v1/index.js";
2
+ export * from "./v1/index.js";
package/src/v1/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import spec from "./spec.json" with { type: "json" };
2
-
3
- export { spec };
4
- export default spec;
1
+ import spec from "./spec.json" with { type: "json" };
2
+
3
+ export { spec };
4
+ export default spec;