juxscript 1.0.104 → 1.0.105
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/machinery/compiler3.js +19 -11
- package/package.json +1 -1
package/machinery/compiler3.js
CHANGED
|
@@ -98,17 +98,24 @@ export class JuxCompiler {
|
|
|
98
98
|
*/
|
|
99
99
|
copyJuxscriptCss() {
|
|
100
100
|
const componentsDir = this.getComponentsDir();
|
|
101
|
-
if (!componentsDir)
|
|
101
|
+
if (!componentsDir) {
|
|
102
|
+
console.log('⚠️ Components directory not found, skipping CSS bundling');
|
|
103
|
+
return { bundlePath: null, components: [] };
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
console.log(`📂 Scanning for CSS in: ${componentsDir}`);
|
|
102
107
|
|
|
103
108
|
const cssContents = [];
|
|
104
109
|
const components = [];
|
|
105
110
|
|
|
106
111
|
const walkDir = (dir, relativePath = '') => {
|
|
107
112
|
if (!fs.existsSync(dir)) return;
|
|
113
|
+
|
|
108
114
|
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
109
115
|
for (const entry of entries) {
|
|
110
116
|
const fullPath = path.join(dir, entry.name);
|
|
111
|
-
const relPath = path.join(relativePath, entry.name);
|
|
117
|
+
const relPath = relativePath ? path.join(relativePath, entry.name) : entry.name;
|
|
118
|
+
|
|
112
119
|
if (entry.isDirectory()) {
|
|
113
120
|
walkDir(fullPath, relPath);
|
|
114
121
|
} else if (entry.name === 'structure.css') {
|
|
@@ -118,12 +125,12 @@ export class JuxCompiler {
|
|
|
118
125
|
// Add comment header for each component's CSS
|
|
119
126
|
cssContents.push(`/* ═══════════════════════════════════════════════════════════════
|
|
120
127
|
* Component: ${componentName}
|
|
121
|
-
*
|
|
122
|
-
* ═══════════════════════════════════════════════════════════════ */\n`);
|
|
128
|
+
* ═══════════════════════════════════════════════════════════════ */`);
|
|
123
129
|
cssContents.push(content);
|
|
124
|
-
cssContents.push('
|
|
130
|
+
cssContents.push('');
|
|
125
131
|
|
|
126
132
|
components.push(componentName);
|
|
133
|
+
console.log(` 📄 Found: ${componentName}/structure.css`);
|
|
127
134
|
}
|
|
128
135
|
}
|
|
129
136
|
};
|
|
@@ -131,6 +138,7 @@ export class JuxCompiler {
|
|
|
131
138
|
walkDir(componentsDir);
|
|
132
139
|
|
|
133
140
|
if (cssContents.length === 0) {
|
|
141
|
+
console.log('⚠️ No CSS files found to bundle');
|
|
134
142
|
return { bundlePath: null, components: [] };
|
|
135
143
|
}
|
|
136
144
|
|
|
@@ -142,18 +150,18 @@ export class JuxCompiler {
|
|
|
142
150
|
* JUX Component Styles Bundle
|
|
143
151
|
* Auto-generated - Do not edit directly
|
|
144
152
|
*
|
|
145
|
-
* Components included:
|
|
146
|
-
* ${components.map(c => ` - ${c}`).join('\n * ')}
|
|
147
|
-
*
|
|
153
|
+
* Components included: ${components.join(', ')}
|
|
148
154
|
* Generated: ${new Date().toISOString()}
|
|
149
|
-
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
`;
|
|
150
158
|
|
|
151
|
-
const bundledCss = bundleHeader + cssContents.join('\n');
|
|
159
|
+
const bundledCss = bundleHeader + cssContents.join('\n\n');
|
|
152
160
|
const bundlePath = path.join(cssDistDir, 'jux-components.css');
|
|
153
161
|
|
|
154
162
|
fs.writeFileSync(bundlePath, bundledCss);
|
|
155
163
|
|
|
156
|
-
console.log(
|
|
164
|
+
console.log(`✅ Bundled ${components.length} CSS files → css/jux-components.css (${(bundledCss.length / 1024).toFixed(1)}KB)`);
|
|
157
165
|
|
|
158
166
|
return {
|
|
159
167
|
bundlePath: './css/jux-components.css',
|