declarative-spec 0.0.0-stage → 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,3 +1,85 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
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,6 +1,35 @@
1
- {
2
- "name": "declarative-spec",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
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/"
6
35
  }
package/src/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { default } from "./v1/index.js";
2
+ export * from "./v1/index.js";
@@ -0,0 +1,4 @@
1
+ import spec from "./spec.json" with { type: "json" };
2
+
3
+ export { spec };
4
+ export default spec;