doe-sdk 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.
Files changed (127) hide show
  1. package/README.md +509 -0
  2. package/dist/cli/index.d.ts +17 -0
  3. package/dist/cli/index.d.ts.map +1 -0
  4. package/dist/cli/index.js +118 -0
  5. package/dist/cli/index.js.map +1 -0
  6. package/dist/cli/init.d.ts +25 -0
  7. package/dist/cli/init.d.ts.map +1 -0
  8. package/dist/cli/init.js +100 -0
  9. package/dist/cli/init.js.map +1 -0
  10. package/dist/cli/login.d.ts +52 -0
  11. package/dist/cli/login.d.ts.map +1 -0
  12. package/dist/cli/login.js +571 -0
  13. package/dist/cli/login.js.map +1 -0
  14. package/dist/cli/publish.d.ts +27 -0
  15. package/dist/cli/publish.d.ts.map +1 -0
  16. package/dist/cli/publish.js +531 -0
  17. package/dist/cli/publish.js.map +1 -0
  18. package/dist/cli/scaffold.d.ts +18 -0
  19. package/dist/cli/scaffold.d.ts.map +1 -0
  20. package/dist/cli/scaffold.js +252 -0
  21. package/dist/cli/scaffold.js.map +1 -0
  22. package/dist/cli/ui.d.ts +57 -0
  23. package/dist/cli/ui.d.ts.map +1 -0
  24. package/dist/cli/ui.js +339 -0
  25. package/dist/cli/ui.js.map +1 -0
  26. package/dist/cli/validate.d.ts +28 -0
  27. package/dist/cli/validate.d.ts.map +1 -0
  28. package/dist/cli/validate.js +1270 -0
  29. package/dist/cli/validate.js.map +1 -0
  30. package/dist/compat/legacy-adapter.d.ts +198 -0
  31. package/dist/compat/legacy-adapter.d.ts.map +1 -0
  32. package/dist/compat/legacy-adapter.js +318 -0
  33. package/dist/compat/legacy-adapter.js.map +1 -0
  34. package/dist/index.d.ts +14 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +16 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/runtime/client.d.ts +370 -0
  39. package/dist/runtime/client.d.ts.map +1 -0
  40. package/dist/runtime/client.js +470 -0
  41. package/dist/runtime/client.js.map +1 -0
  42. package/dist/runtime/index.d.ts +8 -0
  43. package/dist/runtime/index.d.ts.map +1 -0
  44. package/dist/runtime/index.js +7 -0
  45. package/dist/runtime/index.js.map +1 -0
  46. package/dist/types/api.d.ts +564 -0
  47. package/dist/types/api.d.ts.map +1 -0
  48. package/dist/types/api.js +11 -0
  49. package/dist/types/api.js.map +1 -0
  50. package/dist/types/index.d.ts +12 -0
  51. package/dist/types/index.d.ts.map +1 -0
  52. package/dist/types/index.js +10 -0
  53. package/dist/types/index.js.map +1 -0
  54. package/dist/types/manifest.d.ts +412 -0
  55. package/dist/types/manifest.d.ts.map +1 -0
  56. package/dist/types/manifest.js +42 -0
  57. package/dist/types/manifest.js.map +1 -0
  58. package/dist/types/marketplace-categories.d.ts +9 -0
  59. package/dist/types/marketplace-categories.d.ts.map +1 -0
  60. package/dist/types/marketplace-categories.js +16 -0
  61. package/dist/types/marketplace-categories.js.map +1 -0
  62. package/dist/types/permissions.d.ts +86 -0
  63. package/dist/types/permissions.d.ts.map +1 -0
  64. package/dist/types/permissions.js +295 -0
  65. package/dist/types/permissions.js.map +1 -0
  66. package/dist/types/theme/index.d.ts +7 -0
  67. package/dist/types/theme/index.d.ts.map +1 -0
  68. package/dist/types/theme/index.js +7 -0
  69. package/dist/types/theme/index.js.map +1 -0
  70. package/dist/types/theme/schema.d.ts +1205 -0
  71. package/dist/types/theme/schema.d.ts.map +1 -0
  72. package/dist/types/theme/schema.js +325 -0
  73. package/dist/types/theme/schema.js.map +1 -0
  74. package/dist/types/theme/types.d.ts +648 -0
  75. package/dist/types/theme/types.d.ts.map +1 -0
  76. package/dist/types/theme/types.js +8 -0
  77. package/dist/types/theme/types.js.map +1 -0
  78. package/package.json +75 -0
  79. package/templates/extension/README.md +254 -0
  80. package/templates/extension/icon.png +0 -0
  81. package/templates/extension/index.html +42 -0
  82. package/templates/extension/manifest.json +57 -0
  83. package/templates/extension/package.json +24 -0
  84. package/templates/extension/src/App.tsx +252 -0
  85. package/templates/extension/src/components/OnboardingComplete.tsx +190 -0
  86. package/templates/extension/src/components/OnboardingProgress.tsx +82 -0
  87. package/templates/extension/src/components/OnboardingWelcome.tsx +166 -0
  88. package/templates/extension/src/components/StepContainer.tsx +217 -0
  89. package/templates/extension/src/components/playground/CanvasTab.tsx +24 -0
  90. package/templates/extension/src/components/playground/ConfigTab.tsx +24 -0
  91. package/templates/extension/src/components/playground/EventsTab.tsx +24 -0
  92. package/templates/extension/src/components/playground/InfoTab.tsx +89 -0
  93. package/templates/extension/src/components/playground/NetworkTab.tsx +24 -0
  94. package/templates/extension/src/components/playground/PlaygroundContainer.tsx +184 -0
  95. package/templates/extension/src/components/playground/ResultDisplay.tsx +30 -0
  96. package/templates/extension/src/components/playground/StorageTab.tsx +24 -0
  97. package/templates/extension/src/components/playground/UITab.tsx +24 -0
  98. package/templates/extension/src/components/shared/CanvasControls.tsx +130 -0
  99. package/templates/extension/src/components/shared/ConfigControls.tsx +154 -0
  100. package/templates/extension/src/components/shared/EventsControls.tsx +232 -0
  101. package/templates/extension/src/components/shared/InfoControls.tsx +281 -0
  102. package/templates/extension/src/components/shared/NetworkControls.tsx +328 -0
  103. package/templates/extension/src/components/shared/StorageControls.tsx +203 -0
  104. package/templates/extension/src/components/shared/UIControls.tsx +199 -0
  105. package/templates/extension/src/components/shared/index.ts +15 -0
  106. package/templates/extension/src/components/steps/CanvasStep.tsx +67 -0
  107. package/templates/extension/src/components/steps/ClipboardStep.tsx +167 -0
  108. package/templates/extension/src/components/steps/ConfigStep.tsx +63 -0
  109. package/templates/extension/src/components/steps/EventsStep.tsx +69 -0
  110. package/templates/extension/src/components/steps/InfoStep.tsx +70 -0
  111. package/templates/extension/src/components/steps/NetworkStep.tsx +70 -0
  112. package/templates/extension/src/components/steps/StorageStep.tsx +61 -0
  113. package/templates/extension/src/components/steps/UIStep.tsx +70 -0
  114. package/templates/extension/src/hooks/useDoe.ts +93 -0
  115. package/templates/extension/src/hooks/useOnboarding.ts +264 -0
  116. package/templates/extension/src/hooks/usePointerHandlers.ts +105 -0
  117. package/templates/extension/src/main.tsx +18 -0
  118. package/templates/extension/src/styles.ts +265 -0
  119. package/templates/extension/tsconfig.json +28 -0
  120. package/templates/extension/vite.config.ts +32 -0
  121. package/templates/theme/README.md +132 -0
  122. package/templates/theme/manifest.json +19 -0
  123. package/templates/theme/package.json +16 -0
  124. package/templates/theme/styles/.gitkeep +2 -0
  125. package/templates/theme/themes/theme.json +32 -0
  126. package/templates/theme/vite-plugin-doe-theme.ts +53 -0
  127. package/templates/theme/vite.config.ts +10 -0
@@ -0,0 +1,132 @@
1
+ # {{displayName}}
2
+
3
+ A custom theme for DOE.
4
+
5
+ ## Installation
6
+
7
+ Install from the DOE marketplace or load locally during development.
8
+
9
+ ## Development
10
+
11
+ ```bash
12
+ # Install dependencies
13
+ pnpm install
14
+
15
+ # Start development server with hot reload
16
+ pnpm dev
17
+
18
+ # Validate theme
19
+ pnpm validate
20
+
21
+ # Build for production
22
+ pnpm build
23
+
24
+ # Publish to marketplace
25
+ pnpm publish
26
+ ```
27
+
28
+ ## Theme Customization
29
+
30
+ Edit `themes/theme.json` to customize the theme. The theme system supports:
31
+
32
+ ### Colors (Required)
33
+
34
+ - `background` - Main app background
35
+ - `surface` - Panel and card backgrounds
36
+ - `text` - Primary text color
37
+ - `textMuted` - Secondary/muted text
38
+ - `accent` - Brand/accent color
39
+ - `border` - Borders and dividers
40
+
41
+ ### Typography (Optional)
42
+
43
+ - `fontFamily` - Primary font stack
44
+ - `fontFamilyMono` - Monospace font stack
45
+ - `scale` - Font size scale (minor-second, major-second, minor-third, major-third, perfect-fourth)
46
+
47
+ ### Effects (Optional)
48
+
49
+ - `shadows` - Shadow style (none, subtle, soft, medium, hard, neon)
50
+ - `glassEnabled` - Enable glassmorphism effects
51
+
52
+ ### Shapes (Optional)
53
+
54
+ - `borderRadius` - Corner radius preset (none, xs, sm, md, lg, xl, full)
55
+
56
+ ### Motion (Optional)
57
+
58
+ - `easing` - Animation easing (linear, ease, spring, bounce, snappy, smooth)
59
+ - `durationScale` - Animation duration multiplier (0.5-2)
60
+
61
+ ## Adding Custom CSS
62
+
63
+ For advanced styling beyond color tokens, use custom CSS with semantic theme parts:
64
+
65
+ 1. Create a CSS file in `styles/`:
66
+
67
+ ```css
68
+ /* styles/my-theme.css */
69
+ [data-theme-part="titlebar"] {
70
+ background: linear-gradient(#fff, #ccc);
71
+ }
72
+
73
+ [data-theme-part="sidebar"] {
74
+ border-right: 2px solid var(--color-accent);
75
+ }
76
+ ```
77
+
78
+ 2. Reference it in your `themes/theme.json`:
79
+
80
+ ```json
81
+ {
82
+ "customCSS": "./styles/my-theme.css",
83
+ "colors": { ... }
84
+ }
85
+ ```
86
+
87
+ 3. The CSS file will be automatically copied to `dist/themes/` during build.
88
+
89
+ ### Available Theme Parts
90
+
91
+ Use `data-theme-part` selectors for stable CSS targeting:
92
+
93
+ **Layout:**
94
+ - `sidebar`, `topbar`, `statusbar`, `panel`
95
+
96
+ **Window (ExtensionShape):**
97
+ - `window`, `titlebar`, `titlebar-title`, `titlebar-controls`
98
+ - `titlebar-minimize`, `titlebar-maximize`, `titlebar-close`
99
+ - `window-content`
100
+
101
+ **Controls:**
102
+ - `button`, `button-primary`, `button-icon`
103
+ - `input`, `select`, `checkbox`, `switch`, `tab`
104
+
105
+ **Feedback:**
106
+ - `modal`, `modal-backdrop`, `tooltip`, `menu`, `menu-item`, `popover`
107
+
108
+ **Canvas (tldraw wrapper):**
109
+ - `toolbar`, `toolbar-button`, `style-panel`
110
+
111
+ ## Adding Custom Assets
112
+
113
+ Place custom fonts in an `assets/fonts/` directory and reference them in your theme:
114
+
115
+ ```json
116
+ {
117
+ "assets": {
118
+ "fonts": [
119
+ {
120
+ "family": "MyCustomFont",
121
+ "weight": "400",
122
+ "style": "normal",
123
+ "url": "./assets/fonts/MyCustomFont-Regular.woff2"
124
+ }
125
+ ]
126
+ }
127
+ }
128
+ ```
129
+
130
+ ## License
131
+
132
+ MIT
@@ -0,0 +1,19 @@
1
+ {
2
+ "id": "@{{slug}}/{{name}}",
3
+ "version": "1.0.0",
4
+ "name": "{{displayName}}",
5
+ "description": "A custom theme for DOE",
6
+ "author": "{{author}}",
7
+ "permissions": [],
8
+ "categories": ["theme"],
9
+ "keywords": ["theme"],
10
+ "minDOEVersion": "1.0.0",
11
+ "contributes": {
12
+ "themes": [
13
+ {
14
+ "path": "./themes/theme.json",
15
+ "label": "{{displayName}}"
16
+ }
17
+ ]
18
+ }
19
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "{{name}}",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite build --watch",
8
+ "build": "vite build && doe-sdk validate",
9
+ "validate": "doe-sdk validate",
10
+ "publish": "doe-sdk publish"
11
+ },
12
+ "devDependencies": {
13
+ "doe-sdk": "{{sdkDependency}}",
14
+ "vite": "^6.2.0"
15
+ }
16
+ }
@@ -0,0 +1,2 @@
1
+ # Custom CSS files go here
2
+ # Reference them in your theme.json with "customCSS": "./styles/my-theme.css"
@@ -0,0 +1,32 @@
1
+ {
2
+ "id": "{{name}}",
3
+ "name": "{{displayName}}",
4
+ "version": "1.0.0",
5
+ "author": "{{author}}",
6
+ "type": "dark",
7
+ "tags": ["custom"],
8
+ "colors": {
9
+ "background": "#1a1a2e",
10
+ "surface": "#252541",
11
+ "text": "#eaeaea",
12
+ "textMuted": "#a0a0a0",
13
+ "accent": "#e94560",
14
+ "border": "#3d3d5c"
15
+ },
16
+ "typography": {
17
+ "fontFamily": "Inter, system-ui, sans-serif",
18
+ "fontFamilyMono": "JetBrains Mono, monospace",
19
+ "scale": "minor-third"
20
+ },
21
+ "effects": {
22
+ "shadows": "soft",
23
+ "glassEnabled": false
24
+ },
25
+ "shapes": {
26
+ "borderRadius": "md"
27
+ },
28
+ "motion": {
29
+ "easing": "smooth",
30
+ "durationScale": 1
31
+ }
32
+ }
@@ -0,0 +1,53 @@
1
+ import type { Plugin } from "vite";
2
+ import * as fs from "node:fs/promises";
3
+ import * as path from "node:path";
4
+
5
+ export function doeThemePlugin(): Plugin {
6
+ return {
7
+ name: "doe-theme",
8
+ async buildStart() {
9
+ // Copy manifest.json
10
+ const manifest = await fs.readFile("manifest.json", "utf-8");
11
+ this.emitFile({
12
+ type: "asset",
13
+ fileName: "manifest.json",
14
+ source: manifest,
15
+ });
16
+ },
17
+ async generateBundle() {
18
+ // Copy theme JSON files
19
+ const themesDir = path.resolve("themes");
20
+ const files = await fs.readdir(themesDir);
21
+
22
+ for (const file of files) {
23
+ if (file.endsWith(".json")) {
24
+ const content = await fs.readFile(
25
+ path.join(themesDir, file),
26
+ "utf-8"
27
+ );
28
+ const theme = JSON.parse(content);
29
+
30
+ this.emitFile({
31
+ type: "asset",
32
+ fileName: `themes/${file}`,
33
+ source: content,
34
+ });
35
+
36
+ // Copy customCSS if referenced
37
+ if (theme.customCSS) {
38
+ const cssPath = path.resolve(
39
+ path.dirname(path.join(themesDir, file)),
40
+ theme.customCSS
41
+ );
42
+ const cssContent = await fs.readFile(cssPath, "utf-8");
43
+ this.emitFile({
44
+ type: "asset",
45
+ fileName: `themes/${theme.customCSS}`,
46
+ source: cssContent,
47
+ });
48
+ }
49
+ }
50
+ }
51
+ },
52
+ };
53
+ }
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from "vite";
2
+ import { doeThemePlugin } from "./vite-plugin-doe-theme";
3
+
4
+ export default defineConfig({
5
+ plugins: [doeThemePlugin()],
6
+ build: {
7
+ outDir: "dist",
8
+ emptyDirBeforeWrite: true,
9
+ },
10
+ });