diff --git a/.env b/.env index 79e7408..161a0e3 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ TZ=UTC -APP_KEY=gPcUOP5OFpP6fgblb2APfEdyX_fHroZc +APP_KEY=development-app-key-not-used-in-production DATABASE_SERVER=postgres://postgres:@127.0.0.1:5432 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0ab7011 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + - package-ecosystem: 'npm' + directory: '/' + schedule: + interval: 'weekly' + allow: + - dependency-type: 'all' + + - package-ecosystem: 'github-actions' + directory: '/' + schedule: + interval: 'daily' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..902fad6 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,84 @@ +name: CI + +on: [push] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: checkout repository + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.tool-versions' + cache: 'npm' + - name: npm + run: npm ci + - name: lint + run: npm run lint + schema: + runs-on: ubuntu-latest + + env: + DATABASE_SERVER: postgres://postgres:postgres@localhost:5432 + + services: + postgres: + image: postgres:15.5-alpine + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: adonisjs_template_development + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 5 + + steps: + - name: checkout repository + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.tool-versions' + cache: 'npm' + - name: npm + run: npm ci + - name: run migrations + run: | + node ace db:migrate + - name: check git diff + run: git diff --exit-code database/types.d.ts + + tests: + runs-on: ubuntu-latest + + env: + DATABASE_SERVER: postgres://postgres:postgres@localhost:5432 + NODE_ENV: test + + services: + postgres: + image: postgres:15.5-alpine + env: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: adonisjs_template_test + ports: + - 5432:5432 + options: --health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 5 + + steps: + - name: checkout repository + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: '.tool-versions' + cache: 'npm' + - name: npm + run: npm ci + - name: playwright + run: npx playwright install chromium + - name: run migrations + run: | + node ace db:migrate + - name: tests + run: node ace test --coverage diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..86560b2 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs v20.16.0 diff --git a/app/services/db.ts b/app/services/db.ts index a7b28f2..e9c2b9d 100644 --- a/app/services/db.ts +++ b/app/services/db.ts @@ -5,7 +5,7 @@ import env from '#start/env' import { databaseConfig } from '#config/database' const dialect = new PostgresDialect({ - pool: new PG.Pool(databaseConfig[env.get('NODE_ENV')]()), + pool: new PG.Pool(databaseConfig[env.get('NODE_ENV') as keyof typeof databaseConfig]()), }) export const globalDb = new Kysely({ diff --git a/commands/db_migrate.ts b/commands/db_migrate.ts index a33a974..3cbf19c 100644 --- a/commands/db_migrate.ts +++ b/commands/db_migrate.ts @@ -7,6 +7,8 @@ import type { CommandOptions } from '@adonisjs/core/types/ace' import { databaseConfig } from '#config/database' import { Cli as kyselyCodegenCli } from 'kysely-codegen/dist/cli/cli.js' import env from '#start/env' +import { default as PG } from 'pg' +import { promisify } from 'node:util' export default class KyselyMigrate extends BaseCommand { static commandName = 'db:migrate' @@ -45,7 +47,10 @@ export default class KyselyMigrate extends BaseCommand { * Runs migrations up method */ async run() { - this.logger.info(`Migrating ${databaseConfig[env.get('NODE_ENV')]().database}`) + const config = databaseConfig[env.get('NODE_ENV') as keyof typeof databaseConfig]() + const client = new PG.Client(config) + + this.logger.info(`Migrating ${client.database}`) const { error, results } = await this.migrator.migrateToLatest() @@ -78,8 +83,8 @@ export default class KyselyMigrate extends BaseCommand { * Update database types */ this.logger.info('Updating database types with kysely-codegen') - const config = databaseConfig[env.get('NODE_ENV')]() - const url = `postgres://${config.user}:${config.password}@${config.host}:${config.port}/${config.database}` + const url = `postgres://${client.user}:${client.password}@${client.host}:${client.port}/${client.database}` + await new kyselyCodegenCli().generate({ url, dialectName: 'postgres', diff --git a/config/app.ts b/config/app.ts index 1292af7..e61d5fa 100644 --- a/config/app.ts +++ b/config/app.ts @@ -10,7 +10,7 @@ import { defineConfig } from '@adonisjs/core/http' * The encryption module will fail to decrypt data if the key is lost or * changed. Therefore it is recommended to keep the app key secure. */ -export const appKey = new Secret(env.get('APP_KEY')) +export const appKey = new Secret(env.get('APP_KEY', 'non-production-app-key')) /** * The configuration settings used by the HTTP server diff --git a/config/database.ts b/config/database.ts index 9fc7b59..f36f736 100644 --- a/config/database.ts +++ b/config/database.ts @@ -2,8 +2,6 @@ import env from '#start/env' import { basename, join } from 'node:path' import PG from 'pg' -type DatabaseConfig = Record PG.ClientConfig> - const requireEnvVar = (key: string) => { const value = env.get(key) if (!value) throw new Error(`${key} required for ${env.get('NODE_ENV')}`) @@ -13,13 +11,13 @@ const requireEnvVar = (key: string) => { const appFolderName = basename(join(import.meta.dirname, '..')).replace(/[^\w]+/, '_') // const type = Record<> -export const databaseConfig: DatabaseConfig = { - production: () => { +export const databaseConfig = { + production: (): PG.ClientConfig => { return { connectionString: requireEnvVar('DATABASE_URL'), } }, - development: () => { + development: (): PG.ClientConfig => { const url = new URL(requireEnvVar('DATABASE_SERVER')) return { host: url.hostname, @@ -29,7 +27,7 @@ export const databaseConfig: DatabaseConfig = { database: `${appFolderName}_development`, } }, - test: () => { + test: (): PG.ClientConfig => { const url = new URL(requireEnvVar('DATABASE_SERVER')) return { host: url.hostname, diff --git a/package-lock.json b/package-lock.json index eeb2453..6ee1e23 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,36 +17,39 @@ "@adonisjs/session": "^7.4.1", "@adonisjs/shield": "^8.1.1", "@adonisjs/static": "^1.1.1", + "@adonisjs/tsconfig": "^1.3.0", "@adonisjs/vite": "^3.0.0", "@heroicons/react": "^2.1.5", "@inertiajs/react": "^1.2.0", "@playwright/test": "^1.47.0", "@tailwindcss/aspect-ratio": "^0.4.2", - "@types/color-string": "^1.5.5", "@vinejs/vine": "^2.1.0", "classnames": "^2.5.1", "color-string": "^1.9.1", "edge.js": "^6.0.2", "kysely": "^0.27.4", + "kysely-codegen": "^0.16.3", "luxon": "^3.5.0", "pg": "^8.12.0", "react": "^18.3.1", "react-dom": "^18.3.1", "reflect-metadata": "^0.2.2", "sass-embedded": "^1.78.0", + "ts-node-maintained": "^10.9.4", + "typescript": "^5.4.5", "zod": "^3.23.8" }, "devDependencies": { "@adonisjs/assembler": "^7.8.2", "@adonisjs/eslint-config": "^2.0.0-beta.6", "@adonisjs/prettier-config": "^1.4.0", - "@adonisjs/tsconfig": "^1.3.0", "@japa/api-client": "^2.0.3", "@japa/assert": "^3.0.0", "@japa/browser-client": "^2.0.3", "@japa/plugin-adonisjs": "^3.0.1", "@japa/runner": "^3.1.4", "@swc/core": "^1.6.3", + "@types/color-string": "^1.5.5", "@types/luxon": "^3.4.2", "@types/node": "^20.14.5", "@types/pg": "^8.11.8", @@ -60,7 +63,6 @@ "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.7", - "kysely-codegen": "^0.16.3", "monocart-coverage-reports": "^2.11.1", "pino-pretty": "^11.2.1", "playwright": "^1.46.1", @@ -71,8 +73,6 @@ "stylelint-config-sass-guidelines": "^12.1.0", "stylelint-config-tailwindcss": "^0.0.7", "tailwindcss": "^3.4.10", - "ts-node-maintained": "^10.9.4", - "typescript": "^5.4.5", "v8-to-istanbul": "^9.3.0", "vite": "^5.3.1", "vite-plugin-istanbul": "^6.0.2" @@ -740,7 +740,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/@adonisjs/tsconfig/-/tsconfig-1.3.0.tgz", "integrity": "sha512-+nOykDG44b4JSAdsrTdh5HuZqJpr6F+dHpfNYgHfYsFJIEtZo8plHilZAM7iabCRN5R49SPv5p8Ixcp47Rr50g==", - "dev": true, "license": "MIT" }, "node_modules/@adonisjs/vite": { @@ -1386,7 +1385,6 @@ "version": "0.8.1", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", - "devOptional": true, "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "0.3.9" @@ -2529,7 +2527,6 @@ "version": "0.3.9", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "devOptional": true, "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", @@ -3249,7 +3246,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -3266,7 +3262,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -3283,7 +3278,6 @@ "cpu": [ "arm" ], - "dev": true, "license": "Apache-2.0", "optional": true, "os": [ @@ -3300,7 +3294,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -3317,7 +3310,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -3334,7 +3326,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -3351,7 +3342,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -3368,7 +3358,6 @@ "cpu": [ "arm64" ], - "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -3385,7 +3374,6 @@ "cpu": [ "ia32" ], - "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -3402,7 +3390,6 @@ "cpu": [ "x64" ], - "dev": true, "license": "Apache-2.0 AND MIT", "optional": true, "os": [ @@ -3461,28 +3448,24 @@ "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", - "devOptional": true, "license": "MIT" }, "node_modules/@tsconfig/node12": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", - "devOptional": true, "license": "MIT" }, "node_modules/@tsconfig/node14": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", - "devOptional": true, "license": "MIT" }, "node_modules/@tsconfig/node16": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", - "devOptional": true, "license": "MIT" }, "node_modules/@tuyau/utils": { @@ -3553,6 +3536,7 @@ "version": "1.5.5", "resolved": "https://registry.npmjs.org/@types/color-string/-/color-string-1.5.5.tgz", "integrity": "sha512-p9+C1ssJsjnHV8nn96rkimm2h90LclLIwgBfiMCHW0oUr6jLmB+wzZUEGJPduB/D2RzI2Ahoe69xKNOawX6jgw==", + "dev": true, "license": "MIT" }, "node_modules/@types/cookiejar": { @@ -3638,7 +3622,6 @@ "version": "20.16.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.2.tgz", "integrity": "sha512-91s/n4qUPV/wg8eE9KHYW1kouTfDk2FPGjXbBMfRWP/2vg1rCXNQL1OCabwGs0XSdukuK+MwCDXE30QpSeMUhQ==", - "devOptional": true, "license": "MIT", "dependencies": { "undici-types": "~6.19.2" @@ -4138,7 +4121,6 @@ "version": "8.3.4", "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", - "devOptional": true, "license": "MIT", "dependencies": { "acorn": "^8.11.0" @@ -4347,7 +4329,6 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "devOptional": true, "license": "MIT" }, "node_modules/argparse": { @@ -5316,7 +5297,6 @@ "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true, "license": "MIT" }, "node_modules/console-grid": { @@ -5543,7 +5523,6 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "devOptional": true, "license": "MIT" }, "node_modules/cross-spawn": { @@ -5905,7 +5884,6 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "devOptional": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" @@ -5956,7 +5934,6 @@ "version": "11.0.6", "resolved": "https://registry.npmjs.org/dotenv-expand/-/dotenv-expand-11.0.6.tgz", "integrity": "sha512-8NHi73otpWsZGBSZwwknTXS5pqMOrk9+Ssrna8xCaxkzEpU9OTf9R5ArQGVw03//Zmk9MOwLPng9WwndvpAJ5g==", - "dev": true, "license": "BSD-2-Clause", "dependencies": { "dotenv": "^16.4.4" @@ -7231,7 +7208,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, "license": "ISC" }, "node_modules/fsevents": { @@ -7425,7 +7401,6 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/git-diff/-/git-diff-2.0.6.tgz", "integrity": "sha512-/Iu4prUrydE3Pb3lCBMbcSNIf81tgGt0W1ZwknnyF62t3tHmtiJTRj0f+1ZIhp3+Rh0ktz1pJVoa7ZXUCskivA==", - "dev": true, "license": "ISC", "dependencies": { "chalk": "^2.3.2", @@ -7442,7 +7417,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "license": "MIT", "dependencies": { "color-convert": "^1.9.0" @@ -7455,7 +7429,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", @@ -7470,7 +7443,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "license": "MIT", "dependencies": { "color-name": "1.1.3" @@ -7480,14 +7452,12 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true, "license": "MIT" }, "node_modules/git-diff/node_modules/diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" @@ -7497,7 +7467,6 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.8.0" @@ -7507,7 +7476,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^3.0.0" @@ -7521,7 +7489,6 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", - "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -7554,7 +7521,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -7565,7 +7531,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^1.1.7" @@ -7723,7 +7688,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, "license": "MIT", "engines": { "node": ">=4" @@ -8039,7 +8003,6 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -9072,7 +9035,6 @@ "version": "0.16.3", "resolved": "https://registry.npmjs.org/kysely-codegen/-/kysely-codegen-0.16.3.tgz", "integrity": "sha512-SOOF3AhrsjREJuRewXmKl0nb6CkEzpP7VavHXzWdfIdIdfoJnlWlozuZhgMsYoIFmzL8aG4skvKGXF/dF3mbwg==", - "dev": true, "license": "MIT", "dependencies": { "chalk": "4.1.2", @@ -9135,7 +9097,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -9152,7 +9113,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -9162,7 +9122,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -9363,7 +9322,6 @@ "version": "1.9.1", "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.1.tgz", "integrity": "sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.6.0" @@ -9437,7 +9395,6 @@ "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "devOptional": true, "license": "ISC" }, "node_modules/mathml-tag-names": { @@ -9633,7 +9590,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", - "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -9947,7 +9903,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "devOptional": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -10201,7 +10156,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -12443,7 +12397,6 @@ "version": "0.8.5", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", - "dev": true, "license": "BSD-3-Clause", "dependencies": { "glob": "^7.0.0", @@ -12461,7 +12414,6 @@ "version": "1.1.8", "resolved": "https://registry.npmjs.org/shelljs.exec/-/shelljs.exec-1.1.8.tgz", "integrity": "sha512-vFILCw+lzUtiwBAHV8/Ex8JsFjelFMdhONIsgKNLgTzeRckp2AOYRQtHJE/9LhNvdMmE27AGtzWx0+DHpwIwSw==", - "dev": true, "license": "ISC", "engines": { "node": ">= 4.0.0" @@ -12471,7 +12423,6 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true, "license": "MIT", "engines": { "node": ">= 0.10" @@ -12481,7 +12432,6 @@ "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", - "dev": true, "dependencies": { "resolve": "^1.1.6" }, @@ -13813,7 +13763,6 @@ "version": "10.9.4", "resolved": "https://registry.npmjs.org/ts-node-maintained/-/ts-node-maintained-10.9.4.tgz", "integrity": "sha512-Fq4c+LoWee4E0YWDBsotcBR8CB9pStBYBUuanQjXuOlLFescZ4uEODG8mdpDGGWYSCCaQXBjEgXzLIGu/NbyNw==", - "dev": true, "license": "MIT", "dependencies": { "@cspotcode/source-map-support": "^0.8.0", @@ -14015,7 +13964,6 @@ "version": "5.5.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", - "devOptional": true, "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -14106,7 +14054,6 @@ "version": "6.19.8", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", - "devOptional": true, "license": "MIT" }, "node_modules/unicorn-magic": { @@ -14182,7 +14129,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "devOptional": true, "license": "MIT" }, "node_modules/v8-to-istanbul": { @@ -14578,7 +14524,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "devOptional": true, "license": "ISC" }, "node_modules/write-file-atomic": { @@ -14697,7 +14642,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "devOptional": true, "license": "MIT", "engines": { "node": ">=6" diff --git a/package.json b/package.json index 48cbc26..89e2b4f 100644 --- a/package.json +++ b/package.json @@ -38,13 +38,13 @@ "@adonisjs/assembler": "^7.8.2", "@adonisjs/eslint-config": "^2.0.0-beta.6", "@adonisjs/prettier-config": "^1.4.0", - "@adonisjs/tsconfig": "^1.3.0", "@japa/api-client": "^2.0.3", "@japa/assert": "^3.0.0", "@japa/browser-client": "^2.0.3", "@japa/plugin-adonisjs": "^3.0.1", "@japa/runner": "^3.1.4", "@swc/core": "^1.6.3", + "@types/color-string": "^1.5.5", "@types/luxon": "^3.4.2", "@types/node": "^20.14.5", "@types/pg": "^8.11.8", @@ -58,7 +58,6 @@ "istanbul-lib-coverage": "^3.2.2", "istanbul-lib-report": "^3.0.1", "istanbul-reports": "^3.1.7", - "kysely-codegen": "^0.16.3", "monocart-coverage-reports": "^2.11.1", "pino-pretty": "^11.2.1", "playwright": "^1.46.1", @@ -69,13 +68,12 @@ "stylelint-config-sass-guidelines": "^12.1.0", "stylelint-config-tailwindcss": "^0.0.7", "tailwindcss": "^3.4.10", - "ts-node-maintained": "^10.9.4", - "typescript": "^5.4.5", "v8-to-istanbul": "^9.3.0", "vite": "^5.3.1", "vite-plugin-istanbul": "^6.0.2" }, "dependencies": { + "@adonisjs/tsconfig": "^1.3.0", "@adonisjs/auth": "^9.2.3", "@adonisjs/bouncer": "^3.1.3", "@adonisjs/core": "^6.14.1", @@ -89,18 +87,20 @@ "@inertiajs/react": "^1.2.0", "@playwright/test": "^1.47.0", "@tailwindcss/aspect-ratio": "^0.4.2", - "@types/color-string": "^1.5.5", "@vinejs/vine": "^2.1.0", "classnames": "^2.5.1", "color-string": "^1.9.1", "edge.js": "^6.0.2", "kysely": "^0.27.4", + "kysely-codegen": "^0.16.3", "luxon": "^3.5.0", "pg": "^8.12.0", "react": "^18.3.1", "react-dom": "^18.3.1", "reflect-metadata": "^0.2.2", "sass-embedded": "^1.78.0", + "ts-node-maintained": "^10.9.4", + "typescript": "^5.4.5", "zod": "^3.23.8" }, "hotHook": { diff --git a/start/env.ts b/start/env.ts index d5b9686..72a33e8 100644 --- a/start/env.ts +++ b/start/env.ts @@ -14,7 +14,7 @@ import { Env } from '@adonisjs/core/env' export const schema = { NODE_ENV: Env.schema.enum.optional(['development', 'production', 'test'] as const), PORT: Env.schema.number(), - APP_KEY: Env.schema.string.optional(), + APP_KEY: Env.schema.string(), HOST: Env.schema.string({ format: 'host' }), LOG_LEVEL: Env.schema.string.optional(),