domma-js 0.53.3 → 0.55.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/assets/types/config.d.ts +2 -2
- package/assets/types/elements.d.ts +24 -3
- package/assets/types/index.d.ts +48 -25
- package/assets/types/theme.d.ts +2 -1
- package/package.json +31 -6
- package/public/dist/bundles/domma-complete.css +405 -23
- package/public/dist/bundles/domma-data-focused.css +405 -23
- package/public/dist/bundles/domma-essentials.css +405 -23
- package/public/dist/bundles/domma-full.css +405 -23
- package/public/dist/bundles/domma-minimal.css +8 -8
- package/public/dist/domma-flags.esm.js +4 -3
- package/public/dist/domma-flags.esm.js.map +1 -0
- package/public/dist/domma-flags.min.js +4 -3
- package/public/dist/domma-flags.min.js.map +1 -0
- package/public/dist/domma-syntax.min.js +4 -3
- package/public/dist/domma-syntax.min.js.map +1 -0
- package/public/dist/domma.css +3 -3
- package/public/dist/domma.esm.js +6 -5
- package/public/dist/domma.esm.js.map +1 -0
- package/public/dist/domma.min.js +6 -5
- package/public/dist/domma.min.js.map +1 -0
- package/public/dist/elements.css +394 -12
- package/public/dist/grid.css +3 -3
- package/public/dist/syntax.css +3 -3
- package/public/dist/themes/domma-themes.css +3 -3
- package/bin/postinstall.js +0 -212
package/bin/postinstall.js
DELETED
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Domma Postinstall Script
|
|
5
|
-
* Offers to copy AI assistance files to the project root
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { existsSync, mkdirSync, copyFileSync, readdirSync, statSync, readFileSync, writeFileSync } from 'fs';
|
|
9
|
-
import { join, dirname, resolve } from 'path';
|
|
10
|
-
import { fileURLToPath } from 'url';
|
|
11
|
-
import { createInterface } from 'readline';
|
|
12
|
-
|
|
13
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
14
|
-
const __dirname = dirname(__filename);
|
|
15
|
-
|
|
16
|
-
// Color codes for terminal output
|
|
17
|
-
const colors = {
|
|
18
|
-
reset: '\x1b[0m',
|
|
19
|
-
bright: '\x1b[1m',
|
|
20
|
-
cyan: '\x1b[36m',
|
|
21
|
-
green: '\x1b[32m',
|
|
22
|
-
yellow: '\x1b[33m',
|
|
23
|
-
gray: '\x1b[90m'
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Check if we're in a valid installation context
|
|
28
|
-
* - Should be installed as dependency (in node_modules)
|
|
29
|
-
* - Should not be in development mode (inside domma repo itself)
|
|
30
|
-
*/
|
|
31
|
-
function shouldRunPostinstall() {
|
|
32
|
-
const cwd = process.cwd();
|
|
33
|
-
|
|
34
|
-
// Don't run during development in domma repo
|
|
35
|
-
if (existsSync(join(cwd, 'templates', 'kickstart'))) {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// Don't run in CI environments
|
|
40
|
-
if (process.env.CI || process.env.CONTINUOUS_INTEGRATION) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Check if we're in node_modules (normal install)
|
|
45
|
-
const isInNodeModules = cwd.includes('node_modules');
|
|
46
|
-
|
|
47
|
-
return isInNodeModules;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Find project root (directory with package.json, above node_modules)
|
|
52
|
-
*/
|
|
53
|
-
function findProjectRoot() {
|
|
54
|
-
let currentDir = process.cwd();
|
|
55
|
-
|
|
56
|
-
// Navigate up to find the project root (outside node_modules)
|
|
57
|
-
while (currentDir.includes('node_modules')) {
|
|
58
|
-
currentDir = dirname(currentDir);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// Go up one more level to get to the actual project root
|
|
62
|
-
const projectRoot = dirname(currentDir);
|
|
63
|
-
|
|
64
|
-
// Verify it has package.json
|
|
65
|
-
if (existsSync(join(projectRoot, 'package.json'))) {
|
|
66
|
-
return projectRoot;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return null;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Get path to kickstart template in installed package
|
|
74
|
-
*/
|
|
75
|
-
function getTemplatePath() {
|
|
76
|
-
// When installed via npm, templates are in node_modules/domma-js/templates/
|
|
77
|
-
const cwd = process.cwd();
|
|
78
|
-
return join(cwd, 'templates', 'kickstart');
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Copy file recursively
|
|
83
|
-
*/
|
|
84
|
-
function copyRecursive(src, dest) {
|
|
85
|
-
const stat = statSync(src);
|
|
86
|
-
|
|
87
|
-
if (stat.isDirectory()) {
|
|
88
|
-
if (!existsSync(dest)) {
|
|
89
|
-
mkdirSync(dest, { recursive: true });
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const items = readdirSync(src);
|
|
93
|
-
for (const item of items) {
|
|
94
|
-
copyRecursive(join(src, item), join(dest, item));
|
|
95
|
-
}
|
|
96
|
-
} else {
|
|
97
|
-
copyFileSync(src, dest);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Prompt user for input
|
|
103
|
-
*/
|
|
104
|
-
function prompt(question) {
|
|
105
|
-
const rl = createInterface({
|
|
106
|
-
input: process.stdin,
|
|
107
|
-
output: process.stdout
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
return new Promise((resolve) => {
|
|
111
|
-
rl.question(question, (answer) => {
|
|
112
|
-
rl.close();
|
|
113
|
-
resolve(answer.trim().toLowerCase());
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Main postinstall function
|
|
120
|
-
*/
|
|
121
|
-
async function main() {
|
|
122
|
-
// Check if we should run
|
|
123
|
-
if (!shouldRunPostinstall()) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
const projectRoot = findProjectRoot();
|
|
128
|
-
if (!projectRoot) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
const templatePath = getTemplatePath();
|
|
133
|
-
if (!existsSync(templatePath)) {
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
console.log(`\n${colors.cyan}${colors.bright}╭───────────────────────────────────────────╮${colors.reset}`);
|
|
138
|
-
console.log(`${colors.cyan}${colors.bright}│${colors.reset} ${colors.bright}Domma AI Assistance Available${colors.reset} ${colors.cyan}${colors.bright}│${colors.reset}`);
|
|
139
|
-
console.log(`${colors.cyan}${colors.bright}╰───────────────────────────────────────────╯${colors.reset}\n`);
|
|
140
|
-
|
|
141
|
-
console.log(`${colors.gray}Domma includes AI assistance files for Claude Code:${colors.reset}`);
|
|
142
|
-
console.log(`${colors.gray} • CLAUDE.md - Framework reference guide${colors.reset}`);
|
|
143
|
-
console.log(`${colors.gray} • .claude/ - Settings & code snippets${colors.reset}`);
|
|
144
|
-
console.log(`${colors.gray} • blueprints/ - Reusable schemas (8 files)${colors.reset}`);
|
|
145
|
-
console.log(`${colors.gray} • types/ - TypeScript definitions${colors.reset}\n`);
|
|
146
|
-
|
|
147
|
-
const answer = await prompt(`${colors.bright}Copy AI assistance files to your project? (Y/n): ${colors.reset}`);
|
|
148
|
-
|
|
149
|
-
if (answer === 'n' || answer === 'no') {
|
|
150
|
-
console.log(`${colors.gray}Skipped. Run ${colors.bright}npx domma-js setup-ai${colors.gray} later to add these files.${colors.reset}\n`);
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
console.log(`\n${colors.cyan}Copying AI assistance files...${colors.reset}\n`);
|
|
155
|
-
|
|
156
|
-
try {
|
|
157
|
-
let copied = 0;
|
|
158
|
-
|
|
159
|
-
// Copy CLAUDE.md
|
|
160
|
-
const claudeMd = join(templatePath, 'CLAUDE.md');
|
|
161
|
-
const destClaudeMd = join(projectRoot, 'CLAUDE.md');
|
|
162
|
-
if (existsSync(claudeMd) && !existsSync(destClaudeMd)) {
|
|
163
|
-
copyFileSync(claudeMd, destClaudeMd);
|
|
164
|
-
console.log(` ${colors.green}✓${colors.reset} Created CLAUDE.md`);
|
|
165
|
-
copied++;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
// Copy .claude/ directory
|
|
169
|
-
const claudeDir = join(templatePath, '.claude');
|
|
170
|
-
const destClaudeDir = join(projectRoot, '.claude');
|
|
171
|
-
if (existsSync(claudeDir) && !existsSync(destClaudeDir)) {
|
|
172
|
-
copyRecursive(claudeDir, destClaudeDir);
|
|
173
|
-
console.log(` ${colors.green}✓${colors.reset} Created .claude/ directory`);
|
|
174
|
-
copied++;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
// Copy blueprints/ directory
|
|
178
|
-
const blueprintsDir = join(templatePath, 'blueprints');
|
|
179
|
-
const destBlueprintsDir = join(projectRoot, 'blueprints');
|
|
180
|
-
if (existsSync(blueprintsDir) && !existsSync(destBlueprintsDir)) {
|
|
181
|
-
copyRecursive(blueprintsDir, destBlueprintsDir);
|
|
182
|
-
console.log(` ${colors.green}✓${colors.reset} Created blueprints/ directory`);
|
|
183
|
-
copied++;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
// Copy types/ directory
|
|
187
|
-
const typesDir = join(templatePath, 'frontend', 'types');
|
|
188
|
-
const destTypesDir = join(projectRoot, 'types');
|
|
189
|
-
if (existsSync(typesDir) && !existsSync(destTypesDir)) {
|
|
190
|
-
copyRecursive(typesDir, destTypesDir);
|
|
191
|
-
console.log(` ${colors.green}✓${colors.reset} Created types/ directory`);
|
|
192
|
-
copied++;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
if (copied > 0) {
|
|
196
|
-
console.log(`\n${colors.green}${colors.bright}✓ Successfully added AI assistance files!${colors.reset}`);
|
|
197
|
-
console.log(`${colors.gray}Claude Code will now have full context for your Domma project.${colors.reset}\n`);
|
|
198
|
-
} else {
|
|
199
|
-
console.log(`\n${colors.yellow}AI assistance files already exist. Skipped copying.${colors.reset}\n`);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
} catch (error) {
|
|
203
|
-
console.error(`\n${colors.yellow}Warning: Could not copy AI assistance files${colors.reset}`);
|
|
204
|
-
console.error(`${colors.gray}You can manually copy them from node_modules/domma-js/templates/kickstart/${colors.reset}\n`);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
// Run postinstall
|
|
209
|
-
main().catch(() => {
|
|
210
|
-
// Silent failure - don't break installation
|
|
211
|
-
process.exit(0);
|
|
212
|
-
});
|