mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-27 15:17:30 +00:00
refactor(db): keep the touched files within their size baselines
The users identity guard moves to repositories/_shared/user-identity.ts (Users.repository.ts re-exports UserIdentityTakenError), the flag text pass of the entity generator to scripts/generate-entities-flags.ts, and the Wallet pass query takes the repository's EntityManager. The size baseline of Users.repository.ts is lowered to what it holds now (1445 to 1421); a few exports only their own file used are no longer exported.
This commit is contained in:
@@ -31,7 +31,6 @@ import {
|
||||
checkEntities,
|
||||
dumpEntities,
|
||||
fixDbTimestampClassFieldTypes,
|
||||
fixFlagClassFieldTypes,
|
||||
fixJsonClassFieldTypes,
|
||||
generateEntities,
|
||||
injectJoinColumns,
|
||||
@@ -46,6 +45,7 @@ import {
|
||||
writeRepositoriesIfMissing,
|
||||
type DefaultFixup,
|
||||
} from '../../../scripts/generate-entities';
|
||||
import { fixFlagClassFieldTypes } from '../../../scripts/generate-entities-flags';
|
||||
import { Users } from '../../../src/db/entities/Users.entity';
|
||||
import { UsersRepository } from '../../../src/db/repositories/Users.repository';
|
||||
import { createSnapshotTestDb } from '../../helpers/db-mock';
|
||||
@@ -207,7 +207,7 @@ describe('RULE1c_markBooleanColumns', () => {
|
||||
const plain = 'export class Addons {\n enabled?: boolean | null;\n}\n';
|
||||
expect(fixFlagClassFieldTypes(plain, fixups)).toBe(plain);
|
||||
expect(() => fixFlagClassFieldTypes('export class Addons {\n enabled?: number | null;\n}\n', fixups)).toThrow(
|
||||
/no IType<boolean, number> to simplify/,
|
||||
/typed IType<boolean, number> to simplify/,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user