@akanjs/cli 1.0.19 → 2.1.0-rc.0
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/guidelines/componentRule/componentRule.generate.json +37 -0
- package/guidelines/componentRule/componentRule.instruction.md +28 -0
- package/guidelines/cssRule/cssRule.generate.json +37 -0
- package/guidelines/cssRule/cssRule.instruction.md +28 -0
- package/guidelines/docPageRule/docPageRule.generate.json +37 -0
- package/guidelines/docPageRule/docPageRule.instruction.md +25 -0
- package/guidelines/docSyncRule/docSyncRule.generate.json +37 -0
- package/guidelines/docSyncRule/docSyncRule.instruction.md +25 -0
- package/guidelines/enumConstant/enumConstant.generate.json +37 -0
- package/guidelines/enumConstant/enumConstant.instruction.md +28 -0
- package/guidelines/fieldRule/fieldRule.generate.json +37 -0
- package/guidelines/fieldRule/fieldRule.instruction.md +31 -0
- package/guidelines/framework/framework.generate.json +37 -0
- package/guidelines/framework/framework.instruction.md +29 -0
- package/guidelines/modelConstant/modelConstant.generate.json +37 -0
- package/guidelines/modelConstant/modelConstant.instruction.md +30 -0
- package/guidelines/modelDictionary/modelDictionary.generate.json +37 -0
- package/guidelines/modelDictionary/modelDictionary.instruction.md +30 -0
- package/guidelines/modelDocument/modelDocument.generate.json +37 -0
- package/guidelines/modelDocument/modelDocument.instruction.md +29 -0
- package/guidelines/modelService/modelService.generate.json +37 -0
- package/guidelines/modelService/modelService.instruction.md +28 -0
- package/guidelines/modelSignal/modelSignal.generate.json +37 -0
- package/guidelines/modelSignal/modelSignal.instruction.md +28 -0
- package/guidelines/modelStore/modelStore.generate.json +37 -0
- package/guidelines/modelStore/modelStore.instruction.md +28 -0
- package/guidelines/modelTemplate/modelTemplate.generate.json +37 -0
- package/guidelines/modelTemplate/modelTemplate.instruction.md +25 -0
- package/guidelines/modelUnit/modelUnit.generate.json +37 -0
- package/guidelines/modelUnit/modelUnit.instruction.md +25 -0
- package/guidelines/modelUtil/modelUtil.generate.json +37 -0
- package/guidelines/modelUtil/modelUtil.instruction.md +25 -0
- package/guidelines/modelView/modelView.generate.json +37 -0
- package/guidelines/modelView/modelView.instruction.md +25 -0
- package/guidelines/modelZone/modelZone.generate.json +37 -0
- package/guidelines/modelZone/modelZone.instruction.md +25 -0
- package/guidelines/moduleCodegen/moduleCodegen.generate.json +37 -0
- package/guidelines/moduleCodegen/moduleCodegen.instruction.md +28 -0
- package/guidelines/moduleOverview/moduleOverview.generate.json +37 -0
- package/guidelines/moduleOverview/moduleOverview.instruction.md +31 -0
- package/guidelines/scalarConstant/scalarConstant.generate.json +37 -0
- package/guidelines/scalarConstant/scalarConstant.instruction.md +28 -0
- package/guidelines/scalarDictionary/scalarDictionary.generate.json +37 -0
- package/guidelines/scalarDictionary/scalarDictionary.instruction.md +28 -0
- package/guidelines/scalarModule/scalarModule.generate.json +37 -0
- package/guidelines/scalarModule/scalarModule.instruction.md +29 -0
- package/guidelines/sharedUiUsage/sharedUiUsage.generate.json +37 -0
- package/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +25 -0
- package/guidelines/utilUiUsage/utilUiUsage.generate.json +37 -0
- package/guidelines/utilUiUsage/utilUiUsage.instruction.md +25 -0
- package/index.js +11630 -0
- package/package.json +38 -56
- package/templates/__scalar/__model__/__model__.constant.ts +15 -0
- package/templates/__scalar/__model__/__model__.dictionary.ts +19 -0
- package/templates/__scalar/__model__/__model__.document.ts +15 -0
- package/templates/app/akan.config.ts +14 -0
- package/templates/app/env/env.client.debug.ts.template +7 -0
- package/templates/app/env/env.client.develop.ts.template +7 -0
- package/templates/app/env/env.client.local.ts.template +7 -0
- package/templates/app/env/env.client.main.ts.template +7 -0
- package/templates/app/env/env.client.testing.ts.template +7 -0
- package/{esm/src/templates/app/env/env.client.js → templates/app/env/env.client.ts} +7 -6
- package/templates/app/env/env.client.type.ts +16 -0
- package/{esm/src/templates/app/env/env.server.testing.ts.template → templates/app/env/env.server.debug.ts.template} +3 -2
- package/templates/app/env/env.server.develop.ts.template +7 -0
- package/templates/app/env/env.server.local.ts.template +7 -0
- package/templates/app/env/env.server.main.ts.template +7 -0
- package/{cjs/src/templates → templates}/app/env/env.server.testing.ts.template +0 -0
- package/{esm/src/templates/app/env/env.server.js → templates/app/env/env.server.ts} +7 -6
- package/templates/app/lib/___appName__/__appName__.dictionary.ts +17 -0
- package/templates/app/lib/___appName__/__appName__.service.ts +13 -0
- package/templates/app/lib/___appName__/__appName__.signal.ts +17 -0
- package/templates/app/lib/___appName__/__appName__.store.ts +17 -0
- package/templates/app/lib/option.ts +18 -0
- package/templates/app/main.ts +16 -0
- package/templates/app/page/_index.tsx +296 -0
- package/templates/app/page/_layout.tsx +31 -0
- package/templates/app/page/styles.css.template +53 -0
- package/templates/app/public/favicon.ico +0 -0
- package/templates/app/public/logo.png +0 -0
- package/{esm/src/templates → templates}/app/tsconfig.json.template +0 -1
- package/templates/client.ts +46 -0
- package/templates/crudPages/[__model__Id]/edit/page.tsx +47 -0
- package/templates/crudPages/[__model__Id]/page.tsx +52 -0
- package/templates/crudPages/new/page.tsx +42 -0
- package/templates/crudPages/page.tsx +43 -0
- package/templates/crudSinglePage/page.tsx +37 -0
- package/templates/env/_env.server.type.ts +16 -0
- package/templates/facetIndex/index.ts +33 -0
- package/templates/index.ts +10 -0
- package/templates/lib/__lib/lib.constant.ts +38 -0
- package/templates/lib/__lib/lib.dictionary.ts +33 -0
- package/templates/lib/__lib/lib.document.ts +35 -0
- package/templates/lib/__lib/lib.service.ts +33 -0
- package/templates/lib/__lib/lib.signal.ts +34 -0
- package/templates/lib/__lib/lib.store.ts +33 -0
- package/templates/lib/cnst.ts +29 -0
- package/templates/lib/db.ts +32 -0
- package/{esm/src/templates/lib/dict.js → templates/lib/dict.ts} +16 -16
- package/templates/lib/sig.ts +60 -0
- package/templates/lib/srv.ts +34 -0
- package/templates/lib/st.ts +31 -0
- package/templates/lib/useClient.ts +19 -0
- package/templates/lib/useServer.ts +7 -0
- package/templates/libRoot/akan.config.ts +12 -0
- package/templates/libRoot/base/baseLogic.ts +14 -0
- package/templates/libRoot/base/index.ts +8 -0
- package/templates/libRoot/common/commonLogic.ts +14 -0
- package/templates/libRoot/common/index.ts +8 -0
- package/{esm/src/templates/libRoot/lib/___libName__/__libName__.dictionary.js → templates/libRoot/lib/___libName__/__libName__.dictionary.ts} +6 -6
- package/templates/libRoot/lib/___libName__/__libName__.service.ts +13 -0
- package/templates/libRoot/lib/___libName__/__libName__.store.ts +15 -0
- package/templates/libRoot/lib/option.ts +18 -0
- package/templates/libRoot/srvkit/backendLogic.ts +13 -0
- package/templates/libRoot/srvkit/index.ts +8 -0
- package/templates/libRoot/ui/index.ts +8 -0
- package/templates/libRoot/webkit/frontendLogic.ts +13 -0
- package/templates/libRoot/webkit/index.ts +8 -0
- package/templates/localDev/docker-compose.yaml.template +37 -0
- package/{esm/src/templates/module/__Model__.Template.js → templates/module/__Model__.Template.tsx} +11 -8
- package/templates/module/__Model__.Unit.tsx +26 -0
- package/templates/module/__Model__.Util.tsx +30 -0
- package/{esm/src/templates/module/__Model__.View.js → templates/module/__Model__.View.tsx} +11 -8
- package/{esm/src/templates/module/__Model__.Zone.js → templates/module/__Model__.Zone.tsx} +15 -12
- package/{esm/src/templates/module/__model__.constant.js → templates/module/__model__.constant.ts} +9 -6
- package/{esm/src/templates/module/__model__.dictionary.js → templates/module/__model__.dictionary.ts} +12 -9
- package/templates/module/__model__.document.ts +23 -0
- package/templates/module/__model__.service.ts +16 -0
- package/{esm/src/templates/module/__model__.signal.js → templates/module/__model__.signal.ts} +10 -7
- package/templates/module/__model__.store.ts +21 -0
- package/templates/moduleRoot/index.tsx +31 -0
- package/{esm/src/templates/libRoot → templates/pkgRoot}/tsconfig.json.template +2 -3
- package/templates/server.ts +45 -0
- package/templates/service/__model__.dictionary.ts +19 -0
- package/templates/service/__model__.service.ts +13 -0
- package/templates/service/__model__.signal.ts +17 -0
- package/templates/service/__model__.store.ts +17 -0
- package/templates/workspaceRoot/.env.template +14 -0
- package/{cjs/src/templates → templates}/workspaceRoot/.gitignore.template +14 -13
- package/templates/workspaceRoot/.vscode/settings.json.template +23 -0
- package/templates/workspaceRoot/biome.json.template +191 -0
- package/templates/workspaceRoot/bunfig.toml +4 -0
- package/templates/workspaceRoot/package.json.template +7 -0
- package/templates/workspaceRoot/tsconfig.json.template +29 -0
- package/README.md +0 -301
- package/cjs/index.js +0 -7778
- package/cjs/src/guidelines/___library/sharedUiStructureDescription.en.md +0 -767
- package/cjs/src/guidelines/___library/utilUiStructureDescription.en.md +0 -395
- package/cjs/src/guidelines/___lint/lintRuleDescription.en.md +0 -64
- package/cjs/src/guidelines/___module/moduleStructureDescription.en.md +0 -80
- package/cjs/src/guidelines/componentRule/componentRule.generate.json +0 -131
- package/cjs/src/guidelines/componentRule/componentRule.instruction.md +0 -637
- package/cjs/src/guidelines/cssRule/cssRule.generate.json +0 -93
- package/cjs/src/guidelines/cssRule/cssRule.instruction.md +0 -435
- package/cjs/src/guidelines/databaseModule/databaseModule.generate.json +0 -51
- package/cjs/src/guidelines/databaseModule/databaseModule.instruction.md +0 -631
- package/cjs/src/guidelines/docPageRule/docPageRule.generate.json +0 -72
- package/cjs/src/guidelines/docPageRule/docPageRule.instruction.md +0 -389
- package/cjs/src/guidelines/enumConstant/enumConstant.generate.json +0 -24
- package/cjs/src/guidelines/enumConstant/enumConstant.instruction.md +0 -232
- package/cjs/src/guidelines/framework/framework.generate.json +0 -119
- package/cjs/src/guidelines/framework/framework.instruction.md +0 -1110
- package/cjs/src/guidelines/howToUseStore/howToUseStore.generate.json +0 -0
- package/cjs/src/guidelines/modelConstant/modelConstant.generate.json +0 -128
- package/cjs/src/guidelines/modelConstant/modelConstant.instruction.md +0 -506
- package/cjs/src/guidelines/modelDictionary/modelDictionary.generate.json +0 -108
- package/cjs/src/guidelines/modelDictionary/modelDictionary.instruction.md +0 -547
- package/cjs/src/guidelines/modelDocument/modelDocument.generate.json +0 -129
- package/cjs/src/guidelines/modelDocument/modelDocument.instruction.md +0 -659
- package/cjs/src/guidelines/modelService/modelService.generate.json +0 -135
- package/cjs/src/guidelines/modelService/modelService.instruction.md +0 -708
- package/cjs/src/guidelines/modelSignal/modelSignal.generate.json +0 -201
- package/cjs/src/guidelines/modelSignal/modelSignal.instruction.md +0 -552
- package/cjs/src/guidelines/modelStore/modelStore.generate.json +0 -130
- package/cjs/src/guidelines/modelStore/modelStore.instruction.md +0 -590
- package/cjs/src/guidelines/modelTemplate/modelTemplate.generate.json +0 -104
- package/cjs/src/guidelines/modelTemplate/modelTemplate.instruction.md +0 -604
- package/cjs/src/guidelines/modelUnit/modelUnit.generate.json +0 -92
- package/cjs/src/guidelines/modelUnit/modelUnit.instruction.md +0 -541
- package/cjs/src/guidelines/modelUtil/modelUtil.generate.json +0 -93
- package/cjs/src/guidelines/modelUtil/modelUtil.instruction.md +0 -752
- package/cjs/src/guidelines/modelView/modelView.generate.json +0 -80
- package/cjs/src/guidelines/modelView/modelView.instruction.md +0 -1005
- package/cjs/src/guidelines/modelZone/modelZone.generate.json +0 -126
- package/cjs/src/guidelines/modelZone/modelZone.instruction.md +0 -528
- package/cjs/src/guidelines/scalarConstant/scalarConstant.generate.json +0 -106
- package/cjs/src/guidelines/scalarConstant/scalarConstant.instruction.md +0 -442
- package/cjs/src/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -83
- package/cjs/src/guidelines/scalarDictionary/scalarDictionary.instruction.md +0 -273
- package/cjs/src/guidelines/scalarModule/scalarModule.generate.json +0 -35
- package/cjs/src/guidelines/scalarModule/scalarModule.instruction.md +0 -81
- package/cjs/src/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -108
- package/cjs/src/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -310
- package/cjs/src/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -140
- package/cjs/src/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -339
- package/cjs/src/templates/__scalar/__model__/__model__.constant.js +0 -33
- package/cjs/src/templates/__scalar/__model__/__model__.dictionary.js +0 -37
- package/cjs/src/templates/__scalar/__model__/__model__.document.js +0 -33
- package/cjs/src/templates/app/akan.config.js +0 -33
- package/cjs/src/templates/app/app/[lang]/layout.js +0 -55
- package/cjs/src/templates/app/app/[lang]/page.js +0 -111
- package/cjs/src/templates/app/app/[lang]/styles.css.template +0 -20
- package/cjs/src/templates/app/app/csr.js +0 -36
- package/cjs/src/templates/app/app/index.html.template +0 -13
- package/cjs/src/templates/app/app/layout.js +0 -41
- package/cjs/src/templates/app/app/robots.js +0 -40
- package/cjs/src/templates/app/app/sitemap.js +0 -36
- package/cjs/src/templates/app/base/baseLogic.js +0 -35
- package/cjs/src/templates/app/base/index.js +0 -29
- package/cjs/src/templates/app/capacitor.config.ts.template +0 -8
- package/cjs/src/templates/app/common/commonLogic.js +0 -35
- package/cjs/src/templates/app/common/index.js +0 -29
- package/cjs/src/templates/app/env/env.client.debug.ts.template +0 -7
- package/cjs/src/templates/app/env/env.client.develop.ts.template +0 -7
- package/cjs/src/templates/app/env/env.client.js +0 -40
- package/cjs/src/templates/app/env/env.client.local.ts.template +0 -7
- package/cjs/src/templates/app/env/env.client.main.ts.template +0 -7
- package/cjs/src/templates/app/env/env.client.testing.ts.template +0 -7
- package/cjs/src/templates/app/env/env.client.type.js +0 -35
- package/cjs/src/templates/app/env/env.server.debug.ts.template +0 -10
- package/cjs/src/templates/app/env/env.server.develop.ts.template +0 -10
- package/cjs/src/templates/app/env/env.server.js +0 -39
- package/cjs/src/templates/app/env/env.server.local.ts.template +0 -10
- package/cjs/src/templates/app/env/env.server.main.ts.template +0 -10
- package/cjs/src/templates/app/instrumentation.js +0 -32
- package/cjs/src/templates/app/jest.config.js +0 -36
- package/cjs/src/templates/app/lib/___appName__/__appName__.dictionary.js +0 -35
- package/cjs/src/templates/app/lib/___appName__/__appName__.service.js +0 -31
- package/cjs/src/templates/app/lib/___appName__/__appName__.signal.js +0 -35
- package/cjs/src/templates/app/lib/___appName__/__appName__.store.js +0 -35
- package/cjs/src/templates/app/lib/option.js +0 -47
- package/cjs/src/templates/app/main.js +0 -39
- package/cjs/src/templates/app/nest/backendLogic.js +0 -34
- package/cjs/src/templates/app/nest/index.js +0 -29
- package/cjs/src/templates/app/next/frontendLogic.js +0 -34
- package/cjs/src/templates/app/next/index.js +0 -29
- package/cjs/src/templates/app/postcss.config.js.template +0 -8
- package/cjs/src/templates/app/proxy.js +0 -35
- package/cjs/src/templates/app/public/favicon.ico +0 -0
- package/cjs/src/templates/app/public/icons/icon-128x128.png +0 -0
- package/cjs/src/templates/app/public/icons/icon-144x144.png +0 -0
- package/cjs/src/templates/app/public/icons/icon-152x152.png +0 -0
- package/cjs/src/templates/app/public/icons/icon-192x192.png +0 -0
- package/cjs/src/templates/app/public/icons/icon-256x256.png +0 -0
- package/cjs/src/templates/app/public/icons/icon-384x384.png +0 -0
- package/cjs/src/templates/app/public/icons/icon-48x48.png +0 -0
- package/cjs/src/templates/app/public/icons/icon-512x512.png +0 -0
- package/cjs/src/templates/app/public/icons/icon-72x72.png +0 -0
- package/cjs/src/templates/app/public/icons/icon-96x96.png +0 -0
- package/cjs/src/templates/app/public/logo.svg +0 -70
- package/cjs/src/templates/app/public/manifest.json.template +0 -67
- package/cjs/src/templates/app/tsconfig.json.template +0 -22
- package/cjs/src/templates/app/tsconfig.spec.json.template +0 -7
- package/cjs/src/templates/app/ui/UiComponent.js +0 -38
- package/cjs/src/templates/app/ui/index.js +0 -29
- package/cjs/src/templates/client.js +0 -47
- package/cjs/src/templates/crudPages/[__model__Id]/edit/page.js +0 -72
- package/cjs/src/templates/crudPages/[__model__Id]/page.js +0 -78
- package/cjs/src/templates/crudPages/new/page.js +0 -67
- package/cjs/src/templates/crudPages/page.js +0 -68
- package/cjs/src/templates/crudSinglePage/page.js +0 -62
- package/cjs/src/templates/env/_env.server.type.js +0 -39
- package/cjs/src/templates/index.js +0 -29
- package/cjs/src/templates/lib/__lib/lib.constant.js +0 -57
- package/cjs/src/templates/lib/__lib/lib.dictionary.js +0 -50
- package/cjs/src/templates/lib/__lib/lib.document.js +0 -52
- package/cjs/src/templates/lib/__lib/lib.service.js +0 -59
- package/cjs/src/templates/lib/__lib/lib.signal.js +0 -55
- package/cjs/src/templates/lib/__lib/lib.store.js +0 -52
- package/cjs/src/templates/lib/cnst.js +0 -56
- package/cjs/src/templates/lib/db.js +0 -53
- package/cjs/src/templates/lib/dict.js +0 -69
- package/cjs/src/templates/lib/sig.js +0 -71
- package/cjs/src/templates/lib/srv.js +0 -50
- package/cjs/src/templates/lib/st.js +0 -50
- package/cjs/src/templates/lib/useClient.js +0 -40
- package/cjs/src/templates/lib/useServer.js +0 -31
- package/cjs/src/templates/libRoot/akan.config.js +0 -33
- package/cjs/src/templates/libRoot/base/baseLogic.js +0 -35
- package/cjs/src/templates/libRoot/base/index.js +0 -29
- package/cjs/src/templates/libRoot/common/commonLogic.js +0 -35
- package/cjs/src/templates/libRoot/common/index.js +0 -29
- package/cjs/src/templates/libRoot/jest.config.js +0 -36
- package/cjs/src/templates/libRoot/lib/___libName__/__libName__.dictionary.js +0 -35
- package/cjs/src/templates/libRoot/lib/___libName__/__libName__.service.js +0 -33
- package/cjs/src/templates/libRoot/lib/___libName__/__libName__.store.js +0 -35
- package/cjs/src/templates/libRoot/lib/option.js +0 -46
- package/cjs/src/templates/libRoot/nest/backendLogic.js +0 -34
- package/cjs/src/templates/libRoot/nest/index.js +0 -29
- package/cjs/src/templates/libRoot/next/frontendLogic.js +0 -34
- package/cjs/src/templates/libRoot/next/index.js +0 -29
- package/cjs/src/templates/libRoot/tsconfig.spec.json.template +0 -7
- package/cjs/src/templates/libRoot/ui/index.js +0 -29
- package/cjs/src/templates/localDev/docker-compose.yaml.template +0 -42
- package/cjs/src/templates/module/__Model__.Template.js +0 -53
- package/cjs/src/templates/module/__Model__.Unit.js +0 -43
- package/cjs/src/templates/module/__Model__.Util.js +0 -47
- package/cjs/src/templates/module/__Model__.View.js +0 -46
- package/cjs/src/templates/module/__Model__.Zone.js +0 -60
- package/cjs/src/templates/module/__model__.constant.js +0 -41
- package/cjs/src/templates/module/__model__.dictionary.js +0 -47
- package/cjs/src/templates/module/__model__.document.js +0 -46
- package/cjs/src/templates/module/__model__.service.js +0 -33
- package/cjs/src/templates/module/__model__.signal.js +0 -44
- package/cjs/src/templates/module/__model__.store.js +0 -38
- package/cjs/src/templates/module/index.js +0 -61
- package/cjs/src/templates/moduleRoot/index.js +0 -49
- package/cjs/src/templates/pkgRoot/tsconfig.json.template +0 -15
- package/cjs/src/templates/server.js +0 -87
- package/cjs/src/templates/workspaceRoot/.env.template +0 -20
- package/cjs/src/templates/workspaceRoot/.prettierignore.template +0 -10
- package/cjs/src/templates/workspaceRoot/.prettierrc.json.template +0 -6
- package/cjs/src/templates/workspaceRoot/.swcrc.template +0 -9
- package/cjs/src/templates/workspaceRoot/.vscode/settings.json.template +0 -12
- package/cjs/src/templates/workspaceRoot/README.md.template +0 -37
- package/cjs/src/templates/workspaceRoot/eslint.config.ts.template +0 -3
- package/cjs/src/templates/workspaceRoot/infra/app/Chart.yaml.template +0 -6
- package/cjs/src/templates/workspaceRoot/infra/app/templates/frontend.yaml.template +0 -182
- package/cjs/src/templates/workspaceRoot/infra/app/values/_common-values.yaml.template +0 -183
- package/cjs/src/templates/workspaceRoot/package.json.template +0 -47
- package/cjs/src/templates/workspaceRoot/tsconfig.json.template +0 -27
- package/esm/index.js +0 -7758
- package/esm/src/guidelines/___library/sharedUiStructureDescription.en.md +0 -767
- package/esm/src/guidelines/___library/utilUiStructureDescription.en.md +0 -395
- package/esm/src/guidelines/___lint/lintRuleDescription.en.md +0 -64
- package/esm/src/guidelines/___module/moduleStructureDescription.en.md +0 -80
- package/esm/src/guidelines/componentRule/componentRule.generate.json +0 -131
- package/esm/src/guidelines/componentRule/componentRule.instruction.md +0 -637
- package/esm/src/guidelines/cssRule/cssRule.generate.json +0 -93
- package/esm/src/guidelines/cssRule/cssRule.instruction.md +0 -435
- package/esm/src/guidelines/databaseModule/databaseModule.generate.json +0 -51
- package/esm/src/guidelines/databaseModule/databaseModule.instruction.md +0 -631
- package/esm/src/guidelines/docPageRule/docPageRule.generate.json +0 -72
- package/esm/src/guidelines/docPageRule/docPageRule.instruction.md +0 -389
- package/esm/src/guidelines/enumConstant/enumConstant.generate.json +0 -24
- package/esm/src/guidelines/enumConstant/enumConstant.instruction.md +0 -232
- package/esm/src/guidelines/framework/framework.generate.json +0 -119
- package/esm/src/guidelines/framework/framework.instruction.md +0 -1110
- package/esm/src/guidelines/howToUseStore/howToUseStore.generate.json +0 -0
- package/esm/src/guidelines/modelConstant/modelConstant.generate.json +0 -128
- package/esm/src/guidelines/modelConstant/modelConstant.instruction.md +0 -506
- package/esm/src/guidelines/modelDictionary/modelDictionary.generate.json +0 -108
- package/esm/src/guidelines/modelDictionary/modelDictionary.instruction.md +0 -547
- package/esm/src/guidelines/modelDocument/modelDocument.generate.json +0 -129
- package/esm/src/guidelines/modelDocument/modelDocument.instruction.md +0 -659
- package/esm/src/guidelines/modelService/modelService.generate.json +0 -135
- package/esm/src/guidelines/modelService/modelService.instruction.md +0 -708
- package/esm/src/guidelines/modelSignal/modelSignal.generate.json +0 -201
- package/esm/src/guidelines/modelSignal/modelSignal.instruction.md +0 -552
- package/esm/src/guidelines/modelStore/modelStore.generate.json +0 -130
- package/esm/src/guidelines/modelStore/modelStore.instruction.md +0 -590
- package/esm/src/guidelines/modelTemplate/modelTemplate.generate.json +0 -104
- package/esm/src/guidelines/modelTemplate/modelTemplate.instruction.md +0 -604
- package/esm/src/guidelines/modelUnit/modelUnit.generate.json +0 -92
- package/esm/src/guidelines/modelUnit/modelUnit.instruction.md +0 -541
- package/esm/src/guidelines/modelUtil/modelUtil.generate.json +0 -93
- package/esm/src/guidelines/modelUtil/modelUtil.instruction.md +0 -752
- package/esm/src/guidelines/modelView/modelView.generate.json +0 -80
- package/esm/src/guidelines/modelView/modelView.instruction.md +0 -1005
- package/esm/src/guidelines/modelZone/modelZone.generate.json +0 -126
- package/esm/src/guidelines/modelZone/modelZone.instruction.md +0 -528
- package/esm/src/guidelines/scalarConstant/scalarConstant.generate.json +0 -106
- package/esm/src/guidelines/scalarConstant/scalarConstant.instruction.md +0 -442
- package/esm/src/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -83
- package/esm/src/guidelines/scalarDictionary/scalarDictionary.instruction.md +0 -273
- package/esm/src/guidelines/scalarModule/scalarModule.generate.json +0 -35
- package/esm/src/guidelines/scalarModule/scalarModule.instruction.md +0 -81
- package/esm/src/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -108
- package/esm/src/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -310
- package/esm/src/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -140
- package/esm/src/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -339
- package/esm/src/templates/__scalar/__model__/__model__.constant.js +0 -13
- package/esm/src/templates/__scalar/__model__/__model__.dictionary.js +0 -17
- package/esm/src/templates/__scalar/__model__/__model__.document.js +0 -13
- package/esm/src/templates/app/akan.config.js +0 -13
- package/esm/src/templates/app/app/[lang]/layout.js +0 -35
- package/esm/src/templates/app/app/[lang]/page.js +0 -91
- package/esm/src/templates/app/app/[lang]/styles.css.template +0 -20
- package/esm/src/templates/app/app/csr.js +0 -16
- package/esm/src/templates/app/app/index.html.template +0 -13
- package/esm/src/templates/app/app/layout.js +0 -21
- package/esm/src/templates/app/app/robots.js +0 -20
- package/esm/src/templates/app/app/sitemap.js +0 -16
- package/esm/src/templates/app/base/baseLogic.js +0 -15
- package/esm/src/templates/app/base/index.js +0 -9
- package/esm/src/templates/app/capacitor.config.ts.template +0 -8
- package/esm/src/templates/app/common/commonLogic.js +0 -15
- package/esm/src/templates/app/common/index.js +0 -9
- package/esm/src/templates/app/env/env.client.debug.ts.template +0 -7
- package/esm/src/templates/app/env/env.client.develop.ts.template +0 -7
- package/esm/src/templates/app/env/env.client.local.ts.template +0 -7
- package/esm/src/templates/app/env/env.client.main.ts.template +0 -7
- package/esm/src/templates/app/env/env.client.testing.ts.template +0 -7
- package/esm/src/templates/app/env/env.client.type.js +0 -15
- package/esm/src/templates/app/env/env.server.debug.ts.template +0 -10
- package/esm/src/templates/app/env/env.server.develop.ts.template +0 -10
- package/esm/src/templates/app/env/env.server.local.ts.template +0 -10
- package/esm/src/templates/app/env/env.server.main.ts.template +0 -10
- package/esm/src/templates/app/instrumentation.js +0 -12
- package/esm/src/templates/app/jest.config.js +0 -16
- package/esm/src/templates/app/lib/___appName__/__appName__.dictionary.js +0 -15
- package/esm/src/templates/app/lib/___appName__/__appName__.service.js +0 -11
- package/esm/src/templates/app/lib/___appName__/__appName__.signal.js +0 -15
- package/esm/src/templates/app/lib/___appName__/__appName__.store.js +0 -15
- package/esm/src/templates/app/lib/option.js +0 -27
- package/esm/src/templates/app/main.js +0 -19
- package/esm/src/templates/app/nest/backendLogic.js +0 -14
- package/esm/src/templates/app/nest/index.js +0 -9
- package/esm/src/templates/app/next/frontendLogic.js +0 -14
- package/esm/src/templates/app/next/index.js +0 -9
- package/esm/src/templates/app/package.json.template +0 -5
- package/esm/src/templates/app/postcss.config.js.template +0 -8
- package/esm/src/templates/app/proxy.js +0 -15
- package/esm/src/templates/app/public/favicon.ico +0 -0
- package/esm/src/templates/app/public/icons/icon-128x128.png +0 -0
- package/esm/src/templates/app/public/icons/icon-144x144.png +0 -0
- package/esm/src/templates/app/public/icons/icon-152x152.png +0 -0
- package/esm/src/templates/app/public/icons/icon-192x192.png +0 -0
- package/esm/src/templates/app/public/icons/icon-256x256.png +0 -0
- package/esm/src/templates/app/public/icons/icon-384x384.png +0 -0
- package/esm/src/templates/app/public/icons/icon-48x48.png +0 -0
- package/esm/src/templates/app/public/icons/icon-512x512.png +0 -0
- package/esm/src/templates/app/public/icons/icon-72x72.png +0 -0
- package/esm/src/templates/app/public/icons/icon-96x96.png +0 -0
- package/esm/src/templates/app/public/logo.svg +0 -70
- package/esm/src/templates/app/public/manifest.json.template +0 -67
- package/esm/src/templates/app/tsconfig.spec.json.template +0 -7
- package/esm/src/templates/app/ui/UiComponent.js +0 -18
- package/esm/src/templates/app/ui/index.js +0 -9
- package/esm/src/templates/client.js +0 -27
- package/esm/src/templates/crudPages/[__model__Id]/edit/page.js +0 -52
- package/esm/src/templates/crudPages/[__model__Id]/page.js +0 -58
- package/esm/src/templates/crudPages/new/page.js +0 -47
- package/esm/src/templates/crudPages/page.js +0 -48
- package/esm/src/templates/crudSinglePage/page.js +0 -42
- package/esm/src/templates/env/_env.server.type.js +0 -19
- package/esm/src/templates/index.js +0 -9
- package/esm/src/templates/lib/__lib/lib.constant.js +0 -37
- package/esm/src/templates/lib/__lib/lib.dictionary.js +0 -30
- package/esm/src/templates/lib/__lib/lib.document.js +0 -32
- package/esm/src/templates/lib/__lib/lib.service.js +0 -39
- package/esm/src/templates/lib/__lib/lib.signal.js +0 -35
- package/esm/src/templates/lib/__lib/lib.store.js +0 -32
- package/esm/src/templates/lib/cnst.js +0 -36
- package/esm/src/templates/lib/db.js +0 -33
- package/esm/src/templates/lib/sig.js +0 -51
- package/esm/src/templates/lib/srv.js +0 -30
- package/esm/src/templates/lib/st.js +0 -30
- package/esm/src/templates/lib/useClient.js +0 -20
- package/esm/src/templates/lib/useServer.js +0 -11
- package/esm/src/templates/libRoot/.gitignore.template +0 -16
- package/esm/src/templates/libRoot/akan.config.js +0 -13
- package/esm/src/templates/libRoot/base/baseLogic.js +0 -15
- package/esm/src/templates/libRoot/base/index.js +0 -9
- package/esm/src/templates/libRoot/common/commonLogic.js +0 -15
- package/esm/src/templates/libRoot/common/index.js +0 -9
- package/esm/src/templates/libRoot/env/env.server.example.ts.template +0 -6
- package/esm/src/templates/libRoot/env/env.server.testing.ts.template +0 -6
- package/esm/src/templates/libRoot/jest.config.js +0 -16
- package/esm/src/templates/libRoot/lib/___libName__/__libName__.service.js +0 -13
- package/esm/src/templates/libRoot/lib/___libName__/__libName__.store.js +0 -15
- package/esm/src/templates/libRoot/lib/option.js +0 -26
- package/esm/src/templates/libRoot/nest/backendLogic.js +0 -14
- package/esm/src/templates/libRoot/nest/index.js +0 -9
- package/esm/src/templates/libRoot/next/frontendLogic.js +0 -14
- package/esm/src/templates/libRoot/next/index.js +0 -9
- package/esm/src/templates/libRoot/package.json.template +0 -5
- package/esm/src/templates/libRoot/tsconfig.spec.json.template +0 -7
- package/esm/src/templates/libRoot/ui/index.js +0 -9
- package/esm/src/templates/localDev/docker-compose.yaml.template +0 -42
- package/esm/src/templates/module/__Model__.Unit.js +0 -23
- package/esm/src/templates/module/__Model__.Util.js +0 -27
- package/esm/src/templates/module/__model__.document.js +0 -26
- package/esm/src/templates/module/__model__.service.js +0 -13
- package/esm/src/templates/module/__model__.store.js +0 -18
- package/esm/src/templates/module/index.js +0 -41
- package/esm/src/templates/moduleRoot/index.js +0 -29
- package/esm/src/templates/pkgRoot/tsconfig.json.template +0 -15
- package/esm/src/templates/server.js +0 -67
- package/esm/src/templates/workspaceRoot/.env.template +0 -20
- package/esm/src/templates/workspaceRoot/.gitignore.template +0 -119
- package/esm/src/templates/workspaceRoot/.prettierignore.template +0 -10
- package/esm/src/templates/workspaceRoot/.prettierrc.json.template +0 -6
- package/esm/src/templates/workspaceRoot/.swcrc.template +0 -9
- package/esm/src/templates/workspaceRoot/.vscode/settings.json.template +0 -12
- package/esm/src/templates/workspaceRoot/README.md.template +0 -37
- package/esm/src/templates/workspaceRoot/eslint.config.ts.template +0 -3
- package/esm/src/templates/workspaceRoot/infra/app/Chart.yaml.template +0 -6
- package/esm/src/templates/workspaceRoot/infra/app/templates/frontend.yaml.template +0 -182
- package/esm/src/templates/workspaceRoot/infra/app/values/_common-values.yaml.template +0 -183
- package/esm/src/templates/workspaceRoot/package.json.template +0 -47
- package/esm/src/templates/workspaceRoot/tsconfig.json.template +0 -27
- package/index.d.ts +0 -2
- package/src/application/application.command.d.ts +0 -31
- package/src/application/application.interface.d.ts +0 -40
- package/src/application/application.runner.d.ts +0 -73
- package/src/application/application.script.d.ts +0 -83
- package/src/cloud/cloud.command.d.ts +0 -12
- package/src/cloud/cloud.runner.d.ts +0 -11
- package/src/cloud/cloud.script.d.ts +0 -11
- package/src/guideline/guideline.command.d.ts +0 -9
- package/src/guideline/guideline.prompt.d.ts +0 -29
- package/src/guideline/guideline.runner.d.ts +0 -19
- package/src/guideline/guideline.script.d.ts +0 -12
- package/src/guidelines/___library/sharedUiStructureDescription.en.md +0 -767
- package/src/guidelines/___library/utilUiStructureDescription.en.md +0 -395
- package/src/guidelines/___lint/lintRuleDescription.en.md +0 -64
- package/src/guidelines/___module/moduleStructureDescription.en.md +0 -80
- package/src/guidelines/componentRule/componentRule.instruction.md +0 -637
- package/src/guidelines/cssRule/cssRule.instruction.md +0 -435
- package/src/guidelines/databaseModule/databaseModule.instruction.md +0 -631
- package/src/guidelines/docPageRule/docPageRule.instruction.md +0 -389
- package/src/guidelines/enumConstant/enumConstant.instruction.md +0 -232
- package/src/guidelines/framework/framework.instruction.md +0 -1110
- package/src/guidelines/modelConstant/modelConstant.instruction.md +0 -506
- package/src/guidelines/modelDictionary/modelDictionary.instruction.md +0 -547
- package/src/guidelines/modelDocument/modelDocument.instruction.md +0 -659
- package/src/guidelines/modelService/modelService.instruction.md +0 -708
- package/src/guidelines/modelSignal/modelSignal.instruction.md +0 -552
- package/src/guidelines/modelStore/modelStore.instruction.md +0 -590
- package/src/guidelines/modelTemplate/modelTemplate.instruction.md +0 -604
- package/src/guidelines/modelUnit/modelUnit.instruction.md +0 -541
- package/src/guidelines/modelUtil/modelUtil.instruction.md +0 -752
- package/src/guidelines/modelView/modelView.instruction.md +0 -1005
- package/src/guidelines/modelZone/modelZone.instruction.md +0 -528
- package/src/guidelines/scalarConstant/scalarConstant.instruction.md +0 -442
- package/src/guidelines/scalarDictionary/scalarDictionary.instruction.md +0 -273
- package/src/guidelines/scalarModule/scalarModule.instruction.md +0 -81
- package/src/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -310
- package/src/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -339
- package/src/library/library.command.d.ts +0 -9
- package/src/library/library.runner.d.ts +0 -9
- package/src/library/library.script.d.ts +0 -9
- package/src/module/module.command.d.ts +0 -10
- package/src/module/module.prompt.d.ts +0 -13
- package/src/module/module.request.d.ts +0 -63
- package/src/module/module.runner.d.ts +0 -53
- package/src/module/module.script.d.ts +0 -17
- package/src/package/package.command.d.ts +0 -10
- package/src/package/package.runner.d.ts +0 -9
- package/src/package/package.script.d.ts +0 -10
- package/src/page/page.command.d.ts +0 -6
- package/src/page/page.runner.d.ts +0 -8
- package/src/page/page.script.d.ts +0 -9
- package/src/scalar/scalar.command.d.ts +0 -7
- package/src/scalar/scalar.prompt.d.ts +0 -23
- package/src/scalar/scalar.runner.d.ts +0 -14
- package/src/scalar/scalar.script.d.ts +0 -7
- package/src/templates/__scalar/__model__/__model__.constant.d.ts +0 -7
- package/src/templates/__scalar/__model__/__model__.dictionary.d.ts +0 -7
- package/src/templates/__scalar/__model__/__model__.document.d.ts +0 -7
- package/src/templates/app/akan.config.d.ts +0 -6
- package/src/templates/app/app/[lang]/layout.d.ts +0 -11
- package/src/templates/app/app/[lang]/page.d.ts +0 -9
- package/src/templates/app/app/csr.d.ts +0 -9
- package/src/templates/app/app/layout.d.ts +0 -9
- package/src/templates/app/app/robots.d.ts +0 -6
- package/src/templates/app/app/sitemap.d.ts +0 -6
- package/src/templates/app/base/baseLogic.d.ts +0 -6
- package/src/templates/app/base/index.d.ts +0 -6
- package/src/templates/app/common/commonLogic.d.ts +0 -6
- package/src/templates/app/common/index.d.ts +0 -6
- package/src/templates/app/env/env.client.d.ts +0 -6
- package/src/templates/app/env/env.client.type.d.ts +0 -6
- package/src/templates/app/env/env.server.d.ts +0 -6
- package/src/templates/app/instrumentation.d.ts +0 -6
- package/src/templates/app/jest.config.d.ts +0 -6
- package/src/templates/app/lib/___appName__/__appName__.dictionary.d.ts +0 -7
- package/src/templates/app/lib/___appName__/__appName__.service.d.ts +0 -7
- package/src/templates/app/lib/___appName__/__appName__.signal.d.ts +0 -7
- package/src/templates/app/lib/___appName__/__appName__.store.d.ts +0 -7
- package/src/templates/app/lib/option.d.ts +0 -6
- package/src/templates/app/main.d.ts +0 -6
- package/src/templates/app/nest/backendLogic.d.ts +0 -6
- package/src/templates/app/nest/index.d.ts +0 -6
- package/src/templates/app/next/frontendLogic.d.ts +0 -6
- package/src/templates/app/next/index.d.ts +0 -6
- package/src/templates/app/proxy.d.ts +0 -6
- package/src/templates/app/ui/UiComponent.d.ts +0 -9
- package/src/templates/app/ui/index.d.ts +0 -6
- package/src/templates/client.d.ts +0 -4
- package/src/templates/crudPages/[__model__Id]/edit/page.d.ts +0 -11
- package/src/templates/crudPages/[__model__Id]/page.d.ts +0 -11
- package/src/templates/crudPages/new/page.d.ts +0 -11
- package/src/templates/crudPages/page.d.ts +0 -11
- package/src/templates/crudSinglePage/page.d.ts +0 -11
- package/src/templates/env/_env.server.type.d.ts +0 -7
- package/src/templates/index.d.ts +0 -6
- package/src/templates/lib/__lib/lib.constant.d.ts +0 -4
- package/src/templates/lib/__lib/lib.dictionary.d.ts +0 -4
- package/src/templates/lib/__lib/lib.document.d.ts +0 -4
- package/src/templates/lib/__lib/lib.service.d.ts +0 -4
- package/src/templates/lib/__lib/lib.signal.d.ts +0 -4
- package/src/templates/lib/__lib/lib.store.d.ts +0 -4
- package/src/templates/lib/cnst.d.ts +0 -4
- package/src/templates/lib/db.d.ts +0 -4
- package/src/templates/lib/dict.d.ts +0 -4
- package/src/templates/lib/sig.d.ts +0 -4
- package/src/templates/lib/srv.d.ts +0 -4
- package/src/templates/lib/st.d.ts +0 -4
- package/src/templates/lib/useClient.d.ts +0 -4
- package/src/templates/lib/useServer.d.ts +0 -4
- package/src/templates/libRoot/akan.config.d.ts +0 -5
- package/src/templates/libRoot/base/baseLogic.d.ts +0 -5
- package/src/templates/libRoot/base/index.d.ts +0 -5
- package/src/templates/libRoot/common/commonLogic.d.ts +0 -5
- package/src/templates/libRoot/common/index.d.ts +0 -5
- package/src/templates/libRoot/jest.config.d.ts +0 -6
- package/src/templates/libRoot/lib/___libName__/__libName__.dictionary.d.ts +0 -6
- package/src/templates/libRoot/lib/___libName__/__libName__.service.d.ts +0 -6
- package/src/templates/libRoot/lib/___libName__/__libName__.store.d.ts +0 -6
- package/src/templates/libRoot/lib/option.d.ts +0 -6
- package/src/templates/libRoot/nest/backendLogic.d.ts +0 -5
- package/src/templates/libRoot/nest/index.d.ts +0 -5
- package/src/templates/libRoot/next/frontendLogic.d.ts +0 -5
- package/src/templates/libRoot/next/index.d.ts +0 -5
- package/src/templates/libRoot/ui/index.d.ts +0 -5
- package/src/templates/module/__Model__.Template.d.ts +0 -11
- package/src/templates/module/__Model__.Unit.d.ts +0 -11
- package/src/templates/module/__Model__.Util.d.ts +0 -11
- package/src/templates/module/__Model__.View.d.ts +0 -11
- package/src/templates/module/__Model__.Zone.d.ts +0 -11
- package/src/templates/module/__model__.constant.d.ts +0 -8
- package/src/templates/module/__model__.dictionary.d.ts +0 -8
- package/src/templates/module/__model__.document.d.ts +0 -8
- package/src/templates/module/__model__.service.d.ts +0 -8
- package/src/templates/module/__model__.signal.d.ts +0 -9
- package/src/templates/module/__model__.store.d.ts +0 -8
- package/src/templates/module/index.d.ts +0 -11
- package/src/templates/moduleRoot/index.d.ts +0 -11
- package/src/templates/server.d.ts +0 -4
- package/src/workspace/workspace.command.d.ts +0 -12
- package/src/workspace/workspace.runner.d.ts +0 -13
- package/src/workspace/workspace.script.d.ts +0 -24
- package/ui/MultiScrollList.d.ts +0 -14
- /package/{cjs/src/templates → templates}/app/package.json.template +0 -0
- /package/{cjs/src/templates → templates}/libRoot/.gitignore.template +0 -0
- /package/{cjs/src/templates → templates}/libRoot/env/env.server.example.ts.template +0 -0
- /package/{cjs/src/templates → templates}/libRoot/env/env.server.testing.ts.template +0 -0
- /package/{cjs/src/templates → templates}/libRoot/package.json.template +0 -0
- /package/{cjs/src/templates → templates}/libRoot/tsconfig.json.template +0 -0
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
# Scalar Dictionary Implementation Guide for Akan.js
|
|
2
|
-
|
|
3
|
-
## Purpose of Scalar Dictionary Files
|
|
4
|
-
|
|
5
|
-
Scalar dictionary files in Akan.js provide internationalization (i18n) support by:
|
|
6
|
-
|
|
7
|
-
- Defining translations for scalar names, fields, and enum values
|
|
8
|
-
- Supporting multiple languages (primarily English and Korean)
|
|
9
|
-
- Enabling consistent terminology across the application
|
|
10
|
-
- Providing field descriptions for documentation and tooltips
|
|
11
|
-
- Maintaining type safety with the constant model definition
|
|
12
|
-
- Creating a centralized translation source for UI components
|
|
13
|
-
|
|
14
|
-
## File Structure and Location
|
|
15
|
-
|
|
16
|
-
### Location Convention
|
|
17
|
-
|
|
18
|
-
```
|
|
19
|
-
{app,lib}/
|
|
20
|
-
└── */lib/__scalar/
|
|
21
|
-
└── <scalarName>/ # camelCase directory
|
|
22
|
-
├── <scalarName>.constant.ts # scalar definition
|
|
23
|
-
└── <scalarName>.dictionary.ts # translations
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
### Key Benefits
|
|
27
|
-
|
|
28
|
-
- End-to-end type safety
|
|
29
|
-
- Fluent builder pattern
|
|
30
|
-
- Automatic validation via generics
|
|
31
|
-
- Multi-language support
|
|
32
|
-
|
|
33
|
-
## Required Imports
|
|
34
|
-
|
|
35
|
-
```typescript
|
|
36
|
-
import { scalarDictionary } from "@akanjs/dictionary";
|
|
37
|
-
|
|
38
|
-
// Import types using "import type" for cleaner code
|
|
39
|
-
import type { YourScalar, YourEnum } from "./yourScalar.constant";
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Scalar Dictionary Builder
|
|
43
|
-
|
|
44
|
-
The `scalarDictionary()` function creates a type-safe dictionary using a fluent builder pattern.
|
|
45
|
-
|
|
46
|
-
### Builder Methods
|
|
47
|
-
|
|
48
|
-
| Method | Description | Example |
|
|
49
|
-
| ---------------------------- | -------------------------------- | -------------------------------------------------------------------------- |
|
|
50
|
-
| `.of((t) => ...)` | Define scalar name & description | `.of((t) => t(["Scalar Name", "스칼라 이름"]).desc(["Desc", "설명"]))` |
|
|
51
|
-
| `.model<T>((t) => ...)` | Define field translations | `.model<YourScalar>((t) => ({ fieldName: t(["Label", "레이블"]) }))` |
|
|
52
|
-
| `.enum<T>(name, (t) => ...)` | Define enum value translations | `.enum<YourEnum>("enumName", (t) => ({ value1: t(["Label", "레이블"]) }))` |
|
|
53
|
-
|
|
54
|
-
## Translation Format
|
|
55
|
-
|
|
56
|
-
Each translation uses the `t()` function with an array of values. The array order matches the language order defined in `scalarDictionary()`.
|
|
57
|
-
|
|
58
|
-
```typescript
|
|
59
|
-
// Language order: ["en", "ko"]
|
|
60
|
-
// Index 0 = English, Index 1 = Korean
|
|
61
|
-
|
|
62
|
-
t(["English Label", "한국어 레이블"]).desc(["English description", "한국어 설명"]);
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Translation Methods
|
|
66
|
-
|
|
67
|
-
| Method | Purpose | Example |
|
|
68
|
-
| -------------- | ---------------------- | ---------------------------------------- |
|
|
69
|
-
| `t([...])` | Define the label/name | `t(["Status", "상태"])` |
|
|
70
|
-
| `.desc([...])` | Define the description | `.desc(["Current status", "현재 상태"])` |
|
|
71
|
-
|
|
72
|
-
> **Note**: Both label and description are required for complete internationalization support.
|
|
73
|
-
|
|
74
|
-
## Basic Structure
|
|
75
|
-
|
|
76
|
-
```typescript
|
|
77
|
-
import { scalarDictionary } from "@akanjs/dictionary";
|
|
78
|
-
import type { YourScalar, YourEnum } from "./yourScalar.constant";
|
|
79
|
-
|
|
80
|
-
export const dictionary = scalarDictionary(["en", "ko"])
|
|
81
|
-
.of((t) => t(["Scalar Name", "스칼라 이름"]).desc(["Scalar description", "스칼라 설명"]))
|
|
82
|
-
.model<YourScalar>((t) => ({
|
|
83
|
-
fieldName: t(["Field Label", "필드 레이블"]).desc(["Field description", "필드 설명"]),
|
|
84
|
-
}))
|
|
85
|
-
.enum<YourEnum>("enumName", (t) => ({
|
|
86
|
-
value1: t(["Value Label", "값 레이블"]).desc(["Value description", "값 설명"]),
|
|
87
|
-
}));
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
## Complete Example
|
|
91
|
-
|
|
92
|
-
```typescript
|
|
93
|
-
// File: libs/payment/lib/__scalar/price/price.dictionary.ts
|
|
94
|
-
import { scalarDictionary } from "@akanjs/dictionary";
|
|
95
|
-
import type { Currency, Price } from "./price.constant";
|
|
96
|
-
|
|
97
|
-
export const dictionary = scalarDictionary(["en", "ko"])
|
|
98
|
-
.of((t) => t(["Price", "가격"]).desc(["Price information", "가격 정보"]))
|
|
99
|
-
.model<Price>((t) => ({
|
|
100
|
-
amount: t(["Amount", "금액"]).desc(["Price amount", "가격 금액"]),
|
|
101
|
-
currency: t(["Currency", "통화"]).desc(["Currency type", "통화 유형"]),
|
|
102
|
-
}))
|
|
103
|
-
.enum<Currency>("currency", (t) => ({
|
|
104
|
-
usd: t(["USD", "달러"]).desc(["US Dollar", "미국 달러"]),
|
|
105
|
-
krw: t(["KRW", "원"]).desc(["Korean Won", "한국 원"]),
|
|
106
|
-
eur: t(["EUR", "유로"]).desc(["Euro", "유로"]),
|
|
107
|
-
}));
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
## Enum Name Matching
|
|
111
|
-
|
|
112
|
-
The first argument to `.enum()` must match the name used in `enumOf()` from the constant file. This ensures proper type checking and runtime resolution.
|
|
113
|
-
|
|
114
|
-
### Example
|
|
115
|
-
|
|
116
|
-
**constant.ts**:
|
|
117
|
-
|
|
118
|
-
```typescript
|
|
119
|
-
export class Currency extends enumOf("currency", ["usd", "krw", "eur"]) {}
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
**dictionary.ts**:
|
|
123
|
-
|
|
124
|
-
```typescript
|
|
125
|
-
// Must match: "currency"
|
|
126
|
-
.enum<Currency>("currency", (t) => ({
|
|
127
|
-
usd: t(["USD", "달러"]).desc(["US Dollar", "미국 달러"]),
|
|
128
|
-
krw: t(["KRW", "원"]).desc(["Korean Won", "한국 원"]),
|
|
129
|
-
eur: t(["EUR", "유로"]).desc(["Euro", "유로"]),
|
|
130
|
-
}))
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
> **Important**: The enum name string must exactly match the first argument of `enumOf()`. For example, `enumOf("journey", [...])` requires `.enum<Journey>("journey", ...)`.
|
|
134
|
-
|
|
135
|
-
## Type Imports
|
|
136
|
-
|
|
137
|
-
Always import types from the constant file to ensure type safety. The generic parameters enforce that all fields and enum values have translations.
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
import { scalarDictionary } from "@akanjs/dictionary";
|
|
141
|
-
|
|
142
|
-
// Import types using "import type" for cleaner code
|
|
143
|
-
import type { EncourageInfo, Inquiry, Journey } from "./encourageInfo.constant";
|
|
144
|
-
|
|
145
|
-
export const dictionary = scalarDictionary(["en", "ko"])
|
|
146
|
-
.of((t) => t(["Encourage Info", "격려 정보"]).desc(["Encouragement information", "격려 정보"]))
|
|
147
|
-
.model<EncourageInfo>((t) => ({
|
|
148
|
-
// TypeScript ensures all fields of EncourageInfo are defined
|
|
149
|
-
}))
|
|
150
|
-
.enum<Journey>("journey", (t) => ({
|
|
151
|
-
// TypeScript ensures all values of Journey enum are defined
|
|
152
|
-
}))
|
|
153
|
-
.enum<Inquiry>("inquiry", (t) => ({
|
|
154
|
-
// TypeScript ensures all values of Inquiry enum are defined
|
|
155
|
-
}));
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### Type Safety Benefits
|
|
159
|
-
|
|
160
|
-
- **`import type`**: Use `import type` for type-only imports. This ensures no runtime code is included.
|
|
161
|
-
- **`.model<Type>`**: Provides autocomplete for field names and validates that all fields are translated.
|
|
162
|
-
- **`.enum<Type>`**: Provides autocomplete for enum values and validates that all values are translated.
|
|
163
|
-
|
|
164
|
-
## Common Mistakes and Fixes
|
|
165
|
-
|
|
166
|
-
| Issue | Wrong ❌ | Correct ✅ |
|
|
167
|
-
| ----------------- | -------------------------------- | ----------------------------------------------- |
|
|
168
|
-
| Missing .desc() | `t(["Label", "레이블"])` | `t(["Label", "레이블"]).desc(["Desc", "설명"])` |
|
|
169
|
-
| Wrong enum name | `.enum<Journey>("Journey", ...)` | `.enum<Journey>("journey", ...)` |
|
|
170
|
-
| Missing export | `const dictionary = ...` | `export const dictionary = ...` |
|
|
171
|
-
| Wrong array order | `t(["한국어", "English"])` | `t(["English", "한국어"])` |
|
|
172
|
-
| Missing field | (TypeScript error) | All fields defined |
|
|
173
|
-
|
|
174
|
-
## Best Practices
|
|
175
|
-
|
|
176
|
-
### 1. Always Use Type Generics
|
|
177
|
-
|
|
178
|
-
Use `.model<Type>` and `.enum<Type>` to ensure TypeScript validates all fields and values are translated.
|
|
179
|
-
|
|
180
|
-
### 2. Consistent Language Order
|
|
181
|
-
|
|
182
|
-
Always use the same language order (e.g., `["en", "ko"]`) across all dictionaries in your project.
|
|
183
|
-
|
|
184
|
-
### 3. Meaningful Descriptions
|
|
185
|
-
|
|
186
|
-
Provide helpful descriptions that explain the field's purpose, not just repeat the label.
|
|
187
|
-
|
|
188
|
-
```typescript
|
|
189
|
-
// ❌ Bad - description just repeats the label
|
|
190
|
-
amount: t(["Amount", "금액"]).desc(["Amount", "금액"]),
|
|
191
|
-
|
|
192
|
-
// ✅ Good - description explains the purpose
|
|
193
|
-
amount: t(["Amount", "금액"]).desc(["Price amount in selected currency", "선택된 통화의 가격 금액"]),
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### 4. Export as 'dictionary'
|
|
197
|
-
|
|
198
|
-
Use the standard export name `dictionary` for consistency with the framework's auto-import system.
|
|
199
|
-
|
|
200
|
-
```typescript
|
|
201
|
-
// ✅ Correct
|
|
202
|
-
export const dictionary = scalarDictionary(["en", "ko"])...
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
## Implementation Checklist
|
|
206
|
-
|
|
207
|
-
### Required Elements
|
|
208
|
-
|
|
209
|
-
- [ ] File location: `__scalar/<name>/<name>.dictionary.ts`
|
|
210
|
-
- [ ] Import `scalarDictionary` from `@akanjs/dictionary`
|
|
211
|
-
- [ ] Import types from constant file using `import type`
|
|
212
|
-
- [ ] Initialize with correct language order: `["en", "ko"]`
|
|
213
|
-
- [ ] Define scalar name/description with `.of()`
|
|
214
|
-
- [ ] Define all field translations with `.model<Type>()`
|
|
215
|
-
- [ ] Define all enum translations with `.enum<Type>(name)`
|
|
216
|
-
- [ ] Ensure enum name matches `enumOf()` name
|
|
217
|
-
- [ ] Include both label and description for all entries
|
|
218
|
-
- [ ] Export as `dictionary`
|
|
219
|
-
|
|
220
|
-
### Translation Format
|
|
221
|
-
|
|
222
|
-
- [ ] Each translation uses `t([...]).desc([...])`
|
|
223
|
-
- [ ] First element is English translation
|
|
224
|
-
- [ ] Second element is Korean translation
|
|
225
|
-
- [ ] No trailing punctuation in translations
|
|
226
|
-
- [ ] First letter capitalized in English
|
|
227
|
-
|
|
228
|
-
## Full Example with Multiple Enums
|
|
229
|
-
|
|
230
|
-
```typescript
|
|
231
|
-
// File: apps/example/lib/__scalar/encourageInfo/encourageInfo.dictionary.ts
|
|
232
|
-
import { scalarDictionary } from "@akanjs/dictionary";
|
|
233
|
-
import type { EncourageInfo, Inquiry, Journey } from "./encourageInfo.constant";
|
|
234
|
-
|
|
235
|
-
export const dictionary = scalarDictionary(["en", "ko"])
|
|
236
|
-
.of((t) => t(["Encourage Info", "격려 정보"]).desc(["User encouragement settings", "사용자 격려 설정"]))
|
|
237
|
-
.model<EncourageInfo>((t) => ({
|
|
238
|
-
journey: t(["Journey", "여정"]).desc(["User journey stage", "사용자 여정 단계"]),
|
|
239
|
-
inquiry: t(["Inquiry", "문의"]).desc(["Inquiry type", "문의 유형"]),
|
|
240
|
-
message: t(["Message", "메시지"]).desc(["Encouragement message", "격려 메시지"]),
|
|
241
|
-
showAt: t(["Show At", "표시 시간"]).desc(["When to show encouragement", "격려 표시 시점"]),
|
|
242
|
-
}))
|
|
243
|
-
.enum<Journey>("journey", (t) => ({
|
|
244
|
-
firstJoin: t(["First Join", "첫 가입"]).desc(["User just joined", "사용자가 방금 가입함"]),
|
|
245
|
-
waitPay: t(["Waiting Payment", "결제 대기"]).desc(["Awaiting payment", "결제 대기 중"]),
|
|
246
|
-
onProgress: t(["In Progress", "진행 중"]).desc(["Currently active", "현재 진행 중"]),
|
|
247
|
-
completed: t(["Completed", "완료됨"]).desc(["Journey completed", "여정 완료"]),
|
|
248
|
-
}))
|
|
249
|
-
.enum<Inquiry>("inquiry", (t) => ({
|
|
250
|
-
general: t(["General", "일반"]).desc(["General inquiry", "일반 문의"]),
|
|
251
|
-
support: t(["Support", "지원"]).desc(["Technical support", "기술 지원"]),
|
|
252
|
-
billing: t(["Billing", "청구"]).desc(["Billing inquiry", "청구 문의"]),
|
|
253
|
-
}));
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
## Pro Tips
|
|
257
|
-
|
|
258
|
-
- **TypeScript Errors**: TypeScript will show errors if you miss any fields or enum values - use this to your advantage!
|
|
259
|
-
- **Usage**: The dictionary is used for UI labels, form validation messages, and API documentation
|
|
260
|
-
- **Descriptions**: Keep descriptions concise but informative - they appear in tooltips and help text
|
|
261
|
-
- **Consistency**: Match the field order in dictionary with the constant file for easier maintenance
|
|
262
|
-
|
|
263
|
-
## Summary
|
|
264
|
-
|
|
265
|
-
1. **Import**: `scalarDictionary` from `@akanjs/dictionary`, types from constant file
|
|
266
|
-
2. **Initialize**: `scalarDictionary(["en", "ko"])`
|
|
267
|
-
3. **Scalar Info**: `.of((t) => t([...]).desc([...]))`
|
|
268
|
-
4. **Fields**: `.model<Type>((t) => ({ field: t([...]).desc([...]) }))`
|
|
269
|
-
5. **Enums**: `.enum<Type>("enumName", (t) => ({ value: t([...]).desc([...]) }))`
|
|
270
|
-
6. **Export**: `export const dictionary = ...`
|
|
271
|
-
7. **Format**: `t(["English", "Korean"]).desc(["English desc", "Korean desc"])`
|
|
272
|
-
|
|
273
|
-
Following these guidelines ensures your scalar dictionary files are complete, type-safe, and maintainable across the Akan.js framework.
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# Scalar Modules Overview
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
|
|
5
|
-
Scalar modules provide reusable value objects for:
|
|
6
|
-
|
|
7
|
-
- Embedded documents in domain models
|
|
8
|
-
- Shared DTOs and configuration objects
|
|
9
|
-
- Type-safe schemas across your application
|
|
10
|
-
- Internationalized data structures
|
|
11
|
-
|
|
12
|
-
## Core Principles
|
|
13
|
-
|
|
14
|
-
- **Reusability**: Designed for cross-module consumption
|
|
15
|
-
- **Stateless**: Pure data containers without business logic
|
|
16
|
-
- **Type-Safe**: Full TypeScript integration with runtime validation
|
|
17
|
-
- **Composable**: Embeddable within larger domain models
|
|
18
|
-
- **I18n Ready**: Built-in translation support
|
|
19
|
-
|
|
20
|
-
## File Structure
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
{domain}/lib/
|
|
24
|
-
└── __scalar/ // Special scalar directory
|
|
25
|
-
└── [scalarName]/ // camelCase scalar name
|
|
26
|
-
├── [name].constant.ts // Schema definition
|
|
27
|
-
├── [name].dictionary.ts // I18n translations
|
|
28
|
-
└── [name].document.ts // Method extensions (optional)
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## File Responsibilities
|
|
32
|
-
|
|
33
|
-
| File Type | Purpose |
|
|
34
|
-
| ----------------- | ---------------------------------------------------------------- |
|
|
35
|
-
| `*.constant.ts` | Defines schema with `@Model.Scalar` and `@Field.Prop` decorators |
|
|
36
|
-
| `*.dictionary.ts` | Provides internationalization with `ModelDictionary<Type>` |
|
|
37
|
-
| `*.document.ts` | Extends functionality with custom methods using `by()` decorator |
|
|
38
|
-
|
|
39
|
-
## Naming Conventions
|
|
40
|
-
|
|
41
|
-
| Element | Convention | Example |
|
|
42
|
-
| ---------------- | ---------------------- | --------------------------- |
|
|
43
|
-
| Scalar Directory | `camelCase` | `geoLocation` |
|
|
44
|
-
| Constant File | `[name].constant.ts` | `geoLocation.constant.ts` |
|
|
45
|
-
| Dictionary File | `[name].dictionary.ts` | `geoLocation.dictionary.ts` |
|
|
46
|
-
| Document File | `[name].document.ts` | `geoLocation.document.ts` |
|
|
47
|
-
| Scalar Class | `PascalCase` | `GeoLocation` |
|
|
48
|
-
| Enum Values | `camelCase` | `highAccuracy` |
|
|
49
|
-
| Dictionary Keys | `kebab-case` prefixes | `desc-fieldName` |
|
|
50
|
-
|
|
51
|
-
## Core Components
|
|
52
|
-
|
|
53
|
-
1. **Constant File**: Schema definition with typed fields and validation
|
|
54
|
-
2. **Dictionary File**: I18n translations for model metadata, fields and enums
|
|
55
|
-
3. **Document File**: Optional method extensions for data transformations
|
|
56
|
-
|
|
57
|
-
## Key Rules
|
|
58
|
-
|
|
59
|
-
1. One scalar class per file with matching `@Model.Scalar` parameter
|
|
60
|
-
2. All fields require decorators (`@Field.Prop`, `@Field.Hidden`, etc.)
|
|
61
|
-
3. Dictionary must include all fields/enums with `modelName`/`modelDesc`
|
|
62
|
-
4. Use `satisfies ModelDictionary<Type>` for dictionary type safety
|
|
63
|
-
|
|
64
|
-
## Best Practices
|
|
65
|
-
|
|
66
|
-
- Design for maximum reusability across modules
|
|
67
|
-
- Keep scalars focused and lightweight
|
|
68
|
-
- Use immutable fields for invariant data
|
|
69
|
-
- Provide complete I18n coverage in dictionaries
|
|
70
|
-
- Add document methods only for data transformations
|
|
71
|
-
- Validate fields with options (min/max, minlength/maxlength)
|
|
72
|
-
|
|
73
|
-
## Integration Points
|
|
74
|
-
|
|
75
|
-
- **Domain Models**: Embedded as value objects
|
|
76
|
-
- **GraphQL**: Auto-generated types and enums
|
|
77
|
-
- **Validation**: Runtime type checking through decorators
|
|
78
|
-
- **Internationalization**: Consistent terminology via dictionaries
|
|
79
|
-
- **API Contracts**: Shared request/response payloads
|
|
80
|
-
|
|
81
|
-
Scalar modules provide foundational data structures that enable consistent, type-safe modeling across Akan.js applications while promoting code reuse and maintainability.
|
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
# Using Shared UI Components in Akan.js
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
The `@shared/ui` library in the Akan.js framework provides a comprehensive set of React components designed for building data-driven applications. This library follows consistent patterns and deeply integrates with the application's store system, making it efficient to develop complex UIs with minimal code.
|
|
6
|
-
|
|
7
|
-
## Key Features
|
|
8
|
-
|
|
9
|
-
- **Store-Centric Architecture**: Seamless integration with standardized store slices using naming conventions
|
|
10
|
-
- **Type-Safe Components**: Extensive TypeScript generic usage for compile-time safety
|
|
11
|
-
- **Internationalization**: Built-in multi-language support throughout all components
|
|
12
|
-
- **Responsive Design**: Mobile-first approach with adaptive breakpoints
|
|
13
|
-
- **Performance Optimized**: Components use memoization, lazy loading, and efficient rendering strategies
|
|
14
|
-
- **Accessibility Compliant**: Proper ARIA attributes and keyboard navigation
|
|
15
|
-
- **Extensible Architecture**: Plugin systems and customizable renderers
|
|
16
|
-
- **Unidirectional Data Flow**: Predictable state management patterns
|
|
17
|
-
|
|
18
|
-
## Getting Started
|
|
19
|
-
|
|
20
|
-
### Importing Components
|
|
21
|
-
|
|
22
|
-
UI components are available as named exports from the `@shared/ui` package:
|
|
23
|
-
|
|
24
|
-
```tsx
|
|
25
|
-
import { Field, Only, Editor } from "@shared/ui";
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
Each namespace contains specialized components for specific use cases:
|
|
29
|
-
|
|
30
|
-
- **Field**: Form inputs and data entry components
|
|
31
|
-
- **Only**: Conditional rendering based on user state and device
|
|
32
|
-
- **Editor**: Rich text editing capabilities
|
|
33
|
-
|
|
34
|
-
### Component Organization in Your Module
|
|
35
|
-
|
|
36
|
-
When building a module in Akan.js, you should organize your components following the pattern:
|
|
37
|
-
|
|
38
|
-
```
|
|
39
|
-
/lib/myFeature/
|
|
40
|
-
MyFeature.constant.ts # Types, GraphQL schema, enums
|
|
41
|
-
MyFeature.service.ts # Business logic and database operations
|
|
42
|
-
MyFeature.signal.ts # Client state management and API calls
|
|
43
|
-
MyFeature.store.ts # Zustand store definitions
|
|
44
|
-
MyFeature.Template.tsx # Form templates for create/edit
|
|
45
|
-
MyFeature.Unit.tsx # Card/list item components
|
|
46
|
-
MyFeature.View.tsx # Full page views
|
|
47
|
-
MyFeature.Zone.tsx # Layout containers
|
|
48
|
-
MyFeature.Util.tsx # Utility components
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Usage Examples
|
|
52
|
-
|
|
53
|
-
### 1. Basic Form Fields
|
|
54
|
-
|
|
55
|
-
Form fields are used for data entry and are integrated with the validation system:
|
|
56
|
-
|
|
57
|
-
```tsx
|
|
58
|
-
import { Field } from "@shared/ui";
|
|
59
|
-
import { usePage } from "@shared/client";
|
|
60
|
-
|
|
61
|
-
const MyComponent = () => {
|
|
62
|
-
const { l } = usePage(); // For internationalization
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<>
|
|
66
|
-
<Field.Text
|
|
67
|
-
label={l("myModel.title")}
|
|
68
|
-
desc={l("myModel.title.desc")}
|
|
69
|
-
value={formState.title}
|
|
70
|
-
onChange={(value) => st.do.setTitleOnMyModel(value)}
|
|
71
|
-
nullable={false}
|
|
72
|
-
maxlength={100}
|
|
73
|
-
/>
|
|
74
|
-
|
|
75
|
-
<Field.Number
|
|
76
|
-
label={l("myModel.amount")}
|
|
77
|
-
desc={l("myModel.amount.desc")}
|
|
78
|
-
value={formState.amount}
|
|
79
|
-
onChange={(value) => st.do.setAmountOnMyModel(value)}
|
|
80
|
-
min={0}
|
|
81
|
-
max={1000}
|
|
82
|
-
unit="KRW"
|
|
83
|
-
/>
|
|
84
|
-
|
|
85
|
-
<Field.ToggleSelect
|
|
86
|
-
label={l("myModel.status")}
|
|
87
|
-
desc={l("myModel.status.desc")}
|
|
88
|
-
value={formState.status}
|
|
89
|
-
items={cnst.Status}
|
|
90
|
-
onChange={(status) => st.do.setStatusOnMyModel(status)}
|
|
91
|
-
/>
|
|
92
|
-
</>
|
|
93
|
-
);
|
|
94
|
-
};
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### 2. Data Management Components
|
|
98
|
-
|
|
99
|
-
Data components are used to display and manage collections of data:
|
|
100
|
-
|
|
101
|
-
```tsx
|
|
102
|
-
import { Data, Model } from "@akanjs/ui";
|
|
103
|
-
|
|
104
|
-
export const MyFeatureAdmin = ({ sliceName = "myFeature" }) => {
|
|
105
|
-
return (
|
|
106
|
-
<Data.ListContainer
|
|
107
|
-
sliceName={sliceName}
|
|
108
|
-
renderItem={MyFeature.Unit.Card}
|
|
109
|
-
renderDashboard={MyFeature.Util.Stat}
|
|
110
|
-
renderTemplate={MyFeature.Template.General}
|
|
111
|
-
renderView={(myFeature) => <MyFeature.View.General myFeature={myFeature} />}
|
|
112
|
-
columns={["id", "title", "status", "createdAt"]}
|
|
113
|
-
actions={(myFeature) => ["remove", "edit", "view"]}
|
|
114
|
-
/>
|
|
115
|
-
);
|
|
116
|
-
};
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### 3. Loading and Data Fetching
|
|
120
|
-
|
|
121
|
-
Load components handle data fetching and state management:
|
|
122
|
-
|
|
123
|
-
```tsx
|
|
124
|
-
import { Load } from "@akanjs/ui";
|
|
125
|
-
|
|
126
|
-
export const MyFeatureView = ({ id }) => {
|
|
127
|
-
return (
|
|
128
|
-
<Load.View
|
|
129
|
-
loader={() => fetch.myFeature(id)}
|
|
130
|
-
render={(myFeature) => (
|
|
131
|
-
<div className="space-y-4 p-4">
|
|
132
|
-
<h1>{myFeature.title}</h1>
|
|
133
|
-
<p>{myFeature.description}</p>
|
|
134
|
-
</div>
|
|
135
|
-
)}
|
|
136
|
-
/>
|
|
137
|
-
);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export const MyFeatureList = () => {
|
|
141
|
-
return (
|
|
142
|
-
<Load.Units
|
|
143
|
-
init={st.do.initMyFeature}
|
|
144
|
-
renderItem={(myFeature) => <MyFeature.Unit.Card key={myFeature.id} myFeature={myFeature} />}
|
|
145
|
-
filter={(myFeature) => myFeature.isActive}
|
|
146
|
-
sort={(a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()}
|
|
147
|
-
/>
|
|
148
|
-
);
|
|
149
|
-
};
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### 4. CRUD Operations
|
|
153
|
-
|
|
154
|
-
Model components handle create, read, update and delete operations:
|
|
155
|
-
|
|
156
|
-
```tsx
|
|
157
|
-
import { Model } from "@akanjs/ui";
|
|
158
|
-
|
|
159
|
-
export const CreateMyFeature = () => {
|
|
160
|
-
return (
|
|
161
|
-
<Model.NewWrapper sliceName="myFeature">
|
|
162
|
-
<button className="btn btn-primary">Create New</button>
|
|
163
|
-
</Model.NewWrapper>
|
|
164
|
-
);
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export const EditMyFeature = ({ id }) => {
|
|
168
|
-
return (
|
|
169
|
-
<Model.EditModal
|
|
170
|
-
sliceName="myFeature"
|
|
171
|
-
id={id}
|
|
172
|
-
renderTitle={(myFeature) => `Edit ${myFeature.title}`}
|
|
173
|
-
onSubmit="closeModal"
|
|
174
|
-
/>
|
|
175
|
-
);
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
export const ViewMyFeature = ({ id }) => {
|
|
179
|
-
return (
|
|
180
|
-
<Model.ViewModal
|
|
181
|
-
id={id}
|
|
182
|
-
renderView={(myFeature) => <MyFeature.View.General myFeature={myFeature} />}
|
|
183
|
-
renderAction={(myFeature) => (
|
|
184
|
-
<Model.EditWrapper sliceName="myFeature" id={myFeature.id}>
|
|
185
|
-
<button className="btn btn-secondary">Edit</button>
|
|
186
|
-
</Model.EditWrapper>
|
|
187
|
-
)}
|
|
188
|
-
/>
|
|
189
|
-
);
|
|
190
|
-
};
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### 5. Conditional Rendering
|
|
194
|
-
|
|
195
|
-
Only components handle conditional rendering based on user roles or device:
|
|
196
|
-
|
|
197
|
-
```tsx
|
|
198
|
-
import { Only } from "@shared/ui";
|
|
199
|
-
|
|
200
|
-
export const AdminFeature = () => {
|
|
201
|
-
return (
|
|
202
|
-
<Only.Admin roles={["superadmin", "manager"]}>
|
|
203
|
-
<div className="bg-red-100 p-4">Admin Only Content</div>
|
|
204
|
-
</Only.Admin>
|
|
205
|
-
);
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
export const MobileFeature = () => {
|
|
209
|
-
return (
|
|
210
|
-
<>
|
|
211
|
-
<Only.Mobile>
|
|
212
|
-
<div className="compact-view">Mobile View</div>
|
|
213
|
-
</Only.Mobile>
|
|
214
|
-
|
|
215
|
-
<Only.Web>
|
|
216
|
-
<div className="expanded-view">Desktop View</div>
|
|
217
|
-
</Only.Web>
|
|
218
|
-
</>
|
|
219
|
-
);
|
|
220
|
-
};
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
## Integration with Store System
|
|
224
|
-
|
|
225
|
-
The components integrate deeply with the Akan.js store system using standardized naming conventions:
|
|
226
|
-
|
|
227
|
-
```tsx
|
|
228
|
-
// Field.ParentId example
|
|
229
|
-
<Field.ParentId
|
|
230
|
-
label="Organization"
|
|
231
|
-
sliceName="orgInUser" // References st.slice.orgInUser
|
|
232
|
-
value={userForm.org}
|
|
233
|
-
onChange={st.do.setOrgOnUser}
|
|
234
|
-
renderOption={(org) => org.name}
|
|
235
|
-
/>
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
The components automatically use naming conventions to interact with your store:
|
|
239
|
-
|
|
240
|
-
- `${modelName}List` for accessing list data
|
|
241
|
-
- `init${ModelName}` for initialization functions
|
|
242
|
-
- `${modelName}Form` for form state
|
|
243
|
-
- `add${ModelName}Files` for file uploads
|
|
244
|
-
|
|
245
|
-
## Common Patterns
|
|
246
|
-
|
|
247
|
-
### Render Props
|
|
248
|
-
|
|
249
|
-
Many components use render props for customization:
|
|
250
|
-
|
|
251
|
-
```tsx
|
|
252
|
-
<Data.ListContainer
|
|
253
|
-
renderItem={(item) => <MyItem item={item} />}
|
|
254
|
-
renderDashboard={(props) => <MyDashboard {...props} />}
|
|
255
|
-
renderTemplate={(form) => <MyTemplate form={form} />}
|
|
256
|
-
renderView={(model) => <MyView model={model} />}
|
|
257
|
-
/>
|
|
258
|
-
```
|
|
259
|
-
|
|
260
|
-
### Internationalization
|
|
261
|
-
|
|
262
|
-
Components automatically integrate with the internationalization system:
|
|
263
|
-
|
|
264
|
-
```tsx
|
|
265
|
-
const { l } = usePage();
|
|
266
|
-
|
|
267
|
-
<Field.Text label={l("user.name")} desc={l("user.name.desc")} placeholder={l("user.namePlaceholder")} />;
|
|
268
|
-
```
|
|
269
|
-
|
|
270
|
-
### State Management Integration
|
|
271
|
-
|
|
272
|
-
Components seamlessly integrate with the state management:
|
|
273
|
-
|
|
274
|
-
```tsx
|
|
275
|
-
<Field.ToggleSelect value={userForm.role} onChange={(role) => st.do.setRoleOnUser(role)} items={cnst.UserRole} />
|
|
276
|
-
```
|
|
277
|
-
|
|
278
|
-
## Best Practices
|
|
279
|
-
|
|
280
|
-
1. **Use the appropriate component type** for each part of your feature:
|
|
281
|
-
- Use **Field** components for data entry
|
|
282
|
-
- Use **Data** components for data visualization and management
|
|
283
|
-
- Use **Load** components for data fetching
|
|
284
|
-
- Use **Model** components for CRUD operations
|
|
285
|
-
|
|
286
|
-
2. **Leverage the internationalization system** by using the `l` function for all user-facing text
|
|
287
|
-
|
|
288
|
-
3. **Follow the naming conventions** for store slices and actions to ensure proper integration
|
|
289
|
-
|
|
290
|
-
4. **Use render props** for customization rather than creating custom components
|
|
291
|
-
|
|
292
|
-
5. **Utilize conditional rendering** with Only components rather than conditional logic in your components
|
|
293
|
-
|
|
294
|
-
6. **Structure your modules** following the Akan.js pattern with separate files for each concern
|
|
295
|
-
|
|
296
|
-
## Troubleshooting
|
|
297
|
-
|
|
298
|
-
Common issues and solutions:
|
|
299
|
-
|
|
300
|
-
1. **Component not updating when store changes**: Ensure you're using the correct store slice name and following naming conventions
|
|
301
|
-
|
|
302
|
-
2. **Field validation errors**: Check the validation rules and ensure you're providing the correct props (minlength, maxlength, etc.)
|
|
303
|
-
|
|
304
|
-
3. **Data not loading**: Verify that the loader function is correctly implemented and returning data in the expected format
|
|
305
|
-
|
|
306
|
-
4. **Missing translations**: Ensure that all keys are defined in your dictionary files and that you're using the correct model and field names
|
|
307
|
-
|
|
308
|
-
## Conclusion
|
|
309
|
-
|
|
310
|
-
The shared UI library provides a comprehensive set of components for building data-driven applications with Akan.js. By following the patterns and conventions outlined in this guide, you can efficiently build complex UIs with minimal code.
|