create-specment 0.2.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.
Files changed (113) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +314 -0
  3. package/bin/commands/create.d.ts +3 -0
  4. package/bin/commands/create.d.ts.map +1 -0
  5. package/bin/commands/create.js +30 -0
  6. package/bin/commands/create.js.map +1 -0
  7. package/bin/constants/languages.d.ts +15 -0
  8. package/bin/constants/languages.d.ts.map +1 -0
  9. package/bin/constants/languages.js +14 -0
  10. package/bin/constants/languages.js.map +1 -0
  11. package/bin/core/interactive-setup.d.ts +15 -0
  12. package/bin/core/interactive-setup.d.ts.map +1 -0
  13. package/bin/core/interactive-setup.js +171 -0
  14. package/bin/core/interactive-setup.js.map +1 -0
  15. package/bin/core/interactive-setup.test.d.ts +2 -0
  16. package/bin/core/interactive-setup.test.d.ts.map +1 -0
  17. package/bin/core/interactive-setup.test.js +97 -0
  18. package/bin/core/interactive-setup.test.js.map +1 -0
  19. package/bin/core/project-generator.d.ts +12 -0
  20. package/bin/core/project-generator.d.ts.map +1 -0
  21. package/bin/core/project-generator.js +83 -0
  22. package/bin/core/project-generator.js.map +1 -0
  23. package/bin/features/index.d.ts +3 -0
  24. package/bin/features/index.d.ts.map +1 -0
  25. package/bin/features/index.js +47 -0
  26. package/bin/features/index.js.map +1 -0
  27. package/bin/generators/docusaurus-config.d.ts +3 -0
  28. package/bin/generators/docusaurus-config.d.ts.map +1 -0
  29. package/bin/generators/docusaurus-config.js +285 -0
  30. package/bin/generators/docusaurus-config.js.map +1 -0
  31. package/bin/generators/package-json.d.ts +3 -0
  32. package/bin/generators/package-json.d.ts.map +1 -0
  33. package/bin/generators/package-json.js +98 -0
  34. package/bin/generators/package-json.js.map +1 -0
  35. package/bin/generators/template-files.d.ts +3 -0
  36. package/bin/generators/template-files.d.ts.map +1 -0
  37. package/bin/generators/template-files.js +370 -0
  38. package/bin/generators/template-files.js.map +1 -0
  39. package/bin/index.d.ts +5 -0
  40. package/bin/index.d.ts.map +1 -0
  41. package/bin/index.js +37 -0
  42. package/bin/index.js.map +1 -0
  43. package/bin/plugins/i18n-integration.d.ts +25 -0
  44. package/bin/plugins/i18n-integration.d.ts.map +1 -0
  45. package/bin/plugins/i18n-integration.js +309 -0
  46. package/bin/plugins/i18n-integration.js.map +1 -0
  47. package/bin/plugins/plantuml-integration.d.ts +17 -0
  48. package/bin/plugins/plantuml-integration.d.ts.map +1 -0
  49. package/bin/plugins/plantuml-integration.js +111 -0
  50. package/bin/plugins/plantuml-integration.js.map +1 -0
  51. package/bin/plugins/redoc-integration.d.ts +25 -0
  52. package/bin/plugins/redoc-integration.d.ts.map +1 -0
  53. package/bin/plugins/redoc-integration.js +372 -0
  54. package/bin/plugins/redoc-integration.js.map +1 -0
  55. package/bin/plugins/search-integration.d.ts +20 -0
  56. package/bin/plugins/search-integration.d.ts.map +1 -0
  57. package/bin/plugins/search-integration.js +165 -0
  58. package/bin/plugins/search-integration.js.map +1 -0
  59. package/bin/templates/index.d.ts +4 -0
  60. package/bin/templates/index.d.ts.map +1 -0
  61. package/bin/templates/index.js +60 -0
  62. package/bin/templates/index.js.map +1 -0
  63. package/bin/templates/template-definitions.d.ts +10 -0
  64. package/bin/templates/template-definitions.d.ts.map +1 -0
  65. package/bin/templates/template-definitions.js +296 -0
  66. package/bin/templates/template-definitions.js.map +1 -0
  67. package/bin/tests/integration.test.d.ts +2 -0
  68. package/bin/tests/integration.test.d.ts.map +1 -0
  69. package/bin/tests/integration.test.js +171 -0
  70. package/bin/tests/integration.test.js.map +1 -0
  71. package/bin/types/index.d.ts +44 -0
  72. package/bin/types/index.d.ts.map +1 -0
  73. package/bin/types/index.js +2 -0
  74. package/bin/types/index.js.map +1 -0
  75. package/bin/utils/config-merger.d.ts +32 -0
  76. package/bin/utils/config-merger.d.ts.map +1 -0
  77. package/bin/utils/config-merger.js +216 -0
  78. package/bin/utils/config-merger.js.map +1 -0
  79. package/bin/utils/errors.d.ts +9 -0
  80. package/bin/utils/errors.d.ts.map +1 -0
  81. package/bin/utils/errors.js +22 -0
  82. package/bin/utils/errors.js.map +1 -0
  83. package/bin/utils/install.d.ts +5 -0
  84. package/bin/utils/install.d.ts.map +1 -0
  85. package/bin/utils/install.js +38 -0
  86. package/bin/utils/install.js.map +1 -0
  87. package/bin/utils/message-formatter.d.ts +15 -0
  88. package/bin/utils/message-formatter.d.ts.map +1 -0
  89. package/bin/utils/message-formatter.js +85 -0
  90. package/bin/utils/message-formatter.js.map +1 -0
  91. package/bin/utils/template-processor.d.ts +54 -0
  92. package/bin/utils/template-processor.d.ts.map +1 -0
  93. package/bin/utils/template-processor.js +139 -0
  94. package/bin/utils/template-processor.js.map +1 -0
  95. package/bin/utils/template-processor.test.d.ts +2 -0
  96. package/bin/utils/template-processor.test.d.ts.map +1 -0
  97. package/bin/utils/template-processor.test.js +120 -0
  98. package/bin/utils/template-processor.test.js.map +1 -0
  99. package/bin/utils/version.d.ts +2 -0
  100. package/bin/utils/version.d.ts.map +1 -0
  101. package/bin/utils/version.js +10 -0
  102. package/bin/utils/version.js.map +1 -0
  103. package/package.json +67 -0
  104. package/templates/classic-spec/docusaurus.config.js.template +106 -0
  105. package/templates/classic-spec/package.json.template +36 -0
  106. package/templates/external-design/docusaurus.config.js.template +123 -0
  107. package/templates/external-design/package.json.template +36 -0
  108. package/templates/internal-design/docusaurus.config.js.template +123 -0
  109. package/templates/internal-design/package.json.template +36 -0
  110. package/templates/project-analysis/docusaurus.config.js.template +113 -0
  111. package/templates/project-analysis/package.json.template +36 -0
  112. package/templates/requirements/docusaurus.config.js.template +119 -0
  113. package/templates/requirements/package.json.template +36 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-processor.test.d.ts","sourceRoot":"","sources":["../../src/utils/template-processor.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,120 @@
1
+ import { describe, it, expect, beforeEach } from 'vitest';
2
+ import { TemplateProcessor, createTemplateProcessor } from './template-processor.js';
3
+ describe('TemplateProcessor', () => {
4
+ let processor;
5
+ beforeEach(() => {
6
+ processor = new TemplateProcessor({
7
+ projectName: 'test-project',
8
+ author: 'Test Author',
9
+ email: 'test@example.com',
10
+ });
11
+ });
12
+ describe('processTemplate', () => {
13
+ it('should replace simple variables', () => {
14
+ const template = 'Hello {{projectName}}!';
15
+ const result = processor.processTemplate(template);
16
+ expect(result).toBe('Hello test-project!');
17
+ });
18
+ it('should replace multiple variables', () => {
19
+ const template = 'Project: {{projectName}}, Author: {{author}}';
20
+ const result = processor.processTemplate(template);
21
+ expect(result).toBe('Project: test-project, Author: Test Author');
22
+ });
23
+ it('should handle undefined variables gracefully', () => {
24
+ const template = 'Hello {{unknownVariable}}!';
25
+ const result = processor.processTemplate(template);
26
+ expect(result).toBe('Hello {{unknownVariable}}!');
27
+ });
28
+ it('should handle templates with no variables', () => {
29
+ const template = 'This is a plain text template';
30
+ const result = processor.processTemplate(template);
31
+ expect(result).toBe('This is a plain text template');
32
+ });
33
+ it('should handle empty template', () => {
34
+ const template = '';
35
+ const result = processor.processTemplate(template);
36
+ expect(result).toBe('');
37
+ });
38
+ it('should handle malformed variable syntax', () => {
39
+ const template = 'Hello {projectName} and {{author}';
40
+ const result = processor.processTemplate(template);
41
+ expect(result).toBe('Hello {projectName} and {{author}');
42
+ });
43
+ });
44
+ describe('setVariable and setVariables', () => {
45
+ it('should set single variable', () => {
46
+ processor.setVariable('customVar', 'custom value');
47
+ const result = processor.processTemplate('{{customVar}}');
48
+ expect(result).toBe('custom value');
49
+ });
50
+ it('should set multiple variables', () => {
51
+ processor.setVariables({
52
+ var1: 'value1',
53
+ var2: 'value2',
54
+ });
55
+ const result = processor.processTemplate('{{var1}} and {{var2}}');
56
+ expect(result).toBe('value1 and value2');
57
+ });
58
+ it('should override existing variables', () => {
59
+ processor.setVariable('projectName', 'new-project-name');
60
+ const result = processor.processTemplate('{{projectName}}');
61
+ expect(result).toBe('new-project-name');
62
+ });
63
+ });
64
+ describe('generateDerivedVariables', () => {
65
+ it('should generate derived variables from project name', () => {
66
+ const processor = new TemplateProcessor({ projectName: 'my-awesome-project' });
67
+ processor.generateDerivedVariables();
68
+ const variables = processor.getVariables();
69
+ expect(variables.projectNameCamel).toBe('myAwesomeProject');
70
+ expect(variables.projectNamePascal).toBe('MyAwesomeProject');
71
+ expect(variables.projectNameConstant).toBe('MY_AWESOME_PROJECT');
72
+ expect(variables.projectNameKebab).toBe('my-awesome-project');
73
+ });
74
+ it('should handle single word project names', () => {
75
+ const processor = new TemplateProcessor({ projectName: 'project' });
76
+ processor.generateDerivedVariables();
77
+ const variables = processor.getVariables();
78
+ expect(variables.projectNameCamel).toBe('project');
79
+ expect(variables.projectNamePascal).toBe('Project');
80
+ expect(variables.projectNameConstant).toBe('PROJECT');
81
+ expect(variables.projectNameKebab).toBe('project');
82
+ });
83
+ });
84
+ describe('default variables', () => {
85
+ it('should set default date and year', () => {
86
+ const processor = new TemplateProcessor({});
87
+ const variables = processor.getVariables();
88
+ expect(variables.date).toMatch(/^\d{4}-\d{2}-\d{2}$/); // YYYY-MM-DD format
89
+ expect(variables.year).toMatch(/^\d{4}$/); // YYYY format
90
+ });
91
+ it('should set default project name', () => {
92
+ const processor = new TemplateProcessor({});
93
+ const variables = processor.getVariables();
94
+ expect(variables.projectName).toBe('my-project');
95
+ });
96
+ });
97
+ });
98
+ describe('createTemplateProcessor', () => {
99
+ it('should create processor with project name', async () => {
100
+ const processor = await createTemplateProcessor('test-project');
101
+ const variables = processor.getVariables();
102
+ expect(variables.projectName).toBe('test-project');
103
+ expect(variables.description).toBe('Documentation for test-project');
104
+ });
105
+ it('should include derived variables', async () => {
106
+ const processor = await createTemplateProcessor('my-test-project');
107
+ const variables = processor.getVariables();
108
+ expect(variables.projectNameCamel).toBe('myTestProject');
109
+ expect(variables.projectNamePascal).toBe('MyTestProject');
110
+ expect(variables.projectNameConstant).toBe('MY_TEST_PROJECT');
111
+ });
112
+ it('should accept additional variables', async () => {
113
+ const processor = await createTemplateProcessor('test-project', {
114
+ customVar: 'custom value',
115
+ });
116
+ const variables = processor.getVariables();
117
+ expect(variables.customVar).toBe('custom value');
118
+ });
119
+ });
120
+ //# sourceMappingURL=template-processor.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-processor.test.js","sourceRoot":"","sources":["../../src/utils/template-processor.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAErF,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;IACjC,IAAI,SAA4B,CAAC;IAEjC,UAAU,CAAC,GAAG,EAAE;QACd,SAAS,GAAG,IAAI,iBAAiB,CAAC;YAChC,WAAW,EAAE,cAAc;YAC3B,MAAM,EAAE,aAAa;YACrB,KAAK,EAAE,kBAAkB;SAC1B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC/B,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;YACzC,MAAM,QAAQ,GAAG,wBAAwB,CAAC;YAC1C,MAAM,MAAM,GAAG,SAAS,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YACnD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,MAAM,QAAQ,GAAG,8CAA8C,CAAC;YAChE,MAAM,MAAM,GAAG,SAAS,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YACnD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;QACpE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;YACtD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,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const version: any;
2
+ //# sourceMappingURL=version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,OAAO,KAAsB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { readFileSync } from 'fs';
2
+ import { fileURLToPath } from 'url';
3
+ import { dirname, join } from 'path';
4
+ const __filename = fileURLToPath(import.meta.url);
5
+ const __dirname = dirname(__filename);
6
+ // Read version from package.json
7
+ const packageJsonPath = join(__dirname, '../../package.json');
8
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf-8'));
9
+ export const version = packageJson.version;
10
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/utils/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAErC,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAEtC,iCAAiC;AACjC,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC;AAC9D,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAAC;AAEvE,MAAM,CAAC,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC"}
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "create-specment",
3
+ "version": "0.2.2",
4
+ "description": "Interactive CLI tool for creating Docusaurus-based specification documentation projects",
5
+ "type": "module",
6
+ "author": "Plenarc",
7
+ "license": "MIT",
8
+ "main": "./bin/index.js",
9
+ "types": "./bin/index.d.ts",
10
+ "bin": {
11
+ "create-specment": "./bin/index.js"
12
+ },
13
+ "keywords": [
14
+ "cli",
15
+ "documentation",
16
+ "specification",
17
+ "docusaurus",
18
+ "template",
19
+ "generator",
20
+ "interactive"
21
+ ],
22
+ "homepage": "https://github.com/plenarc/create-specment#readme",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "https://github.com/plenarc/create-specment.git"
26
+ },
27
+ "bugs": {
28
+ "url": "https://github.com/plenarc/create-specment/issues"
29
+ },
30
+ "scripts": {
31
+ "build": "tsc",
32
+ "dev": "tsc --watch",
33
+ "test": "vitest --run",
34
+ "test:watch": "vitest",
35
+ "check": "biome check --apply .",
36
+ "format": "biome format . --write",
37
+ "lint": "biome lint . --diagnostic-level=error",
38
+ "lint:fix": "biome lint . --fix",
39
+ "typecheck": "tsc",
40
+ "prepublishOnly": "nr build && nr test"
41
+ },
42
+ "dependencies": {
43
+ "@antfu/ni": "^28.0.0",
44
+ "@clack/prompts": "^0.11.0",
45
+ "chalk": "^5.6.2",
46
+ "commander": "^14.0.2",
47
+ "fs-extra": "^11.3.3",
48
+ "inquirer": "^13.1.0"
49
+ },
50
+ "devDependencies": {
51
+ "@biomejs/biome": "^2.3.10",
52
+ "@types/fs-extra": "^11.0.4",
53
+ "@types/inquirer": "^9.0.9",
54
+ "@types/node": "^25.0.3",
55
+ "typescript": "^5.9.3",
56
+ "vitest": "^4.0.16"
57
+ },
58
+ "engines": {
59
+ "node": ">=22.0.0"
60
+ },
61
+ "files": [
62
+ "bin",
63
+ "templates",
64
+ "README.md",
65
+ "LICENSE"
66
+ ]
67
+ }
@@ -0,0 +1,106 @@
1
+ // @ts-check
2
+ // Note: type annotations allow type checking and IDEs autocompletion
3
+
4
+ /** @type {import('@docusaurus/types').Config} */
5
+ const config = {
6
+ title: '{{projectName}}',
7
+ tagline: 'Classic Specification Documentation',
8
+ favicon: 'img/favicon.ico',
9
+
10
+ // Set the production url of your site here
11
+ url: 'https://your-docusaurus-site.example.com',
12
+ // Set the /<baseUrl>/ pathname under which your site is served
13
+ baseUrl: '/',
14
+
15
+ // GitHub pages deployment config.
16
+ organizationName: 'your-org',
17
+ projectName: '{{projectName}}',
18
+
19
+ onBrokenLinks: 'throw',
20
+ onBrokenMarkdownLinks: 'warn',
21
+
22
+ // Even if you don't use internalization, you can use this field to set useful
23
+ // metadata like html lang. For example, if your site is Chinese, you may want
24
+ // to replace "en" with "zh-Hans".
25
+ i18n: {
26
+ defaultLocale: 'en',
27
+ locales: ['en'],
28
+ },
29
+
30
+ presets: [
31
+ [
32
+ 'classic',
33
+ /** @type {import('@docusaurus/preset-classic').Options} */
34
+ ({
35
+ docs: {
36
+ sidebarPath: require.resolve('./sidebars.js'),
37
+ editUrl: 'https://github.com/your-org/your-repo/tree/main/',
38
+ },
39
+ blog: {
40
+ showReadingTime: true,
41
+ editUrl: 'https://github.com/your-org/your-repo/tree/main/',
42
+ },
43
+ theme: {
44
+ customCss: require.resolve('./src/css/custom.css'),
45
+ },
46
+ }),
47
+ ],
48
+ ],
49
+
50
+ themeConfig:
51
+ /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
52
+ ({
53
+ // Replace with your project's social card
54
+ image: 'img/docusaurus-social-card.jpg',
55
+ navbar: {
56
+ title: '{{projectName}}',
57
+ logo: {
58
+ alt: '{{projectName}} Logo',
59
+ src: 'img/logo.svg',
60
+ },
61
+ items: [
62
+ {
63
+ type: 'docSidebar',
64
+ sidebarId: 'tutorialSidebar',
65
+ position: 'left',
66
+ label: 'Documentation',
67
+ },
68
+ {
69
+ href: 'https://github.com/your-org/your-repo',
70
+ label: 'GitHub',
71
+ position: 'right',
72
+ },
73
+ ],
74
+ },
75
+ footer: {
76
+ style: 'dark',
77
+ links: [
78
+ {
79
+ title: 'Documentation',
80
+ items: [
81
+ {
82
+ label: 'Getting Started',
83
+ to: '/docs/intro',
84
+ },
85
+ ],
86
+ },
87
+ {
88
+ title: 'Community',
89
+ items: [
90
+ {
91
+ label: 'GitHub',
92
+ href: 'https://github.com/your-org/your-repo',
93
+ },
94
+ ],
95
+ },
96
+ ],
97
+ copyright: `Copyright © ${new Date().getFullYear()} {{projectName}}. Built with Docusaurus.`,
98
+ },
99
+ prism: {
100
+ theme: require('prism-react-renderer/themes/github'),
101
+ darkTheme: require('prism-react-renderer/themes/dracula'),
102
+ },
103
+ }),
104
+ };
105
+
106
+ module.exports = config;
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "docusaurus": "docusaurus",
7
+ "start": "docusaurus start",
8
+ "build": "docusaurus build",
9
+ "swizzle": "docusaurus swizzle",
10
+ "deploy": "docusaurus deploy",
11
+ "clear": "docusaurus clear",
12
+ "serve": "docusaurus serve",
13
+ "write-translations": "docusaurus write-translations",
14
+ "write-heading-ids": "docusaurus write-heading-ids"
15
+ },
16
+ "dependencies": {
17
+ "@docusaurus/core": "^3.0.0",
18
+ "@docusaurus/preset-classic": "^3.0.0",
19
+ "@mdx-js/react": "^3.0.0",
20
+ "clsx": "^2.0.0",
21
+ "prism-react-renderer": "^2.3.0",
22
+ "react": "^18.0.0",
23
+ "react-dom": "^18.0.0"
24
+ },
25
+ "devDependencies": {
26
+ "@docusaurus/module-type-aliases": "^3.0.0",
27
+ "@docusaurus/types": "^3.0.0"
28
+ },
29
+ "browserslist": {
30
+ "production": [">0.5%", "not dead", "not op_mini all"],
31
+ "development": ["last 3 chrome version", "last 3 firefox version", "last 5 safari version"]
32
+ },
33
+ "engines": {
34
+ "node": ">=20.0"
35
+ }
36
+ }
@@ -0,0 +1,123 @@
1
+ // @ts-check
2
+ // Note: type annotations allow type checking and IDEs autocompletion
3
+
4
+ /** @type {import('@docusaurus/types').Config} */
5
+ const config = {
6
+ title: '{{projectName}}',
7
+ tagline: 'External Design Specification Documentation',
8
+ favicon: 'img/favicon.ico',
9
+
10
+ // Set the production url of your site here
11
+ url: 'https://your-docusaurus-site.example.com',
12
+ // Set the /<baseUrl>/ pathname under which your site is served
13
+ baseUrl: '/',
14
+
15
+ // GitHub pages deployment config.
16
+ organizationName: 'your-org',
17
+ projectName: '{{projectName}}',
18
+
19
+ onBrokenLinks: 'throw',
20
+ onBrokenMarkdownLinks: 'warn',
21
+
22
+ // Even if you don't use internalization, you can use this field to set useful
23
+ // metadata like html lang. For example, if your site is Chinese, you may want
24
+ // to replace "en" with "zh-Hans".
25
+ i18n: {
26
+ defaultLocale: 'en',
27
+ locales: ['en'],
28
+ },
29
+
30
+ presets: [
31
+ [
32
+ 'classic',
33
+ /** @type {import('@docusaurus/preset-classic').Options} */
34
+ ({
35
+ docs: {
36
+ sidebarPath: require.resolve('./sidebars.js'),
37
+ editUrl: 'https://github.com/your-org/your-repo/tree/main/',
38
+ },
39
+ blog: false, // Disable blog for external design
40
+ theme: {
41
+ customCss: require.resolve('./src/css/custom.css'),
42
+ },
43
+ }),
44
+ ],
45
+ ],
46
+
47
+ themeConfig:
48
+ /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
49
+ ({
50
+ // Replace with your project's social card
51
+ image: 'img/docusaurus-social-card.jpg',
52
+ navbar: {
53
+ title: '{{projectName}}',
54
+ logo: {
55
+ alt: '{{projectName}} Logo',
56
+ src: 'img/logo.svg',
57
+ },
58
+ items: [
59
+ {
60
+ type: 'docSidebar',
61
+ sidebarId: 'architectureSidebar',
62
+ position: 'left',
63
+ label: 'Architecture',
64
+ },
65
+ {
66
+ type: 'docSidebar',
67
+ sidebarId: 'apiSidebar',
68
+ position: 'left',
69
+ label: 'API Design',
70
+ },
71
+ {
72
+ type: 'docSidebar',
73
+ sidebarId: 'uiSidebar',
74
+ position: 'left',
75
+ label: 'UI/UX Design',
76
+ },
77
+ {
78
+ href: 'https://github.com/your-org/your-repo',
79
+ label: 'GitHub',
80
+ position: 'right',
81
+ },
82
+ ],
83
+ },
84
+ footer: {
85
+ style: 'dark',
86
+ links: [
87
+ {
88
+ title: 'Design',
89
+ items: [
90
+ {
91
+ label: 'System Architecture',
92
+ to: '/docs/architecture/intro',
93
+ },
94
+ {
95
+ label: 'API Design',
96
+ to: '/docs/api/intro',
97
+ },
98
+ {
99
+ label: 'UI/UX Design',
100
+ to: '/docs/ui/intro',
101
+ },
102
+ ],
103
+ },
104
+ {
105
+ title: 'Community',
106
+ items: [
107
+ {
108
+ label: 'GitHub',
109
+ href: 'https://github.com/your-org/your-repo',
110
+ },
111
+ ],
112
+ },
113
+ ],
114
+ copyright: `Copyright © ${new Date().getFullYear()} {{projectName}}. Built with Docusaurus.`,
115
+ },
116
+ prism: {
117
+ theme: require('prism-react-renderer/themes/github'),
118
+ darkTheme: require('prism-react-renderer/themes/dracula'),
119
+ },
120
+ }),
121
+ };
122
+
123
+ module.exports = config;
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "{{projectName}}",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "docusaurus": "docusaurus",
7
+ "start": "docusaurus start",
8
+ "build": "docusaurus build",
9
+ "swizzle": "docusaurus swizzle",
10
+ "deploy": "docusaurus deploy",
11
+ "clear": "docusaurus clear",
12
+ "serve": "docusaurus serve",
13
+ "write-translations": "docusaurus write-translations",
14
+ "write-heading-ids": "docusaurus write-heading-ids"
15
+ },
16
+ "dependencies": {
17
+ "@docusaurus/core": "^3.0.0",
18
+ "@docusaurus/preset-classic": "^3.0.0",
19
+ "@mdx-js/react": "^3.0.0",
20
+ "clsx": "^2.0.0",
21
+ "prism-react-renderer": "^2.3.0",
22
+ "react": "^18.0.0",
23
+ "react-dom": "^18.0.0"
24
+ },
25
+ "devDependencies": {
26
+ "@docusaurus/module-type-aliases": "^3.0.0",
27
+ "@docusaurus/types": "^3.0.0"
28
+ },
29
+ "browserslist": {
30
+ "production": [">0.5%", "not dead", "not op_mini all"],
31
+ "development": ["last 3 chrome version", "last 3 firefox version", "last 5 safari version"]
32
+ },
33
+ "engines": {
34
+ "node": ">=20.0"
35
+ }
36
+ }
@@ -0,0 +1,123 @@
1
+ // @ts-check
2
+ // Note: type annotations allow type checking and IDEs autocompletion
3
+
4
+ /** @type {import('@docusaurus/types').Config} */
5
+ const config = {
6
+ title: '{{projectName}}',
7
+ tagline: 'Internal Design Specification Documentation',
8
+ favicon: 'img/favicon.ico',
9
+
10
+ // Set the production url of your site here
11
+ url: 'https://your-docusaurus-site.example.com',
12
+ // Set the /<baseUrl>/ pathname under which your site is served
13
+ baseUrl: '/',
14
+
15
+ // GitHub pages deployment config.
16
+ organizationName: 'your-org',
17
+ projectName: '{{projectName}}',
18
+
19
+ onBrokenLinks: 'throw',
20
+ onBrokenMarkdownLinks: 'warn',
21
+
22
+ // Even if you don't use internalization, you can use this field to set useful
23
+ // metadata like html lang. For example, if your site is Chinese, you may want
24
+ // to replace "en" with "zh-Hans".
25
+ i18n: {
26
+ defaultLocale: 'en',
27
+ locales: ['en'],
28
+ },
29
+
30
+ presets: [
31
+ [
32
+ 'classic',
33
+ /** @type {import('@docusaurus/preset-classic').Options} */
34
+ ({
35
+ docs: {
36
+ sidebarPath: require.resolve('./sidebars.js'),
37
+ editUrl: 'https://github.com/your-org/your-repo/tree/main/',
38
+ },
39
+ blog: false, // Disable blog for internal design
40
+ theme: {
41
+ customCss: require.resolve('./src/css/custom.css'),
42
+ },
43
+ }),
44
+ ],
45
+ ],
46
+
47
+ themeConfig:
48
+ /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
49
+ ({
50
+ // Replace with your project's social card
51
+ image: 'img/docusaurus-social-card.jpg',
52
+ navbar: {
53
+ title: '{{projectName}}',
54
+ logo: {
55
+ alt: '{{projectName}} Logo',
56
+ src: 'img/logo.svg',
57
+ },
58
+ items: [
59
+ {
60
+ type: 'docSidebar',
61
+ sidebarId: 'implementationSidebar',
62
+ position: 'left',
63
+ label: 'Implementation',
64
+ },
65
+ {
66
+ type: 'docSidebar',
67
+ sidebarId: 'databaseSidebar',
68
+ position: 'left',
69
+ label: 'Database Design',
70
+ },
71
+ {
72
+ type: 'docSidebar',
73
+ sidebarId: 'algorithmSidebar',
74
+ position: 'left',
75
+ label: 'Algorithms',
76
+ },
77
+ {
78
+ href: 'https://github.com/your-org/your-repo',
79
+ label: 'GitHub',
80
+ position: 'right',
81
+ },
82
+ ],
83
+ },
84
+ footer: {
85
+ style: 'dark',
86
+ links: [
87
+ {
88
+ title: 'Internal Design',
89
+ items: [
90
+ {
91
+ label: 'Implementation Details',
92
+ to: '/docs/implementation/intro',
93
+ },
94
+ {
95
+ label: 'Database Design',
96
+ to: '/docs/database/intro',
97
+ },
98
+ {
99
+ label: 'Algorithms',
100
+ to: '/docs/algorithms/intro',
101
+ },
102
+ ],
103
+ },
104
+ {
105
+ title: 'Community',
106
+ items: [
107
+ {
108
+ label: 'GitHub',
109
+ href: 'https://github.com/your-org/your-repo',
110
+ },
111
+ ],
112
+ },
113
+ ],
114
+ copyright: `Copyright © ${new Date().getFullYear()} {{projectName}}. Built with Docusaurus.`,
115
+ },
116
+ prism: {
117
+ theme: require('prism-react-renderer/themes/github'),
118
+ darkTheme: require('prism-react-renderer/themes/dracula'),
119
+ },
120
+ }),
121
+ };
122
+
123
+ module.exports = config;