@forumone/create-throughline 0.2.1 → 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 (131) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/generator.d.ts +2 -0
  3. package/dist/generator.d.ts.map +1 -1
  4. package/dist/generator.js +21 -4
  5. package/dist/generator.js.map +1 -1
  6. package/dist/templates/base/apps/web/package.json.template +2 -1
  7. package/dist/templates/base/apps/web/src/app/api/inngest/route.ts.template +2 -2
  8. package/dist/templates/base/apps/web/src/payload.config.ts.template +7 -5
  9. package/dist/templates/base/apps/web/tsconfig.json +2 -1
  10. package/dist/templates/base/gitignore +15 -0
  11. package/dist/templates/base/package.json.template +4 -1
  12. package/dist/templates/base/pnpm-workspace.yaml +1 -0
  13. package/dist/templates/base/turbo.json +11 -0
  14. package/dist/templates/with-reference-ds/design-system/.storybook/main.ts +21 -0
  15. package/dist/templates/with-reference-ds/design-system/.storybook/preview.ts +19 -0
  16. package/dist/templates/with-reference-ds/design-system/README.md +33 -0
  17. package/dist/templates/with-reference-ds/design-system/gitignore +5 -0
  18. package/dist/templates/with-reference-ds/design-system/package.json.template +62 -0
  19. package/dist/templates/with-reference-ds/design-system/scripts/build-manifest.ts +89 -0
  20. package/dist/templates/with-reference-ds/design-system/scripts/build-styles.ts +28 -0
  21. package/dist/templates/with-reference-ds/design-system/scripts/build-tokens-css.ts +43 -0
  22. package/dist/templates/with-reference-ds/design-system/scripts/validate.ts +58 -0
  23. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/CTASection.contract.ts +128 -0
  24. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/CTASection.module.css +83 -0
  25. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/CTASection.stories.tsx +39 -0
  26. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/CTASection.test.tsx +27 -0
  27. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/CTASection.tsx +41 -0
  28. package/dist/templates/with-reference-ds/design-system/src/components/CTASection/index.ts +2 -0
  29. package/dist/templates/with-reference-ds/design-system/src/components/Card/Card.contract.ts +122 -0
  30. package/dist/templates/with-reference-ds/design-system/src/components/Card/Card.module.css +64 -0
  31. package/dist/templates/with-reference-ds/design-system/src/components/Card/Card.stories.tsx +45 -0
  32. package/dist/templates/with-reference-ds/design-system/src/components/Card/Card.test.tsx +37 -0
  33. package/dist/templates/with-reference-ds/design-system/src/components/Card/Card.tsx +39 -0
  34. package/dist/templates/with-reference-ds/design-system/src/components/Card/index.ts +2 -0
  35. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/CardGrid.contract.ts +78 -0
  36. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/CardGrid.module.css +34 -0
  37. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/CardGrid.stories.tsx +36 -0
  38. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/CardGrid.test.tsx +25 -0
  39. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/CardGrid.tsx +19 -0
  40. package/dist/templates/with-reference-ds/design-system/src/components/CardGrid/index.ts +2 -0
  41. package/dist/templates/with-reference-ds/design-system/src/components/Divider/Divider.contract.ts +87 -0
  42. package/dist/templates/with-reference-ds/design-system/src/components/Divider/Divider.module.css +18 -0
  43. package/dist/templates/with-reference-ds/design-system/src/components/Divider/Divider.stories.tsx +35 -0
  44. package/dist/templates/with-reference-ds/design-system/src/components/Divider/Divider.test.tsx +20 -0
  45. package/dist/templates/with-reference-ds/design-system/src/components/Divider/Divider.tsx +17 -0
  46. package/dist/templates/with-reference-ds/design-system/src/components/Divider/index.ts +2 -0
  47. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/FAQ.contract.ts +104 -0
  48. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/FAQ.module.css +66 -0
  49. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/FAQ.stories.tsx +61 -0
  50. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/FAQ.test.tsx +30 -0
  51. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/FAQ.tsx +41 -0
  52. package/dist/templates/with-reference-ds/design-system/src/components/FAQ/index.ts +2 -0
  53. package/dist/templates/with-reference-ds/design-system/src/components/Hero/Hero.contract.ts +182 -0
  54. package/dist/templates/with-reference-ds/design-system/src/components/Hero/Hero.module.css +124 -0
  55. package/dist/templates/with-reference-ds/design-system/src/components/Hero/Hero.stories.tsx +58 -0
  56. package/dist/templates/with-reference-ds/design-system/src/components/Hero/Hero.test.tsx +49 -0
  57. package/dist/templates/with-reference-ds/design-system/src/components/Hero/Hero.tsx +67 -0
  58. package/dist/templates/with-reference-ds/design-system/src/components/Hero/index.ts +2 -0
  59. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/MediaBlock.contract.ts +94 -0
  60. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/MediaBlock.module.css +49 -0
  61. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/MediaBlock.stories.tsx +37 -0
  62. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/MediaBlock.test.tsx +35 -0
  63. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/MediaBlock.tsx +49 -0
  64. package/dist/templates/with-reference-ds/design-system/src/components/MediaBlock/index.ts +7 -0
  65. package/dist/templates/with-reference-ds/design-system/src/components/Prose/Prose.contract.ts +107 -0
  66. package/dist/templates/with-reference-ds/design-system/src/components/Prose/Prose.module.css +72 -0
  67. package/dist/templates/with-reference-ds/design-system/src/components/Prose/Prose.stories.tsx +39 -0
  68. package/dist/templates/with-reference-ds/design-system/src/components/Prose/Prose.test.tsx +26 -0
  69. package/dist/templates/with-reference-ds/design-system/src/components/Prose/Prose.tsx +15 -0
  70. package/dist/templates/with-reference-ds/design-system/src/components/Prose/index.ts +2 -0
  71. package/dist/templates/with-reference-ds/design-system/src/components/Quote/Quote.contract.ts +101 -0
  72. package/dist/templates/with-reference-ds/design-system/src/components/Quote/Quote.module.css +59 -0
  73. package/dist/templates/with-reference-ds/design-system/src/components/Quote/Quote.stories.tsx +44 -0
  74. package/dist/templates/with-reference-ds/design-system/src/components/Quote/Quote.test.tsx +37 -0
  75. package/dist/templates/with-reference-ds/design-system/src/components/Quote/Quote.tsx +40 -0
  76. package/dist/templates/with-reference-ds/design-system/src/components/Quote/index.ts +2 -0
  77. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/SectionIntro.contract.ts +108 -0
  78. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/SectionIntro.module.css +36 -0
  79. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/SectionIntro.stories.tsx +33 -0
  80. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/SectionIntro.test.tsx +28 -0
  81. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/SectionIntro.tsx +28 -0
  82. package/dist/templates/with-reference-ds/design-system/src/components/SectionIntro/index.ts +2 -0
  83. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/Spacer.contract.ts +76 -0
  84. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/Spacer.module.css +23 -0
  85. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/Spacer.stories.tsx +25 -0
  86. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/Spacer.test.tsx +17 -0
  87. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/Spacer.tsx +19 -0
  88. package/dist/templates/with-reference-ds/design-system/src/components/Spacer/index.ts +2 -0
  89. package/dist/templates/with-reference-ds/design-system/src/components/Stats/Stats.contract.ts +103 -0
  90. package/dist/templates/with-reference-ds/design-system/src/components/Stats/Stats.module.css +88 -0
  91. package/dist/templates/with-reference-ds/design-system/src/components/Stats/Stats.stories.tsx +44 -0
  92. package/dist/templates/with-reference-ds/design-system/src/components/Stats/Stats.test.tsx +44 -0
  93. package/dist/templates/with-reference-ds/design-system/src/components/Stats/Stats.tsx +39 -0
  94. package/dist/templates/with-reference-ds/design-system/src/components/Stats/index.ts +2 -0
  95. package/dist/templates/with-reference-ds/design-system/src/css-modules.d.ts +5 -0
  96. package/dist/templates/with-reference-ds/design-system/src/foundations/Colors.stories.tsx +46 -0
  97. package/dist/templates/with-reference-ds/design-system/src/foundations/Elevation.stories.tsx +37 -0
  98. package/dist/templates/with-reference-ds/design-system/src/foundations/LayoutContainers.stories.tsx +86 -0
  99. package/dist/templates/with-reference-ds/design-system/src/foundations/Radii.stories.tsx +38 -0
  100. package/dist/templates/with-reference-ds/design-system/src/foundations/Spacing.stories.tsx +33 -0
  101. package/dist/templates/with-reference-ds/design-system/src/foundations/Typography.stories.tsx +55 -0
  102. package/dist/templates/with-reference-ds/design-system/src/foundations/_helpers.tsx +82 -0
  103. package/dist/templates/with-reference-ds/design-system/src/index.ts +14 -0
  104. package/dist/templates/with-reference-ds/design-system/src/styles/base.css +55 -0
  105. package/dist/templates/with-reference-ds/design-system/src/styles/reset.css +48 -0
  106. package/dist/templates/with-reference-ds/design-system/src/styles/tokens.css +116 -0
  107. package/dist/templates/with-reference-ds/design-system/src/tokens/colors.ts +54 -0
  108. package/dist/templates/with-reference-ds/design-system/src/tokens/index.ts +32 -0
  109. package/dist/templates/with-reference-ds/design-system/src/tokens/layout.ts +26 -0
  110. package/dist/templates/with-reference-ds/design-system/src/tokens/radii.ts +11 -0
  111. package/dist/templates/with-reference-ds/design-system/src/tokens/spacing.ts +26 -0
  112. package/dist/templates/with-reference-ds/design-system/src/tokens/typography.ts +32 -0
  113. package/dist/templates/with-reference-ds/design-system/tsconfig.json +24 -0
  114. package/dist/templates/with-reference-ds/design-system/vitest.config.ts +15 -0
  115. package/dist/templates/with-reference-ds/design-system/vitest.setup.ts +7 -0
  116. package/dist/templates/without-reference-ds/design-system/.storybook/main.ts +21 -0
  117. package/dist/templates/without-reference-ds/design-system/.storybook/preview.ts +16 -0
  118. package/dist/templates/without-reference-ds/design-system/README.md +20 -0
  119. package/dist/templates/without-reference-ds/design-system/gitignore +5 -0
  120. package/dist/templates/without-reference-ds/design-system/package.json.template +33 -0
  121. package/dist/templates/without-reference-ds/design-system/src/foundations/Welcome.stories.tsx +24 -0
  122. package/dist/templates/without-reference-ds/design-system/src/index.ts +9 -0
  123. package/dist/templates/without-reference-ds/design-system/tsconfig.json +11 -0
  124. package/package.json +3 -1
  125. package/dist/templates/with-reference-ds/packages/design-system/package.json.template +0 -18
  126. package/dist/templates/with-reference-ds/packages/design-system/src/index.ts +0 -6
  127. package/dist/templates/with-reference-ds/packages/design-system/src/manifest.ts +0 -6
  128. package/dist/templates/with-reference-ds/packages/design-system/tsconfig.json +0 -9
  129. package/dist/templates/without-reference-ds/packages/design-system/README.md +0 -19
  130. package/dist/templates/without-reference-ds/packages/design-system/package.json.template +0 -14
  131. package/dist/templates/without-reference-ds/packages/design-system/src/index.ts +0 -8
@@ -0,0 +1,54 @@
1
+ export const colors = {
2
+ 'color.neutral.0': '#FFFFFF',
3
+ 'color.neutral.50': '#FAFAFA',
4
+ 'color.neutral.100': '#F4F4F5',
5
+ 'color.neutral.200': '#E4E4E7',
6
+ 'color.neutral.300': '#D4D4D8',
7
+ 'color.neutral.400': '#A1A1AA',
8
+ 'color.neutral.500': '#71717A',
9
+ 'color.neutral.600': '#52525B',
10
+ 'color.neutral.700': '#3F3F46',
11
+ 'color.neutral.800': '#27272A',
12
+ 'color.neutral.900': '#18181B',
13
+ 'color.neutral.1000': '#000000',
14
+
15
+ 'color.brand.primary': '#2563EB',
16
+ 'color.brand.primaryHover': '#1D4ED8',
17
+ 'color.brand.secondary': '#0891B2',
18
+
19
+ 'color.text.primary': '#18181B',
20
+ 'color.text.secondary': '#52525B',
21
+ 'color.text.muted': '#71717A',
22
+ 'color.text.inverse': '#FFFFFF',
23
+
24
+ 'color.bg.primary': '#FFFFFF',
25
+ 'color.bg.secondary': '#FAFAFA',
26
+ 'color.bg.tertiary': '#F4F4F5',
27
+ 'color.bg.inverse': '#18181B',
28
+
29
+ 'color.border.default': '#E4E4E7',
30
+ 'color.border.strong': '#D4D4D8',
31
+
32
+ 'color.state.success': '#16A34A',
33
+ 'color.state.warning': '#CA8A04',
34
+ 'color.state.error': '#DC2626',
35
+ 'color.state.info': '#2563EB',
36
+ } as const
37
+
38
+ /**
39
+ * Tokens that swap under `prefers-color-scheme: dark`. Keys match the base
40
+ * palette; values replace the light defaults when the media query applies.
41
+ */
42
+ export const darkOverrides = {
43
+ 'color.text.primary': '#FAFAFA',
44
+ 'color.text.secondary': '#A1A1AA',
45
+ 'color.text.muted': '#71717A',
46
+ 'color.bg.primary': '#18181B',
47
+ 'color.bg.secondary': '#27272A',
48
+ 'color.bg.tertiary': '#3F3F46',
49
+ 'color.bg.inverse': '#FAFAFA',
50
+ 'color.border.default': '#3F3F46',
51
+ 'color.border.strong': '#52525B',
52
+ } as const
53
+
54
+ export type ColorToken = keyof typeof colors
@@ -0,0 +1,32 @@
1
+ import { colors, darkOverrides } from './colors.js'
2
+ import { typography } from './typography.js'
3
+ import { spacing } from './spacing.js'
4
+ import { radii } from './radii.js'
5
+ import { layout } from './layout.js'
6
+
7
+ export { colors, darkOverrides, typography, spacing, radii, layout }
8
+ export type { ColorToken } from './colors.js'
9
+ export type { TypographyToken } from './typography.js'
10
+ export type { SpacingToken } from './spacing.js'
11
+ export type { RadiusToken } from './radii.js'
12
+ export type { LayoutToken } from './layout.js'
13
+
14
+ export const allTokens = {
15
+ ...colors,
16
+ ...typography,
17
+ ...spacing,
18
+ ...radii,
19
+ ...layout,
20
+ } as const
21
+
22
+ export type TokenName = keyof typeof allTokens
23
+
24
+ /** Returns every token in the shape the design-contract manifest expects. */
25
+ export function getTokenList() {
26
+ const categorize = (name: string) => name.split('.')[0] ?? 'other'
27
+ return Object.entries(allTokens).map(([name, value]) => ({
28
+ name,
29
+ value,
30
+ category: categorize(name),
31
+ }))
32
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Layout & container tokens: the max-widths a page constrains to, the
3
+ * horizontal gutter/margins, and the responsive breakpoints. These are the
4
+ * values the "Layout & Containers" foundation documents. Brand projects
5
+ * override them (e.g. Forum One uses constrain 800/1440/2200, gutter 40,
6
+ * breakpoints 320–1400); the reference DS ships neutral defaults.
7
+ */
8
+ export const layout = {
9
+ /** Container max-widths the page content constrains to. */
10
+ 'layout.container.sm': '40rem', // 640px — narrow prose
11
+ 'layout.container.md': '64rem', // 1024px — default content width
12
+ 'layout.container.lg': '80rem', // 1280px — wide / full-bleed sections
13
+
14
+ /** Horizontal gutter between grid columns. */
15
+ 'layout.gutter': '1.5rem', // 24px
16
+ /** Page side margins (inside the viewport, outside the container). */
17
+ 'layout.margin': '1rem', // 16px
18
+
19
+ /** Responsive breakpoints (min-width). */
20
+ 'layout.breakpoint.sm': '40rem', // 640px
21
+ 'layout.breakpoint.md': '48rem', // 768px
22
+ 'layout.breakpoint.lg': '64rem', // 1024px
23
+ 'layout.breakpoint.xl': '80rem', // 1280px
24
+ } as const
25
+
26
+ export type LayoutToken = keyof typeof layout
@@ -0,0 +1,11 @@
1
+ export const radii = {
2
+ 'radius.none': '0',
3
+ 'radius.sm': '0.25rem',
4
+ 'radius.md': '0.375rem',
5
+ 'radius.lg': '0.5rem',
6
+ 'radius.xl': '0.75rem',
7
+ 'radius.2xl': '1rem',
8
+ 'radius.full': '9999px',
9
+ } as const
10
+
11
+ export type RadiusToken = keyof typeof radii
@@ -0,0 +1,26 @@
1
+ export const spacing = {
2
+ 'spacing.0': '0',
3
+ 'spacing.px': '1px',
4
+ 'spacing.0.5': '0.125rem',
5
+ 'spacing.1': '0.25rem',
6
+ 'spacing.2': '0.5rem',
7
+ 'spacing.3': '0.75rem',
8
+ 'spacing.4': '1rem',
9
+ 'spacing.5': '1.25rem',
10
+ 'spacing.6': '1.5rem',
11
+ 'spacing.8': '2rem',
12
+ 'spacing.10': '2.5rem',
13
+ 'spacing.12': '3rem',
14
+ 'spacing.16': '4rem',
15
+ 'spacing.20': '5rem',
16
+ 'spacing.24': '6rem',
17
+ 'spacing.32': '8rem',
18
+ 'spacing.40': '10rem',
19
+ 'spacing.48': '12rem',
20
+ /** Semantic: default vertical padding inside a page section. */
21
+ 'spacing.section': '5rem',
22
+ /** Semantic: horizontal gutter inside the page container. */
23
+ 'spacing.container': '1.5rem',
24
+ } as const
25
+
26
+ export type SpacingToken = keyof typeof spacing
@@ -0,0 +1,32 @@
1
+ export const typography = {
2
+ 'font.family.sans': 'Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif',
3
+ 'font.family.mono': 'ui-monospace, "SF Mono", Monaco, Consolas, monospace',
4
+
5
+ 'font.size.xs': '0.75rem',
6
+ 'font.size.sm': '0.875rem',
7
+ 'font.size.base': '1rem',
8
+ 'font.size.lg': '1.125rem',
9
+ 'font.size.xl': '1.25rem',
10
+ 'font.size.2xl': '1.5rem',
11
+ 'font.size.3xl': '1.875rem',
12
+ 'font.size.4xl': '2.25rem',
13
+ 'font.size.5xl': '3rem',
14
+ 'font.size.6xl': '3.75rem',
15
+
16
+ 'font.weight.normal': '400',
17
+ 'font.weight.medium': '500',
18
+ 'font.weight.semibold': '600',
19
+ 'font.weight.bold': '700',
20
+
21
+ 'line.height.tight': '1.15',
22
+ 'line.height.snug': '1.3',
23
+ 'line.height.normal': '1.5',
24
+ 'line.height.relaxed': '1.65',
25
+ 'line.height.loose': '1.8',
26
+
27
+ 'letter.spacing.tight': '-0.025em',
28
+ 'letter.spacing.normal': '0',
29
+ 'letter.spacing.wide': '0.025em',
30
+ } as const
31
+
32
+ export type TypographyToken = keyof typeof typography
@@ -0,0 +1,24 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "composite": true,
5
+ "declaration": true,
6
+ "declarationMap": true,
7
+ "sourceMap": true,
8
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
9
+ "jsx": "react-jsx",
10
+ "rootDir": "./src",
11
+ "outDir": "./dist",
12
+ "resolveJsonModule": true
13
+ },
14
+ "include": ["src/**/*"],
15
+ "exclude": [
16
+ "dist",
17
+ "storybook-static",
18
+ "node_modules",
19
+ "**/*.test.ts",
20
+ "**/*.test.tsx",
21
+ "**/*.stories.ts",
22
+ "**/*.stories.tsx"
23
+ ]
24
+ }
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from 'vitest/config'
2
+ import react from '@vitejs/plugin-react'
3
+
4
+ export default defineConfig({
5
+ plugins: [react()],
6
+ test: {
7
+ environment: 'jsdom',
8
+ setupFiles: ['./vitest.setup.ts'],
9
+ include: ['src/**/*.test.{ts,tsx}'],
10
+ passWithNoTests: true,
11
+ css: {
12
+ modules: { classNameStrategy: 'non-scoped' },
13
+ },
14
+ },
15
+ })
@@ -0,0 +1,7 @@
1
+ import '@testing-library/jest-dom/vitest'
2
+ import { cleanup } from '@testing-library/react'
3
+ import { afterEach } from 'vitest'
4
+
5
+ afterEach(() => {
6
+ cleanup()
7
+ })
@@ -0,0 +1,21 @@
1
+ import type { StorybookConfig } from '@storybook/react-vite'
2
+
3
+ const config: StorybookConfig = {
4
+ stories: [
5
+ '../src/foundations/**/*.stories.@(ts|tsx)',
6
+ '../src/components/**/*.stories.@(ts|tsx)',
7
+ ],
8
+ addons: ['@storybook/addon-a11y'],
9
+ framework: {
10
+ name: '@storybook/react-vite',
11
+ options: {},
12
+ },
13
+ typescript: {
14
+ reactDocgen: 'react-docgen-typescript',
15
+ },
16
+ docs: {
17
+ autodocs: true,
18
+ },
19
+ }
20
+
21
+ export default config
@@ -0,0 +1,16 @@
1
+ import type { Preview } from '@storybook/react-vite'
2
+
3
+ const preview: Preview = {
4
+ parameters: {
5
+ controls: {
6
+ matchers: { color: /(background|color)$/i, date: /Date$/i },
7
+ },
8
+ a11y: {
9
+ config: {},
10
+ options: {},
11
+ manual: false,
12
+ },
13
+ },
14
+ }
15
+
16
+ export default preview
@@ -0,0 +1,20 @@
1
+ # Design system
2
+
3
+ An empty Storybook authoring environment for your own design system. Bring your components here.
4
+
5
+ ```
6
+ src/
7
+ components/ One folder per component: .tsx, .module.css, .stories.tsx, .contract.ts
8
+ foundations/ Storybook "Foundations" pages documenting your tokens
9
+ .storybook/ Storybook (react-vite) config
10
+ ```
11
+
12
+ ## Commands
13
+
14
+ ```bash
15
+ pnpm --filter "./design-system" storybook # author at http://localhost:6006
16
+ pnpm --filter "./design-system" build-storybook # static Storybook
17
+ pnpm --filter "./design-system" typecheck
18
+ ```
19
+
20
+ Point the Components MCP server at your manifest in `apps/web/src/payload.config.ts` (`componentsPlugin({ manifest })`) once you generate one. For a worked starting point, re-scaffold with the reference design system.
@@ -0,0 +1,5 @@
1
+ dist
2
+ storybook-static
3
+ node_modules
4
+ *.tsbuildinfo
5
+ .turbo
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "{{designSystemName}}",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "main": "./src/index.ts",
7
+ "types": "./src/index.ts",
8
+ "exports": {
9
+ ".": "./src/index.ts"
10
+ },
11
+ "scripts": {
12
+ "storybook": "storybook dev -p 6006",
13
+ "build-storybook": "storybook build",
14
+ "typecheck": "tsc --noEmit",
15
+ "clean": "rm -rf dist .turbo storybook-static *.tsbuildinfo"
16
+ },
17
+ "peerDependencies": {
18
+ "react": "^18.0.0 || ^19.0.0",
19
+ "react-dom": "^18.0.0 || ^19.0.0"
20
+ },
21
+ "devDependencies": {
22
+ "@storybook/addon-a11y": "^10.3.5",
23
+ "@storybook/react-vite": "^10.3.5",
24
+ "@types/react": "^19.2.0",
25
+ "@types/react-dom": "^19.2.0",
26
+ "@vitejs/plugin-react": "^6.0.1",
27
+ "react": "^19.2.0",
28
+ "react-dom": "^19.2.0",
29
+ "storybook": "^10.3.5",
30
+ "typescript": "^5.6.0",
31
+ "vite": "^8.0.9"
32
+ }
33
+ }
@@ -0,0 +1,24 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite'
2
+
3
+ const meta: Meta = {
4
+ title: 'Foundations/Welcome',
5
+ }
6
+ export default meta
7
+
8
+ export const Welcome: StoryObj = {
9
+ render: () => (
10
+ <div style={{ fontFamily: 'system-ui, sans-serif', padding: '2rem', maxWidth: '40rem', lineHeight: 1.6 }}>
11
+ <h1>Your design system</h1>
12
+ <p>
13
+ This is an empty Storybook authoring environment. Add components under{' '}
14
+ <code>src/components/</code> with a <code>.stories.tsx</code> story and a{' '}
15
+ <code>.contract.ts</code> contract, and document your tokens in{' '}
16
+ <code>src/foundations/</code> (Colors, Typography, Spacing, Radii, Layout &amp; Containers).
17
+ </p>
18
+ <p>
19
+ Tip: <code>pnpm create @forumone/throughline</code> with the reference design system gives
20
+ you 12 worked examples to start from.
21
+ </p>
22
+ </div>
23
+ ),
24
+ }
@@ -0,0 +1,9 @@
1
+ // Your design system's public surface. Export your components from here as you
2
+ // build them under `./components/`, then write a contract (`.contract.ts`) and
3
+ // a Storybook story (`.stories.tsx`) for each so the Components MCP server can
4
+ // reason about them.
5
+ //
6
+ // The web app's Components MCP server reads a manifest. Point it at your
7
+ // manifest in `apps/web/src/payload.config.ts` (`componentsPlugin({ manifest })`)
8
+ // once you generate one.
9
+ export {}
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../tsconfig.json",
3
+ "compilerOptions": {
4
+ "lib": ["ES2022", "DOM", "DOM.Iterable"],
5
+ "jsx": "react-jsx",
6
+ "noEmit": true,
7
+ "resolveJsonModule": true
8
+ },
9
+ "include": ["src/**/*"],
10
+ "exclude": ["dist", "storybook-static", "node_modules"]
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forumone/create-throughline",
3
- "version": "0.2.1",
3
+ "version": "0.3.0",
4
4
  "description": "Scaffolder for new Throughline projects (Payload CMS + MCP servers + Inngest workflows).",
5
5
  "type": "module",
6
6
  "bin": {
@@ -46,6 +46,7 @@
46
46
  "devDependencies": {
47
47
  "@types/node": "^20.17.0",
48
48
  "eslint": "^9.15.0",
49
+ "tsx": "^4.21.0",
49
50
  "typescript": "^5.6.0",
50
51
  "vitest": "^2.1.0",
51
52
  "@forumone/throughline-eslint-config": "0.0.0",
@@ -58,6 +59,7 @@
58
59
  "build": "tsc -b && pnpm copy-templates && pnpm chmod-bin",
59
60
  "copy-templates": "node ./scripts/copy-templates.mjs",
60
61
  "chmod-bin": "node ./scripts/chmod-bin.mjs",
62
+ "sync-reference-ds": "tsx scripts/sync-reference-ds.ts",
61
63
  "dev": "tsc -b -w",
62
64
  "clean": "rm -rf dist .turbo *.tsbuildinfo",
63
65
  "typecheck": "tsc --noEmit",
@@ -1,18 +0,0 @@
1
- {
2
- "name": "{{#if packageScope}}@{{packageScope}}/design-system{{else}}{{projectName}}-design-system{{/if}}",
3
- "version": "0.0.0",
4
- "private": true,
5
- "type": "module",
6
- "main": "./src/index.ts",
7
- "types": "./src/index.ts",
8
- "exports": {
9
- ".": "./src/index.ts",
10
- "./manifest": "./src/manifest.ts"
11
- },
12
- "dependencies": {
13
- "@forumone/throughline-reference-ds": "^0.2.0"
14
- },
15
- "devDependencies": {
16
- "typescript": "^5.6.0"
17
- }
18
- }
@@ -1,6 +0,0 @@
1
- // Re-export the Throughline reference design system. Wrap or override
2
- // individual components here when you start building your own brand layer
3
- // (e.g. swap colors, replace Hero, add new components). When you have
4
- // enough custom work to stand alone, drop the reference DS dependency
5
- // and replace this file with your own component exports.
6
- export * from '@forumone/throughline-reference-ds'
@@ -1,6 +0,0 @@
1
- // Re-export the reference DS manifest so payload.config.ts can import
2
- // it from a single workspace path. Replace this with your own manifest
3
- // import when you stop using the reference DS.
4
- import manifest from '@forumone/throughline-reference-ds/manifest' with { type: 'json' }
5
-
6
- export default manifest
@@ -1,9 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "compilerOptions": {
4
- "lib": ["ES2022", "DOM"],
5
- "jsx": "preserve"
6
- },
7
- "include": ["src/**/*"],
8
- "exclude": ["node_modules"]
9
- }
@@ -1,19 +0,0 @@
1
- # {{projectName}} design system
2
-
3
- This is a placeholder for your design system. The Components MCP server in `apps/web/src/payload.config.ts` is configured to read a manifest URL — replace the `https://your-design-system.example.com/manifest.json` value with your real DS's manifest endpoint.
4
-
5
- ## What the manifest needs to contain
6
-
7
- A list of components, each with:
8
-
9
- - `name`, `description`, `categories`
10
- - `props` schema (Zod-compatible JSON description)
11
- - `slots` (named regions)
12
- - `tokens` (CSS variables / brand tokens consumed)
13
- - `examples` (sample inputs Claude can learn from)
14
-
15
- See `@forumone/throughline-design-contract` for the full schema.
16
-
17
- ## Quickest path
18
-
19
- If you just want to start moving, `pnpm create @forumone/throughline` again and answer "yes" to the reference design system. You'll get a working setup you can study, swap components in, and slowly replace.
@@ -1,14 +0,0 @@
1
- {
2
- "name": "{{#if packageScope}}@{{packageScope}}/design-system{{else}}{{projectName}}-design-system{{/if}}",
3
- "version": "0.0.0",
4
- "private": true,
5
- "type": "module",
6
- "main": "./src/index.ts",
7
- "types": "./src/index.ts",
8
- "exports": {
9
- ".": "./src/index.ts"
10
- },
11
- "devDependencies": {
12
- "typescript": "^5.6.0"
13
- }
14
- }
@@ -1,8 +0,0 @@
1
- // This file is a placeholder. Bring your own design system here:
2
- // - Vendor your component source under `./components/` and re-export from here
3
- // - Or publish the DS separately and replace this package with the consumer
4
- //
5
- // The Components MCP server reads a manifest URL from your payload.config.ts
6
- // (see `componentsPlugin({ manifest })`). Update that URL to point at your
7
- // design system's manifest endpoint once you have one.
8
- export {}