@warlock.js/core 4.1.15 → 4.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.
- package/CHANGELOG.md +24 -0
- package/LICENSE +21 -0
- package/esm/application/app.d.mts +1 -1
- package/esm/application/app.d.mts.map +1 -1
- package/esm/application/app.mjs +1 -1
- package/esm/application/app.mjs.map +1 -1
- package/esm/application/application-config-types.d.mts +1 -1
- package/esm/application/application-config-types.d.mts.map +1 -1
- package/esm/application/application.d.mts +1 -1
- package/esm/application/application.d.mts.map +1 -1
- package/esm/application/application.mjs +1 -1
- package/esm/application/application.mjs.map +1 -1
- package/esm/benchmark/benchmark-snapshots.d.mts +1 -1
- package/esm/benchmark/benchmark-snapshots.d.mts.map +1 -1
- package/esm/benchmark/benchmark-snapshots.mjs +1 -1
- package/esm/benchmark/benchmark-snapshots.mjs.map +1 -1
- package/esm/benchmark/benchmark.d.mts +1 -1
- package/esm/benchmark/benchmark.d.mts.map +1 -1
- package/esm/benchmark/benchmark.mjs +1 -1
- package/esm/benchmark/benchmark.mjs.map +1 -1
- package/esm/benchmark/channels/console.channel.d.mts +1 -1
- package/esm/benchmark/channels/console.channel.d.mts.map +1 -1
- package/esm/benchmark/channels/console.channel.mjs +1 -1
- package/esm/benchmark/channels/console.channel.mjs.map +1 -1
- package/esm/benchmark/channels/noop.channel.d.mts +1 -1
- package/esm/benchmark/channels/noop.channel.d.mts.map +1 -1
- package/esm/benchmark/channels/noop.channel.mjs +1 -1
- package/esm/benchmark/channels/noop.channel.mjs.map +1 -1
- package/esm/benchmark/profiler.d.mts +1 -1
- package/esm/benchmark/profiler.d.mts.map +1 -1
- package/esm/benchmark/profiler.mjs +1 -1
- package/esm/benchmark/profiler.mjs.map +1 -1
- package/esm/benchmark/types.d.mts +1 -1
- package/esm/benchmark/types.d.mts.map +1 -1
- package/esm/bootstrap/setup.d.mts +1 -1
- package/esm/bootstrap/setup.d.mts.map +1 -1
- package/esm/bootstrap/setup.mjs +1 -1
- package/esm/bootstrap/setup.mjs.map +1 -1
- package/esm/bootstrap.d.mts +1 -1
- package/esm/bootstrap.d.mts.map +1 -1
- package/esm/bootstrap.mjs +1 -1
- package/esm/bootstrap.mjs.map +1 -1
- package/esm/cache/database-cache-driver.d.mts +1 -1
- package/esm/cache/database-cache-driver.d.mts.map +1 -1
- package/esm/cache/database-cache-driver.mjs +1 -1
- package/esm/cache/database-cache-driver.mjs.map +1 -1
- package/esm/cache/index.mjs +1 -1
- package/esm/cache/index.mjs.map +1 -1
- package/esm/cli/cli-command.d.mts +1 -1
- package/esm/cli/cli-command.d.mts.map +1 -1
- package/esm/cli/cli-command.mjs +1 -1
- package/esm/cli/cli-command.mjs.map +1 -1
- package/esm/cli/types.d.mts +1 -1
- package/esm/cli/types.d.mts.map +1 -1
- package/esm/config/config-getter.d.mts +1 -1
- package/esm/config/config-getter.d.mts.map +1 -1
- package/esm/config/config-getter.mjs +6 -6
- package/esm/config/config-getter.mjs.map +1 -1
- package/esm/config/config-handlers.d.mts +1 -1
- package/esm/config/config-handlers.d.mts.map +1 -1
- package/esm/config/config-handlers.mjs +1 -1
- package/esm/config/config-handlers.mjs.map +1 -1
- package/esm/config/config-loader.d.mts +1 -1
- package/esm/config/config-loader.d.mts.map +1 -1
- package/esm/config/config-loader.mjs +3 -3
- package/esm/config/config-loader.mjs.map +1 -1
- package/esm/config/config-manager.mjs +1 -1
- package/esm/config/config-manager.mjs.map +1 -1
- package/esm/config/config-special-handlers.d.mts +1 -1
- package/esm/config/config-special-handlers.d.mts.map +1 -1
- package/esm/config/config-special-handlers.mjs +1 -1
- package/esm/config/config-special-handlers.mjs.map +1 -1
- package/esm/config/load-config-files.mjs +1 -1
- package/esm/config/load-config-files.mjs.map +1 -1
- package/esm/config/types.d.mts +1 -1
- package/esm/config/types.d.mts.map +1 -1
- package/esm/connectors/access-connector.d.mts +39 -0
- package/esm/connectors/access-connector.d.mts.map +1 -0
- package/esm/connectors/access-connector.mjs +54 -0
- package/esm/connectors/access-connector.mjs.map +1 -0
- package/esm/connectors/base-connector.d.mts +1 -1
- package/esm/connectors/base-connector.d.mts.map +1 -1
- package/esm/connectors/base-connector.mjs +1 -1
- package/esm/connectors/base-connector.mjs.map +1 -1
- package/esm/connectors/cache-connector.d.mts +1 -1
- package/esm/connectors/cache-connector.d.mts.map +1 -1
- package/esm/connectors/cache-connector.mjs +3 -3
- package/esm/connectors/cache-connector.mjs.map +1 -1
- package/esm/connectors/connectors-manager.d.mts +1 -1
- package/esm/connectors/connectors-manager.d.mts.map +1 -1
- package/esm/connectors/connectors-manager.mjs +5 -1
- package/esm/connectors/connectors-manager.mjs.map +1 -1
- package/esm/connectors/database-connector.d.mts +1 -1
- package/esm/connectors/database-connector.d.mts.map +1 -1
- package/esm/connectors/database-connector.mjs +3 -3
- package/esm/connectors/database-connector.mjs.map +1 -1
- package/esm/connectors/herald-connector.d.mts +1 -1
- package/esm/connectors/herald-connector.d.mts.map +1 -1
- package/esm/connectors/herald-connector.mjs +4 -4
- package/esm/connectors/herald-connector.mjs.map +1 -1
- package/esm/connectors/http-connector.d.mts +1 -1
- package/esm/connectors/http-connector.d.mts.map +1 -1
- package/esm/connectors/http-connector.mjs +8 -6
- package/esm/connectors/http-connector.mjs.map +1 -1
- package/esm/connectors/index.d.mts +2 -0
- package/esm/connectors/index.mjs +2 -0
- package/esm/connectors/logger-connector.d.mts +1 -1
- package/esm/connectors/logger-connector.d.mts.map +1 -1
- package/esm/connectors/logger-connector.mjs +3 -3
- package/esm/connectors/logger-connector.mjs.map +1 -1
- package/esm/connectors/mail-connector.d.mts +1 -1
- package/esm/connectors/mail-connector.d.mts.map +1 -1
- package/esm/connectors/mail-connector.mjs +3 -3
- package/esm/connectors/mail-connector.mjs.map +1 -1
- package/esm/connectors/notifications-connector.d.mts +38 -0
- package/esm/connectors/notifications-connector.d.mts.map +1 -0
- package/esm/connectors/notifications-connector.mjs +51 -0
- package/esm/connectors/notifications-connector.mjs.map +1 -0
- package/esm/connectors/socket-connector.d.mts +1 -1
- package/esm/connectors/socket-connector.d.mts.map +1 -1
- package/esm/connectors/socket-connector.mjs +4 -4
- package/esm/connectors/socket-connector.mjs.map +1 -1
- package/esm/connectors/storage.connector.d.mts +1 -1
- package/esm/connectors/storage.connector.d.mts.map +1 -1
- package/esm/connectors/storage.connector.mjs +1 -1
- package/esm/connectors/storage.connector.mjs.map +1 -1
- package/esm/connectors/types.d.mts +5 -3
- package/esm/connectors/types.d.mts.map +1 -1
- package/esm/connectors/types.mjs +3 -1
- package/esm/connectors/types.mjs.map +1 -1
- package/esm/container/index.d.mts +1 -1
- package/esm/container/index.d.mts.map +1 -1
- package/esm/container/index.mjs +1 -1
- package/esm/container/index.mjs.map +1 -1
- package/esm/database/models/database-log/database-log.d.mts +1 -1
- package/esm/database/models/database-log/database-log.d.mts.map +1 -1
- package/esm/database/models/database-log/database-log.mjs +1 -1
- package/esm/database/models/database-log/database-log.mjs.map +1 -1
- package/esm/database/seeds/seeder.d.mts +1 -1
- package/esm/database/seeds/seeder.d.mts.map +1 -1
- package/esm/database/seeds/seeder.mjs +1 -1
- package/esm/database/seeds/seeder.mjs.map +1 -1
- package/esm/database/seeds/types.d.mts +1 -1
- package/esm/database/seeds/types.d.mts.map +1 -1
- package/esm/database/utils.d.mts +1 -1
- package/esm/database/utils.d.mts.map +1 -1
- package/esm/database/utils.mjs +1 -1
- package/esm/database/utils.mjs.map +1 -1
- package/esm/dev-server/create-worker.mjs +1 -1
- package/esm/dev-server/create-worker.mjs.map +1 -1
- package/esm/dev-server/dependency-graph.d.mts +1 -1
- package/esm/dev-server/dependency-graph.d.mts.map +1 -1
- package/esm/dev-server/dependency-graph.mjs +1 -1
- package/esm/dev-server/dependency-graph.mjs.map +1 -1
- package/esm/dev-server/dev-logger.mjs +2 -13
- package/esm/dev-server/dev-logger.mjs.map +1 -1
- package/esm/dev-server/events.mjs +1 -1
- package/esm/dev-server/events.mjs.map +1 -1
- package/esm/dev-server/file-event-handler.mjs +1 -1
- package/esm/dev-server/file-event-handler.mjs.map +1 -1
- package/esm/dev-server/file-manager.d.mts +1 -1
- package/esm/dev-server/file-manager.d.mts.map +1 -1
- package/esm/dev-server/file-manager.mjs +1 -1
- package/esm/dev-server/file-manager.mjs.map +1 -1
- package/esm/dev-server/file-operations.d.mts +1 -1
- package/esm/dev-server/file-operations.d.mts.map +1 -1
- package/esm/dev-server/file-operations.mjs +1 -1
- package/esm/dev-server/file-operations.mjs.map +1 -1
- package/esm/dev-server/files-orchestrator.d.mts +1 -1
- package/esm/dev-server/files-orchestrator.d.mts.map +1 -1
- package/esm/dev-server/files-orchestrator.mjs +1 -1
- package/esm/dev-server/files-orchestrator.mjs.map +1 -1
- package/esm/dev-server/files-watcher.d.mts +1 -1
- package/esm/dev-server/files-watcher.d.mts.map +1 -1
- package/esm/dev-server/files-watcher.mjs +1 -1
- package/esm/dev-server/files-watcher.mjs.map +1 -1
- package/esm/dev-server/flags.mjs +1 -1
- package/esm/dev-server/flags.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/base-health-checker.d.mts +1 -1
- package/esm/dev-server/health-checker/checkers/base-health-checker.d.mts.map +1 -1
- package/esm/dev-server/health-checker/checkers/base-health-checker.mjs +1 -1
- package/esm/dev-server/health-checker/checkers/base-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.d.mts +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.d.mts.map +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs +1 -1
- package/esm/dev-server/health-checker/checkers/eslint-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.d.mts +1 -1
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.d.mts.map +1 -1
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs +1 -1
- package/esm/dev-server/health-checker/checkers/typescript-health-checker.mjs.map +1 -1
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts +1 -1
- package/esm/dev-server/health-checker/file-health-checker.contract.d.mts.map +1 -1
- package/esm/dev-server/health-checker/file-health-result.d.mts +1 -1
- package/esm/dev-server/health-checker/file-health-result.d.mts.map +1 -1
- package/esm/dev-server/health-checker/file-health-result.mjs +1 -1
- package/esm/dev-server/health-checker/file-health-result.mjs.map +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.d.mts +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.d.mts.map +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs +1 -1
- package/esm/dev-server/health-checker/files-healthcare.manager.mjs.map +1 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs +1 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.mjs.map +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs +1 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.mjs.map +1 -1
- package/esm/dev-server/loader/build-transpile-init.mjs +1 -1
- package/esm/dev-server/loader/build-transpile-init.mjs.map +1 -1
- package/esm/dev-server/loader/register-loader.mjs +1 -1
- package/esm/dev-server/loader/register-loader.mjs.map +1 -1
- package/esm/dev-server/loader/transpile-cache.mjs +2 -164
- package/esm/dev-server/loader/transpile-cache.mjs.map +1 -1
- package/esm/dev-server/manifest-manager.d.mts +1 -1
- package/esm/dev-server/manifest-manager.d.mts.map +1 -1
- package/esm/dev-server/manifest-manager.mjs +1 -1
- package/esm/dev-server/manifest-manager.mjs.map +1 -1
- package/esm/dev-server/module-loader.d.mts +1 -1
- package/esm/dev-server/module-loader.d.mts.map +1 -1
- package/esm/dev-server/module-loader.mjs +1 -1
- package/esm/dev-server/module-loader.mjs.map +1 -1
- package/esm/dev-server/package-json-manager.mjs +1 -1
- package/esm/dev-server/package-json-manager.mjs.map +1 -1
- package/esm/dev-server/parse-imports.mjs +1 -1
- package/esm/dev-server/parse-imports.mjs.map +1 -1
- package/esm/dev-server/path.mjs +1 -1
- package/esm/dev-server/path.mjs.map +1 -1
- package/esm/dev-server/special-files-collector.d.mts +1 -1
- package/esm/dev-server/special-files-collector.d.mts.map +1 -1
- package/esm/dev-server/special-files-collector.mjs +1 -1
- package/esm/dev-server/special-files-collector.mjs.map +1 -1
- package/esm/dev-server/tsconfig-manager.mjs +1 -1
- package/esm/dev-server/tsconfig-manager.mjs.map +1 -1
- package/esm/dev-server/types.d.mts +1 -1
- package/esm/dev-server/types.d.mts.map +1 -1
- package/esm/dev-server/utils.mjs +1 -1
- package/esm/dev-server/utils.mjs.map +1 -1
- package/esm/encryption/encrypt.d.mts +1 -1
- package/esm/encryption/encrypt.d.mts.map +1 -1
- package/esm/encryption/encrypt.mjs +1 -1
- package/esm/encryption/encrypt.mjs.map +1 -1
- package/esm/encryption/hash.d.mts +1 -1
- package/esm/encryption/hash.d.mts.map +1 -1
- package/esm/encryption/hash.mjs +1 -1
- package/esm/encryption/hash.mjs.map +1 -1
- package/esm/encryption/password.d.mts +1 -1
- package/esm/encryption/password.d.mts.map +1 -1
- package/esm/encryption/password.mjs +1 -1
- package/esm/encryption/password.mjs.map +1 -1
- package/esm/encryption/types.d.mts +1 -1
- package/esm/encryption/types.d.mts.map +1 -1
- package/esm/http/config.d.mts +1 -1
- package/esm/http/config.d.mts.map +1 -1
- package/esm/http/config.mjs +3 -3
- package/esm/http/config.mjs.map +1 -1
- package/esm/http/context/request-context.d.mts +1 -1
- package/esm/http/context/request-context.d.mts.map +1 -1
- package/esm/http/context/request-context.mjs +1 -1
- package/esm/http/context/request-context.mjs.map +1 -1
- package/esm/http/createHttpApplication.d.mts +1 -1
- package/esm/http/createHttpApplication.d.mts.map +1 -1
- package/esm/http/createHttpApplication.mjs +3 -3
- package/esm/http/createHttpApplication.mjs.map +1 -1
- package/esm/http/database/RequestLog.d.mts +1 -1
- package/esm/http/database/RequestLog.d.mts.map +1 -1
- package/esm/http/database/RequestLog.mjs +1 -1
- package/esm/http/database/RequestLog.mjs.map +1 -1
- package/esm/http/error-codes.d.mts +1 -1
- package/esm/http/error-codes.d.mts.map +1 -1
- package/esm/http/error-codes.mjs +1 -1
- package/esm/http/error-codes.mjs.map +1 -1
- package/esm/http/errors/errors.d.mts +1 -1
- package/esm/http/errors/errors.d.mts.map +1 -1
- package/esm/http/errors/errors.mjs +1 -1
- package/esm/http/errors/errors.mjs.map +1 -1
- package/esm/http/events.d.mts +1 -1
- package/esm/http/events.d.mts.map +1 -1
- package/esm/http/events.mjs +1 -1
- package/esm/http/events.mjs.map +1 -1
- package/esm/http/middleware/cache-response-middleware.d.mts +1 -1
- package/esm/http/middleware/cache-response-middleware.d.mts.map +1 -1
- package/esm/http/middleware/cache-response-middleware.mjs +1 -1
- package/esm/http/middleware/cache-response-middleware.mjs.map +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.d.mts +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.mjs +1 -1
- package/esm/http/middleware/concurrency-limit.middleware.mjs.map +1 -1
- package/esm/http/middleware/idempotency.middleware.d.mts +1 -1
- package/esm/http/middleware/idempotency.middleware.d.mts.map +1 -1
- package/esm/http/middleware/idempotency.middleware.mjs +6 -6
- package/esm/http/middleware/idempotency.middleware.mjs.map +1 -1
- package/esm/http/middleware/inject-request-context.d.mts +1 -1
- package/esm/http/middleware/inject-request-context.d.mts.map +1 -1
- package/esm/http/middleware/inject-request-context.mjs +3 -3
- package/esm/http/middleware/inject-request-context.mjs.map +1 -1
- package/esm/http/middleware/ip-filter.middleware.d.mts +1 -1
- package/esm/http/middleware/ip-filter.middleware.d.mts.map +1 -1
- package/esm/http/middleware/ip-filter.middleware.mjs +1 -1
- package/esm/http/middleware/ip-filter.middleware.mjs.map +1 -1
- package/esm/http/middleware/maintenance.middleware.d.mts +1 -1
- package/esm/http/middleware/maintenance.middleware.d.mts.map +1 -1
- package/esm/http/middleware/maintenance.middleware.mjs +5 -5
- package/esm/http/middleware/maintenance.middleware.mjs.map +1 -1
- package/esm/http/middleware/max-body-size.middleware.d.mts +1 -1
- package/esm/http/middleware/max-body-size.middleware.d.mts.map +1 -1
- package/esm/http/middleware/max-body-size.middleware.mjs +1 -1
- package/esm/http/middleware/max-body-size.middleware.mjs.map +1 -1
- package/esm/http/middleware/middleware-list.d.mts +1 -1
- package/esm/http/middleware/middleware-list.d.mts.map +1 -1
- package/esm/http/middleware/middleware-list.mjs +1 -1
- package/esm/http/middleware/middleware-list.mjs.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.d.mts +1 -1
- package/esm/http/middleware/rate-limit.middleware.d.mts.map +1 -1
- package/esm/http/middleware/rate-limit.middleware.mjs +1 -1
- package/esm/http/middleware/rate-limit.middleware.mjs.map +1 -1
- package/esm/http/middleware/utils/cidr-match.d.mts +1 -1
- package/esm/http/middleware/utils/cidr-match.d.mts.map +1 -1
- package/esm/http/middleware/utils/cidr-match.mjs +1 -1
- package/esm/http/middleware/utils/cidr-match.mjs.map +1 -1
- package/esm/http/middleware/utils/idempotency-key.d.mts +1 -1
- package/esm/http/middleware/utils/idempotency-key.d.mts.map +1 -1
- package/esm/http/middleware/utils/idempotency-key.mjs +1 -1
- package/esm/http/middleware/utils/idempotency-key.mjs.map +1 -1
- package/esm/http/middleware/utils/parse-size.d.mts +1 -1
- package/esm/http/middleware/utils/parse-size.d.mts.map +1 -1
- package/esm/http/middleware/utils/parse-size.mjs +1 -1
- package/esm/http/middleware/utils/parse-size.mjs.map +1 -1
- package/esm/http/plugins.d.mts +1 -1
- package/esm/http/plugins.d.mts.map +1 -1
- package/esm/http/plugins.mjs +10 -10
- package/esm/http/plugins.mjs.map +1 -1
- package/esm/http/request-controller.d.mts +1 -1
- package/esm/http/request-controller.d.mts.map +1 -1
- package/esm/http/request-controller.mjs +1 -1
- package/esm/http/request-controller.mjs.map +1 -1
- package/esm/http/request.d.mts +1 -1
- package/esm/http/request.d.mts.map +1 -1
- package/esm/http/request.mjs +1 -1
- package/esm/http/request.mjs.map +1 -1
- package/esm/http/response.d.mts +4 -4
- package/esm/http/response.d.mts.map +1 -1
- package/esm/http/response.mjs +6 -6
- package/esm/http/response.mjs.map +1 -1
- package/esm/http/server.d.mts +1 -1
- package/esm/http/server.d.mts.map +1 -1
- package/esm/http/server.mjs +3 -3
- package/esm/http/server.mjs.map +1 -1
- package/esm/http/types.d.mts +1 -1
- package/esm/http/types.d.mts.map +1 -1
- package/esm/http/uploaded-file.d.mts +1 -1
- package/esm/http/uploaded-file.d.mts.map +1 -1
- package/esm/http/uploaded-file.mjs +1 -1
- package/esm/http/uploaded-file.mjs.map +1 -1
- package/esm/http/uploads-config.d.mts +1 -1
- package/esm/http/uploads-config.d.mts.map +1 -1
- package/esm/http/uploads-config.mjs +1 -1
- package/esm/http/uploads-config.mjs.map +1 -1
- package/esm/http/uploads-types.d.mts +1 -1
- package/esm/http/uploads-types.d.mts.map +1 -1
- package/esm/image/image.d.mts +1 -1
- package/esm/image/image.d.mts.map +1 -1
- package/esm/image/image.mjs +1 -1
- package/esm/image/image.mjs.map +1 -1
- package/esm/index.d.mts +4 -1
- package/esm/index.mjs +5 -1
- package/esm/logger/logger.d.mts +1 -1
- package/esm/logger/logger.d.mts.map +1 -1
- package/esm/logger/logger.mjs +1 -1
- package/esm/logger/logger.mjs.map +1 -1
- package/esm/logger/types.d.mts +1 -1
- package/esm/logger/types.d.mts.map +1 -1
- package/esm/mail/config.d.mts +1 -1
- package/esm/mail/config.d.mts.map +1 -1
- package/esm/mail/config.mjs +1 -1
- package/esm/mail/config.mjs.map +1 -1
- package/esm/mail/events.d.mts +1 -1
- package/esm/mail/events.d.mts.map +1 -1
- package/esm/mail/events.mjs +1 -1
- package/esm/mail/events.mjs.map +1 -1
- package/esm/mail/mail.d.mts +1 -1
- package/esm/mail/mail.d.mts.map +1 -1
- package/esm/mail/mail.mjs +1 -1
- package/esm/mail/mail.mjs.map +1 -1
- package/esm/mail/mailer-pool.d.mts +1 -1
- package/esm/mail/mailer-pool.d.mts.map +1 -1
- package/esm/mail/mailer-pool.mjs +1 -1
- package/esm/mail/mailer-pool.mjs.map +1 -1
- package/esm/mail/react-mail.d.mts +1 -1
- package/esm/mail/react-mail.d.mts.map +1 -1
- package/esm/mail/react-mail.mjs +1 -1
- package/esm/mail/react-mail.mjs.map +1 -1
- package/esm/mail/send-mail.d.mts +1 -1
- package/esm/mail/send-mail.d.mts.map +1 -1
- package/esm/mail/send-mail.mjs +1 -1
- package/esm/mail/send-mail.mjs.map +1 -1
- package/esm/mail/test-mailbox.d.mts +1 -1
- package/esm/mail/test-mailbox.d.mts.map +1 -1
- package/esm/mail/test-mailbox.mjs +1 -1
- package/esm/mail/test-mailbox.mjs.map +1 -1
- package/esm/mail/types.d.mts +1 -1
- package/esm/mail/types.d.mts.map +1 -1
- package/esm/mail/types.mjs +1 -1
- package/esm/mail/types.mjs.map +1 -1
- package/esm/react/index.d.mts +1 -1
- package/esm/react/index.d.mts.map +1 -1
- package/esm/react/index.mjs +1 -1
- package/esm/react/index.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.mjs +1 -1
- package/esm/repositories/adapters/cascade/cascade-adapter.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.d.mts.map +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.mjs +1 -1
- package/esm/repositories/adapters/cascade/cascade-query-builder.mjs.map +1 -1
- package/esm/repositories/adapters/cascade/filter-applicator.mjs +1 -1
- package/esm/repositories/adapters/cascade/filter-applicator.mjs.map +1 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts +1 -1
- package/esm/repositories/contracts/query-builder.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/repository-adapter.contract.d.mts +1 -1
- package/esm/repositories/contracts/repository-adapter.contract.d.mts.map +1 -1
- package/esm/repositories/contracts/types.d.mts +1 -1
- package/esm/repositories/contracts/types.d.mts.map +1 -1
- package/esm/repositories/repository.manager.d.mts +1 -1
- package/esm/repositories/repository.manager.d.mts.map +1 -1
- package/esm/repositories/repository.manager.mjs +1 -1
- package/esm/repositories/repository.manager.mjs.map +1 -1
- package/esm/resource/define-resource.d.mts +1 -1
- package/esm/resource/define-resource.d.mts.map +1 -1
- package/esm/resource/define-resource.mjs +1 -1
- package/esm/resource/define-resource.mjs.map +1 -1
- package/esm/resource/register-resource.d.mts +1 -1
- package/esm/resource/register-resource.d.mts.map +1 -1
- package/esm/resource/register-resource.mjs +1 -1
- package/esm/resource/register-resource.mjs.map +1 -1
- package/esm/resource/resource-field-builder.d.mts +1 -1
- package/esm/resource/resource-field-builder.d.mts.map +1 -1
- package/esm/resource/resource-field-builder.mjs +1 -1
- package/esm/resource/resource-field-builder.mjs.map +1 -1
- package/esm/resource/resource.d.mts +1 -1
- package/esm/resource/resource.d.mts.map +1 -1
- package/esm/resource/resource.mjs +1 -1
- package/esm/resource/resource.mjs.map +1 -1
- package/esm/resource/types.d.mts +1 -1
- package/esm/resource/types.d.mts.map +1 -1
- package/esm/restful/restful.d.mts +1 -1
- package/esm/restful/restful.d.mts.map +1 -1
- package/esm/restful/restful.mjs +1 -1
- package/esm/restful/restful.mjs.map +1 -1
- package/esm/router/route-builder.d.mts +1 -1
- package/esm/router/route-builder.d.mts.map +1 -1
- package/esm/router/route-builder.mjs +1 -1
- package/esm/router/route-builder.mjs.map +1 -1
- package/esm/router/route-registry.mjs +1 -1
- package/esm/router/route-registry.mjs.map +1 -1
- package/esm/router/router.d.mts +1 -1
- package/esm/router/router.d.mts.map +1 -1
- package/esm/router/router.mjs +1 -1
- package/esm/router/router.mjs.map +1 -1
- package/esm/router/types.d.mts +1 -1
- package/esm/router/types.d.mts.map +1 -1
- package/esm/socket/types.d.mts +1 -1
- package/esm/socket/types.d.mts.map +1 -1
- package/esm/socket/utils.d.mts +1 -1
- package/esm/socket/utils.d.mts.map +1 -1
- package/esm/socket/utils.mjs +1 -1
- package/esm/socket/utils.mjs.map +1 -1
- package/esm/storage/config.d.mts +1 -1
- package/esm/storage/config.d.mts.map +1 -1
- package/esm/storage/config.mjs +1 -1
- package/esm/storage/config.mjs.map +1 -1
- package/esm/storage/context/storage-driver-context.d.mts +1 -1
- package/esm/storage/context/storage-driver-context.d.mts.map +1 -1
- package/esm/storage/context/storage-driver-context.mjs +1 -1
- package/esm/storage/context/storage-driver-context.mjs.map +1 -1
- package/esm/storage/drivers/cloud-driver.d.mts +1 -1
- package/esm/storage/drivers/cloud-driver.d.mts.map +1 -1
- package/esm/storage/drivers/cloud-driver.mjs +1 -1
- package/esm/storage/drivers/cloud-driver.mjs.map +1 -1
- package/esm/storage/drivers/do-spaces-driver.d.mts +1 -1
- package/esm/storage/drivers/do-spaces-driver.d.mts.map +1 -1
- package/esm/storage/drivers/do-spaces-driver.mjs +1 -1
- package/esm/storage/drivers/do-spaces-driver.mjs.map +1 -1
- package/esm/storage/drivers/local-driver.d.mts +1 -1
- package/esm/storage/drivers/local-driver.d.mts.map +1 -1
- package/esm/storage/drivers/local-driver.mjs +1 -1
- package/esm/storage/drivers/local-driver.mjs.map +1 -1
- package/esm/storage/drivers/r2-driver.d.mts +1 -1
- package/esm/storage/drivers/r2-driver.d.mts.map +1 -1
- package/esm/storage/drivers/r2-driver.mjs +1 -1
- package/esm/storage/drivers/r2-driver.mjs.map +1 -1
- package/esm/storage/drivers/s3-driver.d.mts +1 -1
- package/esm/storage/drivers/s3-driver.d.mts.map +1 -1
- package/esm/storage/drivers/s3-driver.mjs +1 -1
- package/esm/storage/drivers/s3-driver.mjs.map +1 -1
- package/esm/storage/scoped-storage.d.mts +1 -1
- package/esm/storage/scoped-storage.d.mts.map +1 -1
- package/esm/storage/scoped-storage.mjs +1 -1
- package/esm/storage/scoped-storage.mjs.map +1 -1
- package/esm/storage/storage-file.d.mts +1 -1
- package/esm/storage/storage-file.d.mts.map +1 -1
- package/esm/storage/storage-file.mjs +1 -1
- package/esm/storage/storage-file.mjs.map +1 -1
- package/esm/storage/storage.d.mts +1 -1
- package/esm/storage/storage.d.mts.map +1 -1
- package/esm/storage/storage.mjs +1 -1
- package/esm/storage/storage.mjs.map +1 -1
- package/esm/storage/types.d.mts +1 -1
- package/esm/storage/types.d.mts.map +1 -1
- package/esm/storage/utils/mime.d.mts +1 -1
- package/esm/storage/utils/mime.d.mts.map +1 -1
- package/esm/storage/utils/mime.mjs +1 -1
- package/esm/storage/utils/mime.mjs.map +1 -1
- package/esm/tests/start-http-development-server.d.mts +1 -1
- package/esm/tests/start-http-development-server.d.mts.map +1 -1
- package/esm/tests/start-http-development-server.mjs +4 -2
- package/esm/tests/start-http-development-server.mjs.map +1 -1
- package/esm/tests/test-helpers.d.mts +1 -1
- package/esm/tests/test-helpers.d.mts.map +1 -1
- package/esm/tests/test-helpers.mjs +1 -1
- package/esm/tests/test-helpers.mjs.map +1 -1
- package/esm/tests/vitest-setup.d.mts +1 -1
- package/esm/tests/vitest-setup.d.mts.map +1 -1
- package/esm/tests/vitest-setup.mjs +1 -1
- package/esm/tests/vitest-setup.mjs.map +1 -1
- package/esm/use-cases/types.d.mts +1 -1
- package/esm/use-cases/types.d.mts.map +1 -1
- package/esm/use-cases/use-case-broadcast.d.mts +1 -1
- package/esm/use-cases/use-case-broadcast.d.mts.map +1 -1
- package/esm/use-cases/use-case-broadcast.mjs +1 -1
- package/esm/use-cases/use-case-broadcast.mjs.map +1 -1
- package/esm/use-cases/use-case-events.d.mts +1 -1
- package/esm/use-cases/use-case-events.d.mts.map +1 -1
- package/esm/use-cases/use-case-events.mjs +1 -1
- package/esm/use-cases/use-case-events.mjs.map +1 -1
- package/esm/use-cases/use-case-pipeline.d.mts +1 -1
- package/esm/use-cases/use-case-pipeline.d.mts.map +1 -1
- package/esm/use-cases/use-case-pipeline.mjs +1 -1
- package/esm/use-cases/use-case-pipeline.mjs.map +1 -1
- package/esm/use-cases/use-case.d.mts +1 -1
- package/esm/use-cases/use-case.d.mts.map +1 -1
- package/esm/use-cases/use-case.errors.d.mts +1 -1
- package/esm/use-cases/use-case.errors.d.mts.map +1 -1
- package/esm/use-cases/use-case.errors.mjs +1 -1
- package/esm/use-cases/use-case.errors.mjs.map +1 -1
- package/esm/use-cases/use-case.mjs +1 -1
- package/esm/use-cases/use-case.mjs.map +1 -1
- package/esm/use-cases/use-cases-registry.d.mts +1 -1
- package/esm/use-cases/use-cases-registry.d.mts.map +1 -1
- package/esm/use-cases/use-cases-registry.mjs +1 -1
- package/esm/use-cases/use-cases-registry.mjs.map +1 -1
- package/esm/utils/app-log.d.mts +1 -1
- package/esm/utils/app-log.d.mts.map +1 -1
- package/esm/utils/app-log.mjs +1 -1
- package/esm/utils/app-log.mjs.map +1 -1
- package/esm/utils/database-log.d.mts +1 -1
- package/esm/utils/database-log.d.mts.map +1 -1
- package/esm/utils/database-log.mjs +1 -1
- package/esm/utils/database-log.mjs.map +1 -1
- package/esm/utils/environment.d.mts +1 -1
- package/esm/utils/environment.d.mts.map +1 -1
- package/esm/utils/environment.mjs +1 -1
- package/esm/utils/environment.mjs.map +1 -1
- package/esm/utils/framework-vesion.mjs +2 -11
- package/esm/utils/framework-vesion.mjs.map +1 -1
- package/esm/utils/get-localized.d.mts +1 -1
- package/esm/utils/get-localized.d.mts.map +1 -1
- package/esm/utils/get-localized.mjs +1 -1
- package/esm/utils/get-localized.mjs.map +1 -1
- package/esm/utils/paths.d.mts +1 -1
- package/esm/utils/paths.d.mts.map +1 -1
- package/esm/utils/paths.mjs +3 -3
- package/esm/utils/paths.mjs.map +1 -1
- package/esm/utils/promise-all-object.d.mts +1 -1
- package/esm/utils/promise-all-object.d.mts.map +1 -1
- package/esm/utils/promise-all-object.mjs +1 -1
- package/esm/utils/promise-all-object.mjs.map +1 -1
- package/esm/utils/queue.d.mts +1 -1
- package/esm/utils/queue.d.mts.map +1 -1
- package/esm/utils/queue.mjs +1 -1
- package/esm/utils/queue.mjs.map +1 -1
- package/esm/utils/sleep.d.mts +1 -1
- package/esm/utils/sleep.d.mts.map +1 -1
- package/esm/utils/sleep.mjs +1 -1
- package/esm/utils/sleep.mjs.map +1 -1
- package/esm/utils/sluggable.d.mts +1 -1
- package/esm/utils/sluggable.d.mts.map +1 -1
- package/esm/utils/sluggable.mjs +1 -1
- package/esm/utils/sluggable.mjs.map +1 -1
- package/esm/utils/to-json.d.mts +1 -1
- package/esm/utils/to-json.d.mts.map +1 -1
- package/esm/utils/to-json.mjs +1 -1
- package/esm/utils/to-json.mjs.map +1 -1
- package/esm/utils/types.d.mts +1 -1
- package/esm/utils/types.d.mts.map +1 -1
- package/esm/utils/urls.d.mts +1 -1
- package/esm/utils/urls.d.mts.map +1 -1
- package/esm/utils/urls.mjs +1 -1
- package/esm/utils/urls.mjs.map +1 -1
- package/esm/validation/database/exists-except-current-id.d.mts +1 -1
- package/esm/validation/database/exists-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-id.mjs +1 -1
- package/esm/validation/database/exists-except-current-id.mjs.map +1 -1
- package/esm/validation/database/exists-except-current-user.d.mts +1 -1
- package/esm/validation/database/exists-except-current-user.d.mts.map +1 -1
- package/esm/validation/database/exists-except-current-user.mjs +1 -1
- package/esm/validation/database/exists-except-current-user.mjs.map +1 -1
- package/esm/validation/database/types.d.mts +1 -1
- package/esm/validation/database/types.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-id.d.mts +1 -1
- package/esm/validation/database/unique-except-current-id.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-id.mjs +1 -1
- package/esm/validation/database/unique-except-current-id.mjs.map +1 -1
- package/esm/validation/database/unique-except-current-user.d.mts +1 -1
- package/esm/validation/database/unique-except-current-user.d.mts.map +1 -1
- package/esm/validation/database/unique-except-current-user.mjs +1 -1
- package/esm/validation/database/unique-except-current-user.mjs.map +1 -1
- package/esm/validation/file/file.d.mts +1 -1
- package/esm/validation/file/file.d.mts.map +1 -1
- package/esm/validation/file/file.mjs +1 -1
- package/esm/validation/file/file.mjs.map +1 -1
- package/esm/validation/init.mjs +1 -1
- package/esm/validation/init.mjs.map +1 -1
- package/esm/validation/plugins/database-plugin.mjs +1 -1
- package/esm/validation/plugins/database-plugin.mjs.map +1 -1
- package/esm/validation/plugins/file-plugin.mjs +1 -1
- package/esm/validation/plugins/file-plugin.mjs.map +1 -1
- package/esm/validation/plugins/localized-plugin.mjs +1 -1
- package/esm/validation/plugins/localized-plugin.mjs.map +1 -1
- package/esm/validation/types.d.mts +1 -1
- package/esm/validation/types.d.mts.map +1 -1
- package/esm/validation/validateAll.mjs +3 -3
- package/esm/validation/validateAll.mjs.map +1 -1
- package/esm/validation/validators/file-validator.d.mts +1 -1
- package/esm/validation/validators/file-validator.d.mts.map +1 -1
- package/esm/validation/validators/file-validator.mjs +1 -1
- package/esm/validation/validators/file-validator.mjs.map +1 -1
- package/esm/vite/index.mjs +3 -0
- package/esm/vite/lower-stage3-decorators.d.mts +53 -0
- package/esm/vite/lower-stage3-decorators.d.mts.map +1 -0
- package/esm/vite/lower-stage3-decorators.mjs +63 -0
- package/esm/vite/lower-stage3-decorators.mjs.map +1 -0
- package/esm/warlock-config/default-configurations.mjs +1 -1
- package/esm/warlock-config/default-configurations.mjs.map +1 -1
- package/esm/warlock-config/define-config.d.mts +1 -1
- package/esm/warlock-config/define-config.d.mts.map +1 -1
- package/esm/warlock-config/define-config.mjs +1 -1
- package/esm/warlock-config/define-config.mjs.map +1 -1
- package/esm/warlock-config/types.d.mts +1 -1
- package/esm/warlock-config/types.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.d.mts +1 -1
- package/esm/warlock-config/warlock-config.manager.d.mts.map +1 -1
- package/esm/warlock-config/warlock-config.manager.mjs +1 -1
- package/esm/warlock-config/warlock-config.manager.mjs.map +1 -1
- package/llms-full.txt +64 -4
- package/llms.txt +1 -0
- package/package.json +9 -33
- package/skills/lower-stage3-decorators/SKILL.md +54 -0
- package/skills/test-http/SKILL.md +3 -2
- package/skills/test-service/SKILL.md +3 -2
- package/bin/warlock.js +0 -3
- package/esm/_virtual/_rolldown/runtime.mjs +0 -7
- package/esm/cli/cli-commands.manager.mjs +0 -290
- package/esm/cli/cli-commands.manager.mjs.map +0 -1
- package/esm/cli/cli-commands.utils.mjs +0 -217
- package/esm/cli/cli-commands.utils.mjs.map +0 -1
- package/esm/cli/commands/add.command.mjs +0 -27
- package/esm/cli/commands/add.command.mjs.map +0 -1
- package/esm/cli/commands/build.command.mjs +0 -14
- package/esm/cli/commands/build.command.mjs.map +0 -1
- package/esm/cli/commands/create-database.command.mjs +0 -24
- package/esm/cli/commands/create-database.command.mjs.map +0 -1
- package/esm/cli/commands/dev-server.command.mjs +0 -48
- package/esm/cli/commands/dev-server.command.mjs.map +0 -1
- package/esm/cli/commands/drop-tables.command.mjs +0 -23
- package/esm/cli/commands/drop-tables.command.mjs.map +0 -1
- package/esm/cli/commands/generate/generate.command.mjs +0 -201
- package/esm/cli/commands/generate/generate.command.mjs.map +0 -1
- package/esm/cli/commands/generate/generators/column-dsl-parser.mjs +0 -49
- package/esm/cli/commands/generate/generators/column-dsl-parser.mjs.map +0 -1
- package/esm/cli/commands/generate/generators/controller.generator.mjs +0 -48
- package/esm/cli/commands/generate/generators/controller.generator.mjs.map +0 -1
- package/esm/cli/commands/generate/generators/migration.generator.mjs +0 -81
- package/esm/cli/commands/generate/generators/migration.generator.mjs.map +0 -1
- package/esm/cli/commands/generate/generators/model.generator.mjs +0 -60
- package/esm/cli/commands/generate/generators/model.generator.mjs.map +0 -1
- package/esm/cli/commands/generate/generators/module.generator.mjs +0 -113
- package/esm/cli/commands/generate/generators/module.generator.mjs.map +0 -1
- package/esm/cli/commands/generate/generators/repository.generator.mjs +0 -42
- package/esm/cli/commands/generate/generators/repository.generator.mjs.map +0 -1
- package/esm/cli/commands/generate/generators/resource.generator.mjs +0 -42
- package/esm/cli/commands/generate/generators/resource.generator.mjs.map +0 -1
- package/esm/cli/commands/generate/generators/service.generator.mjs +0 -42
- package/esm/cli/commands/generate/generators/service.generator.mjs.map +0 -1
- package/esm/cli/commands/generate/templates/stubs.mjs +0 -514
- package/esm/cli/commands/generate/templates/stubs.mjs.map +0 -1
- package/esm/cli/commands/generate/utils/name-parser.mjs +0 -69
- package/esm/cli/commands/generate/utils/name-parser.mjs.map +0 -1
- package/esm/cli/commands/generate/utils/path-resolver.mjs +0 -56
- package/esm/cli/commands/generate/utils/path-resolver.mjs.map +0 -1
- package/esm/cli/commands/generate/utils/prompt.mjs +0 -28
- package/esm/cli/commands/generate/utils/prompt.mjs.map +0 -1
- package/esm/cli/commands/generate/utils/writer.mjs +0 -60
- package/esm/cli/commands/generate/utils/writer.mjs.map +0 -1
- package/esm/cli/commands/migrate.command.mjs +0 -60
- package/esm/cli/commands/migrate.command.mjs.map +0 -1
- package/esm/cli/commands/seed.command.mjs +0 -41
- package/esm/cli/commands/seed.command.mjs.map +0 -1
- package/esm/cli/commands/start-production.command.mjs +0 -50
- package/esm/cli/commands/start-production.command.mjs.map +0 -1
- package/esm/cli/commands/storage-put.action.mjs +0 -75
- package/esm/cli/commands/storage-put.action.mjs.map +0 -1
- package/esm/cli/commands/storage-put.command.mjs +0 -46
- package/esm/cli/commands/storage-put.command.mjs.map +0 -1
- package/esm/cli/commands/typings-generator.command.mjs +0 -38
- package/esm/cli/commands/typings-generator.command.mjs.map +0 -1
- package/esm/cli/commands-loader.mjs +0 -50
- package/esm/cli/commands-loader.mjs.map +0 -1
- package/esm/cli/framework-cli-commands.mjs +0 -37
- package/esm/cli/framework-cli-commands.mjs.map +0 -1
- package/esm/cli/parse-cli-args.mjs +0 -62
- package/esm/cli/parse-cli-args.mjs.map +0 -1
- package/esm/cli/start.d.mts +0 -1
- package/esm/cli/start.mjs +0 -8
- package/esm/cli/start.mjs.map +0 -1
- package/esm/cli/string-similarity.mjs +0 -56
- package/esm/cli/string-similarity.mjs.map +0 -1
- package/esm/database/create-database-action.mjs +0 -32
- package/esm/database/create-database-action.mjs.map +0 -1
- package/esm/database/drop-tables-action.mjs +0 -35
- package/esm/database/drop-tables-action.mjs.map +0 -1
- package/esm/database/migrate-action.mjs +0 -99
- package/esm/database/migrate-action.mjs.map +0 -1
- package/esm/database/seed-command-action.mjs +0 -74
- package/esm/database/seed-command-action.mjs.map +0 -1
- package/esm/database/seeds/seeders.manager.mjs +0 -129
- package/esm/database/seeds/seeders.manager.mjs.map +0 -1
- package/esm/database/seeds/seeds-table-migration.mjs +0 -31
- package/esm/database/seeds/seeds-table-migration.mjs.map +0 -1
- package/esm/database/seeds/utils.mjs +0 -6
- package/esm/database/seeds/utils.mjs.map +0 -1
- package/esm/dev-server/development-server.mjs +0 -115
- package/esm/dev-server/development-server.mjs.map +0 -1
- package/esm/dev-server/health-checker/workers/eslint-health.worker.d.mts +0 -1
- package/esm/dev-server/health-checker/workers/ts-health.worker.d.mts +0 -1
- package/esm/dev-server/layer-executor.mjs +0 -114
- package/esm/dev-server/layer-executor.mjs.map +0 -1
- package/esm/dev-server/loader/hook-thread.d.mts +0 -48
- package/esm/dev-server/loader/hook-thread.d.mts.map +0 -1
- package/esm/dev-server/loader/hook-thread.mjs +0 -47
- package/esm/dev-server/loader/hook-thread.mjs.map +0 -1
- package/esm/dev-server/loader/load-hook.d.mts +0 -58
- package/esm/dev-server/loader/load-hook.d.mts.map +0 -1
- package/esm/dev-server/loader/load-hook.mjs +0 -86
- package/esm/dev-server/loader/load-hook.mjs.map +0 -1
- package/esm/dev-server/loader/own-resolver.mjs +0 -69
- package/esm/dev-server/loader/own-resolver.mjs.map +0 -1
- package/esm/dev-server/loader/resolve-capture.mjs +0 -43
- package/esm/dev-server/loader/resolve-capture.mjs.map +0 -1
- package/esm/dev-server/loader/resolve-hook.d.mts +0 -41
- package/esm/dev-server/loader/resolve-hook.d.mts.map +0 -1
- package/esm/dev-server/loader/resolve-hook.mjs +0 -87
- package/esm/dev-server/loader/resolve-hook.mjs.map +0 -1
- package/esm/dev-server/loader/source-slug.mjs +0 -22
- package/esm/dev-server/loader/source-slug.mjs.map +0 -1
- package/esm/dev-server/loader/version-registry.mjs +0 -45
- package/esm/dev-server/loader/version-registry.mjs.map +0 -1
- package/esm/dev-server/start-development-server.mjs +0 -63
- package/esm/dev-server/start-development-server.mjs.map +0 -1
- package/esm/dev-server/type-generator.mjs +0 -453
- package/esm/dev-server/type-generator.mjs.map +0 -1
- package/esm/generations/add-command.action.mjs +0 -376
- package/esm/generations/add-command.action.mjs.map +0 -1
- package/esm/generations/stubs.mjs +0 -103
- package/esm/generations/stubs.mjs.map +0 -1
- package/esm/manifest/manifest-manager.mjs +0 -79
- package/esm/manifest/manifest-manager.mjs.map +0 -1
- package/esm/production/build-app-production.mjs +0 -14
- package/esm/production/build-app-production.mjs.map +0 -1
- package/esm/production/esbuild-plugins.mjs +0 -37
- package/esm/production/esbuild-plugins.mjs.map +0 -1
- package/esm/production/production-builder.mjs +0 -264
- package/esm/production/production-builder.mjs.map +0 -1
- package/esm/production/resolve-build-config.mjs +0 -28
- package/esm/production/resolve-build-config.mjs.map +0 -1
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
//#region ../../@warlock.js/core/src/cli/commands/generate/generators/column-dsl-parser.ts
|
|
2
|
-
const typeMapping = {
|
|
3
|
-
text: "text",
|
|
4
|
-
string: "string",
|
|
5
|
-
integer: "integer",
|
|
6
|
-
int: "integer",
|
|
7
|
-
bigInteger: "bigInteger",
|
|
8
|
-
bigInt: "bigInteger",
|
|
9
|
-
boolean: "boolCol",
|
|
10
|
-
bool: "boolCol",
|
|
11
|
-
uuid: "uuid",
|
|
12
|
-
timestamp: "timestamp",
|
|
13
|
-
date: "date",
|
|
14
|
-
json: "json",
|
|
15
|
-
object: "objectCol",
|
|
16
|
-
decimal: "decimal",
|
|
17
|
-
float: "float",
|
|
18
|
-
enum: "enumCol",
|
|
19
|
-
set: "setCol",
|
|
20
|
-
blob: "blobCol",
|
|
21
|
-
binary: "blobCol"
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Parses a subset DSL for column schemas:
|
|
25
|
-
* "phone:text:nullable,price:decimal:notNullable:unsigned"
|
|
26
|
-
*/
|
|
27
|
-
function parseColumnDsl(input) {
|
|
28
|
-
if (!input) return [];
|
|
29
|
-
return input.split(",").map((c) => c.trim()).filter(Boolean).map((colStr) => {
|
|
30
|
-
const parts = colStr.split(":").map((p) => p.trim());
|
|
31
|
-
const name = parts[0];
|
|
32
|
-
const rawType = parts[1] || "string";
|
|
33
|
-
const helper = typeMapping[rawType] || rawType;
|
|
34
|
-
const modifiers = [];
|
|
35
|
-
for (let i = 2; i < parts.length; i++) {
|
|
36
|
-
let modifier = parts[i];
|
|
37
|
-
modifiers.push(`.${modifier}()`);
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
name,
|
|
41
|
-
helper,
|
|
42
|
-
modifiers
|
|
43
|
-
};
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
//#endregion
|
|
48
|
-
export { parseColumnDsl };
|
|
49
|
-
//# sourceMappingURL=column-dsl-parser.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"column-dsl-parser.mjs","names":[],"sources":["../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generators/column-dsl-parser.ts"],"sourcesContent":["export type ParsedColumn = {\n name: string;\n helper: string; // e.g. \"text\", \"boolCol\", \"decimal\"\n modifiers: string[]; // e.g. [\".nullable()\", \".unsigned()\"]\n};\n\nconst typeMapping: Record<string, string> = {\n text: \"text\",\n string: \"string\",\n integer: \"integer\",\n int: \"integer\",\n bigInteger: \"bigInteger\",\n bigInt: \"bigInteger\",\n boolean: \"boolCol\",\n bool: \"boolCol\",\n uuid: \"uuid\",\n timestamp: \"timestamp\",\n date: \"date\",\n json: \"json\",\n object: \"objectCol\",\n decimal: \"decimal\",\n float: \"float\",\n enum: \"enumCol\",\n set: \"setCol\",\n blob: \"blobCol\",\n binary: \"blobCol\",\n};\n\n/**\n * Parses a subset DSL for column schemas:\n * \"phone:text:nullable,price:decimal:notNullable:unsigned\"\n */\nexport function parseColumnDsl(input: string): ParsedColumn[] {\n if (!input) return [];\n\n const columns = input.split(\",\").map((c) => c.trim()).filter(Boolean);\n \n return columns.map((colStr) => {\n const parts = colStr.split(\":\").map((p) => p.trim());\n const name = parts[0];\n const rawType = parts[1] || \"string\";\n const helper = typeMapping[rawType] || rawType; // fallback to raw string if not mapped\n\n const modifiers: string[] = [];\n for (let i = 2; i < parts.length; i++) {\n let modifier = parts[i];\n // Basic modifiers that translates to builder calls\n modifiers.push(`.${modifier}()`);\n }\n\n return {\n name,\n helper,\n modifiers,\n };\n });\n}\n"],"mappings":";AAMA,MAAM,cAAsC;CAC1C,MAAM;CACN,QAAQ;CACR,SAAS;CACT,KAAK;CACL,YAAY;CACZ,QAAQ;CACR,SAAS;CACT,MAAM;CACN,MAAM;CACN,WAAW;CACX,MAAM;CACN,MAAM;CACN,QAAQ;CACR,SAAS;CACT,OAAO;CACP,MAAM;CACN,KAAK;CACL,MAAM;CACN,QAAQ;AACV;;;;;AAMA,SAAgB,eAAe,OAA+B;CAC5D,IAAI,CAAC,OAAO,OAAO,CAAC;CAIpB,OAFgB,MAAM,MAAM,GAAG,EAAE,KAAK,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,OAEhD,EAAE,KAAK,WAAW;EAC7B,MAAM,QAAQ,OAAO,MAAM,GAAG,EAAE,KAAK,MAAM,EAAE,KAAK,CAAC;EACnD,MAAM,OAAO,MAAM;EACnB,MAAM,UAAU,MAAM,MAAM;EAC5B,MAAM,SAAS,YAAY,YAAY;EAEvC,MAAM,YAAsB,CAAC;EAC7B,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;GACrC,IAAI,WAAW,MAAM;GAErB,UAAU,KAAK,IAAI,SAAS,GAAG;EACjC;EAEA,OAAO;GACL;GACA;GACA;EACF;CACF,CAAC;AACH"}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { controllerStub, schemaStub } from "../templates/stubs.mjs";
|
|
2
|
-
import { parseModulePath, parseName } from "../utils/name-parser.mjs";
|
|
3
|
-
import { putFileAsync, setDryRun } from "../utils/writer.mjs";
|
|
4
|
-
import { componentExists, ensureComponentDirectory, moduleExists, resolveComponentPath } from "../utils/path-resolver.mjs";
|
|
5
|
-
import { colors } from "@mongez/copper";
|
|
6
|
-
|
|
7
|
-
//#region ../../@warlock.js/core/src/cli/commands/generate/generators/controller.generator.ts
|
|
8
|
-
async function generateController(data) {
|
|
9
|
-
const input = data.args[0];
|
|
10
|
-
if (!input) {
|
|
11
|
-
console.log(colors.red("Error: Controller name is required"));
|
|
12
|
-
console.log(colors.yellow("Usage: warlock create.controller <module>/<name>"));
|
|
13
|
-
console.log(colors.yellow("Example: warlock create.controller users/create-user"));
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
const { module, name: componentName } = parseModulePath(input);
|
|
17
|
-
if (!module) {
|
|
18
|
-
console.log(colors.red("Error: Module name is required"));
|
|
19
|
-
console.log(colors.yellow("Usage: warlock create.controller <module>/<name>"));
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
if (!await moduleExists(module)) {
|
|
23
|
-
console.log(colors.red(`Error: Module "${module}" does not exist`));
|
|
24
|
-
console.log(colors.yellow(`Run: warlock create.module ${module}`));
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
const name = parseName(componentName);
|
|
28
|
-
const withValidation = data.options.withValidation || data.options.v;
|
|
29
|
-
const force = data.options.force || data.options.f;
|
|
30
|
-
setDryRun(Boolean(data.options.dryRun));
|
|
31
|
-
const controllerPath = resolveComponentPath(module, "controllers", `${name.kebab}.controller`);
|
|
32
|
-
if (await componentExists(module, "controllers", `${name.kebab}.controller`) && !force) {
|
|
33
|
-
console.log(colors.red(`Error: Controller "${name.kebab}.controller.ts" already exists`));
|
|
34
|
-
console.log(colors.yellow("Use --force to overwrite"));
|
|
35
|
-
process.exit(1);
|
|
36
|
-
}
|
|
37
|
-
await ensureComponentDirectory(module, "controllers");
|
|
38
|
-
await putFileAsync(controllerPath, controllerStub(name, { withValidation: !!withValidation }));
|
|
39
|
-
if (withValidation) {
|
|
40
|
-
await ensureComponentDirectory(module, "schema");
|
|
41
|
-
await putFileAsync(resolveComponentPath(module, "schema", `${name.kebab}.schema`), schemaStub(name));
|
|
42
|
-
}
|
|
43
|
-
console.log(colors.cyan(`\n✨ Controller "${name.camel}" generated successfully!`));
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
//#endregion
|
|
47
|
-
export { generateController };
|
|
48
|
-
//# sourceMappingURL=controller.generator.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"controller.generator.mjs","names":[],"sources":["../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generators/controller.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { controllerStub, schemaStub } from \"../templates/stubs\";\r\nimport { parseModulePath, parseName } from \"../utils/name-parser\";\r\nimport {\r\n componentExists,\r\n ensureComponentDirectory,\r\n moduleExists,\r\n resolveComponentPath,\r\n} from \"../utils/path-resolver\";\r\nimport { putFileAsync, setDryRun } from \"../utils/writer\";\r\n\r\nexport async function generateController(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Controller name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.controller <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.controller users/create-user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.controller <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = parseName(componentName);\r\n const withValidation = data.options.withValidation || data.options.v;\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Check if controller already exists\r\n const controllerPath = resolveComponentPath(module, \"controllers\", `${name.kebab}.controller`);\r\n if ((await componentExists(module, \"controllers\", `${name.kebab}.controller`)) && !force) {\r\n console.log(colors.red(`Error: Controller \"${name.kebab}.controller.ts\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureComponentDirectory(module, \"controllers\");\r\n\r\n // Generate controller\r\n const controllerContent = controllerStub(name, { withValidation: !!withValidation });\r\n await putFileAsync(controllerPath, controllerContent);\r\n\r\n // Generate the validation schema alongside the controller if requested.\r\n // The controller imports the schema's exported type + value directly —\r\n // there is no separate `requests/` alias file.\r\n if (withValidation) {\r\n await ensureComponentDirectory(module, \"schema\");\r\n\r\n const schemaPath = resolveComponentPath(module, \"schema\", `${name.kebab}.schema`);\r\n const schemaContent = schemaStub(name);\r\n\r\n await putFileAsync(schemaPath, schemaContent);\r\n }\r\n\r\n console.log(colors.cyan(`\\n✨ Controller \"${name.camel}\" generated successfully!`));\r\n}\r\n"],"mappings":";;;;;;;AAYA,eAAsB,mBAAmB,MAAwC;CAC/E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,oCAAoC,CAAC;EAC5D,QAAQ,IAAI,OAAO,OAAO,kDAAkD,CAAC;EAC7E,QAAQ,IAAI,OAAO,OAAO,sDAAsD,CAAC;EACjF,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,kDAAkD,CAAC;EAC7E,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,UAAU,aAAa;CACpC,MAAM,iBAAiB,KAAK,QAAQ,kBAAkB,KAAK,QAAQ;CACnE,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;CACjD,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAGtC,MAAM,iBAAiB,qBAAqB,QAAQ,eAAe,GAAG,KAAK,MAAM,YAAY;CAC7F,IAAK,MAAM,gBAAgB,QAAQ,eAAe,GAAG,KAAK,MAAM,YAAY,KAAM,CAAC,OAAO;EACxF,QAAQ,IAAI,OAAO,IAAI,sBAAsB,KAAK,MAAM,+BAA+B,CAAC;EACxF,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,yBAAyB,QAAQ,aAAa;CAIpD,MAAM,aAAa,gBADO,eAAe,MAAM,EAAE,gBAAgB,CAAC,CAAC,eAAe,CAC/B,CAAC;CAKpD,IAAI,gBAAgB;EAClB,MAAM,yBAAyB,QAAQ,QAAQ;EAK/C,MAAM,aAHa,qBAAqB,QAAQ,UAAU,GAAG,KAAK,MAAM,QAG5C,GAFN,WAAW,IAEU,CAAC;CAC9C;CAEA,QAAQ,IAAI,OAAO,KAAK,qBAAqB,KAAK,MAAM,0BAA0B,CAAC;AACrF"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { appPath } from "../../../../utils/paths.mjs";
|
|
2
|
-
import "../../../../utils/index.mjs";
|
|
3
|
-
import { migrationAlterStub, migrationStub } from "../templates/stubs.mjs";
|
|
4
|
-
import { parseName } from "../utils/name-parser.mjs";
|
|
5
|
-
import { ensureDirectoryAsync, putFileAsync, setDryRun } from "../utils/writer.mjs";
|
|
6
|
-
import { parseColumnDsl } from "./column-dsl-parser.mjs";
|
|
7
|
-
import { colors } from "@mongez/copper";
|
|
8
|
-
import path from "node:path";
|
|
9
|
-
|
|
10
|
-
//#region ../../@warlock.js/core/src/cli/commands/generate/generators/migration.generator.ts
|
|
11
|
-
/**
|
|
12
|
-
* Generate a migration file for a model
|
|
13
|
-
*/
|
|
14
|
-
/**
|
|
15
|
-
* Create a migration file for a model
|
|
16
|
-
*/
|
|
17
|
-
async function createMigrationFile(moduleName, entityName, options = {}) {
|
|
18
|
-
const entity = parseName(entityName);
|
|
19
|
-
const now = /* @__PURE__ */ new Date();
|
|
20
|
-
const migrationFileName = `${`${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}-${now.getFullYear()}_${String(now.getHours()).padStart(2, "0")}-${String(now.getMinutes()).padStart(2, "0")}-${String(now.getSeconds()).padStart(2, "0")}`}-${entity.kebab}.migration.ts`;
|
|
21
|
-
const migrationsPath = path.join(appPath(), moduleName, "models", entity.kebab, "migrations");
|
|
22
|
-
await ensureDirectoryAsync(migrationsPath);
|
|
23
|
-
const addParams = options.add;
|
|
24
|
-
const dropParams = options.drop;
|
|
25
|
-
const renameParams = options.rename;
|
|
26
|
-
const timestamps = options.timestamps !== "false" && options.timestamps !== false;
|
|
27
|
-
let migrationContent = "";
|
|
28
|
-
if (addParams || dropParams || renameParams) {
|
|
29
|
-
const parsedAdd = parseColumnDsl(addParams || "");
|
|
30
|
-
const helpersSet = /* @__PURE__ */ new Set();
|
|
31
|
-
const addLines = parsedAdd.map((col) => {
|
|
32
|
-
helpersSet.add(col.helper);
|
|
33
|
-
return ` ${col.name}: ${col.helper}()${col.modifiers.join("")},`;
|
|
34
|
-
});
|
|
35
|
-
let formattedDrop = void 0;
|
|
36
|
-
if (dropParams) formattedDrop = JSON.stringify(dropParams.split(",").map((s) => s.trim()));
|
|
37
|
-
let formattedRename = void 0;
|
|
38
|
-
if (renameParams) {
|
|
39
|
-
const obj = {};
|
|
40
|
-
renameParams.split(",").map((s) => s.trim()).forEach((p) => {
|
|
41
|
-
const [oldN, newN] = p.split(":").map((s) => s.trim());
|
|
42
|
-
if (oldN && newN) obj[oldN] = newN;
|
|
43
|
-
});
|
|
44
|
-
formattedRename = JSON.stringify(obj, null, 2).replace(/\n/g, "\n ");
|
|
45
|
-
}
|
|
46
|
-
migrationContent = migrationAlterStub(entity, {
|
|
47
|
-
add: addLines.length > 0 ? addLines.join("\n") : void 0,
|
|
48
|
-
drop: formattedDrop,
|
|
49
|
-
rename: formattedRename,
|
|
50
|
-
imports: Array.from(helpersSet)
|
|
51
|
-
});
|
|
52
|
-
} else migrationContent = migrationStub(entity, { timestamps });
|
|
53
|
-
const migrationFilePath = path.join(migrationsPath, migrationFileName);
|
|
54
|
-
await putFileAsync(migrationFilePath, migrationContent);
|
|
55
|
-
return migrationFilePath;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Generate a migration file for a model
|
|
59
|
-
*/
|
|
60
|
-
async function generateMigration(data) {
|
|
61
|
-
const modelPath = data.args[0];
|
|
62
|
-
if (!modelPath) {
|
|
63
|
-
console.log(colors.red("Error: Model path is required"));
|
|
64
|
-
console.log(colors.gray("Usage: warlock gen.migration <model-path>"));
|
|
65
|
-
console.log(colors.gray("Example: warlock gen.migration products/product"));
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const [moduleName, entityName] = modelPath.split("/");
|
|
69
|
-
if (!moduleName || !entityName) {
|
|
70
|
-
console.log(colors.red("Error: Invalid model path format. Expected: <module>/<entity>"));
|
|
71
|
-
console.log(colors.gray("Example: warlock gen.migration products/product"));
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
setDryRun(Boolean(data.options.dryRun));
|
|
75
|
-
const migrationFilePath = await createMigrationFile(moduleName, entityName, data.options);
|
|
76
|
-
console.log(colors.cyan(`\n✨ Migration file created at: ${path.relative(appPath(), migrationFilePath)}`));
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
//#endregion
|
|
80
|
-
export { createMigrationFile, generateMigration };
|
|
81
|
-
//# sourceMappingURL=migration.generator.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"migration.generator.mjs","names":[],"sources":["../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generators/migration.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport path from \"node:path\";\r\nimport { appPath } from \"../../../../utils\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { migrationAlterStub, migrationStub } from \"../templates/stubs\";\r\nimport { parseColumnDsl } from \"./column-dsl-parser\";\r\nimport { parseName } from \"../utils/name-parser\";\r\nimport { ensureDirectoryAsync, putFileAsync, setDryRun } from \"../utils/writer\";\r\n\r\n/**\r\n * Generate a migration file for a model\r\n */\r\n/**\r\n * Create a migration file for a model\r\n */\r\nexport async function createMigrationFile(moduleName: string, entityName: string, options: any = {}) {\r\n const entity = parseName(entityName);\r\n\r\n // Generate timestamp: MM-DD-YYYY_HH-MM-SS\r\n const now = new Date();\r\n const timestamp = `${String(now.getMonth() + 1).padStart(2, \"0\")}-${String(now.getDate()).padStart(2, \"0\")}-${now.getFullYear()}_${String(now.getHours()).padStart(2, \"0\")}-${String(now.getMinutes()).padStart(2, \"0\")}-${String(now.getSeconds()).padStart(2, \"0\")}`;\r\n\r\n const migrationFileName = `${timestamp}-${entity.kebab}.migration.ts`;\r\n const migrationsPath = path.join(appPath(), moduleName, \"models\", entity.kebab, \"migrations\");\r\n\r\n // Ensure migrations directory exists\r\n await ensureDirectoryAsync(migrationsPath);\r\n\r\n const addParams = options.add as string;\r\n const dropParams = options.drop as string;\r\n const renameParams = options.rename as string;\r\n const timestamps = options.timestamps !== \"false\" && options.timestamps !== false;\r\n\r\n let migrationContent = \"\";\r\n\r\n if (addParams || dropParams || renameParams) {\r\n // Generate alter stub\r\n const parsedAdd = parseColumnDsl(addParams || \"\");\r\n const helpersSet = new Set<string>();\r\n \r\n const addLines = parsedAdd.map((col) => {\r\n helpersSet.add(col.helper);\r\n return ` ${col.name}: ${col.helper}()${col.modifiers.join(\"\")},`;\r\n });\r\n\r\n let formattedDrop: string | undefined = undefined;\r\n if (dropParams) {\r\n formattedDrop = JSON.stringify(dropParams.split(\",\").map((s) => s.trim()));\r\n }\r\n\r\n let formattedRename: string | undefined = undefined;\r\n if (renameParams) {\r\n const obj: Record<string, string> = {};\r\n renameParams.split(\",\").map((s) => s.trim()).forEach((p) => {\r\n const [oldN, newN] = p.split(\":\").map((s) => s.trim());\r\n if (oldN && newN) obj[oldN] = newN;\r\n });\r\n formattedRename = JSON.stringify(obj, null, 2).replace(/\\n/g, '\\n ');\r\n }\r\n\r\n migrationContent = migrationAlterStub(entity, {\r\n add: addLines.length > 0 ? addLines.join(\"\\n\") : undefined,\r\n drop: formattedDrop,\r\n rename: formattedRename,\r\n imports: Array.from(helpersSet),\r\n });\r\n } else {\r\n // Generate create stub\r\n migrationContent = migrationStub(entity, {\r\n timestamps,\r\n });\r\n }\r\n\r\n // Create migration file\r\n const migrationFilePath = path.join(migrationsPath, migrationFileName);\r\n await putFileAsync(migrationFilePath, migrationContent);\r\n\r\n return migrationFilePath;\r\n}\r\n\r\n/**\r\n * Generate a migration file for a model\r\n */\r\nexport async function generateMigration(data: CommandActionData) {\r\n const modelPath = data.args[0] as string;\r\n\r\n if (!modelPath) {\r\n console.log(colors.red(\"Error: Model path is required\"));\r\n console.log(colors.gray(\"Usage: warlock gen.migration <model-path>\"));\r\n console.log(colors.gray(\"Example: warlock gen.migration products/product\"));\r\n return;\r\n }\r\n\r\n // Parse model path (e.g., \"products/product\")\r\n const [moduleName, entityName] = modelPath.split(\"/\");\r\n\r\n if (!moduleName || !entityName) {\r\n console.log(colors.red(\"Error: Invalid model path format. Expected: <module>/<entity>\"));\r\n console.log(colors.gray(\"Example: warlock gen.migration products/product\"));\r\n return;\r\n }\r\n\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n const migrationFilePath = await createMigrationFile(moduleName, entityName, data.options);\r\n\r\n console.log(\r\n colors.cyan(`\\n✨ Migration file created at: ${path.relative(appPath(), migrationFilePath)}`),\r\n );\r\n}\r\n"],"mappings":"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"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { migrationStub, modelStub } from "../templates/stubs.mjs";
|
|
2
|
-
import { parseModulePath, singularName } from "../utils/name-parser.mjs";
|
|
3
|
-
import { ensureDirectoryAsync, putFileAsync, setDryRun } from "../utils/writer.mjs";
|
|
4
|
-
import { componentExists, moduleExists, resolveModulePath } from "../utils/path-resolver.mjs";
|
|
5
|
-
import { colors } from "@mongez/copper";
|
|
6
|
-
import path from "node:path";
|
|
7
|
-
|
|
8
|
-
//#region ../../@warlock.js/core/src/cli/commands/generate/generators/model.generator.ts
|
|
9
|
-
async function generateModel(data) {
|
|
10
|
-
const input = data.args[0];
|
|
11
|
-
if (!input) {
|
|
12
|
-
console.log(colors.red("Error: Model name is required"));
|
|
13
|
-
console.log(colors.yellow("Usage: warlock create.model <module>/<name>"));
|
|
14
|
-
console.log(colors.yellow("Example: warlock create.model users/user"));
|
|
15
|
-
process.exit(1);
|
|
16
|
-
}
|
|
17
|
-
const { module, name: componentName } = parseModulePath(input);
|
|
18
|
-
if (!module) {
|
|
19
|
-
console.log(colors.red("Error: Module name is required"));
|
|
20
|
-
console.log(colors.yellow("Usage: warlock create.model <module>/<name>"));
|
|
21
|
-
process.exit(1);
|
|
22
|
-
}
|
|
23
|
-
if (!await moduleExists(module)) {
|
|
24
|
-
console.log(colors.red(`Error: Module "${module}" does not exist`));
|
|
25
|
-
console.log(colors.yellow(`Run: warlock create.module ${module}`));
|
|
26
|
-
process.exit(1);
|
|
27
|
-
}
|
|
28
|
-
const name = singularName(componentName);
|
|
29
|
-
const force = data.options.force || data.options.f;
|
|
30
|
-
setDryRun(Boolean(data.options.dryRun));
|
|
31
|
-
const withResource = data.options.withResource || data.options.rs;
|
|
32
|
-
const tableName = data.options.table || name.plural.snake;
|
|
33
|
-
const modelDir = path.join(resolveModulePath(module), "models", name.kebab);
|
|
34
|
-
const modelPath = path.join(modelDir, `${name.kebab}.model.ts`);
|
|
35
|
-
if (await componentExists(module, `models/${name.kebab}`, `${name.kebab}.model`) && !force) {
|
|
36
|
-
console.log(colors.red(`Error: Model "${name.kebab}" already exists`));
|
|
37
|
-
console.log(colors.yellow("Use --force to overwrite"));
|
|
38
|
-
process.exit(1);
|
|
39
|
-
}
|
|
40
|
-
await ensureDirectoryAsync(modelDir);
|
|
41
|
-
await ensureDirectoryAsync(path.join(modelDir, "migrations"));
|
|
42
|
-
await putFileAsync(modelPath, modelStub(name, {
|
|
43
|
-
tableName,
|
|
44
|
-
withResource: !!withResource
|
|
45
|
-
}));
|
|
46
|
-
const indexContent = `export * from "./${name.kebab}.model";
|
|
47
|
-
`;
|
|
48
|
-
await putFileAsync(path.join(modelDir, "index.ts"), indexContent);
|
|
49
|
-
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/[-:T]/g, "_").split(".")[0];
|
|
50
|
-
await putFileAsync(path.join(modelDir, "migrations", `${timestamp}_${name.kebab}.migration.ts`), migrationStub(name, { timestamps: data.options.timestamps !== "false" && data.options.timestamps !== false }));
|
|
51
|
-
console.log(colors.cyan(`\n✨ Model "${name.pascal}" generated successfully!`));
|
|
52
|
-
console.log(colors.gray(`\nNext steps:`));
|
|
53
|
-
console.log(colors.gray(` 1. Update model schema in ${name.kebab}.model.ts`));
|
|
54
|
-
console.log(colors.gray(` 2. Update migration in migrations/${timestamp}_${name.kebab}.migration.ts`));
|
|
55
|
-
console.log(colors.gray(` 3. Run migration: warlock migrate`));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
//#endregion
|
|
59
|
-
export { generateModel };
|
|
60
|
-
//# sourceMappingURL=model.generator.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model.generator.mjs","names":[],"sources":["../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generators/model.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport path from \"node:path\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { migrationStub, modelStub } from \"../templates/stubs\";\r\nimport { parseModulePath, singularName } from \"../utils/name-parser\";\r\nimport { componentExists, moduleExists, resolveModulePath } from \"../utils/path-resolver\";\r\nimport { ensureDirectoryAsync, putFileAsync, setDryRun } from \"../utils/writer\";\r\n\r\nexport async function generateModel(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Model name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.model <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.model users/user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.model <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = singularName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n const withResource = data.options.withResource || data.options.rs;\r\n const tableName = (data.options.table as string) || name.plural.snake;\r\n\r\n // Check if model already exists\r\n const modelDir = path.join(resolveModulePath(module), \"models\", name.kebab);\r\n const modelPath = path.join(modelDir, `${name.kebab}.model.ts`);\r\n\r\n if ((await componentExists(module, `models/${name.kebab}`, `${name.kebab}.model`)) && !force) {\r\n console.log(colors.red(`Error: Model \"${name.kebab}\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureDirectoryAsync(modelDir);\r\n await ensureDirectoryAsync(path.join(modelDir, \"migrations\"));\r\n\r\n // Generate model\r\n const modelContent = modelStub(name, { tableName, withResource: !!withResource });\r\n await putFileAsync(modelPath, modelContent);\r\n\r\n // Generate index.ts\r\n const indexContent = `export * from \"./${name.kebab}.model\";\r\n`;\r\n await putFileAsync(path.join(modelDir, \"index.ts\"), indexContent);\r\n\r\n // Generate migration\r\n const timestamp = new Date().toISOString().replace(/[-:T]/g, \"_\").split(\".\")[0];\r\n const migrationPath = path.join(\r\n modelDir,\r\n \"migrations\",\r\n `${timestamp}_${name.kebab}.migration.ts`,\r\n );\r\n\r\n const migrationContent = migrationStub(name, {\r\n timestamps: data.options.timestamps !== \"false\" && data.options.timestamps !== false,\r\n });\r\n\r\n await putFileAsync(migrationPath, migrationContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Model \"${name.pascal}\" generated successfully!`));\r\n console.log(colors.gray(`\\nNext steps:`));\r\n console.log(colors.gray(` 1. Update model schema in ${name.kebab}.model.ts`));\r\n console.log(\r\n colors.gray(` 2. Update migration in migrations/${timestamp}_${name.kebab}.migration.ts`),\r\n );\r\n console.log(colors.gray(` 3. Run migration: warlock migrate`));\r\n}\r\n"],"mappings":";;;;;;;;AAQA,eAAsB,cAAc,MAAwC;CAC1E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,+BAA+B,CAAC;EACvD,QAAQ,IAAI,OAAO,OAAO,6CAA6C,CAAC;EACxE,QAAQ,IAAI,OAAO,OAAO,0CAA0C,CAAC;EACrE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,6CAA6C,CAAC;EACxE,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,aAAa,aAAa;CACvC,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;CACjD,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CACtC,MAAM,eAAe,KAAK,QAAQ,gBAAgB,KAAK,QAAQ;CAC/D,MAAM,YAAa,KAAK,QAAQ,SAAoB,KAAK,OAAO;CAGhE,MAAM,WAAW,KAAK,KAAK,kBAAkB,MAAM,GAAG,UAAU,KAAK,KAAK;CAC1E,MAAM,YAAY,KAAK,KAAK,UAAU,GAAG,KAAK,MAAM,UAAU;CAE9D,IAAK,MAAM,gBAAgB,QAAQ,UAAU,KAAK,SAAS,GAAG,KAAK,MAAM,OAAO,KAAM,CAAC,OAAO;EAC5F,QAAQ,IAAI,OAAO,IAAI,iBAAiB,KAAK,MAAM,iBAAiB,CAAC;EACrE,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,qBAAqB,QAAQ;CACnC,MAAM,qBAAqB,KAAK,KAAK,UAAU,YAAY,CAAC;CAI5D,MAAM,aAAa,WADE,UAAU,MAAM;EAAE;EAAW,cAAc,CAAC,CAAC;CAAa,CACtC,CAAC;CAG1C,MAAM,eAAe,oBAAoB,KAAK,MAAM;;CAEpD,MAAM,aAAa,KAAK,KAAK,UAAU,UAAU,GAAG,YAAY;CAGhE,MAAM,6BAAY,IAAI,KAAK,GAAE,YAAY,EAAE,QAAQ,UAAU,GAAG,EAAE,MAAM,GAAG,EAAE;CAW7E,MAAM,aAVgB,KAAK,KACzB,UACA,cACA,GAAG,UAAU,GAAG,KAAK,MAAM,cAOE,GAJN,cAAc,MAAM,EAC3C,YAAY,KAAK,QAAQ,eAAe,WAAW,KAAK,QAAQ,eAAe,MACjF,CAEiD,CAAC;CAElD,QAAQ,IAAI,OAAO,KAAK,gBAAgB,KAAK,OAAO,0BAA0B,CAAC;CAC/E,QAAQ,IAAI,OAAO,KAAK,eAAe,CAAC;CACxC,QAAQ,IAAI,OAAO,KAAK,+BAA+B,KAAK,MAAM,UAAU,CAAC;CAC7E,QAAQ,IACN,OAAO,KAAK,uCAAuC,UAAU,GAAG,KAAK,MAAM,cAAc,CAC3F;CACA,QAAQ,IAAI,OAAO,KAAK,qCAAqC,CAAC;AAChE"}
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { appPath } from "../../../../utils/paths.mjs";
|
|
2
|
-
import "../../../../utils/index.mjs";
|
|
3
|
-
import { crudCreateControllerStub, crudCreateSchemaStub, crudCreateServiceStub, crudDeleteControllerStub, crudDeleteServiceStub, crudGetServiceStub, crudListControllerStub, crudListServiceStub, crudModelStub, crudRepositoryStub, crudResourceStub, crudRoutesStub, crudSeedStub, crudShowControllerStub, crudUpdateControllerStub, crudUpdateSchemaStub, crudUpdateServiceStub } from "../templates/stubs.mjs";
|
|
4
|
-
import { pluralName, singularName } from "../utils/name-parser.mjs";
|
|
5
|
-
import { ensureDirectoryAsync, putFileAsync, setDryRun } from "../utils/writer.mjs";
|
|
6
|
-
import { moduleExists } from "../utils/path-resolver.mjs";
|
|
7
|
-
import { createMigrationFile } from "./migration.generator.mjs";
|
|
8
|
-
import { colors } from "@mongez/copper";
|
|
9
|
-
import path from "node:path";
|
|
10
|
-
|
|
11
|
-
//#region ../../@warlock.js/core/src/cli/commands/generate/generators/module.generator.ts
|
|
12
|
-
async function generateModule(data) {
|
|
13
|
-
const moduleName = data.args[0];
|
|
14
|
-
if (!moduleName) {
|
|
15
|
-
console.log(colors.red("Error: Module name is required"));
|
|
16
|
-
console.log(colors.yellow("Usage: warlock generate.module <name> [options]"));
|
|
17
|
-
console.log(colors.yellow("Example: warlock generate.module products"));
|
|
18
|
-
console.log(colors.yellow(" warlock generate.module products --minimal"));
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
const name = pluralName(moduleName);
|
|
22
|
-
const force = data.options.force || data.options.f;
|
|
23
|
-
setDryRun(Boolean(data.options.dryRun));
|
|
24
|
-
const withCrud = !(data.options.minimal || data.options.m);
|
|
25
|
-
if (await moduleExists(name.kebab) && !force) {
|
|
26
|
-
console.log(colors.red(`Error: Module "${name.kebab}" already exists`));
|
|
27
|
-
console.log(colors.yellow("Use --force to overwrite"));
|
|
28
|
-
process.exit(1);
|
|
29
|
-
}
|
|
30
|
-
const modulePath = appPath(name.kebab);
|
|
31
|
-
for (const dir of [
|
|
32
|
-
"controllers",
|
|
33
|
-
"services",
|
|
34
|
-
"models",
|
|
35
|
-
"repositories",
|
|
36
|
-
"schema",
|
|
37
|
-
"resources",
|
|
38
|
-
"events",
|
|
39
|
-
"types",
|
|
40
|
-
"utils"
|
|
41
|
-
]) await ensureDirectoryAsync(path.join(modulePath, dir));
|
|
42
|
-
await putFileAsync(path.join(modulePath, "main.ts"), `// You may use this file as a custom entry point to be executed when the app starts.
|
|
43
|
-
// it runs only once, and you don't need to import the routes.ts file, it will be imported automatically.
|
|
44
|
-
// Use it to regsiter or boot up any custom logic for this module.
|
|
45
|
-
`);
|
|
46
|
-
const routesContent = withCrud ? crudRoutesStub(name) : `import { router } from "@warlock.js/core";
|
|
47
|
-
import { guarded } from "app/shared/utils/router";
|
|
48
|
-
|
|
49
|
-
// Define your routes here
|
|
50
|
-
// Example:
|
|
51
|
-
// router.get("/${name.kebab}", listController);
|
|
52
|
-
`;
|
|
53
|
-
await putFileAsync(path.join(modulePath, "routes.ts"), routesContent);
|
|
54
|
-
const localesContent = `import { groupedTranslations } from "@mongez/localization";
|
|
55
|
-
|
|
56
|
-
groupedTranslations("${name.camel}", {
|
|
57
|
-
// Add your translations here
|
|
58
|
-
// Example:
|
|
59
|
-
// welcome: {
|
|
60
|
-
// en: "Welcome",
|
|
61
|
-
// ar: "Ù…Ø±ØØ¨Ø§",
|
|
62
|
-
// },
|
|
63
|
-
});
|
|
64
|
-
`;
|
|
65
|
-
await putFileAsync(path.join(modulePath, "utils", "locales.ts"), localesContent);
|
|
66
|
-
if (withCrud) {
|
|
67
|
-
const entity = singularName(moduleName);
|
|
68
|
-
await putFileAsync(path.join(modulePath, "controllers", `create-${entity.kebab}.controller.ts`), crudCreateControllerStub(entity));
|
|
69
|
-
await putFileAsync(path.join(modulePath, "controllers", `update-${entity.kebab}.controller.ts`), crudUpdateControllerStub(entity));
|
|
70
|
-
await putFileAsync(path.join(modulePath, "controllers", `list-${name.kebab}.controller.ts`), crudListControllerStub(name));
|
|
71
|
-
await putFileAsync(path.join(modulePath, "controllers", `get-${entity.kebab}.controller.ts`), crudShowControllerStub(entity));
|
|
72
|
-
await putFileAsync(path.join(modulePath, "controllers", `delete-${entity.kebab}.controller.ts`), crudDeleteControllerStub(entity));
|
|
73
|
-
await putFileAsync(path.join(modulePath, "schema", `create-${entity.kebab}.schema.ts`), crudCreateSchemaStub(entity));
|
|
74
|
-
await putFileAsync(path.join(modulePath, "schema", `update-${entity.kebab}.schema.ts`), crudUpdateSchemaStub(entity));
|
|
75
|
-
await ensureDirectoryAsync(path.join(modulePath, "models", entity.kebab));
|
|
76
|
-
await putFileAsync(path.join(modulePath, "models", entity.kebab, `${entity.kebab}.model.ts`), crudModelStub(entity));
|
|
77
|
-
await putFileAsync(path.join(modulePath, "models", entity.kebab, "index.ts"), `export * from "./${entity.kebab}.model";\n`);
|
|
78
|
-
await ensureDirectoryAsync(path.join(modulePath, "models", entity.kebab, "migrations"));
|
|
79
|
-
await putFileAsync(path.join(modulePath, "resources", `${entity.kebab}.resource.ts`), crudResourceStub(name));
|
|
80
|
-
await putFileAsync(path.join(modulePath, "repositories", `${name.kebab}.repository.ts`), crudRepositoryStub(name));
|
|
81
|
-
await putFileAsync(path.join(modulePath, "services", `create-${entity.kebab}.service.ts`), crudCreateServiceStub(entity));
|
|
82
|
-
await putFileAsync(path.join(modulePath, "services", `update-${entity.kebab}.service.ts`), crudUpdateServiceStub(entity));
|
|
83
|
-
await putFileAsync(path.join(modulePath, "services", `list-${name.kebab}.service.ts`), crudListServiceStub(name));
|
|
84
|
-
await putFileAsync(path.join(modulePath, "services", `get-${entity.kebab}.service.ts`), crudGetServiceStub(entity));
|
|
85
|
-
await putFileAsync(path.join(modulePath, "services", `delete-${entity.kebab}.service.ts`), crudDeleteServiceStub(entity));
|
|
86
|
-
await ensureDirectoryAsync(path.join(modulePath, "seeds"));
|
|
87
|
-
await putFileAsync(path.join(modulePath, "seeds", `${name.kebab}.seed.ts`), crudSeedStub(name));
|
|
88
|
-
await createMigrationFile(name.kebab, entity.kebab);
|
|
89
|
-
}
|
|
90
|
-
console.log(colors.cyan(`\n✨ Module "${name.kebab}" generated successfully!`));
|
|
91
|
-
if (withCrud) {
|
|
92
|
-
console.log(colors.gray(`\n📦 CRUD scaffold created with:`));
|
|
93
|
-
console.log(colors.gray(` - List, Get, Create, Update & Delete controllers`));
|
|
94
|
-
console.log(colors.gray(` - Repository`));
|
|
95
|
-
console.log(colors.gray(` - Validation schemas in schema/`));
|
|
96
|
-
console.log(colors.gray(` - Model with resource`));
|
|
97
|
-
console.log(colors.gray(` - Routes configured`));
|
|
98
|
-
console.log(colors.gray(`\nNext steps:`));
|
|
99
|
-
console.log(colors.gray(` 1. Update model schema in models/${name.kebab}/${name.kebab}.model.ts`));
|
|
100
|
-
console.log(colors.gray(` 2. Update schema rules in schema/*.schema.ts`));
|
|
101
|
-
console.log(colors.gray(` 3. Create migration: warlock generate.model ${name.kebab}/${name.kebab}`));
|
|
102
|
-
} else {
|
|
103
|
-
console.log(colors.gray(`\nNext steps:`));
|
|
104
|
-
console.log(colors.gray(` 1. Define routes in ${name.kebab}/routes.ts`));
|
|
105
|
-
console.log(colors.gray(` 2. Create controllers: warlock generate.controller ${name.kebab}/<name>`));
|
|
106
|
-
console.log(colors.gray(` 3. Create models: warlock generate.model ${name.kebab}/<name>`));
|
|
107
|
-
console.log(colors.gray(`\nTip: omit --minimal to generate a full CRUD scaffold`));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
//#endregion
|
|
112
|
-
export { generateModule };
|
|
113
|
-
//# sourceMappingURL=module.generator.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"module.generator.mjs","names":[],"sources":["../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generators/module.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport path from \"node:path\";\r\nimport { appPath } from \"../../../../utils\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport {\r\n crudCreateControllerStub,\r\n crudCreateSchemaStub,\r\n crudCreateServiceStub,\r\n crudDeleteControllerStub,\r\n crudDeleteServiceStub,\r\n crudGetServiceStub,\r\n crudListControllerStub,\r\n crudListServiceStub,\r\n crudModelStub,\r\n crudRepositoryStub,\r\n crudResourceStub,\r\n crudRoutesStub,\r\n crudSeedStub,\r\n crudShowControllerStub,\r\n crudUpdateControllerStub,\r\n crudUpdateSchemaStub,\r\n crudUpdateServiceStub,\r\n} from \"../templates/stubs\";\r\nimport { pluralName, singularName } from \"../utils/name-parser\";\r\nimport { moduleExists } from \"../utils/path-resolver\";\r\nimport { ensureDirectoryAsync, putFileAsync, setDryRun } from \"../utils/writer\";\r\nimport { createMigrationFile } from \"./migration.generator\";\r\n\r\nexport async function generateModule(data: CommandActionData): Promise<void> {\r\n const moduleName = data.args[0];\r\n\r\n if (!moduleName) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock generate.module <name> [options]\"));\r\n console.log(colors.yellow(\"Example: warlock generate.module products\"));\r\n console.log(colors.yellow(\" warlock generate.module products --minimal\"));\r\n process.exit(1);\r\n }\r\n\r\n const name = pluralName(moduleName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Full CRUD is the default; --minimal (-m) opts down to a bare skeleton.\r\n const minimal = data.options.minimal || data.options.m;\r\n const withCrud = !minimal;\r\n\r\n // Check if module already exists\r\n if ((await moduleExists(name.kebab)) && !force) {\r\n console.log(colors.red(`Error: Module \"${name.kebab}\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n const modulePath = appPath(name.kebab);\r\n\r\n // Create module directory structure\r\n const directories = [\r\n \"controllers\",\r\n \"services\",\r\n \"models\",\r\n \"repositories\",\r\n \"schema\",\r\n \"resources\",\r\n \"events\",\r\n \"types\",\r\n \"utils\",\r\n ];\r\n\r\n for (const dir of directories) {\r\n await ensureDirectoryAsync(path.join(modulePath, dir));\r\n }\r\n\r\n // Create main.ts\r\n const mainContent = `// You may use this file as a custom entry point to be executed when the app starts.\r\n// it runs only once, and you don't need to import the routes.ts file, it will be imported automatically.\r\n// Use it to regsiter or boot up any custom logic for this module.\r\n`;\r\n await putFileAsync(path.join(modulePath, \"main.ts\"), mainContent);\r\n\r\n // Create routes.ts\r\n const routesContent = withCrud\r\n ? crudRoutesStub(name)\r\n : `import { router } from \"@warlock.js/core\";\r\nimport { guarded } from \"app/shared/utils/router\";\r\n\r\n// Define your routes here\r\n// Example:\r\n// router.get(\"/${name.kebab}\", listController);\r\n`;\r\n await putFileAsync(path.join(modulePath, \"routes.ts\"), routesContent);\r\n\r\n // Create utils/locales.ts\r\n const localesContent = `import { groupedTranslations } from \"@mongez/localization\";\r\n\r\ngroupedTranslations(\"${name.camel}\", {\r\n // Add your translations here\r\n // Example:\r\n // welcome: {\r\n // en: \"Welcome\",\r\n // ar: \"Ù…Ø±ØØ¨Ø§\",\r\n // },\r\n});\r\n`;\r\n await putFileAsync(path.join(modulePath, \"utils\", \"locales.ts\"), localesContent);\r\n\r\n // Full CRUD scaffold (the default) unless --minimal was passed\r\n if (withCrud) {\r\n const entity = singularName(moduleName);\r\n\r\n // Create controllers\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `create-${entity.kebab}.controller.ts`),\r\n crudCreateControllerStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `update-${entity.kebab}.controller.ts`),\r\n crudUpdateControllerStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `list-${name.kebab}.controller.ts`),\r\n crudListControllerStub(name),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `get-${entity.kebab}.controller.ts`),\r\n crudShowControllerStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"controllers\", `delete-${entity.kebab}.controller.ts`),\r\n crudDeleteControllerStub(entity),\r\n );\r\n\r\n // Create schema files — each exports both the schema value and its\r\n // inferred type; controllers import them directly (no requests/ alias).\r\n await putFileAsync(\r\n path.join(modulePath, \"schema\", `create-${entity.kebab}.schema.ts`),\r\n crudCreateSchemaStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"schema\", `update-${entity.kebab}.schema.ts`),\r\n crudUpdateSchemaStub(entity),\r\n );\r\n\r\n // Create model\r\n await ensureDirectoryAsync(path.join(modulePath, \"models\", entity.kebab));\r\n await putFileAsync(\r\n path.join(modulePath, \"models\", entity.kebab, `${entity.kebab}.model.ts`),\r\n crudModelStub(entity),\r\n );\r\n\r\n // Create model index\r\n await putFileAsync(\r\n path.join(modulePath, \"models\", entity.kebab, \"index.ts\"),\r\n `export * from \"./${entity.kebab}.model\";\\n`,\r\n );\r\n\r\n // Create migrations folder\r\n await ensureDirectoryAsync(path.join(modulePath, \"models\", entity.kebab, \"migrations\"));\r\n\r\n // Create resource\r\n await putFileAsync(\r\n path.join(modulePath, \"resources\", `${entity.kebab}.resource.ts`),\r\n crudResourceStub(name),\r\n );\r\n\r\n // Create repository\r\n await putFileAsync(\r\n path.join(modulePath, \"repositories\", `${name.kebab}.repository.ts`),\r\n crudRepositoryStub(name),\r\n );\r\n\r\n // Create services\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `create-${entity.kebab}.service.ts`),\r\n crudCreateServiceStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `update-${entity.kebab}.service.ts`),\r\n crudUpdateServiceStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `list-${name.kebab}.service.ts`),\r\n crudListServiceStub(name),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `get-${entity.kebab}.service.ts`),\r\n crudGetServiceStub(entity),\r\n );\r\n\r\n await putFileAsync(\r\n path.join(modulePath, \"services\", `delete-${entity.kebab}.service.ts`),\r\n crudDeleteServiceStub(entity),\r\n );\r\n\r\n // Create seeds\r\n await ensureDirectoryAsync(path.join(modulePath, \"seeds\"));\r\n await putFileAsync(path.join(modulePath, \"seeds\", `${name.kebab}.seed.ts`), crudSeedStub(name));\r\n\r\n // Create migration\r\n await createMigrationFile(name.kebab, entity.kebab);\r\n }\r\n\r\n console.log(colors.cyan(`\\n✨ Module \"${name.kebab}\" generated successfully!`));\r\n\r\n if (withCrud) {\r\n console.log(colors.gray(`\\n📦 CRUD scaffold created with:`));\r\n console.log(colors.gray(` - List, Get, Create, Update & Delete controllers`));\r\n console.log(colors.gray(` - Repository`));\r\n console.log(colors.gray(` - Validation schemas in schema/`));\r\n console.log(colors.gray(` - Model with resource`));\r\n console.log(colors.gray(` - Routes configured`));\r\n console.log(colors.gray(`\\nNext steps:`));\r\n console.log(\r\n colors.gray(` 1. Update model schema in models/${name.kebab}/${name.kebab}.model.ts`),\r\n );\r\n console.log(colors.gray(` 2. Update schema rules in schema/*.schema.ts`));\r\n console.log(\r\n colors.gray(` 3. Create migration: warlock generate.model ${name.kebab}/${name.kebab}`),\r\n );\r\n } else {\r\n console.log(colors.gray(`\\nNext steps:`));\r\n console.log(colors.gray(` 1. Define routes in ${name.kebab}/routes.ts`));\r\n console.log(\r\n colors.gray(` 2. Create controllers: warlock generate.controller ${name.kebab}/<name>`),\r\n );\r\n console.log(colors.gray(` 3. Create models: warlock generate.model ${name.kebab}/<name>`));\r\n console.log(colors.gray(`\\nTip: omit --minimal to generate a full CRUD scaffold`));\r\n }\r\n}\r\n"],"mappings":"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"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { repositoryStub } from "../templates/stubs.mjs";
|
|
2
|
-
import { parseModulePath, parseName } from "../utils/name-parser.mjs";
|
|
3
|
-
import { putFileAsync, setDryRun } from "../utils/writer.mjs";
|
|
4
|
-
import { componentExists, ensureComponentDirectory, moduleExists, resolveComponentPath } from "../utils/path-resolver.mjs";
|
|
5
|
-
import { colors } from "@mongez/copper";
|
|
6
|
-
|
|
7
|
-
//#region ../../@warlock.js/core/src/cli/commands/generate/generators/repository.generator.ts
|
|
8
|
-
async function generateRepository(data) {
|
|
9
|
-
const input = data.args[0];
|
|
10
|
-
if (!input) {
|
|
11
|
-
console.log(colors.red("Error: Repository name is required"));
|
|
12
|
-
console.log(colors.yellow("Usage: warlock create.repository <module>/<name>"));
|
|
13
|
-
console.log(colors.yellow("Example: warlock create.repository users/user"));
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
const { module, name: componentName } = parseModulePath(input);
|
|
17
|
-
if (!module) {
|
|
18
|
-
console.log(colors.red("Error: Module name is required"));
|
|
19
|
-
console.log(colors.yellow("Usage: warlock create.repository <module>/<name>"));
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
if (!await moduleExists(module)) {
|
|
23
|
-
console.log(colors.red(`Error: Module "${module}" does not exist`));
|
|
24
|
-
console.log(colors.yellow(`Run: warlock create.module ${module}`));
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
const name = parseName(componentName);
|
|
28
|
-
const force = data.options.force || data.options.f;
|
|
29
|
-
setDryRun(Boolean(data.options.dryRun));
|
|
30
|
-
if (await componentExists(module, "repositories", `${name.kebab}.repository`) && !force) {
|
|
31
|
-
console.log(colors.red(`Error: Repository "${name.kebab}.repository.ts" already exists`));
|
|
32
|
-
console.log(colors.yellow("Use --force to overwrite"));
|
|
33
|
-
process.exit(1);
|
|
34
|
-
}
|
|
35
|
-
await ensureComponentDirectory(module, "repositories");
|
|
36
|
-
await putFileAsync(resolveComponentPath(module, "repositories", `${name.kebab}.repository`), repositoryStub(name));
|
|
37
|
-
console.log(colors.cyan(`\n✨ Repository "${name.pascal}Repository" generated successfully!`));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
export { generateRepository };
|
|
42
|
-
//# sourceMappingURL=repository.generator.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repository.generator.mjs","names":[],"sources":["../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generators/repository.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { repositoryStub } from \"../templates/stubs\";\r\nimport { putFileAsync, setDryRun } from \"../utils/writer\";\r\nimport { parseModulePath, parseName } from \"../utils/name-parser\";\r\nimport {\r\n componentExists,\r\n ensureComponentDirectory,\r\n moduleExists,\r\n resolveComponentPath,\r\n} from \"../utils/path-resolver\";\r\n\r\nexport async function generateRepository(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Repository name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.repository <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.repository users/user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.repository <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = parseName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Check if repository already exists\r\n if ((await componentExists(module, \"repositories\", `${name.kebab}.repository`)) && !force) {\r\n console.log(colors.red(`Error: Repository \"${name.kebab}.repository.ts\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureComponentDirectory(module, \"repositories\");\r\n\r\n // Generate repository\r\n const repositoryPath = resolveComponentPath(module, \"repositories\", `${name.kebab}.repository`);\r\n const repositoryContent = repositoryStub(name);\r\n\r\n await putFileAsync(repositoryPath, repositoryContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Repository \"${name.pascal}Repository\" generated successfully!`));\r\n}\r\n"],"mappings":";;;;;;;AAYA,eAAsB,mBAAmB,MAAwC;CAC/E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,oCAAoC,CAAC;EAC5D,QAAQ,IAAI,OAAO,OAAO,kDAAkD,CAAC;EAC7E,QAAQ,IAAI,OAAO,OAAO,+CAA+C,CAAC;EAC1E,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,kDAAkD,CAAC;EAC7E,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,UAAU,aAAa;CACpC,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;CACjD,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAGtC,IAAK,MAAM,gBAAgB,QAAQ,gBAAgB,GAAG,KAAK,MAAM,YAAY,KAAM,CAAC,OAAO;EACzF,QAAQ,IAAI,OAAO,IAAI,sBAAsB,KAAK,MAAM,+BAA+B,CAAC;EACxF,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,yBAAyB,QAAQ,cAAc;CAMrD,MAAM,aAHiB,qBAAqB,QAAQ,gBAAgB,GAAG,KAAK,MAAM,YAGlD,GAFN,eAAe,IAEU,CAAC;CAEpD,QAAQ,IAAI,OAAO,KAAK,qBAAqB,KAAK,OAAO,oCAAoC,CAAC;AAChG"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { resourceStub } from "../templates/stubs.mjs";
|
|
2
|
-
import { parseModulePath, parseName } from "../utils/name-parser.mjs";
|
|
3
|
-
import { putFileAsync, setDryRun } from "../utils/writer.mjs";
|
|
4
|
-
import { componentExists, ensureComponentDirectory, moduleExists, resolveComponentPath } from "../utils/path-resolver.mjs";
|
|
5
|
-
import { colors } from "@mongez/copper";
|
|
6
|
-
|
|
7
|
-
//#region ../../@warlock.js/core/src/cli/commands/generate/generators/resource.generator.ts
|
|
8
|
-
async function generateResource(data) {
|
|
9
|
-
const input = data.args[0];
|
|
10
|
-
if (!input) {
|
|
11
|
-
console.log(colors.red("Error: Resource name is required"));
|
|
12
|
-
console.log(colors.yellow("Usage: warlock create.resource <module>/<name>"));
|
|
13
|
-
console.log(colors.yellow("Example: warlock create.resource users/user"));
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
const { module, name: componentName } = parseModulePath(input);
|
|
17
|
-
if (!module) {
|
|
18
|
-
console.log(colors.red("Error: Module name is required"));
|
|
19
|
-
console.log(colors.yellow("Usage: warlock create.resource <module>/<name>"));
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
if (!await moduleExists(module)) {
|
|
23
|
-
console.log(colors.red(`Error: Module "${module}" does not exist`));
|
|
24
|
-
console.log(colors.yellow(`Run: warlock create.module ${module}`));
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
const name = parseName(componentName);
|
|
28
|
-
const force = data.options.force || data.options.f;
|
|
29
|
-
setDryRun(Boolean(data.options.dryRun));
|
|
30
|
-
if (await componentExists(module, "resources", `${name.kebab}.resource`) && !force) {
|
|
31
|
-
console.log(colors.red(`Error: Resource "${name.kebab}.resource.ts" already exists`));
|
|
32
|
-
console.log(colors.yellow("Use --force to overwrite"));
|
|
33
|
-
process.exit(1);
|
|
34
|
-
}
|
|
35
|
-
await ensureComponentDirectory(module, "resources");
|
|
36
|
-
await putFileAsync(resolveComponentPath(module, "resources", `${name.kebab}.resource`), resourceStub(name));
|
|
37
|
-
console.log(colors.cyan(`\n✨ Resource "${name.pascal}Resource" generated successfully!`));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
export { generateResource };
|
|
42
|
-
//# sourceMappingURL=resource.generator.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resource.generator.mjs","names":[],"sources":["../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generators/resource.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { resourceStub } from \"../templates/stubs\";\r\nimport { putFileAsync, setDryRun } from \"../utils/writer\";\r\nimport { parseModulePath, parseName } from \"../utils/name-parser\";\r\nimport {\r\n componentExists,\r\n ensureComponentDirectory,\r\n moduleExists,\r\n resolveComponentPath,\r\n} from \"../utils/path-resolver\";\r\n\r\nexport async function generateResource(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Resource name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.resource <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.resource users/user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.resource <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = parseName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Check if resource already exists\r\n if ((await componentExists(module, \"resources\", `${name.kebab}.resource`)) && !force) {\r\n console.log(colors.red(`Error: Resource \"${name.kebab}.resource.ts\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureComponentDirectory(module, \"resources\");\r\n\r\n // Generate resource\r\n const resourcePath = resolveComponentPath(module, \"resources\", `${name.kebab}.resource`);\r\n const resourceContent = resourceStub(name);\r\n\r\n await putFileAsync(resourcePath, resourceContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Resource \"${name.pascal}Resource\" generated successfully!`));\r\n}\r\n"],"mappings":";;;;;;;AAYA,eAAsB,iBAAiB,MAAwC;CAC7E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,kCAAkC,CAAC;EAC1D,QAAQ,IAAI,OAAO,OAAO,gDAAgD,CAAC;EAC3E,QAAQ,IAAI,OAAO,OAAO,6CAA6C,CAAC;EACxE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,gDAAgD,CAAC;EAC3E,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,UAAU,aAAa;CACpC,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;CACjD,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAGtC,IAAK,MAAM,gBAAgB,QAAQ,aAAa,GAAG,KAAK,MAAM,UAAU,KAAM,CAAC,OAAO;EACpF,QAAQ,IAAI,OAAO,IAAI,oBAAoB,KAAK,MAAM,6BAA6B,CAAC;EACpF,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,yBAAyB,QAAQ,WAAW;CAMlD,MAAM,aAHe,qBAAqB,QAAQ,aAAa,GAAG,KAAK,MAAM,UAG/C,GAFN,aAAa,IAEU,CAAC;CAEhD,QAAQ,IAAI,OAAO,KAAK,mBAAmB,KAAK,OAAO,kCAAkC,CAAC;AAC5F"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { serviceStub } from "../templates/stubs.mjs";
|
|
2
|
-
import { parseModulePath, parseName } from "../utils/name-parser.mjs";
|
|
3
|
-
import { putFileAsync, setDryRun } from "../utils/writer.mjs";
|
|
4
|
-
import { componentExists, ensureComponentDirectory, moduleExists, resolveComponentPath } from "../utils/path-resolver.mjs";
|
|
5
|
-
import { colors } from "@mongez/copper";
|
|
6
|
-
|
|
7
|
-
//#region ../../@warlock.js/core/src/cli/commands/generate/generators/service.generator.ts
|
|
8
|
-
async function generateService(data) {
|
|
9
|
-
const input = data.args[0];
|
|
10
|
-
if (!input) {
|
|
11
|
-
console.log(colors.red("Error: Service name is required"));
|
|
12
|
-
console.log(colors.yellow("Usage: warlock create.service <module>/<name>"));
|
|
13
|
-
console.log(colors.yellow("Example: warlock create.service users/create-user"));
|
|
14
|
-
process.exit(1);
|
|
15
|
-
}
|
|
16
|
-
const { module, name: componentName } = parseModulePath(input);
|
|
17
|
-
if (!module) {
|
|
18
|
-
console.log(colors.red("Error: Module name is required"));
|
|
19
|
-
console.log(colors.yellow("Usage: warlock create.service <module>/<name>"));
|
|
20
|
-
process.exit(1);
|
|
21
|
-
}
|
|
22
|
-
if (!await moduleExists(module)) {
|
|
23
|
-
console.log(colors.red(`Error: Module "${module}" does not exist`));
|
|
24
|
-
console.log(colors.yellow(`Run: warlock create.module ${module}`));
|
|
25
|
-
process.exit(1);
|
|
26
|
-
}
|
|
27
|
-
const name = parseName(componentName);
|
|
28
|
-
const force = data.options.force || data.options.f;
|
|
29
|
-
setDryRun(Boolean(data.options.dryRun));
|
|
30
|
-
if (await componentExists(module, "services", `${name.kebab}.service`) && !force) {
|
|
31
|
-
console.log(colors.red(`Error: Service "${name.kebab}.service.ts" already exists`));
|
|
32
|
-
console.log(colors.yellow("Use --force to overwrite"));
|
|
33
|
-
process.exit(1);
|
|
34
|
-
}
|
|
35
|
-
await ensureComponentDirectory(module, "services");
|
|
36
|
-
await putFileAsync(resolveComponentPath(module, "services", `${name.kebab}.service`), serviceStub(name));
|
|
37
|
-
console.log(colors.cyan(`\n✨ Service "${name.camel}" generated successfully!`));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
export { generateService };
|
|
42
|
-
//# sourceMappingURL=service.generator.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"service.generator.mjs","names":[],"sources":["../../../../../../../../../@warlock.js/core/src/cli/commands/generate/generators/service.generator.ts"],"sourcesContent":["import { colors } from \"@mongez/copper\";\r\nimport type { CommandActionData } from \"../../../types\";\r\nimport { serviceStub } from \"../templates/stubs\";\r\nimport { putFileAsync, setDryRun } from \"../utils/writer\";\r\nimport { parseModulePath, parseName } from \"../utils/name-parser\";\r\nimport {\r\n componentExists,\r\n ensureComponentDirectory,\r\n moduleExists,\r\n resolveComponentPath,\r\n} from \"../utils/path-resolver\";\r\n\r\nexport async function generateService(data: CommandActionData): Promise<void> {\r\n const input = data.args[0];\r\n\r\n if (!input) {\r\n console.log(colors.red(\"Error: Service name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.service <module>/<name>\"));\r\n console.log(colors.yellow(\"Example: warlock create.service users/create-user\"));\r\n process.exit(1);\r\n }\r\n\r\n const { module, name: componentName } = parseModulePath(input);\r\n\r\n if (!module) {\r\n console.log(colors.red(\"Error: Module name is required\"));\r\n console.log(colors.yellow(\"Usage: warlock create.service <module>/<name>\"));\r\n process.exit(1);\r\n }\r\n\r\n // Check if module exists\r\n if (!(await moduleExists(module))) {\r\n console.log(colors.red(`Error: Module \"${module}\" does not exist`));\r\n console.log(colors.yellow(`Run: warlock create.module ${module}`));\r\n process.exit(1);\r\n }\r\n\r\n const name = parseName(componentName);\r\n const force = data.options.force || data.options.f;\r\n setDryRun(Boolean(data.options.dryRun));\r\n\r\n // Check if service already exists\r\n if ((await componentExists(module, \"services\", `${name.kebab}.service`)) && !force) {\r\n console.log(colors.red(`Error: Service \"${name.kebab}.service.ts\" already exists`));\r\n console.log(colors.yellow(\"Use --force to overwrite\"));\r\n process.exit(1);\r\n }\r\n\r\n // Ensure directories exist\r\n await ensureComponentDirectory(module, \"services\");\r\n\r\n // Generate service\r\n const servicePath = resolveComponentPath(module, \"services\", `${name.kebab}.service`);\r\n const serviceContent = serviceStub(name);\r\n\r\n await putFileAsync(servicePath, serviceContent);\r\n\r\n console.log(colors.cyan(`\\n✨ Service \"${name.camel}\" generated successfully!`));\r\n}\r\n"],"mappings":";;;;;;;AAYA,eAAsB,gBAAgB,MAAwC;CAC5E,MAAM,QAAQ,KAAK,KAAK;CAExB,IAAI,CAAC,OAAO;EACV,QAAQ,IAAI,OAAO,IAAI,iCAAiC,CAAC;EACzD,QAAQ,IAAI,OAAO,OAAO,+CAA+C,CAAC;EAC1E,QAAQ,IAAI,OAAO,OAAO,mDAAmD,CAAC;EAC9E,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,EAAE,QAAQ,MAAM,kBAAkB,gBAAgB,KAAK;CAE7D,IAAI,CAAC,QAAQ;EACX,QAAQ,IAAI,OAAO,IAAI,gCAAgC,CAAC;EACxD,QAAQ,IAAI,OAAO,OAAO,+CAA+C,CAAC;EAC1E,QAAQ,KAAK,CAAC;CAChB;CAGA,IAAI,CAAE,MAAM,aAAa,MAAM,GAAI;EACjC,QAAQ,IAAI,OAAO,IAAI,kBAAkB,OAAO,iBAAiB,CAAC;EAClE,QAAQ,IAAI,OAAO,OAAO,8BAA8B,QAAQ,CAAC;EACjE,QAAQ,KAAK,CAAC;CAChB;CAEA,MAAM,OAAO,UAAU,aAAa;CACpC,MAAM,QAAQ,KAAK,QAAQ,SAAS,KAAK,QAAQ;CACjD,UAAU,QAAQ,KAAK,QAAQ,MAAM,CAAC;CAGtC,IAAK,MAAM,gBAAgB,QAAQ,YAAY,GAAG,KAAK,MAAM,SAAS,KAAM,CAAC,OAAO;EAClF,QAAQ,IAAI,OAAO,IAAI,mBAAmB,KAAK,MAAM,4BAA4B,CAAC;EAClF,QAAQ,IAAI,OAAO,OAAO,0BAA0B,CAAC;EACrD,QAAQ,KAAK,CAAC;CAChB;CAGA,MAAM,yBAAyB,QAAQ,UAAU;CAMjD,MAAM,aAHc,qBAAqB,QAAQ,YAAY,GAAG,KAAK,MAAM,SAG9C,GAFN,YAAY,IAEU,CAAC;CAE9C,QAAQ,IAAI,OAAO,KAAK,kBAAkB,KAAK,MAAM,0BAA0B,CAAC;AAClF"}
|