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.
- package/bin/lectio.mjs +11 -5
- 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
|
|
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:
|
|
139
|
-
//
|
|
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
|
|
142
|
-
|
|
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
|