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:
parent
ad1d1e3b59
commit
2d069cbebf
3 changed files with 21 additions and 1 deletions
|
@ -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`);
|
||||
};
|
||||
|
|
|
@ -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": {
|
||||
|
|
7
packages/schemas/update-next.sh
Executable file
7
packages/schemas/update-next.sh
Executable 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
|
Loading…
Reference in a new issue