@forumone/create-throughline 0.0.1 → 0.2.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 (54) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +21 -0
  3. package/README.md +41 -43
  4. package/dist/bin.d.ts +3 -0
  5. package/dist/bin.d.ts.map +1 -0
  6. package/dist/bin.js +45 -0
  7. package/dist/bin.js.map +1 -0
  8. package/dist/generator.d.ts +48 -0
  9. package/dist/generator.d.ts.map +1 -0
  10. package/dist/generator.js +131 -0
  11. package/dist/generator.js.map +1 -0
  12. package/dist/index.d.ts +5 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +5 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/post-install.d.ts +9 -0
  17. package/dist/post-install.d.ts.map +1 -0
  18. package/dist/post-install.js +68 -0
  19. package/dist/post-install.js.map +1 -0
  20. package/dist/prompts.d.ts +23 -0
  21. package/dist/prompts.d.ts.map +1 -0
  22. package/dist/prompts.js +89 -0
  23. package/dist/prompts.js.map +1 -0
  24. package/dist/templates/base/.env.example +43 -0
  25. package/dist/templates/base/README.md +96 -0
  26. package/dist/templates/base/apps/web/next-env.d.ts +5 -0
  27. package/dist/templates/base/apps/web/next.config.mjs +10 -0
  28. package/dist/templates/base/apps/web/package.json.template +42 -0
  29. package/dist/templates/base/apps/web/src/app/(frontend)/layout.tsx +22 -0
  30. package/dist/templates/base/apps/web/src/app/(frontend)/page.tsx +18 -0
  31. package/dist/templates/base/apps/web/src/app/(payload)/admin/[[...segments]]/not-found.tsx +12 -0
  32. package/dist/templates/base/apps/web/src/app/(payload)/admin/[[...segments]]/page.tsx +16 -0
  33. package/dist/templates/base/apps/web/src/app/(payload)/admin/importMap.js +6 -0
  34. package/dist/templates/base/apps/web/src/app/(payload)/api/[...slug]/route.ts +16 -0
  35. package/dist/templates/base/apps/web/src/app/(payload)/layout.tsx +23 -0
  36. package/dist/templates/base/apps/web/src/app/api/inngest/route.ts.template +56 -0
  37. package/dist/templates/base/apps/web/src/payload.config.ts.template +164 -0
  38. package/dist/templates/base/apps/web/tsconfig.json +24 -0
  39. package/dist/templates/base/package.json.template +23 -0
  40. package/dist/templates/base/pnpm-workspace.yaml +3 -0
  41. package/dist/templates/base/tsconfig.json +14 -0
  42. package/dist/templates/base/turbo.json +27 -0
  43. package/dist/templates/with-reference-ds/packages/design-system/package.json.template +18 -0
  44. package/dist/templates/with-reference-ds/packages/design-system/src/index.ts +6 -0
  45. package/dist/templates/with-reference-ds/packages/design-system/src/manifest.ts +6 -0
  46. package/dist/templates/with-reference-ds/packages/design-system/tsconfig.json +9 -0
  47. package/dist/templates/without-reference-ds/packages/design-system/README.md +19 -0
  48. package/dist/templates/without-reference-ds/packages/design-system/package.json.template +14 -0
  49. package/dist/templates/without-reference-ds/packages/design-system/src/index.ts +8 -0
  50. package/dist/utils/templates.d.ts +11 -0
  51. package/dist/utils/templates.d.ts.map +1 -0
  52. package/dist/utils/templates.js +31 -0
  53. package/dist/utils/templates.js.map +1 -0
  54. package/package.json +64 -7
@@ -0,0 +1,6 @@
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
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "../../tsconfig.json",
3
+ "compilerOptions": {
4
+ "lib": ["ES2022", "DOM"],
5
+ "jsx": "preserve"
6
+ },
7
+ "include": ["src/**/*"],
8
+ "exclude": ["node_modules"]
9
+ }
@@ -0,0 +1,19 @@
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.
@@ -0,0 +1,14 @@
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
+ }
@@ -0,0 +1,8 @@
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 {}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Minimal mustache-style template renderer. Supports {{variable}} and
3
+ * {{#if variable}}...{{/if}} (with optional {{else}}). No nesting,
4
+ * no helpers. Keeps the CLI dependency-free.
5
+ *
6
+ * Order of operations matters: {{#if}} is processed before {{variable}}
7
+ * so a single pass over the result expands variables that lived inside
8
+ * an `if` block.
9
+ */
10
+ export declare function renderTemplate(template: string, data: Record<string, unknown>): string;
11
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/utils/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CActF"}
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Minimal mustache-style template renderer. Supports {{variable}} and
3
+ * {{#if variable}}...{{/if}} (with optional {{else}}). No nesting,
4
+ * no helpers. Keeps the CLI dependency-free.
5
+ *
6
+ * Order of operations matters: {{#if}} is processed before {{variable}}
7
+ * so a single pass over the result expands variables that lived inside
8
+ * an `if` block.
9
+ */
10
+ export function renderTemplate(template, data) {
11
+ let result = template.replace(/\{\{#if\s+(\w+)\}\}([\s\S]*?)(?:\{\{else\}\}([\s\S]*?))?\{\{\/if\}\}/g, (_match, variable, truthy, falsy) => {
12
+ return isTruthy(data[variable]) ? truthy : (falsy ?? '');
13
+ });
14
+ result = result.replace(/\{\{(\w+)\}\}/g, (_match, variable) => {
15
+ const value = data[variable];
16
+ return value == null ? '' : String(value);
17
+ });
18
+ return result;
19
+ }
20
+ function isTruthy(value) {
21
+ if (value == null)
22
+ return false;
23
+ if (value === false)
24
+ return false;
25
+ if (value === '')
26
+ return false;
27
+ if (value === 0)
28
+ return false;
29
+ return true;
30
+ }
31
+ //# sourceMappingURL=templates.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.js","sourceRoot":"","sources":["../../src/utils/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,QAAgB,EAAE,IAA6B;IAC5E,IAAI,MAAM,GAAG,QAAQ,CAAC,OAAO,CAC3B,uEAAuE,EACvE,CAAC,MAAM,EAAE,QAAgB,EAAE,MAAc,EAAE,KAAyB,EAAE,EAAE;QACtE,OAAO,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;IAC1D,CAAC,CACF,CAAA;IAED,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC,MAAM,EAAE,QAAgB,EAAE,EAAE;QACrE,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC5B,OAAO,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;IAC3C,CAAC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,KAAK,IAAI,IAAI;QAAE,OAAO,KAAK,CAAA;IAC/B,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,KAAK,CAAA;IACjC,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,KAAK,CAAA;IAC9B,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAC7B,OAAO,IAAI,CAAA;AACb,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,67 @@
1
1
  {
2
2
  "name": "@forumone/create-throughline",
3
- "version": "0.0.1",
4
- "description": "OIDC trusted publishing setup package for @forumone/create-throughline",
3
+ "version": "0.2.0",
4
+ "description": "Scaffolder for new Throughline projects (Payload CMS + MCP servers + Inngest workflows).",
5
+ "type": "module",
6
+ "bin": {
7
+ "create-throughline": "./dist/bin.js"
8
+ },
9
+ "main": "./dist/index.js",
10
+ "types": "./dist/index.d.ts",
11
+ "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ }
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md",
20
+ "CHANGELOG.md"
21
+ ],
5
22
  "keywords": [
6
- "oidc",
7
- "trusted-publishing",
8
- "setup"
9
- ]
10
- }
23
+ "throughline",
24
+ "payload",
25
+ "mcp",
26
+ "scaffolder",
27
+ "create"
28
+ ],
29
+ "license": "MIT",
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/forumone/throughline.git",
33
+ "directory": "packages/create-throughline"
34
+ },
35
+ "homepage": "https://github.com/forumone/throughline/tree/main/packages/create-throughline#readme",
36
+ "bugs": {
37
+ "url": "https://github.com/forumone/throughline/issues"
38
+ },
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "dependencies": {
43
+ "@clack/prompts": "^0.8.0",
44
+ "picocolors": "^1.1.0"
45
+ },
46
+ "devDependencies": {
47
+ "@types/node": "^20.17.0",
48
+ "eslint": "^9.15.0",
49
+ "typescript": "^5.6.0",
50
+ "vitest": "^2.1.0",
51
+ "@forumone/throughline-eslint-config": "0.0.0",
52
+ "@forumone/throughline-tsconfig": "0.0.0"
53
+ },
54
+ "engines": {
55
+ "node": ">=20.9.0"
56
+ },
57
+ "scripts": {
58
+ "build": "tsc -b && pnpm copy-templates && pnpm chmod-bin",
59
+ "copy-templates": "node ./scripts/copy-templates.mjs",
60
+ "chmod-bin": "node ./scripts/chmod-bin.mjs",
61
+ "dev": "tsc -b -w",
62
+ "clean": "rm -rf dist .turbo *.tsbuildinfo",
63
+ "typecheck": "tsc --noEmit",
64
+ "lint": "eslint src",
65
+ "test": "vitest run"
66
+ }
67
+ }