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.
Files changed (133) hide show
  1. package/bin/commands/create.d.ts +0 -1
  2. package/bin/constants/languages.d.ts +0 -1
  3. package/bin/core/interactive-setup.d.ts +0 -1
  4. package/bin/core/interactive-setup.js +17 -10
  5. package/bin/core/interactive-setup.js.map +1 -1
  6. package/bin/core/interactive-setup.test.d.ts +0 -1
  7. package/bin/core/interactive-setup.test.js +7 -7
  8. package/bin/core/interactive-setup.test.js.map +1 -1
  9. package/bin/core/project-generator.d.ts +0 -1
  10. package/bin/core/project-generator.js +5 -8
  11. package/bin/core/project-generator.js.map +1 -1
  12. package/bin/features/index.d.ts +0 -1
  13. package/bin/features/index.js +15 -13
  14. package/bin/features/index.js.map +1 -1
  15. package/bin/generators/docusaurus-config.d.ts +0 -1
  16. package/bin/generators/docusaurus-config.js +211 -264
  17. package/bin/generators/docusaurus-config.js.map +1 -1
  18. package/bin/generators/package-json.d.ts +0 -1
  19. package/bin/generators/package-json.js +45 -91
  20. package/bin/generators/package-json.js.map +1 -1
  21. package/bin/generators/template-files.d.ts +0 -1
  22. package/bin/generators/template-files.js +563 -168
  23. package/bin/generators/template-files.js.map +1 -1
  24. package/bin/index.d.ts +0 -1
  25. package/bin/index.js.map +1 -1
  26. package/bin/templates/index.d.ts +0 -1
  27. package/bin/templates/index.js +36 -24
  28. package/bin/templates/index.js.map +1 -1
  29. package/bin/tests/integration.test.d.ts +0 -1
  30. package/bin/tests/integration.test.js +34 -34
  31. package/bin/tests/integration.test.js.map +1 -1
  32. package/bin/types/index.d.ts +1 -21
  33. package/bin/utils/config-merger.d.ts +0 -1
  34. package/bin/utils/config-merger.js +0 -1
  35. package/bin/utils/config-merger.js.map +1 -1
  36. package/bin/utils/errors.d.ts +0 -1
  37. package/bin/utils/install.d.ts +0 -1
  38. package/bin/utils/install.js +3 -3
  39. package/bin/utils/install.js.map +1 -1
  40. package/bin/utils/message-formatter.d.ts +0 -1
  41. package/bin/utils/template-processor.d.ts +0 -1
  42. package/bin/utils/template-processor.js +2 -3
  43. package/bin/utils/template-processor.js.map +1 -1
  44. package/bin/utils/template-processor.test.d.ts +0 -1
  45. package/bin/utils/template-processor.test.js +22 -22
  46. package/bin/utils/template-processor.test.js.map +1 -1
  47. package/bin/utils/version.d.ts +0 -1
  48. package/bin/utils/version.js +3 -3
  49. package/bin/utils/version.js.map +1 -1
  50. package/package.json +2 -7
  51. package/templates/docs/01-overview/_requirements-specification.mdx +1 -5
  52. package/templates/docs/01-overview/as-is.mdx +1 -1
  53. package/templates/docs/01-overview/glossary.mdx +6 -6
  54. package/templates/docs/01-overview/odsc.mdx +1 -1
  55. package/templates/docs/01-overview/to-be.mdx +6 -6
  56. package/templates/docs/02-requirements/functional/_req-template.mdx +0 -3
  57. package/templates/docs/02-requirements/functional/req-001.mdx +0 -4
  58. package/templates/docs/02-requirements/non-functional/_nfr-template.mdx +0 -3
  59. package/templates/docs/02-requirements/non-functional/nfr-001.mdx +0 -3
  60. package/templates/docs/02-requirements/non-functional/nfr-002.mdx +0 -3
  61. package/templates/docs/03-external/business-model.mdx +1 -1
  62. package/templates/docs/03-external/index.mdx +1 -1
  63. package/templates/docs/04-internal/batches/import-products.mdx +2 -6
  64. package/templates/docs/04-internal/policies/github.mdx +1 -1
  65. package/templates/docs/04-internal/rules/database.mdx +1 -1
  66. package/templates/docs/04-internal/screens/dashboard.mdx +1 -1
  67. package/templates/docs/04-internal/screens/index.mdx +1 -1
  68. package/templates/docs/04-internal/screens/login.mdx +1 -1
  69. package/templates/docs/04-internal/screens/menu.mdx +1 -1
  70. package/templates/docs/index.module.css +96 -0
  71. package/templates/docs/index.tsx +48 -0
  72. package/templates/docs/introduction/index.mdx +1 -1
  73. package/templates/docs/introduction/operational-policies/sharepoint.mdx +1 -1
  74. package/templates/package.json.template +46 -0
  75. package/templates/src/components/Highlight/index.tsx +68 -0
  76. package/templates/src/components/PriorityMatrix/index.tsx +97 -0
  77. package/templates/src/components/TBD/index.tsx +16 -0
  78. package/templates/src/css/custom.css +81 -0
  79. package/templates/src/types/requirements.ts +19 -0
  80. package/templates/static/img/business-model.drawio.svg +4 -0
  81. package/templates/static/img/gantt.drawio.svg +1152 -0
  82. package/templates/static/img/logo.svg +21 -0
  83. package/bin/commands/create.d.ts.map +0 -1
  84. package/bin/constants/languages.d.ts.map +0 -1
  85. package/bin/core/interactive-setup.d.ts.map +0 -1
  86. package/bin/core/interactive-setup.test.d.ts.map +0 -1
  87. package/bin/core/project-generator.d.ts.map +0 -1
  88. package/bin/features/index.d.ts.map +0 -1
  89. package/bin/generators/docusaurus-config.d.ts.map +0 -1
  90. package/bin/generators/package-json.d.ts.map +0 -1
  91. package/bin/generators/template-files.d.ts.map +0 -1
  92. package/bin/index.d.ts.map +0 -1
  93. package/bin/plugins/i18n-integration.d.ts +0 -25
  94. package/bin/plugins/i18n-integration.d.ts.map +0 -1
  95. package/bin/plugins/i18n-integration.js +0 -310
  96. package/bin/plugins/i18n-integration.js.map +0 -1
  97. package/bin/plugins/plantuml-integration.d.ts +0 -17
  98. package/bin/plugins/plantuml-integration.d.ts.map +0 -1
  99. package/bin/plugins/plantuml-integration.js +0 -112
  100. package/bin/plugins/plantuml-integration.js.map +0 -1
  101. package/bin/plugins/redoc-integration.d.ts +0 -25
  102. package/bin/plugins/redoc-integration.d.ts.map +0 -1
  103. package/bin/plugins/redoc-integration.js +0 -373
  104. package/bin/plugins/redoc-integration.js.map +0 -1
  105. package/bin/plugins/search-integration.d.ts +0 -20
  106. package/bin/plugins/search-integration.d.ts.map +0 -1
  107. package/bin/plugins/search-integration.js +0 -169
  108. package/bin/plugins/search-integration.js.map +0 -1
  109. package/bin/templates/index.d.ts.map +0 -1
  110. package/bin/templates/template-definitions.d.ts +0 -10
  111. package/bin/templates/template-definitions.d.ts.map +0 -1
  112. package/bin/templates/template-definitions.js +0 -517
  113. package/bin/templates/template-definitions.js.map +0 -1
  114. package/bin/tests/integration.test.d.ts.map +0 -1
  115. package/bin/types/index.d.ts.map +0 -1
  116. package/bin/utils/config-merger.d.ts.map +0 -1
  117. package/bin/utils/errors.d.ts.map +0 -1
  118. package/bin/utils/install.d.ts.map +0 -1
  119. package/bin/utils/message-formatter.d.ts.map +0 -1
  120. package/bin/utils/template-processor.d.ts.map +0 -1
  121. package/bin/utils/template-processor.test.d.ts.map +0 -1
  122. package/bin/utils/version.d.ts.map +0 -1
  123. package/templates/classic-spec/docusaurus.config.js.template +0 -106
  124. package/templates/classic-spec/package.json.template +0 -36
  125. package/templates/docs/example.drawio.svg +0 -57
  126. package/templates/external-design/docusaurus.config.js.template +0 -123
  127. package/templates/external-design/package.json.template +0 -36
  128. package/templates/internal-design/docusaurus.config.js.template +0 -123
  129. package/templates/internal-design/package.json.template +0 -36
  130. package/templates/project-analysis/docusaurus.config.js.template +0 -113
  131. package/templates/project-analysis/package.json.template +0 -36
  132. package/templates/requirements/docusaurus.config.js.template +0 -119
  133. package/templates/requirements/package.json.template +0 -36
@@ -0,0 +1,46 @@
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
+ "typecheck": "tsc"
16
+ },
17
+ "dependencies": {
18
+ "@docusaurus/core": "^3.9.2",
19
+ "@docusaurus/preset-classic": "^3.9.2"{{#hasMermaid}},
20
+ "@docusaurus/theme-mermaid": "^3.9.2"{{/hasMermaid}},
21
+ "@easyops-cn/docusaurus-search-local": "^0.52.2",
22
+ "@mdx-js/react": "^3.0.0",
23
+ "clsx": "^2.0.0"{{#hasPlantUML}},
24
+ "docusaurus-theme-plantuml": "^1.0.2"{{/hasPlantUML}},
25
+ "prism-react-renderer": "^2.4.1",
26
+ "react": "^19.0.0",
27
+ "react-dom": "^19.0.0"{{#hasRedoc}},
28
+ "redocusaurus": "^2.5.0"{{/hasRedoc}}
29
+ },
30
+ "devDependencies": {
31
+ "@docusaurus/module-type-aliases": "^3.9.2",
32
+ "@docusaurus/tsconfig": "3.9.2",
33
+ "@docusaurus/types": "^3.9.2",
34
+ "@types/node": "^24.2.1",
35
+ "@types/react": "^19.0.0",
36
+ "@types/react-dom": "^19.0.0",
37
+ "typescript": "~5.9.2"
38
+ },
39
+ "browserslist": {
40
+ "production": [">0.5%", "not dead", "not op_mini all"],
41
+ "development": ["last 3 chrome version", "last 3 firefox version", "last 5 safari version"]
42
+ },
43
+ "engines": {
44
+ "node": ">=22.0"
45
+ }
46
+ }
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Module Text highlighting. Color designation is possible.
3
+ * @module Highlight
4
+ * @example
5
+ * import { Highlight } from '@site/src/components/Highlight';
6
+ * <Highlight color='#25C2A0'>Green</Highlight>
7
+ * <Highlight color='#1877F2'>Blue</Highlight>
8
+ * <TBD/>
9
+ */
10
+ import type { ReactElement, ReactNode } from 'react';
11
+
12
+ type HighlightProps = {
13
+ /** 強調したい文字列(子要素) */
14
+ children: ReactNode;
15
+ /** 背景色(16進数表記 #RRGGBB か #RGB) */
16
+ color: string;
17
+ };
18
+
19
+ /**
20
+ * Highlight tag.
21
+ * @param {{chidren: string, color: string}}
22
+ * @returns {JSX.Element}
23
+ */
24
+ export function Highlight({ children, color }: HighlightProps): ReactElement {
25
+ return (
26
+ <span
27
+ style={{
28
+ backgroundColor: color,
29
+ borderRadius: '0.5rem',
30
+ color: blackOrWhite(color),
31
+ padding: '0.2rem',
32
+ }}
33
+ >
34
+ {children}
35
+ </span>
36
+ );
37
+ }
38
+
39
+ /**
40
+ * @see {@link https://www.w3.org/TR/AERT/#color-contract}
41
+ * @param hex - example. '11AAFF' or '1AF'
42
+ */
43
+ function blackOrWhite(hex: string): '#FFF' | '#000' {
44
+ const [r, g, b] = hex2rgb(hex);
45
+ return (r * 299 + g * 587 + b * 114) / 1000 < 120 ? '#FFF' : '#000';
46
+ }
47
+
48
+ /**
49
+ * @param hexVal - example. '11AAFF' or '1AF'
50
+ */
51
+ function hex2rgb(hexVal: string): [number, number, number] {
52
+ let hex = hexVal.startsWith('#') ? hexVal.slice(1) : hexVal;
53
+
54
+ if (![3, 6].includes(hex.length)) {
55
+ throw new Error(`Invalid hex string: digit must be 3 or 6. hex=${hexVal}`);
56
+ }
57
+
58
+ if (hex.length === 3) hex = hex.replace(/(.)/g, '$1$1');
59
+ if (!/^[0-9A-Fa-f]{6}$/.test(hex)) {
60
+ throw new Error(`Invalid hex string. not hex number. hex=${hex}`);
61
+ }
62
+ const rgb = hex.match(/../g);
63
+ if (!rgb) {
64
+ throw new Error(`Invalid hex string. unknown. hex=${hex}`);
65
+ }
66
+
67
+ return [Number.parseInt(rgb[0], 16), Number.parseInt(rgb[1], 16), Number.parseInt(rgb[2], 16)];
68
+ }
@@ -0,0 +1,97 @@
1
+ import type { PriorityScale } from '@site/src/types/requirements';
2
+ /**
3
+ * Priority Matrix Component.
4
+ * @module PriorityMatrix
5
+ * @example
6
+ * import { PriorityMatrix } from '@site/src/components/PriorityMatrix';
7
+ * <PriorityMatrix urgency={frontMatter.urgency} importance={frontMatter.importance} />
8
+ */
9
+ import type { ReactElement } from 'react';
10
+
11
+ interface PriorityMatrixProps {
12
+ importance: PriorityScale;
13
+ urgency: PriorityScale;
14
+ }
15
+
16
+ const getBackgroundColor = (value: number, selectedValue: number): string => {
17
+ if (value === selectedValue) return '#007bff';
18
+ if (value >= 7) return 'rgba(220, 53, 69, 0.2)';
19
+ if (value >= 4) return 'rgba(255, 193, 7, 0.2)';
20
+ return 'rgba(40, 167, 69, 0.2)';
21
+ };
22
+
23
+ export function PriorityMatrix({ importance, urgency }: PriorityMatrixProps): ReactElement {
24
+ return (
25
+ <div
26
+ style={{
27
+ marginTop: '1rem',
28
+ color: 'var(--ifm-color-content)',
29
+ }}
30
+ >
31
+ <div
32
+ style={{
33
+ display: 'grid',
34
+ gridTemplateColumns: '80px repeat(9, 40px)',
35
+ gap: '4px',
36
+ fontSize: '0.875rem',
37
+ }}
38
+ >
39
+ {/* 緊急度の行 */}
40
+ <div
41
+ style={{
42
+ display: 'flex',
43
+ alignItems: 'center',
44
+ justifyContent: 'center',
45
+ padding: '4px',
46
+ }}
47
+ >
48
+ 緊急度
49
+ </div>
50
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9].map((num) => (
51
+ <div
52
+ key={`urgency-${num}`}
53
+ style={{
54
+ display: 'flex',
55
+ alignItems: 'center',
56
+ justifyContent: 'center',
57
+ padding: '8px 4px',
58
+ backgroundColor: getBackgroundColor(num, urgency),
59
+ borderRadius: '4px',
60
+ color: num === urgency ? '#ffffff' : 'var(--ifm-color-content)',
61
+ }}
62
+ >
63
+ {num}
64
+ </div>
65
+ ))}
66
+
67
+ {/* 重要度の行 */}
68
+ <div
69
+ style={{
70
+ display: 'flex',
71
+ alignItems: 'center',
72
+ justifyContent: 'center',
73
+ padding: '4px',
74
+ }}
75
+ >
76
+ 重要度
77
+ </div>
78
+ {[1, 2, 3, 4, 5, 6, 7, 8, 9].map((num) => (
79
+ <div
80
+ key={`importance-${num}`}
81
+ style={{
82
+ display: 'flex',
83
+ alignItems: 'center',
84
+ justifyContent: 'center',
85
+ padding: '8px 4px',
86
+ backgroundColor: getBackgroundColor(num, importance),
87
+ borderRadius: '4px',
88
+ color: num === importance ? '#ffffff' : 'var(--ifm-color-content)',
89
+ }}
90
+ >
91
+ {num}
92
+ </div>
93
+ ))}
94
+ </div>
95
+ </div>
96
+ );
97
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Module TBD Label.
3
+ * @module TBD
4
+ * @example
5
+ * import TBD from '@site/src/components/TBD';
6
+ * <TBD/>
7
+ */
8
+ import type { ReactNode } from 'react';
9
+ import { Highlight } from '../Highlight/index';
10
+
11
+ export function TBD(): ReactNode {
12
+ return <Highlight color="#1877F2">TBD</Highlight>;
13
+ }
14
+
15
+ // デフォルトエクスポートも提供
16
+ export default TBD;
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Any CSS included here will be global. The classic template
3
+ * bundles Infima by default. Infima is a CSS framework designed to
4
+ * work well for content-centric websites.
5
+ */
6
+
7
+ /* You can override the default Infima variables here. */
8
+ :root {
9
+ --ifm-color-primary: #2e8555;
10
+ --ifm-color-primary-dark: #29784c;
11
+ --ifm-color-primary-darker: #277148;
12
+ --ifm-color-primary-darkest: #205d3b;
13
+ --ifm-color-primary-light: #33925d;
14
+ --ifm-color-primary-lighter: #359962;
15
+ --ifm-color-primary-lightest: #3cad6e;
16
+ --ifm-code-font-size: 95%;
17
+ --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
18
+ }
19
+
20
+ /* For readability concerns, you should choose a lighter palette in dark mode. */
21
+ [data-theme='dark'] {
22
+ --ifm-color-primary: #25c2a0;
23
+ --ifm-color-primary-dark: #21af90;
24
+ --ifm-color-primary-darker: #1fa588;
25
+ --ifm-color-primary-darkest: #1a8870;
26
+ --ifm-color-primary-light: #29d5b0;
27
+ --ifm-color-primary-lighter: #32d8b4;
28
+ --ifm-color-primary-lightest: #4fddbf;
29
+ --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
30
+ }
31
+ .docusaurus-highlight-code-line {
32
+ background-color: rgba(0, 0, 0, 0.1);
33
+ display: block;
34
+ margin: 0 calc(-1 * var(--ifm-pre-padding));
35
+ padding: 0 var(--ifm-pre-padding);
36
+ }
37
+
38
+ [data-theme='dark'] .docusaurus-highlight-code-line {
39
+ background-color: rgba(0, 0, 0, 0.3);
40
+ }
41
+
42
+ /* Chapter number */
43
+ main div.container article div.theme-doc-markdown {
44
+ counter-reset: ch-lv1;
45
+ }
46
+ main div.container article div.theme-doc-markdown > h2 {
47
+ counter-reset: ch-lv2;
48
+ }
49
+ main div.container article div.theme-doc-markdown > h3 {
50
+ counter-reset: ch-lv3;
51
+ }
52
+ main div.container article div.theme-doc-markdown > h4 {
53
+ counter-reset: ch-lv4;
54
+ }
55
+
56
+ main div.container article div.theme-doc-markdown > h2::before {
57
+ counter-increment: ch-lv1;
58
+ content: counter(ch-lv1) '. ';
59
+ }
60
+ main div.container article div.theme-doc-markdown > h3::before {
61
+ counter-increment: ch-lv2;
62
+ content: counter(ch-lv1) '.' counter(ch-lv2) '. ';
63
+ }
64
+ main div.container article div.theme-doc-markdown > h4::before {
65
+ counter-increment: ch-lv3;
66
+ content: counter(ch-lv1) '.' counter(ch-lv2) '.' counter(ch-lv3) '. ';
67
+ }
68
+ main div.container article div.theme-doc-markdown > h5::before {
69
+ counter-increment: ch-lv4;
70
+ content: counter(ch-lv1) '.' counter(ch-lv2) '.' counter(ch-lv3) '.' counter(ch-lv4) '. ';
71
+ }
72
+
73
+ /* Table of contents number */
74
+ main div[class^='tableOfContents_'] ul {
75
+ counter-reset: toc-lv;
76
+ list-style: none;
77
+ }
78
+ main div[class^='tableOfContents_'] ul > li > a::before {
79
+ counter-increment: toc-lv;
80
+ content: counters(toc-lv, '.') '. ';
81
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Requirements related type definitions
3
+ */
4
+
5
+ /**
6
+ * Priority scale from 1 to 9
7
+ * 1-3: Low priority
8
+ * 4-6: Medium priority
9
+ * 7-9: High priority
10
+ */
11
+ export type PriorityScale = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9;
12
+
13
+ /**
14
+ * Requirement priority matrix
15
+ */
16
+ export interface RequirementPriority {
17
+ importance: PriorityScale;
18
+ urgency: PriorityScale;
19
+ }