esm-styles 0.3.1 → 0.3.3
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/dist/watch.d.ts +2 -0
- package/dist/watch.js +24 -0
- package/doc/ai-guide.md +2 -0
- package/doc/best-practices.md +1 -0
- package/doc/usage-guide.md +1 -1
- package/package.json +1 -1
package/dist/watch.d.ts
ADDED
package/dist/watch.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from 'child_process';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import process from 'process';
|
|
5
|
+
const configPath = process.argv[2] || 'esm-styles.config.js';
|
|
6
|
+
const configModule = await import(path.isAbsolute(configPath)
|
|
7
|
+
? configPath
|
|
8
|
+
: path.resolve(process.cwd(), configPath));
|
|
9
|
+
const config = configModule.default;
|
|
10
|
+
const basePath = path.resolve(process.cwd(), config.basePath || '.');
|
|
11
|
+
const sourcePath = path.join(basePath, config.sourcePath || '');
|
|
12
|
+
const nodemonArgs = [
|
|
13
|
+
'--watch',
|
|
14
|
+
sourcePath,
|
|
15
|
+
'--ext',
|
|
16
|
+
'mjs',
|
|
17
|
+
'--ignore',
|
|
18
|
+
path.join(sourcePath, '$*.mjs'),
|
|
19
|
+
'--exec',
|
|
20
|
+
`node dist/build.js ${configPath}`,
|
|
21
|
+
];
|
|
22
|
+
console.log('[esm-styles] Running:', 'nodemon', ...nodemonArgs);
|
|
23
|
+
const nodemon = spawn('nodemon', nodemonArgs, { stdio: 'inherit' });
|
|
24
|
+
nodemon.on('exit', (code) => process.exit(code));
|
package/doc/ai-guide.md
CHANGED
|
@@ -172,6 +172,8 @@ export default {
|
|
|
172
172
|
// Use variable references - gets converted to var(--color-primary)
|
|
173
173
|
backgroundColor: $theme.color.primary,
|
|
174
174
|
color: $theme.color.textOnPrimary,
|
|
175
|
+
// in case of concatenation, use .var property, otherwise it will be [object Object]
|
|
176
|
+
border: `1px solid ${$theme.color.primary.var}`,
|
|
175
177
|
},
|
|
176
178
|
}
|
|
177
179
|
```
|
package/doc/best-practices.md
CHANGED
|
@@ -549,6 +549,7 @@ export default {
|
|
|
549
549
|
button: {
|
|
550
550
|
backgroundColor: $theme.surface.primary,
|
|
551
551
|
color: $theme.text.primary
|
|
552
|
+
border: `1px solid ${$theme.color.primary.var}` // in case of concatenation, use .var property of variable reference object
|
|
552
553
|
}
|
|
553
554
|
}
|
|
554
555
|
```
|
package/doc/usage-guide.md
CHANGED