@dnzn/dxkit 0.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/LICENSE +21 -0
- package/README.md +130 -0
- package/dist/index.cjs +589 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +425 -0
- package/dist/index.d.ts +425 -0
- package/dist/index.global.js +582 -0
- package/dist/index.global.js.map +1 -0
- package/dist/index.js +557 -0
- package/dist/index.js.map +1 -0
- package/package.json +49 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Denizen. // dnzn.wei
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# DNZN // DxKit
|
|
2
|
+
|
|
3
|
+
A headless microframework for building composable dapps. Routing, lifecycle management, event bus, plugin registry — zero DOM ownership.
|
|
4
|
+
|
|
5
|
+
by **Denizen.** // dnzn.wei
|
|
6
|
+
|
|
7
|
+
## Release Info
|
|
8
|
+
|
|
9
|
+
### Project Status
|
|
10
|
+
|
|
11
|
+
| STATUS | VERSION | AUDIT |
|
|
12
|
+
|:---|:---|:---|
|
|
13
|
+
| `vibe/alpha` | 0.1.0 | [Self Review](audit/self/dxkit-0.1.0.md) |
|
|
14
|
+
|
|
15
|
+
This is alpha software. Let it bake. Do not trust in production without thorough testing and review.
|
|
16
|
+
|
|
17
|
+
No warranty.
|
|
18
|
+
|
|
19
|
+
### Installation
|
|
20
|
+
|
|
21
|
+
*Framework*
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
npm install @dnzn/dxkit
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
*Plugins*
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
npm install @dnzn/dxkit-auth
|
|
31
|
+
npm install @dnzn/dxkit-wallet
|
|
32
|
+
npm install @dnzn/dxkit-settings
|
|
33
|
+
npm install @dnzn/dxkit-theme
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Architecture
|
|
37
|
+
|
|
38
|
+
The shell owns orchestration. The developer owns the DOM. Dapps are self-contained scripts that mount into a provided `#dx-mount` container and interact with plugins and events through the shared `__DXKIT__` context.
|
|
39
|
+
|
|
40
|
+
```mermaid
|
|
41
|
+
graph TD
|
|
42
|
+
subgraph DxKit
|
|
43
|
+
Shell --> Router
|
|
44
|
+
Shell --> EventBus["Event Bus"]
|
|
45
|
+
Shell --> PluginRegistry["Plugin Registry"]
|
|
46
|
+
Shell --> Lifecycle["Lifecycle Manager"]
|
|
47
|
+
|
|
48
|
+
PluginRegistry --> Wallet["@dxkit/wallet"]
|
|
49
|
+
PluginRegistry --> Auth["@dxkit/auth"]
|
|
50
|
+
PluginRegistry --> Theme["@dxkit/theme"]
|
|
51
|
+
PluginRegistry --> Settings["@dxkit/settings"]
|
|
52
|
+
|
|
53
|
+
Router -->|resolve route| Lifecycle
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
subgraph Developer App
|
|
57
|
+
Dapp
|
|
58
|
+
Container["#dx-mount"]
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
Lifecycle -->|load & mount| Dapp
|
|
62
|
+
Lifecycle -->|mount into| Container
|
|
63
|
+
|
|
64
|
+
Dapp -->|window.__DXKIT__| EventBus
|
|
65
|
+
Dapp -->|window.__DXKIT__| PluginRegistry
|
|
66
|
+
|
|
67
|
+
EventBus -->|dx:mount / dx:unmount| Dapp
|
|
68
|
+
EventBus -->|dx:ready| Shell
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Documentation
|
|
72
|
+
|
|
73
|
+
### Framework
|
|
74
|
+
|
|
75
|
+
| DOCUMENT | DESCRIPTION |
|
|
76
|
+
|----------|-------------|
|
|
77
|
+
| [Getting Started](docs/getting-started.md) | Framework overview, core concepts, lifecycle, config, full sample project |
|
|
78
|
+
| [Dapp Development](docs/dapp-development.md) | Manifest, lifecycle events, context, settings, sub-routing, standalone mode |
|
|
79
|
+
| [Plugin Development](docs/plugin-development.md) | Plugin interface, init lifecycle, custom events, duck-typing, full example |
|
|
80
|
+
| [System Internals](docs/system-internals.md) | Architecture, sequence diagrams, router/lifecycle/event bus internals |
|
|
81
|
+
| [Events Reference](docs/events-reference.md) | Complete event catalog with payloads, organized by source |
|
|
82
|
+
| [API Reference](docs/api-reference.md) | All factory functions, interfaces, and type definitions |
|
|
83
|
+
| [Cookbook](docs/cookbook.md) | Patterns & recipes — DxKit by example |
|
|
84
|
+
|
|
85
|
+
### Plugins
|
|
86
|
+
|
|
87
|
+
| DOCUMENT | DESCRIPTION |
|
|
88
|
+
|----------|-------------|
|
|
89
|
+
| [@dxkit/wallet](docs/plugins/wallet.md) | Wallet providers, EIP-1193, local dev, custom providers |
|
|
90
|
+
| [@dxkit/auth](docs/plugins/auth.md) | Passthrough auth, wallet bridging |
|
|
91
|
+
| [@dxkit/theme](docs/plugins/theme.md) | CSS theming, light/dark/system, DOM integration |
|
|
92
|
+
| [@dxkit/settings](docs/plugins/settings.md) | Key-value store, sections, form generation, dapp toggles |
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
## Development
|
|
96
|
+
|
|
97
|
+
### Common Helpers
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
make setup # Install dependencies and initialize development environment
|
|
101
|
+
make build # Build dxkit + all plugins -> dist/ + plugins/*/dist/
|
|
102
|
+
make test # Lint + run all tests (vitest + happy-dom)
|
|
103
|
+
make test-watch # Lint + run tests in watch mode
|
|
104
|
+
make lint # Run biome check
|
|
105
|
+
make lint-fix # Run biome check with auto-fix
|
|
106
|
+
make lint-format # Run biome format with auto-fix
|
|
107
|
+
make clean # Remove all dist/ directories
|
|
108
|
+
make superclean # Remove all dist/ and node_modules/ directories
|
|
109
|
+
make audit # Run pnpm audit, semgrep SAST, and gitleaks secret detection
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Tests run the standalone vitest config (`vitest.config.ts`) with happy-dom for DOM APIs.
|
|
113
|
+
|
|
114
|
+
### Build System
|
|
115
|
+
|
|
116
|
+
Each package (core + plugins) uses `tsup` to produce three output formats from a single TypeScript entry point:
|
|
117
|
+
|
|
118
|
+
| FORMAT | PATH | PURPOSE |
|
|
119
|
+
|--------|------|---------|
|
|
120
|
+
| ESM | `dist/index.js` | Modern `import`/`export` — bundlers, Node.js, `<script type="module">` |
|
|
121
|
+
| CJS | `dist/index.cjs` | CommonJS `require()` — legacy Node.js tooling |
|
|
122
|
+
| IIFE | `dist/index.global.js` | Self-contained `<script>` tag — no bundler required, good for IPFS/etc |
|
|
123
|
+
|
|
124
|
+
The `exports` field in each `package.json` maps consumers to the right format automatically. IIFE builds attach to a global (`DxKit`, `DxWallet`, `DxAuth`, `DxTheme`, `DxSettings`) for use in static HTML without a build step — the primary deployment target for dapps served from IPFS or `file:///`.
|
|
125
|
+
|
|
126
|
+
Plugin IIFE builds bundle dxkit core inline (`noExternal: ['dxkit']`). ESM/CJS builds declare it as `external` to avoid duplication when used with a bundler.
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
MIT — see [LICENSE](LICENSE).
|