create-specment 0.2.9 → 0.3.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/bin/commands/create.d.ts +0 -1
- package/bin/constants/languages.d.ts +0 -1
- package/bin/core/interactive-setup.d.ts +0 -1
- package/bin/core/interactive-setup.js +17 -10
- package/bin/core/interactive-setup.js.map +1 -1
- package/bin/core/interactive-setup.test.d.ts +0 -1
- package/bin/core/interactive-setup.test.js +7 -7
- package/bin/core/interactive-setup.test.js.map +1 -1
- package/bin/core/project-generator.d.ts +0 -1
- package/bin/core/project-generator.js +5 -8
- package/bin/core/project-generator.js.map +1 -1
- package/bin/features/index.d.ts +0 -1
- package/bin/features/index.js +15 -13
- package/bin/features/index.js.map +1 -1
- package/bin/generators/docusaurus-config.d.ts +0 -1
- package/bin/generators/docusaurus-config.js +211 -264
- package/bin/generators/docusaurus-config.js.map +1 -1
- package/bin/generators/package-json.d.ts +0 -1
- package/bin/generators/package-json.js +45 -91
- package/bin/generators/package-json.js.map +1 -1
- package/bin/generators/template-files.d.ts +0 -1
- package/bin/generators/template-files.js +563 -168
- package/bin/generators/template-files.js.map +1 -1
- package/bin/index.d.ts +0 -1
- package/bin/index.js.map +1 -1
- package/bin/templates/index.d.ts +0 -1
- package/bin/templates/index.js +36 -24
- package/bin/templates/index.js.map +1 -1
- package/bin/tests/integration.test.d.ts +0 -1
- package/bin/tests/integration.test.js +34 -34
- package/bin/tests/integration.test.js.map +1 -1
- package/bin/types/index.d.ts +1 -21
- package/bin/utils/config-merger.d.ts +0 -1
- package/bin/utils/config-merger.js +0 -1
- package/bin/utils/config-merger.js.map +1 -1
- package/bin/utils/errors.d.ts +0 -1
- package/bin/utils/install.d.ts +0 -1
- package/bin/utils/install.js +3 -3
- package/bin/utils/install.js.map +1 -1
- package/bin/utils/message-formatter.d.ts +0 -1
- package/bin/utils/template-processor.d.ts +0 -1
- package/bin/utils/template-processor.js +2 -3
- package/bin/utils/template-processor.js.map +1 -1
- package/bin/utils/template-processor.test.d.ts +0 -1
- package/bin/utils/template-processor.test.js +22 -22
- package/bin/utils/template-processor.test.js.map +1 -1
- package/bin/utils/version.d.ts +0 -1
- package/bin/utils/version.js +3 -3
- package/bin/utils/version.js.map +1 -1
- package/package.json +2 -7
- package/templates/docs/01-overview/_requirements-specification.mdx +1 -5
- package/templates/docs/01-overview/as-is.mdx +1 -1
- package/templates/docs/01-overview/glossary.mdx +6 -6
- package/templates/docs/01-overview/odsc.mdx +1 -1
- package/templates/docs/01-overview/to-be.mdx +6 -6
- package/templates/docs/02-requirements/functional/_req-template.mdx +0 -3
- package/templates/docs/02-requirements/functional/req-001.mdx +0 -4
- package/templates/docs/02-requirements/non-functional/_nfr-template.mdx +0 -3
- package/templates/docs/02-requirements/non-functional/nfr-001.mdx +0 -3
- package/templates/docs/02-requirements/non-functional/nfr-002.mdx +0 -3
- package/templates/docs/03-external/business-model.mdx +1 -1
- package/templates/docs/03-external/index.mdx +1 -1
- package/templates/docs/04-internal/batches/import-products.mdx +2 -6
- package/templates/docs/04-internal/policies/github.mdx +1 -1
- package/templates/docs/04-internal/rules/database.mdx +1 -1
- package/templates/docs/04-internal/screens/dashboard.mdx +1 -1
- package/templates/docs/04-internal/screens/index.mdx +1 -1
- package/templates/docs/04-internal/screens/login.mdx +1 -1
- package/templates/docs/04-internal/screens/menu.mdx +1 -1
- package/templates/docs/index.module.css +96 -0
- package/templates/docs/index.tsx +48 -0
- package/templates/docs/introduction/index.mdx +1 -1
- package/templates/docs/introduction/operational-policies/sharepoint.mdx +1 -1
- package/templates/package.json.template +46 -0
- package/templates/src/components/Highlight/index.tsx +68 -0
- package/templates/src/components/PriorityMatrix/index.tsx +97 -0
- package/templates/src/components/TBD/index.tsx +16 -0
- package/templates/src/css/custom.css +81 -0
- package/templates/src/types/requirements.ts +19 -0
- package/templates/static/img/business-model.drawio.svg +4 -0
- package/templates/static/img/gantt.drawio.svg +1152 -0
- package/templates/static/img/logo.svg +21 -0
- package/bin/commands/create.d.ts.map +0 -1
- package/bin/constants/languages.d.ts.map +0 -1
- package/bin/core/interactive-setup.d.ts.map +0 -1
- package/bin/core/interactive-setup.test.d.ts.map +0 -1
- package/bin/core/project-generator.d.ts.map +0 -1
- package/bin/features/index.d.ts.map +0 -1
- package/bin/generators/docusaurus-config.d.ts.map +0 -1
- package/bin/generators/package-json.d.ts.map +0 -1
- package/bin/generators/template-files.d.ts.map +0 -1
- package/bin/index.d.ts.map +0 -1
- package/bin/plugins/i18n-integration.d.ts +0 -25
- package/bin/plugins/i18n-integration.d.ts.map +0 -1
- package/bin/plugins/i18n-integration.js +0 -310
- package/bin/plugins/i18n-integration.js.map +0 -1
- package/bin/plugins/plantuml-integration.d.ts +0 -17
- package/bin/plugins/plantuml-integration.d.ts.map +0 -1
- package/bin/plugins/plantuml-integration.js +0 -112
- package/bin/plugins/plantuml-integration.js.map +0 -1
- package/bin/plugins/redoc-integration.d.ts +0 -25
- package/bin/plugins/redoc-integration.d.ts.map +0 -1
- package/bin/plugins/redoc-integration.js +0 -373
- package/bin/plugins/redoc-integration.js.map +0 -1
- package/bin/plugins/search-integration.d.ts +0 -20
- package/bin/plugins/search-integration.d.ts.map +0 -1
- package/bin/plugins/search-integration.js +0 -169
- package/bin/plugins/search-integration.js.map +0 -1
- package/bin/templates/index.d.ts.map +0 -1
- package/bin/templates/template-definitions.d.ts +0 -10
- package/bin/templates/template-definitions.d.ts.map +0 -1
- package/bin/templates/template-definitions.js +0 -517
- package/bin/templates/template-definitions.js.map +0 -1
- package/bin/tests/integration.test.d.ts.map +0 -1
- package/bin/types/index.d.ts.map +0 -1
- package/bin/utils/config-merger.d.ts.map +0 -1
- package/bin/utils/errors.d.ts.map +0 -1
- package/bin/utils/install.d.ts.map +0 -1
- package/bin/utils/message-formatter.d.ts.map +0 -1
- package/bin/utils/template-processor.d.ts.map +0 -1
- package/bin/utils/template-processor.test.d.ts.map +0 -1
- package/bin/utils/version.d.ts.map +0 -1
- package/templates/classic-spec/docusaurus.config.js.template +0 -106
- package/templates/classic-spec/package.json.template +0 -36
- package/templates/docs/example.drawio.svg +0 -57
- package/templates/external-design/docusaurus.config.js.template +0 -123
- package/templates/external-design/package.json.template +0 -36
- package/templates/internal-design/docusaurus.config.js.template +0 -123
- package/templates/internal-design/package.json.template +0 -36
- package/templates/project-analysis/docusaurus.config.js.template +0 -113
- package/templates/project-analysis/package.json.template +0 -36
- package/templates/requirements/docusaurus.config.js.template +0 -119
- package/templates/requirements/package.json.template +0 -36
|
@@ -1,285 +1,232 @@
|
|
|
1
|
-
import { PlantUMLIntegration } from '../plugins/plantuml-integration.js';
|
|
2
|
-
import { RedocIntegration } from '../plugins/redoc-integration.js';
|
|
3
|
-
import { SearchIntegration } from '../plugins/search-integration.js';
|
|
4
|
-
import { I18nIntegration } from '../plugins/i18n-integration.js';
|
|
5
|
-
import { LANG } from '../constants/languages.js';
|
|
6
1
|
export function generateDocusaurusConfig(selections) {
|
|
7
2
|
const { projectName, templates, features } = selections;
|
|
8
3
|
const enabledFeatures = features.filter((f) => f.enabled);
|
|
9
|
-
//
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// 設定の妥当性を検証
|
|
15
|
-
validateConfig(config);
|
|
16
|
-
return generateConfigString(config);
|
|
4
|
+
// 機能フラグ
|
|
5
|
+
const hasPlantUML = enabledFeatures.some(f => f.name === 'plantuml');
|
|
6
|
+
const hasMermaid = enabledFeatures.some(f => f.name === 'mermaid');
|
|
7
|
+
const hasRedoc = enabledFeatures.some(f => f.name === 'redoc');
|
|
8
|
+
return generateConfigString(templates, enabledFeatures, hasPlantUML, hasMermaid, hasRedoc, projectName);
|
|
17
9
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return baseConfig;
|
|
38
|
-
}
|
|
39
|
-
function getTaglineForTemplate(templateName) {
|
|
40
|
-
const taglines = {
|
|
41
|
-
'classic-spec': 'Classic Specification Documentation',
|
|
42
|
-
'api-spec': 'API Specification Documentation',
|
|
43
|
-
'technical-spec': 'Technical Specification Documentation',
|
|
44
|
-
'enterprise-spec': 'Enterprise Specification Documentation',
|
|
45
|
-
};
|
|
46
|
-
return taglines[templateName] || 'Documentation Site';
|
|
47
|
-
}
|
|
48
|
-
function getPresetConfigForTemplate(templateName) {
|
|
49
|
-
const basePresetConfig = {
|
|
10
|
+
const makeI18n = () => {
|
|
11
|
+
return `
|
|
12
|
+
i18n: {
|
|
13
|
+
defaultLocale: 'ja',
|
|
14
|
+
locales: ['ja'],
|
|
15
|
+
},
|
|
16
|
+
`;
|
|
17
|
+
};
|
|
18
|
+
const makeMarkdown = (hasMermaid) => {
|
|
19
|
+
return hasMermaid ? `
|
|
20
|
+
markdown: {
|
|
21
|
+
mermaid: true,
|
|
22
|
+
},` : '';
|
|
23
|
+
};
|
|
24
|
+
const makePresets = (hasRedoc) => {
|
|
25
|
+
const baseText = {
|
|
26
|
+
classic: `[
|
|
27
|
+
'classic',
|
|
28
|
+
{
|
|
50
29
|
docs: {
|
|
51
|
-
|
|
52
|
-
editUrl: 'https://github.com/your-org/your-repo/tree/main/',
|
|
30
|
+
sidebarPath: './sidebars.ts',
|
|
53
31
|
},
|
|
32
|
+
blog: false,
|
|
33
|
+
theme: {
|
|
34
|
+
customCss: './src/css/custom.css',
|
|
35
|
+
},
|
|
36
|
+
} satisfies Preset.Options,
|
|
37
|
+
]`,
|
|
38
|
+
redoc: `[
|
|
39
|
+
'redocusaurus',
|
|
40
|
+
{
|
|
41
|
+
specs: [
|
|
42
|
+
{
|
|
43
|
+
id: 'api-spec',
|
|
44
|
+
spec: 'openapi/openapi-single.yaml',
|
|
45
|
+
route: '/api/',
|
|
46
|
+
},
|
|
47
|
+
],
|
|
54
48
|
theme: {
|
|
55
|
-
|
|
49
|
+
primaryColor: '#1976d2',
|
|
56
50
|
},
|
|
51
|
+
},
|
|
52
|
+
]`,
|
|
57
53
|
};
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
54
|
+
return [
|
|
55
|
+
baseText.classic,
|
|
56
|
+
hasRedoc && baseText.redoc,
|
|
57
|
+
].filter(Boolean).join(',\n ');
|
|
58
|
+
};
|
|
59
|
+
const makeThemes = (hasPlantUML, hasMermaid) => {
|
|
60
|
+
const baseText = {
|
|
61
|
+
search: `[
|
|
62
|
+
require.resolve('@easyops-cn/docusaurus-search-local'),
|
|
63
|
+
{
|
|
64
|
+
language: ['jp'],
|
|
65
|
+
hashed: true,
|
|
66
|
+
highlightSearchTermsOnTargetPage: true,
|
|
67
|
+
},
|
|
68
|
+
]`,
|
|
69
|
+
plantUML: `require.resolve('docusaurus-theme-plantuml')`,
|
|
70
|
+
mermaid: `'@docusaurus/theme-mermaid'`,
|
|
72
71
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
footer: {
|
|
86
|
-
style: 'dark',
|
|
87
|
-
links: getFooterLinksForTemplate(templateName),
|
|
88
|
-
copyright: `Copyright © ${new Date().getFullYear()} ${projectName}. Built with Docusaurus.`,
|
|
89
|
-
},
|
|
90
|
-
prism: {
|
|
91
|
-
theme: 'prism-react-renderer/themes/github',
|
|
92
|
-
darkTheme: 'prism-react-renderer/themes/dracula',
|
|
93
|
-
},
|
|
72
|
+
return [
|
|
73
|
+
baseText.search,
|
|
74
|
+
hasPlantUML && baseText.plantUML,
|
|
75
|
+
hasMermaid && baseText.mermaid,
|
|
76
|
+
].filter(Boolean).join(',\n ');
|
|
77
|
+
};
|
|
78
|
+
const makeNavbarItems = (templates, enabledFeatures) => {
|
|
79
|
+
const templateNavItems = {
|
|
80
|
+
'project-analysis': { label: 'プロジェクト概要・分析', docId: 'overview/index' },
|
|
81
|
+
'requirements': { label: '要件定義', docId: 'requirements/index' },
|
|
82
|
+
'external-design': { label: '外部設計', docId: 'external/index' },
|
|
83
|
+
'internal-design': { label: '内部設計', docId: 'internal/index' },
|
|
94
84
|
};
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
85
|
+
let navbarItems = '[';
|
|
86
|
+
// 選択されたテンプレートに応じてナビゲーション項目を追加
|
|
87
|
+
for (const template of templates) {
|
|
88
|
+
const navItem = templateNavItems[template.name];
|
|
89
|
+
if (navItem) {
|
|
90
|
+
navbarItems += `
|
|
99
91
|
{
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
case 'classic-spec':
|
|
107
|
-
return [
|
|
108
|
-
{
|
|
109
|
-
type: 'docSidebar',
|
|
110
|
-
sidebarId: 'tutorialSidebar',
|
|
111
|
-
position: 'left',
|
|
112
|
-
label: 'Documentation',
|
|
113
|
-
},
|
|
114
|
-
...baseItems,
|
|
115
|
-
];
|
|
116
|
-
case 'api-spec':
|
|
117
|
-
return [
|
|
118
|
-
{
|
|
119
|
-
type: 'docSidebar',
|
|
120
|
-
sidebarId: 'apiSidebar',
|
|
121
|
-
position: 'left',
|
|
122
|
-
label: 'API Reference',
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
type: 'docSidebar',
|
|
126
|
-
sidebarId: 'guidesSidebar',
|
|
127
|
-
position: 'left',
|
|
128
|
-
label: 'Guides',
|
|
129
|
-
},
|
|
130
|
-
...baseItems,
|
|
131
|
-
];
|
|
132
|
-
case 'technical-spec':
|
|
133
|
-
return [
|
|
134
|
-
{
|
|
135
|
-
type: 'docSidebar',
|
|
136
|
-
sidebarId: 'architectureSidebar',
|
|
137
|
-
position: 'left',
|
|
138
|
-
label: 'Architecture',
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
type: 'docSidebar',
|
|
142
|
-
sidebarId: 'implementationSidebar',
|
|
143
|
-
position: 'left',
|
|
144
|
-
label: 'Implementation',
|
|
145
|
-
},
|
|
146
|
-
...baseItems,
|
|
147
|
-
];
|
|
148
|
-
case 'enterprise-spec':
|
|
149
|
-
return [
|
|
150
|
-
{
|
|
151
|
-
type: 'docSidebar',
|
|
152
|
-
sidebarId: 'overviewSidebar',
|
|
153
|
-
position: 'left',
|
|
154
|
-
label: 'Overview',
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
type: 'docSidebar',
|
|
158
|
-
sidebarId: 'specificationSidebar',
|
|
159
|
-
position: 'left',
|
|
160
|
-
label: 'Specifications',
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
type: 'docSidebar',
|
|
164
|
-
sidebarId: 'processSidebar',
|
|
165
|
-
position: 'left',
|
|
166
|
-
label: 'Processes',
|
|
167
|
-
},
|
|
168
|
-
...baseItems,
|
|
169
|
-
];
|
|
170
|
-
default:
|
|
171
|
-
return [
|
|
172
|
-
{
|
|
173
|
-
type: 'docSidebar',
|
|
174
|
-
sidebarId: 'tutorialSidebar',
|
|
175
|
-
position: 'left',
|
|
176
|
-
label: 'Documentation',
|
|
177
|
-
},
|
|
178
|
-
...baseItems,
|
|
179
|
-
];
|
|
92
|
+
label: '${navItem.label}',
|
|
93
|
+
type: 'doc',
|
|
94
|
+
position: 'left',
|
|
95
|
+
docId: '${navItem.docId}',
|
|
96
|
+
},`;
|
|
97
|
+
}
|
|
180
98
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
99
|
+
// redoc機能が有効な場合はAPIリンクを追加
|
|
100
|
+
const hasRedocFeature = enabledFeatures.some(f => f.name === 'redoc');
|
|
101
|
+
if (hasRedocFeature) {
|
|
102
|
+
navbarItems += `
|
|
184
103
|
{
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
104
|
+
label: 'API',
|
|
105
|
+
position: 'left',
|
|
106
|
+
to: '/api/',
|
|
107
|
+
},`;
|
|
108
|
+
}
|
|
109
|
+
// GitHubリンクを追加
|
|
110
|
+
navbarItems += `
|
|
111
|
+
{
|
|
112
|
+
href: isGithubActions ? \`https://github.com/\${organizationValue}/\${projectValue}\` : 'http://localhost:3000',
|
|
113
|
+
label: 'GitHub',
|
|
114
|
+
position: 'right',
|
|
192
115
|
},
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
116
|
+
]`;
|
|
117
|
+
return navbarItems;
|
|
118
|
+
};
|
|
119
|
+
function generateConfigString(templates, enabledFeatures, hasPlantUML, hasMermaid, hasRedoc, projectName) {
|
|
120
|
+
const i18n = makeI18n();
|
|
121
|
+
const markdown = makeMarkdown(hasMermaid);
|
|
122
|
+
const presets = makePresets(hasRedoc);
|
|
123
|
+
const themes = makeThemes(hasPlantUML, hasMermaid);
|
|
124
|
+
// 選択されたテンプレートに応じてナビゲーション項目を動的に生成
|
|
125
|
+
const navbarItems = makeNavbarItems(templates, enabledFeatures);
|
|
126
|
+
// TypeScript形式で設定を生成
|
|
127
|
+
return `import type * as Preset from '@docusaurus/preset-classic';
|
|
128
|
+
import type { Config } from '@docusaurus/types';
|
|
129
|
+
import { themes as prismThemes } from 'prism-react-renderer';
|
|
130
|
+
|
|
131
|
+
// GitHub pages deployment config.
|
|
132
|
+
// ToDo: 最初に編集する必要がある箇所
|
|
133
|
+
const titleValue = 'プロジェクト名';
|
|
134
|
+
const descriptionValue = 'プロジェクト概要。xxxのためのシステムです';
|
|
135
|
+
const organizationValue = 'your-org';
|
|
136
|
+
const projectValue = '${projectName}';
|
|
137
|
+
const urlValue = \`https://\${organizationValue}.github.io\`;
|
|
138
|
+
const baseUrlValue = \`/\${projectValue}/\`;
|
|
139
|
+
|
|
140
|
+
// ToDo: Since I don't think GitHub Pages will be used in actual operation, this area needs to be edited according to the environment.
|
|
141
|
+
// ToDo: 実運用時にGitHub Pagesは使わないと思うので、この辺りは環境に合わせて要編集する
|
|
142
|
+
const isGithubActions = process.env.GITHUB_ACTIONS === 'true';
|
|
143
|
+
|
|
144
|
+
const config: Config = {
|
|
145
|
+
title: titleValue,
|
|
146
|
+
tagline: descriptionValue,
|
|
147
|
+
favicon: 'img/favicon.ico',
|
|
148
|
+
|
|
149
|
+
url: isGithubActions ? urlValue : 'http://localhost:3000',
|
|
150
|
+
baseUrl: isGithubActions ? baseUrlValue : '/',
|
|
151
|
+
|
|
152
|
+
organizationName: organizationValue,
|
|
153
|
+
projectName: projectValue,
|
|
154
|
+
trailingSlash: false,
|
|
155
|
+
|
|
156
|
+
onBrokenLinks: 'warn',
|
|
157
|
+
onBrokenMarkdownLinks: 'warn',
|
|
158
|
+
|
|
159
|
+
${i18n}
|
|
160
|
+
|
|
161
|
+
${markdown}
|
|
162
|
+
|
|
163
|
+
presets: [
|
|
164
|
+
${presets}
|
|
165
|
+
],
|
|
166
|
+
|
|
167
|
+
themeConfig: {
|
|
168
|
+
image: 'img/docusaurus-social-card.jpg',
|
|
169
|
+
docs: {
|
|
170
|
+
sidebar: {
|
|
171
|
+
hideable: true,
|
|
172
|
+
autoCollapseCategories: true,
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
navbar: {
|
|
176
|
+
title: titleValue,
|
|
177
|
+
logo: {
|
|
178
|
+
alt: titleValue,
|
|
179
|
+
src: 'img/logo.svg',
|
|
180
|
+
},
|
|
181
|
+
items: ${navbarItems}
|
|
182
|
+
},
|
|
183
|
+
footer: {
|
|
184
|
+
style: 'dark',
|
|
185
|
+
links: [
|
|
186
|
+
{
|
|
187
|
+
title: 'Community',
|
|
188
|
+
items: [
|
|
197
189
|
{
|
|
198
|
-
|
|
199
|
-
|
|
190
|
+
label: 'Slack (Sample)',
|
|
191
|
+
href: 'https://slack.com/intl/ja-jp',
|
|
200
192
|
},
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
if (featureConfig.presets) {
|
|
234
|
-
config.presets.push(...featureConfig.presets);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
return config;
|
|
238
|
-
}
|
|
239
|
-
function validateConfig(config) {
|
|
240
|
-
// 必須フィールドの検証
|
|
241
|
-
const requiredFields = ['title', 'url', 'baseUrl', 'presets', 'themeConfig'];
|
|
242
|
-
for (const field of requiredFields) {
|
|
243
|
-
if (!config[field]) {
|
|
244
|
-
throw new Error(`Required configuration field missing: ${field}`);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
// URL形式の検証
|
|
248
|
-
try {
|
|
249
|
-
new URL(config.url);
|
|
250
|
-
}
|
|
251
|
-
catch (_error) {
|
|
252
|
-
throw new Error(`Invalid URL format: ${config.url}`);
|
|
253
|
-
}
|
|
254
|
-
// プリセット設定の検証
|
|
255
|
-
if (!Array.isArray(config.presets) || config.presets.length === 0) {
|
|
256
|
-
throw new Error('At least one preset must be configured');
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
function generateConfigString(config) {
|
|
260
|
-
// Prismテーマの設定を特別に処理
|
|
261
|
-
let configString = JSON.stringify(config, null, 2);
|
|
262
|
-
// Prismテーマの文字列をrequire文に置換
|
|
263
|
-
configString = configString.replace('"prism-react-renderer/themes/github"', 'require("prism-react-renderer").themes.github');
|
|
264
|
-
configString = configString.replace('"prism-react-renderer/themes/dracula"', 'require("prism-react-renderer").themes.dracula');
|
|
265
|
-
return `// @ts-check
|
|
266
|
-
// Note: type annotations allow type checking and IDEs autocompletion
|
|
193
|
+
{
|
|
194
|
+
label: 'GitHub Discussions',
|
|
195
|
+
href: 'https://github.com/plenarc/create-specment/discussions',
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
title: 'More',
|
|
201
|
+
items: [
|
|
202
|
+
{
|
|
203
|
+
label: 'Changelog',
|
|
204
|
+
href: 'https://github.com/plenarc/create-specment/blob/main/CHANGELOG.md',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
label: 'GitHub: Create Specment',
|
|
208
|
+
href: 'https://github.com/plenarc/create-specment',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
label: 'Docusaurus',
|
|
212
|
+
href: 'https://docusaurus.io/',
|
|
213
|
+
},
|
|
214
|
+
],
|
|
215
|
+
},
|
|
216
|
+
],
|
|
217
|
+
copyright: \`Copyright © \${new Date().getFullYear()} \${titleValue}, Inc. Built with Specment.\`,
|
|
218
|
+
},
|
|
219
|
+
prism: {
|
|
220
|
+
theme: prismThemes.github,
|
|
221
|
+
darkTheme: prismThemes.dracula,
|
|
222
|
+
},
|
|
223
|
+
} satisfies Preset.ThemeConfig,
|
|
267
224
|
|
|
268
|
-
|
|
269
|
-
|
|
225
|
+
themes: [
|
|
226
|
+
${themes}
|
|
227
|
+
],
|
|
228
|
+
};
|
|
270
229
|
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
function mergeDeep(target, source) {
|
|
274
|
-
const result = { ...target };
|
|
275
|
-
for (const key in source) {
|
|
276
|
-
if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {
|
|
277
|
-
result[key] = mergeDeep(result[key] || {}, source[key]);
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
result[key] = source[key];
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return result;
|
|
230
|
+
export default config;`;
|
|
284
231
|
}
|
|
285
232
|
//# sourceMappingURL=docusaurus-config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docusaurus-config.js","sourceRoot":"","sources":["../../src/generators/docusaurus-config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"docusaurus-config.js","sourceRoot":"","sources":["../../src/generators/docusaurus-config.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,wBAAwB,CAAC,UAA0B;IACjE,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC;IACxD,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;IAE1D,QAAQ;IACR,MAAM,WAAW,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;IACrE,MAAM,UAAU,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC;IACnE,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC;IAE/D,OAAO,oBAAoB,CAAC,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC;AAC1G,CAAC;AAED,MAAM,QAAQ,GAAG,GAAW,EAAE;IAC5B,OAAO;;;;;GAKN,CAAC;AACJ,CAAC,CAAC;AAEF,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