@stacksjs/iconify-generator 0.2.22 → 0.2.24
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/package.json +2 -2
- package/src/index.ts +15 -3
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/iconify-generator",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.24",
|
|
5
5
|
"description": "Generator for Iconify icon packages",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
"dev": "bun build.ts --watch"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@stacksjs/iconify-core": "0.2.
|
|
36
|
+
"@stacksjs/iconify-core": "0.2.24"
|
|
37
37
|
}
|
|
38
38
|
}
|
package/src/index.ts
CHANGED
|
@@ -305,13 +305,25 @@ const distEntry = join(distDir, 'index.js')
|
|
|
305
305
|
// Skip rebuild when dist is already up to date. Makes prepublishOnly a
|
|
306
306
|
// no-op when CI pre-built the package in parallel earlier in the
|
|
307
307
|
// pipeline — and a no-op for local re-runs that didn't touch src/.
|
|
308
|
+
//
|
|
309
|
+
// Walks src/ recursively so changes inside subdirectories (if we ever
|
|
310
|
+
// add them) properly invalidate the cached dist.
|
|
308
311
|
function isDistFresh() {
|
|
309
312
|
if (!existsSync(distEntry)) return false
|
|
310
313
|
const distMtime = statSync(distEntry).mtimeMs
|
|
311
|
-
|
|
312
|
-
|
|
314
|
+
function newer(dir) {
|
|
315
|
+
for (const name of readdirSync(dir)) {
|
|
316
|
+
const p = join(dir, name)
|
|
317
|
+
const s = statSync(p)
|
|
318
|
+
if (s.isDirectory()) {
|
|
319
|
+
if (newer(p)) return true
|
|
320
|
+
} else if (s.mtimeMs > distMtime) {
|
|
321
|
+
return true
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return false
|
|
313
325
|
}
|
|
314
|
-
return
|
|
326
|
+
return !newer(srcDir)
|
|
315
327
|
}
|
|
316
328
|
|
|
317
329
|
if (isDistFresh()) {
|