mikser-io 9.78.0 → 9.79.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.
@@ -882,6 +882,14 @@ surfaces that turn silence into a statement:
882
882
  - **A plugin that appears to do nothing** — `No plugins loaded` with a
883
883
  config present is a warning naming the file. A config that fails to
884
884
  load now exits non-zero rather than loading as empty.
885
+ - **A derivative for a source that is gone.** The assets folder sits at
886
+ the working-folder root, outside both `outputFolder` and the runtime
887
+ folder, and it is symlinked INTO the output — so an orphaned derivative
888
+ is still served, and `find out -type f` cannot see it (that tree is
889
+ reached through a link; use `find -L`). `--clear` removes the folder and
890
+ re-derives what still has a source. An ordinary build does not: the
891
+ files plugin performs no delete sweep, so a source deleted from disk
892
+ stays in the catalog and its derivative stays with it.
885
893
  - **A postprocess that could not run** — a stage whose external
886
894
  dependency is absent (no chrome for a PDF, no binary for a conversion)
887
895
  reports a fault naming the subsystem, and each page that wanted that
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mikser-io",
3
- "version": "9.78.0",
3
+ "version": "9.79.0",
4
4
  "files": [
5
5
  "app.js",
6
6
  "index.js",
@@ -291,6 +291,28 @@ export function assets(options = {}) {
291
291
  runtime.options.assets = options.assetsFolder || 'assets'
292
292
  runtime.options.assetsFolder = path.join(runtime.options.workingFolder, runtime.options.assets)
293
293
  logger.debug('Assets folder: %s', runtime.options.assetsFolder)
294
+
295
+ // --clear means "throw away what was derived and build it again", and
296
+ // derivatives are derived — but this folder sits at the working-folder
297
+ // root, outside both outputFolder and runtimeFolder, so the engine's
298
+ // clear never reached it. Anything here whose source had gone stayed
299
+ // forever: still on disk, still SERVED through the symlink below, and
300
+ // invisible to `find out -type f` because that tree is reached through
301
+ // a link. The only way out was deleting the folder by hand.
302
+ //
303
+ // Cleared here rather than in the engine because the path is not known
304
+ // until this plugin resolves it — the engine's clear runs before any
305
+ // plugin's onLoaded.
306
+ //
307
+ // Whole folder, not a sweep of orphans: identifying an orphan means
308
+ // mapping a derivative back to a source, which is the id/name mapping
309
+ // that has bitten this plugin twice. --clear already accepts a full
310
+ // rebuild, so re-deriving is the honest cost of asking for one.
311
+ if (runtime.options.clear) {
312
+ await rm(runtime.options.assetsFolder, { recursive: true, force: true })
313
+ logger.info('Assets cleared: %s', runtime.options.assetsFolder)
314
+ }
315
+
294
316
  await mkdir(runtime.options.assetsFolder, { recursive: true })
295
317
 
296
318
  let link = path.join(runtime.options.outputFolder, runtime.options.assets)