0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(schemas): auto update next alteration scripts (#2008)

* refactor(schemas): auto update next alteration scripts

* refactor(schemas): update eslint config

* refactor(core): log when alteration is done
This commit is contained in:
Gao Sun 2022-09-27 14:43:17 +08:00 committed by GitHub
parent ad1d1e3b59
commit 2d069cbebf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

View file

@ -154,4 +154,6 @@ export const deployAlterations = async (pool: DatabasePool) => {
// eslint-disable-next-line no-await-in-loop
await deployAlteration(pool, alteration);
}
console.log(`${chalk.blue('[alteration]')} ✓ done`);
};

View file

@ -11,6 +11,7 @@
"private": true,
"scripts": {
"precommit": "lint-staged",
"version": "./update-next.sh && git add alterations/",
"generate": "rm -rf src/db-entries && ts-node src/gen/index.ts && eslint \"src/db-entries/**\" --fix",
"build:alterations": "rm -rf alterations/*.d.ts alterations/*.js && tsc -p tsconfig.build.alterations.json",
"build": "pnpm generate && rm -rf lib/ && tsc -p tsconfig.build.json && pnpm build:alterations",
@ -47,7 +48,17 @@
"extends": "@silverhand",
"rules": {
"@typescript-eslint/ban-types": "off"
},
"overrides": [
{
"files": [
"alterations/*.ts"
],
"rules": {
"unicorn/filename-case": "off"
}
}
]
},
"prettier": "@silverhand/eslint-config/.prettierrc",
"dependencies": {

View file

@ -0,0 +1,7 @@
CURRENT_VERSION=$(node -p "require('./package.json').version.replaceAll('-', '_')")
cd alterations
for x in next-*.ts;
do mv $x $CURRENT_VERSION$(echo ${x#next});
done