@vercel/microfrontends 1.4.0 → 1.4.2
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 +13 -0
- package/dist/bin/cli.cjs +39 -5
- package/dist/experimental/sveltekit.cjs +10 -0
- package/dist/experimental/sveltekit.cjs.map +1 -1
- package/dist/experimental/sveltekit.js +10 -0
- package/dist/experimental/sveltekit.js.map +1 -1
- package/dist/experimental/vite.cjs +10 -0
- package/dist/experimental/vite.cjs.map +1 -1
- package/dist/experimental/vite.js +10 -0
- package/dist/experimental/vite.js.map +1 -1
- package/dist/microfrontends/server.cjs +10 -0
- package/dist/microfrontends/server.cjs.map +1 -1
- package/dist/microfrontends/server.js +10 -0
- package/dist/microfrontends/server.js.map +1 -1
- package/dist/next/config.cjs +10 -0
- package/dist/next/config.cjs.map +1 -1
- package/dist/next/config.js +10 -0
- package/dist/next/config.js.map +1 -1
- package/dist/utils/mfe-port.cjs +10 -0
- package/dist/utils/mfe-port.cjs.map +1 -1
- package/dist/utils/mfe-port.js +10 -0
- package/dist/utils/mfe-port.js.map +1 -1
- package/package.json +1 -1
package/dist/next/config.js
CHANGED
|
@@ -172,17 +172,27 @@ function hasGitDirectory(dir) {
|
|
|
172
172
|
function hasPnpmWorkspaces(dir) {
|
|
173
173
|
return fs.existsSync(path.join(dir, "pnpm-workspace.yaml"));
|
|
174
174
|
}
|
|
175
|
+
function hasPackageJson(dir) {
|
|
176
|
+
return fs.existsSync(path.join(dir, "package.json"));
|
|
177
|
+
}
|
|
175
178
|
function findRepositoryRoot(startDir) {
|
|
176
179
|
if (process.env.NX_WORKSPACE_ROOT) {
|
|
177
180
|
return process.env.NX_WORKSPACE_ROOT;
|
|
178
181
|
}
|
|
179
182
|
let currentDir = startDir || process.cwd();
|
|
183
|
+
let lastPackageJsonDir = null;
|
|
180
184
|
while (currentDir !== path.parse(currentDir).root) {
|
|
181
185
|
if (hasGitDirectory(currentDir) || hasPnpmWorkspaces(currentDir)) {
|
|
182
186
|
return currentDir;
|
|
183
187
|
}
|
|
188
|
+
if (hasPackageJson(currentDir)) {
|
|
189
|
+
lastPackageJsonDir = currentDir;
|
|
190
|
+
}
|
|
184
191
|
currentDir = path.dirname(currentDir);
|
|
185
192
|
}
|
|
193
|
+
if (lastPackageJsonDir) {
|
|
194
|
+
return lastPackageJsonDir;
|
|
195
|
+
}
|
|
186
196
|
throw new Error(
|
|
187
197
|
`Could not find the root of the repository for ${startDir}. Please ensure that the directory is part of a Git repository. If you suspect that this should work, please file an issue to the Vercel team.`
|
|
188
198
|
);
|