jamdesk 1.1.66 → 1.1.67

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.
@@ -16,17 +16,24 @@ describe('findProjectDir', () => {
16
16
  await writeFile(path.join(root, 'docs.json'), '{}');
17
17
  expect(findProjectDir(root)).toBe(root);
18
18
  });
19
- it('returns the jamdesk/ subdirectory when docs.json lives there', async () => {
20
- await mkdir(path.join(root, 'jamdesk'));
21
- await writeFile(path.join(root, 'jamdesk/docs.json'), '{}');
22
- expect(findProjectDir(root)).toBe(path.join(root, 'jamdesk'));
19
+ it.each([['jamdesk'], ['docs'], ['documentation']])('returns the %s/ subdirectory when docs.json lives there', async (subdir) => {
20
+ await mkdir(path.join(root, subdir));
21
+ await writeFile(path.join(root, subdir, 'docs.json'), '{}');
22
+ expect(findProjectDir(root)).toBe(path.join(root, subdir));
23
23
  });
24
- it('prefers a root docs.json over jamdesk/docs.json when both exist', async () => {
24
+ it('prefers a root docs.json over a subdirectory docs.json', async () => {
25
25
  await writeFile(path.join(root, 'docs.json'), '{}');
26
26
  await mkdir(path.join(root, 'jamdesk'));
27
27
  await writeFile(path.join(root, 'jamdesk/docs.json'), '{}');
28
28
  expect(findProjectDir(root)).toBe(root);
29
29
  });
30
+ it('prefers jamdesk/ over docs/ when both have docs.json', async () => {
31
+ await mkdir(path.join(root, 'jamdesk'));
32
+ await writeFile(path.join(root, 'jamdesk/docs.json'), '{}');
33
+ await mkdir(path.join(root, 'docs'));
34
+ await writeFile(path.join(root, 'docs/docs.json'), '{}');
35
+ expect(findProjectDir(root)).toBe(path.join(root, 'jamdesk'));
36
+ });
30
37
  it('returns the cwd unchanged when no docs.json is found', async () => {
31
38
  expect(findProjectDir(root)).toBe(root);
32
39
  });
@@ -1 +1 @@
1
- {"version":3,"file":"find-project-dir.test.js","sourceRoot":"","sources":["../../../src/__tests__/unit/find-project-dir.test.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,OAAO,EAAE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,IAAI,CAAC,CAAC;QACpD,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QACxC,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,EAAE,IAAI,CAAC,CAAC;QAC5D,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,KAAK,IAAI,EAAE;QACpE,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;QACxC,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,EAAE,IAAI,CAAC,CAAC;QAC5D,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;QACrC,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,EAAE,IAAI,CAAC,CAAC;QACzD,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,KAAK,IAAI,EAAE;QACpE,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -2,9 +2,9 @@
2
2
  * Resolve the docs project root from a starting directory.
3
3
  *
4
4
  * Why: customers run `jamdesk dev` either from a docs-only repo (docs.json
5
- * at the root) or from a code+docs monorepo where docs live in a `jamdesk/`
6
- * subdirectory. The production build service supports the same shape via a
7
- * configured `docsPath`; this mirrors that for local CLI use.
5
+ * at the root) or from a code+docs monorepo where docs live in a subdirectory.
6
+ * The production build service supports the same shape via a configured
7
+ * `docsPath`; this mirrors that for local CLI use.
8
8
  *
9
9
  * Returns the cwd unchanged if no docs.json is found anywhere — caller
10
10
  * surfaces the standard "docs.json not found" error.
@@ -1 +1 @@
1
- {"version":3,"file":"find-project-dir.d.ts","sourceRoot":"","sources":["../../src/lib/find-project-dir.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAKlE"}
1
+ {"version":3,"file":"find-project-dir.d.ts","sourceRoot":"","sources":["../../src/lib/find-project-dir.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAOlE"}
@@ -1,12 +1,15 @@
1
1
  import fs from 'fs';
2
2
  import path from 'path';
3
+ // Mirrors the patterns checked by build-service/scripts/dev-project.cjs so the
4
+ // CLI auto-detects the same monorepo layouts as production builds.
5
+ const MONOREPO_DOCS_SUBDIRS = ['jamdesk', 'docs', 'documentation'];
3
6
  /**
4
7
  * Resolve the docs project root from a starting directory.
5
8
  *
6
9
  * Why: customers run `jamdesk dev` either from a docs-only repo (docs.json
7
- * at the root) or from a code+docs monorepo where docs live in a `jamdesk/`
8
- * subdirectory. The production build service supports the same shape via a
9
- * configured `docsPath`; this mirrors that for local CLI use.
10
+ * at the root) or from a code+docs monorepo where docs live in a subdirectory.
11
+ * The production build service supports the same shape via a configured
12
+ * `docsPath`; this mirrors that for local CLI use.
10
13
  *
11
14
  * Returns the cwd unchanged if no docs.json is found anywhere — caller
12
15
  * surfaces the standard "docs.json not found" error.
@@ -14,9 +17,11 @@ import path from 'path';
14
17
  export function findProjectDir(cwd = process.cwd()) {
15
18
  if (fs.existsSync(path.join(cwd, 'docs.json')))
16
19
  return cwd;
17
- const subdir = path.join(cwd, 'jamdesk');
18
- if (fs.existsSync(path.join(subdir, 'docs.json')))
19
- return subdir;
20
+ for (const subdir of MONOREPO_DOCS_SUBDIRS) {
21
+ const candidate = path.join(cwd, subdir);
22
+ if (fs.existsSync(path.join(candidate, 'docs.json')))
23
+ return candidate;
24
+ }
20
25
  return cwd;
21
26
  }
22
27
  //# sourceMappingURL=find-project-dir.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"find-project-dir.js","sourceRoot":"","sources":["../../src/lib/find-project-dir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc,OAAO,CAAC,GAAG,EAAE;IACxD,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAAE,OAAO,GAAG,CAAC;IAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IACzC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;QAAE,OAAO,MAAM,CAAC;IACjE,OAAO,GAAG,CAAC;AACb,CAAC"}
1
+ {"version":3,"file":"find-project-dir.js","sourceRoot":"","sources":["../../src/lib/find-project-dir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,+EAA+E;AAC/E,mEAAmE;AACnE,MAAM,qBAAqB,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;AAEnE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAAC,MAAc,OAAO,CAAC,GAAG,EAAE;IACxD,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QAAE,OAAO,GAAG,CAAC;IAC3D,KAAK,MAAM,MAAM,IAAI,qBAAqB,EAAE,CAAC;QAC3C,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACzC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;YAAE,OAAO,SAAS,CAAC;IACzE,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamdesk",
3
- "version": "1.1.66",
3
+ "version": "1.1.67",
4
4
  "description": "CLI for Jamdesk — build, preview, and deploy documentation sites from MDX. Dev server with hot reload, 50+ components, OpenAPI support, AI search, and Mintlify migration",
5
5
  "keywords": [
6
6
  "jamdesk",