0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-10 22:22:45 -05:00

chore: use shared config

This commit is contained in:
Gao Sun 2021-07-11 17:59:44 +08:00 committed by Gao Sun
parent 91dafc3fef
commit 4778ccddd1
9 changed files with 390 additions and 1697 deletions

View file

@ -1,6 +1,6 @@
{
"recommendations": [
"samverschueren.linter-xo",
"mikestead.dotenv"
"mikestead.dotenv",
"dbaeumer.vscode-eslint"
]
}

View file

@ -1,13 +1,4 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "samverschueren.linter-xo",
"xo.enable": true,
"xo.format.enable": true,
"editor.formatOnSave": true,
"[typescriptreact]": {
"editor.defaultFormatter": "samverschueren.linter-xo"
},
"[javascript]": {
"editor.defaultFormatter": "samverschueren.linter-xo"
}
"editor.formatOnSave": true
}

View file

@ -8,12 +8,12 @@
"private": true,
"scripts": {
"build": "tsc",
"lint": "xo src/",
"lint": "eslint --format pretty \"src/**\"",
"dev": "tsc-watch --onSuccess \"node ./build/index.js\"",
"prepare": "husky install"
},
"dependencies": {
"@logto/essentials": "^1.1.0-rc.0",
"@logto/essentials": "^1.1.0-rc.1",
"@logto/schemas": "^1.1.0-rc.1",
"dayjs": "^1.10.5",
"decamelize": "^5.0.0",
@ -38,18 +38,23 @@
"devDependencies": {
"@commitlint/cli": "^12.1.4",
"@commitlint/config-conventional": "^12.1.4",
"@logto/eslint-config": "^0.1.0-rc.6",
"@logto/ts-config": "^0.1.0-rc.6",
"@types/koa": "^2.13.3",
"@types/koa-compose": "^3.2.5",
"@types/koa-logger": "^3.1.1",
"@types/koa-mount": "^4.0.0",
"@types/koa-router": "^7.4.2",
"@types/lodash.pick": "^4.4.6",
"@types/node": "^16.3.1",
"@types/oidc-provider": "^7.4.0",
"eslint": "^7.30.0",
"eslint-formatter-pretty": "^4.1.0",
"husky": "^6.0.0",
"lint-staged": "^11.0.0",
"prettier": "^2.3.2",
"tsc-watch": "^4.4.0",
"typescript": "^4.3.2",
"xo": "0.39.1"
"typescript": "^4.3.5"
},
"engines": {
"node": ">=14.15.0",
@ -58,5 +63,6 @@
"_moduleAliases": {
"@": "./build"
},
"prettier": "@logto/essentials/.prettierrc.json"
"eslintConfig": { "extends": "@logto" },
"prettier": "@logto/eslint-config/.prettierrc"
}

View file

@ -1,6 +1,8 @@
import 'module-alias/register';
/* eslint-disable import/first */
import 'module-alias/register.js';
import dotenv from 'dotenv';
dotenv.config();
import Koa from 'koa';

View file

@ -2,9 +2,9 @@ import Koa from 'koa';
import koaLogger from 'koa-logger';
import koaErrorHandler from '@/middleware/koa-error-handler';
import { port } from '@/consts';
import initOidc from './oidc';
import initRouter from './router';
import { port } from '@/consts';
export default async function initApp(app: Koa): Promise<void> {
app.use(koaErrorHandler());

View file

@ -22,7 +22,7 @@ export const encryptPassword = (
'Unsupported password encryption method'
);
const sum = [...id].reduce((acc, current) => acc + current.charCodeAt(0), 0);
const sum = [...id].reduce((accumulator, current) => accumulator + current.charCodeAt(0), 0);
const pepper = peppers[sum % peppers.length];
assert(pepper, 'Password pepper not found');

View file

@ -1,11 +1,15 @@
{
"extends": "@logto/essentials/tsconfig.base",
"extends": "@logto/ts-config/tsconfig.base",
"compilerOptions": {
"outDir": "build",
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
"@/*": [
"src/*"
]
}
},
"include": ["src"]
"include": [
"src"
]
}

View file

@ -1 +0,0 @@
module.exports = require('@logto/essentials/.xo-config.json');

File diff suppressed because it is too large Load diff