create-eziwiki 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.
Files changed (98) hide show
  1. package/README.md +46 -0
  2. package/bin/create-eziwiki.mjs +83 -0
  3. package/lib/scaffold.mjs +230 -0
  4. package/lib/scaffold.test.mjs +270 -0
  5. package/package.json +38 -0
  6. package/template/README.md +39 -0
  7. package/template/app/[...slug]/page.tsx +162 -0
  8. package/template/app/error.tsx +77 -0
  9. package/template/app/global-error.tsx +76 -0
  10. package/template/app/globals.css +44 -0
  11. package/template/app/graph/page.tsx +62 -0
  12. package/template/app/layout.tsx +164 -0
  13. package/template/app/not-found.tsx +48 -0
  14. package/template/app/page.tsx +34 -0
  15. package/template/app/robots.ts +20 -0
  16. package/template/app/sitemap.ts +48 -0
  17. package/template/components/ThemeToggle.tsx +77 -0
  18. package/template/components/graph/GraphView.tsx +156 -0
  19. package/template/components/layout/Backlinks.tsx +42 -0
  20. package/template/components/layout/Breadcrumb.tsx +88 -0
  21. package/template/components/layout/MobileMenu.tsx +299 -0
  22. package/template/components/layout/NavigationButtons.tsx +87 -0
  23. package/template/components/layout/PageLayout.tsx +89 -0
  24. package/template/components/layout/Sidebar.tsx +376 -0
  25. package/template/components/layout/TabBar.tsx +312 -0
  26. package/template/components/layout/TabBarSkeleton.tsx +12 -0
  27. package/template/components/layout/TabInitializer.tsx +99 -0
  28. package/template/components/layout/TableOfContents.tsx +138 -0
  29. package/template/components/markdown/CodeCopy.tsx +65 -0
  30. package/template/components/markdown/MarkdownContent.tsx +38 -0
  31. package/template/components/markdown/PageTransition.tsx +56 -0
  32. package/template/components/providers/UrlMapProvider.tsx +68 -0
  33. package/template/components/search/SearchDialog.tsx +286 -0
  34. package/template/components/search/SearchTrigger.tsx +41 -0
  35. package/template/content/guides/_meta.json +4 -0
  36. package/template/content/guides/writing.md +82 -0
  37. package/template/content/intro.md +29 -0
  38. package/template/eslintignore +7 -0
  39. package/template/eslintrc.js +40 -0
  40. package/template/gitignore +40 -0
  41. package/template/lib/basePath.test.ts +120 -0
  42. package/template/lib/basePath.ts +108 -0
  43. package/template/lib/cache.ts +36 -0
  44. package/template/lib/content/registry.ts +311 -0
  45. package/template/lib/content/resolver.ts +109 -0
  46. package/template/lib/graph/build.ts +214 -0
  47. package/template/lib/graph/layout.test.ts +189 -0
  48. package/template/lib/graph/layout.ts +247 -0
  49. package/template/lib/markdown/languages.test.ts +85 -0
  50. package/template/lib/markdown/languages.ts +103 -0
  51. package/template/lib/markdown/rehype-plugins.ts +240 -0
  52. package/template/lib/markdown/remark-wikilink.ts +141 -0
  53. package/template/lib/markdown/render.ts +175 -0
  54. package/template/lib/markdown/wikilink.test.ts +91 -0
  55. package/template/lib/markdown/wikilink.ts +85 -0
  56. package/template/lib/navigation/auto.ts +227 -0
  57. package/template/lib/navigation/builder.test.ts +129 -0
  58. package/template/lib/navigation/builder.ts +122 -0
  59. package/template/lib/navigation/hash.ts +32 -0
  60. package/template/lib/navigation/url.test.ts +88 -0
  61. package/template/lib/navigation/url.ts +108 -0
  62. package/template/lib/navigation/urlMap.ts +81 -0
  63. package/template/lib/payload/schema.ts +81 -0
  64. package/template/lib/payload/types.ts +105 -0
  65. package/template/lib/payload/validator.ts +56 -0
  66. package/template/lib/search/build.ts +204 -0
  67. package/template/lib/search/client.ts +190 -0
  68. package/template/lib/search/tokenizer.test.ts +60 -0
  69. package/template/lib/search/tokenizer.ts +83 -0
  70. package/template/lib/search/types.ts +40 -0
  71. package/template/lib/site.ts +86 -0
  72. package/template/lib/store/searchStore.ts +26 -0
  73. package/template/lib/store/tabStore.ts +313 -0
  74. package/template/next-env.d.ts +5 -0
  75. package/template/next.config.js +43 -0
  76. package/template/package-lock.json +9933 -0
  77. package/template/package.json +69 -0
  78. package/template/payload/config.ts +34 -0
  79. package/template/postcss.config.js +6 -0
  80. package/template/prettierignore +7 -0
  81. package/template/prettierrc +8 -0
  82. package/template/public/favicon.svg +10 -0
  83. package/template/public/fonts/Pretandard/Pretendard-Bold.woff2 +0 -0
  84. package/template/public/fonts/Pretandard/Pretendard-Regular.woff2 +0 -0
  85. package/template/public/fonts/Pretandard/Pretendard-SemiBold.woff2 +0 -0
  86. package/template/public/fonts/SUITE/SUITE-Bold.woff2 +0 -0
  87. package/template/public/fonts/SUITE/SUITE-Regular.woff2 +0 -0
  88. package/template/public/fonts/SUITE/SUITE-SemiBold.woff2 +0 -0
  89. package/template/public/images/.gitkeep +0 -0
  90. package/template/scripts/build-search-index.ts +36 -0
  91. package/template/scripts/check-links.ts +40 -0
  92. package/template/scripts/show-urls.ts +48 -0
  93. package/template/scripts/validate-payload.ts +30 -0
  94. package/template/styles/markdown.css +167 -0
  95. package/template/styles/theme.css +65 -0
  96. package/template/tailwind.config.ts +156 -0
  97. package/template/tsconfig.json +32 -0
  98. package/template/vitest.config.ts +30 -0
@@ -0,0 +1,156 @@
1
+ import type { Config } from 'tailwindcss';
2
+
3
+ const config: Config = {
4
+ darkMode: 'class',
5
+ content: [
6
+ './pages/**/*.{js,ts,jsx,tsx,mdx}',
7
+ './components/**/*.{js,ts,jsx,tsx,mdx}',
8
+ './app/**/*.{js,ts,jsx,tsx,mdx}',
9
+ ],
10
+ theme: {
11
+ extend: {
12
+ colors: {
13
+ primary: {
14
+ DEFAULT: 'var(--color-primary)',
15
+ hover: 'var(--color-primary-hover)',
16
+ },
17
+ secondary: {
18
+ DEFAULT: 'var(--color-secondary)',
19
+ hover: 'var(--color-secondary-hover)',
20
+ },
21
+ background: 'var(--color-background)',
22
+ text: {
23
+ DEFAULT: 'var(--color-text)',
24
+ muted: 'var(--color-text-muted)',
25
+ },
26
+ sidebar: {
27
+ bg: 'var(--color-sidebar-bg)',
28
+ text: 'var(--color-sidebar-text)',
29
+ hover: 'var(--color-sidebar-hover)',
30
+ active: 'var(--color-sidebar-active)',
31
+ },
32
+ code: {
33
+ bg: 'var(--color-code-bg)',
34
+ text: 'var(--color-code-text)',
35
+ },
36
+ border: 'var(--color-border)',
37
+ },
38
+ typography: {
39
+ DEFAULT: {
40
+ css: {
41
+ '--tw-prose-body': 'var(--color-text)',
42
+ '--tw-prose-headings': 'var(--color-text)',
43
+ '--tw-prose-links': 'var(--color-primary)',
44
+ '--tw-prose-bold': 'var(--color-text)',
45
+ '--tw-prose-code': 'var(--color-code-text)',
46
+ '--tw-prose-pre-bg': 'var(--color-code-bg)',
47
+ '--tw-prose-quotes': 'var(--color-text-muted)',
48
+ color: 'var(--color-text)',
49
+ maxWidth: 'none',
50
+ fontSize: '1rem',
51
+ lineHeight: '1.75',
52
+ a: {
53
+ color: 'var(--color-primary)',
54
+ textDecoration: 'none',
55
+ '&:hover': {
56
+ color: 'var(--color-primary-hover)',
57
+ },
58
+ },
59
+ code: {
60
+ color: 'var(--color-code-text)',
61
+ backgroundColor: 'var(--color-code-bg)',
62
+ padding: '0.25rem 0.375rem',
63
+ borderRadius: '0.25rem',
64
+ fontWeight: '400',
65
+ },
66
+ 'code::before': {
67
+ content: '""',
68
+ },
69
+ 'code::after': {
70
+ content: '""',
71
+ },
72
+ pre: {
73
+ backgroundColor: 'var(--color-code-bg)',
74
+ color: 'var(--color-code-text)',
75
+ },
76
+ h1: {
77
+ fontSize: '2rem',
78
+ lineHeight: '1.2',
79
+ fontWeight: '700',
80
+ },
81
+ h2: {
82
+ fontSize: '1.75rem',
83
+ lineHeight: '1.3',
84
+ fontWeight: '600',
85
+ },
86
+ h3: {
87
+ fontSize: '1.5rem',
88
+ lineHeight: '1.4',
89
+ fontWeight: '600',
90
+ },
91
+ h4: {
92
+ fontSize: '1.25rem',
93
+ lineHeight: '1.5',
94
+ fontWeight: '600',
95
+ },
96
+ },
97
+ },
98
+ sm: {
99
+ css: {
100
+ fontSize: '0.875rem',
101
+ lineHeight: '1.7',
102
+ h1: {
103
+ fontSize: '1.75rem',
104
+ lineHeight: '1.2',
105
+ },
106
+ h2: {
107
+ fontSize: '1.5rem',
108
+ lineHeight: '1.3',
109
+ },
110
+ h3: {
111
+ fontSize: '1.25rem',
112
+ lineHeight: '1.4',
113
+ },
114
+ h4: {
115
+ fontSize: '1.125rem',
116
+ lineHeight: '1.5',
117
+ },
118
+ },
119
+ },
120
+ lg: {
121
+ css: {
122
+ fontSize: '1.125rem',
123
+ lineHeight: '1.8',
124
+ h1: {
125
+ fontSize: '2.5rem',
126
+ lineHeight: '1.2',
127
+ },
128
+ h2: {
129
+ fontSize: '2rem',
130
+ lineHeight: '1.3',
131
+ },
132
+ h3: {
133
+ fontSize: '1.75rem',
134
+ lineHeight: '1.4',
135
+ },
136
+ h4: {
137
+ fontSize: '1.5rem',
138
+ lineHeight: '1.5',
139
+ },
140
+ },
141
+ },
142
+ },
143
+ screens: {
144
+ xs: '475px',
145
+ sm: '640px',
146
+ md: '768px',
147
+ lg: '1024px',
148
+ xl: '1280px',
149
+ '2xl': '1536px',
150
+ },
151
+ },
152
+ },
153
+ plugins: [require('@tailwindcss/typography')],
154
+ };
155
+
156
+ export default config;
@@ -0,0 +1,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "lib": ["dom", "dom.iterable", "esnext"],
4
+ "allowJs": true,
5
+ "skipLibCheck": true,
6
+ "strict": true,
7
+ "noEmit": true,
8
+ "esModuleInterop": true,
9
+ "module": "esnext",
10
+ "moduleResolution": "bundler",
11
+ "resolveJsonModule": true,
12
+ "isolatedModules": true,
13
+ "jsx": "preserve",
14
+ "incremental": true,
15
+ "plugins": [
16
+ {
17
+ "name": "next"
18
+ }
19
+ ],
20
+ "paths": {
21
+ "@/*": ["./*"]
22
+ },
23
+ "forceConsistentCasingInFileNames": true,
24
+ "noUnusedLocals": true,
25
+ "noUnusedParameters": true,
26
+ "noFallthroughCasesInSwitch": true,
27
+ "alwaysStrict": true,
28
+ "target": "es2017"
29
+ },
30
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
31
+ "exclude": ["node_modules", "reference", "packages/*/template"]
32
+ }
@@ -0,0 +1,30 @@
1
+ import { defineConfig } from 'vitest/config';
2
+ import path from 'path';
3
+
4
+ export default defineConfig({
5
+ test: {
6
+ globals: true,
7
+ exclude: [
8
+ '**/node_modules/**',
9
+ '**/dist/**',
10
+ // The CLI template is a generated copy of this source tree; running its
11
+ // tests here would double every result and report failures against files
12
+ // nobody edits directly.
13
+ 'packages/*/template/**',
14
+ ],
15
+ // The first test to render Markdown pays for Shiki loading its grammars and
16
+ // themes, which takes several seconds. That cost is real and one-off — it is
17
+ // amortised across the whole build — so the timeout has to accommodate it
18
+ // rather than the default 5s failing the first test to arrive.
19
+ testTimeout: 30_000,
20
+ // Hooks get their own budget, and the suites that build a search index do
21
+ // that work in beforeAll. At ~8s it sits uncomfortably close to the 10s
22
+ // default whenever the machine is busy, which makes for a flaky CI.
23
+ hookTimeout: 30_000,
24
+ },
25
+ resolve: {
26
+ alias: {
27
+ '@': path.resolve(__dirname, './'),
28
+ },
29
+ },
30
+ });