MCPcopy Index your code
hub / github.com/QwikDev/qwik / _computeWorkspaceRoot

Function _computeWorkspaceRoot

e2e/qwik-cli-e2e/utils/index.ts:188–201  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

186export const workspaceRoot = _computeWorkspaceRoot(process.cwd());
187
188function _computeWorkspaceRoot(cwd: string) {
189 if (dirname(cwd) === cwd) {
190 return process.cwd();
191 }
192
193 const packageJsonAtCwd = join(cwd, 'package.json');
194 if (existsSync(packageJsonAtCwd)) {
195 const content = JSON.parse(readFileSync(packageJsonAtCwd, 'utf-8'));
196 if (content.name === 'qwik-monorepo') {
197 return cwd;
198 }
199 }
200 return _computeWorkspaceRoot(dirname(cwd));
201}
202
203export function log(text: string) {
204 // eslint-disable-next-line no-console

Callers 1

index.tsFile · 0.85

Calls 3

dirnameFunction · 0.90
joinFunction · 0.90
parseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…