diff --git a/.env.default b/.env.default index 739bfb2..eca226f 100644 --- a/.env.default +++ b/.env.default @@ -1,4 +1,3 @@ -NODE_ENV= REDIS_HOST= # parseInt(process.env.REDIS_PORT, 10) @@ -20,3 +19,6 @@ REDIS_HOST= LOKALISE_TOKEN= LOKALISE_PROJECT_ID= + +PORT= +GLOBAL_PREFIX= \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1f5e4a2..8178952 100644 --- a/.gitignore +++ b/.gitignore @@ -19,8 +19,8 @@ jest-stare/ .dist/ _dist/ .vscode -.env .history .yarn/install-state.gz -.yarn/cache \ No newline at end of file +.yarn/cache +.config*.json diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..8d07680 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,7 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" +export NVM_DIR="$HOME/.nvm" +[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + +echo "Running lint-staged..." +npx lint-staged \ No newline at end of file diff --git a/package.json b/package.json index ad4bf19..11a5af3 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,9 @@ "@midwayjs/redis": "3", "@midwayjs/validate": "3", "@typegoose/typegoose": "^11.7.1", - "class-transformer": "^0.5.1", - "class-validator": "^0.14.0", "dotenv": "^16.3.1", "glob": "^10.3.10", + "lint-staged": "^15.2.2", "lodash": "^4.17.21", "mongoose": "^7.0.0", "mongoose-delete": "^1.0.1", @@ -39,6 +38,7 @@ "@types/node": "14", "cross-env": "^7.0.3", "eslint-plugin-import": "^2.29.0", + "husky": "^9.0.11", "jest": "^29.7.0", "lokalise-client": "^1.1.9", "mwts": "^1.3.0", @@ -58,8 +58,8 @@ "lint:fix": "mwts fix", "ci": "npm run cov", "build": "midway-bin build -c", - "prepare-env": "yarn dlx ts-node ./src/scripts/prepare-env.ts", - "fetch:locale": "rimraf src/locales/*.json & npx lokalise-client fetch" + "fetch:locale": "rimraf src/locales/*.json & npx lokalise-client fetch", + "prepare": "husky" }, "midway-bin-clean": [ ".vscode/.tsbuildinfo", @@ -71,5 +71,10 @@ }, "author": "anonymous", "license": "MIT", - "packageManager": "yarn@4.0.2" + "packageManager": "yarn@4.0.2", + "lint-staged": { + "*{.ts,.tsx}": [ + "yarn run lint:fix" + ] + } } diff --git a/src/config/base.ts b/src/config/base.ts deleted file mode 100644 index 3ba4813..0000000 --- a/src/config/base.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* eslint-disable no-process-env */ -import { join } from 'path'; - -import { plainToInstance } from 'class-transformer'; -import { validateSync } from 'class-validator'; -import * as dotenv from 'dotenv'; - -import localeConfig from '../locales'; -import { ServerEnv } from '../types/config/config.dto'; - -dotenv.config({ - path: join(__dirname, '../../.env'), -}); - -export const getRedisConfig = ( - db = 0, - options: Record = {} -) => ({ - host: process.env.REDIS_HOST, - port: parseInt(process.env.REDIS_PORT, 10), - password: process.env.REDIS_PWD, - db, - ...options, -}); - -const envConfig = { - redis: getRedisConfig(parseInt(process.env.REDIS_DB, 10)), - mongoose: { - dataSource: { - default: { - uri: process.env.MONGODB_URI, - options: { - user: process.env.MONGODB_USER, - pass: process.env.MONGODB_PASSWORD, - }, - }, - }, - }, - NODE_ENV: process.env.NODE_ENV, - aws: { - awsAccessKeyId: process.env.AWS_ACCESS_KEY_ID, - awsSecretKey: process.env.AWS_SECRET_KEY, - awsRegion: process.env.AWS_REGION, - }, - keys: process.env.COOKIE_SIGN_KEY, - i18n: { - defaultLocale: 'en-us', - localeTable: localeConfig, - fallbacks: { - '*': 'en-us', - }, - writeCookie: false, - resolver: false, - }, -}; - -function getBaseConfig() { - const parsed = plainToInstance(ServerEnv, envConfig); - const validationErr = validateSync(parsed); - - if (validationErr.length > 0) { - const simpleErrs = []; - // eslint-disable-next-line no-console - console.error(validationErr); - - validationErr.forEach(err => { - if (err.children && err.children.length > 0) { - // eslint-disable-next-line no-console - console.error(JSON.stringify(err.children || {})); - simpleErrs.push(err.children[0].constraints); - } else { - simpleErrs.push(err.constraints); - } - }); - - throw new Error(`Invalid custom config ${JSON.stringify(simpleErrs)}`); - } - - return envConfig; -} - -export const baseConfig = getBaseConfig(); diff --git a/src/config/config.default.ts b/src/config/config.default.ts new file mode 100644 index 0000000..dbf5334 --- /dev/null +++ b/src/config/config.default.ts @@ -0,0 +1,55 @@ +/* eslint-disable no-process-env */ + +import localeConfig from '../locales'; + +const getRedisConfig = (db = 0, options: Record = {}) => ({ + host: process.env.REDIS_HOST, + port: parseInt(process.env.REDIS_PORT, 10), + password: process.env.REDIS_PWD, + db, + ...options, +}); + +/* + default中的配置项,会被config.xxxx.ts中相同配置项覆盖 +*/ +export default { + koa: { + port: Number(process.env.PORT), + globalPrefix: process.env.GLOBAL_PREFIX, + }, + midwayLogger: { + default: { + enableFile: false, + enableConsole: false, + }, + }, + redis: getRedisConfig(parseInt(process.env.REDIS_DB, 10)), + mongoose: { + dataSource: { + default: { + uri: process.env.MONGODB_URI, + options: { + user: process.env.MONGODB_USER, + pass: process.env.MONGODB_PASSWORD, + }, + }, + }, + }, + NODE_ENV: process.env.NODE_ENV, + aws: { + awsAccessKeyId: process.env.AWS_ACCESS_KEY_ID, + awsSecretKey: process.env.AWS_SECRET_KEY, + awsRegion: process.env.AWS_REGION, + }, + keys: process.env.COOKIE_SIGN_KEY, + i18n: { + defaultLocale: 'en-us', + localeTable: localeConfig, + fallbacks: { + '*': 'en-us', + }, + writeCookie: false, + resolver: false, + }, +}; diff --git a/src/config/config.local.ts b/src/config/config.local.ts index b2a7820..c137031 100644 --- a/src/config/config.local.ts +++ b/src/config/config.local.ts @@ -1,21 +1,3 @@ -/* eslint-disable no-console */ -/* eslint-disable no-process-env */ - import { MidwayConfig } from '@midwayjs/core'; -import { merge } from 'lodash'; - -import { baseConfig } from './base'; -export default (): MidwayConfig => { - return merge(baseConfig, { - koa: { - port: 7001, - }, - midwayLogger: { - default: { - console: false, - file: false, - }, - }, - }) as MidwayConfig; -}; +export default {} as MidwayConfig; diff --git a/src/config/config.production.ts b/src/config/config.production.ts index 1431370..c137031 100644 --- a/src/config/config.production.ts +++ b/src/config/config.production.ts @@ -1,5 +1,3 @@ -import { baseConfig } from './base'; +import { MidwayConfig } from '@midwayjs/core'; -import type { MidwayConfig } from '@midwayjs/core'; - -export default baseConfig as MidwayConfig; +export default {} as MidwayConfig; diff --git a/src/config/config.test.ts b/src/config/config.test.ts index 1431370..c137031 100644 --- a/src/config/config.test.ts +++ b/src/config/config.test.ts @@ -1,5 +1,3 @@ -import { baseConfig } from './base'; +import { MidwayConfig } from '@midwayjs/core'; -import type { MidwayConfig } from '@midwayjs/core'; - -export default baseConfig as MidwayConfig; +export default {} as MidwayConfig; diff --git a/src/configuration.ts b/src/configuration.ts index f07d4d5..49748b8 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -1,3 +1,5 @@ +import './init'; + import { hostname } from 'os'; import path, { join } from 'path'; @@ -21,6 +23,8 @@ import { sync } from 'read-pkg'; import { DefaultErrorFilter } from './filter/default.filter'; import { LocaleMiddleware } from './middleware/locale.middleware'; import { ResponseWrapperMiddleware } from './middleware/response-wrapper.middleware'; +import { RUNTIME_ENV_MAP, ServerEnv } from './types/config/config.dto'; +import { validateBy } from './utils/common'; import { CloudwatchTransport } from './utils/logger'; import { registerModel } from './utils/register-model'; @Configuration({ @@ -57,11 +61,19 @@ export class MainConfiguration { @Inject() dataSourceManager: mongoose.MongooseDataSourceManager; + async onConfigLoad() { + const config = this.app.getConfig(); + + return validateBy(config, ServerEnv, { + allowUnknown: true, + }); + } + async onReady(applicationContext: IMidwayContainer) { this.app.useMiddleware([LocaleMiddleware, ResponseWrapperMiddleware]); this.app.useFilter([DefaultErrorFilter]); - if (this.envConfig === 'production') { + if (this.envConfig === RUNTIME_ENV_MAP.PRODUCTION) { const cloudwatchTransport = new CloudwatchTransport({ app: this.app.getProjectName(), hostname: hostname(), diff --git a/src/init.ts b/src/init.ts new file mode 100644 index 0000000..8f27675 --- /dev/null +++ b/src/init.ts @@ -0,0 +1,37 @@ +/* eslint-disable no-process-env */ +import { join, resolve } from 'path'; + +import * as dotenv from 'dotenv'; + +export const ServerSecretsPath = resolve( + '/', + 'mnt', + 'secrets', + `onekey-eks-dashboard-${process.env.NODE_ENV}.json` +); +export const ServerConfigPath = resolve('/', 'mnt', 'config', 'config.json'); + +function loadJsonConfigFile(file: string, errorMessage: string) { + try { + dotenv.populate(process.env, require(file)); + } catch (error) { + console.log(errorMessage, file); + } +} + +/* + 加载线上配置文件 +*/ +loadJsonConfigFile(ServerConfigPath, 'No config found path:'); +loadJsonConfigFile(ServerSecretsPath, 'No secrets found path:'); +loadJsonConfigFile( + join(__dirname, '..', '.config.json'), + 'No local json config found' +); + +/* + 加载本地配置文件,注意.config.json和.env只需要一个即可,两个都存在的话,.config.json会覆盖.env +*/ +dotenv.config({ + path: join(__dirname, '..', '.env'), +}); diff --git a/src/types/config/config.base.dto.ts b/src/types/config/config.base.dto.ts index 7232cbc..6f3b264 100644 --- a/src/types/config/config.base.dto.ts +++ b/src/types/config/config.base.dto.ts @@ -1,75 +1,63 @@ -import { Type } from 'class-transformer'; -import { - IsNotEmpty, - IsNumber, - IsObject, - IsOptional, - IsString, - ValidateNested, -} from 'class-validator'; +import { Rule, RuleType, getSchema } from '@midwayjs/validate'; export class Redis { - @IsString() - @IsNotEmpty() + @Rule(RuleType.string().required()) host!: string; - @IsNumber() + @Rule(RuleType.number().required()) port!: number; - @IsString() + @Rule(RuleType.string().required().allow('')) password!: string; - @IsNumber() + @Rule(RuleType.number().required()) db!: number; } class MongooseOptions { - @IsString() - @IsOptional() + @Rule(RuleType.string().optional()) user?: string; - @IsString() - @IsOptional() + @Rule(RuleType.string().optional()) pass?: string; } class MongooseConfig { - @IsString() + @Rule(RuleType.string().required()) uri!: string; - @IsObject() - @ValidateNested() - @Type(() => MongooseOptions) + @Rule(getSchema(MongooseOptions).required()) options!: MongooseOptions; } class MongooseDataSource { - @IsObject() - @ValidateNested() - @Type(() => MongooseConfig) - @IsOptional() + @Rule(getSchema(MongooseConfig).required()) test?: MongooseConfig; - @IsObject() - @ValidateNested() - @Type(() => MongooseConfig) + @Rule(getSchema(MongooseConfig).required()) default!: MongooseConfig; } export class Mongoose { - @IsObject() - @ValidateNested() - @Type(() => MongooseDataSource) + @Rule(getSchema(MongooseDataSource).required()) dataSource!: MongooseDataSource; } export class AWS { - @IsString() + @Rule(RuleType.string().required()) awsAccessKeyId!: string; - @IsString() + @Rule(RuleType.string().required()) awsSecretKey!: string; - @IsString() + @Rule(RuleType.string().required()) awsRegion!: string; } + +export class KOAConfig { + @Rule(RuleType.number().required()) + port!: number; + + @Rule(RuleType.string().required()) + globalPrefix!: string; +} diff --git a/src/types/config/config.dto.ts b/src/types/config/config.dto.ts index 17c2a63..c252570 100644 --- a/src/types/config/config.dto.ts +++ b/src/types/config/config.dto.ts @@ -1,24 +1,27 @@ -import { Type } from 'class-transformer'; -import { ValidateNested } from 'class-validator'; +import { Rule, RuleType, getSchema } from '@midwayjs/validate'; -import { AWS, Redis } from './config.base.dto'; +import { AWS, KOAConfig, Redis } from './config.base.dto'; export enum RUNTIME_ENV_MAP { LOCAL = 'local', PRODUCTION = 'production', TEST = 'test', + JEST = 'jest', } export class ServerEnv { - @Type(() => Redis) - @ValidateNested() + @Rule(getSchema(Redis).required()) redis: Redis; - @Type(() => AWS) - @ValidateNested() + @Rule(getSchema(AWS).required()) aws!: AWS; + @Rule(RuleType.string().required()) NODE_ENV: RUNTIME_ENV_MAP; - cookieSignKey: string; + @Rule(RuleType.string().required()) + keys: string; + + @Rule(getSchema(KOAConfig).required()) + koa: KOAConfig; } diff --git a/src/utils/common.ts b/src/utils/common.ts new file mode 100644 index 0000000..927bee7 --- /dev/null +++ b/src/utils/common.ts @@ -0,0 +1,16 @@ +import { RuleType, getSchema } from '@midwayjs/validate'; + +export function validateBy( + object: any, + schemaOrTypeClass: any, + options?: RuleType.ValidationOptions +): any { + const schema = RuleType.isSchema(schemaOrTypeClass) + ? schemaOrTypeClass + : getSchema(schemaOrTypeClass); + const { value, error } = schema.validate(object, options); + if (error) { + throw error; + } + return value; +} diff --git a/yarn.lock b/yarn.lock index 44f92c6..1d35ff1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1893,13 +1893,13 @@ __metadata: "@types/lodash": "npm:^4.14.202" "@types/mongoose-delete": "npm:^1.0.3" "@types/node": "npm:14" - class-transformer: "npm:^0.5.1" - class-validator: "npm:^0.14.0" cross-env: "npm:^7.0.3" dotenv: "npm:^16.3.1" eslint-plugin-import: "npm:^2.29.0" glob: "npm:^10.3.10" + husky: "npm:^9.0.11" jest: "npm:^29.7.0" + lint-staged: "npm:^15.2.2" lodash: "npm:^4.17.21" lokalise-client: "npm:^1.1.9" mongoose: "npm:^7.0.0" @@ -2904,13 +2904,6 @@ __metadata: languageName: node linkType: hard -"@types/validator@npm:^13.7.10": - version: 13.11.7 - resolution: "@types/validator@npm:13.11.7" - checksum: 9ca2a047d6e7c1d718c6dd28b12d6d893c4ac2acdb8a557b8d448dab17aaa044e92c7a13c8476601078f4c907ed66259e3b20525f7fa849378fbaf53a971d574 - languageName: node - linkType: hard - "@types/webidl-conversions@npm:*": version: 7.0.3 resolution: "@types/webidl-conversions@npm:7.0.3" @@ -3202,6 +3195,15 @@ __metadata: languageName: node linkType: hard +"ansi-escapes@npm:^6.2.0": + version: 6.2.0 + resolution: "ansi-escapes@npm:6.2.0" + dependencies: + type-fest: "npm:^3.0.0" + checksum: 3eec75deedd8b10192c5f98e4cd9715cc3ff268d33fc463c24b7d22446668bfcd4ad1803993ea89c0f51f88b5a3399572bacb7c8cb1a067fc86e189c5f3b0c7e + languageName: node + linkType: hard + "ansi-regex@npm:^5.0.1": version: 5.0.1 resolution: "ansi-regex@npm:5.0.1" @@ -3241,7 +3243,7 @@ __metadata: languageName: node linkType: hard -"ansi-styles@npm:^6.1.0": +"ansi-styles@npm:^6.0.0, ansi-styles@npm:^6.1.0, ansi-styles@npm:^6.2.1": version: 6.2.1 resolution: "ansi-styles@npm:6.2.1" checksum: 5d1ec38c123984bcedd996eac680d548f31828bd679a66db2bdf11844634dde55fec3efa9c6bb1d89056a5e79c1ac540c4c784d592ea1d25028a92227d2f2d5c @@ -3789,6 +3791,13 @@ __metadata: languageName: node linkType: hard +"chalk@npm:5.3.0": + version: 5.3.0 + resolution: "chalk@npm:5.3.0" + checksum: 8297d436b2c0f95801103ff2ef67268d362021b8210daf8ddbe349695333eb3610a71122172ff3b0272f1ef2cf7cc2c41fdaa4715f52e49ffe04c56340feed09 + languageName: node + linkType: hard + "chalk@npm:^2.4.2": version: 2.4.2 resolution: "chalk@npm:2.4.2" @@ -3878,24 +3887,13 @@ __metadata: languageName: node linkType: hard -"class-transformer@npm:0.5.1, class-transformer@npm:^0.5.1": +"class-transformer@npm:0.5.1": version: 0.5.1 resolution: "class-transformer@npm:0.5.1" checksum: 19809914e51c6db42c036166839906420bb60367df14e15f49c45c8c1231bf25ae661ebe94736ee29cc688b77101ef851a8acca299375cc52fc141b64acde18a languageName: node linkType: hard -"class-validator@npm:^0.14.0": - version: 0.14.0 - resolution: "class-validator@npm:0.14.0" - dependencies: - "@types/validator": "npm:^13.7.10" - libphonenumber-js: "npm:^1.10.14" - validator: "npm:^13.7.0" - checksum: 1f7c34052f0c342b1d27c5aec7c42b646bb77a56874acc0d8003e2ad8f0294e7da18b43e9caaac8e8817cbb309cf9f14bcebe4611994390ca4818f3b393783dc - languageName: node - linkType: hard - "clean-stack@npm:^2.0.0": version: 2.2.0 resolution: "clean-stack@npm:2.2.0" @@ -3919,6 +3917,25 @@ __metadata: languageName: node linkType: hard +"cli-cursor@npm:^4.0.0": + version: 4.0.0 + resolution: "cli-cursor@npm:4.0.0" + dependencies: + restore-cursor: "npm:^4.0.0" + checksum: e776e8c3c6727300d0539b0d25160b2bb56aed1a63942753ba1826b012f337a6f4b7ace3548402e4f2f13b5e16bfd751be672c44b203205e7eca8be94afec42c + languageName: node + linkType: hard + +"cli-truncate@npm:^4.0.0": + version: 4.0.0 + resolution: "cli-truncate@npm:4.0.0" + dependencies: + slice-ansi: "npm:^5.0.0" + string-width: "npm:^7.0.0" + checksum: d7f0b73e3d9b88cb496e6c086df7410b541b56a43d18ade6a573c9c18bd001b1c3fba1ad578f741a4218fdc794d042385f8ac02c25e1c295a2d8b9f3cb86eb4c + languageName: node + linkType: hard + "cli-width@npm:^3.0.0": version: 3.0.0 resolution: "cli-width@npm:3.0.0" @@ -4031,6 +4048,13 @@ __metadata: languageName: node linkType: hard +"colorette@npm:^2.0.20": + version: 2.0.20 + resolution: "colorette@npm:2.0.20" + checksum: e94116ff33b0ff56f3b83b9ace895e5bf87c2a7a47b3401b8c3f3226e050d5ef76cf4072fb3325f9dc24d1698f9b730baf4e05eeaf861d74a1883073f4c98a40 + languageName: node + linkType: hard + "colorspace@npm:1.1.x": version: 1.1.4 resolution: "colorspace@npm:1.1.4" @@ -4050,6 +4074,13 @@ __metadata: languageName: node linkType: hard +"commander@npm:11.1.0": + version: 11.1.0 + resolution: "commander@npm:11.1.0" + checksum: 13cc6ac875e48780250f723fb81c1c1178d35c5decb1abb1b628b3177af08a8554e76b2c0f29de72d69eef7c864d12613272a71fabef8047922bc622ab75a179 + languageName: node + linkType: hard + "commander@npm:^2.8.1": version: 2.20.3 resolution: "commander@npm:2.20.3" @@ -4239,7 +4270,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:4.x, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.4": +"debug@npm:4, debug@npm:4.3.4, debug@npm:4.x, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.2, debug@npm:^4.3.4": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -4609,6 +4640,13 @@ __metadata: languageName: node linkType: hard +"emoji-regex@npm:^10.3.0": + version: 10.3.0 + resolution: "emoji-regex@npm:10.3.0" + checksum: b4838e8dcdceb44cf47f59abe352c25ff4fe7857acaf5fb51097c427f6f75b44d052eb907a7a3b86f86bc4eae3a93f5c2b7460abe79c407307e6212d65c91163 + languageName: node + linkType: hard + "emoji-regex@npm:^8.0.0": version: 8.0.0 resolution: "emoji-regex@npm:8.0.0" @@ -5062,6 +5100,30 @@ __metadata: languageName: node linkType: hard +"eventemitter3@npm:^5.0.1": + version: 5.0.1 + resolution: "eventemitter3@npm:5.0.1" + checksum: 4ba5c00c506e6c786b4d6262cfbce90ddc14c10d4667e5c83ae993c9de88aa856033994dd2b35b83e8dc1170e224e66a319fa80adc4c32adcd2379bbc75da814 + languageName: node + linkType: hard + +"execa@npm:8.0.1": + version: 8.0.1 + resolution: "execa@npm:8.0.1" + dependencies: + cross-spawn: "npm:^7.0.3" + get-stream: "npm:^8.0.1" + human-signals: "npm:^5.0.0" + is-stream: "npm:^3.0.0" + merge-stream: "npm:^2.0.0" + npm-run-path: "npm:^5.1.0" + onetime: "npm:^6.0.0" + signal-exit: "npm:^4.1.0" + strip-final-newline: "npm:^3.0.0" + checksum: 2c52d8775f5bf103ce8eec9c7ab3059909ba350a5164744e9947ed14a53f51687c040a250bda833f906d1283aa8803975b84e6c8f7a7c42f99dc8ef80250d1af + languageName: node + linkType: hard + "execa@npm:^5.0.0": version: 5.1.1 resolution: "execa@npm:5.1.1" @@ -5476,6 +5538,13 @@ __metadata: languageName: node linkType: hard +"get-east-asian-width@npm:^1.0.0": + version: 1.2.0 + resolution: "get-east-asian-width@npm:1.2.0" + checksum: 914b1e217cf38436c24b4c60b4c45289e39a45bf9e65ef9fd343c2815a1a02b8a0215aeec8bf9c07c516089004b6e3826332481f40a09529fcadbf6e579f286b + languageName: node + linkType: hard + "get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0, get-intrinsic@npm:^1.2.1, get-intrinsic@npm:^1.2.2": version: 1.2.2 resolution: "get-intrinsic@npm:1.2.2" @@ -5537,6 +5606,13 @@ __metadata: languageName: node linkType: hard +"get-stream@npm:^8.0.1": + version: 8.0.1 + resolution: "get-stream@npm:8.0.1" + checksum: 5c2181e98202b9dae0bb4a849979291043e5892eb40312b47f0c22b9414fc9b28a3b6063d2375705eb24abc41ecf97894d9a51f64ff021511b504477b27b4290 + languageName: node + linkType: hard + "get-symbol-description@npm:^1.0.0": version: 1.0.0 resolution: "get-symbol-description@npm:1.0.0" @@ -5896,6 +5972,22 @@ __metadata: languageName: node linkType: hard +"human-signals@npm:^5.0.0": + version: 5.0.0 + resolution: "human-signals@npm:5.0.0" + checksum: 5a9359073fe17a8b58e5a085e9a39a950366d9f00217c4ff5878bd312e09d80f460536ea6a3f260b5943a01fe55c158d1cea3fc7bee3d0520aeef04f6d915c82 + languageName: node + linkType: hard + +"husky@npm:^9.0.11": + version: 9.0.11 + resolution: "husky@npm:9.0.11" + bin: + husky: bin.mjs + checksum: 2c787dcf74a837fc9a4fea7da907509d4bd9a289f4ea10ecc9d86279e4d4542b0f5f6443a619bccae19e265f2677172cc2b86aae5c932a35a330cc227d914605 + languageName: node + linkType: hard + "iconv-lite@npm:0.4.24, iconv-lite@npm:^0.4.24": version: 0.4.24 resolution: "iconv-lite@npm:0.4.24" @@ -6182,6 +6274,22 @@ __metadata: languageName: node linkType: hard +"is-fullwidth-code-point@npm:^4.0.0": + version: 4.0.0 + resolution: "is-fullwidth-code-point@npm:4.0.0" + checksum: df2a717e813567db0f659c306d61f2f804d480752526886954a2a3e2246c7745fd07a52b5fecf2b68caf0a6c79dcdace6166fdf29cc76ed9975cc334f0a018b8 + languageName: node + linkType: hard + +"is-fullwidth-code-point@npm:^5.0.0": + version: 5.0.0 + resolution: "is-fullwidth-code-point@npm:5.0.0" + dependencies: + get-east-asian-width: "npm:^1.0.0" + checksum: cd591b27d43d76b05fa65ed03eddce57a16e1eca0b7797ff7255de97019bcaf0219acfc0c4f7af13319e13541f2a53c0ace476f442b13267b9a6a7568f2b65c8 + languageName: node + linkType: hard + "is-generator-fn@npm:^2.0.0": version: 2.1.0 resolution: "is-generator-fn@npm:2.1.0" @@ -6315,6 +6423,13 @@ __metadata: languageName: node linkType: hard +"is-stream@npm:^3.0.0": + version: 3.0.0 + resolution: "is-stream@npm:3.0.0" + checksum: eb2f7127af02ee9aa2a0237b730e47ac2de0d4e76a4a905a50a11557f2339df5765eaea4ceb8029f1efa978586abe776908720bfcb1900c20c6ec5145f6f29d8 + languageName: node + linkType: hard + "is-string@npm:^1.0.5, is-string@npm:^1.0.7": version: 1.0.7 resolution: "is-string@npm:1.0.7" @@ -7190,13 +7305,6 @@ __metadata: languageName: node linkType: hard -"libphonenumber-js@npm:^1.10.14": - version: 1.10.50 - resolution: "libphonenumber-js@npm:1.10.50" - checksum: 80b6fb745325d0f33326afb3bb0c94a9c492f1d94ca83f834d74fad8496caf10cfe2fd2eb698dd31a77c905d34b56794b83bc1112d2572b32ed193a80cc10428 - languageName: node - linkType: hard - "light-spinner@npm:^1.0.0, light-spinner@npm:^1.0.1": version: 1.0.4 resolution: "light-spinner@npm:1.0.4" @@ -7204,6 +7312,13 @@ __metadata: languageName: node linkType: hard +"lilconfig@npm:3.0.0": + version: 3.0.0 + resolution: "lilconfig@npm:3.0.0" + checksum: 7f5ee7a658dc016cacf146815e8d88b06f06f4402823b8b0934e305a57a197f55ccc9c5cd4fb5ea1b2b821c8ccaf2d54abd59602a4931af06eabda332388d3e6 + languageName: node + linkType: hard + "lines-and-columns@npm:^1.1.6": version: 1.2.4 resolution: "lines-and-columns@npm:1.2.4" @@ -7211,6 +7326,40 @@ __metadata: languageName: node linkType: hard +"lint-staged@npm:^15.2.2": + version: 15.2.2 + resolution: "lint-staged@npm:15.2.2" + dependencies: + chalk: "npm:5.3.0" + commander: "npm:11.1.0" + debug: "npm:4.3.4" + execa: "npm:8.0.1" + lilconfig: "npm:3.0.0" + listr2: "npm:8.0.1" + micromatch: "npm:4.0.5" + pidtree: "npm:0.6.0" + string-argv: "npm:0.3.2" + yaml: "npm:2.3.4" + bin: + lint-staged: bin/lint-staged.js + checksum: a1ba6c7ee53e30a0f6ea9a351d95d3d0d2be916a41b561e22907e9ea513eb18cb3dbe65bff3ec13fad15777999efe56b2e2a95427e31d12a9b7e7948c3630ee2 + languageName: node + linkType: hard + +"listr2@npm:8.0.1": + version: 8.0.1 + resolution: "listr2@npm:8.0.1" + dependencies: + cli-truncate: "npm:^4.0.0" + colorette: "npm:^2.0.20" + eventemitter3: "npm:^5.0.1" + log-update: "npm:^6.0.0" + rfdc: "npm:^1.3.0" + wrap-ansi: "npm:^9.0.0" + checksum: b565d6ceb3a4c2dbe0c1735c0fd907afd0d6f89de21aced8e05187b2d88ca2f8f9ebc5d743885396a00f05f13146f6be744d098a56ce0402cf1cd131485a7ff1 + languageName: node + linkType: hard + "locate-path@npm:^5.0.0": version: 5.0.0 resolution: "locate-path@npm:5.0.0" @@ -7290,6 +7439,19 @@ __metadata: languageName: node linkType: hard +"log-update@npm:^6.0.0": + version: 6.0.0 + resolution: "log-update@npm:6.0.0" + dependencies: + ansi-escapes: "npm:^6.2.0" + cli-cursor: "npm:^4.0.0" + slice-ansi: "npm:^7.0.0" + strip-ansi: "npm:^7.1.0" + wrap-ansi: "npm:^9.0.0" + checksum: e0b3c3401ef49ce3eb17e2f83d644765e4f7988498fc1344eaa4f31ab30e510dcc469a7fb64dc01bd1c8d9237d917598fa677a9818705fb3774c10f6e9d4b27c + languageName: node + linkType: hard + "logform@npm:^2.3.2, logform@npm:^2.4.0": version: 2.6.0 resolution: "logform@npm:2.6.0" @@ -7516,7 +7678,7 @@ __metadata: languageName: node linkType: hard -"micromatch@npm:^4.0.4": +"micromatch@npm:4.0.5, micromatch@npm:^4.0.4": version: 4.0.5 resolution: "micromatch@npm:4.0.5" dependencies: @@ -7570,6 +7732,13 @@ __metadata: languageName: node linkType: hard +"mimic-fn@npm:^4.0.0": + version: 4.0.0 + resolution: "mimic-fn@npm:4.0.0" + checksum: de9cc32be9996fd941e512248338e43407f63f6d497abe8441fa33447d922e927de54d4cc3c1a3c6d652857acd770389d5a3823f311a744132760ce2be15ccbf + languageName: node + linkType: hard + "mimic-response@npm:^1.0.0, mimic-response@npm:^1.0.1": version: 1.0.1 resolution: "mimic-response@npm:1.0.1" @@ -8075,6 +8244,15 @@ __metadata: languageName: node linkType: hard +"npm-run-path@npm:^5.1.0": + version: 5.3.0 + resolution: "npm-run-path@npm:5.3.0" + dependencies: + path-key: "npm:^4.0.0" + checksum: 124df74820c40c2eb9a8612a254ea1d557ddfab1581c3e751f825e3e366d9f00b0d76a3c94ecd8398e7f3eee193018622677e95816e8491f0797b21e30b2deba + languageName: node + linkType: hard + "object-assign@npm:^4.0.1": version: 4.1.1 resolution: "object-assign@npm:4.1.1" @@ -8185,6 +8363,15 @@ __metadata: languageName: node linkType: hard +"onetime@npm:^6.0.0": + version: 6.0.0 + resolution: "onetime@npm:6.0.0" + dependencies: + mimic-fn: "npm:^4.0.0" + checksum: 4eef7c6abfef697dd4479345a4100c382d73c149d2d56170a54a07418c50816937ad09500e1ed1e79d235989d073a9bade8557122aee24f0576ecde0f392bb6c + languageName: node + linkType: hard + "only@npm:~0.0.2": version: 0.0.2 resolution: "only@npm:0.0.2" @@ -8331,6 +8518,13 @@ __metadata: languageName: node linkType: hard +"path-key@npm:^4.0.0": + version: 4.0.0 + resolution: "path-key@npm:4.0.0" + checksum: 794efeef32863a65ac312f3c0b0a99f921f3e827ff63afa5cb09a377e202c262b671f7b3832a4e64731003fa94af0263713962d317b9887bd1e0c48a342efba3 + languageName: node + linkType: hard + "path-parse@npm:^1.0.7": version: 1.0.7 resolution: "path-parse@npm:1.0.7" @@ -8383,6 +8577,15 @@ __metadata: languageName: node linkType: hard +"pidtree@npm:0.6.0": + version: 0.6.0 + resolution: "pidtree@npm:0.6.0" + bin: + pidtree: bin/pidtree.js + checksum: 0829ec4e9209e230f74ebf4265f5ccc9ebfb488334b525cb13f86ff801dca44b362c41252cd43ae4d7653a10a5c6ab3be39d2c79064d6895e0d78dc50a5ed6e9 + languageName: node + linkType: hard + "pify@npm:^2.3.0": version: 2.3.0 resolution: "pify@npm:2.3.0" @@ -8857,6 +9060,16 @@ __metadata: languageName: node linkType: hard +"restore-cursor@npm:^4.0.0": + version: 4.0.0 + resolution: "restore-cursor@npm:4.0.0" + dependencies: + onetime: "npm:^5.1.0" + signal-exit: "npm:^3.0.2" + checksum: 6f7da8c5e422ac26aa38354870b1afac09963572cf2879443540449068cb43476e9cbccf6f8de3e0171e0d6f7f533c2bc1a0a008003c9a525bbc098e89041318 + languageName: node + linkType: hard + "retry@npm:^0.12.0": version: 0.12.0 resolution: "retry@npm:0.12.0" @@ -8871,6 +9084,13 @@ __metadata: languageName: node linkType: hard +"rfdc@npm:^1.3.0": + version: 1.3.1 + resolution: "rfdc@npm:1.3.1" + checksum: 69f65e3ed30970f8055fac9fbbef9ce578800ca19554eab1dcbffe73a4b8aef536bc4248313889cf25e3b4e38b212c721eabe30856575bf2b2bc3d90f8ba93ef + languageName: node + linkType: hard + "rimraf@npm:^3.0.2": version: 3.0.2 resolution: "rimraf@npm:3.0.2" @@ -9104,7 +9324,7 @@ __metadata: languageName: node linkType: hard -"signal-exit@npm:^4.0.1": +"signal-exit@npm:^4.0.1, signal-exit@npm:^4.1.0": version: 4.1.0 resolution: "signal-exit@npm:4.1.0" checksum: 41602dce540e46d599edba9d9860193398d135f7ff72cab629db5171516cfae628d21e7bfccde1bbfdf11c48726bc2a6d1a8fb8701125852fbfda7cf19c6aa83 @@ -9145,6 +9365,26 @@ __metadata: languageName: node linkType: hard +"slice-ansi@npm:^5.0.0": + version: 5.0.0 + resolution: "slice-ansi@npm:5.0.0" + dependencies: + ansi-styles: "npm:^6.0.0" + is-fullwidth-code-point: "npm:^4.0.0" + checksum: 2d4d40b2a9d5cf4e8caae3f698fe24ae31a4d778701724f578e984dcb485ec8c49f0c04dab59c401821e80fcdfe89cace9c66693b0244e40ec485d72e543914f + languageName: node + linkType: hard + +"slice-ansi@npm:^7.0.0": + version: 7.1.0 + resolution: "slice-ansi@npm:7.1.0" + dependencies: + ansi-styles: "npm:^6.2.1" + is-fullwidth-code-point: "npm:^5.0.0" + checksum: 631c971d4abf56cf880f034d43fcc44ff883624867bf11ecbd538c47343911d734a4656d7bc02362b40b89d765652a7f935595441e519b59e2ad3f4d5d6fe7ca + languageName: node + linkType: hard + "smart-buffer@npm:^4.2.0": version: 4.2.0 resolution: "smart-buffer@npm:4.2.0" @@ -9296,6 +9536,13 @@ __metadata: languageName: node linkType: hard +"string-argv@npm:0.3.2": + version: 0.3.2 + resolution: "string-argv@npm:0.3.2" + checksum: 75c02a83759ad1722e040b86823909d9a2fc75d15dd71ec4b537c3560746e33b5f5a07f7332d1e3f88319909f82190843aa2f0a0d8c8d591ec08e93d5b8dec82 + languageName: node + linkType: hard + "string-length@npm:^4.0.1": version: 4.0.2 resolution: "string-length@npm:4.0.2" @@ -9328,6 +9575,17 @@ __metadata: languageName: node linkType: hard +"string-width@npm:^7.0.0": + version: 7.1.0 + resolution: "string-width@npm:7.1.0" + dependencies: + emoji-regex: "npm:^10.3.0" + get-east-asian-width: "npm:^1.0.0" + strip-ansi: "npm:^7.1.0" + checksum: 68a99fbc3bd3d8eb42886ff38dce819767dee55f606f74dfa4687a07dfd21262745d9683df0aa53bf81a5dd47c13da921a501925b974bec66a7ddd634fef0634 + languageName: node + linkType: hard + "string.prototype.trim@npm:^1.2.8": version: 1.2.8 resolution: "string.prototype.trim@npm:1.2.8" @@ -9388,7 +9646,7 @@ __metadata: languageName: node linkType: hard -"strip-ansi@npm:^7.0.1": +"strip-ansi@npm:^7.0.1, strip-ansi@npm:^7.1.0": version: 7.1.0 resolution: "strip-ansi@npm:7.1.0" dependencies: @@ -9427,6 +9685,13 @@ __metadata: languageName: node linkType: hard +"strip-final-newline@npm:^3.0.0": + version: 3.0.0 + resolution: "strip-final-newline@npm:3.0.0" + checksum: a771a17901427bac6293fd416db7577e2bc1c34a19d38351e9d5478c3c415f523f391003b42ed475f27e33a78233035df183525395f731d3bfb8cdcbd4da08ce + languageName: node + linkType: hard + "strip-indent@npm:^3.0.0": version: 3.0.0 resolution: "strip-indent@npm:3.0.0" @@ -9842,6 +10107,13 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^3.0.0": + version: 3.13.1 + resolution: "type-fest@npm:3.13.1" + checksum: 547d22186f73a8c04590b70dcf63baff390078c75ea8acd366bbd510fd0646e348bd1970e47ecf795b7cff0b41d26e9c475c1fedd6ef5c45c82075fbf916b629 + languageName: node + linkType: hard + "type-is@npm:^1.6.16, type-is@npm:^1.6.18": version: 1.6.18 resolution: "type-is@npm:1.6.18" @@ -10123,13 +10395,6 @@ __metadata: languageName: node linkType: hard -"validator@npm:^13.7.0": - version: 13.11.0 - resolution: "validator@npm:13.11.0" - checksum: 0107da3add5a4ebc6391dac103c55f6d8ed055bbcc29a4c9cbf89eacfc39ba102a5618c470bdc33c6487d30847771a892134a8c791f06ef0962dd4b7a60ae0f5 - languageName: node - linkType: hard - "vary@npm:1.1.2, vary@npm:^1.1.2": version: 1.1.2 resolution: "vary@npm:1.1.2" @@ -10307,6 +10572,17 @@ __metadata: languageName: node linkType: hard +"wrap-ansi@npm:^9.0.0": + version: 9.0.0 + resolution: "wrap-ansi@npm:9.0.0" + dependencies: + ansi-styles: "npm:^6.2.1" + string-width: "npm:^7.0.0" + strip-ansi: "npm:^7.1.0" + checksum: a139b818da9573677548dd463bd626a5a5286271211eb6e4e82f34a4f643191d74e6d4a9bb0a3c26ec90e6f904f679e0569674ac099ea12378a8b98e20706066 + languageName: node + linkType: hard + "wrappy@npm:1": version: 1.0.2 resolution: "wrappy@npm:1.0.2" @@ -10386,6 +10662,13 @@ __metadata: languageName: node linkType: hard +"yaml@npm:2.3.4": + version: 2.3.4 + resolution: "yaml@npm:2.3.4" + checksum: cf03b68f8fef5e8516b0f0b54edaf2459f1648317fc6210391cf606d247e678b449382f4bd01f77392538429e306c7cba8ff46ff6b37cac4de9a76aff33bd9e1 + languageName: node + linkType: hard + "yargs-parser@npm:^20.2.3": version: 20.2.9 resolution: "yargs-parser@npm:20.2.9"