bedrock-flows 0.7.1

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 (85) hide show
  1. package/auth-schema.sql +8 -0
  2. package/bin/bedrock-flows.mjs +127 -0
  3. package/lib/setup.mjs +262 -0
  4. package/package.json +11 -0
  5. package/template/.storybook/main.js +46 -0
  6. package/template/.storybook/manager-head.html +963 -0
  7. package/template/.storybook/preview-head.html +35 -0
  8. package/template/.storybook/preview.js +23 -0
  9. package/template/CHANGELOG.md +236 -0
  10. package/template/README.md +26 -0
  11. package/template/apps/dashboard/index.html +15 -0
  12. package/template/apps/dashboard/package.json +22 -0
  13. package/template/apps/dashboard/src/App.module.css +1318 -0
  14. package/template/apps/dashboard/src/App.tsx +2716 -0
  15. package/template/apps/dashboard/src/auth-client.ts +17 -0
  16. package/template/apps/dashboard/src/changelog.tsx +92 -0
  17. package/template/apps/dashboard/src/index.css +86 -0
  18. package/template/apps/dashboard/src/main.tsx +15 -0
  19. package/template/apps/dashboard/src/theme.ts +31 -0
  20. package/template/apps/dashboard/src/vite-env.d.ts +4 -0
  21. package/template/apps/dashboard/vite.config.ts +48 -0
  22. package/template/apps/worker/.dev.vars.example +50 -0
  23. package/template/apps/worker/package.json +19 -0
  24. package/template/apps/worker/src/index.ts +295 -0
  25. package/template/apps/worker/tsconfig.json +11 -0
  26. package/template/apps/worker/wrangler.jsonc +29 -0
  27. package/template/bedrock.config.ts +16 -0
  28. package/template/design-system/README.md +97 -0
  29. package/template/design-system/starter-v1/components/button/component.css +42 -0
  30. package/template/design-system/starter-v1/components/button/danger.html +21 -0
  31. package/template/design-system/starter-v1/components/button/default.html +21 -0
  32. package/template/design-system/starter-v1/components/button/disabled.html +21 -0
  33. package/template/design-system/starter-v1/components/button/ghost.html +21 -0
  34. package/template/design-system/starter-v1/components/button/macro.njk +14 -0
  35. package/template/design-system/starter-v1/components/button/primary.html +21 -0
  36. package/template/design-system/starter-v1/components/button/variants.json +30 -0
  37. package/template/design-system/starter-v1/ds.json +3 -0
  38. package/template/design-system/starter-v1/global.css +52 -0
  39. package/template/design-system/starter-v1/style.css +107 -0
  40. package/template/gitignore +8 -0
  41. package/template/package.json +41 -0
  42. package/template/prototypes/F-001-hello/1-welcome.njk +30 -0
  43. package/template/prototypes/F-001-hello/2-form.njk +46 -0
  44. package/template/prototypes/F-001-hello/3-done.njk +29 -0
  45. package/template/prototypes/F-001-hello/meta.json +6 -0
  46. package/template/prototypes/_shared/_auth-gate.njk +54 -0
  47. package/template/prototypes/_shared/delivery.njk +43 -0
  48. package/template/prototypes/_shared/layout.njk +15 -0
  49. package/template/prototypes/_shared/screen.njk +1818 -0
  50. package/template/prototypes/_shared/wireflow.njk +4731 -0
  51. package/template/public/auth-gate.css +150 -0
  52. package/template/public/bedrock/color-inspector.js +284 -0
  53. package/template/public/bedrock/component-overlay.js +219 -0
  54. package/template/public/bedrock/data/bedrock-config.js +45 -0
  55. package/template/public/bedrock/font-size-overlay.js +590 -0
  56. package/template/public/bedrock/grid-overlay.js +379 -0
  57. package/template/public/bedrock/prototype-navigation.js +974 -0
  58. package/template/public/cmdk.js +146 -0
  59. package/template/public/ds-xray.css +112 -0
  60. package/template/public/ds-xray.js +271 -0
  61. package/template/public/favicon.svg +4 -0
  62. package/template/public/icons/bolt-fill.svg +3 -0
  63. package/template/public/icons/bolt.svg +3 -0
  64. package/template/public/icons/caret-down-fill.svg +3 -0
  65. package/template/public/icons/check-double.svg +4 -0
  66. package/template/public/icons/check.svg +3 -0
  67. package/template/public/icons/chevron-left.svg +3 -0
  68. package/template/public/icons/chevron-right.svg +3 -0
  69. package/template/public/icons/circle-info.svg +6 -0
  70. package/template/public/icons/grid.svg +6 -0
  71. package/template/public/icons/message-square-1.svg +3 -0
  72. package/template/public/icons/message-square.svg +3 -0
  73. package/template/public/icons/messages.svg +4 -0
  74. package/template/public/icons/options-horizontal.svg +5 -0
  75. package/template/public/icons/swatches.svg +6 -0
  76. package/template/public/icons/workflow.svg +6 -0
  77. package/template/public/lightbox.js +87 -0
  78. package/template/public/proto-chrome.css +596 -0
  79. package/template/public/screen-comments.css +723 -0
  80. package/template/public/wireflow-client.js +26 -0
  81. package/template/scripts/build-storybooks.mjs +8 -0
  82. package/template/scripts/dev-setup.mjs +15 -0
  83. package/template/scripts/generate-stories.mjs +12 -0
  84. package/template/scripts/generate-variants.mjs +22 -0
  85. package/template/tsconfig.base.json +19 -0
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ // CLI shim — logic lives in @obra-studio/bedrock-flows/design-system (buildStorybooks).
3
+ import path from 'node:path'
4
+ import { fileURLToPath } from 'node:url'
5
+ import { buildStorybooks } from '@obra-studio/bedrock-flows/design-system'
6
+
7
+ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
8
+ buildStorybooks(ROOT, { onlyVersion: process.env.DS_VERSION_ONLY })
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+ // First-run dev bootstrap: create apps/worker/.dev.vars from the example with
3
+ // a generated BETTER_AUTH_SECRET, so `npm run dev` works with zero manual setup.
4
+ import fs from 'node:fs'
5
+ import path from 'node:path'
6
+ import crypto from 'node:crypto'
7
+
8
+ const vars = path.join('apps', 'worker', '.dev.vars')
9
+ const example = path.join('apps', 'worker', '.dev.vars.example')
10
+ if (!fs.existsSync(vars)) {
11
+ const secret = crypto.randomBytes(32).toString('base64')
12
+ const txt = fs.readFileSync(example, 'utf8').replace('BETTER_AUTH_SECRET=replace-me', 'BETTER_AUTH_SECRET=' + secret)
13
+ fs.writeFileSync(vars, txt)
14
+ console.log('• created apps/worker/.dev.vars (generated BETTER_AUTH_SECRET)')
15
+ }
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ // CLI shim — logic lives in @obra-studio/bedrock-flows/design-system (generateStories).
3
+ import path from 'node:path'
4
+ import { fileURLToPath } from 'node:url'
5
+ import { generateStories } from '@obra-studio/bedrock-flows/design-system'
6
+
7
+ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
8
+ const { totalFiles, totalStories } = generateStories(
9
+ path.join(ROOT, 'design-system'),
10
+ path.join(ROOT, '.stories-generated'),
11
+ )
12
+ console.log(`[stories] wrote ${totalFiles} files, ${totalStories} stories to .stories-generated/`)
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+ // CLI shim — the logic lives in @obra-studio/bedrock-flows/design-system (generateVariants).
3
+ import path from 'node:path'
4
+ import { fileURLToPath } from 'node:url'
5
+ import { generateVariants } from '@obra-studio/bedrock-flows/design-system'
6
+
7
+ const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
8
+ const { totalRendered, totalComponents, lintErrors } = generateVariants(path.join(ROOT, 'design-system'))
9
+
10
+ console.log(`[variants] regenerated ${totalRendered} variants across ${totalComponents} components`)
11
+
12
+ if (lintErrors.length > 0) {
13
+ console.error('')
14
+ console.error(`[lint] ${lintErrors.length} variant${lintErrors.length === 1 ? '' : 's'} reference unknown class names:`)
15
+ for (const e of lintErrors) {
16
+ console.error(` ✗ ${e.where}`)
17
+ for (const c of e.missing) console.error(` .${c}`)
18
+ }
19
+ console.error('')
20
+ console.error('Every class in a variant must exist in global.css or a component.css.')
21
+ process.exit(1)
22
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2023",
4
+ "module": "ESNext",
5
+ "moduleResolution": "Bundler",
6
+ "lib": ["ES2023", "DOM", "DOM.Iterable"],
7
+ "strict": true,
8
+ "noUnusedLocals": true,
9
+ "noUnusedParameters": true,
10
+ "noFallthroughCasesInSwitch": true,
11
+ "esModuleInterop": true,
12
+ "skipLibCheck": true,
13
+ "forceConsistentCasingInFileNames": true,
14
+ "declaration": true,
15
+ "composite": true,
16
+ "verbatimModuleSyntax": true,
17
+ "isolatedModules": true
18
+ }
19
+ }