@graphql-markdown/nuxt-theme 0.0.0-stage → 0.1.0
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/README.md +196 -2
- package/app/app-config.d.ts +15 -0
- package/app/app.config.ts +22 -0
- package/app/assets/css/main.css +85 -0
- package/app/components/ApiCodeColumn.vue +53 -0
- package/app/components/ApiDocumentContent.vue +45 -0
- package/app/components/ApiNamespaceLanding.vue +29 -0
- package/app/components/ApiOverviewGrid.vue +38 -0
- package/app/components/ApiSinglePageEntry.vue +75 -0
- package/app/components/ApiSinglePageSection.vue +32 -0
- package/app/components/SchemaCodeCard.vue +68 -0
- package/app/components/SiteFooter.vue +13 -0
- package/app/components/SiteHeader.vue +31 -0
- package/app/composables/useApiCodeCards.ts +96 -0
- package/app/composables/useApiDocument.ts +69 -0
- package/app/composables/useApiNavigation.ts +212 -0
- package/app/composables/useApiReferencePage.ts +164 -0
- package/app/composables/useApiSinglePage.ts +320 -0
- package/app/composables/useClipboardCopy.ts +56 -0
- package/app/composables/useHierarchyMode.ts +48 -0
- package/app/layouts/reference.vue +128 -0
- package/app/pages/api-reference/[...slug].vue +233 -0
- package/app/utils/api-document.ts +329 -0
- package/app/utils/mdc.ts +60 -0
- package/app/utils/navigation-tree.ts +28 -0
- package/bin/swizzle.mjs +256 -0
- package/content.config.ts +13 -0
- package/formatter.ts +77 -0
- package/generate.ts +91 -0
- package/modules/generate.ts +72 -0
- package/modules/prerender.ts +104 -0
- package/nuxt.config.ts +16 -0
- package/package.json +81 -4
- package/swizzle.manifest.mjs +84 -0
- package/swizzle.manifest.ts +11 -0
package/package.json
CHANGED
|
@@ -1,6 +1,83 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-markdown/nuxt-theme",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A Nuxt layer for building GraphQL API reference sites",
|
|
5
|
+
"homepage": "https://graphql-markdown.dev",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/graphql-markdown/graphql-markdown/issues"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/graphql-markdown/graphql-markdown.git",
|
|
12
|
+
"directory": "packages/nuxt-theme"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"nuxt",
|
|
16
|
+
"nuxt-layer",
|
|
17
|
+
"graphql",
|
|
18
|
+
"graphql-schema",
|
|
19
|
+
"documentation",
|
|
20
|
+
"api-reference",
|
|
21
|
+
"markdown",
|
|
22
|
+
"graphql-markdown"
|
|
23
|
+
],
|
|
24
|
+
"author": {
|
|
25
|
+
"name": "Gregory Heitz"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"type": "module",
|
|
29
|
+
"main": "./nuxt.config.ts",
|
|
30
|
+
"exports": {
|
|
31
|
+
".": "./nuxt.config.ts",
|
|
32
|
+
"./generate": "./generate.ts",
|
|
33
|
+
"./package.json": "./package.json"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "echo \"no build step — Nuxt layer ships source\"",
|
|
37
|
+
"lint": "eslint --config ../../packages/tooling-config/eslint/config.ts \"app/**/*.{ts,vue}\" \"modules/**/*.ts\" \"*.ts\" \"bin/**/*.mjs\" \"tests/**/*.ts\" --ignore-pattern \"tests/fixture*/**\"",
|
|
38
|
+
"lint:fix": "eslint --config ../../packages/tooling-config/eslint/config.ts \"app/**/*.{ts,vue}\" \"modules/**/*.ts\" \"*.ts\" \"bin/**/*.mjs\" \"tests/**/*.ts\" --ignore-pattern \"tests/fixture*/**\" --fix",
|
|
39
|
+
"prettier": "prettier \"app/**/*.{ts,vue,css}\" \"modules/**/*.ts\" \"*.ts\" \"bin/**/*.mjs\" \"tests/**/*.ts\" \"!tests/fixture*/**\" --check",
|
|
40
|
+
"prettier:fix": "prettier \"app/**/*.{ts,vue,css}\" \"modules/**/*.ts\" \"*.ts\" \"bin/**/*.mjs\" \"tests/**/*.ts\" \"!tests/fixture*/**\" --write",
|
|
41
|
+
"ts:check": "nuxi typecheck",
|
|
42
|
+
"test": "vitest run --passWithNoTests",
|
|
43
|
+
"test:unit": "vitest run --passWithNoTests tests/unit",
|
|
44
|
+
"test:integration": "vitest run --passWithNoTests tests/integration",
|
|
45
|
+
"test:ci": "vitest run --passWithNoTests --silent --sequence.shuffle"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"@clack/prompts": "^1.0.0",
|
|
49
|
+
"@graphql-markdown/cli": "",
|
|
50
|
+
"@nuxt/content": "^3.16.0",
|
|
51
|
+
"@nuxt/kit": "^4.5.2",
|
|
52
|
+
"@nuxt/ui": "^4.11.0",
|
|
53
|
+
"consola": "^3.4.2",
|
|
54
|
+
"shiki": "^4.4.3",
|
|
55
|
+
"tailwindcss": "^4.3.3"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@graphql-markdown/tooling-config": "",
|
|
59
|
+
"nuxt": "^4.5.2",
|
|
60
|
+
"typescript": "6.0.3",
|
|
61
|
+
"vue-tsc": "^3.3.11"
|
|
62
|
+
},
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">=22.12.0"
|
|
65
|
+
},
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"bin": {
|
|
70
|
+
"gqlmd-swizzle": "./bin/swizzle.mjs"
|
|
71
|
+
},
|
|
72
|
+
"files": [
|
|
73
|
+
"app",
|
|
74
|
+
"modules",
|
|
75
|
+
"bin",
|
|
76
|
+
"content.config.ts",
|
|
77
|
+
"formatter.ts",
|
|
78
|
+
"generate.ts",
|
|
79
|
+
"nuxt.config.ts",
|
|
80
|
+
"swizzle.manifest.ts",
|
|
81
|
+
"swizzle.manifest.mjs"
|
|
82
|
+
]
|
|
83
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {object} SwizzleEntry
|
|
3
|
+
* @property {string} id
|
|
4
|
+
* @property {string} description
|
|
5
|
+
* @property {string} sourcePath
|
|
6
|
+
* @property {string} targetPath
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Builds a manifest entry. Swizzled files land at the same relative path in
|
|
11
|
+
* the consumer's project, so `targetPath` mirrors `sourcePath`.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} id
|
|
14
|
+
* @param {string} path
|
|
15
|
+
* @param {string} description
|
|
16
|
+
* @returns {SwizzleEntry}
|
|
17
|
+
*/
|
|
18
|
+
const entry = (id, path, description) => {
|
|
19
|
+
return { id, sourcePath: path, targetPath: path, description };
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Builds an entry for a component living at `app/components/<id>.vue`.
|
|
24
|
+
*
|
|
25
|
+
* @param {string} id
|
|
26
|
+
* @param {string} description
|
|
27
|
+
* @returns {SwizzleEntry}
|
|
28
|
+
*/
|
|
29
|
+
const component = (id, description) => {
|
|
30
|
+
return entry(id, `app/components/${id}.vue`, description);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Single source of truth for the swizzle manifest — loaded directly by
|
|
35
|
+
* `bin/swizzle.mjs` (plain JS, no TypeScript loader required at runtime so
|
|
36
|
+
* the CLI works on any Node >=22.12 without relying on experimental type
|
|
37
|
+
* stripping) and re-exported with types by `swizzle.manifest.ts` for
|
|
38
|
+
* everything else in this package. Do not duplicate this array anywhere —
|
|
39
|
+
* edit it here only.
|
|
40
|
+
*
|
|
41
|
+
* @type {SwizzleEntry[]}
|
|
42
|
+
*/
|
|
43
|
+
export const swizzleManifest = [
|
|
44
|
+
component("SiteHeader", "Top navigation bar"),
|
|
45
|
+
component("SiteFooter", "Bottom attribution bar"),
|
|
46
|
+
component(
|
|
47
|
+
"SchemaCodeCard",
|
|
48
|
+
"Highlighted code panel (schema definitions and examples)",
|
|
49
|
+
),
|
|
50
|
+
component(
|
|
51
|
+
"ApiOverviewGrid",
|
|
52
|
+
"Card grid for displaying API reference overview and namespace sections",
|
|
53
|
+
),
|
|
54
|
+
component(
|
|
55
|
+
"ApiNamespaceLanding",
|
|
56
|
+
"Header and grid for API reference landing pages and namespace chooser",
|
|
57
|
+
),
|
|
58
|
+
component(
|
|
59
|
+
"ApiDocumentContent",
|
|
60
|
+
"Document content with collapsible sections for API reference pages",
|
|
61
|
+
),
|
|
62
|
+
component(
|
|
63
|
+
"ApiCodeColumn",
|
|
64
|
+
"Code column sidebar with highlighted schema definitions and examples",
|
|
65
|
+
),
|
|
66
|
+
component(
|
|
67
|
+
"ApiSinglePageSection",
|
|
68
|
+
"Bucket heading + entries for the single-page reference view",
|
|
69
|
+
),
|
|
70
|
+
component(
|
|
71
|
+
"ApiSinglePageEntry",
|
|
72
|
+
"One query/mutation/type's content on the single-page reference view",
|
|
73
|
+
),
|
|
74
|
+
entry(
|
|
75
|
+
"ReferenceLayout",
|
|
76
|
+
"app/layouts/reference.vue",
|
|
77
|
+
"Sidebar + header chrome around the reference page",
|
|
78
|
+
),
|
|
79
|
+
entry(
|
|
80
|
+
"ReferencePage",
|
|
81
|
+
"app/pages/api-reference/[...slug].vue",
|
|
82
|
+
"The two-column reference page itself",
|
|
83
|
+
),
|
|
84
|
+
];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SwizzleEntry {
|
|
2
|
+
id: string;
|
|
3
|
+
description: string;
|
|
4
|
+
sourcePath: string;
|
|
5
|
+
targetPath: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
// Re-exports the single source of truth in `swizzle.manifest.mjs` — do not
|
|
9
|
+
// redeclare the array here, it would silently drift from what the CLI (which
|
|
10
|
+
// loads the .mjs directly) actually uses.
|
|
11
|
+
export { swizzleManifest } from "./swizzle.manifest.mjs";
|