mimarjs 0.0.1-alpha.0 → 0.0.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +49 -3
- package/bin/mimar.js +32 -0
- package/dist/auth/auth.d.ts +86 -0
- package/dist/auth/auth.d.ts.map +1 -0
- package/dist/auth/auth.js +212 -0
- package/dist/auth/auth.js.map +1 -0
- package/dist/auth/errors.d.ts +44 -0
- package/dist/auth/errors.d.ts.map +1 -0
- package/dist/auth/errors.js +66 -0
- package/dist/auth/errors.js.map +1 -0
- package/dist/auth/index.d.ts +9 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +9 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/manager.d.ts +109 -0
- package/dist/auth/manager.d.ts.map +1 -0
- package/dist/auth/manager.js +113 -0
- package/dist/auth/manager.js.map +1 -0
- package/dist/auth/middleware.d.ts +26 -0
- package/dist/auth/middleware.d.ts.map +1 -0
- package/dist/auth/middleware.js +152 -0
- package/dist/auth/middleware.js.map +1 -0
- package/dist/auth/passwords.d.ts +45 -0
- package/dist/auth/passwords.d.ts.map +1 -0
- package/dist/auth/passwords.js +104 -0
- package/dist/auth/passwords.js.map +1 -0
- package/dist/auth/policy.d.ts +57 -0
- package/dist/auth/policy.d.ts.map +1 -0
- package/dist/auth/policy.js +115 -0
- package/dist/auth/policy.js.map +1 -0
- package/dist/auth/setup.d.ts +55 -0
- package/dist/auth/setup.d.ts.map +1 -0
- package/dist/auth/setup.js +50 -0
- package/dist/auth/setup.js.map +1 -0
- package/dist/auth/state.d.ts +19 -0
- package/dist/auth/state.d.ts.map +1 -0
- package/dist/auth/state.js +19 -0
- package/dist/auth/state.js.map +1 -0
- package/dist/auth/tokens.d.ts +22 -0
- package/dist/auth/tokens.d.ts.map +1 -0
- package/dist/auth/tokens.js +51 -0
- package/dist/auth/tokens.js.map +1 -0
- package/dist/auth/verification.d.ts +31 -0
- package/dist/auth/verification.d.ts.map +1 -0
- package/dist/auth/verification.js +77 -0
- package/dist/auth/verification.js.map +1 -0
- package/dist/aws/index.d.ts +2 -0
- package/dist/aws/index.d.ts.map +1 -0
- package/dist/aws/index.js +2 -0
- package/dist/aws/index.js.map +1 -0
- package/dist/aws/signer.d.ts +47 -0
- package/dist/aws/signer.d.ts.map +1 -0
- package/dist/aws/signer.js +130 -0
- package/dist/aws/signer.js.map +1 -0
- package/dist/broadcast/index.d.ts +2 -0
- package/dist/broadcast/index.d.ts.map +1 -0
- package/dist/broadcast/index.js +2 -0
- package/dist/broadcast/index.js.map +1 -0
- package/dist/cache/cache.d.ts +129 -0
- package/dist/cache/cache.d.ts.map +1 -0
- package/dist/cache/cache.js +407 -0
- package/dist/cache/cache.js.map +1 -0
- package/dist/cache/database.d.ts +38 -0
- package/dist/cache/database.d.ts.map +1 -0
- package/dist/cache/database.js +210 -0
- package/dist/cache/database.js.map +1 -0
- package/dist/cache/file.d.ts +18 -0
- package/dist/cache/file.d.ts.map +1 -0
- package/dist/cache/file.js +237 -0
- package/dist/cache/file.js.map +1 -0
- package/dist/cache/index.d.ts +9 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +9 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/cache/manager.d.ts +42 -0
- package/dist/cache/manager.d.ts.map +1 -0
- package/dist/cache/manager.js +107 -0
- package/dist/cache/manager.js.map +1 -0
- package/dist/cache/module.d.ts +41 -0
- package/dist/cache/module.d.ts.map +1 -0
- package/dist/cache/module.js +49 -0
- package/dist/cache/module.js.map +1 -0
- package/dist/cache/rate-limiter.d.ts +76 -0
- package/dist/cache/rate-limiter.d.ts.map +1 -0
- package/dist/cache/rate-limiter.js +119 -0
- package/dist/cache/rate-limiter.js.map +1 -0
- package/dist/cache/redis.d.ts +19 -0
- package/dist/cache/redis.d.ts.map +1 -0
- package/dist/cache/redis.js +99 -0
- package/dist/cache/redis.js.map +1 -0
- package/dist/cache/store.d.ts +78 -0
- package/dist/cache/store.d.ts.map +1 -0
- package/dist/cache/store.js +162 -0
- package/dist/cache/store.js.map +1 -0
- package/dist/client/index.d.ts +4 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/pages.d.ts +51 -0
- package/dist/client/pages.d.ts.map +1 -0
- package/dist/client/pages.js +2 -0
- package/dist/client/pages.js.map +1 -0
- package/dist/client/routes.d.ts +22 -0
- package/dist/client/routes.d.ts.map +1 -0
- package/dist/client/routes.js +66 -0
- package/dist/client/routes.js.map +1 -0
- package/dist/client/wire.d.ts +44 -0
- package/dist/client/wire.d.ts.map +1 -0
- package/dist/client/wire.js +2 -0
- package/dist/client/wire.js.map +1 -0
- package/dist/config/config.d.ts +39 -0
- package/dist/config/config.d.ts.map +1 -0
- package/dist/config/config.js +44 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +3 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/sections.d.ts +243 -0
- package/dist/config/sections.d.ts.map +1 -0
- package/dist/config/sections.js +250 -0
- package/dist/config/sections.js.map +1 -0
- package/dist/console/command.d.ts +82 -0
- package/dist/console/command.d.ts.map +1 -0
- package/dist/console/command.js +82 -0
- package/dist/console/command.js.map +1 -0
- package/dist/console/index.d.ts +4 -0
- package/dist/console/index.d.ts.map +1 -0
- package/dist/console/index.js +4 -0
- package/dist/console/index.js.map +1 -0
- package/dist/console/io.d.ts +79 -0
- package/dist/console/io.d.ts.map +1 -0
- package/dist/console/io.js +214 -0
- package/dist/console/io.js.map +1 -0
- package/dist/console/kernel.d.ts +38 -0
- package/dist/console/kernel.d.ts.map +1 -0
- package/dist/console/kernel.js +279 -0
- package/dist/console/kernel.js.map +1 -0
- package/dist/container/container.d.ts +47 -0
- package/dist/container/container.d.ts.map +1 -0
- package/dist/container/container.js +130 -0
- package/dist/container/container.js.map +1 -0
- package/dist/container/index.d.ts +2 -0
- package/dist/container/index.d.ts.map +1 -0
- package/dist/container/index.js +2 -0
- package/dist/container/index.js.map +1 -0
- package/dist/cookie/index.d.ts +2 -0
- package/dist/cookie/index.d.ts.map +1 -0
- package/dist/cookie/index.js +2 -0
- package/dist/cookie/index.js.map +1 -0
- package/dist/crypt/crypt.d.ts +48 -0
- package/dist/crypt/crypt.d.ts.map +1 -0
- package/dist/crypt/crypt.js +151 -0
- package/dist/crypt/crypt.js.map +1 -0
- package/dist/crypt/index.d.ts +2 -0
- package/dist/crypt/index.d.ts.map +1 -0
- package/dist/crypt/index.js +2 -0
- package/dist/crypt/index.js.map +1 -0
- package/dist/db/codec.d.ts +36 -0
- package/dist/db/codec.d.ts.map +1 -0
- package/dist/db/codec.js +129 -0
- package/dist/db/codec.js.map +1 -0
- package/dist/db/contract.d.ts +103 -0
- package/dist/db/contract.d.ts.map +1 -0
- package/dist/db/contract.js +2 -0
- package/dist/db/contract.js.map +1 -0
- package/dist/db/db.d.ts +41 -0
- package/dist/db/db.d.ts.map +1 -0
- package/dist/db/db.js +48 -0
- package/dist/db/db.js.map +1 -0
- package/dist/db/drivers/better-sqlite3.d.ts +4 -0
- package/dist/db/drivers/better-sqlite3.d.ts.map +1 -0
- package/dist/db/drivers/better-sqlite3.js +49 -0
- package/dist/db/drivers/better-sqlite3.js.map +1 -0
- package/dist/db/drivers/mysql.d.ts +5 -0
- package/dist/db/drivers/mysql.d.ts.map +1 -0
- package/dist/db/drivers/mysql.js +318 -0
- package/dist/db/drivers/mysql.js.map +1 -0
- package/dist/db/drivers/pgsql.d.ts +5 -0
- package/dist/db/drivers/pgsql.d.ts.map +1 -0
- package/dist/db/drivers/pgsql.js +261 -0
- package/dist/db/drivers/pgsql.js.map +1 -0
- package/dist/db/drivers/sqlite.d.ts +51 -0
- package/dist/db/drivers/sqlite.d.ts.map +1 -0
- package/dist/db/drivers/sqlite.js +251 -0
- package/dist/db/drivers/sqlite.js.map +1 -0
- package/dist/db/errors.d.ts +65 -0
- package/dist/db/errors.d.ts.map +1 -0
- package/dist/db/errors.js +101 -0
- package/dist/db/errors.js.map +1 -0
- package/dist/db/grammars/grammar.d.ts +77 -0
- package/dist/db/grammars/grammar.d.ts.map +1 -0
- package/dist/db/grammars/grammar.js +345 -0
- package/dist/db/grammars/grammar.js.map +1 -0
- package/dist/db/grammars/mysql.d.ts +45 -0
- package/dist/db/grammars/mysql.d.ts.map +1 -0
- package/dist/db/grammars/mysql.js +147 -0
- package/dist/db/grammars/mysql.js.map +1 -0
- package/dist/db/grammars/pgsql.d.ts +20 -0
- package/dist/db/grammars/pgsql.d.ts.map +1 -0
- package/dist/db/grammars/pgsql.js +66 -0
- package/dist/db/grammars/pgsql.js.map +1 -0
- package/dist/db/grammars/sqlite.d.ts +27 -0
- package/dist/db/grammars/sqlite.d.ts.map +1 -0
- package/dist/db/grammars/sqlite.js +95 -0
- package/dist/db/grammars/sqlite.js.map +1 -0
- package/dist/db/index.d.ts +18 -0
- package/dist/db/index.d.ts.map +1 -0
- package/dist/db/index.js +17 -0
- package/dist/db/index.js.map +1 -0
- package/dist/db/kysely/index.d.ts +2 -0
- package/dist/db/kysely/index.d.ts.map +1 -0
- package/dist/db/kysely/index.js +2 -0
- package/dist/db/kysely/index.js.map +1 -0
- package/dist/db/kysely/kysely.d.ts +15 -0
- package/dist/db/kysely/kysely.d.ts.map +1 -0
- package/dist/db/kysely/kysely.js +127 -0
- package/dist/db/kysely/kysely.js.map +1 -0
- package/dist/db/manager.d.ts +138 -0
- package/dist/db/manager.d.ts.map +1 -0
- package/dist/db/manager.js +776 -0
- package/dist/db/manager.js.map +1 -0
- package/dist/db/pool.d.ts +28 -0
- package/dist/db/pool.d.ts.map +1 -0
- package/dist/db/pool.js +114 -0
- package/dist/db/pool.js.map +1 -0
- package/dist/db/query/builder.d.ts +290 -0
- package/dist/db/query/builder.d.ts.map +1 -0
- package/dist/db/query/builder.js +957 -0
- package/dist/db/query/builder.js.map +1 -0
- package/dist/db/query/state.d.ts +183 -0
- package/dist/db/query/state.d.ts.map +1 -0
- package/dist/db/query/state.js +48 -0
- package/dist/db/query/state.js.map +1 -0
- package/dist/db/sql.d.ts +82 -0
- package/dist/db/sql.d.ts.map +1 -0
- package/dist/db/sql.js +143 -0
- package/dist/db/sql.js.map +1 -0
- package/dist/env/env.d.ts +61 -0
- package/dist/env/env.d.ts.map +1 -0
- package/dist/env/env.js +184 -0
- package/dist/env/env.js.map +1 -0
- package/dist/env/index.d.ts +2 -0
- package/dist/env/index.d.ts.map +1 -0
- package/dist/env/index.js +2 -0
- package/dist/env/index.js.map +1 -0
- package/dist/errors/errors.d.ts +42 -0
- package/dist/errors/errors.d.ts.map +1 -0
- package/dist/errors/errors.js +60 -0
- package/dist/errors/errors.js.map +1 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +2 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/events/event.d.ts +52 -0
- package/dist/events/event.d.ts.map +1 -0
- package/dist/events/event.js +77 -0
- package/dist/events/event.js.map +1 -0
- package/dist/events/fake.d.ts +22 -0
- package/dist/events/fake.d.ts.map +1 -0
- package/dist/events/fake.js +53 -0
- package/dist/events/fake.js.map +1 -0
- package/dist/events/index.d.ts +6 -0
- package/dist/events/index.d.ts.map +1 -0
- package/dist/events/index.js +6 -0
- package/dist/events/index.js.map +1 -0
- package/dist/events/listener.d.ts +49 -0
- package/dist/events/listener.d.ts.map +1 -0
- package/dist/events/listener.js +31 -0
- package/dist/events/listener.js.map +1 -0
- package/dist/events/manager.d.ts +54 -0
- package/dist/events/manager.d.ts.map +1 -0
- package/dist/events/manager.js +166 -0
- package/dist/events/manager.js.map +1 -0
- package/dist/events/module.d.ts +10 -0
- package/dist/events/module.d.ts.map +1 -0
- package/dist/events/module.js +12 -0
- package/dist/events/module.js.map +1 -0
- package/dist/factory/factory.d.ts +93 -0
- package/dist/factory/factory.d.ts.map +1 -0
- package/dist/factory/factory.js +261 -0
- package/dist/factory/factory.js.map +1 -0
- package/dist/factory/fake.d.ts +92 -0
- package/dist/factory/fake.d.ts.map +1 -0
- package/dist/factory/fake.js +328 -0
- package/dist/factory/fake.js.map +1 -0
- package/dist/factory/index.d.ts +4 -0
- package/dist/factory/index.d.ts.map +1 -0
- package/dist/factory/index.js +4 -0
- package/dist/factory/index.js.map +1 -0
- package/dist/factory/seed.d.ts +21 -0
- package/dist/factory/seed.d.ts.map +1 -0
- package/dist/factory/seed.js +55 -0
- package/dist/factory/seed.js.map +1 -0
- package/dist/feature/index.d.ts +2 -0
- package/dist/feature/index.d.ts.map +1 -0
- package/dist/feature/index.js +2 -0
- package/dist/feature/index.js.map +1 -0
- package/dist/foundation/application.d.ts +156 -0
- package/dist/foundation/application.d.ts.map +1 -0
- package/dist/foundation/application.js +1258 -0
- package/dist/foundation/application.js.map +1 -0
- package/dist/foundation/cache-commands.d.ts +7 -0
- package/dist/foundation/cache-commands.d.ts.map +1 -0
- package/dist/foundation/cache-commands.js +48 -0
- package/dist/foundation/cache-commands.js.map +1 -0
- package/dist/foundation/command-result.d.ts +14 -0
- package/dist/foundation/command-result.d.ts.map +1 -0
- package/dist/foundation/command-result.js +43 -0
- package/dist/foundation/command-result.js.map +1 -0
- package/dist/foundation/commands.d.ts +159 -0
- package/dist/foundation/commands.d.ts.map +1 -0
- package/dist/foundation/commands.js +404 -0
- package/dist/foundation/commands.js.map +1 -0
- package/dist/foundation/database-commands.d.ts +24 -0
- package/dist/foundation/database-commands.d.ts.map +1 -0
- package/dist/foundation/database-commands.js +304 -0
- package/dist/foundation/database-commands.js.map +1 -0
- package/dist/foundation/debug-page.d.ts +11 -0
- package/dist/foundation/debug-page.d.ts.map +1 -0
- package/dist/foundation/debug-page.js +112 -0
- package/dist/foundation/debug-page.js.map +1 -0
- package/dist/foundation/dev-vite.d.ts +2 -0
- package/dist/foundation/dev-vite.d.ts.map +1 -0
- package/dist/foundation/dev-vite.js +39 -0
- package/dist/foundation/dev-vite.js.map +1 -0
- package/dist/foundation/dev.d.ts +31 -0
- package/dist/foundation/dev.d.ts.map +1 -0
- package/dist/foundation/dev.js +430 -0
- package/dist/foundation/dev.js.map +1 -0
- package/dist/foundation/discovery.d.ts +41 -0
- package/dist/foundation/discovery.d.ts.map +1 -0
- package/dist/foundation/discovery.js +69 -0
- package/dist/foundation/discovery.js.map +1 -0
- package/dist/foundation/error-pages.d.ts +10 -0
- package/dist/foundation/error-pages.d.ts.map +1 -0
- package/dist/foundation/error-pages.js +38 -0
- package/dist/foundation/error-pages.js.map +1 -0
- package/dist/foundation/exceptions.d.ts +20 -0
- package/dist/foundation/exceptions.d.ts.map +1 -0
- package/dist/foundation/exceptions.js +36 -0
- package/dist/foundation/exceptions.js.map +1 -0
- package/dist/foundation/generators.d.ts +71 -0
- package/dist/foundation/generators.d.ts.map +1 -0
- package/dist/foundation/generators.js +577 -0
- package/dist/foundation/generators.js.map +1 -0
- package/dist/foundation/helpers.d.ts +7 -0
- package/dist/foundation/helpers.d.ts.map +1 -0
- package/dist/foundation/helpers.js +12 -0
- package/dist/foundation/helpers.js.map +1 -0
- package/dist/foundation/index.d.ts +8 -0
- package/dist/foundation/index.d.ts.map +1 -0
- package/dist/foundation/index.js +8 -0
- package/dist/foundation/index.js.map +1 -0
- package/dist/foundation/install-api.d.ts +4 -0
- package/dist/foundation/install-api.d.ts.map +1 -0
- package/dist/foundation/install-api.js +91 -0
- package/dist/foundation/install-api.js.map +1 -0
- package/dist/foundation/provider.d.ts +83 -0
- package/dist/foundation/provider.d.ts.map +1 -0
- package/dist/foundation/provider.js +13 -0
- package/dist/foundation/provider.js.map +1 -0
- package/dist/foundation/queue-commands.d.ts +38 -0
- package/dist/foundation/queue-commands.d.ts.map +1 -0
- package/dist/foundation/queue-commands.js +279 -0
- package/dist/foundation/queue-commands.js.map +1 -0
- package/dist/foundation/route-types.d.ts +22 -0
- package/dist/foundation/route-types.d.ts.map +1 -0
- package/dist/foundation/route-types.js +158 -0
- package/dist/foundation/route-types.js.map +1 -0
- package/dist/foundation/schedule-commands.d.ts +4 -0
- package/dist/foundation/schedule-commands.d.ts.map +1 -0
- package/dist/foundation/schedule-commands.js +128 -0
- package/dist/foundation/schedule-commands.js.map +1 -0
- package/dist/foundation/stubs/api.d.ts +9 -0
- package/dist/foundation/stubs/api.d.ts.map +1 -0
- package/dist/foundation/stubs/api.js +225 -0
- package/dist/foundation/stubs/api.js.map +1 -0
- package/dist/foundation/stubs/handler.d.ts +15 -0
- package/dist/foundation/stubs/handler.d.ts.map +1 -0
- package/dist/foundation/stubs/handler.js +54 -0
- package/dist/foundation/stubs/handler.js.map +1 -0
- package/dist/foundation/stubs/others.d.ts +53 -0
- package/dist/foundation/stubs/others.d.ts.map +1 -0
- package/dist/foundation/stubs/others.js +159 -0
- package/dist/foundation/stubs/others.js.map +1 -0
- package/dist/foundation/test-command.d.ts +9 -0
- package/dist/foundation/test-command.d.ts.map +1 -0
- package/dist/foundation/test-command.js +43 -0
- package/dist/foundation/test-command.js.map +1 -0
- package/dist/hash/hash.d.ts +44 -0
- package/dist/hash/hash.d.ts.map +1 -0
- package/dist/hash/hash.js +94 -0
- package/dist/hash/hash.js.map +1 -0
- package/dist/hash/index.d.ts +2 -0
- package/dist/hash/index.d.ts.map +1 -0
- package/dist/hash/index.js +2 -0
- package/dist/hash/index.js.map +1 -0
- package/dist/http/cookies.d.ts +37 -0
- package/dist/http/cookies.d.ts.map +1 -0
- package/dist/http/cookies.js +86 -0
- package/dist/http/cookies.js.map +1 -0
- package/dist/http/csrf.d.ts +24 -0
- package/dist/http/csrf.d.ts.map +1 -0
- package/dist/http/csrf.js +93 -0
- package/dist/http/csrf.js.map +1 -0
- package/dist/http/form.d.ts +11 -0
- package/dist/http/form.d.ts.map +1 -0
- package/dist/http/form.js +57 -0
- package/dist/http/form.js.map +1 -0
- package/dist/http/index.d.ts +18 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +18 -0
- package/dist/http/index.js.map +1 -0
- package/dist/http/kernel.d.ts +82 -0
- package/dist/http/kernel.d.ts.map +1 -0
- package/dist/http/kernel.js +454 -0
- package/dist/http/kernel.js.map +1 -0
- package/dist/http/maintenance.d.ts +25 -0
- package/dist/http/maintenance.d.ts.map +1 -0
- package/dist/http/maintenance.js +70 -0
- package/dist/http/maintenance.js.map +1 -0
- package/dist/http/middleware.d.ts +75 -0
- package/dist/http/middleware.d.ts.map +1 -0
- package/dist/http/middleware.js +169 -0
- package/dist/http/middleware.js.map +1 -0
- package/dist/http/multipart.d.ts +4 -0
- package/dist/http/multipart.d.ts.map +1 -0
- package/dist/http/multipart.js +95 -0
- package/dist/http/multipart.js.map +1 -0
- package/dist/http/render.d.ts +19 -0
- package/dist/http/render.d.ts.map +1 -0
- package/dist/http/render.js +65 -0
- package/dist/http/render.js.map +1 -0
- package/dist/http/request.d.ts +106 -0
- package/dist/http/request.d.ts.map +1 -0
- package/dist/http/request.js +313 -0
- package/dist/http/request.js.map +1 -0
- package/dist/http/response.d.ts +128 -0
- package/dist/http/response.d.ts.map +1 -0
- package/dist/http/response.js +217 -0
- package/dist/http/response.js.map +1 -0
- package/dist/http/server.d.ts +27 -0
- package/dist/http/server.d.ts.map +1 -0
- package/dist/http/server.js +76 -0
- package/dist/http/server.js.map +1 -0
- package/dist/http/signature.d.ts +10 -0
- package/dist/http/signature.d.ts.map +1 -0
- package/dist/http/signature.js +42 -0
- package/dist/http/signature.js.map +1 -0
- package/dist/http/throttle.d.ts +26 -0
- package/dist/http/throttle.d.ts.map +1 -0
- package/dist/http/throttle.js +52 -0
- package/dist/http/throttle.js.map +1 -0
- package/dist/http/types.d.ts +66 -0
- package/dist/http/types.d.ts.map +1 -0
- package/dist/http/types.js +5 -0
- package/dist/http/types.js.map +1 -0
- package/dist/http/uploads.d.ts +46 -0
- package/dist/http/uploads.d.ts.map +1 -0
- package/dist/http/uploads.js +130 -0
- package/dist/http/uploads.js.map +1 -0
- package/dist/http/wire.d.ts +15 -0
- package/dist/http/wire.d.ts.map +1 -0
- package/dist/http/wire.js +114 -0
- package/dist/http/wire.js.map +1 -0
- package/dist/http/write.d.ts +13 -0
- package/dist/http/write.d.ts.map +1 -0
- package/dist/http/write.js +161 -0
- package/dist/http/write.js.map +1 -0
- package/dist/http-client/index.d.ts +2 -0
- package/dist/http-client/index.d.ts.map +1 -0
- package/dist/http-client/index.js +2 -0
- package/dist/http-client/index.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/inertia/index.d.ts +5 -0
- package/dist/inertia/index.d.ts.map +1 -0
- package/dist/inertia/index.js +4 -0
- package/dist/inertia/index.js.map +1 -0
- package/dist/inertia/inertia.d.ts +159 -0
- package/dist/inertia/inertia.d.ts.map +1 -0
- package/dist/inertia/inertia.js +406 -0
- package/dist/inertia/inertia.js.map +1 -0
- package/dist/inertia/props.d.ts +138 -0
- package/dist/inertia/props.d.ts.map +1 -0
- package/dist/inertia/props.js +138 -0
- package/dist/inertia/props.js.map +1 -0
- package/dist/inertia/resolve.d.ts +51 -0
- package/dist/inertia/resolve.d.ts.map +1 -0
- package/dist/inertia/resolve.js +289 -0
- package/dist/inertia/resolve.js.map +1 -0
- package/dist/inertia/response.d.ts +24 -0
- package/dist/inertia/response.d.ts.map +1 -0
- package/dist/inertia/response.js +49 -0
- package/dist/inertia/response.js.map +1 -0
- package/dist/inertia/ssr-worker.d.ts +25 -0
- package/dist/inertia/ssr-worker.d.ts.map +1 -0
- package/dist/inertia/ssr-worker.js +55 -0
- package/dist/inertia/ssr-worker.js.map +1 -0
- package/dist/inertia/ssr.d.ts +49 -0
- package/dist/inertia/ssr.d.ts.map +1 -0
- package/dist/inertia/ssr.js +273 -0
- package/dist/inertia/ssr.js.map +1 -0
- package/dist/log/channels.d.ts +27 -0
- package/dist/log/channels.d.ts.map +1 -0
- package/dist/log/channels.js +95 -0
- package/dist/log/channels.js.map +1 -0
- package/dist/log/index.d.ts +4 -0
- package/dist/log/index.d.ts.map +1 -0
- package/dist/log/index.js +4 -0
- package/dist/log/index.js.map +1 -0
- package/dist/log/log.d.ts +69 -0
- package/dist/log/log.d.ts.map +1 -0
- package/dist/log/log.js +173 -0
- package/dist/log/log.js.map +1 -0
- package/dist/log/record.d.ts +26 -0
- package/dist/log/record.d.ts.map +1 -0
- package/dist/log/record.js +89 -0
- package/dist/log/record.js.map +1 -0
- package/dist/mail/address.d.ts +27 -0
- package/dist/mail/address.d.ts.map +1 -0
- package/dist/mail/address.js +44 -0
- package/dist/mail/address.js.map +1 -0
- package/dist/mail/auth.d.ts +6 -0
- package/dist/mail/auth.d.ts.map +1 -0
- package/dist/mail/auth.js +39 -0
- package/dist/mail/auth.js.map +1 -0
- package/dist/mail/components.d.ts +29 -0
- package/dist/mail/components.d.ts.map +1 -0
- package/dist/mail/components.js +87 -0
- package/dist/mail/components.js.map +1 -0
- package/dist/mail/fake.d.ts +42 -0
- package/dist/mail/fake.d.ts.map +1 -0
- package/dist/mail/fake.js +111 -0
- package/dist/mail/fake.js.map +1 -0
- package/dist/mail/index.d.ts +9 -0
- package/dist/mail/index.d.ts.map +1 -0
- package/dist/mail/index.js +9 -0
- package/dist/mail/index.js.map +1 -0
- package/dist/mail/mail.d.ts +56 -0
- package/dist/mail/mail.d.ts.map +1 -0
- package/dist/mail/mail.js +68 -0
- package/dist/mail/mail.js.map +1 -0
- package/dist/mail/manager.d.ts +77 -0
- package/dist/mail/manager.d.ts.map +1 -0
- package/dist/mail/manager.js +160 -0
- package/dist/mail/manager.js.map +1 -0
- package/dist/mail/text.d.ts +3 -0
- package/dist/mail/text.d.ts.map +1 -0
- package/dist/mail/text.js +161 -0
- package/dist/mail/text.js.map +1 -0
- package/dist/mail/transport.d.ts +57 -0
- package/dist/mail/transport.d.ts.map +1 -0
- package/dist/mail/transport.js +41 -0
- package/dist/mail/transport.js.map +1 -0
- package/dist/migrations/create-database.d.ts +6 -0
- package/dist/migrations/create-database.d.ts.map +1 -0
- package/dist/migrations/create-database.js +23 -0
- package/dist/migrations/create-database.js.map +1 -0
- package/dist/migrations/dump.d.ts +27 -0
- package/dist/migrations/dump.d.ts.map +1 -0
- package/dist/migrations/dump.js +258 -0
- package/dist/migrations/dump.js.map +1 -0
- package/dist/migrations/files.d.ts +40 -0
- package/dist/migrations/files.d.ts.map +1 -0
- package/dist/migrations/files.js +101 -0
- package/dist/migrations/files.js.map +1 -0
- package/dist/migrations/index.d.ts +5 -0
- package/dist/migrations/index.d.ts.map +1 -0
- package/dist/migrations/index.js +5 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/migrations/migrator.d.ts +97 -0
- package/dist/migrations/migrator.d.ts.map +1 -0
- package/dist/migrations/migrator.js +383 -0
- package/dist/migrations/migrator.js.map +1 -0
- package/dist/model/checks.d.ts +10 -0
- package/dist/model/checks.d.ts.map +1 -0
- package/dist/model/checks.js +171 -0
- package/dist/model/checks.js.map +1 -0
- package/dist/model/columns.d.ts +153 -0
- package/dist/model/columns.d.ts.map +1 -0
- package/dist/model/columns.js +96 -0
- package/dist/model/columns.js.map +1 -0
- package/dist/model/describe.d.ts +36 -0
- package/dist/model/describe.d.ts.map +1 -0
- package/dist/model/describe.js +57 -0
- package/dist/model/describe.js.map +1 -0
- package/dist/model/drift.d.ts +15 -0
- package/dist/model/drift.d.ts.map +1 -0
- package/dist/model/drift.js +123 -0
- package/dist/model/drift.js.map +1 -0
- package/dist/model/errors.d.ts +33 -0
- package/dist/model/errors.d.ts.map +1 -0
- package/dist/model/errors.js +55 -0
- package/dist/model/errors.js.map +1 -0
- package/dist/model/index.d.ts +14 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/index.js +13 -0
- package/dist/model/index.js.map +1 -0
- package/dist/model/keys.d.ts +37 -0
- package/dist/model/keys.d.ts.map +1 -0
- package/dist/model/keys.js +39 -0
- package/dist/model/keys.js.map +1 -0
- package/dist/model/loading.d.ts +8 -0
- package/dist/model/loading.d.ts.map +1 -0
- package/dist/model/loading.js +201 -0
- package/dist/model/loading.js.map +1 -0
- package/dist/model/meta.d.ts +27 -0
- package/dist/model/meta.d.ts.map +1 -0
- package/dist/model/meta.js +110 -0
- package/dist/model/meta.js.map +1 -0
- package/dist/model/model.d.ts +107 -0
- package/dist/model/model.d.ts.map +1 -0
- package/dist/model/model.js +667 -0
- package/dist/model/model.js.map +1 -0
- package/dist/model/query.d.ts +214 -0
- package/dist/model/query.d.ts.map +1 -0
- package/dist/model/query.js +869 -0
- package/dist/model/query.js.map +1 -0
- package/dist/model/related.d.ts +40 -0
- package/dist/model/related.d.ts.map +1 -0
- package/dist/model/related.js +274 -0
- package/dist/model/related.js.map +1 -0
- package/dist/model/relations.d.ts +160 -0
- package/dist/model/relations.d.ts.map +1 -0
- package/dist/model/relations.js +44 -0
- package/dist/model/relations.js.map +1 -0
- package/dist/model/types.d.ts +461 -0
- package/dist/model/types.d.ts.map +1 -0
- package/dist/model/types.js +2 -0
- package/dist/model/types.js.map +1 -0
- package/dist/notification/index.d.ts +2 -0
- package/dist/notification/index.d.ts.map +1 -0
- package/dist/notification/index.js +2 -0
- package/dist/notification/index.js.map +1 -0
- package/dist/pagination/index.d.ts +2 -0
- package/dist/pagination/index.d.ts.map +1 -0
- package/dist/pagination/index.js +2 -0
- package/dist/pagination/index.js.map +1 -0
- package/dist/pagination/paginator.d.ts +174 -0
- package/dist/pagination/paginator.d.ts.map +1 -0
- package/dist/pagination/paginator.js +413 -0
- package/dist/pagination/paginator.js.map +1 -0
- package/dist/queue/batches.d.ts +152 -0
- package/dist/queue/batches.d.ts.map +1 -0
- package/dist/queue/batches.js +344 -0
- package/dist/queue/batches.js.map +1 -0
- package/dist/queue/database.d.ts +35 -0
- package/dist/queue/database.d.ts.map +1 -0
- package/dist/queue/database.js +137 -0
- package/dist/queue/database.js.map +1 -0
- package/dist/queue/driver.d.ts +72 -0
- package/dist/queue/driver.d.ts.map +1 -0
- package/dist/queue/driver.js +17 -0
- package/dist/queue/driver.js.map +1 -0
- package/dist/queue/envelope.d.ts +66 -0
- package/dist/queue/envelope.d.ts.map +1 -0
- package/dist/queue/envelope.js +81 -0
- package/dist/queue/envelope.js.map +1 -0
- package/dist/queue/failed.d.ts +43 -0
- package/dist/queue/failed.d.ts.map +1 -0
- package/dist/queue/failed.js +76 -0
- package/dist/queue/failed.js.map +1 -0
- package/dist/queue/fake.d.ts +68 -0
- package/dist/queue/fake.d.ts.map +1 -0
- package/dist/queue/fake.js +93 -0
- package/dist/queue/fake.js.map +1 -0
- package/dist/queue/index.d.ts +15 -0
- package/dist/queue/index.d.ts.map +1 -0
- package/dist/queue/index.js +15 -0
- package/dist/queue/index.js.map +1 -0
- package/dist/queue/job.d.ts +137 -0
- package/dist/queue/job.d.ts.map +1 -0
- package/dist/queue/job.js +154 -0
- package/dist/queue/job.js.map +1 -0
- package/dist/queue/manager.d.ts +116 -0
- package/dist/queue/manager.d.ts.map +1 -0
- package/dist/queue/manager.js +545 -0
- package/dist/queue/manager.js.map +1 -0
- package/dist/queue/middleware.d.ts +33 -0
- package/dist/queue/middleware.d.ts.map +1 -0
- package/dist/queue/middleware.js +88 -0
- package/dist/queue/middleware.js.map +1 -0
- package/dist/queue/module.d.ts +42 -0
- package/dist/queue/module.d.ts.map +1 -0
- package/dist/queue/module.js +68 -0
- package/dist/queue/module.js.map +1 -0
- package/dist/queue/redis.d.ts +27 -0
- package/dist/queue/redis.d.ts.map +1 -0
- package/dist/queue/redis.js +189 -0
- package/dist/queue/redis.js.map +1 -0
- package/dist/queue/runner.d.ts +79 -0
- package/dist/queue/runner.d.ts.map +1 -0
- package/dist/queue/runner.js +129 -0
- package/dist/queue/runner.js.map +1 -0
- package/dist/queue/sqs.d.ts +59 -0
- package/dist/queue/sqs.d.ts.map +1 -0
- package/dist/queue/sqs.js +323 -0
- package/dist/queue/sqs.js.map +1 -0
- package/dist/queue/worker.d.ts +59 -0
- package/dist/queue/worker.d.ts.map +1 -0
- package/dist/queue/worker.js +466 -0
- package/dist/queue/worker.js.map +1 -0
- package/dist/redis/index.d.ts +2 -0
- package/dist/redis/index.d.ts.map +1 -0
- package/dist/redis/index.js +2 -0
- package/dist/redis/index.js.map +1 -0
- package/dist/redis/redis.d.ts +41 -0
- package/dist/redis/redis.d.ts.map +1 -0
- package/dist/redis/redis.js +140 -0
- package/dist/redis/redis.js.map +1 -0
- package/dist/reverb/index.d.ts +2 -0
- package/dist/reverb/index.d.ts.map +1 -0
- package/dist/reverb/index.js +2 -0
- package/dist/reverb/index.js.map +1 -0
- package/dist/routing/index.d.ts +6 -0
- package/dist/routing/index.d.ts.map +1 -0
- package/dist/routing/index.js +6 -0
- package/dist/routing/index.js.map +1 -0
- package/dist/routing/paths.d.ts +27 -0
- package/dist/routing/paths.d.ts.map +1 -0
- package/dist/routing/paths.js +45 -0
- package/dist/routing/paths.js.map +1 -0
- package/dist/routing/router.d.ts +137 -0
- package/dist/routing/router.d.ts.map +1 -0
- package/dist/routing/router.js +236 -0
- package/dist/routing/router.js.map +1 -0
- package/dist/routing/routing.d.ts +34 -0
- package/dist/routing/routing.d.ts.map +1 -0
- package/dist/routing/routing.js +57 -0
- package/dist/routing/routing.js.map +1 -0
- package/dist/routing/table.d.ts +35 -0
- package/dist/routing/table.d.ts.map +1 -0
- package/dist/routing/table.js +247 -0
- package/dist/routing/table.js.map +1 -0
- package/dist/routing/urls.d.ts +34 -0
- package/dist/routing/urls.d.ts.map +1 -0
- package/dist/routing/urls.js +116 -0
- package/dist/routing/urls.js.map +1 -0
- package/dist/schedule/cron.d.ts +35 -0
- package/dist/schedule/cron.d.ts.map +1 -0
- package/dist/schedule/cron.js +212 -0
- package/dist/schedule/cron.js.map +1 -0
- package/dist/schedule/index.d.ts +5 -0
- package/dist/schedule/index.d.ts.map +1 -0
- package/dist/schedule/index.js +5 -0
- package/dist/schedule/index.js.map +1 -0
- package/dist/schedule/schedule.d.ts +38 -0
- package/dist/schedule/schedule.d.ts.map +1 -0
- package/dist/schedule/schedule.js +70 -0
- package/dist/schedule/schedule.js.map +1 -0
- package/dist/schedule/scheduler.d.ts +89 -0
- package/dist/schedule/scheduler.d.ts.map +1 -0
- package/dist/schedule/scheduler.js +404 -0
- package/dist/schedule/scheduler.js.map +1 -0
- package/dist/schedule/task.d.ts +150 -0
- package/dist/schedule/task.d.ts.map +1 -0
- package/dist/schedule/task.js +323 -0
- package/dist/schedule/task.js.map +1 -0
- package/dist/schema/blueprint.d.ts +256 -0
- package/dist/schema/blueprint.d.ts.map +1 -0
- package/dist/schema/blueprint.js +458 -0
- package/dist/schema/blueprint.js.map +1 -0
- package/dist/schema/builder.d.ts +40 -0
- package/dist/schema/builder.d.ts.map +1 -0
- package/dist/schema/builder.js +153 -0
- package/dist/schema/builder.js.map +1 -0
- package/dist/schema/grammars/grammar.d.ts +112 -0
- package/dist/schema/grammars/grammar.d.ts.map +1 -0
- package/dist/schema/grammars/grammar.js +231 -0
- package/dist/schema/grammars/grammar.js.map +1 -0
- package/dist/schema/grammars/mysql.d.ts +43 -0
- package/dist/schema/grammars/mysql.d.ts.map +1 -0
- package/dist/schema/grammars/mysql.js +220 -0
- package/dist/schema/grammars/mysql.js.map +1 -0
- package/dist/schema/grammars/pgsql.d.ts +33 -0
- package/dist/schema/grammars/pgsql.d.ts.map +1 -0
- package/dist/schema/grammars/pgsql.js +218 -0
- package/dist/schema/grammars/pgsql.js.map +1 -0
- package/dist/schema/grammars/sqlite-text.d.ts +24 -0
- package/dist/schema/grammars/sqlite-text.d.ts.map +1 -0
- package/dist/schema/grammars/sqlite-text.js +174 -0
- package/dist/schema/grammars/sqlite-text.js.map +1 -0
- package/dist/schema/grammars/sqlite.d.ts +39 -0
- package/dist/schema/grammars/sqlite.d.ts.map +1 -0
- package/dist/schema/grammars/sqlite.js +484 -0
- package/dist/schema/grammars/sqlite.js.map +1 -0
- package/dist/schema/index.d.ts +9 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +9 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/schema.d.ts +48 -0
- package/dist/schema/schema.d.ts.map +1 -0
- package/dist/schema/schema.js +47 -0
- package/dist/schema/schema.js.map +1 -0
- package/dist/scope/context.d.ts +39 -0
- package/dist/scope/context.d.ts.map +1 -0
- package/dist/scope/context.js +113 -0
- package/dist/scope/context.js.map +1 -0
- package/dist/scope/index.d.ts +3 -0
- package/dist/scope/index.d.ts.map +1 -0
- package/dist/scope/index.js +3 -0
- package/dist/scope/index.js.map +1 -0
- package/dist/scope/scope.d.ts +116 -0
- package/dist/scope/scope.d.ts.map +1 -0
- package/dist/scope/scope.js +148 -0
- package/dist/scope/scope.js.map +1 -0
- package/dist/session/cache-store.d.ts +17 -0
- package/dist/session/cache-store.d.ts.map +1 -0
- package/dist/session/cache-store.js +45 -0
- package/dist/session/cache-store.js.map +1 -0
- package/dist/session/database.d.ts +32 -0
- package/dist/session/database.d.ts.map +1 -0
- package/dist/session/database.js +98 -0
- package/dist/session/database.js.map +1 -0
- package/dist/session/index.d.ts +7 -0
- package/dist/session/index.d.ts.map +1 -0
- package/dist/session/index.js +7 -0
- package/dist/session/index.js.map +1 -0
- package/dist/session/manager.d.ts +61 -0
- package/dist/session/manager.d.ts.map +1 -0
- package/dist/session/manager.js +217 -0
- package/dist/session/manager.js.map +1 -0
- package/dist/session/middleware.d.ts +6 -0
- package/dist/session/middleware.d.ts.map +1 -0
- package/dist/session/middleware.js +76 -0
- package/dist/session/middleware.js.map +1 -0
- package/dist/session/session.d.ts +118 -0
- package/dist/session/session.d.ts.map +1 -0
- package/dist/session/session.js +223 -0
- package/dist/session/session.js.map +1 -0
- package/dist/session/stores.d.ts +36 -0
- package/dist/session/stores.d.ts.map +1 -0
- package/dist/session/stores.js +151 -0
- package/dist/session/stores.js.map +1 -0
- package/dist/storage/index.d.ts +2 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +2 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/str/index.d.ts +2 -0
- package/dist/str/index.d.ts.map +1 -0
- package/dist/str/index.js +2 -0
- package/dist/str/index.js.map +1 -0
- package/dist/str/str.d.ts +27 -0
- package/dist/str/str.d.ts.map +1 -0
- package/dist/str/str.js +102 -0
- package/dist/str/str.js.map +1 -0
- package/dist/support/clock.d.ts +6 -0
- package/dist/support/clock.d.ts.map +1 -0
- package/dist/support/clock.js +7 -0
- package/dist/support/clock.js.map +1 -0
- package/dist/support/data.d.ts +29 -0
- package/dist/support/data.d.ts.map +1 -0
- package/dist/support/data.js +160 -0
- package/dist/support/data.js.map +1 -0
- package/dist/support/index.d.ts +8 -0
- package/dist/support/index.d.ts.map +1 -0
- package/dist/support/index.js +7 -0
- package/dist/support/index.js.map +1 -0
- package/dist/support/register.d.ts +14 -0
- package/dist/support/register.d.ts.map +1 -0
- package/dist/support/register.js +2 -0
- package/dist/support/register.js.map +1 -0
- package/dist/support/text.d.ts +8 -0
- package/dist/support/text.d.ts.map +1 -0
- package/dist/support/text.js +19 -0
- package/dist/support/text.js.map +1 -0
- package/dist/support/type-assertions.d.ts +7 -0
- package/dist/support/type-assertions.d.ts.map +1 -0
- package/dist/support/type-assertions.js +10 -0
- package/dist/support/type-assertions.js.map +1 -0
- package/dist/support/types.d.ts +34 -0
- package/dist/support/types.d.ts.map +1 -0
- package/dist/support/types.js +31 -0
- package/dist/support/types.js.map +1 -0
- package/dist/support/units.d.ts +17 -0
- package/dist/support/units.d.ts.map +1 -0
- package/dist/support/units.js +54 -0
- package/dist/support/units.js.map +1 -0
- package/dist/task/index.d.ts +2 -0
- package/dist/task/index.d.ts.map +1 -0
- package/dist/task/index.js +2 -0
- package/dist/task/index.js.map +1 -0
- package/dist/task/task.d.ts +68 -0
- package/dist/task/task.d.ts.map +1 -0
- package/dist/task/task.js +162 -0
- package/dist/task/task.js.map +1 -0
- package/dist/testing/assert-database.d.ts +10 -0
- package/dist/testing/assert-database.d.ts.map +1 -0
- package/dist/testing/assert-database.js +125 -0
- package/dist/testing/assert-database.js.map +1 -0
- package/dist/testing/conformance/cache.d.ts +24 -0
- package/dist/testing/conformance/cache.d.ts.map +1 -0
- package/dist/testing/conformance/cache.js +397 -0
- package/dist/testing/conformance/cache.js.map +1 -0
- package/dist/testing/conformance/column-types.d.ts +44 -0
- package/dist/testing/conformance/column-types.d.ts.map +1 -0
- package/dist/testing/conformance/column-types.js +47 -0
- package/dist/testing/conformance/column-types.js.map +1 -0
- package/dist/testing/conformance/database.d.ts +11 -0
- package/dist/testing/conformance/database.d.ts.map +1 -0
- package/dist/testing/conformance/database.js +410 -0
- package/dist/testing/conformance/database.js.map +1 -0
- package/dist/testing/conformance/factories.d.ts +4 -0
- package/dist/testing/conformance/factories.d.ts.map +1 -0
- package/dist/testing/conformance/factories.js +313 -0
- package/dist/testing/conformance/factories.js.map +1 -0
- package/dist/testing/conformance/harness.d.ts +30 -0
- package/dist/testing/conformance/harness.d.ts.map +1 -0
- package/dist/testing/conformance/harness.js +85 -0
- package/dist/testing/conformance/harness.js.map +1 -0
- package/dist/testing/conformance/index.d.ts +13 -0
- package/dist/testing/conformance/index.d.ts.map +1 -0
- package/dist/testing/conformance/index.js +12 -0
- package/dist/testing/conformance/index.js.map +1 -0
- package/dist/testing/conformance/migrations.d.ts +4 -0
- package/dist/testing/conformance/migrations.d.ts.map +1 -0
- package/dist/testing/conformance/migrations.js +313 -0
- package/dist/testing/conformance/migrations.js.map +1 -0
- package/dist/testing/conformance/models.d.ts +4 -0
- package/dist/testing/conformance/models.d.ts.map +1 -0
- package/dist/testing/conformance/models.js +715 -0
- package/dist/testing/conformance/models.js.map +1 -0
- package/dist/testing/conformance/pagination.d.ts +4 -0
- package/dist/testing/conformance/pagination.d.ts.map +1 -0
- package/dist/testing/conformance/pagination.js +283 -0
- package/dist/testing/conformance/pagination.js.map +1 -0
- package/dist/testing/conformance/query-builder.d.ts +4 -0
- package/dist/testing/conformance/query-builder.d.ts.map +1 -0
- package/dist/testing/conformance/query-builder.js +725 -0
- package/dist/testing/conformance/query-builder.js.map +1 -0
- package/dist/testing/conformance/queue.d.ts +29 -0
- package/dist/testing/conformance/queue.d.ts.map +1 -0
- package/dist/testing/conformance/queue.js +203 -0
- package/dist/testing/conformance/queue.js.map +1 -0
- package/dist/testing/conformance/relationships.d.ts +4 -0
- package/dist/testing/conformance/relationships.d.ts.map +1 -0
- package/dist/testing/conformance/relationships.js +737 -0
- package/dist/testing/conformance/relationships.js.map +1 -0
- package/dist/testing/conformance/schema.d.ts +4 -0
- package/dist/testing/conformance/schema.d.ts.map +1 -0
- package/dist/testing/conformance/schema.js +320 -0
- package/dist/testing/conformance/schema.js.map +1 -0
- package/dist/testing/conformance/session.d.ts +22 -0
- package/dist/testing/conformance/session.d.ts.map +1 -0
- package/dist/testing/conformance/session.js +162 -0
- package/dist/testing/conformance/session.js.map +1 -0
- package/dist/testing/database.d.ts +28 -0
- package/dist/testing/database.d.ts.map +1 -0
- package/dist/testing/database.js +213 -0
- package/dist/testing/database.js.map +1 -0
- package/dist/testing/files.d.ts +11 -0
- package/dist/testing/files.d.ts.map +1 -0
- package/dist/testing/files.js +44 -0
- package/dist/testing/files.js.map +1 -0
- package/dist/testing/index.d.ts +7 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +7 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/inertia.d.ts +35 -0
- package/dist/testing/inertia.d.ts.map +1 -0
- package/dist/testing/inertia.js +127 -0
- package/dist/testing/inertia.js.map +1 -0
- package/dist/testing/query-log.d.ts +10 -0
- package/dist/testing/query-log.d.ts.map +1 -0
- package/dist/testing/query-log.js +31 -0
- package/dist/testing/query-log.js.map +1 -0
- package/dist/testing/response.d.ts +100 -0
- package/dist/testing/response.d.ts.map +1 -0
- package/dist/testing/response.js +329 -0
- package/dist/testing/response.js.map +1 -0
- package/dist/testing/testing.d.ts +191 -0
- package/dist/testing/testing.d.ts.map +1 -0
- package/dist/testing/testing.js +449 -0
- package/dist/testing/testing.js.map +1 -0
- package/dist/time/index.d.ts +3 -0
- package/dist/time/index.d.ts.map +1 -0
- package/dist/time/index.js +2 -0
- package/dist/time/index.js.map +1 -0
- package/dist/time/time.d.ts +39 -0
- package/dist/time/time.d.ts.map +1 -0
- package/dist/time/time.js +130 -0
- package/dist/time/time.js.map +1 -0
- package/dist/tracing/index.d.ts +2 -0
- package/dist/tracing/index.d.ts.map +1 -0
- package/dist/tracing/index.js +2 -0
- package/dist/tracing/index.js.map +1 -0
- package/dist/validation/index.d.ts +6 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +6 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/input.d.ts +89 -0
- package/dist/validation/input.d.ts.map +1 -0
- package/dist/validation/input.js +241 -0
- package/dist/validation/input.js.map +1 -0
- package/dist/validation/messages.d.ts +7 -0
- package/dist/validation/messages.d.ts.map +1 -0
- package/dist/validation/messages.js +93 -0
- package/dist/validation/messages.js.map +1 -0
- package/dist/validation/presence.d.ts +32 -0
- package/dist/validation/presence.d.ts.map +1 -0
- package/dist/validation/presence.js +17 -0
- package/dist/validation/presence.js.map +1 -0
- package/dist/validation/rules.d.ts +321 -0
- package/dist/validation/rules.d.ts.map +1 -0
- package/dist/validation/rules.js +603 -0
- package/dist/validation/rules.js.map +1 -0
- package/dist/validation/standard.d.ts +33 -0
- package/dist/validation/standard.d.ts.map +1 -0
- package/dist/validation/standard.js +10 -0
- package/dist/validation/standard.js.map +1 -0
- package/dist/view/channel.d.ts +13 -0
- package/dist/view/channel.d.ts.map +1 -0
- package/dist/view/channel.js +6 -0
- package/dist/view/channel.js.map +1 -0
- package/dist/view/head.d.ts +60 -0
- package/dist/view/head.d.ts.map +1 -0
- package/dist/view/head.js +122 -0
- package/dist/view/head.js.map +1 -0
- package/dist/view/helpers.d.ts +17 -0
- package/dist/view/helpers.d.ts.map +1 -0
- package/dist/view/helpers.js +19 -0
- package/dist/view/helpers.js.map +1 -0
- package/dist/view/html.d.ts +25 -0
- package/dist/view/html.d.ts.map +1 -0
- package/dist/view/html.js +291 -0
- package/dist/view/html.js.map +1 -0
- package/dist/view/index.d.ts +7 -0
- package/dist/view/index.d.ts.map +1 -0
- package/dist/view/index.js +7 -0
- package/dist/view/index.js.map +1 -0
- package/dist/view/translate.d.ts +14 -0
- package/dist/view/translate.d.ts.map +1 -0
- package/dist/view/translate.js +42 -0
- package/dist/view/translate.js.map +1 -0
- package/dist/vite/index.d.ts +3 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/index.js +3 -0
- package/dist/vite/index.js.map +1 -0
- package/dist/vite/plugin.d.ts +51 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/dist/vite/plugin.js +273 -0
- package/dist/vite/plugin.js.map +1 -0
- package/dist/vite/vite.d.ts +68 -0
- package/dist/vite/vite.d.ts.map +1 -0
- package/dist/vite/vite.js +228 -0
- package/dist/vite/vite.js.map +1 -0
- package/dist/workflow/index.d.ts +2 -0
- package/dist/workflow/index.d.ts.map +1 -0
- package/dist/workflow/index.js +2 -0
- package/dist/workflow/index.js.map +1 -0
- package/docs/authentication.md +428 -0
- package/docs/authorization.md +203 -0
- package/docs/cache.md +215 -0
- package/docs/configuration.md +86 -0
- package/docs/console.md +99 -0
- package/docs/container.md +58 -0
- package/docs/csrf.md +54 -0
- package/docs/database-testing.md +121 -0
- package/docs/database.md +314 -0
- package/docs/documentation.md +49 -0
- package/docs/encryption.md +104 -0
- package/docs/errors.md +85 -0
- package/docs/events.md +136 -0
- package/docs/factories.md +144 -0
- package/docs/hashing.md +78 -0
- package/docs/inertia.md +469 -0
- package/docs/installation.md +87 -0
- package/docs/lifecycle.md +84 -0
- package/docs/logging.md +49 -0
- package/docs/middleware.md +64 -0
- package/docs/migrations.md +192 -0
- package/docs/models.md +301 -0
- package/docs/pagination.md +129 -0
- package/docs/passwords.md +151 -0
- package/docs/providers.md +51 -0
- package/docs/queries.md +239 -0
- package/docs/queues.md +407 -0
- package/docs/rate-limiting.md +64 -0
- package/docs/redis.md +76 -0
- package/docs/relationships.md +251 -0
- package/docs/requests.md +53 -0
- package/docs/responses.md +71 -0
- package/docs/routing.md +84 -0
- package/docs/scheduling.md +177 -0
- package/docs/seeding.md +96 -0
- package/docs/session.md +138 -0
- package/docs/structure.md +45 -0
- package/docs/testing.md +134 -0
- package/docs/upgrade.md +42 -0
- package/docs/uploads.md +74 -0
- package/docs/validation.md +105 -0
- package/docs/verification.md +125 -0
- package/docs/views.md +94 -0
- package/docs/vite.md +193 -0
- package/package.json +272 -11
- package/src/auth/auth.ts +260 -0
- package/src/auth/errors.ts +69 -0
- package/src/auth/index.ts +34 -0
- package/src/auth/manager.ts +205 -0
- package/src/auth/middleware.ts +169 -0
- package/src/auth/passwords.ts +117 -0
- package/src/auth/policy.ts +184 -0
- package/src/auth/setup.ts +96 -0
- package/src/auth/state.ts +24 -0
- package/src/auth/tokens.ts +66 -0
- package/src/auth/verification.ts +85 -0
- package/src/aws/index.ts +10 -0
- package/src/aws/signer.ts +170 -0
- package/src/broadcast/index.ts +1 -0
- package/src/cache/cache.ts +495 -0
- package/src/cache/database.ts +243 -0
- package/src/cache/file.ts +262 -0
- package/src/cache/index.ts +26 -0
- package/src/cache/manager.ts +138 -0
- package/src/cache/module.ts +59 -0
- package/src/cache/rate-limiter.ts +183 -0
- package/src/cache/redis.ts +122 -0
- package/src/cache/store.ts +239 -0
- package/src/client/index.ts +3 -0
- package/src/client/pages.ts +90 -0
- package/src/client/routes.ts +90 -0
- package/src/client/wire.ts +93 -0
- package/src/config/config.ts +83 -0
- package/src/config/index.ts +27 -0
- package/src/config/sections.ts +501 -0
- package/src/console/command.ts +171 -0
- package/src/console/index.ts +13 -0
- package/src/console/io.ts +285 -0
- package/src/console/kernel.ts +309 -0
- package/src/container/container.ts +174 -0
- package/src/container/index.ts +1 -0
- package/src/cookie/index.ts +1 -0
- package/src/crypt/crypt.ts +185 -0
- package/src/crypt/index.ts +1 -0
- package/src/db/codec.ts +143 -0
- package/src/db/contract.ts +128 -0
- package/src/db/db.ts +72 -0
- package/src/db/drivers/better-sqlite3.ts +62 -0
- package/src/db/drivers/mysql.ts +379 -0
- package/src/db/drivers/pgsql.ts +293 -0
- package/src/db/drivers/sqlite.ts +321 -0
- package/src/db/errors.ts +149 -0
- package/src/db/grammars/grammar.ts +429 -0
- package/src/db/grammars/mysql.ts +181 -0
- package/src/db/grammars/pgsql.ts +83 -0
- package/src/db/grammars/sqlite.ts +109 -0
- package/src/db/index.ts +107 -0
- package/src/db/kysely/index.ts +1 -0
- package/src/db/kysely/kysely.ts +182 -0
- package/src/db/manager.ts +891 -0
- package/src/db/pool.ts +127 -0
- package/src/db/query/builder.ts +1245 -0
- package/src/db/query/state.ts +210 -0
- package/src/db/sql.ts +196 -0
- package/src/env/env.ts +224 -0
- package/src/env/index.ts +11 -0
- package/src/errors/errors.ts +83 -0
- package/src/errors/index.ts +1 -0
- package/src/events/event.ts +113 -0
- package/src/events/fake.ts +73 -0
- package/src/events/index.ts +16 -0
- package/src/events/listener.ts +86 -0
- package/src/events/manager.ts +192 -0
- package/src/events/module.ts +14 -0
- package/src/factory/factory.ts +394 -0
- package/src/factory/fake.ts +431 -0
- package/src/factory/index.ts +14 -0
- package/src/factory/seed.ts +72 -0
- package/src/feature/index.ts +1 -0
- package/src/foundation/application.ts +1419 -0
- package/src/foundation/cache-commands.ts +49 -0
- package/src/foundation/command-result.ts +46 -0
- package/src/foundation/commands.ts +432 -0
- package/src/foundation/database-commands.ts +321 -0
- package/src/foundation/debug-page.ts +142 -0
- package/src/foundation/dev-vite.ts +32 -0
- package/src/foundation/dev.ts +464 -0
- package/src/foundation/discovery.ts +96 -0
- package/src/foundation/error-pages.ts +32 -0
- package/src/foundation/exceptions.ts +56 -0
- package/src/foundation/generators.ts +642 -0
- package/src/foundation/helpers.ts +15 -0
- package/src/foundation/index.ts +16 -0
- package/src/foundation/install-api.ts +109 -0
- package/src/foundation/provider.ts +98 -0
- package/src/foundation/queue-commands.ts +301 -0
- package/src/foundation/route-types.ts +199 -0
- package/src/foundation/schedule-commands.ts +139 -0
- package/src/foundation/stubs/api.ts +232 -0
- package/src/foundation/stubs/handler.ts +76 -0
- package/src/foundation/stubs/others.ts +188 -0
- package/src/foundation/test-command.ts +40 -0
- package/src/hash/hash.ts +138 -0
- package/src/hash/index.ts +1 -0
- package/src/http/busboy.d.ts +31 -0
- package/src/http/cookies.ts +104 -0
- package/src/http/csrf.ts +102 -0
- package/src/http/form.ts +60 -0
- package/src/http/index.ts +87 -0
- package/src/http/kernel.ts +509 -0
- package/src/http/maintenance.ts +85 -0
- package/src/http/middleware.ts +229 -0
- package/src/http/multipart.ts +105 -0
- package/src/http/render.ts +77 -0
- package/src/http/request.ts +368 -0
- package/src/http/response.ts +301 -0
- package/src/http/server.ts +95 -0
- package/src/http/signature.ts +42 -0
- package/src/http/throttle.ts +67 -0
- package/src/http/types.ts +71 -0
- package/src/http/uploads.ts +139 -0
- package/src/http/wire.ts +104 -0
- package/src/http/write.ts +158 -0
- package/src/http-client/index.ts +1 -0
- package/src/index.ts +20 -0
- package/src/inertia/index.ts +26 -0
- package/src/inertia/inertia.ts +590 -0
- package/src/inertia/props.ts +237 -0
- package/src/inertia/resolve.ts +326 -0
- package/src/inertia/response.ts +66 -0
- package/src/inertia/ssr-worker.ts +66 -0
- package/src/inertia/ssr.ts +369 -0
- package/src/log/channels.ts +101 -0
- package/src/log/index.ts +3 -0
- package/src/log/log.ts +216 -0
- package/src/log/record.ts +107 -0
- package/src/mail/address.ts +60 -0
- package/src/mail/auth.ts +54 -0
- package/src/mail/components.ts +98 -0
- package/src/mail/fake.ts +131 -0
- package/src/mail/index.ts +38 -0
- package/src/mail/mail.ts +124 -0
- package/src/mail/manager.ts +212 -0
- package/src/mail/text.ts +150 -0
- package/src/mail/transport.ts +88 -0
- package/src/migrations/create-database.ts +27 -0
- package/src/migrations/dump.ts +317 -0
- package/src/migrations/files.ts +118 -0
- package/src/migrations/index.ts +21 -0
- package/src/migrations/migrator.ts +499 -0
- package/src/model/checks.ts +189 -0
- package/src/model/columns.ts +221 -0
- package/src/model/describe.ts +95 -0
- package/src/model/drift.ts +150 -0
- package/src/model/errors.ts +69 -0
- package/src/model/index.ts +96 -0
- package/src/model/keys.ts +73 -0
- package/src/model/loading.ts +226 -0
- package/src/model/meta.ts +120 -0
- package/src/model/model.ts +788 -0
- package/src/model/query.ts +1100 -0
- package/src/model/related.ts +336 -0
- package/src/model/relations.ts +211 -0
- package/src/model/types.ts +557 -0
- package/src/notification/index.ts +1 -0
- package/src/pagination/index.ts +21 -0
- package/src/pagination/paginator.ts +545 -0
- package/src/queue/batches.ts +481 -0
- package/src/queue/database.ts +177 -0
- package/src/queue/driver.ts +85 -0
- package/src/queue/envelope.ts +133 -0
- package/src/queue/failed.ts +119 -0
- package/src/queue/fake.ts +145 -0
- package/src/queue/index.ts +88 -0
- package/src/queue/job.ts +295 -0
- package/src/queue/manager.ts +636 -0
- package/src/queue/middleware.ts +111 -0
- package/src/queue/module.ts +74 -0
- package/src/queue/redis.ts +223 -0
- package/src/queue/runner.ts +185 -0
- package/src/queue/sqs.ts +381 -0
- package/src/queue/worker.ts +519 -0
- package/src/redis/index.ts +1 -0
- package/src/redis/redis.ts +158 -0
- package/src/reverb/index.ts +1 -0
- package/src/routing/index.ts +15 -0
- package/src/routing/paths.ts +67 -0
- package/src/routing/router.ts +346 -0
- package/src/routing/routing.ts +80 -0
- package/src/routing/table.ts +281 -0
- package/src/routing/urls.ts +139 -0
- package/src/schedule/cron.ts +221 -0
- package/src/schedule/index.ts +11 -0
- package/src/schedule/schedule.ts +99 -0
- package/src/schedule/scheduler.ts +455 -0
- package/src/schedule/task.ts +381 -0
- package/src/schema/blueprint.ts +684 -0
- package/src/schema/builder.ts +178 -0
- package/src/schema/grammars/grammar.ts +348 -0
- package/src/schema/grammars/mysql.ts +241 -0
- package/src/schema/grammars/pgsql.ts +248 -0
- package/src/schema/grammars/sqlite-text.ts +177 -0
- package/src/schema/grammars/sqlite.ts +540 -0
- package/src/schema/index.ts +25 -0
- package/src/schema/schema.ts +87 -0
- package/src/scope/context.ts +124 -0
- package/src/scope/index.ts +26 -0
- package/src/scope/scope.ts +250 -0
- package/src/session/cache-store.ts +57 -0
- package/src/session/database.ts +121 -0
- package/src/session/index.ts +24 -0
- package/src/session/manager.ts +251 -0
- package/src/session/middleware.ts +79 -0
- package/src/session/session.ts +282 -0
- package/src/session/stores.ts +173 -0
- package/src/storage/index.ts +1 -0
- package/src/str/index.ts +1 -0
- package/src/str/str.ts +115 -0
- package/src/support/clock.ts +11 -0
- package/src/support/data.ts +156 -0
- package/src/support/index.ts +26 -0
- package/src/support/register.ts +13 -0
- package/src/support/text.ts +17 -0
- package/src/support/type-assertions.ts +14 -0
- package/src/support/types.ts +80 -0
- package/src/support/units.ts +67 -0
- package/src/task/index.ts +14 -0
- package/src/task/task.ts +199 -0
- package/src/testing/assert-database.ts +145 -0
- package/src/testing/conformance/cache.ts +453 -0
- package/src/testing/conformance/column-types.ts +47 -0
- package/src/testing/conformance/database.ts +512 -0
- package/src/testing/conformance/factories.ts +350 -0
- package/src/testing/conformance/harness.ts +107 -0
- package/src/testing/conformance/index.ts +12 -0
- package/src/testing/conformance/migrations.ts +400 -0
- package/src/testing/conformance/models.ts +810 -0
- package/src/testing/conformance/pagination.ts +324 -0
- package/src/testing/conformance/query-builder.ts +900 -0
- package/src/testing/conformance/queue.ts +239 -0
- package/src/testing/conformance/relationships.ts +948 -0
- package/src/testing/conformance/schema.ts +373 -0
- package/src/testing/conformance/session.ts +190 -0
- package/src/testing/database.ts +245 -0
- package/src/testing/files.ts +46 -0
- package/src/testing/index.ts +15 -0
- package/src/testing/inertia.ts +151 -0
- package/src/testing/query-log.ts +34 -0
- package/src/testing/response.ts +391 -0
- package/src/testing/testing.ts +593 -0
- package/src/time/index.ts +2 -0
- package/src/time/time.ts +143 -0
- package/src/tracing/index.ts +1 -0
- package/src/validation/index.ts +38 -0
- package/src/validation/input.ts +334 -0
- package/src/validation/messages.ts +96 -0
- package/src/validation/presence.ts +52 -0
- package/src/validation/rules.ts +839 -0
- package/src/validation/standard.ts +45 -0
- package/src/view/channel.ts +16 -0
- package/src/view/head.ts +165 -0
- package/src/view/helpers.ts +29 -0
- package/src/view/html.ts +303 -0
- package/src/view/index.ts +6 -0
- package/src/view/translate.ts +48 -0
- package/src/vite/index.ts +2 -0
- package/src/vite/plugin.ts +311 -0
- package/src/vite/vite.ts +302 -0
- package/src/workflow/index.ts +1 -0
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
// `mimar dev`: the processes of development under one command. The server runs as `node main.ts serve` and starts
|
|
2
|
+
// again when one of its files changes; a queue worker (`queue:work`) runs beside it when QUEUE_CONNECTION is not sync,
|
|
3
|
+
// and starts again with it; Vite's development server runs when the application has a vite.config; `mimar types`
|
|
4
|
+
// writes the browser's routes at the start and whenever the routes may have changed. Every
|
|
5
|
+
// line a process writes is shown with its name in front. A process that stops on its own is reported and started
|
|
6
|
+
// again, while the others keep running. Ctrl+C stops them all.
|
|
7
|
+
//
|
|
8
|
+
// Each long-running process has an IPC channel to this one. Closing it is how a process is asked to stop, the same way
|
|
9
|
+
// on every platform (Windows has no SIGTERM), and a process whose `mimar dev` goes away, killed or with its terminal
|
|
10
|
+
// closed, sees the channel close and stops as well, so nothing is left running.
|
|
11
|
+
import { type ChildProcess, spawn } from 'node:child_process'
|
|
12
|
+
import { existsSync, type FSWatcher, readFileSync, rmSync, watch } from 'node:fs'
|
|
13
|
+
import { createRequire } from 'node:module'
|
|
14
|
+
import { dirname, join, resolve as resolvePath, sep } from 'node:path'
|
|
15
|
+
import type { Readable } from 'node:stream'
|
|
16
|
+
import { fileURLToPath } from 'node:url'
|
|
17
|
+
import { styleText } from 'node:util'
|
|
18
|
+
import { defineCommand, flag, type Io } from '../console/index.ts'
|
|
19
|
+
import { processEnvironment } from '../env/index.ts'
|
|
20
|
+
import { QueueManager } from '../queue/index.ts'
|
|
21
|
+
import { currentApplication } from '../scope/index.ts'
|
|
22
|
+
import { isServerFile, routeFiles, serverFiles } from '../vite/index.ts'
|
|
23
|
+
import type { Application } from './application.ts'
|
|
24
|
+
|
|
25
|
+
type Color = Parameters<typeof styleText>[0]
|
|
26
|
+
|
|
27
|
+
/** How long a process asked to stop may take before it is ended. */
|
|
28
|
+
const stopTimeoutMs = 5000
|
|
29
|
+
/** A process that stopped after running this long did not fail as it started: it is started again after a second. */
|
|
30
|
+
const steadyMs = 10_000
|
|
31
|
+
/** The longest wait before a process that keeps failing is started again. */
|
|
32
|
+
const longestWaitMs = 30_000
|
|
33
|
+
/** Changes this close together restart the server once. */
|
|
34
|
+
const settleMs = 150
|
|
35
|
+
|
|
36
|
+
const viteConfigs = ['vite.config.ts', 'vite.config.mts', 'vite.config.cts', 'vite.config.js', 'vite.config.mjs', 'vite.config.cjs']
|
|
37
|
+
const viteRunner = fileURLToPath(new URL(import.meta.url.endsWith('.ts') ? './dev-vite.ts' : './dev-vite.js', import.meta.url))
|
|
38
|
+
|
|
39
|
+
export interface DevelopmentOptions {
|
|
40
|
+
/** The application's root folder, where main.ts is. */
|
|
41
|
+
readonly root: string
|
|
42
|
+
/** Vite's hot file (VITE_HOT_FILE), from the root or absolute: removed when Vite ends without removing it. */
|
|
43
|
+
readonly hotFile: string
|
|
44
|
+
/** SERVER_HOST for the server, from `--host`. */
|
|
45
|
+
readonly host?: string | undefined
|
|
46
|
+
/** SERVER_PORT for the server, from `--port`. */
|
|
47
|
+
readonly port?: number | undefined
|
|
48
|
+
/** Whether to run Vite's development server, when there is a vite.config. */
|
|
49
|
+
readonly vite: boolean
|
|
50
|
+
/** Whether to run a queue worker: QUEUE_CONNECTION is not sync, and --no-queue was not given. */
|
|
51
|
+
readonly queue?: boolean
|
|
52
|
+
/** Where the output goes; its signal stops everything. */
|
|
53
|
+
readonly io: Io
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Runs the server, the queue worker, Vite and `mimar types` until `io.signal` aborts, then stops them all. Returns the exit code. */
|
|
57
|
+
export async function runDevelopment(options: DevelopmentOptions): Promise<number> {
|
|
58
|
+
const { root, io } = options
|
|
59
|
+
const main = join(root, 'main.ts')
|
|
60
|
+
if (!existsSync(main)) {
|
|
61
|
+
io.error(`mimar dev runs main.ts, and there is none in ${root}.`)
|
|
62
|
+
return 1
|
|
63
|
+
}
|
|
64
|
+
const node = nodeFlags(process.execArgv)
|
|
65
|
+
const env: NodeJS.ProcessEnv = { ...processEnvironment(), MIMAR_DEV: '1' }
|
|
66
|
+
if (options.host !== undefined) env.SERVER_HOST = options.host
|
|
67
|
+
if (options.port !== undefined) env.SERVER_PORT = String(options.port)
|
|
68
|
+
// The processes write to a pipe, not the terminal, so they are told that colours are wanted.
|
|
69
|
+
if (io.colors && env.FORCE_COLOR === undefined && env.NO_COLOR === undefined) env.FORCE_COLOR = '1'
|
|
70
|
+
|
|
71
|
+
const viteConfig = options.vite ? viteConfigs.find((name) => existsSync(join(root, name))) : undefined
|
|
72
|
+
const viteInstalled = viteConfig !== undefined && resolves(root, 'vite')
|
|
73
|
+
const output = new Output(io, [
|
|
74
|
+
'server',
|
|
75
|
+
'types',
|
|
76
|
+
...(options.queue === true ? ['queue'] : []),
|
|
77
|
+
...(viteConfig !== undefined ? ['vite'] : []),
|
|
78
|
+
])
|
|
79
|
+
const context: Context = { root, env, output }
|
|
80
|
+
const server = new Supervised({ name: 'server', color: 'blue', args: [...node, main, 'serve'] }, context)
|
|
81
|
+
// Jobs are the server's files too, so the worker starts again with the server, and runs the code as it is now.
|
|
82
|
+
const worker =
|
|
83
|
+
options.queue === true ? new Supervised({ name: 'queue', color: 'green', args: [...node, main, 'queue:work'] }, context) : null
|
|
84
|
+
const vite = viteInstalled
|
|
85
|
+
? new Supervised(
|
|
86
|
+
{
|
|
87
|
+
name: 'vite',
|
|
88
|
+
color: 'magenta',
|
|
89
|
+
args: [...node, viteRunner],
|
|
90
|
+
// laravel-vite-plugin removes the hot file as Vite exits, but not when Vite is ended: then the server
|
|
91
|
+
// would point the browser at a development server that is gone.
|
|
92
|
+
exited: () => {
|
|
93
|
+
try {
|
|
94
|
+
rmSync(resolvePath(root, options.hotFile), { force: true })
|
|
95
|
+
} catch {
|
|
96
|
+
// Locked or not ours to remove: the server reads a stale hot file until Vite writes it again.
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
context,
|
|
101
|
+
)
|
|
102
|
+
: null
|
|
103
|
+
const types = new RouteTypes(context, [...node, main, 'types', '--quiet'])
|
|
104
|
+
if (viteConfig !== undefined && !viteInstalled) {
|
|
105
|
+
output.note('vite', 'magenta', `There is a ${viteConfig}, but Vite is not installed: npm install --save-dev vite`, 'warn')
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
server.start()
|
|
109
|
+
worker?.start()
|
|
110
|
+
vite?.start()
|
|
111
|
+
types.run()
|
|
112
|
+
|
|
113
|
+
const changes = new Set<string>()
|
|
114
|
+
let settle: NodeJS.Timeout | undefined
|
|
115
|
+
const watcher = watchServerFiles(root, (path) => {
|
|
116
|
+
if (!isServerFile(path)) return
|
|
117
|
+
changes.add(path)
|
|
118
|
+
clearTimeout(settle)
|
|
119
|
+
settle = setTimeout(() => {
|
|
120
|
+
const paths = [...changes].sort()
|
|
121
|
+
changes.clear()
|
|
122
|
+
const reason = paths.length === 1 ? `${paths[0]} changed` : `${paths.length} files changed`
|
|
123
|
+
server.restart(reason)
|
|
124
|
+
worker?.restart(reason)
|
|
125
|
+
if (paths.some((changed) => isServerFile(changed, routeFiles))) types.run()
|
|
126
|
+
}, settleMs)
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
await new Promise<void>((resolve) => {
|
|
130
|
+
if (io.signal.aborted) resolve()
|
|
131
|
+
else io.signal.addEventListener('abort', () => resolve(), { once: true })
|
|
132
|
+
})
|
|
133
|
+
clearTimeout(settle)
|
|
134
|
+
watcher.close()
|
|
135
|
+
await Promise.all([server.close(), worker?.close(), vite?.close(), types.close()])
|
|
136
|
+
return 0
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** What the processes share: where they run, their environment, and where their output goes. */
|
|
140
|
+
interface Context {
|
|
141
|
+
readonly root: string
|
|
142
|
+
readonly env: NodeJS.ProcessEnv
|
|
143
|
+
readonly output: Output
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** What `mimar dev` writes: each line of a process with its name in front, and its own notes about them. */
|
|
147
|
+
class Output {
|
|
148
|
+
readonly #io: Io
|
|
149
|
+
readonly #width: number
|
|
150
|
+
|
|
151
|
+
constructor(io: Io, names: readonly string[]) {
|
|
152
|
+
this.#io = io
|
|
153
|
+
this.#width = Math.max(...names.map((name) => name.length))
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
line(name: string, color: Color, text: string): void {
|
|
157
|
+
this.#io.write(`${this.#paint(color, name.padEnd(this.#width))} | ${text}\n`)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** A note of `mimar dev`'s own about a process: grey, or yellow when something went wrong. */
|
|
161
|
+
note(name: string, color: Color, text: string, tone: 'plain' | 'warn' = 'plain'): void {
|
|
162
|
+
this.line(name, color, this.#paint(tone === 'warn' ? 'yellow' : 'gray', text))
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
#paint(color: Color, text: string): string {
|
|
166
|
+
return this.#io.colors ? styleText(color, text, { validateStream: false }) : text
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
interface ProcessSpec {
|
|
171
|
+
readonly name: string
|
|
172
|
+
readonly color: Color
|
|
173
|
+
/** Node's arguments: its flags, then the script and the script's own arguments. */
|
|
174
|
+
readonly args: readonly string[]
|
|
175
|
+
/** Called after the process ends, however it ended. */
|
|
176
|
+
readonly exited?: () => void
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** A long-running process: started, stopped, restarted, and started again when it stops on its own. */
|
|
180
|
+
class Supervised {
|
|
181
|
+
readonly #spec: ProcessSpec
|
|
182
|
+
readonly #context: Context
|
|
183
|
+
#child: ChildProcess | null = null
|
|
184
|
+
#exited: Promise<void> = Promise.resolve()
|
|
185
|
+
#stopping = false
|
|
186
|
+
#closed = false
|
|
187
|
+
#startedAt = 0
|
|
188
|
+
#failures = 0
|
|
189
|
+
#retry: NodeJS.Timeout | undefined
|
|
190
|
+
#queue: Promise<void> = Promise.resolve()
|
|
191
|
+
#restartQueued = false
|
|
192
|
+
|
|
193
|
+
constructor(spec: ProcessSpec, context: Context) {
|
|
194
|
+
this.#spec = spec
|
|
195
|
+
this.#context = context
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
start(): void {
|
|
199
|
+
clearTimeout(this.#retry)
|
|
200
|
+
this.#retry = undefined
|
|
201
|
+
if (this.#closed || this.#child !== null) return
|
|
202
|
+
const { name, color } = this.#spec
|
|
203
|
+
const output = this.#context.output
|
|
204
|
+
const child = spawn(process.execPath, this.#spec.args, {
|
|
205
|
+
cwd: this.#context.root,
|
|
206
|
+
env: this.#context.env,
|
|
207
|
+
// stdin stays open and unused: Vite also stops when it closes.
|
|
208
|
+
stdio: ['pipe', 'pipe', 'pipe', 'ipc'],
|
|
209
|
+
})
|
|
210
|
+
this.#child = child
|
|
211
|
+
this.#startedAt = performance.now()
|
|
212
|
+
const show = (line: string) => output.line(name, color, line)
|
|
213
|
+
if (child.stdout !== null) lines(child.stdout, show)
|
|
214
|
+
if (child.stderr !== null) lines(child.stderr, show)
|
|
215
|
+
child.stdin?.on('error', () => {})
|
|
216
|
+
this.#exited = new Promise((resolve) => {
|
|
217
|
+
let ended = false
|
|
218
|
+
const end = (code: number | null, signal: NodeJS.Signals | null) => {
|
|
219
|
+
if (ended) return
|
|
220
|
+
ended = true
|
|
221
|
+
this.#child = null
|
|
222
|
+
this.#spec.exited?.()
|
|
223
|
+
resolve()
|
|
224
|
+
if (!this.#stopping) this.#stoppedOnItsOwn(code, signal)
|
|
225
|
+
}
|
|
226
|
+
child.once('exit', end)
|
|
227
|
+
child.on('error', (error) => {
|
|
228
|
+
output.note(name, color, `could not be started: ${error.message}`, 'warn')
|
|
229
|
+
// A process that never started ends with no exit event.
|
|
230
|
+
if (child.pid === undefined) end(1, null)
|
|
231
|
+
})
|
|
232
|
+
})
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
#stoppedOnItsOwn(code: number | null, signal: NodeJS.Signals | null): void {
|
|
236
|
+
// Ctrl+C reaches every process in the terminal at once, and one may end before `mimar dev` hears of it.
|
|
237
|
+
setTimeout(() => {
|
|
238
|
+
if (this.#closed || this.#child !== null || this.#restartQueued) return
|
|
239
|
+
this.#failures = performance.now() - this.#startedAt < steadyMs ? this.#failures + 1 : 1
|
|
240
|
+
const wait = Math.min(longestWaitMs, 1000 * 2 ** (this.#failures - 1))
|
|
241
|
+
const how = signal !== null ? `was ended by ${signal}` : `exited with code ${code}`
|
|
242
|
+
this.#context.output.note(this.#spec.name, this.#spec.color, `${how}; starting it again in ${wait / 1000} s`, 'warn')
|
|
243
|
+
this.#retry = setTimeout(() => this.start(), wait)
|
|
244
|
+
}, 100)
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** Asks the process to stop, and ends it when it has not stopped within 5 seconds. Cancels a start that waits. */
|
|
248
|
+
async stop(): Promise<void> {
|
|
249
|
+
clearTimeout(this.#retry)
|
|
250
|
+
this.#retry = undefined
|
|
251
|
+
const child = this.#child
|
|
252
|
+
if (child === null) return
|
|
253
|
+
if (this.#stopping) return this.#exited
|
|
254
|
+
this.#stopping = true
|
|
255
|
+
if (child.connected) child.disconnect()
|
|
256
|
+
else child.kill('SIGTERM')
|
|
257
|
+
const timer = setTimeout(() => {
|
|
258
|
+
this.#context.output.note(
|
|
259
|
+
this.#spec.name,
|
|
260
|
+
this.#spec.color,
|
|
261
|
+
`did not stop within ${stopTimeoutMs / 1000} s, so it was ended (something in it keeps Node running)`,
|
|
262
|
+
'warn',
|
|
263
|
+
)
|
|
264
|
+
child.kill('SIGKILL')
|
|
265
|
+
}, stopTimeoutMs)
|
|
266
|
+
await this.#exited
|
|
267
|
+
clearTimeout(timer)
|
|
268
|
+
this.#stopping = false
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Stops the process and starts it again: once, however many more changes come in while the old one stops. */
|
|
272
|
+
restart(reason: string): void {
|
|
273
|
+
if (this.#closed || this.#restartQueued) return
|
|
274
|
+
this.#restartQueued = true
|
|
275
|
+
this.#queue = this.#queue.then(async () => {
|
|
276
|
+
this.#context.output.note(this.#spec.name, this.#spec.color, `${reason}; ${this.#child === null ? 'starting' : 'restarting'}`)
|
|
277
|
+
await this.stop()
|
|
278
|
+
this.#restartQueued = false
|
|
279
|
+
this.start()
|
|
280
|
+
})
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
async close(): Promise<void> {
|
|
284
|
+
this.#closed = true
|
|
285
|
+
clearTimeout(this.#retry)
|
|
286
|
+
await this.#queue
|
|
287
|
+
await this.stop()
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* `mimar types`, one run at a time: asked again during a run, it runs once more after it. It writes nothing to the
|
|
293
|
+
* output unless it wrote the file, or failed.
|
|
294
|
+
*/
|
|
295
|
+
class RouteTypes {
|
|
296
|
+
readonly #context: Context
|
|
297
|
+
readonly #args: readonly string[]
|
|
298
|
+
#child: ChildProcess | null = null
|
|
299
|
+
#again = false
|
|
300
|
+
#closed = false
|
|
301
|
+
|
|
302
|
+
constructor(context: Context, args: readonly string[]) {
|
|
303
|
+
this.#context = context
|
|
304
|
+
this.#args = args
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
run(): void {
|
|
308
|
+
if (this.#closed) return
|
|
309
|
+
if (this.#child !== null) {
|
|
310
|
+
this.#again = true
|
|
311
|
+
return
|
|
312
|
+
}
|
|
313
|
+
const { root, env, output } = this.#context
|
|
314
|
+
const file = join(root, '.mimar', 'routes.ts')
|
|
315
|
+
const before = contents(file)
|
|
316
|
+
const child = spawn(process.execPath, this.#args, { cwd: root, env, stdio: ['ignore', 'pipe', 'pipe'] })
|
|
317
|
+
this.#child = child
|
|
318
|
+
const written: string[] = []
|
|
319
|
+
if (child.stdout !== null) lines(child.stdout, (line) => written.push(line))
|
|
320
|
+
if (child.stderr !== null) lines(child.stderr, (line) => written.push(line))
|
|
321
|
+
child.on('error', (error) => written.push(error.message))
|
|
322
|
+
child.once('close', (code) => {
|
|
323
|
+
this.#child = null
|
|
324
|
+
if (this.#closed) return
|
|
325
|
+
if (code === 0) {
|
|
326
|
+
if (contents(file) !== before) output.note('types', 'green', 'wrote .mimar/routes.ts')
|
|
327
|
+
} else {
|
|
328
|
+
for (const line of written) output.line('types', 'green', line)
|
|
329
|
+
output.note('types', 'green', 'mimar types failed, so app/generated/routes is out of date', 'warn')
|
|
330
|
+
}
|
|
331
|
+
if (this.#again) {
|
|
332
|
+
this.#again = false
|
|
333
|
+
this.run()
|
|
334
|
+
}
|
|
335
|
+
})
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
async close(): Promise<void> {
|
|
339
|
+
this.#closed = true
|
|
340
|
+
const child = this.#child
|
|
341
|
+
if (child === null || child.exitCode !== null || child.signalCode !== null) return
|
|
342
|
+
const exited = new Promise((resolve) => child.once('exit', resolve))
|
|
343
|
+
child.kill()
|
|
344
|
+
await exited
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Watches the server's files folder by folder (so never node_modules), and calls `changed` with the path of each file
|
|
350
|
+
* that changes, from the root with `/` separators. A folder that does not exist yet is watched once it appears.
|
|
351
|
+
*/
|
|
352
|
+
function watchServerFiles(root: string, changed: (path: string) => void): { close(): void } {
|
|
353
|
+
const folders = new Map<string, FSWatcher | null>()
|
|
354
|
+
const files = new Set<string>()
|
|
355
|
+
for (const pattern of serverFiles) {
|
|
356
|
+
const segments = pattern.split('/')
|
|
357
|
+
const fixed = segments.findIndex((segment) => /[*?{[]/.test(segment))
|
|
358
|
+
if (fixed === -1 && segments.length === 1) files.add(pattern)
|
|
359
|
+
else folders.set(fixed === -1 ? dirname(pattern) : segments.slice(0, fixed).join('/'), null)
|
|
360
|
+
}
|
|
361
|
+
const attach = () => {
|
|
362
|
+
for (const [folder, watcher] of folders) {
|
|
363
|
+
if (watcher !== null || !existsSync(join(root, folder))) continue
|
|
364
|
+
try {
|
|
365
|
+
const next = watch(join(root, folder), { recursive: true }, (_event, name) => {
|
|
366
|
+
if (name !== null) changed(`${folder}/${name.split(sep).join('/')}`)
|
|
367
|
+
})
|
|
368
|
+
next.on('error', () => {
|
|
369
|
+
next.close()
|
|
370
|
+
folders.set(folder, null)
|
|
371
|
+
})
|
|
372
|
+
folders.set(folder, next)
|
|
373
|
+
} catch {
|
|
374
|
+
// Gone again, or not a folder: tried again on the next change at the root.
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
attach()
|
|
379
|
+
const top = watch(root, (_event, name) => {
|
|
380
|
+
if (name !== null && files.has(name)) changed(name)
|
|
381
|
+
attach()
|
|
382
|
+
})
|
|
383
|
+
top.on('error', () => top.close())
|
|
384
|
+
return {
|
|
385
|
+
close() {
|
|
386
|
+
top.close()
|
|
387
|
+
for (const watcher of folders.values()) watcher?.close()
|
|
388
|
+
},
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/** Calls `each` with every line of `stream`, and with the last one when it has no line break. */
|
|
393
|
+
function lines(stream: Readable, each: (line: string) => void): void {
|
|
394
|
+
let rest = ''
|
|
395
|
+
stream.setEncoding('utf8')
|
|
396
|
+
stream.on('data', (chunk: string) => {
|
|
397
|
+
const parts = `${rest}${chunk}`.split(/\r?\n/)
|
|
398
|
+
rest = parts.pop() ?? ''
|
|
399
|
+
for (const part of parts) each(part)
|
|
400
|
+
})
|
|
401
|
+
stream.on('end', () => {
|
|
402
|
+
if (rest !== '') each(rest)
|
|
403
|
+
rest = ''
|
|
404
|
+
})
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* This process's Node flags, for the processes it starts, less those two processes cannot share: a debugger's port
|
|
409
|
+
* and watch mode.
|
|
410
|
+
*/
|
|
411
|
+
export function nodeFlags(execArgv: readonly string[]): string[] {
|
|
412
|
+
const withValue = ['--inspect-port', '--inspect-publish-uid', '--watch-path', '--watch-kill-signal']
|
|
413
|
+
const flags: string[] = []
|
|
414
|
+
for (let index = 0; index < execArgv.length; index++) {
|
|
415
|
+
const flag = execArgv[index]!
|
|
416
|
+
if (/^--(?:inspect|watch)(?:-[a-z-]+)?(?:=.*)?$/.test(flag)) {
|
|
417
|
+
if (withValue.includes(flag)) index++
|
|
418
|
+
continue
|
|
419
|
+
}
|
|
420
|
+
flags.push(flag)
|
|
421
|
+
}
|
|
422
|
+
return flags
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
function resolves(root: string, specifier: string): boolean {
|
|
426
|
+
try {
|
|
427
|
+
createRequire(join(root, 'package.json')).resolve(specifier)
|
|
428
|
+
return true
|
|
429
|
+
} catch {
|
|
430
|
+
return false
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
function contents(file: string): string | null {
|
|
435
|
+
try {
|
|
436
|
+
return readFileSync(file, 'utf8')
|
|
437
|
+
} catch {
|
|
438
|
+
return null
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
export const devCommand = defineCommand({
|
|
443
|
+
name: 'dev',
|
|
444
|
+
description: 'Run the application for development: the server, restarted when its files change, a queue worker, Vite and mimar types.',
|
|
445
|
+
flags: {
|
|
446
|
+
host: flag.string('The address the server listens on (SERVER_HOST).').optional(),
|
|
447
|
+
port: flag.number('The port the server listens on (SERVER_PORT).').optional(),
|
|
448
|
+
vite: flag.boolean("Run Vite's development server when there is a vite.config; --no-vite leaves it out.").default(true),
|
|
449
|
+
queue: flag.boolean('Run a queue worker when QUEUE_CONNECTION is not sync; --no-queue leaves it out.').default(true),
|
|
450
|
+
},
|
|
451
|
+
run({ flags, io }) {
|
|
452
|
+
const application = currentApplication('mimar dev') as Application
|
|
453
|
+
const queues = application.resolve(QueueManager)
|
|
454
|
+
return runDevelopment({
|
|
455
|
+
root: application.basePath,
|
|
456
|
+
hotFile: application.config.vite.hotFile,
|
|
457
|
+
host: flags.host,
|
|
458
|
+
port: flags.port,
|
|
459
|
+
vite: flags.vite,
|
|
460
|
+
queue: flags.queue && !queues.isSync(queues.config.default),
|
|
461
|
+
io,
|
|
462
|
+
})
|
|
463
|
+
},
|
|
464
|
+
})
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Discovery: the application's convention folders are walked at boot and every export carrying a known brand is
|
|
2
|
+
// collected. Importing a file registers nothing by itself; this is the only place definitions are gathered.
|
|
3
|
+
import { existsSync, readdirSync, statSync } from 'node:fs'
|
|
4
|
+
import { join, relative, sep } from 'node:path'
|
|
5
|
+
import { pathToFileURL } from 'node:url'
|
|
6
|
+
|
|
7
|
+
/** The folders discovery walks, relative to the application root. */
|
|
8
|
+
export interface DiscoveryOptions {
|
|
9
|
+
config?: string | false
|
|
10
|
+
models?: string | false
|
|
11
|
+
jobs?: string | false
|
|
12
|
+
events?: string | false
|
|
13
|
+
listeners?: string | false
|
|
14
|
+
commands?: string | false
|
|
15
|
+
workflows?: string | false
|
|
16
|
+
features?: string | false
|
|
17
|
+
/** Migrations are only listed at boot, never imported by discovery: a migration's file is imported when it runs. */
|
|
18
|
+
migrations?: string | false
|
|
19
|
+
seeders?: string | false
|
|
20
|
+
factories?: string | false
|
|
21
|
+
/** Handler files: checked at boot for inputs that do not say who may send them. */
|
|
22
|
+
handlers?: string | false
|
|
23
|
+
/** Shared inputs: checked at boot like the handlers. */
|
|
24
|
+
inputs?: string | false
|
|
25
|
+
/** Mailables: named by their export in messages, and checked for duplicate names. */
|
|
26
|
+
mail?: string | false
|
|
27
|
+
/** The schedule: a file, not a folder. */
|
|
28
|
+
schedule?: string | false
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const defaultDiscovery: Readonly<Required<DiscoveryOptions>> = Object.freeze({
|
|
32
|
+
config: 'config',
|
|
33
|
+
models: 'app/models',
|
|
34
|
+
jobs: 'app/jobs',
|
|
35
|
+
events: 'app/events',
|
|
36
|
+
listeners: 'app/listeners',
|
|
37
|
+
commands: 'app/console/commands',
|
|
38
|
+
workflows: 'app/workflows',
|
|
39
|
+
features: 'app/features',
|
|
40
|
+
migrations: 'database/migrations',
|
|
41
|
+
seeders: 'database/seeders',
|
|
42
|
+
factories: 'database/factories',
|
|
43
|
+
handlers: 'app/http/handlers',
|
|
44
|
+
inputs: 'app/http/inputs',
|
|
45
|
+
mail: 'app/mail',
|
|
46
|
+
schedule: 'app/console/schedule.ts',
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
/** One export found by discovery, with where it came from. */
|
|
50
|
+
export interface Discovered {
|
|
51
|
+
readonly value: unknown
|
|
52
|
+
/** `app/console/commands/publish-post.ts publishPost`, for messages and `mimar about`. */
|
|
53
|
+
readonly source: string
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function files(directory: string): string[] {
|
|
57
|
+
if (!existsSync(directory)) return []
|
|
58
|
+
if (statSync(directory).isFile()) return [directory]
|
|
59
|
+
const found: string[] = []
|
|
60
|
+
const visit = (current: string) => {
|
|
61
|
+
for (const entry of readdirSync(current).sort()) {
|
|
62
|
+
if (entry.startsWith('.') || entry === 'node_modules') continue
|
|
63
|
+
const path = join(current, entry)
|
|
64
|
+
if (statSync(path).isDirectory()) visit(path)
|
|
65
|
+
else if (/\.ts$/.test(entry) && !/\.(test|test-d|d)\.ts$/.test(entry)) found.push(path)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
visit(directory)
|
|
69
|
+
return found
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** One imported file: where it is, and its exports by name. */
|
|
73
|
+
export interface DiscoveredModule {
|
|
74
|
+
/** `app/models/post.ts`. */
|
|
75
|
+
readonly file: string
|
|
76
|
+
readonly exports: Readonly<Record<string, unknown>>
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Imports every `.ts` file in `folder`, sorted by path so the order is the same on every system. */
|
|
80
|
+
export async function discoverModules(basePath: string, folder: string): Promise<DiscoveredModule[]> {
|
|
81
|
+
const found: DiscoveredModule[] = []
|
|
82
|
+
for (const file of files(join(basePath, folder))) {
|
|
83
|
+
const exports = (await import(pathToFileURL(file).href)) as Record<string, unknown>
|
|
84
|
+
found.push({ file: relative(basePath, file).split(sep).join('/'), exports })
|
|
85
|
+
}
|
|
86
|
+
return found
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Imports every `.ts` file in `folder` and lists its exports. */
|
|
90
|
+
export async function discover(basePath: string, folder: string): Promise<Discovered[]> {
|
|
91
|
+
const found: Discovered[] = []
|
|
92
|
+
for (const { file, exports } of await discoverModules(basePath, folder)) {
|
|
93
|
+
for (const [name, value] of Object.entries(exports)) found.push({ value, source: `${file} ${name}` })
|
|
94
|
+
}
|
|
95
|
+
return found
|
|
96
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// The application's error pages: resources/views/errors/404.ts, 4xx.ts, 5xx.ts, 419.ts, 503.ts…, each default-exporting
|
|
2
|
+
// `(error: ErrorPage) => Html`. The exact status wins over its class.
|
|
3
|
+
import { existsSync, readdirSync } from 'node:fs'
|
|
4
|
+
import { join } from 'node:path'
|
|
5
|
+
import { pathToFileURL } from 'node:url'
|
|
6
|
+
import type { ErrorPage, Html } from '../view/index.ts'
|
|
7
|
+
|
|
8
|
+
export type ErrorPageView = (error: ErrorPage) => Html | string
|
|
9
|
+
|
|
10
|
+
/** Loads the error pages of an application. Returns the problems for files that do not export a view. */
|
|
11
|
+
export async function loadErrorPages(basePath: string): Promise<{ pages: Map<string, ErrorPageView>; problems: string[] }> {
|
|
12
|
+
const pages = new Map<string, ErrorPageView>()
|
|
13
|
+
const problems: string[] = []
|
|
14
|
+
const directory = join(basePath, 'resources', 'views', 'errors')
|
|
15
|
+
if (!existsSync(directory)) return { pages, problems }
|
|
16
|
+
for (const file of readdirSync(directory).sort()) {
|
|
17
|
+
const match = /^(\d{3}|[45]xx)\.ts$/.exec(file)
|
|
18
|
+
if (match === null) continue
|
|
19
|
+
const module = (await import(pathToFileURL(join(directory, file)).href)) as { default?: unknown }
|
|
20
|
+
if (typeof module.default !== 'function') {
|
|
21
|
+
problems.push(`resources/views/errors/${file} must default-export a view: export default (error: ErrorPage) => html\`…\`.`)
|
|
22
|
+
continue
|
|
23
|
+
}
|
|
24
|
+
pages.set(match[1]!, module.default as ErrorPageView)
|
|
25
|
+
}
|
|
26
|
+
return { pages, problems }
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The page for a status: the exact one, else its class (4xx, 5xx). */
|
|
30
|
+
export function pageFor(pages: ReadonlyMap<string, ErrorPageView>, status: number): ErrorPageView | undefined {
|
|
31
|
+
return pages.get(String(status)) ?? pages.get(`${Math.floor(status / 100)}xx`)
|
|
32
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
// What `.withExceptions((exceptions) => …)` and a provider's `app.exceptions()` receive, with Laravel's method names.
|
|
2
|
+
import type { HttpRequest, HttpResponse } from '../http/index.ts'
|
|
3
|
+
|
|
4
|
+
type ErrorClass<E extends Error = Error> = abstract new (...args: never[]) => E
|
|
5
|
+
|
|
6
|
+
export type ReportHook = (error: unknown, information: Readonly<Record<string, unknown>>) => void | Promise<void>
|
|
7
|
+
|
|
8
|
+
export class Exceptions {
|
|
9
|
+
readonly #reporters: ReportHook[] = []
|
|
10
|
+
readonly #ignored: ErrorClass[] = []
|
|
11
|
+
readonly #renderers: {
|
|
12
|
+
type: ErrorClass
|
|
13
|
+
render: (error: never, request: HttpRequest<unknown>) => HttpResponse | Promise<HttpResponse>
|
|
14
|
+
}[] = []
|
|
15
|
+
readonly #dontFlash: string[] = ['password', 'passwordConfirmation', 'currentPassword']
|
|
16
|
+
|
|
17
|
+
/** Calls `hook` for every reported error (send it to Sentry, page someone). */
|
|
18
|
+
report(hook: ReportHook): void {
|
|
19
|
+
this.#reporters.push(hook)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Errors of these classes are never reported. */
|
|
23
|
+
dontReport(...types: ErrorClass[]): void {
|
|
24
|
+
this.#ignored.push(...types)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Renders errors of `type` yourself. The first matching renderer wins. */
|
|
28
|
+
render<E extends Error>(
|
|
29
|
+
type: ErrorClass<E>,
|
|
30
|
+
render: (error: E, request: HttpRequest<unknown>) => HttpResponse | Promise<HttpResponse>,
|
|
31
|
+
): void {
|
|
32
|
+
this.#renderers.push({ type, render: render as (error: never, request: HttpRequest<unknown>) => HttpResponse })
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Fields never flashed back to a form after a validation error (password fields are already on the list). */
|
|
36
|
+
dontFlash(...fields: string[]): void {
|
|
37
|
+
this.#dontFlash.push(...fields)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
shouldReport(error: unknown): boolean {
|
|
41
|
+
return !this.#ignored.some((type) => error instanceof type)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
get reporters(): readonly ReportHook[] {
|
|
45
|
+
return this.#reporters
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
get flashExceptions(): readonly string[] {
|
|
49
|
+
return this.#dontFlash
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async renderFor(error: unknown, request: HttpRequest<unknown>): Promise<HttpResponse | null> {
|
|
53
|
+
const match = this.#renderers.find((entry) => error instanceof entry.type)
|
|
54
|
+
return match ? await match.render(error as never, request) : null
|
|
55
|
+
}
|
|
56
|
+
}
|