@qlover/create-app 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/react-app/README.en.md +257 -0
- package/dist/templates/react-app/README.md +29 -231
- package/dist/templates/react-app/config/IOCIdentifier.ts +13 -0
- package/dist/templates/react-app/docs/en/bootstrap.md +562 -0
- package/dist/templates/react-app/docs/en/development-guide.md +523 -0
- package/dist/templates/react-app/docs/en/env.md +482 -0
- package/dist/templates/react-app/docs/en/global.md +509 -0
- package/dist/templates/react-app/docs/en/i18n.md +268 -0
- package/dist/templates/react-app/docs/en/index.md +173 -0
- package/dist/templates/react-app/docs/en/ioc.md +424 -0
- package/dist/templates/react-app/docs/en/project-structure.md +434 -0
- package/dist/templates/react-app/docs/en/request.md +425 -0
- package/dist/templates/react-app/docs/en/router.md +404 -0
- package/dist/templates/react-app/docs/en/store.md +321 -0
- package/dist/templates/react-app/docs/en/theme.md +424 -0
- package/dist/templates/react-app/docs/en/typescript-guide.md +473 -0
- package/dist/templates/react-app/docs/zh/bootstrap.md +562 -0
- package/dist/templates/react-app/docs/zh/development-guide.md +523 -0
- package/dist/templates/react-app/docs/zh/env.md +479 -0
- package/dist/templates/react-app/docs/zh/global.md +511 -0
- package/dist/templates/react-app/docs/zh/i18n.md +268 -0
- package/dist/templates/react-app/docs/zh/index.md +173 -0
- package/dist/templates/react-app/docs/zh/ioc.md +422 -0
- package/dist/templates/react-app/docs/zh/project-structure.md +434 -0
- package/dist/templates/react-app/docs/zh/request.md +429 -0
- package/dist/templates/react-app/docs/zh/router.md +408 -0
- package/dist/templates/react-app/docs/zh/store.md +321 -0
- package/dist/templates/react-app/docs/zh/theme.md +424 -0
- package/dist/templates/react-app/docs/zh/typescript-guide.md +473 -0
- package/dist/templates/react-app/package.json +2 -2
- package/dist/templates/react-app/src/base/apis/AiApi.ts +10 -5
- package/dist/templates/react-app/src/base/apis/feApi/FeApiAdapter.ts +1 -1
- package/dist/templates/react-app/src/base/apis/feApi/FeApiBootstarp.ts +1 -1
- package/dist/templates/react-app/src/base/apis/userApi/UserApi.ts +10 -17
- package/dist/templates/react-app/src/base/apis/userApi/UserApiAdapter.ts +1 -1
- package/dist/templates/react-app/src/base/apis/userApi/UserApiBootstarp.ts +2 -1
- package/dist/templates/react-app/src/base/apis/userApi/UserApiType.ts +7 -5
- package/dist/templates/react-app/src/base/cases/I18nKeyErrorPlugin.ts +3 -2
- package/dist/templates/react-app/src/base/cases/InversifyContainer.ts +33 -0
- package/dist/templates/react-app/src/base/cases/RequestLogger.ts +1 -1
- package/dist/templates/react-app/src/base/cases/RequestStatusCatcher.ts +2 -2
- package/dist/templates/react-app/src/base/services/ProcesserExecutor.ts +1 -1
- package/dist/templates/react-app/src/base/services/RouteService.ts +5 -2
- package/dist/templates/react-app/src/base/services/UserService.ts +8 -10
- package/dist/templates/react-app/src/core/IOC.ts +73 -83
- package/dist/templates/react-app/src/core/bootstraps/BootstrapApp.ts +52 -4
- package/dist/templates/react-app/src/core/bootstraps/{index.ts → BootstrapsRegistry.ts} +2 -3
- package/dist/templates/react-app/src/core/registers/IocRegisterImpl.ts +25 -0
- package/dist/templates/react-app/src/core/registers/RegisterCommon.ts +11 -17
- package/dist/templates/react-app/src/core/registers/RegisterControllers.ts +10 -4
- package/dist/templates/react-app/src/core/registers/RegisterGlobals.ts +6 -15
- package/dist/templates/react-app/src/main.tsx +2 -5
- package/dist/templates/react-app/src/styles/css/antd-themes/dark.css +3 -1
- package/dist/templates/react-app/src/styles/css/antd-themes/index.css +1 -1
- package/dist/templates/react-app/src/styles/css/antd-themes/pink.css +6 -1
- package/dist/templates/react-app/src/styles/css/page.css +1 -1
- package/dist/templates/react-app/src/uikit/controllers/JSONStorageController.ts +1 -1
- package/dist/templates/react-app/tsconfig.app.json +2 -1
- package/dist/templates/react-app/tsconfig.node.json +2 -1
- package/package.json +2 -2
- package/dist/templates/react-app/src/base/port/ApiTransactionInterface.ts +0 -7
- package/dist/templates/react-app/src/base/port/RequestCatcherInterface.ts +0 -12
- package/dist/templates/react-app/src/core/bootstrap.ts +0 -58
- package/dist/templates/react-app/src/core/registers/RegisterApi.ts +0 -5
- package/dist/templates/react-app/src/core/registers/index.ts +0 -32
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Bootstrap } from '@qlover/corekit-bridge';
|
|
2
|
-
import { envBlackList, envPrefix, browserGlobalsName } from '@config/common';
|
|
3
|
-
import { IOC } from './IOC';
|
|
4
|
-
import * as globals from '@/core/globals';
|
|
5
|
-
import { IocRegister } from './registers';
|
|
6
|
-
import { BootstrapsRegistry } from './bootstraps';
|
|
7
|
-
import { GLOBAL_NO_WINDOW } from '@config/Identifier/common.error';
|
|
8
|
-
|
|
9
|
-
export default async function startup({
|
|
10
|
-
root,
|
|
11
|
-
envSource
|
|
12
|
-
}: {
|
|
13
|
-
root: unknown;
|
|
14
|
-
envSource: Record<string, unknown>;
|
|
15
|
-
}) {
|
|
16
|
-
if (!(typeof root !== 'undefined' && root instanceof Window)) {
|
|
17
|
-
throw new Error(GLOBAL_NO_WINDOW);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const { logger, appConfig } = globals;
|
|
21
|
-
|
|
22
|
-
const iocRegister = new IocRegister({
|
|
23
|
-
pathname: root.location.pathname,
|
|
24
|
-
appConfig
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
const bootstrap = new Bootstrap({
|
|
28
|
-
root,
|
|
29
|
-
logger,
|
|
30
|
-
ioc: {
|
|
31
|
-
manager: IOC,
|
|
32
|
-
register: iocRegister
|
|
33
|
-
},
|
|
34
|
-
envOptions: {
|
|
35
|
-
target: appConfig,
|
|
36
|
-
source: { ...envSource, [envPrefix + 'BOOT_HREF']: root.location.href },
|
|
37
|
-
prefix: envPrefix,
|
|
38
|
-
blackList: envBlackList
|
|
39
|
-
},
|
|
40
|
-
globalOptions: {
|
|
41
|
-
sources: globals,
|
|
42
|
-
target: browserGlobalsName
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
try {
|
|
47
|
-
logger.info('bootstrap start...');
|
|
48
|
-
|
|
49
|
-
// init bootstrap
|
|
50
|
-
await bootstrap.initialize();
|
|
51
|
-
|
|
52
|
-
const bootstrapsRegistry = new BootstrapsRegistry(IOC);
|
|
53
|
-
|
|
54
|
-
await bootstrap.use(bootstrapsRegistry.register()).start();
|
|
55
|
-
} catch (error) {
|
|
56
|
-
logger.error(`${appConfig.appName} starup error:`, error);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { RegisterGlobals } from './RegisterGlobals';
|
|
2
|
-
import { RegisterCommon } from './RegisterCommon';
|
|
3
|
-
import { RegisterApi } from './RegisterApi';
|
|
4
|
-
import { RegisterControllers } from './RegisterControllers';
|
|
5
|
-
import {
|
|
6
|
-
InversifyContainer,
|
|
7
|
-
InversifyRegisterInterface,
|
|
8
|
-
IocRegisterOptions
|
|
9
|
-
} from '../IOC';
|
|
10
|
-
import { IOCManagerInterface } from '@qlover/corekit-bridge';
|
|
11
|
-
|
|
12
|
-
export class IocRegister implements InversifyRegisterInterface {
|
|
13
|
-
constructor(protected options: IocRegisterOptions) {}
|
|
14
|
-
|
|
15
|
-
getRegisterList(): InversifyRegisterInterface[] {
|
|
16
|
-
return [
|
|
17
|
-
new RegisterGlobals(),
|
|
18
|
-
new RegisterCommon(),
|
|
19
|
-
new RegisterApi(),
|
|
20
|
-
new RegisterControllers()
|
|
21
|
-
];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
register(
|
|
25
|
-
ioc: InversifyContainer,
|
|
26
|
-
manager: IOCManagerInterface<InversifyContainer>
|
|
27
|
-
): void {
|
|
28
|
-
this.getRegisterList().forEach((register) => {
|
|
29
|
-
register.register(ioc, manager, this.options);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|