模板文件

This commit is contained in:
Xu Chang 2024-05-06 13:34:09 +08:00
parent 1ca94a0c14
commit de867204eb
3 changed files with 7 additions and 7 deletions

View File

@ -6,7 +6,7 @@
"scripts": {
"build": "tsc",
"dev": "tsc --watch",
"test": "ts-node test.ts"
"test": "cd .. && oak-cli create ttt -d"
},
"bin": {
"oak-cli": "lib/index.js"

View File

@ -2,13 +2,13 @@ import { EntityDict } from '@project/oak-app-domain';
import { SelectOpResult } from 'oak-domain/lib/types/Entity';
import { makeException as makeDomainException } from 'oak-domain/lib/types/Exception';
export default function makeException(data: {
export default function makeException<ED extends EntityDict>(data: {
name: string;
message?: string;
opRecords: SelectOpResult<EntityDict>;
opRecords: SelectOpResult<ED>;
[A: string]: any;
}) {
const e = makeDomainException<EntityDict>(data);
const e = makeDomainException<ED>(data);
return e;
}

View File

@ -19,9 +19,9 @@ import { initialize as initFrontend } from 'oak-frontend-base/es/initialize';
import { BasicFeatures } from 'oak-frontend-base/es/features';
export default function initialize() {
const totalCheckers = mergeConcatMany([checkers] as Array<typeof checkers>),
totalCommon = mergeConcatMany([common] as Array<typeof common>),
totalRender = mergeConcatMany([render] as Array<typeof render>);
const totalCheckers = mergeConcatMany([checkers] as Array<typeof checkers>)!,
totalCommon = mergeConcatMany([common] as Array<typeof common>)!,
totalRender = mergeConcatMany([render] as Array<typeof render>)!;
const totalFeatures = {} as FeatureDict & BasicFeatures<EntityDict>;
const { features } = initFrontend<EntityDict, BackendRuntimeContext, FrontendRuntimeContext>(