esm-styles 0.3.4 → 0.3.5
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/lib/build.js +3 -0
- package/dist/lib/utils/timestamp.d.ts +1 -0
- package/dist/lib/utils/timestamp.js +3 -0
- package/doc/usage-guide.md +15 -14
- package/package.json +1 -1
package/dist/lib/build.js
CHANGED
|
@@ -251,6 +251,9 @@ export async function build(configPath = 'esm-styles.config.js') {
|
|
|
251
251
|
.join('\n') +
|
|
252
252
|
'\n';
|
|
253
253
|
await fs.writeFile(mainCssPath, mainCss, 'utf8');
|
|
254
|
+
// 6. Create timestamp file
|
|
255
|
+
const timestampPath = path.join(normalizedBasePath, config.timestampOutputPath || '', 'timestamp.mjs');
|
|
256
|
+
await fs.writeFile(timestampPath, `export default ${Date.now()}`, 'utf8');
|
|
254
257
|
}
|
|
255
258
|
// Helper for file URL import
|
|
256
259
|
import { pathToFileURL as pathToFileUrl } from 'node:url';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/doc/usage-guide.md
CHANGED
|
@@ -144,20 +144,21 @@ export default {
|
|
|
144
144
|
|
|
145
145
|
### Configuration Properties
|
|
146
146
|
|
|
147
|
-
| Property
|
|
148
|
-
|
|
|
149
|
-
| `basePath`
|
|
150
|
-
| `sourcePath`
|
|
151
|
-
| `outputPath`
|
|
152
|
-
| `sourceFilesSuffix`
|
|
153
|
-
| `floors`
|
|
154
|
-
| `importFloors`
|
|
155
|
-
| `mainCssFile`
|
|
156
|
-
| `globalVariables`
|
|
157
|
-
| `globalRootSelector`
|
|
158
|
-
| `media`
|
|
159
|
-
| `mediaSelectors`
|
|
160
|
-
| `mediaQueries`
|
|
147
|
+
| Property | Description |
|
|
148
|
+
| --------------------- | ------------------------------------------------------------------------- |
|
|
149
|
+
| `basePath` | Base directory for all styles, relative to where the build command is run |
|
|
150
|
+
| `sourcePath` | Directory inside `basePath` containing source style files |
|
|
151
|
+
| `outputPath` | Directory inside `basePath` where output CSS files will be written |
|
|
152
|
+
| `sourceFilesSuffix` | Suffix for source style files (default: `.styles.mjs`) |
|
|
153
|
+
| `floors` | Array of floor configurations, defining sources, layers, and output paths |
|
|
154
|
+
| `importFloors` | Array of floor names to include in the main CSS file |
|
|
155
|
+
| `mainCssFile` | Name of the output CSS file that imports all layer and variable files |
|
|
156
|
+
| `globalVariables` | Name of the file containing global CSS variables |
|
|
157
|
+
| `globalRootSelector` | Root selector for CSS variables (default: `:root`) |
|
|
158
|
+
| `media` | Object defining media types and their variable sets |
|
|
159
|
+
| `mediaSelectors` | Configuration for applying media types with selectors/queries |
|
|
160
|
+
| `mediaQueries` | Object defining shorthand names for media queries |
|
|
161
|
+
| `timestampOutputPath` | Path where timestamp.mjs file will be written (default: `basePath`) |
|
|
161
162
|
|
|
162
163
|
## JS to CSS Translation Rules
|
|
163
164
|
|