@meddleware/frontend-config 0.0.5 → 0.0.6

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/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.0.6] - 2026-11-07
9
+
10
+ ### Fixed
11
+
12
+ - `mw-network-status` and `mw-sync` did nothing when run as an installed bin (they compared the symlink in `node_modules/.bin` with the real path); both now compare real paths, and a test runs each through a symlink.
13
+
8
14
  ## [0.0.5] - 2026-11-07
9
15
 
10
16
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meddleware/frontend-config",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "type": "module",
5
5
  "description": "Shared frontend tooling for MeddleWare apps: browser support, ESLint, Stylelint, html-validate, PostCSS, Playwright, axe, screenshots, Lighthouse and the Vite target.",
6
6
  "license": "0BSD",
@@ -9,7 +9,7 @@
9
9
  // The file is committed, so the page and its tests never depend on a hidden build step; CI runs `--check`, and bumping a client package
10
10
  // (Dependabot, or a release that adds a mainnet record) fails the check until the file is regenerated with `--out`. The repository needs `@meddleware/web-utils` and the two clients
11
11
  // (`@meddleware/access-gate-client`, `@meddleware/sealed-storage-client`) installed; it fails when one is missing rather than guess.
12
- import { readFileSync, writeFileSync } from 'node:fs'
12
+ import { readFileSync, realpathSync, writeFileSync } from 'node:fs'
13
13
  import { createRequire } from 'node:module'
14
14
  import { join } from 'node:path'
15
15
  import { pathToFileURL } from 'node:url'
@@ -28,7 +28,8 @@ export function networkStatus(utils, records) {
28
28
  return utils.networkAvailability(Object.fromEntries(Object.entries(records).map(([name, deployments]) => [name, Object.keys(deployments)])))
29
29
  }
30
30
 
31
- if (import.meta.url === pathToFileURL(process.argv[1] ?? '').href) {
31
+ // `process.argv[1]` is the symlink in node_modules/.bin when run as a bin: compare real paths.
32
+ if (process.argv[1] && import.meta.url === pathToFileURL(realpathSync(process.argv[1])).href) {
32
33
  const args = process.argv.slice(2)
33
34
  const outIndex = args.indexOf('--out')
34
35
  const out = outIndex >= 0 ? args[outIndex + 1] : undefined
package/src/sync.js CHANGED
@@ -11,7 +11,7 @@
11
11
  // kind "app" → .github/dependabot.yml, .dockerignore, postcss.config.js, stylelint.config.js are the templates
12
12
  // csp a profile of ./csp.js → the Dockerfile's `ARG CSP="…"` is that profile's policy (`docs` keeps the script hashes already there)
13
13
  // lhci true → .github/audit-allowlist.json is the template (the dated allowlist for the Lighthouse CI tool chain; one expiry, reviewed together)
14
- import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'
14
+ import { existsSync, mkdirSync, readFileSync, realpathSync, writeFileSync } from 'node:fs'
15
15
  import { dirname, join } from 'node:path'
16
16
  import { fileURLToPath } from 'node:url'
17
17
  import { cspForProfile } from './csp.js'
@@ -67,7 +67,8 @@ export function sync(root, options = {}) {
67
67
  return out
68
68
  }
69
69
 
70
- if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
70
+ // `process.argv[1]` is the symlink in node_modules/.bin when run as a bin: compare real paths.
71
+ if (process.argv[1] && fileURLToPath(import.meta.url) === realpathSync(process.argv[1])) {
71
72
  const args = process.argv.slice(2)
72
73
  const write = args.includes('--write')
73
74
  if (!write && !args.includes('--check')) {