@buenojs/bueno 0.8.6 → 0.8.8
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.
- package/.claude/settings.local.json +9 -0
- package/README.md +132 -15
- package/dist/cache/index.d.ts +187 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cli/bin.d.ts +8 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +483 -155
- package/dist/cli/commands/add-frontend.d.ts +7 -0
- package/dist/cli/commands/add-frontend.d.ts.map +1 -0
- package/dist/cli/commands/build.d.ts +7 -0
- package/dist/cli/commands/build.d.ts.map +1 -0
- package/dist/cli/commands/dev.d.ts +7 -0
- package/dist/cli/commands/dev.d.ts.map +1 -0
- package/dist/cli/commands/generate.d.ts +7 -0
- package/dist/cli/commands/generate.d.ts.map +1 -0
- package/dist/cli/commands/help.d.ts +7 -0
- package/dist/cli/commands/help.d.ts.map +1 -0
- package/dist/cli/commands/index.d.ts +59 -0
- package/dist/cli/commands/index.d.ts.map +1 -0
- package/dist/cli/commands/migration.d.ts +7 -0
- package/dist/cli/commands/migration.d.ts.map +1 -0
- package/dist/cli/commands/new.d.ts +7 -0
- package/dist/cli/commands/new.d.ts.map +1 -0
- package/dist/cli/commands/start.d.ts +7 -0
- package/dist/cli/commands/start.d.ts.map +1 -0
- package/dist/cli/core/args.d.ts +61 -0
- package/dist/cli/core/args.d.ts.map +1 -0
- package/dist/cli/core/console.d.ts +135 -0
- package/dist/cli/core/console.d.ts.map +1 -0
- package/dist/cli/core/index.d.ts +10 -0
- package/dist/cli/core/index.d.ts.map +1 -0
- package/dist/cli/core/prompt.d.ts +63 -0
- package/dist/cli/core/prompt.d.ts.map +1 -0
- package/dist/cli/core/spinner.d.ts +111 -0
- package/dist/cli/core/spinner.d.ts.map +1 -0
- package/dist/cli/index.d.ts +47 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/templates/database/index.d.ts +24 -0
- package/dist/cli/templates/database/index.d.ts.map +1 -0
- package/dist/cli/templates/database/mysql.d.ts +6 -0
- package/dist/cli/templates/database/mysql.d.ts.map +1 -0
- package/dist/cli/templates/database/none.d.ts +8 -0
- package/dist/cli/templates/database/none.d.ts.map +1 -0
- package/dist/cli/templates/database/postgresql.d.ts +6 -0
- package/dist/cli/templates/database/postgresql.d.ts.map +1 -0
- package/dist/cli/templates/database/sqlite.d.ts +6 -0
- package/dist/cli/templates/database/sqlite.d.ts.map +1 -0
- package/dist/cli/templates/deploy.d.ts +41 -0
- package/dist/cli/templates/deploy.d.ts.map +1 -0
- package/dist/cli/templates/docker.d.ts +30 -0
- package/dist/cli/templates/docker.d.ts.map +1 -0
- package/dist/cli/templates/frontend/index.d.ts +25 -0
- package/dist/cli/templates/frontend/index.d.ts.map +1 -0
- package/dist/cli/templates/frontend/none.d.ts +8 -0
- package/dist/cli/templates/frontend/none.d.ts.map +1 -0
- package/dist/cli/templates/frontend/react.d.ts +6 -0
- package/dist/cli/templates/frontend/react.d.ts.map +1 -0
- package/dist/cli/templates/frontend/solid.d.ts +6 -0
- package/dist/cli/templates/frontend/solid.d.ts.map +1 -0
- package/dist/cli/templates/frontend/svelte.d.ts +6 -0
- package/dist/cli/templates/frontend/svelte.d.ts.map +1 -0
- package/dist/cli/templates/frontend/vue.d.ts +6 -0
- package/dist/cli/templates/frontend/vue.d.ts.map +1 -0
- package/dist/cli/templates/generators/index.d.ts +29 -0
- package/dist/cli/templates/generators/index.d.ts.map +1 -0
- package/dist/cli/templates/generators/types.d.ts +32 -0
- package/dist/cli/templates/generators/types.d.ts.map +1 -0
- package/dist/cli/templates/index.d.ts +12 -0
- package/dist/cli/templates/index.d.ts.map +1 -0
- package/dist/cli/templates/project/api.d.ts +6 -0
- package/dist/cli/templates/project/api.d.ts.map +1 -0
- package/dist/cli/templates/project/default.d.ts +6 -0
- package/dist/cli/templates/project/default.d.ts.map +1 -0
- package/dist/cli/templates/project/fullstack.d.ts +14 -0
- package/dist/cli/templates/project/fullstack.d.ts.map +1 -0
- package/dist/cli/templates/project/index.d.ts +26 -0
- package/dist/cli/templates/project/index.d.ts.map +1 -0
- package/dist/cli/templates/project/minimal.d.ts +6 -0
- package/dist/cli/templates/project/minimal.d.ts.map +1 -0
- package/dist/cli/templates/project/types.d.ts +80 -0
- package/dist/cli/templates/project/types.d.ts.map +1 -0
- package/dist/cli/templates/project/website.d.ts +8 -0
- package/dist/cli/templates/project/website.d.ts.map +1 -0
- package/dist/cli/utils/fs.d.ts +137 -0
- package/dist/cli/utils/fs.d.ts.map +1 -0
- package/dist/cli/utils/index.d.ts +9 -0
- package/dist/cli/utils/index.d.ts.map +1 -0
- package/dist/cli/utils/strings.d.ts +86 -0
- package/dist/cli/utils/strings.d.ts.map +1 -0
- package/dist/cli/utils/version.d.ts +15 -0
- package/dist/cli/utils/version.d.ts.map +1 -0
- package/dist/config/env-validation.d.ts +49 -0
- package/dist/config/env-validation.d.ts.map +1 -0
- package/dist/config/env.d.ts +167 -0
- package/dist/config/env.d.ts.map +1 -0
- package/dist/config/index.d.ts +168 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/loader.d.ts +81 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/merge.d.ts +66 -0
- package/dist/config/merge.d.ts.map +1 -0
- package/dist/config/types.d.ts +322 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/validation.d.ts +100 -0
- package/dist/config/validation.d.ts.map +1 -0
- package/dist/container/forward-ref.d.ts +116 -0
- package/dist/container/forward-ref.d.ts.map +1 -0
- package/dist/container/index.d.ts +95 -0
- package/dist/container/index.d.ts.map +1 -0
- package/dist/context/index.d.ts +143 -0
- package/dist/context/index.d.ts.map +1 -0
- package/dist/database/index.d.ts +219 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/migrations/index.d.ts +146 -0
- package/dist/database/migrations/index.d.ts.map +1 -0
- package/dist/database/orm/builder.d.ts +122 -0
- package/dist/database/orm/builder.d.ts.map +1 -0
- package/dist/database/orm/casts/index.d.ts +16 -0
- package/dist/database/orm/casts/index.d.ts.map +1 -0
- package/dist/database/orm/casts/types.d.ts +16 -0
- package/dist/database/orm/casts/types.d.ts.map +1 -0
- package/dist/database/orm/compiler.d.ts +90 -0
- package/dist/database/orm/compiler.d.ts.map +1 -0
- package/dist/database/orm/hooks/index.d.ts +53 -0
- package/dist/database/orm/hooks/index.d.ts.map +1 -0
- package/dist/database/orm/index.d.ts +21 -0
- package/dist/database/orm/index.d.ts.map +1 -0
- package/dist/database/orm/model-registry.d.ts +33 -0
- package/dist/database/orm/model-registry.d.ts.map +1 -0
- package/dist/database/orm/model.d.ts +245 -0
- package/dist/database/orm/model.d.ts.map +1 -0
- package/dist/database/orm/relationships/base.d.ts +69 -0
- package/dist/database/orm/relationships/base.d.ts.map +1 -0
- package/dist/database/orm/relationships/belongs-to-many.d.ts +47 -0
- package/dist/database/orm/relationships/belongs-to-many.d.ts.map +1 -0
- package/dist/database/orm/relationships/belongs-to.d.ts +17 -0
- package/dist/database/orm/relationships/belongs-to.d.ts.map +1 -0
- package/dist/database/orm/relationships/has-many.d.ts +14 -0
- package/dist/database/orm/relationships/has-many.d.ts.map +1 -0
- package/dist/database/orm/relationships/has-one.d.ts +14 -0
- package/dist/database/orm/relationships/has-one.d.ts.map +1 -0
- package/dist/database/orm/relationships/index.d.ts +10 -0
- package/dist/database/orm/relationships/index.d.ts.map +1 -0
- package/dist/database/orm/scopes/index.d.ts +36 -0
- package/dist/database/orm/scopes/index.d.ts.map +1 -0
- package/dist/database/schema/index.d.ts +155 -0
- package/dist/database/schema/index.d.ts.map +1 -0
- package/dist/events/__tests__/event-system.test.d.ts +2 -0
- package/dist/events/__tests__/event-system.test.d.ts.map +1 -0
- package/dist/events/config.d.ts +16 -0
- package/dist/events/config.d.ts.map +1 -0
- package/dist/events/example-usage.d.ts +12 -0
- package/dist/events/example-usage.d.ts.map +1 -0
- package/dist/events/index.d.ts +27 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/manager.d.ts +33 -0
- package/dist/events/manager.d.ts.map +1 -0
- package/dist/events/registry.d.ts +31 -0
- package/dist/events/registry.d.ts.map +1 -0
- package/dist/events/types.d.ts +105 -0
- package/dist/events/types.d.ts.map +1 -0
- package/dist/frontend/api-routes.d.ts +189 -0
- package/dist/frontend/api-routes.d.ts.map +1 -0
- package/dist/frontend/bundler.d.ts +99 -0
- package/dist/frontend/bundler.d.ts.map +1 -0
- package/dist/frontend/console-client.d.ts +11 -0
- package/dist/frontend/console-client.d.ts.map +1 -0
- package/dist/frontend/console-stream.d.ts +138 -0
- package/dist/frontend/console-stream.d.ts.map +1 -0
- package/dist/frontend/dev-server.d.ts +174 -0
- package/dist/frontend/dev-server.d.ts.map +1 -0
- package/dist/frontend/file-router.d.ts +170 -0
- package/dist/frontend/file-router.d.ts.map +1 -0
- package/dist/frontend/frameworks/index.d.ts +41 -0
- package/dist/frontend/frameworks/index.d.ts.map +1 -0
- package/dist/frontend/frameworks/react.d.ts +32 -0
- package/dist/frontend/frameworks/react.d.ts.map +1 -0
- package/dist/frontend/frameworks/solid.d.ts +42 -0
- package/dist/frontend/frameworks/solid.d.ts.map +1 -0
- package/dist/frontend/frameworks/svelte.d.ts +57 -0
- package/dist/frontend/frameworks/svelte.d.ts.map +1 -0
- package/dist/frontend/frameworks/vue.d.ts +36 -0
- package/dist/frontend/frameworks/vue.d.ts.map +1 -0
- package/dist/frontend/hmr-client.d.ts +22 -0
- package/dist/frontend/hmr-client.d.ts.map +1 -0
- package/dist/frontend/hmr.d.ts +185 -0
- package/dist/frontend/hmr.d.ts.map +1 -0
- package/dist/frontend/index.d.ts +34 -0
- package/dist/frontend/index.d.ts.map +1 -0
- package/dist/frontend/islands.d.ts +135 -0
- package/dist/frontend/islands.d.ts.map +1 -0
- package/dist/frontend/isr.d.ts +143 -0
- package/dist/frontend/isr.d.ts.map +1 -0
- package/dist/frontend/layout.d.ts +140 -0
- package/dist/frontend/layout.d.ts.map +1 -0
- package/dist/frontend/ssr/react.d.ts +118 -0
- package/dist/frontend/ssr/react.d.ts.map +1 -0
- package/dist/frontend/ssr/solid.d.ts +141 -0
- package/dist/frontend/ssr/solid.d.ts.map +1 -0
- package/dist/frontend/ssr/svelte.d.ts +158 -0
- package/dist/frontend/ssr/svelte.d.ts.map +1 -0
- package/dist/frontend/ssr/vue.d.ts +161 -0
- package/dist/frontend/ssr/vue.d.ts.map +1 -0
- package/dist/frontend/ssr.d.ts +147 -0
- package/dist/frontend/ssr.d.ts.map +1 -0
- package/dist/frontend/types.d.ts +1902 -0
- package/dist/frontend/types.d.ts.map +1 -0
- package/dist/graphql/built-in-engine.d.ts +36 -0
- package/dist/graphql/built-in-engine.d.ts.map +1 -0
- package/dist/graphql/context-builder.d.ts +44 -0
- package/dist/graphql/context-builder.d.ts.map +1 -0
- package/dist/graphql/decorators.d.ts +162 -0
- package/dist/graphql/decorators.d.ts.map +1 -0
- package/dist/graphql/execution-pipeline.d.ts +67 -0
- package/dist/graphql/execution-pipeline.d.ts.map +1 -0
- package/dist/graphql/graphql-module.d.ts +70 -0
- package/dist/graphql/graphql-module.d.ts.map +1 -0
- package/dist/graphql/index.d.ts +48 -0
- package/dist/graphql/index.d.ts.map +1 -0
- package/dist/graphql/metadata.d.ts +37 -0
- package/dist/graphql/metadata.d.ts.map +1 -0
- package/dist/graphql/schema-builder.d.ts +34 -0
- package/dist/graphql/schema-builder.d.ts.map +1 -0
- package/dist/graphql/subscription-handler.d.ts +47 -0
- package/dist/graphql/subscription-handler.d.ts.map +1 -0
- package/dist/graphql/types.d.ts +252 -0
- package/dist/graphql/types.d.ts.map +1 -0
- package/dist/health/index.d.ts +176 -0
- package/dist/health/index.d.ts.map +1 -0
- package/dist/i18n/engine.d.ts +105 -0
- package/dist/i18n/engine.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +13 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/loader.d.ts +79 -0
- package/dist/i18n/loader.d.ts.map +1 -0
- package/dist/i18n/middleware.d.ts +96 -0
- package/dist/i18n/middleware.d.ts.map +1 -0
- package/dist/i18n/negotiator.d.ts +84 -0
- package/dist/i18n/negotiator.d.ts.map +1 -0
- package/dist/i18n/types.d.ts +129 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/index.d.ts +48 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/jobs/drivers/memory.d.ts +38 -0
- package/dist/jobs/drivers/memory.d.ts.map +1 -0
- package/dist/jobs/drivers/redis.d.ts +34 -0
- package/dist/jobs/drivers/redis.d.ts.map +1 -0
- package/dist/jobs/index.d.ts +12 -0
- package/dist/jobs/index.d.ts.map +1 -0
- package/dist/jobs/queue.d.ts +93 -0
- package/dist/jobs/queue.d.ts.map +1 -0
- package/dist/jobs/types.d.ts +193 -0
- package/dist/jobs/types.d.ts.map +1 -0
- package/dist/jobs/worker.d.ts +91 -0
- package/dist/jobs/worker.d.ts.map +1 -0
- package/dist/lock/index.d.ts +141 -0
- package/dist/lock/index.d.ts.map +1 -0
- package/dist/logger/index.d.ts +156 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/transports/index.d.ts +371 -0
- package/dist/logger/transports/index.d.ts.map +1 -0
- package/dist/metrics/index.d.ts +163 -0
- package/dist/metrics/index.d.ts.map +1 -0
- package/dist/middleware/built-in.d.ts +50 -0
- package/dist/middleware/built-in.d.ts.map +1 -0
- package/dist/middleware/index.d.ts +40 -0
- package/dist/middleware/index.d.ts.map +1 -0
- package/dist/migrations/index.d.ts +10 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/modules/filters.d.ts +150 -0
- package/dist/modules/filters.d.ts.map +1 -0
- package/dist/modules/guards.d.ts +188 -0
- package/dist/modules/guards.d.ts.map +1 -0
- package/dist/modules/index.d.ts +266 -0
- package/dist/modules/index.d.ts.map +1 -0
- package/dist/modules/interceptors.d.ts +242 -0
- package/dist/modules/interceptors.d.ts.map +1 -0
- package/dist/modules/lazy.d.ts +187 -0
- package/dist/modules/lazy.d.ts.map +1 -0
- package/dist/modules/lifecycle.d.ts +221 -0
- package/dist/modules/lifecycle.d.ts.map +1 -0
- package/dist/modules/metadata.d.ts +32 -0
- package/dist/modules/metadata.d.ts.map +1 -0
- package/dist/modules/pipes.d.ts +287 -0
- package/dist/modules/pipes.d.ts.map +1 -0
- package/dist/notification/channels/base.d.ts +32 -0
- package/dist/notification/channels/base.d.ts.map +1 -0
- package/dist/notification/channels/email.d.ts +37 -0
- package/dist/notification/channels/email.d.ts.map +1 -0
- package/dist/notification/channels/push.d.ts +37 -0
- package/dist/notification/channels/push.d.ts.map +1 -0
- package/dist/notification/channels/sms.d.ts +37 -0
- package/dist/notification/channels/sms.d.ts.map +1 -0
- package/dist/notification/channels/whatsapp.d.ts +37 -0
- package/dist/notification/channels/whatsapp.d.ts.map +1 -0
- package/dist/notification/index.d.ts +15 -0
- package/dist/notification/index.d.ts.map +1 -0
- package/dist/notification/service.d.ts +100 -0
- package/dist/notification/service.d.ts.map +1 -0
- package/dist/notification/types.d.ts +253 -0
- package/dist/notification/types.d.ts.map +1 -0
- package/dist/observability/__tests__/observability.test.d.ts +2 -0
- package/dist/observability/__tests__/observability.test.d.ts.map +1 -0
- package/dist/observability/breadcrumbs.d.ts +48 -0
- package/dist/observability/breadcrumbs.d.ts.map +1 -0
- package/dist/observability/index.d.ts +95 -0
- package/dist/observability/index.d.ts.map +1 -0
- package/dist/observability/interceptor.d.ts +19 -0
- package/dist/observability/interceptor.d.ts.map +1 -0
- package/dist/observability/service.d.ts +101 -0
- package/dist/observability/service.d.ts.map +1 -0
- package/dist/observability/trace.d.ts +21 -0
- package/dist/observability/trace.d.ts.map +1 -0
- package/dist/observability/types.d.ts +172 -0
- package/dist/observability/types.d.ts.map +1 -0
- package/dist/openapi/__tests__/decorators.test.d.ts +2 -0
- package/dist/openapi/__tests__/decorators.test.d.ts.map +1 -0
- package/dist/openapi/__tests__/document-builder.test.d.ts +2 -0
- package/dist/openapi/__tests__/document-builder.test.d.ts.map +1 -0
- package/dist/openapi/__tests__/route-scanner.test.d.ts +2 -0
- package/dist/openapi/__tests__/route-scanner.test.d.ts.map +1 -0
- package/dist/openapi/__tests__/schema-generator.test.d.ts +2 -0
- package/dist/openapi/__tests__/schema-generator.test.d.ts.map +1 -0
- package/dist/openapi/decorators.d.ts +173 -0
- package/dist/openapi/decorators.d.ts.map +1 -0
- package/dist/openapi/document-builder.d.ts +82 -0
- package/dist/openapi/document-builder.d.ts.map +1 -0
- package/dist/openapi/index.d.ts +48 -0
- package/dist/openapi/index.d.ts.map +1 -0
- package/dist/openapi/metadata.d.ts +36 -0
- package/dist/openapi/metadata.d.ts.map +1 -0
- package/dist/openapi/route-scanner.d.ts +34 -0
- package/dist/openapi/route-scanner.d.ts.map +1 -0
- package/dist/openapi/schema-generator.d.ts +53 -0
- package/dist/openapi/schema-generator.d.ts.map +1 -0
- package/dist/openapi/swagger-module.d.ts +57 -0
- package/dist/openapi/swagger-module.d.ts.map +1 -0
- package/dist/openapi/types.d.ts +344 -0
- package/dist/openapi/types.d.ts.map +1 -0
- package/dist/orm/index.d.ts +10 -0
- package/dist/orm/index.d.ts.map +1 -0
- package/dist/router/index.d.ts +73 -0
- package/dist/router/index.d.ts.map +1 -0
- package/dist/router/linear.d.ts +54 -0
- package/dist/router/linear.d.ts.map +1 -0
- package/dist/router/regex.d.ts +49 -0
- package/dist/router/regex.d.ts.map +1 -0
- package/dist/router/tree.d.ts +112 -0
- package/dist/router/tree.d.ts.map +1 -0
- package/dist/rpc/index.d.ts +321 -0
- package/dist/rpc/index.d.ts.map +1 -0
- package/dist/schema/index.d.ts +10 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/security/index.d.ts +126 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/ssg/index.d.ts +73 -0
- package/dist/ssg/index.d.ts.map +1 -0
- package/dist/storage/index.d.ts +99 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/telemetry/index.d.ts +376 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/template/index.d.ts +7 -0
- package/dist/template/index.d.ts.map +1 -0
- package/dist/templates/engine.d.ts +60 -0
- package/dist/templates/engine.d.ts.map +1 -0
- package/dist/templates/index.d.ts +9 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/loader.d.ts +45 -0
- package/dist/templates/loader.d.ts.map +1 -0
- package/dist/templates/renderers/markdown.d.ts +46 -0
- package/dist/templates/renderers/markdown.d.ts.map +1 -0
- package/dist/templates/renderers/simple.d.ts +35 -0
- package/dist/templates/renderers/simple.d.ts.map +1 -0
- package/dist/templates/types.d.ts +138 -0
- package/dist/templates/types.d.ts.map +1 -0
- package/dist/testing/index.d.ts +539 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +116 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/validation/index.d.ts +89 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/schemas.d.ts +243 -0
- package/dist/validation/schemas.d.ts.map +1 -0
- package/dist/websocket/index.d.ts +252 -0
- package/dist/websocket/index.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/cli/commands/add-frontend.ts +444 -0
- package/src/cli/commands/new.ts +23 -0
- package/src/cli/index.ts +1 -0
- package/src/cli/templates/frontend/react.ts +2 -1
- package/src/cli/templates/frontend/solid.ts +2 -1
- package/src/cli/templates/frontend/svelte.ts +2 -1
- package/src/cli/templates/frontend/vue.ts +2 -1
- package/src/cli/templates/project/api.ts +1 -1
- package/src/cli/templates/project/default.ts +1 -1
- package/src/cli/templates/project/fullstack.ts +14 -104
- package/src/cli/templates/project/website.ts +62 -11
- package/tsconfig.declaration.json +14 -0
package/dist/cli/bin.js
CHANGED
|
@@ -27,6 +27,61 @@ var __legacyMetadataTS = (k, v) => {
|
|
|
27
27
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
28
28
|
var __require = import.meta.require;
|
|
29
29
|
|
|
30
|
+
// src/cli/commands/index.ts
|
|
31
|
+
var exports_commands = {};
|
|
32
|
+
__export(exports_commands, {
|
|
33
|
+
registry: () => registry,
|
|
34
|
+
defineCommand: () => defineCommand,
|
|
35
|
+
command: () => command
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
class CommandRegistry {
|
|
39
|
+
commands = new Map;
|
|
40
|
+
aliases = new Map;
|
|
41
|
+
register(definition, handler) {
|
|
42
|
+
this.commands.set(definition.name, {
|
|
43
|
+
definition,
|
|
44
|
+
handler
|
|
45
|
+
});
|
|
46
|
+
if (definition.alias) {
|
|
47
|
+
this.aliases.set(definition.alias, definition.name);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
get(name) {
|
|
51
|
+
const commandName = this.aliases.get(name) ?? name;
|
|
52
|
+
return this.commands.get(commandName);
|
|
53
|
+
}
|
|
54
|
+
has(name) {
|
|
55
|
+
const commandName = this.aliases.get(name) ?? name;
|
|
56
|
+
return this.commands.has(commandName);
|
|
57
|
+
}
|
|
58
|
+
getAll() {
|
|
59
|
+
return Array.from(this.commands.values()).map((c) => c.definition);
|
|
60
|
+
}
|
|
61
|
+
getCommands() {
|
|
62
|
+
return new Map(this.commands);
|
|
63
|
+
}
|
|
64
|
+
async execute(name, args) {
|
|
65
|
+
const command = this.get(name);
|
|
66
|
+
if (!command) {
|
|
67
|
+
throw new Error(`Unknown command: ${name}`);
|
|
68
|
+
}
|
|
69
|
+
await command.handler(args);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
function command(definition) {
|
|
73
|
+
return (handler) => {
|
|
74
|
+
registry.register(definition, handler);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function defineCommand(definition, handler) {
|
|
78
|
+
registry.register(definition, handler);
|
|
79
|
+
}
|
|
80
|
+
var registry;
|
|
81
|
+
var init_commands = __esm(() => {
|
|
82
|
+
registry = new CommandRegistry;
|
|
83
|
+
});
|
|
84
|
+
|
|
30
85
|
// src/cli/templates/docker.ts
|
|
31
86
|
function getDockerfileTemplate(projectName, database) {
|
|
32
87
|
return `# ${projectName} - Production Dockerfile
|
|
@@ -592,7 +647,7 @@ export class AppController {
|
|
|
592
647
|
return Response.json({ message: 'Welcome to Bueno API!', version: '1.0.0' });
|
|
593
648
|
}
|
|
594
649
|
|
|
595
|
-
@Get('health')
|
|
650
|
+
@Get('/health')
|
|
596
651
|
health(ctx: Context) {
|
|
597
652
|
return Response.json({ status: 'ok', timestamp: new Date().toISOString() });
|
|
598
653
|
}
|
|
@@ -746,7 +801,8 @@ export function App() {
|
|
|
746
801
|
},
|
|
747
802
|
{
|
|
748
803
|
path: "client/src/styles/globals.css",
|
|
749
|
-
content:
|
|
804
|
+
content: `/* PostCSS will process these directives */
|
|
805
|
+
@tailwind base;
|
|
750
806
|
@tailwind components;
|
|
751
807
|
@tailwind utilities;
|
|
752
808
|
|
|
@@ -879,7 +935,8 @@ export function App() {
|
|
|
879
935
|
},
|
|
880
936
|
{
|
|
881
937
|
path: "client/src/styles/globals.css",
|
|
882
|
-
content:
|
|
938
|
+
content: `/* PostCSS will process these directives */
|
|
939
|
+
@tailwind base;
|
|
883
940
|
@tailwind components;
|
|
884
941
|
@tailwind utilities;
|
|
885
942
|
|
|
@@ -1004,7 +1061,8 @@ export default app;
|
|
|
1004
1061
|
},
|
|
1005
1062
|
{
|
|
1006
1063
|
path: "client/src/styles/globals.css",
|
|
1007
|
-
content:
|
|
1064
|
+
content: `/* PostCSS will process these directives */
|
|
1065
|
+
@tailwind base;
|
|
1008
1066
|
@tailwind components;
|
|
1009
1067
|
@tailwind utilities;
|
|
1010
1068
|
|
|
@@ -1132,7 +1190,8 @@ const count = ref(0);
|
|
|
1132
1190
|
},
|
|
1133
1191
|
{
|
|
1134
1192
|
path: "client/src/styles/globals.css",
|
|
1135
|
-
content:
|
|
1193
|
+
content: `/* PostCSS will process these directives */
|
|
1194
|
+
@tailwind base;
|
|
1136
1195
|
@tailwind components;
|
|
1137
1196
|
@tailwind utilities;
|
|
1138
1197
|
|
|
@@ -1229,7 +1288,7 @@ export class AppController {
|
|
|
1229
1288
|
</ul>
|
|
1230
1289
|
|
|
1231
1290
|
<h2>Documentation</h2>
|
|
1232
|
-
<p>Visit <a href="https://
|
|
1291
|
+
<p>Visit <a href="https://bueno.github.io">https://bueno.github.io</a> for full documentation.</p>
|
|
1233
1292
|
|
|
1234
1293
|
<h2>Quick Example</h2>
|
|
1235
1294
|
<pre><code>@Controller('/api')
|
|
@@ -1298,94 +1357,11 @@ var init_default = () => {};
|
|
|
1298
1357
|
|
|
1299
1358
|
// src/cli/templates/project/fullstack.ts
|
|
1300
1359
|
function fullstackTemplate(config) {
|
|
1301
|
-
|
|
1302
|
-
react: reactTemplate,
|
|
1303
|
-
vue: vueTemplate,
|
|
1304
|
-
svelte: svelteTemplate,
|
|
1305
|
-
solid: solidTemplate,
|
|
1306
|
-
none: noneTemplate
|
|
1307
|
-
};
|
|
1308
|
-
const frontendTemplate = frontendTemplates[config.framework] ? frontendTemplates[config.framework]() : reactTemplate();
|
|
1309
|
-
return {
|
|
1310
|
-
files: [
|
|
1311
|
-
{
|
|
1312
|
-
path: "server/main.ts",
|
|
1313
|
-
content: `import { createApp, Module, Controller, Get, Post, Injectable } from '@buenojs/bueno';
|
|
1314
|
-
import type { Context } from '@buenojs/bueno';
|
|
1315
|
-
|
|
1316
|
-
// Services
|
|
1317
|
-
@Injectable()
|
|
1318
|
-
export class AppService {
|
|
1319
|
-
findAll() {
|
|
1320
|
-
return { message: 'Welcome to Bueno!', items: [] };
|
|
1321
|
-
}
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
// Controllers
|
|
1325
|
-
@Controller('/api')
|
|
1326
|
-
export class AppController {
|
|
1327
|
-
constructor(private readonly appService: AppService) {}
|
|
1328
|
-
|
|
1329
|
-
@Get()
|
|
1330
|
-
hello() {
|
|
1331
|
-
return { message: 'Welcome to Bueno API!', version: '1.0.0' };
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
@Get('health')
|
|
1335
|
-
health(ctx: Context) {
|
|
1336
|
-
return { status: 'ok', timestamp: new Date().toISOString() };
|
|
1337
|
-
}
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
// Module
|
|
1341
|
-
@Module({
|
|
1342
|
-
controllers: [AppController],
|
|
1343
|
-
providers: [AppService],
|
|
1344
|
-
})
|
|
1345
|
-
export class AppModule {}
|
|
1346
|
-
|
|
1347
|
-
// Bootstrap
|
|
1348
|
-
const app = createApp(AppModule);
|
|
1349
|
-
|
|
1350
|
-
// Serve static files in production
|
|
1351
|
-
// app.serveStatic('./dist/client');
|
|
1352
|
-
|
|
1353
|
-
await app.listen(3000);
|
|
1354
|
-
console.log('\uD83D\uDE80 Server running at http://localhost:3000');
|
|
1355
|
-
`
|
|
1356
|
-
},
|
|
1357
|
-
...frontendTemplate.files
|
|
1358
|
-
],
|
|
1359
|
-
directories: [
|
|
1360
|
-
"server/modules/app",
|
|
1361
|
-
"server/common/middleware",
|
|
1362
|
-
"server/common/guards",
|
|
1363
|
-
"server/common/interceptors",
|
|
1364
|
-
"server/common/pipes",
|
|
1365
|
-
"server/common/filters",
|
|
1366
|
-
"server/database/migrations",
|
|
1367
|
-
"server/config",
|
|
1368
|
-
"tests/unit",
|
|
1369
|
-
"tests/integration",
|
|
1370
|
-
...frontendTemplate.directories
|
|
1371
|
-
],
|
|
1372
|
-
dependencies: {
|
|
1373
|
-
zod: "^3.24.0",
|
|
1374
|
-
...frontendTemplate.dependencies
|
|
1375
|
-
},
|
|
1376
|
-
devDependencies: {
|
|
1377
|
-
...frontendTemplate.devDependencies
|
|
1378
|
-
},
|
|
1379
|
-
scripts: {
|
|
1380
|
-
dev: "bun run --watch server/main.ts",
|
|
1381
|
-
build: "bun build ./server/main.ts --outdir ./dist --target bun",
|
|
1382
|
-
start: "bun run dist/main.js",
|
|
1383
|
-
test: "bun test",
|
|
1384
|
-
...frontendTemplate.scripts
|
|
1385
|
-
}
|
|
1386
|
-
};
|
|
1360
|
+
return apiTemplate(config);
|
|
1387
1361
|
}
|
|
1388
|
-
var init_fullstack = () => {
|
|
1362
|
+
var init_fullstack = __esm(() => {
|
|
1363
|
+
init_api();
|
|
1364
|
+
});
|
|
1389
1365
|
|
|
1390
1366
|
// src/cli/templates/project/minimal.ts
|
|
1391
1367
|
function minimalTemplate(config) {
|
|
@@ -1475,7 +1451,7 @@ console.log('Build complete!');
|
|
|
1475
1451
|
function renderDefaultLayout(ctx: LayoutContext): string {
|
|
1476
1452
|
const title = ctx.page.frontmatter.title || ctx.site.title;
|
|
1477
1453
|
const description = ctx.page.frontmatter.description || ctx.site.description;
|
|
1478
|
-
|
|
1454
|
+
|
|
1479
1455
|
return \`<!DOCTYPE html>
|
|
1480
1456
|
<html lang="en">
|
|
1481
1457
|
<head>
|
|
@@ -1513,41 +1489,41 @@ const PORT = 3001;
|
|
|
1513
1489
|
|
|
1514
1490
|
async function serve() {
|
|
1515
1491
|
console.log(\`Starting server at http://localhost:\${PORT}\`);
|
|
1516
|
-
|
|
1492
|
+
|
|
1517
1493
|
Bun.serve({
|
|
1518
1494
|
port: PORT,
|
|
1519
1495
|
async fetch(request) {
|
|
1520
1496
|
const url = new URL(request.url);
|
|
1521
1497
|
let path = url.pathname;
|
|
1522
|
-
|
|
1498
|
+
|
|
1523
1499
|
// Serve index.html for root
|
|
1524
1500
|
if (path === '/') {
|
|
1525
1501
|
path = '/index.html';
|
|
1526
1502
|
}
|
|
1527
|
-
|
|
1503
|
+
|
|
1528
1504
|
// Try to serve from dist directory
|
|
1529
1505
|
const filePath = \`./dist\${path}\`;
|
|
1530
1506
|
const file = Bun.file(filePath);
|
|
1531
|
-
|
|
1507
|
+
|
|
1532
1508
|
if (await file.exists()) {
|
|
1533
1509
|
return new Response(file);
|
|
1534
1510
|
}
|
|
1535
|
-
|
|
1511
|
+
|
|
1536
1512
|
// For SPA-like behavior, try adding .html extension
|
|
1537
1513
|
if (!path.includes('.')) {
|
|
1538
1514
|
const htmlPath = \`./dist\${path}/index.html\`;
|
|
1539
1515
|
const htmlFile = Bun.file(htmlPath);
|
|
1540
|
-
|
|
1516
|
+
|
|
1541
1517
|
if (await htmlFile.exists()) {
|
|
1542
1518
|
return new Response(htmlFile);
|
|
1543
1519
|
}
|
|
1544
1520
|
}
|
|
1545
|
-
|
|
1521
|
+
|
|
1546
1522
|
// 404
|
|
1547
1523
|
return new Response('Not Found', { status: 404 });
|
|
1548
1524
|
},
|
|
1549
1525
|
});
|
|
1550
|
-
|
|
1526
|
+
|
|
1551
1527
|
console.log(\`Server running at http://localhost:\${PORT}\`);
|
|
1552
1528
|
}
|
|
1553
1529
|
|
|
@@ -1564,7 +1540,7 @@ layout: default
|
|
|
1564
1540
|
|
|
1565
1541
|
# Welcome to ${config.name}
|
|
1566
1542
|
|
|
1567
|
-
This is a static website built with [Bueno Framework](https://
|
|
1543
|
+
This is a static website built with [Bueno Framework](https://bueno.github.io).
|
|
1568
1544
|
|
|
1569
1545
|
## Getting Started
|
|
1570
1546
|
|
|
@@ -1572,6 +1548,57 @@ This is a static website built with [Bueno Framework](https://buenojs.dev).
|
|
|
1572
1548
|
2. Run \`bun run dev\` to start development
|
|
1573
1549
|
3. Run \`bun run build\` to generate static files
|
|
1574
1550
|
`
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
path: "content/about.md",
|
|
1554
|
+
content: `---
|
|
1555
|
+
title: About
|
|
1556
|
+
description: About this website
|
|
1557
|
+
layout: default
|
|
1558
|
+
---
|
|
1559
|
+
|
|
1560
|
+
# About This Website
|
|
1561
|
+
|
|
1562
|
+
This is a static website built with [Bueno Framework](https://bueno.github.io).
|
|
1563
|
+
|
|
1564
|
+
## Features
|
|
1565
|
+
|
|
1566
|
+
- Lightning fast static site generation
|
|
1567
|
+
- Markdown content support
|
|
1568
|
+
- Simple layout system
|
|
1569
|
+
- Zero JavaScript overhead
|
|
1570
|
+
|
|
1571
|
+
## Getting Started
|
|
1572
|
+
|
|
1573
|
+
Visit the [Bueno documentation](https://bueno.github.io) to learn more.
|
|
1574
|
+
`
|
|
1575
|
+
},
|
|
1576
|
+
{
|
|
1577
|
+
path: "layouts/default.html",
|
|
1578
|
+
content: `<!DOCTYPE html>
|
|
1579
|
+
<html lang="en">
|
|
1580
|
+
<head>
|
|
1581
|
+
<meta charset="UTF-8">
|
|
1582
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1583
|
+
<title>\${ctx.page.frontmatter.title || ctx.site.title}</title>
|
|
1584
|
+
<meta name="description" content="\${ctx.page.frontmatter.description || ctx.site.description}">
|
|
1585
|
+
<link rel="stylesheet" href="\${ctx.site.baseUrl}styles/main.css">
|
|
1586
|
+
</head>
|
|
1587
|
+
<body>
|
|
1588
|
+
<header>
|
|
1589
|
+
<nav>
|
|
1590
|
+
<a href="\${ctx.site.baseUrl}">Home</a>
|
|
1591
|
+
<a href="\${ctx.site.baseUrl}about">About</a>
|
|
1592
|
+
</nav>
|
|
1593
|
+
</header>
|
|
1594
|
+
<main>
|
|
1595
|
+
\${ctx.content}
|
|
1596
|
+
</main>
|
|
1597
|
+
<footer>
|
|
1598
|
+
<p>© \${new Date().getFullYear()} \${ctx.site.title}</p>
|
|
1599
|
+
</footer>
|
|
1600
|
+
</body>
|
|
1601
|
+
</html>`
|
|
1575
1602
|
},
|
|
1576
1603
|
{
|
|
1577
1604
|
path: "public/styles/main.css",
|
|
@@ -1670,7 +1697,7 @@ NODE_ENV=development
|
|
|
1670
1697
|
`
|
|
1671
1698
|
}
|
|
1672
1699
|
],
|
|
1673
|
-
directories: ["src", "content", "public/styles", "layouts"],
|
|
1700
|
+
directories: ["src", "content", "public", "public/styles", "layouts"],
|
|
1674
1701
|
dependencies: {
|
|
1675
1702
|
...getBuenoDependency()
|
|
1676
1703
|
},
|
|
@@ -2177,49 +2204,10 @@ var init_templates = __esm(() => {
|
|
|
2177
2204
|
});
|
|
2178
2205
|
|
|
2179
2206
|
// src/cli/index.ts
|
|
2207
|
+
init_commands();
|
|
2180
2208
|
import { readFileSync as readFileSync3 } from "fs";
|
|
2181
2209
|
import { join as join3 } from "path";
|
|
2182
2210
|
|
|
2183
|
-
// src/cli/commands/index.ts
|
|
2184
|
-
class CommandRegistry {
|
|
2185
|
-
commands = new Map;
|
|
2186
|
-
aliases = new Map;
|
|
2187
|
-
register(definition, handler) {
|
|
2188
|
-
this.commands.set(definition.name, {
|
|
2189
|
-
definition,
|
|
2190
|
-
handler
|
|
2191
|
-
});
|
|
2192
|
-
if (definition.alias) {
|
|
2193
|
-
this.aliases.set(definition.alias, definition.name);
|
|
2194
|
-
}
|
|
2195
|
-
}
|
|
2196
|
-
get(name) {
|
|
2197
|
-
const commandName = this.aliases.get(name) ?? name;
|
|
2198
|
-
return this.commands.get(commandName);
|
|
2199
|
-
}
|
|
2200
|
-
has(name) {
|
|
2201
|
-
const commandName = this.aliases.get(name) ?? name;
|
|
2202
|
-
return this.commands.has(commandName);
|
|
2203
|
-
}
|
|
2204
|
-
getAll() {
|
|
2205
|
-
return Array.from(this.commands.values()).map((c) => c.definition);
|
|
2206
|
-
}
|
|
2207
|
-
getCommands() {
|
|
2208
|
-
return new Map(this.commands);
|
|
2209
|
-
}
|
|
2210
|
-
async execute(name, args) {
|
|
2211
|
-
const command = this.get(name);
|
|
2212
|
-
if (!command) {
|
|
2213
|
-
throw new Error(`Unknown command: ${name}`);
|
|
2214
|
-
}
|
|
2215
|
-
await command.handler(args);
|
|
2216
|
-
}
|
|
2217
|
-
}
|
|
2218
|
-
var registry = new CommandRegistry;
|
|
2219
|
-
function defineCommand(definition, handler) {
|
|
2220
|
-
registry.register(definition, handler);
|
|
2221
|
-
}
|
|
2222
|
-
|
|
2223
2211
|
// src/cli/core/args.ts
|
|
2224
2212
|
function parseArgs(argv = process.argv.slice(2)) {
|
|
2225
2213
|
const result = {
|
|
@@ -2319,32 +2307,32 @@ function getOptionValues(parsed, name, alias) {
|
|
|
2319
2307
|
}
|
|
2320
2308
|
return values;
|
|
2321
2309
|
}
|
|
2322
|
-
function generateHelpText(
|
|
2310
|
+
function generateHelpText(command2, cliName = "bueno") {
|
|
2323
2311
|
const lines = [];
|
|
2324
2312
|
lines.push(`
|
|
2325
|
-
${
|
|
2313
|
+
${command2.description}
|
|
2326
2314
|
`);
|
|
2327
2315
|
lines.push("Usage:");
|
|
2328
|
-
let usage = ` ${cliName} ${
|
|
2329
|
-
if (
|
|
2330
|
-
for (const pos of
|
|
2316
|
+
let usage = ` ${cliName} ${command2.name}`;
|
|
2317
|
+
if (command2.positionals) {
|
|
2318
|
+
for (const pos of command2.positionals) {
|
|
2331
2319
|
usage += pos.required ? ` <${pos.name}>` : ` [${pos.name}]`;
|
|
2332
2320
|
}
|
|
2333
2321
|
}
|
|
2334
2322
|
usage += " [options]";
|
|
2335
2323
|
lines.push(usage + `
|
|
2336
2324
|
`);
|
|
2337
|
-
if (
|
|
2325
|
+
if (command2.positionals && command2.positionals.length > 0) {
|
|
2338
2326
|
lines.push("Arguments:");
|
|
2339
|
-
for (const pos of
|
|
2327
|
+
for (const pos of command2.positionals) {
|
|
2340
2328
|
const required = pos.required ? " (required)" : "";
|
|
2341
2329
|
lines.push(` ${pos.name.padEnd(20)} ${pos.description}${required}`);
|
|
2342
2330
|
}
|
|
2343
2331
|
lines.push("");
|
|
2344
2332
|
}
|
|
2345
|
-
if (
|
|
2333
|
+
if (command2.options && command2.options.length > 0) {
|
|
2346
2334
|
lines.push("Options:");
|
|
2347
|
-
for (const opt of
|
|
2335
|
+
for (const opt of command2.options) {
|
|
2348
2336
|
let flag = `--${opt.name}`;
|
|
2349
2337
|
if (opt.alias) {
|
|
2350
2338
|
flag = `-${opt.alias}, ${flag}`;
|
|
@@ -2357,9 +2345,9 @@ ${command.description}
|
|
|
2357
2345
|
}
|
|
2358
2346
|
lines.push("");
|
|
2359
2347
|
}
|
|
2360
|
-
if (
|
|
2348
|
+
if (command2.examples && command2.examples.length > 0) {
|
|
2361
2349
|
lines.push("Examples:");
|
|
2362
|
-
for (const example of
|
|
2350
|
+
for (const example of command2.examples) {
|
|
2363
2351
|
lines.push(` ${example}`);
|
|
2364
2352
|
}
|
|
2365
2353
|
lines.push("");
|
|
@@ -2957,6 +2945,7 @@ function kebabCase(str) {
|
|
|
2957
2945
|
|
|
2958
2946
|
// src/cli/commands/new.ts
|
|
2959
2947
|
init_version();
|
|
2948
|
+
init_commands();
|
|
2960
2949
|
init_templates();
|
|
2961
2950
|
function validateProjectName(name) {
|
|
2962
2951
|
if (!name || name.length === 0) {
|
|
@@ -3391,6 +3380,22 @@ async function handleNew(args) {
|
|
|
3391
3380
|
}
|
|
3392
3381
|
}
|
|
3393
3382
|
}
|
|
3383
|
+
if (template === "fullstack") {
|
|
3384
|
+
cliConsole.subheader("Adding frontend framework...");
|
|
3385
|
+
try {
|
|
3386
|
+
const { registry: registry2 } = await Promise.resolve().then(() => (init_commands(), exports_commands));
|
|
3387
|
+
const args2 = parseArgs([
|
|
3388
|
+
"add:frontend",
|
|
3389
|
+
framework,
|
|
3390
|
+
skipInstall ? "--skip-install" : null,
|
|
3391
|
+
`--project-path=${projectPath}`
|
|
3392
|
+
].filter(Boolean));
|
|
3393
|
+
await registry2.execute("add:frontend", args2);
|
|
3394
|
+
} catch (error) {
|
|
3395
|
+
cliConsole.error(`Failed to add frontend: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
3396
|
+
cliConsole.warn("You can manually run: bueno add:frontend " + framework);
|
|
3397
|
+
}
|
|
3398
|
+
}
|
|
3394
3399
|
cliConsole.log("");
|
|
3395
3400
|
cliConsole.success(`Project created successfully!`);
|
|
3396
3401
|
cliConsole.log("");
|
|
@@ -3489,7 +3494,321 @@ defineCommand({
|
|
|
3489
3494
|
]
|
|
3490
3495
|
}, handleNew);
|
|
3491
3496
|
|
|
3497
|
+
// src/cli/commands/add-frontend.ts
|
|
3498
|
+
init_templates();
|
|
3499
|
+
init_commands();
|
|
3500
|
+
async function validateBuenoProject(projectPath) {
|
|
3501
|
+
const packageJsonPath = joinPaths(projectPath, "package.json");
|
|
3502
|
+
const buenoCofigPath = joinPaths(projectPath, "bueno.config.ts");
|
|
3503
|
+
const hasPackageJson = await fileExists(packageJsonPath);
|
|
3504
|
+
const hasBuenoConfig = await fileExists(buenoCofigPath);
|
|
3505
|
+
return hasPackageJson && hasBuenoConfig;
|
|
3506
|
+
}
|
|
3507
|
+
async function clientDirExists(projectPath) {
|
|
3508
|
+
return await fileExists(joinPaths(projectPath, "client"));
|
|
3509
|
+
}
|
|
3510
|
+
function getBunBundlerConfig(framework) {
|
|
3511
|
+
const configBase = {
|
|
3512
|
+
react: {
|
|
3513
|
+
entrypoints: ["./src/main.tsx"],
|
|
3514
|
+
loaders: {
|
|
3515
|
+
".tsx": "tsx",
|
|
3516
|
+
".ts": "tsx",
|
|
3517
|
+
".css": "file",
|
|
3518
|
+
".svg": "file"
|
|
3519
|
+
}
|
|
3520
|
+
},
|
|
3521
|
+
vue: {
|
|
3522
|
+
entrypoints: ["./src/main.ts"],
|
|
3523
|
+
loaders: {
|
|
3524
|
+
".vue": "file",
|
|
3525
|
+
".ts": "ts",
|
|
3526
|
+
".css": "file",
|
|
3527
|
+
".svg": "file"
|
|
3528
|
+
}
|
|
3529
|
+
},
|
|
3530
|
+
svelte: {
|
|
3531
|
+
entrypoints: ["./src/main.ts"],
|
|
3532
|
+
loaders: {
|
|
3533
|
+
".svelte": "file",
|
|
3534
|
+
".ts": "ts",
|
|
3535
|
+
".css": "file",
|
|
3536
|
+
".svg": "file"
|
|
3537
|
+
}
|
|
3538
|
+
},
|
|
3539
|
+
solid: {
|
|
3540
|
+
entrypoints: ["./src/main.tsx"],
|
|
3541
|
+
loaders: {
|
|
3542
|
+
".tsx": "tsx",
|
|
3543
|
+
".ts": "tsx",
|
|
3544
|
+
".css": "file",
|
|
3545
|
+
".svg": "file"
|
|
3546
|
+
}
|
|
3547
|
+
}
|
|
3548
|
+
};
|
|
3549
|
+
const config = configBase[framework] || configBase.react;
|
|
3550
|
+
return `import type { BunPlugin } from 'bun';
|
|
3551
|
+
import postcss from 'postcss';
|
|
3552
|
+
import tailwindcss from 'tailwindcss';
|
|
3553
|
+
import autoprefixer from 'autoprefixer';
|
|
3554
|
+
import * as fs from 'fs';
|
|
3555
|
+
import * as path from 'path';
|
|
3556
|
+
|
|
3557
|
+
// PostCSS processor for Tailwind
|
|
3558
|
+
const postcssPlugin: BunPlugin = {
|
|
3559
|
+
name: 'postcss-plugin',
|
|
3560
|
+
setup(build) {
|
|
3561
|
+
build.onLoad({ filter: /\\.css$/ }, async (args) => {
|
|
3562
|
+
const css = fs.readFileSync(args.path, 'utf-8');
|
|
3563
|
+
const result = await postcss([tailwindcss, autoprefixer]).process(css, {
|
|
3564
|
+
from: args.path,
|
|
3565
|
+
});
|
|
3566
|
+
return {
|
|
3567
|
+
contents: result.css,
|
|
3568
|
+
loader: 'text',
|
|
3569
|
+
};
|
|
3570
|
+
});
|
|
3571
|
+
},
|
|
3572
|
+
};
|
|
3573
|
+
|
|
3574
|
+
export const config = {
|
|
3575
|
+
entrypoints: [${config.entrypoints.map((e) => `"${e}"`).join(", ")}],
|
|
3576
|
+
outdir: "../dist/client",
|
|
3577
|
+
minify: true,
|
|
3578
|
+
sourcemap: "external",
|
|
3579
|
+
loaders: {
|
|
3580
|
+
${Object.entries(config.loaders).map(([ext, loader]) => ` "${ext}": "${loader}",`).join(`
|
|
3581
|
+
`)}
|
|
3582
|
+
},
|
|
3583
|
+
plugins: [postcssPlugin],
|
|
3584
|
+
};
|
|
3585
|
+
`;
|
|
3586
|
+
}
|
|
3587
|
+
function getTailwindConfig() {
|
|
3588
|
+
return `export default {
|
|
3589
|
+
content: [
|
|
3590
|
+
"./index.html",
|
|
3591
|
+
"./src/**/*.{tsx,ts,jsx,js}",
|
|
3592
|
+
],
|
|
3593
|
+
theme: {
|
|
3594
|
+
extend: {},
|
|
3595
|
+
},
|
|
3596
|
+
plugins: [],
|
|
3597
|
+
};
|
|
3598
|
+
`;
|
|
3599
|
+
}
|
|
3600
|
+
function getPostCSSConfig() {
|
|
3601
|
+
return `export default {
|
|
3602
|
+
plugins: {
|
|
3603
|
+
tailwindcss: {},
|
|
3604
|
+
autoprefixer: {},
|
|
3605
|
+
},
|
|
3606
|
+
};
|
|
3607
|
+
`;
|
|
3608
|
+
}
|
|
3609
|
+
async function mergePackageJson(projectPath, newDeps, newDevDeps, newScripts) {
|
|
3610
|
+
const packageJsonPath = joinPaths(projectPath, "package.json");
|
|
3611
|
+
const content = await readFile(packageJsonPath);
|
|
3612
|
+
const packageJson = JSON.parse(content);
|
|
3613
|
+
packageJson.dependencies = {
|
|
3614
|
+
...packageJson.dependencies,
|
|
3615
|
+
...newDeps
|
|
3616
|
+
};
|
|
3617
|
+
packageJson.devDependencies = {
|
|
3618
|
+
...packageJson.devDependencies,
|
|
3619
|
+
...newDevDeps
|
|
3620
|
+
};
|
|
3621
|
+
packageJson.scripts = {
|
|
3622
|
+
...packageJson.scripts,
|
|
3623
|
+
...newScripts
|
|
3624
|
+
};
|
|
3625
|
+
await writeFile(packageJsonPath, JSON.stringify(packageJson, null, 2) + `
|
|
3626
|
+
`);
|
|
3627
|
+
}
|
|
3628
|
+
async function handleAddFrontend(args) {
|
|
3629
|
+
const projectPath = getOption(args, "project-path", {
|
|
3630
|
+
name: "project-path",
|
|
3631
|
+
type: "string",
|
|
3632
|
+
description: "Path to the Bueno project"
|
|
3633
|
+
}) || process.cwd();
|
|
3634
|
+
const isValid = await validateBuenoProject(projectPath);
|
|
3635
|
+
if (!isValid) {
|
|
3636
|
+
throw new CLIError("Not a Bueno project. Please run this command in a Bueno project directory (must have package.json and bueno.config.ts)", "INVALID_ARGS" /* INVALID_ARGS */);
|
|
3637
|
+
}
|
|
3638
|
+
let framework = args.positionals[0] || getOption(args, "framework", {
|
|
3639
|
+
name: "framework",
|
|
3640
|
+
alias: "f",
|
|
3641
|
+
type: "string",
|
|
3642
|
+
description: ""
|
|
3643
|
+
});
|
|
3644
|
+
const skipInstall = hasFlag(args, "skip-install");
|
|
3645
|
+
if (!framework && isInteractive()) {
|
|
3646
|
+
framework = await select("Select a frontend framework:", getFrontendOptions(), { default: "react" });
|
|
3647
|
+
}
|
|
3648
|
+
framework = framework || "react";
|
|
3649
|
+
if (await clientDirExists(projectPath)) {
|
|
3650
|
+
cliConsole.warn("client/ directory already exists");
|
|
3651
|
+
throw new CLIError("client/ directory already exists. Please remove it first or use a different project.", "FILE_EXISTS" /* FILE_EXISTS */);
|
|
3652
|
+
}
|
|
3653
|
+
const frontendTemplate = getFrontendTemplate(framework);
|
|
3654
|
+
cliConsole.header(`Adding ${colors.cyan(framework)} frontend to project`);
|
|
3655
|
+
const rows = [
|
|
3656
|
+
["Framework", framework],
|
|
3657
|
+
["Frontend Directory", "client/"],
|
|
3658
|
+
["Include Tailwind CSS", "Yes"],
|
|
3659
|
+
["Bundler", "Bun (native)"],
|
|
3660
|
+
["Install dependencies", skipInstall ? colors.red("No") : colors.green("Yes")]
|
|
3661
|
+
];
|
|
3662
|
+
printTable(["Setting", "Value"], rows);
|
|
3663
|
+
cliConsole.log("");
|
|
3664
|
+
const tasks = [];
|
|
3665
|
+
tasks.push({
|
|
3666
|
+
text: "Creating client directory structure",
|
|
3667
|
+
task: async () => {
|
|
3668
|
+
await createDirectory(joinPaths(projectPath, "client", "src", "components"));
|
|
3669
|
+
await createDirectory(joinPaths(projectPath, "client", "src", "styles"));
|
|
3670
|
+
await createDirectory(joinPaths(projectPath, "client", "public"));
|
|
3671
|
+
for (const dir of frontendTemplate.directories) {
|
|
3672
|
+
const dirPath = dir.startsWith("client/") ? dir.slice(7) : dir;
|
|
3673
|
+
await createDirectory(joinPaths(projectPath, "client", dirPath));
|
|
3674
|
+
}
|
|
3675
|
+
}
|
|
3676
|
+
});
|
|
3677
|
+
for (const file of frontendTemplate.files) {
|
|
3678
|
+
tasks.push({
|
|
3679
|
+
text: `Creating ${file.path}`,
|
|
3680
|
+
task: async () => {
|
|
3681
|
+
const filePath = file.path.startsWith("client/") ? file.path.slice(7) : file.path;
|
|
3682
|
+
await writeFile(joinPaths(projectPath, "client", filePath), file.content);
|
|
3683
|
+
}
|
|
3684
|
+
});
|
|
3685
|
+
}
|
|
3686
|
+
tasks.push({
|
|
3687
|
+
text: "Creating Bun bundler configuration",
|
|
3688
|
+
task: async () => {
|
|
3689
|
+
const bundlerConfig = getBunBundlerConfig(framework);
|
|
3690
|
+
await writeFile(joinPaths(projectPath, "client", "bun.bundler.ts"), bundlerConfig);
|
|
3691
|
+
}
|
|
3692
|
+
});
|
|
3693
|
+
tasks.push({
|
|
3694
|
+
text: "Creating Tailwind CSS configuration",
|
|
3695
|
+
task: async () => {
|
|
3696
|
+
const tailwindConfig = getTailwindConfig();
|
|
3697
|
+
await writeFile(joinPaths(projectPath, "client", "tailwind.config.ts"), tailwindConfig);
|
|
3698
|
+
}
|
|
3699
|
+
});
|
|
3700
|
+
tasks.push({
|
|
3701
|
+
text: "Creating PostCSS configuration",
|
|
3702
|
+
task: async () => {
|
|
3703
|
+
const postCSSConfig = getPostCSSConfig();
|
|
3704
|
+
await writeFile(joinPaths(projectPath, "client", "postcss.config.js"), postCSSConfig);
|
|
3705
|
+
}
|
|
3706
|
+
});
|
|
3707
|
+
tasks.push({
|
|
3708
|
+
text: "Creating client TypeScript configuration",
|
|
3709
|
+
task: async () => {
|
|
3710
|
+
const tsConfig = JSON.stringify({
|
|
3711
|
+
extends: "../tsconfig.json",
|
|
3712
|
+
compilerOptions: {
|
|
3713
|
+
jsx: framework === "solid" ? "preserve" : "react-jsx",
|
|
3714
|
+
jsxImportSource: framework === "solid" ? "solid-js" : "react"
|
|
3715
|
+
},
|
|
3716
|
+
include: ["src/**/*"]
|
|
3717
|
+
}, null, 2);
|
|
3718
|
+
await writeFile(joinPaths(projectPath, "client", "tsconfig.json"), tsConfig);
|
|
3719
|
+
}
|
|
3720
|
+
});
|
|
3721
|
+
tasks.push({
|
|
3722
|
+
text: "Updating package.json with frontend dependencies and scripts",
|
|
3723
|
+
task: async () => {
|
|
3724
|
+
const newDeps = frontendTemplate.dependencies || {};
|
|
3725
|
+
const newDevDeps = {
|
|
3726
|
+
...frontendTemplate.devDependencies,
|
|
3727
|
+
concurrently: "^8.2.0"
|
|
3728
|
+
};
|
|
3729
|
+
const entryFile = framework === "react" || framework === "solid" ? ".tsx" : ".ts";
|
|
3730
|
+
const newScripts = {
|
|
3731
|
+
"dev:server": "bun run --watch server/main.ts",
|
|
3732
|
+
"dev:client": `bun build client/src/main${entryFile} --watch --outdir ./dist/client 2>&1 | grep -v "invalid @ rule"`,
|
|
3733
|
+
dev: "concurrently 'bun run dev:server' 'bun run dev:client'",
|
|
3734
|
+
"build:client": `bun build client/src/main${entryFile} --outdir ./dist/client --minify 2>&1 | grep -v "invalid @ rule"`
|
|
3735
|
+
};
|
|
3736
|
+
await mergePackageJson(projectPath, newDeps, newDevDeps, newScripts);
|
|
3737
|
+
}
|
|
3738
|
+
});
|
|
3739
|
+
await runTasks(tasks);
|
|
3740
|
+
if (!skipInstall) {
|
|
3741
|
+
cliConsole.subheader("Installing dependencies...");
|
|
3742
|
+
const installSpinner = spinner("Running bun install...");
|
|
3743
|
+
try {
|
|
3744
|
+
const proc = Bun.spawn(["bun", "install"], {
|
|
3745
|
+
cwd: projectPath,
|
|
3746
|
+
stdout: "pipe",
|
|
3747
|
+
stderr: "pipe"
|
|
3748
|
+
});
|
|
3749
|
+
const exitCode = await proc.exited;
|
|
3750
|
+
if (exitCode === 0) {
|
|
3751
|
+
installSpinner.success("Dependencies installed");
|
|
3752
|
+
} else {
|
|
3753
|
+
installSpinner.warn("Failed to install dependencies. Run `bun install` manually.");
|
|
3754
|
+
}
|
|
3755
|
+
} catch {
|
|
3756
|
+
installSpinner.warn("Failed to install dependencies. Run `bun install` manually.");
|
|
3757
|
+
}
|
|
3758
|
+
}
|
|
3759
|
+
cliConsole.log("");
|
|
3760
|
+
const frameworkName = framework.charAt(0).toUpperCase() + framework.slice(1);
|
|
3761
|
+
cliConsole.success(`${colors.cyan(frameworkName)} frontend added successfully!`);
|
|
3762
|
+
cliConsole.log("");
|
|
3763
|
+
cliConsole.log("Next steps:");
|
|
3764
|
+
cliConsole.log(" Terminal 1: bun run dev:server");
|
|
3765
|
+
cliConsole.log(" Terminal 2: bun run dev:client");
|
|
3766
|
+
cliConsole.log("");
|
|
3767
|
+
cliConsole.log(" Or run both together:");
|
|
3768
|
+
cliConsole.log(" bun run dev");
|
|
3769
|
+
cliConsole.log("");
|
|
3770
|
+
}
|
|
3771
|
+
defineCommand({
|
|
3772
|
+
name: "add:frontend",
|
|
3773
|
+
description: "Add a frontend framework to your Bueno project",
|
|
3774
|
+
positionals: [
|
|
3775
|
+
{
|
|
3776
|
+
name: "framework",
|
|
3777
|
+
required: false,
|
|
3778
|
+
description: "Frontend framework (react, vue, svelte, solid)"
|
|
3779
|
+
}
|
|
3780
|
+
],
|
|
3781
|
+
options: [
|
|
3782
|
+
{
|
|
3783
|
+
name: "framework",
|
|
3784
|
+
alias: "f",
|
|
3785
|
+
type: "string",
|
|
3786
|
+
description: "Frontend framework (react, vue, svelte, solid)"
|
|
3787
|
+
},
|
|
3788
|
+
{
|
|
3789
|
+
name: "skip-install",
|
|
3790
|
+
type: "boolean",
|
|
3791
|
+
default: false,
|
|
3792
|
+
description: "Skip dependency installation"
|
|
3793
|
+
},
|
|
3794
|
+
{
|
|
3795
|
+
name: "project-path",
|
|
3796
|
+
type: "string",
|
|
3797
|
+
description: "Path to the Bueno project (internal use)"
|
|
3798
|
+
}
|
|
3799
|
+
],
|
|
3800
|
+
examples: [
|
|
3801
|
+
"bueno add:frontend",
|
|
3802
|
+
"bueno add:frontend react",
|
|
3803
|
+
"bueno add:frontend vue",
|
|
3804
|
+
"bueno add:frontend svelte",
|
|
3805
|
+
"bueno add:frontend solid",
|
|
3806
|
+
"bueno add:frontend react --skip-install"
|
|
3807
|
+
]
|
|
3808
|
+
}, handleAddFrontend);
|
|
3809
|
+
|
|
3492
3810
|
// src/cli/commands/generate.ts
|
|
3811
|
+
init_commands();
|
|
3493
3812
|
var GENERATOR_ALIASES2 = {
|
|
3494
3813
|
c: "controller",
|
|
3495
3814
|
s: "service",
|
|
@@ -3929,6 +4248,7 @@ defineCommand({
|
|
|
3929
4248
|
}, handleGenerate);
|
|
3930
4249
|
|
|
3931
4250
|
// src/cli/commands/migration.ts
|
|
4251
|
+
init_commands();
|
|
3932
4252
|
function generateMigrationId3() {
|
|
3933
4253
|
const now = new Date;
|
|
3934
4254
|
const year = now.getFullYear();
|
|
@@ -4186,6 +4506,7 @@ defineCommand({
|
|
|
4186
4506
|
}, handleMigration);
|
|
4187
4507
|
|
|
4188
4508
|
// src/cli/commands/dev.ts
|
|
4509
|
+
init_commands();
|
|
4189
4510
|
async function findEntryPoint(projectRoot) {
|
|
4190
4511
|
const possibleEntries = [
|
|
4191
4512
|
"server/main.ts",
|
|
@@ -4341,6 +4662,7 @@ defineCommand({
|
|
|
4341
4662
|
}, handleDev);
|
|
4342
4663
|
|
|
4343
4664
|
// src/cli/commands/build.ts
|
|
4665
|
+
init_commands();
|
|
4344
4666
|
async function findEntryPoint2(projectRoot) {
|
|
4345
4667
|
const possibleEntries = [
|
|
4346
4668
|
"server/main.ts",
|
|
@@ -4642,6 +4964,7 @@ defineCommand({
|
|
|
4642
4964
|
}, handleBuild);
|
|
4643
4965
|
|
|
4644
4966
|
// src/cli/commands/start.ts
|
|
4967
|
+
init_commands();
|
|
4645
4968
|
async function findEntryPoint3(projectRoot) {
|
|
4646
4969
|
const possibleBuiltEntries = [
|
|
4647
4970
|
"dist/index.js",
|
|
@@ -4785,6 +5108,8 @@ defineCommand({
|
|
|
4785
5108
|
}, handleStart);
|
|
4786
5109
|
|
|
4787
5110
|
// src/cli/commands/help.ts
|
|
5111
|
+
init_commands();
|
|
5112
|
+
init_commands();
|
|
4788
5113
|
defineCommand({
|
|
4789
5114
|
name: "help",
|
|
4790
5115
|
description: "Show help information for commands",
|
|
@@ -4823,6 +5148,9 @@ Bueno CLI - Available Commands
|
|
|
4823
5148
|
cliConsole.log(generateGlobalHelpText(registry.getAll()));
|
|
4824
5149
|
}
|
|
4825
5150
|
});
|
|
5151
|
+
|
|
5152
|
+
// src/cli/index.ts
|
|
5153
|
+
init_commands();
|
|
4826
5154
|
// src/cli/utils/index.ts
|
|
4827
5155
|
init_version();
|
|
4828
5156
|
|