lectio-docs 0.1.0 → 0.1.1

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.
Files changed (2) hide show
  1. package/bin/lectio.mjs +11 -5
  2. package/package.json +1 -1
package/bin/lectio.mjs CHANGED
@@ -132,14 +132,20 @@ await buildSearchIndex({
132
132
 
133
133
  // --- 4. dependency resolution via symlink -----------------------------------
134
134
  // Own package dir = parent of bin/. Where the deps live depends on layout:
135
- // - workspace dev / npm with nesting: <own>/node_modules exists — use it
135
+ // - workspace dev / npm with nesting: <own>/node_modules holds them
136
136
  // - installed via pnpm: realpath resolves into the virtual store, whose
137
137
  // parent dir holds this package's deps as siblings
138
- // - npm flat: <own>/node_modules absent, dirname(realpath) is the flat
139
- // node_modules that holds everything
138
+ // - npm flat: dirname(realpath) is the flat node_modules holding everything
139
+ //
140
+ // We can't just test whether <own>/node_modules EXISTS: pnpm creates an empty
141
+ // one inside the package in the virtual store, so its presence doesn't mean the
142
+ // deps are there. Pick the candidate that actually holds a known direct dep
143
+ // (react-router) instead.
140
144
  const ownPackageDir = realpathSync(pkgRoot);
141
- const ownNodeModules = join(ownPackageDir, 'node_modules');
142
- const depsDir = existsSync(ownNodeModules) ? ownNodeModules : dirname(ownPackageDir);
145
+ const depsDir =
146
+ [join(ownPackageDir, 'node_modules'), dirname(ownPackageDir)].find((dir) =>
147
+ existsSync(join(dir, 'react-router')),
148
+ ) ?? dirname(ownPackageDir);
143
149
 
144
150
  // A REAL node_modules directory with one symlink per package — not a single
145
151
  // symlink to depsDir. Vite writes into node_modules (.vite-temp config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lectio-docs",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Run one command, get a docs site: collects scattered repo docs and builds a static, searchable site.",
5
5
  "license": "MIT",
6
6
  "type": "module",