@akanjs/cli 0.0.91 → 0.0.93
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/README.md +24 -0
- package/index.js +377 -272
- package/index.mjs +6220 -0
- package/package.json +10 -1
- package/{pkgs/@akanjs/cli/src → src}/application/application.command.d.ts +7 -7
- package/{pkgs/@akanjs/cli/src → src}/application/application.runner.d.ts +5 -5
- package/{pkgs/@akanjs/cli/src → src}/application/application.script.d.ts +8 -8
- package/src/templates/__scalar/__model__/__model__.constant.d.ts +7 -0
- package/src/templates/__scalar/__model__/__model__.constant.js +2 -1
- package/src/templates/__scalar/__model__/__model__.constant.mjs +15 -0
- package/src/templates/__scalar/__model__/__model__.dictionary.d.ts +7 -0
- package/src/templates/__scalar/__model__/__model__.dictionary.js +2 -1
- package/src/templates/__scalar/__model__/__model__.dictionary.mjs +26 -0
- package/src/templates/__scalar/__model__/__model__.document.d.ts +7 -0
- package/src/templates/__scalar/__model__/__model__.document.js +2 -1
- package/src/templates/__scalar/__model__/__model__.document.mjs +13 -0
- package/src/templates/app/akan.config.d.ts +6 -0
- package/src/templates/app/akan.config.js +2 -1
- package/src/templates/app/akan.config.mjs +16 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.d.ts +9 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.js +2 -1
- package/src/templates/app/app/[lang]/(__appName__)/(public)/forgotpassword/page.mjs +27 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/page.d.ts +9 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/page.js +2 -1
- package/src/templates/app/app/[lang]/(__appName__)/(public)/page.mjs +28 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.d.ts +9 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.js +2 -1
- package/src/templates/app/app/[lang]/(__appName__)/(public)/privacy/page.mjs +22 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.d.ts +9 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.js +2 -1
- package/src/templates/app/app/[lang]/(__appName__)/(public)/signin/page.mjs +30 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.d.ts +10 -0
- package/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.js +2 -1
- package/src/templates/app/app/[lang]/(__appName__)/(public)/termsofservice/page.mjs +21 -0
- package/src/templates/app/app/[lang]/(__appName__)/(user)/layout.d.ts +9 -0
- package/src/templates/app/app/[lang]/(__appName__)/(user)/layout.js +2 -1
- package/src/templates/app/app/[lang]/(__appName__)/(user)/layout.mjs +23 -0
- package/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.d.ts +9 -0
- package/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.js +2 -1
- package/src/templates/app/app/[lang]/(__appName__)/(user)/self/page.mjs +40 -0
- package/src/templates/app/app/[lang]/(__appName__)/layout.d.ts +9 -0
- package/src/templates/app/app/[lang]/(__appName__)/layout.js +2 -1
- package/src/templates/app/app/[lang]/(__appName__)/layout.mjs +34 -0
- package/src/templates/app/app/[lang]/admin/layout.d.ts +9 -0
- package/src/templates/app/app/[lang]/admin/layout.js +2 -1
- package/src/templates/app/app/[lang]/admin/layout.mjs +33 -0
- package/src/templates/app/app/[lang]/admin/page.d.ts +9 -0
- package/src/templates/app/app/[lang]/admin/page.js +2 -1
- package/src/templates/app/app/[lang]/admin/page.mjs +43 -0
- package/src/templates/app/app/csr.d.ts +9 -0
- package/src/templates/app/app/csr.js +2 -1
- package/src/templates/app/app/csr.mjs +14 -0
- package/src/templates/app/app/layout.d.ts +9 -0
- package/src/templates/app/app/layout.js +2 -1
- package/src/templates/app/app/layout.mjs +18 -0
- package/src/templates/app/app/robots.d.ts +6 -0
- package/src/templates/app/app/robots.js +2 -1
- package/src/templates/app/app/robots.mjs +20 -0
- package/src/templates/app/app/sitemap.d.ts +6 -0
- package/src/templates/app/app/sitemap.js +2 -1
- package/src/templates/app/app/sitemap.mjs +16 -0
- package/src/templates/app/base/baseLogic.d.ts +6 -0
- package/src/templates/app/base/baseLogic.js +2 -1
- package/src/templates/app/base/baseLogic.mjs +15 -0
- package/src/templates/app/base/index.d.ts +6 -0
- package/src/templates/app/base/index.js +2 -1
- package/src/templates/app/base/index.mjs +9 -0
- package/src/templates/app/common/commonLogic.d.ts +6 -0
- package/src/templates/app/common/commonLogic.js +2 -1
- package/src/templates/app/common/commonLogic.mjs +15 -0
- package/src/templates/app/common/index.d.ts +6 -0
- package/src/templates/app/common/index.js +2 -1
- package/src/templates/app/common/index.mjs +9 -0
- package/src/templates/app/env/env.client.d.ts +6 -0
- package/src/templates/app/env/env.client.debug.ts.template +0 -0
- package/src/templates/app/env/env.client.develop.ts.template +0 -0
- package/src/templates/app/env/env.client.js +2 -1
- package/src/templates/app/env/env.client.local.ts.template +0 -0
- package/src/templates/app/env/env.client.main.ts.template +0 -0
- package/src/templates/app/env/env.client.mjs +20 -0
- package/src/templates/app/env/env.client.testing.ts.template +0 -0
- package/src/templates/app/env/env.client.type.d.ts +6 -0
- package/src/templates/app/env/env.client.type.js +2 -1
- package/src/templates/app/env/env.client.type.mjs +15 -0
- package/src/templates/app/env/env.server.d.ts +6 -0
- package/src/templates/app/env/env.server.debug.ts.template +0 -0
- package/src/templates/app/env/env.server.develop.ts.template +0 -0
- package/src/templates/app/env/env.server.js +2 -1
- package/src/templates/app/env/env.server.local.ts.template +0 -0
- package/src/templates/app/env/env.server.main.ts.template +0 -0
- package/src/templates/app/env/env.server.mjs +19 -0
- package/src/templates/app/env/env.server.testing.ts.template +0 -0
- package/src/templates/app/jest.config.d.ts +6 -0
- package/src/templates/app/jest.config.js +2 -1
- package/src/templates/app/jest.config.mjs +16 -0
- package/src/templates/app/lib/___appName__/__appName__.dictionary.d.ts +7 -0
- package/src/templates/app/lib/___appName__/__appName__.dictionary.js +2 -1
- package/src/templates/app/lib/___appName__/__appName__.dictionary.mjs +11 -0
- package/src/templates/app/lib/___appName__/__appName__.service.d.ts +7 -0
- package/src/templates/app/lib/___appName__/__appName__.service.js +2 -1
- package/src/templates/app/lib/___appName__/__appName__.service.mjs +22 -0
- package/src/templates/app/lib/___appName__/__appName__.store.d.ts +7 -0
- package/src/templates/app/lib/___appName__/__appName__.store.js +2 -1
- package/src/templates/app/lib/___appName__/__appName__.store.mjs +16 -0
- package/src/templates/app/lib/___appName__/_server.d.ts +7 -0
- package/src/templates/app/lib/___appName__/_server.js +2 -1
- package/src/templates/app/lib/___appName__/_server.mjs +14 -0
- package/src/templates/app/lib/option.d.ts +6 -0
- package/src/templates/app/lib/option.js +2 -1
- package/src/templates/app/lib/option.mjs +22 -0
- package/src/templates/app/lib/setting/Setting.Template.d.ts +9 -0
- package/src/templates/app/lib/setting/Setting.Template.js +2 -1
- package/src/templates/app/lib/setting/Setting.Template.mjs +37 -0
- package/src/templates/app/lib/setting/Setting.Unit.d.ts +9 -0
- package/src/templates/app/lib/setting/Setting.Unit.js +2 -1
- package/src/templates/app/lib/setting/Setting.Unit.mjs +18 -0
- package/src/templates/app/lib/setting/Setting.Util.d.ts +9 -0
- package/src/templates/app/lib/setting/Setting.Util.js +2 -1
- package/src/templates/app/lib/setting/Setting.Util.mjs +14 -0
- package/src/templates/app/lib/setting/Setting.View.d.ts +9 -0
- package/src/templates/app/lib/setting/Setting.View.js +2 -1
- package/src/templates/app/lib/setting/Setting.View.mjs +31 -0
- package/src/templates/app/lib/setting/Setting.Zone.d.ts +9 -0
- package/src/templates/app/lib/setting/Setting.Zone.js +2 -1
- package/src/templates/app/lib/setting/Setting.Zone.mjs +60 -0
- package/src/templates/app/lib/setting/_server.d.ts +6 -0
- package/src/templates/app/lib/setting/_server.js +2 -1
- package/src/templates/app/lib/setting/_server.mjs +28 -0
- package/src/templates/app/lib/setting/index.d.ts +9 -0
- package/src/templates/app/lib/setting/index.js +2 -1
- package/src/templates/app/lib/setting/index.mjs +41 -0
- package/src/templates/app/lib/setting/setting.constant.d.ts +7 -0
- package/src/templates/app/lib/setting/setting.constant.js +2 -1
- package/src/templates/app/lib/setting/setting.constant.mjs +26 -0
- package/src/templates/app/lib/setting/setting.dictionary.d.ts +7 -0
- package/src/templates/app/lib/setting/setting.dictionary.js +2 -1
- package/src/templates/app/lib/setting/setting.dictionary.mjs +26 -0
- package/src/templates/app/lib/setting/setting.document.d.ts +6 -0
- package/src/templates/app/lib/setting/setting.document.js +2 -1
- package/src/templates/app/lib/setting/setting.document.mjs +28 -0
- package/src/templates/app/lib/setting/setting.service.d.ts +7 -0
- package/src/templates/app/lib/setting/setting.service.js +2 -1
- package/src/templates/app/lib/setting/setting.service.mjs +17 -0
- package/src/templates/app/lib/setting/setting.signal.d.ts +6 -0
- package/src/templates/app/lib/setting/setting.signal.js +2 -1
- package/src/templates/app/lib/setting/setting.signal.mjs +14 -0
- package/src/templates/app/lib/setting/setting.store.d.ts +6 -0
- package/src/templates/app/lib/setting/setting.store.js +2 -1
- package/src/templates/app/lib/setting/setting.store.mjs +21 -0
- package/src/templates/app/lib/summary/Summary.Template.d.ts +9 -0
- package/src/templates/app/lib/summary/Summary.Template.js +2 -1
- package/src/templates/app/lib/summary/Summary.Template.mjs +23 -0
- package/src/templates/app/lib/summary/Summary.Unit.d.ts +9 -0
- package/src/templates/app/lib/summary/Summary.Unit.js +2 -1
- package/src/templates/app/lib/summary/Summary.Unit.mjs +18 -0
- package/src/templates/app/lib/summary/Summary.Util.d.ts +9 -0
- package/src/templates/app/lib/summary/Summary.Util.js +2 -1
- package/src/templates/app/lib/summary/Summary.Util.mjs +13 -0
- package/src/templates/app/lib/summary/Summary.View.d.ts +9 -0
- package/src/templates/app/lib/summary/Summary.View.js +2 -1
- package/src/templates/app/lib/summary/Summary.View.mjs +31 -0
- package/src/templates/app/lib/summary/Summary.Zone.d.ts +9 -0
- package/src/templates/app/lib/summary/Summary.Zone.js +2 -1
- package/src/templates/app/lib/summary/Summary.Zone.mjs +42 -0
- package/src/templates/app/lib/summary/_server.d.ts +6 -0
- package/src/templates/app/lib/summary/_server.js +2 -1
- package/src/templates/app/lib/summary/_server.mjs +28 -0
- package/src/templates/app/lib/summary/index.d.ts +9 -0
- package/src/templates/app/lib/summary/index.js +2 -1
- package/src/templates/app/lib/summary/index.mjs +47 -0
- package/src/templates/app/lib/summary/summary.constant.d.ts +7 -0
- package/src/templates/app/lib/summary/summary.constant.js +2 -1
- package/src/templates/app/lib/summary/summary.constant.mjs +24 -0
- package/src/templates/app/lib/summary/summary.dictionary.d.ts +7 -0
- package/src/templates/app/lib/summary/summary.dictionary.js +2 -1
- package/src/templates/app/lib/summary/summary.dictionary.mjs +29 -0
- package/src/templates/app/lib/summary/summary.document.d.ts +6 -0
- package/src/templates/app/lib/summary/summary.document.js +2 -1
- package/src/templates/app/lib/summary/summary.document.mjs +28 -0
- package/src/templates/app/lib/summary/summary.service.d.ts +7 -0
- package/src/templates/app/lib/summary/summary.service.js +2 -1
- package/src/templates/app/lib/summary/summary.service.mjs +14 -0
- package/src/templates/app/lib/summary/summary.signal.d.ts +6 -0
- package/src/templates/app/lib/summary/summary.signal.js +2 -1
- package/src/templates/app/lib/summary/summary.signal.mjs +14 -0
- package/src/templates/app/lib/summary/summary.store.d.ts +6 -0
- package/src/templates/app/lib/summary/summary.store.js +2 -1
- package/src/templates/app/lib/summary/summary.store.mjs +21 -0
- package/src/templates/app/lib/user/User.Template.d.ts +9 -0
- package/src/templates/app/lib/user/User.Template.js +2 -1
- package/src/templates/app/lib/user/User.Template.mjs +45 -0
- package/src/templates/app/lib/user/User.Unit.d.ts +9 -0
- package/src/templates/app/lib/user/User.Unit.js +2 -1
- package/src/templates/app/lib/user/User.Unit.mjs +18 -0
- package/src/templates/app/lib/user/User.Util.d.ts +9 -0
- package/src/templates/app/lib/user/User.Util.js +2 -1
- package/src/templates/app/lib/user/User.Util.mjs +74 -0
- package/src/templates/app/lib/user/User.View.d.ts +9 -0
- package/src/templates/app/lib/user/User.View.js +2 -1
- package/src/templates/app/lib/user/User.View.mjs +46 -0
- package/src/templates/app/lib/user/User.Zone.d.ts +9 -0
- package/src/templates/app/lib/user/User.Zone.js +2 -1
- package/src/templates/app/lib/user/User.Zone.mjs +54 -0
- package/src/templates/app/lib/user/_server.d.ts +6 -0
- package/src/templates/app/lib/user/_server.js +2 -1
- package/src/templates/app/lib/user/_server.mjs +28 -0
- package/src/templates/app/lib/user/index.d.ts +9 -0
- package/src/templates/app/lib/user/index.js +2 -1
- package/src/templates/app/lib/user/index.mjs +41 -0
- package/src/templates/app/lib/user/user.constant.d.ts +7 -0
- package/src/templates/app/lib/user/user.constant.js +2 -1
- package/src/templates/app/lib/user/user.constant.mjs +47 -0
- package/src/templates/app/lib/user/user.dictionary.d.ts +7 -0
- package/src/templates/app/lib/user/user.dictionary.js +2 -1
- package/src/templates/app/lib/user/user.dictionary.mjs +32 -0
- package/src/templates/app/lib/user/user.document.d.ts +7 -0
- package/src/templates/app/lib/user/user.document.js +2 -1
- package/src/templates/app/lib/user/user.document.mjs +34 -0
- package/src/templates/app/lib/user/user.service.d.ts +7 -0
- package/src/templates/app/lib/user/user.service.js +2 -1
- package/src/templates/app/lib/user/user.service.mjs +22 -0
- package/src/templates/app/lib/user/user.signal.d.ts +6 -0
- package/src/templates/app/lib/user/user.signal.js +2 -1
- package/src/templates/app/lib/user/user.signal.mjs +14 -0
- package/src/templates/app/lib/user/user.signal.spec.d.ts +6 -0
- package/src/templates/app/lib/user/user.signal.spec.js +2 -1
- package/src/templates/app/lib/user/user.signal.spec.mjs +17 -0
- package/src/templates/app/lib/user/user.signal.test.d.ts +6 -0
- package/src/templates/app/lib/user/user.signal.test.js +2 -1
- package/src/templates/app/lib/user/user.signal.test.mjs +19 -0
- package/src/templates/app/lib/user/user.store.d.ts +6 -0
- package/src/templates/app/lib/user/user.store.js +2 -1
- package/src/templates/app/lib/user/user.store.mjs +19 -0
- package/src/templates/app/main.d.ts +6 -0
- package/src/templates/app/main.js +2 -1
- package/src/templates/app/main.mjs +20 -0
- package/src/templates/app/middleware.d.ts +6 -0
- package/src/templates/app/middleware.js +2 -1
- package/src/templates/app/middleware.mjs +15 -0
- package/src/templates/app/nest/backendLogic.d.ts +6 -0
- package/src/templates/app/nest/backendLogic.js +2 -1
- package/src/templates/app/nest/backendLogic.mjs +14 -0
- package/src/templates/app/nest/index.d.ts +6 -0
- package/src/templates/app/nest/index.js +2 -1
- package/src/templates/app/nest/index.mjs +9 -0
- package/src/templates/app/next/frontendLogic.d.ts +6 -0
- package/src/templates/app/next/frontendLogic.js +2 -1
- package/src/templates/app/next/frontendLogic.mjs +14 -0
- package/src/templates/app/next/index.d.ts +6 -0
- package/src/templates/app/next/index.js +2 -1
- package/src/templates/app/next/index.mjs +9 -0
- package/src/templates/app/ui/Footer.d.ts +9 -0
- package/src/templates/app/ui/Footer.js +2 -1
- package/src/templates/app/ui/Footer.mjs +47 -0
- package/src/templates/app/ui/MainHeader.d.ts +10 -0
- package/src/templates/app/ui/MainHeader.js +2 -1
- package/src/templates/app/ui/MainHeader.mjs +111 -0
- package/src/templates/app/ui/index.d.ts +6 -0
- package/src/templates/app/ui/index.js +2 -1
- package/src/templates/app/ui/index.mjs +10 -0
- package/src/templates/client.d.ts +4 -0
- package/src/templates/client.js +3 -2
- package/src/templates/client.mjs +22 -0
- package/src/templates/crudPages/[__model__Id]/edit/page.d.ts +11 -0
- package/src/templates/crudPages/[__model__Id]/edit/page.js +2 -1
- package/src/templates/crudPages/[__model__Id]/edit/page.mjs +53 -0
- package/src/templates/crudPages/[__model__Id]/page.d.ts +11 -0
- package/src/templates/crudPages/[__model__Id]/page.js +2 -1
- package/src/templates/crudPages/[__model__Id]/page.mjs +63 -0
- package/src/templates/crudPages/new/page.d.ts +11 -0
- package/src/templates/crudPages/new/page.js +2 -1
- package/src/templates/crudPages/new/page.mjs +50 -0
- package/src/templates/crudPages/page.d.ts +11 -0
- package/src/templates/crudPages/page.js +2 -1
- package/src/templates/crudPages/page.mjs +51 -0
- package/src/templates/index.d.ts +6 -0
- package/src/templates/index.js +2 -1
- package/src/templates/index.mjs +11 -0
- package/src/templates/lib/__lib/extends/summary.constant.d.ts +4 -0
- package/src/templates/lib/__lib/extends/summary.constant.js +3 -2
- package/src/templates/lib/__lib/extends/summary.constant.mjs +23 -0
- package/src/templates/lib/__lib/lib.constant.d.ts +4 -0
- package/src/templates/lib/__lib/lib.constant.js +2 -1
- package/src/templates/lib/__lib/lib.constant.mjs +33 -0
- package/src/templates/lib/__lib/lib.dictionary.d.ts +4 -0
- package/src/templates/lib/__lib/lib.dictionary.js +2 -1
- package/src/templates/lib/__lib/lib.dictionary.mjs +22 -0
- package/src/templates/lib/__lib/lib.document.d.ts +4 -0
- package/src/templates/lib/__lib/lib.document.js +2 -1
- package/src/templates/lib/__lib/lib.document.mjs +21 -0
- package/src/templates/lib/__lib/lib.service.d.ts +4 -0
- package/src/templates/lib/__lib/lib.service.js +3 -2
- package/src/templates/lib/__lib/lib.service.mjs +63 -0
- package/src/templates/lib/__lib/lib.signal.d.ts +4 -0
- package/src/templates/lib/__lib/lib.signal.js +2 -1
- package/src/templates/lib/__lib/lib.signal.mjs +16 -0
- package/src/templates/lib/__lib/lib.store.d.ts +4 -0
- package/src/templates/lib/__lib/lib.store.js +2 -1
- package/src/templates/lib/__lib/lib.store.mjs +14 -0
- package/src/templates/lib/__scalar/_server.d.ts +4 -0
- package/src/templates/lib/__scalar/_server.js +3 -2
- package/src/templates/lib/__scalar/_server.mjs +19 -0
- package/src/templates/lib/cnst.d.ts +4 -0
- package/src/templates/lib/cnst.js +2 -1
- package/src/templates/lib/cnst.mjs +12 -0
- package/src/templates/lib/cnst_.d.ts +4 -0
- package/src/templates/lib/cnst_.js +2 -1
- package/src/templates/lib/cnst_.mjs +31 -0
- package/src/templates/lib/db.d.ts +4 -0
- package/src/templates/lib/db.js +2 -1
- package/src/templates/lib/db.mjs +33 -0
- package/src/templates/lib/dict.d.ts +4 -0
- package/src/templates/lib/dict.js +2 -1
- package/src/templates/lib/dict.mjs +25 -0
- package/src/templates/lib/fetch.d.ts +4 -0
- package/src/templates/lib/fetch.js +3 -2
- package/src/templates/lib/fetch.mjs +28 -0
- package/src/templates/lib/sig.d.ts +4 -0
- package/src/templates/lib/sig.js +3 -2
- package/src/templates/lib/sig.mjs +17 -0
- package/src/templates/lib/srv.d.ts +4 -0
- package/src/templates/lib/srv.js +3 -2
- package/src/templates/lib/srv.mjs +32 -0
- package/src/templates/lib/st.d.ts +4 -0
- package/src/templates/lib/st.js +2 -1
- package/src/templates/lib/st.mjs +16 -0
- package/src/templates/lib/store.d.ts +4 -0
- package/src/templates/lib/store.js +3 -2
- package/src/templates/lib/store.mjs +32 -0
- package/src/templates/lib/usePage.d.ts +4 -0
- package/src/templates/lib/usePage.js +2 -1
- package/src/templates/lib/usePage.mjs +13 -0
- package/src/templates/libRoot/jest.config.d.ts +6 -0
- package/src/templates/libRoot/jest.config.js +2 -1
- package/src/templates/libRoot/jest.config.mjs +16 -0
- package/src/templates/module/__Model__.Template.d.ts +11 -0
- package/src/templates/module/__Model__.Template.js +2 -1
- package/src/templates/module/__Model__.Template.mjs +34 -0
- package/src/templates/module/__Model__.Unit.d.ts +11 -0
- package/src/templates/module/__Model__.Unit.js +2 -1
- package/src/templates/module/__Model__.Unit.mjs +22 -0
- package/src/templates/module/__Model__.Util.d.ts +11 -0
- package/src/templates/module/__Model__.Util.js +2 -1
- package/src/templates/module/__Model__.Util.mjs +50 -0
- package/src/templates/module/__Model__.View.d.ts +9 -0
- package/src/templates/module/__Model__.View.js +2 -1
- package/src/templates/module/__Model__.View.mjs +28 -0
- package/src/templates/module/__Model__.Zone.d.ts +11 -0
- package/src/templates/module/__Model__.Zone.js +2 -1
- package/src/templates/module/__Model__.Zone.mjs +63 -0
- package/src/templates/module/__model__.constant.d.ts +8 -0
- package/src/templates/module/__model__.constant.js +2 -1
- package/src/templates/module/__model__.constant.mjs +49 -0
- package/src/templates/module/__model__.dictionary.d.ts +8 -0
- package/src/templates/module/__model__.dictionary.js +2 -1
- package/src/templates/module/__model__.dictionary.mjs +78 -0
- package/src/templates/module/__model__.document.d.ts +8 -0
- package/src/templates/module/__model__.document.js +2 -1
- package/src/templates/module/__model__.document.mjs +33 -0
- package/src/templates/module/__model__.service.d.ts +8 -0
- package/src/templates/module/__model__.service.js +2 -1
- package/src/templates/module/__model__.service.mjs +21 -0
- package/src/templates/module/__model__.signal.d.ts +9 -0
- package/src/templates/module/__model__.signal.js +2 -1
- package/src/templates/module/__model__.signal.mjs +40 -0
- package/src/templates/module/__model__.signal.spec.d.ts +8 -0
- package/src/templates/module/__model__.signal.spec.js +2 -1
- package/src/templates/module/__model__.signal.spec.mjs +19 -0
- package/src/templates/module/__model__.signal.test.d.ts +8 -0
- package/src/templates/module/__model__.signal.test.js +2 -1
- package/src/templates/module/__model__.signal.test.mjs +28 -0
- package/src/templates/module/__model__.store.d.ts +8 -0
- package/src/templates/module/__model__.store.js +2 -1
- package/src/templates/module/__model__.store.mjs +19 -0
- package/src/templates/module/_server.d.ts +8 -0
- package/src/templates/module/_server.js +2 -1
- package/src/templates/module/_server.mjs +27 -0
- package/src/templates/module/index.d.ts +11 -0
- package/src/templates/module/index.js +2 -1
- package/src/templates/module/index.mjs +41 -0
- package/src/templates/server.d.ts +4 -0
- package/src/templates/server.js +3 -2
- package/src/templates/server.mjs +39 -0
- package/pkgs/@akanjs/common/Logger.d.ts +0 -28
- package/pkgs/@akanjs/common/applyMixins.d.ts +0 -3
- package/pkgs/@akanjs/common/capitalize.d.ts +0 -1
- package/pkgs/@akanjs/common/deepObjectify.d.ts +0 -4
- package/pkgs/@akanjs/common/index.d.ts +0 -18
- package/pkgs/@akanjs/common/isDayjs.d.ts +0 -2
- package/pkgs/@akanjs/common/isQueryEqual.d.ts +0 -1
- package/pkgs/@akanjs/common/isValidDate.d.ts +0 -2
- package/pkgs/@akanjs/common/lowerlize.d.ts +0 -1
- package/pkgs/@akanjs/common/mergeVersion.d.ts +0 -10
- package/pkgs/@akanjs/common/objectify.d.ts +0 -1
- package/pkgs/@akanjs/common/pathGet.d.ts +0 -1
- package/pkgs/@akanjs/common/pathSet.d.ts +0 -1
- package/pkgs/@akanjs/common/pluralize.d.ts +0 -2
- package/pkgs/@akanjs/common/randomPick.d.ts +0 -1
- package/pkgs/@akanjs/common/randomPicks.d.ts +0 -1
- package/pkgs/@akanjs/common/sleep.d.ts +0 -1
- package/pkgs/@akanjs/common/splitVersion.d.ts +0 -11
- package/pkgs/@akanjs/common/types.d.ts +0 -15
- package/pkgs/@akanjs/config/index.d.ts +0 -3
- package/pkgs/@akanjs/config/src/akanConfig.d.ts +0 -7
- package/pkgs/@akanjs/config/src/nextConfig.d.ts +0 -14
- package/pkgs/@akanjs/config/src/types.d.ts +0 -135
- package/pkgs/@akanjs/devkit/index.d.ts +0 -1
- package/pkgs/@akanjs/devkit/src/aiEditor.d.ts +0 -31
- package/pkgs/@akanjs/devkit/src/auth.d.ts +0 -9
- package/pkgs/@akanjs/devkit/src/capacitorApp.d.ts +0 -21
- package/pkgs/@akanjs/devkit/src/commandDecorators/argMeta.d.ts +0 -55
- package/pkgs/@akanjs/devkit/src/commandDecorators/command.d.ts +0 -2
- package/pkgs/@akanjs/devkit/src/commandDecorators/commandMeta.d.ts +0 -2
- package/pkgs/@akanjs/devkit/src/commandDecorators/index.d.ts +0 -5
- package/pkgs/@akanjs/devkit/src/commandDecorators/targetMeta.d.ts +0 -18
- package/pkgs/@akanjs/devkit/src/commandDecorators/types.d.ts +0 -1
- package/pkgs/@akanjs/devkit/src/constants.d.ts +0 -26
- package/pkgs/@akanjs/devkit/src/createTunnel.d.ts +0 -8
- package/pkgs/@akanjs/devkit/src/dependencyScanner.d.ts +0 -8
- package/pkgs/@akanjs/devkit/src/executors.d.ts +0 -166
- package/pkgs/@akanjs/devkit/src/extractDeps.d.ts +0 -6
- package/pkgs/@akanjs/devkit/src/getCredentials.d.ts +0 -12
- package/pkgs/@akanjs/devkit/src/getModelFileData.d.ts +0 -16
- package/pkgs/@akanjs/devkit/src/getRelatedCnsts.d.ts +0 -53
- package/pkgs/@akanjs/devkit/src/index.d.ts +0 -16
- package/pkgs/@akanjs/devkit/src/selectModel.d.ts +0 -1
- package/pkgs/@akanjs/devkit/src/streamAi.d.ts +0 -6
- package/pkgs/@akanjs/devkit/src/types.d.ts +0 -20
- package/pkgs/@akanjs/devkit/src/uploadRelease.d.ts +0 -9
- package/src/templates/app/public/favicon.ico +0 -0
- package/src/templates/app/public/icons/icon-128x128.png +0 -0
- package/src/templates/app/public/icons/icon-144x144.png +0 -0
- package/src/templates/app/public/icons/icon-152x152.png +0 -0
- package/src/templates/app/public/icons/icon-192x192.png +0 -0
- package/src/templates/app/public/icons/icon-256x256.png +0 -0
- package/src/templates/app/public/icons/icon-384x384.png +0 -0
- package/src/templates/app/public/icons/icon-48x48.png +0 -0
- package/src/templates/app/public/icons/icon-512x512.png +0 -0
- package/src/templates/app/public/icons/icon-72x72.png +0 -0
- package/src/templates/app/public/icons/icon-96x96.png +0 -0
- package/src/templates/app/public/logo.svg +0 -70
- /package/{pkgs/@akanjs/cli/index.d.ts → index.d.ts} +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/application/application.prompt.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/cloud/cloud.command.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/cloud/cloud.runner.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/cloud/cloud.script.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/library/library.command.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/library/library.runner.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/library/library.script.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/module/module.command.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/module/module.prompt.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/module/module.runner.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/module/module.script.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/package/package.command.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/package/package.runner.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/package/package.script.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/page/page.command.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/page/page.runner.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/page/page.script.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/workspace/workspace.command.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/workspace/workspace.runner.d.ts +0 -0
- /package/{pkgs/@akanjs/cli/src → src}/workspace/workspace.script.d.ts +0 -0
package/index.js
CHANGED
|
@@ -118,11 +118,8 @@ var uploadRelease = async (projectName, {
|
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
|
|
121
|
-
// pkgs/@akanjs/devkit/src/getModelFileData.ts
|
|
122
|
-
var import_fs3 = __toESM(require("fs"));
|
|
123
|
-
|
|
124
121
|
// pkgs/@akanjs/devkit/src/getRelatedCnsts.ts
|
|
125
|
-
var
|
|
122
|
+
var fs3 = __toESM(require("fs"));
|
|
126
123
|
var import_ora = __toESM(require("ora"));
|
|
127
124
|
var ts = __toESM(require("typescript"));
|
|
128
125
|
var parseTsConfig = (tsConfigPath = "./tsconfig.json") => {
|
|
@@ -132,7 +129,7 @@ var parseTsConfig = (tsConfigPath = "./tsconfig.json") => {
|
|
|
132
129
|
return ts.parseJsonConfigFileContent(
|
|
133
130
|
configFile.config,
|
|
134
131
|
ts.sys,
|
|
135
|
-
|
|
132
|
+
fs3.realpathSync(tsConfigPath).replace(/[^/\\]+$/, "")
|
|
136
133
|
);
|
|
137
134
|
};
|
|
138
135
|
var collectImportedFiles = (constantFilePath, parsedConfig) => {
|
|
@@ -229,7 +226,7 @@ var analyzeProperties = (filesToAnalyze, program2, checker) => {
|
|
|
229
226
|
isLibModule: true,
|
|
230
227
|
isImport: false,
|
|
231
228
|
libName: left.text,
|
|
232
|
-
source:
|
|
229
|
+
source: fs3.readFileSync(symbolFilePath, "utf-8"),
|
|
233
230
|
isScalar
|
|
234
231
|
});
|
|
235
232
|
} else {
|
|
@@ -239,7 +236,7 @@ var analyzeProperties = (filesToAnalyze, program2, checker) => {
|
|
|
239
236
|
isImport: false,
|
|
240
237
|
libName: left.text,
|
|
241
238
|
isScalar,
|
|
242
|
-
source:
|
|
239
|
+
source: fs3.readFileSync(symbolFilePath, "utf-8")
|
|
243
240
|
});
|
|
244
241
|
}
|
|
245
242
|
}
|
|
@@ -257,7 +254,7 @@ var analyzeProperties = (filesToAnalyze, program2, checker) => {
|
|
|
257
254
|
isLibModule: false,
|
|
258
255
|
isImport: true,
|
|
259
256
|
isScalar,
|
|
260
|
-
source:
|
|
257
|
+
source: fs3.readFileSync(resolved, "utf-8")
|
|
261
258
|
});
|
|
262
259
|
}
|
|
263
260
|
}
|
|
@@ -282,7 +279,6 @@ var getRelatedCnsts = (constantFilePath) => {
|
|
|
282
279
|
|
|
283
280
|
// pkgs/@akanjs/devkit/src/selectModel.ts
|
|
284
281
|
var import_prompts = require("@inquirer/prompts");
|
|
285
|
-
var import_fs4 = __toESM(require("fs"));
|
|
286
282
|
|
|
287
283
|
// pkgs/@akanjs/devkit/src/streamAi.ts
|
|
288
284
|
var import_prompts2 = require("@langchain/core/prompts");
|
|
@@ -473,7 +469,7 @@ var sleep = async (ms) => {
|
|
|
473
469
|
};
|
|
474
470
|
|
|
475
471
|
// pkgs/@akanjs/config/src/akanConfig.ts
|
|
476
|
-
var
|
|
472
|
+
var import_fs3 = __toESM(require("fs"));
|
|
477
473
|
var import_path2 = __toESM(require("path"));
|
|
478
474
|
|
|
479
475
|
// pkgs/@akanjs/config/src/nextConfig.ts
|
|
@@ -688,7 +684,7 @@ CMD ["npm", "start"]`,
|
|
|
688
684
|
};
|
|
689
685
|
var getAppConfig = async (appRoot, props) => {
|
|
690
686
|
const akanConfigPath = import_path2.default.join(appRoot, "akan.config.ts");
|
|
691
|
-
if (!
|
|
687
|
+
if (!import_fs3.default.existsSync(akanConfigPath))
|
|
692
688
|
throw new Error(`application akan.config.ts is not found ${appRoot}`);
|
|
693
689
|
const configImp = (await import(`${appRoot}/akan.config.ts`)).default;
|
|
694
690
|
const config = typeof configImp === "function" ? configImp(props) : configImp;
|
|
@@ -708,7 +704,7 @@ var makeLibConfig = (config, props) => {
|
|
|
708
704
|
};
|
|
709
705
|
var getLibConfig = async (libRoot, props) => {
|
|
710
706
|
const akanConfigPath = import_path2.default.join(libRoot, "akan.config.ts");
|
|
711
|
-
if (!
|
|
707
|
+
if (!import_fs3.default.existsSync(akanConfigPath))
|
|
712
708
|
throw new Error(`library akan.config.ts is not found ${libRoot}`);
|
|
713
709
|
const configImp = (await import(`${libRoot}/akan.config.ts`)).default;
|
|
714
710
|
const config = typeof configImp === "function" ? configImp(props) : configImp;
|
|
@@ -753,14 +749,15 @@ var getDefaultFileScan = () => ({
|
|
|
753
749
|
});
|
|
754
750
|
|
|
755
751
|
// pkgs/@akanjs/devkit/src/executors.ts
|
|
752
|
+
var import_chalk = __toESM(require("chalk"));
|
|
756
753
|
var import_child_process = require("child_process");
|
|
757
754
|
var import_dotenv = __toESM(require("dotenv"));
|
|
758
|
-
var
|
|
755
|
+
var import_fs4 = __toESM(require("fs"));
|
|
759
756
|
var import_promises = __toESM(require("fs/promises"));
|
|
760
757
|
var import_path3 = __toESM(require("path"));
|
|
761
758
|
|
|
762
759
|
// pkgs/@akanjs/devkit/src/dependencyScanner.ts
|
|
763
|
-
var
|
|
760
|
+
var fs5 = __toESM(require("fs"));
|
|
764
761
|
var path3 = __toESM(require("path"));
|
|
765
762
|
var ts2 = __toESM(require("typescript"));
|
|
766
763
|
var TypeScriptDependencyScanner = class {
|
|
@@ -805,7 +802,7 @@ var TypeScriptDependencyScanner = class {
|
|
|
805
802
|
async #findTypeScriptFiles(directory) {
|
|
806
803
|
const files = [];
|
|
807
804
|
const processDirectory = async (dir) => {
|
|
808
|
-
const entries = await
|
|
805
|
+
const entries = await fs5.promises.readdir(dir, { withFileTypes: true });
|
|
809
806
|
for (const entry of entries) {
|
|
810
807
|
const fullPath = path3.join(dir, entry.name);
|
|
811
808
|
if (entry.isDirectory()) {
|
|
@@ -823,7 +820,7 @@ var TypeScriptDependencyScanner = class {
|
|
|
823
820
|
return;
|
|
824
821
|
this.#visitedFiles.add(filePath);
|
|
825
822
|
try {
|
|
826
|
-
const fileContent = await
|
|
823
|
+
const fileContent = await fs5.promises.readFile(filePath, "utf-8");
|
|
827
824
|
const imports = this.#extractImports(fileContent, filePath);
|
|
828
825
|
const resolvedImports = imports.map((importPath) => {
|
|
829
826
|
if (importPath.startsWith(".")) {
|
|
@@ -838,11 +835,11 @@ var TypeScriptDependencyScanner = class {
|
|
|
838
835
|
}
|
|
839
836
|
}
|
|
840
837
|
#ensureExtension(filePath) {
|
|
841
|
-
if (
|
|
838
|
+
if (fs5.existsSync(`${filePath}.ts`))
|
|
842
839
|
return `${filePath}.ts`;
|
|
843
|
-
else if (
|
|
840
|
+
else if (fs5.existsSync(`${filePath}.tsx`))
|
|
844
841
|
return `${filePath}.tsx`;
|
|
845
|
-
else if (
|
|
842
|
+
else if (fs5.existsSync(filePath))
|
|
846
843
|
return filePath;
|
|
847
844
|
return `${filePath}.ts`;
|
|
848
845
|
}
|
|
@@ -913,8 +910,8 @@ var Executor = class {
|
|
|
913
910
|
constructor(name, cwdPath) {
|
|
914
911
|
this.logger = new Logger(name);
|
|
915
912
|
this.cwdPath = cwdPath;
|
|
916
|
-
if (!
|
|
917
|
-
|
|
913
|
+
if (!import_fs4.default.existsSync(cwdPath))
|
|
914
|
+
import_fs4.default.mkdirSync(cwdPath, { recursive: true });
|
|
918
915
|
}
|
|
919
916
|
exec(command, options = {}) {
|
|
920
917
|
const proc = (0, import_child_process.exec)(command, { cwd: this.cwdPath, ...options });
|
|
@@ -922,7 +919,7 @@ var Executor = class {
|
|
|
922
919
|
Logger.raw(data.toString());
|
|
923
920
|
});
|
|
924
921
|
proc.stderr?.on("data", (data) => {
|
|
925
|
-
Logger.raw(data.toString());
|
|
922
|
+
Logger.raw(import_chalk.default.red(data.toString()));
|
|
926
923
|
});
|
|
927
924
|
return new Promise((resolve, reject) => {
|
|
928
925
|
proc.on("exit", (code, signal) => {
|
|
@@ -936,7 +933,7 @@ var Executor = class {
|
|
|
936
933
|
spawn(command, args = [], options = {}) {
|
|
937
934
|
const proc = (0, import_child_process.spawn)(command, args, { cwd: this.cwdPath, stdio: "inherit", ...options });
|
|
938
935
|
proc.stderr?.on("data", (data) => {
|
|
939
|
-
Logger.raw(data.toString());
|
|
936
|
+
Logger.raw(import_chalk.default.red(data.toString()));
|
|
940
937
|
});
|
|
941
938
|
return new Promise((resolve, reject) => {
|
|
942
939
|
proc.on("exit", (code, signal) => {
|
|
@@ -973,31 +970,31 @@ var Executor = class {
|
|
|
973
970
|
}
|
|
974
971
|
mkdir(dirPath) {
|
|
975
972
|
const writePath = this.#getPath(dirPath);
|
|
976
|
-
if (!
|
|
977
|
-
|
|
973
|
+
if (!import_fs4.default.existsSync(writePath))
|
|
974
|
+
import_fs4.default.mkdirSync(writePath, { recursive: true });
|
|
978
975
|
this.logger.verbose(`Make directory ${writePath}`);
|
|
979
976
|
return this;
|
|
980
977
|
}
|
|
981
978
|
exists(filePath) {
|
|
982
979
|
const readPath = this.#getPath(filePath);
|
|
983
|
-
return
|
|
980
|
+
return import_fs4.default.existsSync(readPath);
|
|
984
981
|
}
|
|
985
982
|
writeFile(filePath, content, { overwrite = true } = {}) {
|
|
986
983
|
const writePath = this.#getPath(filePath);
|
|
987
984
|
const dir = import_path3.default.dirname(writePath);
|
|
988
|
-
if (!
|
|
989
|
-
|
|
985
|
+
if (!import_fs4.default.existsSync(dir))
|
|
986
|
+
import_fs4.default.mkdirSync(dir, { recursive: true });
|
|
990
987
|
const contentStr = typeof content === "string" ? content : JSON.stringify(content, null, 2);
|
|
991
|
-
if (
|
|
992
|
-
const currentContent =
|
|
988
|
+
if (import_fs4.default.existsSync(writePath)) {
|
|
989
|
+
const currentContent = import_fs4.default.readFileSync(writePath, "utf8");
|
|
993
990
|
if (currentContent === contentStr || !overwrite)
|
|
994
991
|
this.logger.verbose(`File ${writePath} is unchanged`);
|
|
995
992
|
else {
|
|
996
|
-
|
|
993
|
+
import_fs4.default.writeFileSync(writePath, contentStr, "utf8");
|
|
997
994
|
this.logger.verbose(`File ${writePath} is changed`);
|
|
998
995
|
}
|
|
999
996
|
} else {
|
|
1000
|
-
|
|
997
|
+
import_fs4.default.writeFileSync(writePath, contentStr, "utf8");
|
|
1001
998
|
this.logger.verbose(`File ${writePath} is created`);
|
|
1002
999
|
}
|
|
1003
1000
|
return this;
|
|
@@ -1013,11 +1010,11 @@ var Executor = class {
|
|
|
1013
1010
|
}
|
|
1014
1011
|
readFile(filePath) {
|
|
1015
1012
|
const readPath = this.#getPath(filePath);
|
|
1016
|
-
return
|
|
1013
|
+
return import_fs4.default.readFileSync(readPath, "utf8");
|
|
1017
1014
|
}
|
|
1018
1015
|
readJson(filePath) {
|
|
1019
1016
|
const readPath = this.#getPath(filePath);
|
|
1020
|
-
return JSON.parse(
|
|
1017
|
+
return JSON.parse(import_fs4.default.readFileSync(readPath, "utf8"));
|
|
1021
1018
|
}
|
|
1022
1019
|
async cp(srcPath, destPath) {
|
|
1023
1020
|
const src = this.#getPath(srcPath);
|
|
@@ -1051,7 +1048,7 @@ var Executor = class {
|
|
|
1051
1048
|
overwrite = true
|
|
1052
1049
|
}, dict = {}) {
|
|
1053
1050
|
if (targetPath.endsWith(".js") || targetPath.endsWith(".jsx")) {
|
|
1054
|
-
const getContent =
|
|
1051
|
+
const getContent = require(templatePath);
|
|
1055
1052
|
const result = getContent.default(scanResult ?? null, dict);
|
|
1056
1053
|
if (result === null)
|
|
1057
1054
|
return;
|
|
@@ -1086,7 +1083,7 @@ var Executor = class {
|
|
|
1086
1083
|
overwrite = true
|
|
1087
1084
|
}) {
|
|
1088
1085
|
const templatePath = `${__dirname}/src/templates${template ? `/${template}` : ""}`.replace(".ts", ".js");
|
|
1089
|
-
if (
|
|
1086
|
+
if (import_fs4.default.statSync(templatePath).isFile()) {
|
|
1090
1087
|
const filename = import_path3.default.basename(templatePath);
|
|
1091
1088
|
await this.#applyTemplateFile(
|
|
1092
1089
|
{ templatePath, targetPath: import_path3.default.join(basePath2, filename), scanResult, overwrite },
|
|
@@ -1097,7 +1094,7 @@ var Executor = class {
|
|
|
1097
1094
|
await Promise.all(
|
|
1098
1095
|
subdirs.map(async (subdir) => {
|
|
1099
1096
|
const subpath = import_path3.default.join(templatePath, subdir);
|
|
1100
|
-
if (
|
|
1097
|
+
if (import_fs4.default.statSync(subpath).isFile())
|
|
1101
1098
|
await this.#applyTemplateFile(
|
|
1102
1099
|
{ templatePath: subpath, targetPath: import_path3.default.join(basePath2, subdir), scanResult, overwrite },
|
|
1103
1100
|
dict
|
|
@@ -1203,7 +1200,7 @@ var WorkspaceExecutor = class _WorkspaceExecutor extends Executor {
|
|
|
1203
1200
|
if (AVOID_DIRS.includes(dir))
|
|
1204
1201
|
return;
|
|
1205
1202
|
const dirPath = import_path3.default.join(dirname, dir);
|
|
1206
|
-
if (
|
|
1203
|
+
if (import_fs4.default.lstatSync(dirPath).isDirectory()) {
|
|
1207
1204
|
results.push(`${name}/${prefix}${dir}`);
|
|
1208
1205
|
if (maxDepth > 0)
|
|
1209
1206
|
await getDirs(dirPath, maxDepth - 1, results, `${prefix}${dir}/`);
|
|
@@ -1230,8 +1227,8 @@ var WorkspaceExecutor = class _WorkspaceExecutor extends Executor {
|
|
|
1230
1227
|
if (AVOID_DIRS.includes(dir))
|
|
1231
1228
|
return;
|
|
1232
1229
|
const dirPath = import_path3.default.join(dirname, dir);
|
|
1233
|
-
if (
|
|
1234
|
-
const hasTargetFile =
|
|
1230
|
+
if (import_fs4.default.lstatSync(dirPath).isDirectory()) {
|
|
1231
|
+
const hasTargetFile = import_fs4.default.existsSync(import_path3.default.join(dirPath, targetFilename));
|
|
1235
1232
|
if (hasTargetFile)
|
|
1236
1233
|
results.push(`${prefix}${dir}`);
|
|
1237
1234
|
if (maxDepth > 0)
|
|
@@ -1301,11 +1298,11 @@ var SysExecutor = class extends Executor {
|
|
|
1301
1298
|
const pathSplitLength = path7.split("/").length;
|
|
1302
1299
|
return tsconfig.compilerOptions.paths[path7][0].split("/").slice(1, 1 + pathSplitLength).join("/");
|
|
1303
1300
|
}).filter((libName) => libName !== this.name);
|
|
1304
|
-
if (!
|
|
1305
|
-
|
|
1301
|
+
if (!import_fs4.default.existsSync(`${this.cwdPath}/lib/__scalar`))
|
|
1302
|
+
import_fs4.default.mkdirSync(`${this.cwdPath}/lib/__scalar`, { recursive: true });
|
|
1306
1303
|
const files = getDefaultFileScan();
|
|
1307
1304
|
const dirnames = (await import_promises.default.readdir(`${this.cwdPath}/lib`)).filter(
|
|
1308
|
-
(name) =>
|
|
1305
|
+
(name) => import_fs4.default.lstatSync(`${this.cwdPath}/lib/${name}`).isDirectory()
|
|
1309
1306
|
);
|
|
1310
1307
|
const databaseDirs = dirnames.filter((name) => !name.startsWith("_"));
|
|
1311
1308
|
const serviceDirs = dirnames.filter((name) => name.startsWith("_") && !name.startsWith("__"));
|
|
@@ -1433,27 +1430,27 @@ var SysExecutor = class extends Executor {
|
|
|
1433
1430
|
return { filepath, content };
|
|
1434
1431
|
}
|
|
1435
1432
|
async getDatabaseModules() {
|
|
1436
|
-
const databaseModules = (await import_promises.default.readdir(`${this.cwdPath}/lib`)).filter((name) => !name.startsWith("_") && !name.startsWith("__") && !name.endsWith(".ts")).filter((name) =>
|
|
1433
|
+
const databaseModules = (await import_promises.default.readdir(`${this.cwdPath}/lib`)).filter((name) => !name.startsWith("_") && !name.startsWith("__") && !name.endsWith(".ts")).filter((name) => import_fs4.default.existsSync(`${this.cwdPath}/lib/${name}/${name}.constant.ts`));
|
|
1437
1434
|
return databaseModules;
|
|
1438
1435
|
}
|
|
1439
1436
|
async getServiceModules() {
|
|
1440
|
-
const serviceModules = (await import_promises.default.readdir(`${this.cwdPath}/lib`)).filter((name) => name.startsWith("_") && !name.startsWith("__")).filter((name) =>
|
|
1437
|
+
const serviceModules = (await import_promises.default.readdir(`${this.cwdPath}/lib`)).filter((name) => name.startsWith("_") && !name.startsWith("__")).filter((name) => import_fs4.default.existsSync(`${this.cwdPath}/lib/${name}/${name}.service.ts`));
|
|
1441
1438
|
return serviceModules;
|
|
1442
1439
|
}
|
|
1443
1440
|
async getScalarModules() {
|
|
1444
|
-
const scalarModules = (await import_promises.default.readdir(`${this.cwdPath}/lib/__scalar`)).filter((name) => !name.startsWith("_")).filter((name) =>
|
|
1441
|
+
const scalarModules = (await import_promises.default.readdir(`${this.cwdPath}/lib/__scalar`)).filter((name) => !name.startsWith("_")).filter((name) => import_fs4.default.existsSync(`${this.cwdPath}/lib/__scalar/${name}/${name}.constant.ts`));
|
|
1445
1442
|
return scalarModules;
|
|
1446
1443
|
}
|
|
1447
1444
|
async getViewComponents() {
|
|
1448
|
-
const viewComponents = (await import_promises.default.readdir(`${this.cwdPath}/lib`)).filter((name) => !name.startsWith("_") && !name.startsWith("__") && !name.endsWith(".ts")).filter((name) =>
|
|
1445
|
+
const viewComponents = (await import_promises.default.readdir(`${this.cwdPath}/lib`)).filter((name) => !name.startsWith("_") && !name.startsWith("__") && !name.endsWith(".ts")).filter((name) => import_fs4.default.existsSync(`${this.cwdPath}/lib/${name}/${name}.View.tsx`));
|
|
1449
1446
|
return viewComponents;
|
|
1450
1447
|
}
|
|
1451
1448
|
async getUnitComponents() {
|
|
1452
|
-
const unitComponents = (await import_promises.default.readdir(`${this.cwdPath}/lib`)).filter((name) => name.startsWith("_") && !name.startsWith("__")).filter((name) =>
|
|
1449
|
+
const unitComponents = (await import_promises.default.readdir(`${this.cwdPath}/lib`)).filter((name) => name.startsWith("_") && !name.startsWith("__")).filter((name) => import_fs4.default.existsSync(`${this.cwdPath}/lib/${name}/${name}.Unit.tsx`));
|
|
1453
1450
|
return unitComponents;
|
|
1454
1451
|
}
|
|
1455
1452
|
async getTemplateComponents() {
|
|
1456
|
-
const templateComponents = (await import_promises.default.readdir(`${this.cwdPath}/lib`)).filter((name) => name.startsWith("_") && !name.startsWith("__")).filter((name) =>
|
|
1453
|
+
const templateComponents = (await import_promises.default.readdir(`${this.cwdPath}/lib`)).filter((name) => name.startsWith("_") && !name.startsWith("__")).filter((name) => import_fs4.default.existsSync(`${this.cwdPath}/lib/${name}/${name}.Template.tsx`));
|
|
1457
1454
|
return templateComponents;
|
|
1458
1455
|
}
|
|
1459
1456
|
async getViewsSourceCode() {
|
|
@@ -1508,9 +1505,9 @@ var AppExecutor = class _AppExecutor extends SysExecutor {
|
|
|
1508
1505
|
}
|
|
1509
1506
|
async syncAssets(libDeps) {
|
|
1510
1507
|
const projectPublicLibPath = `${this.cwdPath}/public/libs`;
|
|
1511
|
-
if (
|
|
1508
|
+
if (import_fs4.default.existsSync(projectPublicLibPath))
|
|
1512
1509
|
await import_promises.default.rm(projectPublicLibPath, { recursive: true });
|
|
1513
|
-
const targetDeps = libDeps.filter((dep) =>
|
|
1510
|
+
const targetDeps = libDeps.filter((dep) => import_fs4.default.existsSync(`${this.workspace.workspaceRoot}/libs/${dep}/public`));
|
|
1514
1511
|
await Promise.all(targetDeps.map((dep) => import_promises.default.mkdir(`${projectPublicLibPath}/${dep}`, { recursive: true })));
|
|
1515
1512
|
await Promise.all(
|
|
1516
1513
|
targetDeps.map(
|
|
@@ -1593,14 +1590,14 @@ var defaultHostConfig = {};
|
|
|
1593
1590
|
var defaultAkanGlobalConfig = { cloudHost: {}, llm: null };
|
|
1594
1591
|
|
|
1595
1592
|
// pkgs/@akanjs/devkit/src/auth.ts
|
|
1596
|
-
var
|
|
1593
|
+
var import_fs5 = __toESM(require("fs"));
|
|
1597
1594
|
var getAkanGlobalConfig = () => {
|
|
1598
|
-
const akanConfig =
|
|
1595
|
+
const akanConfig = import_fs5.default.existsSync(configPath) ? JSON.parse(import_fs5.default.readFileSync(configPath, "utf8")) : defaultAkanGlobalConfig;
|
|
1599
1596
|
return akanConfig;
|
|
1600
1597
|
};
|
|
1601
1598
|
var setAkanGlobalConfig = (akanConfig) => {
|
|
1602
|
-
|
|
1603
|
-
|
|
1599
|
+
import_fs5.default.mkdirSync(basePath, { recursive: true });
|
|
1600
|
+
import_fs5.default.writeFileSync(configPath, JSON.stringify(akanConfig, null, 2));
|
|
1604
1601
|
};
|
|
1605
1602
|
var getHostConfig = (host = akanCloudHost) => {
|
|
1606
1603
|
const akanConfig = getAkanGlobalConfig();
|
|
@@ -1623,7 +1620,7 @@ var getSelf = async (token) => {
|
|
|
1623
1620
|
|
|
1624
1621
|
// pkgs/@akanjs/devkit/src/capacitorApp.ts
|
|
1625
1622
|
var import_project = require("@trapezedev/project");
|
|
1626
|
-
var
|
|
1623
|
+
var import_fs6 = __toESM(require("fs"));
|
|
1627
1624
|
var CapacitorApp = class {
|
|
1628
1625
|
constructor(app) {
|
|
1629
1626
|
this.app = app;
|
|
@@ -1649,7 +1646,7 @@ var CapacitorApp = class {
|
|
|
1649
1646
|
await this.project.commit();
|
|
1650
1647
|
}
|
|
1651
1648
|
async releaseIos() {
|
|
1652
|
-
const isAdded =
|
|
1649
|
+
const isAdded = import_fs6.default.existsSync(`${this.app.cwdPath}/ios/App/Podfile`);
|
|
1653
1650
|
if (!isAdded) {
|
|
1654
1651
|
await this.app.spawn("npx cap add ios");
|
|
1655
1652
|
await this.app.spawn("npx @capacitor/assets generate");
|
|
@@ -1658,7 +1655,7 @@ var CapacitorApp = class {
|
|
|
1658
1655
|
await this.app.spawn("cross-env", ["APP_OPERATION_MODE=release", "npx", "cap", "sync", "ios"]);
|
|
1659
1656
|
}
|
|
1660
1657
|
async releaseAndroid() {
|
|
1661
|
-
const isAdded =
|
|
1658
|
+
const isAdded = import_fs6.default.existsSync(`${this.app.cwdPath}/android/app/build.gradle`);
|
|
1662
1659
|
if (!isAdded) {
|
|
1663
1660
|
await this.app.spawn("npx cap add android");
|
|
1664
1661
|
await this.app.spawn("npx @capacitor/assets generate");
|
|
@@ -1799,7 +1796,7 @@ var extractDependencies = (filepaths, pacakgeJson, defaultDependencies = []) =>
|
|
|
1799
1796
|
...pacakgeJson.devDependencies ?? {}
|
|
1800
1797
|
};
|
|
1801
1798
|
const requireRegex = /require\s*\(\s*['"`]([^'"`]+)['"`]\s*\)/g;
|
|
1802
|
-
for (const { text } of filepaths) {
|
|
1799
|
+
for (const { text } of filepaths.filter(({ path: path7 }) => path7.endsWith(".js"))) {
|
|
1803
1800
|
let requireMatch;
|
|
1804
1801
|
while ((requireMatch = requireRegex.exec(text)) !== null) {
|
|
1805
1802
|
const moduleName = requireMatch[1];
|
|
@@ -1898,8 +1895,9 @@ var Target = {
|
|
|
1898
1895
|
|
|
1899
1896
|
// pkgs/@akanjs/devkit/src/commandDecorators/command.ts
|
|
1900
1897
|
var import_prompts3 = require("@inquirer/prompts");
|
|
1898
|
+
var import_chalk2 = __toESM(require("chalk"));
|
|
1901
1899
|
var import_commander = require("commander");
|
|
1902
|
-
var
|
|
1900
|
+
var import_fs7 = __toESM(require("fs"));
|
|
1903
1901
|
var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1904
1902
|
var handleOption = (programCommand, argMeta) => {
|
|
1905
1903
|
const {
|
|
@@ -1912,7 +1910,7 @@ var handleOption = (programCommand, argMeta) => {
|
|
|
1912
1910
|
} = argMeta.argsOption;
|
|
1913
1911
|
const kebabName = camelToKebabCase(argMeta.name);
|
|
1914
1912
|
programCommand.option(
|
|
1915
|
-
`-${flag}, --${kebabName} <${kebabName}
|
|
1913
|
+
`-${flag}, --${kebabName}${type === "boolean" ? " [boolean]" : ` <${kebabName}>`}`,
|
|
1916
1914
|
`${desc}${ask ? ` (${ask})` : ""}${example ? ` (example: ${example})` : ""}${choices ? ` (choices: ${choices.join(", ")})` : ""}`
|
|
1917
1915
|
);
|
|
1918
1916
|
return programCommand;
|
|
@@ -1923,7 +1921,7 @@ var convertOptionValue = (value, type) => {
|
|
|
1923
1921
|
else if (type === "number")
|
|
1924
1922
|
return Number(value);
|
|
1925
1923
|
else
|
|
1926
|
-
return value === "true";
|
|
1924
|
+
return value === true || value === "true";
|
|
1927
1925
|
};
|
|
1928
1926
|
var getOptionValue = async (argMeta, opt) => {
|
|
1929
1927
|
const {
|
|
@@ -1938,15 +1936,15 @@ var getOptionValue = async (argMeta, opt) => {
|
|
|
1938
1936
|
return null;
|
|
1939
1937
|
if (choices) {
|
|
1940
1938
|
const choice = await (0, import_prompts3.select)({
|
|
1941
|
-
message: ask ?? `Select the ${name} value`,
|
|
1939
|
+
message: ask ?? desc ?? `Select the ${name} value`,
|
|
1942
1940
|
choices: choices.map((choice2) => choice2.toString())
|
|
1943
1941
|
});
|
|
1944
1942
|
return choice;
|
|
1945
1943
|
} else if (type === "boolean") {
|
|
1946
|
-
const message = ask ?? `Do you want to set ${name}? ${desc ? ` (${desc})` : ""}: `;
|
|
1944
|
+
const message = ask ?? desc ?? `Do you want to set ${name}? ${desc ? ` (${desc})` : ""}: `;
|
|
1947
1945
|
return await (0, import_prompts3.confirm)({ message });
|
|
1948
1946
|
} else {
|
|
1949
|
-
const message = ask ? `${ask}: ` : `Enter the ${name} value${example ? ` (example: ${example})` : ""}: `;
|
|
1947
|
+
const message = ask ? `${ask}: ` : desc ? `${desc}: ` : `Enter the ${name} value${example ? ` (example: ${example})` : ""}: `;
|
|
1950
1948
|
if (argMeta.argsOption.nullable)
|
|
1951
1949
|
return await (0, import_prompts3.input)({ message });
|
|
1952
1950
|
else
|
|
@@ -1995,8 +1993,8 @@ var getArgumentValue = async (argMeta, value, workspace) => {
|
|
|
1995
1993
|
throw new Error(`Invalid system type: ${argMeta.type}`);
|
|
1996
1994
|
};
|
|
1997
1995
|
var runCommands = async (...commands) => {
|
|
1998
|
-
const hasPackageJson =
|
|
1999
|
-
const version = hasPackageJson ? JSON.parse(
|
|
1996
|
+
const hasPackageJson = import_fs7.default.existsSync(`${__dirname}/package.json`);
|
|
1997
|
+
const version = hasPackageJson ? JSON.parse(import_fs7.default.readFileSync(`${__dirname}/package.json`, "utf8")).version : "0.0.1";
|
|
2000
1998
|
import_commander.program.version(version).description("Akan CLI");
|
|
2001
1999
|
for (const command of commands) {
|
|
2002
2000
|
const targetMetas = getTargetMetas(command);
|
|
@@ -2034,7 +2032,12 @@ var runCommands = async (...commands) => {
|
|
|
2034
2032
|
commandArgs[argMeta.idx] = await getArgumentValue(argMeta, cmdArgs[argMeta.idx], workspace);
|
|
2035
2033
|
}
|
|
2036
2034
|
const cmd = new command();
|
|
2037
|
-
|
|
2035
|
+
try {
|
|
2036
|
+
await cmd[targetMeta.key](...commandArgs);
|
|
2037
|
+
} catch (e) {
|
|
2038
|
+
const errMsg = e instanceof Error ? e.message : typeof e === "string" ? e : JSON.stringify(e);
|
|
2039
|
+
Logger.error(`Command Error: ${import_chalk2.default.red(errMsg)}`);
|
|
2040
|
+
}
|
|
2038
2041
|
});
|
|
2039
2042
|
}
|
|
2040
2043
|
}
|
|
@@ -2046,7 +2049,7 @@ var runCommands = async (...commands) => {
|
|
|
2046
2049
|
var import_prompts4 = require("@inquirer/prompts");
|
|
2047
2050
|
var import_messages = require("@langchain/core/messages");
|
|
2048
2051
|
var import_openai2 = require("@langchain/openai");
|
|
2049
|
-
var
|
|
2052
|
+
var import_chalk3 = __toESM(require("chalk"));
|
|
2050
2053
|
var MAX_ASK_TRY = 300;
|
|
2051
2054
|
var supportedLlmModels = ["deepseek-chat", "deepseek-reasoner"];
|
|
2052
2055
|
var AiSession = class _AiSession {
|
|
@@ -2097,7 +2100,7 @@ var AiSession = class _AiSession {
|
|
|
2097
2100
|
return true;
|
|
2098
2101
|
} catch (error) {
|
|
2099
2102
|
Logger.rawLog(
|
|
2100
|
-
|
|
2103
|
+
import_chalk3.default.red(
|
|
2101
2104
|
`LLM API key is invalid. Please check your API key and try again. You can set it again by running "akan set-llm" or reset by running "akan reset-llm"`
|
|
2102
2105
|
)
|
|
2103
2106
|
);
|
|
@@ -2162,6 +2165,81 @@ var AiSession = class _AiSession {
|
|
|
2162
2165
|
}
|
|
2163
2166
|
};
|
|
2164
2167
|
|
|
2168
|
+
// pkgs/@akanjs/devkit/src/builder.ts
|
|
2169
|
+
var esbuild = __toESM(require("esbuild"));
|
|
2170
|
+
var import_esbuild_plugin_d = require("esbuild-plugin-d.ts");
|
|
2171
|
+
var import_fs8 = __toESM(require("fs"));
|
|
2172
|
+
var Builder = class {
|
|
2173
|
+
#executor;
|
|
2174
|
+
#distExecutor;
|
|
2175
|
+
#pkgJson;
|
|
2176
|
+
#rootPackageJson;
|
|
2177
|
+
constructor({ executor, distExecutor, pkgJson, rootPackageJson }) {
|
|
2178
|
+
this.#executor = executor;
|
|
2179
|
+
this.#distExecutor = distExecutor;
|
|
2180
|
+
this.#pkgJson = pkgJson;
|
|
2181
|
+
this.#rootPackageJson = rootPackageJson;
|
|
2182
|
+
}
|
|
2183
|
+
#getBuildOptions(format, { bundle = false, additionalEntryPoints = [] } = {}) {
|
|
2184
|
+
return {
|
|
2185
|
+
entryPoints: [
|
|
2186
|
+
...bundle ? [`${this.#executor.cwdPath}/index.ts`] : [`${this.#executor.cwdPath}/**/*.ts`, `${this.#executor.cwdPath}/**/*.tsx`],
|
|
2187
|
+
...additionalEntryPoints
|
|
2188
|
+
],
|
|
2189
|
+
bundle,
|
|
2190
|
+
packages: "external",
|
|
2191
|
+
splitting: false,
|
|
2192
|
+
platform: this.#pkgJson.esbuild?.platform,
|
|
2193
|
+
format,
|
|
2194
|
+
outdir: this.#distExecutor.cwdPath,
|
|
2195
|
+
outExtension: format === "cjs" ? { ".js": this.#pkgJson.type === "module" ? ".cjs" : ".js" } : { ".js": this.#pkgJson.type === "module" ? ".js" : ".mjs" },
|
|
2196
|
+
logLevel: "error"
|
|
2197
|
+
};
|
|
2198
|
+
}
|
|
2199
|
+
#getAssetBuildOptions() {
|
|
2200
|
+
return {
|
|
2201
|
+
write: true,
|
|
2202
|
+
bundle: false,
|
|
2203
|
+
entryPoints: [
|
|
2204
|
+
`${this.#executor.cwdPath}/**/*.css`,
|
|
2205
|
+
`${this.#executor.cwdPath}/**/*.md`,
|
|
2206
|
+
`${this.#executor.cwdPath}/**/*.template`,
|
|
2207
|
+
`${this.#executor.cwdPath}/**/*.js`
|
|
2208
|
+
],
|
|
2209
|
+
outdir: this.#distExecutor.cwdPath,
|
|
2210
|
+
logLevel: "error",
|
|
2211
|
+
loader: { ".css": "copy", ".md": "copy", ".template": "copy", ".js": "copy" }
|
|
2212
|
+
};
|
|
2213
|
+
}
|
|
2214
|
+
async build(options = {}) {
|
|
2215
|
+
if (import_fs8.default.existsSync(this.#distExecutor.cwdPath))
|
|
2216
|
+
await this.#distExecutor.exec(`rm -rf ${this.#distExecutor.cwdPath}`);
|
|
2217
|
+
const plugins = [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${this.#executor.cwdPath}/tsconfig.json` })];
|
|
2218
|
+
const [buildResult] = await Promise.all([
|
|
2219
|
+
esbuild.build({ ...this.#getBuildOptions("cjs", options), write: false, plugins }),
|
|
2220
|
+
esbuild.build({ write: true, ...this.#getBuildOptions("esm", options) }),
|
|
2221
|
+
esbuild.build({ ...this.#getAssetBuildOptions() })
|
|
2222
|
+
]);
|
|
2223
|
+
const existingDeps = Object.keys(this.#pkgJson.dependencies ?? {});
|
|
2224
|
+
const dependencies = extractDependencies(buildResult.outputFiles, this.#rootPackageJson, existingDeps);
|
|
2225
|
+
const pkgPackageJson = {
|
|
2226
|
+
...this.#pkgJson,
|
|
2227
|
+
main: "./index.js",
|
|
2228
|
+
engines: { node: ">=22" },
|
|
2229
|
+
dependencies,
|
|
2230
|
+
exports: {
|
|
2231
|
+
".": {
|
|
2232
|
+
require: this.#pkgJson.type === "module" ? "./index.cjs" : "./index.js",
|
|
2233
|
+
import: this.#pkgJson.type === "module" ? "./index.js" : "./index.mjs"
|
|
2234
|
+
},
|
|
2235
|
+
...this.#pkgJson.exports ?? {}
|
|
2236
|
+
}
|
|
2237
|
+
};
|
|
2238
|
+
buildResult.outputFiles.map((file) => this.#distExecutor.writeFile(file.path, file.text));
|
|
2239
|
+
this.#distExecutor.writeJson("package.json", pkgPackageJson);
|
|
2240
|
+
}
|
|
2241
|
+
};
|
|
2242
|
+
|
|
2165
2243
|
// pkgs/@akanjs/cli/src/library/library.runner.ts
|
|
2166
2244
|
var import_compare_versions = require("compare-versions");
|
|
2167
2245
|
var import_dotenv2 = __toESM(require("dotenv"));
|
|
@@ -2297,8 +2375,8 @@ var import_runnables2 = require("@langchain/core/runnables");
|
|
|
2297
2375
|
var import_openai3 = require("@langchain/openai");
|
|
2298
2376
|
var import_plugin_react = __toESM(require("@vitejs/plugin-react"));
|
|
2299
2377
|
var import_dotenv3 = __toESM(require("dotenv"));
|
|
2300
|
-
var
|
|
2301
|
-
var
|
|
2378
|
+
var esbuild2 = __toESM(require("esbuild"));
|
|
2379
|
+
var import_fs9 = __toESM(require("fs"));
|
|
2302
2380
|
var import_promises2 = __toESM(require("fs/promises"));
|
|
2303
2381
|
var import_js_yaml2 = __toESM(require("js-yaml"));
|
|
2304
2382
|
var import_open = __toESM(require("open"));
|
|
@@ -3843,7 +3921,7 @@ var ApplicationRunner = class {
|
|
|
3843
3921
|
AppName: capitalize(appName),
|
|
3844
3922
|
companyName: workspace.repoName,
|
|
3845
3923
|
CompanyName: capitalize(workspace.repoName),
|
|
3846
|
-
|
|
3924
|
+
startDomain: "localhost"
|
|
3847
3925
|
}
|
|
3848
3926
|
});
|
|
3849
3927
|
workspace.setTsPaths("app", appName);
|
|
@@ -3858,7 +3936,7 @@ var ApplicationRunner = class {
|
|
|
3858
3936
|
...app.workspace.getBaseDevEnv(),
|
|
3859
3937
|
type: "app",
|
|
3860
3938
|
name: app.name,
|
|
3861
|
-
command: "
|
|
3939
|
+
command: "start"
|
|
3862
3940
|
});
|
|
3863
3941
|
const scanResult = await app.scan({ akanConfig });
|
|
3864
3942
|
await app.syncAssets(scanResult.akanConfig.libs);
|
|
@@ -3883,9 +3961,9 @@ var ApplicationRunner = class {
|
|
|
3883
3961
|
return { env: this.#getEnv(app, { AKAN_COMMAND_TYPE: type }) };
|
|
3884
3962
|
}
|
|
3885
3963
|
async buildBackend(app) {
|
|
3886
|
-
await this.#prepareCommand(app, "
|
|
3964
|
+
await this.#prepareCommand(app, "start", "backend");
|
|
3887
3965
|
const akanConfig = await app.getConfig("build");
|
|
3888
|
-
const buildResult = await
|
|
3966
|
+
const buildResult = await esbuild2.build({
|
|
3889
3967
|
write: false,
|
|
3890
3968
|
entryPoints: [`${app.cwdPath}/main.ts`],
|
|
3891
3969
|
bundle: true,
|
|
@@ -3908,9 +3986,9 @@ var ApplicationRunner = class {
|
|
|
3908
3986
|
app.dist.writeJson("backend/package.json", appPackageJson);
|
|
3909
3987
|
app.dist.writeFile(import_path4.default.join(app.dist.cwdPath, "backend", "Dockerfile"), akanConfig.backend.dockerfile);
|
|
3910
3988
|
}
|
|
3911
|
-
async
|
|
3912
|
-
const { env } = await this.#prepareCommand(app, "
|
|
3913
|
-
const ctx = await
|
|
3989
|
+
async startBackend(app, { open: open2 = false } = {}) {
|
|
3990
|
+
const { env } = await this.#prepareCommand(app, "start", "backend");
|
|
3991
|
+
const ctx = await esbuild2.context({
|
|
3914
3992
|
write: true,
|
|
3915
3993
|
entryPoints: [`${app.cwdPath}/main.ts`],
|
|
3916
3994
|
bundle: true,
|
|
@@ -3929,7 +4007,7 @@ var ApplicationRunner = class {
|
|
|
3929
4007
|
const { env } = await this.#prepareCommand(app, "build", "frontend");
|
|
3930
4008
|
const akanConfig = await app.getConfig("build");
|
|
3931
4009
|
await app.spawn("npx", ["next", "build", "--no-lint"], { env });
|
|
3932
|
-
const buildResult = await
|
|
4010
|
+
const buildResult = await esbuild2.build({
|
|
3933
4011
|
entryPoints: [`${app.cwdPath}/next.config.ts`],
|
|
3934
4012
|
outdir: `${app.dist.cwdPath}/frontend`,
|
|
3935
4013
|
bundle: true,
|
|
@@ -3960,8 +4038,8 @@ var ApplicationRunner = class {
|
|
|
3960
4038
|
]);
|
|
3961
4039
|
app.dist.writeFile("frontend/Dockerfile", akanConfig.frontend.dockerfile);
|
|
3962
4040
|
}
|
|
3963
|
-
async
|
|
3964
|
-
const { env } = await this.#prepareCommand(app, "
|
|
4041
|
+
async startFrontend(app, { open: open2 = false, turbo = true } = {}) {
|
|
4042
|
+
const { env } = await this.#prepareCommand(app, "start", "frontend");
|
|
3965
4043
|
if (open2)
|
|
3966
4044
|
setTimeout(() => (0, import_open.default)("http://localhost:4200"), 3e3);
|
|
3967
4045
|
await app.spawn("npx", ["next", "dev", "-p", "4200", ...turbo ? ["--turbo"] : []], { env });
|
|
@@ -4012,9 +4090,9 @@ var ApplicationRunner = class {
|
|
|
4012
4090
|
define: {
|
|
4013
4091
|
"process.env": {
|
|
4014
4092
|
// ...env,
|
|
4015
|
-
AKAN_COMMAND_TYPE: "
|
|
4093
|
+
AKAN_COMMAND_TYPE: "start",
|
|
4016
4094
|
NEXT_PUBLIC_REPO_NAME: app.workspace.repoName,
|
|
4017
|
-
|
|
4095
|
+
NEXT_PUBLIC_START_DOMAIN: processEnv.NEXT_PUBLIC_START_DOMAIN ?? "localhost",
|
|
4018
4096
|
NEXT_PUBLIC_ENV: processEnv.NEXT_PUBLIC_ENV ?? "debug",
|
|
4019
4097
|
NEXT_PUBLIC_OPERATION_MODE: processEnv.NEXT_PUBLIC_OPERATION_MODE ?? "local",
|
|
4020
4098
|
NEXT_PUBLIC_LOG_LEVEL: processEnv.NEXT_PUBLIC_LOG_LEVEL ?? "log",
|
|
@@ -4036,7 +4114,7 @@ var ApplicationRunner = class {
|
|
|
4036
4114
|
const config = await this.#getViteConfig(app);
|
|
4037
4115
|
await vite.build(config);
|
|
4038
4116
|
}
|
|
4039
|
-
async
|
|
4117
|
+
async startCsr(app, { open: open2 = false } = {}) {
|
|
4040
4118
|
const config = await this.#getViteConfig(app);
|
|
4041
4119
|
const server = await vite.createServer(config);
|
|
4042
4120
|
await server.listen(4201);
|
|
@@ -4045,7 +4123,7 @@ var ApplicationRunner = class {
|
|
|
4045
4123
|
setTimeout(() => (0, import_open.default)("http://localhost:4201"), 3e3);
|
|
4046
4124
|
}
|
|
4047
4125
|
async #prepareIos(app) {
|
|
4048
|
-
const isAdded =
|
|
4126
|
+
const isAdded = import_fs9.default.existsSync(`${app.cwdPath}/ios/App/Podfile`);
|
|
4049
4127
|
if (!isAdded) {
|
|
4050
4128
|
await app.spawn("npx", ["cap", "add", "ios"]);
|
|
4051
4129
|
await app.spawn("npx", ["@capacitor/assets", "generate"]);
|
|
@@ -4057,7 +4135,7 @@ var ApplicationRunner = class {
|
|
|
4057
4135
|
await this.#prepareIos(app);
|
|
4058
4136
|
await app.spawn("npx", ["cap", "run", "ios"]);
|
|
4059
4137
|
}
|
|
4060
|
-
async
|
|
4138
|
+
async startIos(app, { open: open2 = false, operation = "local" } = {}) {
|
|
4061
4139
|
await this.#prepareIos(app);
|
|
4062
4140
|
if (open2)
|
|
4063
4141
|
await app.spawn("npx", ["cap", "open", "ios"]);
|
|
@@ -4080,7 +4158,7 @@ var ApplicationRunner = class {
|
|
|
4080
4158
|
await capacitorApp.releaseIos();
|
|
4081
4159
|
}
|
|
4082
4160
|
async #prepareAndroid(app) {
|
|
4083
|
-
const isAdded =
|
|
4161
|
+
const isAdded = import_fs9.default.existsSync(`${app.cwdPath}/android/app/build.gradle`);
|
|
4084
4162
|
if (!isAdded) {
|
|
4085
4163
|
await app.spawn("npx", ["cap", "add", "android"]);
|
|
4086
4164
|
await app.spawn("npx", ["@capacitor/assets", "generate"]);
|
|
@@ -4092,7 +4170,7 @@ var ApplicationRunner = class {
|
|
|
4092
4170
|
await this.#prepareAndroid(app);
|
|
4093
4171
|
await app.spawn("npx", ["cap", "build", "android"]);
|
|
4094
4172
|
}
|
|
4095
|
-
async
|
|
4173
|
+
async startAndroid(app, { open: open2 = false, operation = "local" } = {}) {
|
|
4096
4174
|
await this.#prepareAndroid(app);
|
|
4097
4175
|
if (open2)
|
|
4098
4176
|
await app.spawn("npx", ["cap", "open", "android"]);
|
|
@@ -4141,7 +4219,12 @@ var ApplicationRunner = class {
|
|
|
4141
4219
|
]);
|
|
4142
4220
|
}
|
|
4143
4221
|
async dbup(workspace) {
|
|
4144
|
-
await workspace.applyTemplate({
|
|
4222
|
+
await workspace.applyTemplate({
|
|
4223
|
+
basePath: "local",
|
|
4224
|
+
template: "localDev",
|
|
4225
|
+
dict: { repoName: workspace.repoName },
|
|
4226
|
+
overwrite: false
|
|
4227
|
+
});
|
|
4145
4228
|
await workspace.spawn(`docker`, ["compose", "up", "-d"], { cwd: `${workspace.workspaceRoot}/local` });
|
|
4146
4229
|
}
|
|
4147
4230
|
async dbdown(workspace) {
|
|
@@ -4162,14 +4245,14 @@ var ApplicationRunner = class {
|
|
|
4162
4245
|
const buildRoot = `${app.workspace.workspaceRoot}/releases/builds/${app.name}`;
|
|
4163
4246
|
const appVersionInfo = import_js_yaml2.default.load(app.readFile("config.yaml"));
|
|
4164
4247
|
const platformVersion = appVersionInfo.platforms.android.versionName;
|
|
4165
|
-
if (
|
|
4248
|
+
if (import_fs9.default.existsSync(buildRoot))
|
|
4166
4249
|
await import_promises2.default.rm(buildRoot, { recursive: true, force: true });
|
|
4167
4250
|
await import_promises2.default.mkdir(buildRoot, { recursive: true });
|
|
4168
|
-
if (rebuild || !
|
|
4251
|
+
if (rebuild || !import_fs9.default.existsSync(`${app.dist.cwdPath}/backend`))
|
|
4169
4252
|
await this.buildBackend(app);
|
|
4170
|
-
if (rebuild || !
|
|
4253
|
+
if (rebuild || !import_fs9.default.existsSync(`${app.dist.cwdPath}/frontend`))
|
|
4171
4254
|
await this.buildFrontend(app);
|
|
4172
|
-
if (rebuild || !
|
|
4255
|
+
if (rebuild || !import_fs9.default.existsSync(`${app.dist.cwdPath}/csr`))
|
|
4173
4256
|
await this.buildCsr(app);
|
|
4174
4257
|
const buildVersion = `${platformVersion}-${buildNum}`;
|
|
4175
4258
|
const buildPath = `${buildRoot}/${buildVersion}`;
|
|
@@ -4184,7 +4267,7 @@ var ApplicationRunner = class {
|
|
|
4184
4267
|
buildRoot,
|
|
4185
4268
|
"./"
|
|
4186
4269
|
]);
|
|
4187
|
-
if (
|
|
4270
|
+
if (import_fs9.default.existsSync(`${app.dist.cwdPath}/csr`)) {
|
|
4188
4271
|
await import_promises2.default.cp(`${app.dist.cwdPath}/csr`, "./csr", { recursive: true });
|
|
4189
4272
|
await app.workspace.spawn("zip", [
|
|
4190
4273
|
"-r",
|
|
@@ -4194,7 +4277,7 @@ var ApplicationRunner = class {
|
|
|
4194
4277
|
await import_promises2.default.rm("./csr", { recursive: true, force: true });
|
|
4195
4278
|
}
|
|
4196
4279
|
const sourceRoot = `${app.workspace.workspaceRoot}/releases/sources/${app.name}`;
|
|
4197
|
-
if (
|
|
4280
|
+
if (import_fs9.default.existsSync(sourceRoot)) {
|
|
4198
4281
|
const MAX_RETRY = 3;
|
|
4199
4282
|
for (let i = 0; i < MAX_RETRY; i++) {
|
|
4200
4283
|
try {
|
|
@@ -4214,7 +4297,7 @@ var ApplicationRunner = class {
|
|
|
4214
4297
|
await Promise.all(
|
|
4215
4298
|
[".next", "ios", "android", "public/libs"].map(async (path7) => {
|
|
4216
4299
|
const targetPath = `${sourceRoot}/apps/${app.name}/${path7}`;
|
|
4217
|
-
if (
|
|
4300
|
+
if (import_fs9.default.existsSync(targetPath))
|
|
4218
4301
|
await import_promises2.default.rm(targetPath, { recursive: true, force: true });
|
|
4219
4302
|
})
|
|
4220
4303
|
);
|
|
@@ -4242,8 +4325,8 @@ var ApplicationRunner = class {
|
|
|
4242
4325
|
[]
|
|
4243
4326
|
)
|
|
4244
4327
|
]);
|
|
4245
|
-
|
|
4246
|
-
|
|
4328
|
+
import_fs9.default.writeFileSync(`${sourceRoot}/tsconfig.json`, JSON.stringify(tsconfig, null, 2));
|
|
4329
|
+
import_fs9.default.writeFileSync(
|
|
4247
4330
|
`${sourceRoot}/README.md`,
|
|
4248
4331
|
`# ${app.name}
|
|
4249
4332
|
\uBCF8 \uD504\uB85C\uC81D\uD2B8\uC758 \uC18C\uC2A4\uCF54\uB4DC \uBC0F \uAD00\uB828\uC790\uB8CC\uB294 \uBAA8\uB450 \uBE44\uBC00\uC815\uBCF4\uB85C \uAD00\uB9AC\uB429\uB2C8\uB2E4.
|
|
@@ -4264,8 +4347,8 @@ var ApplicationRunner = class {
|
|
|
4264
4347
|
ANALYZE=false
|
|
4265
4348
|
EOF
|
|
4266
4349
|
|
|
4267
|
-
nx
|
|
4268
|
-
# or nx
|
|
4350
|
+
nx start-backend ${app.name}
|
|
4351
|
+
# or nx start-frontend ${app.name}, etc
|
|
4269
4352
|
\`\`\`
|
|
4270
4353
|
|
|
4271
4354
|
## Build
|
|
@@ -4343,11 +4426,11 @@ var ApplicationRunner = class {
|
|
|
4343
4426
|
var ApplicationScript = class {
|
|
4344
4427
|
#runner = new ApplicationRunner();
|
|
4345
4428
|
libraryScript = new LibraryScript();
|
|
4346
|
-
async createApplication(appName, workspace, {
|
|
4429
|
+
async createApplication(appName, workspace, { start = false } = {}) {
|
|
4347
4430
|
const app = await this.#runner.createApplication(appName, workspace);
|
|
4348
4431
|
await this.syncApplication(app);
|
|
4349
|
-
if (
|
|
4350
|
-
await this.
|
|
4432
|
+
if (start)
|
|
4433
|
+
await this.start(app, { open: true });
|
|
4351
4434
|
}
|
|
4352
4435
|
async removeApplication(app) {
|
|
4353
4436
|
await this.#runner.removeApplication(app);
|
|
@@ -4369,53 +4452,55 @@ var ApplicationScript = class {
|
|
|
4369
4452
|
await this.syncApplication(app);
|
|
4370
4453
|
await Promise.all([this.buildBackend(app, { sync: false }), this.buildFrontend(app, { sync: false })]);
|
|
4371
4454
|
}
|
|
4372
|
-
async
|
|
4455
|
+
async start(app, { open: open2 = false } = {}) {
|
|
4373
4456
|
await this.syncApplication(app);
|
|
4374
|
-
|
|
4457
|
+
if (app.workspace.getBaseDevEnv().env === "local")
|
|
4458
|
+
await this.dbup(app.workspace);
|
|
4459
|
+
await Promise.all([this.startBackend(app, { open: open2, sync: false }), this.startFrontend(app, { open: open2, sync: false })]);
|
|
4375
4460
|
}
|
|
4376
4461
|
async buildBackend(app, { sync = true } = {}) {
|
|
4377
4462
|
if (sync)
|
|
4378
4463
|
await this.syncApplication(app);
|
|
4379
4464
|
await this.#runner.buildBackend(app);
|
|
4380
4465
|
}
|
|
4381
|
-
async
|
|
4466
|
+
async startBackend(app, { open: open2 = false, sync = true } = {}) {
|
|
4382
4467
|
if (sync)
|
|
4383
4468
|
await this.syncApplication(app);
|
|
4384
|
-
await this.#runner.
|
|
4469
|
+
await this.#runner.startBackend(app, { open: open2 });
|
|
4385
4470
|
}
|
|
4386
4471
|
async buildFrontend(app, { sync = true } = {}) {
|
|
4387
4472
|
if (sync)
|
|
4388
4473
|
await this.syncApplication(app);
|
|
4389
4474
|
await this.#runner.buildFrontend(app);
|
|
4390
4475
|
}
|
|
4391
|
-
async
|
|
4476
|
+
async startFrontend(app, { open: open2 = false, turbo = false, sync = true } = {}) {
|
|
4392
4477
|
if (sync)
|
|
4393
4478
|
await this.syncApplication(app);
|
|
4394
|
-
await this.#runner.
|
|
4479
|
+
await this.#runner.startFrontend(app, { open: open2, turbo });
|
|
4395
4480
|
}
|
|
4396
4481
|
async buildCsr(app, { sync = true } = {}) {
|
|
4397
4482
|
if (sync)
|
|
4398
4483
|
await this.syncApplication(app);
|
|
4399
4484
|
await this.#runner.buildCsr(app);
|
|
4400
4485
|
}
|
|
4401
|
-
async
|
|
4486
|
+
async startCsr(app, { open: open2 = false, sync = true } = {}) {
|
|
4402
4487
|
if (sync)
|
|
4403
4488
|
await this.syncApplication(app);
|
|
4404
|
-
await this.#runner.
|
|
4489
|
+
await this.#runner.startCsr(app, { open: open2 });
|
|
4405
4490
|
}
|
|
4406
4491
|
async buildIos(app, { sync = true } = {}) {
|
|
4407
4492
|
if (sync)
|
|
4408
4493
|
await this.syncApplication(app);
|
|
4409
4494
|
await this.#runner.buildIos(app);
|
|
4410
4495
|
}
|
|
4411
|
-
async
|
|
4496
|
+
async startIos(app, {
|
|
4412
4497
|
open: open2 = false,
|
|
4413
4498
|
operation = "local",
|
|
4414
4499
|
sync = true
|
|
4415
4500
|
} = {}) {
|
|
4416
4501
|
if (sync)
|
|
4417
4502
|
await this.syncApplication(app);
|
|
4418
|
-
await this.#runner.
|
|
4503
|
+
await this.#runner.startIos(app, { open: open2, operation });
|
|
4419
4504
|
}
|
|
4420
4505
|
async releaseIos(app, { sync = true } = {}) {
|
|
4421
4506
|
await this.buildCsr(app, { sync });
|
|
@@ -4426,14 +4511,14 @@ var ApplicationScript = class {
|
|
|
4426
4511
|
await this.syncApplication(app);
|
|
4427
4512
|
await this.#runner.buildAndroid(app);
|
|
4428
4513
|
}
|
|
4429
|
-
async
|
|
4514
|
+
async startAndroid(app, {
|
|
4430
4515
|
open: open2 = false,
|
|
4431
4516
|
operation = "local",
|
|
4432
4517
|
sync = true
|
|
4433
4518
|
} = {}) {
|
|
4434
4519
|
if (sync)
|
|
4435
4520
|
await this.syncApplication(app);
|
|
4436
|
-
await this.#runner.
|
|
4521
|
+
await this.#runner.startAndroid(app, { open: open2, operation });
|
|
4437
4522
|
}
|
|
4438
4523
|
async releaseAndroid(app, { sync = true } = {}) {
|
|
4439
4524
|
await this.buildCsr(app, { sync });
|
|
@@ -4479,8 +4564,8 @@ var ApplicationScript = class {
|
|
|
4479
4564
|
// pkgs/@akanjs/cli/src/application/application.command.ts
|
|
4480
4565
|
var ApplicationCommand = class {
|
|
4481
4566
|
applicationScript = new ApplicationScript();
|
|
4482
|
-
async createApplication(name,
|
|
4483
|
-
await this.applicationScript.createApplication(name, workspace, {
|
|
4567
|
+
async createApplication(name, start, workspace) {
|
|
4568
|
+
await this.applicationScript.createApplication(name, workspace, { start });
|
|
4484
4569
|
}
|
|
4485
4570
|
async removeApplication(app) {
|
|
4486
4571
|
await this.applicationScript.removeApplication(app);
|
|
@@ -4506,23 +4591,23 @@ var ApplicationCommand = class {
|
|
|
4506
4591
|
async buildAndroid(app) {
|
|
4507
4592
|
await this.applicationScript.buildAndroid(app);
|
|
4508
4593
|
}
|
|
4509
|
-
async
|
|
4510
|
-
await this.applicationScript.
|
|
4594
|
+
async start(app, open2) {
|
|
4595
|
+
await this.applicationScript.start(app, { open: open2 });
|
|
4511
4596
|
}
|
|
4512
|
-
async
|
|
4513
|
-
await this.applicationScript.
|
|
4597
|
+
async startBackend(app, open2) {
|
|
4598
|
+
await this.applicationScript.startBackend(app, { open: open2 });
|
|
4514
4599
|
}
|
|
4515
|
-
async
|
|
4516
|
-
await this.applicationScript.
|
|
4600
|
+
async startFrontend(app, open2, turbo) {
|
|
4601
|
+
await this.applicationScript.startFrontend(app, { open: open2, turbo });
|
|
4517
4602
|
}
|
|
4518
|
-
async
|
|
4519
|
-
await this.applicationScript.
|
|
4603
|
+
async startCsr(app, open2) {
|
|
4604
|
+
await this.applicationScript.startCsr(app, { open: open2 });
|
|
4520
4605
|
}
|
|
4521
|
-
async
|
|
4522
|
-
await this.applicationScript.
|
|
4606
|
+
async startIos(app, open2, release) {
|
|
4607
|
+
await this.applicationScript.startIos(app, { open: open2, operation: release ? "release" : "local" });
|
|
4523
4608
|
}
|
|
4524
|
-
async
|
|
4525
|
-
await this.applicationScript.
|
|
4609
|
+
async startAndroid(app, open2, release) {
|
|
4610
|
+
await this.applicationScript.startAndroid(app, { open: open2, operation: release ? "release" : "local" });
|
|
4526
4611
|
}
|
|
4527
4612
|
async releaseIos(app) {
|
|
4528
4613
|
await this.applicationScript.releaseIos(app);
|
|
@@ -4558,7 +4643,7 @@ var ApplicationCommand = class {
|
|
|
4558
4643
|
__decorateClass([
|
|
4559
4644
|
Target.Public(),
|
|
4560
4645
|
__decorateParam(0, Option("name", { desc: "name of application" })),
|
|
4561
|
-
__decorateParam(1, Option("
|
|
4646
|
+
__decorateParam(1, Option("start", { type: "boolean", desc: "start application", default: false })),
|
|
4562
4647
|
__decorateParam(2, Workspace())
|
|
4563
4648
|
], ApplicationCommand.prototype, "createApplication", 1);
|
|
4564
4649
|
__decorateClass([
|
|
@@ -4596,36 +4681,36 @@ __decorateClass([
|
|
|
4596
4681
|
__decorateClass([
|
|
4597
4682
|
Target.Public({ short: true }),
|
|
4598
4683
|
__decorateParam(0, App()),
|
|
4599
|
-
__decorateParam(1, Option("open", { type: "boolean", desc: "open web browser", default: false }))
|
|
4600
|
-
], ApplicationCommand.prototype, "
|
|
4684
|
+
__decorateParam(1, Option("open", { type: "boolean", desc: "open web browser?", default: false }))
|
|
4685
|
+
], ApplicationCommand.prototype, "start", 1);
|
|
4601
4686
|
__decorateClass([
|
|
4602
4687
|
Target.Public({ short: true }),
|
|
4603
4688
|
__decorateParam(0, App()),
|
|
4604
4689
|
__decorateParam(1, Option("open", { type: "boolean", desc: "open graphql playground", default: false }))
|
|
4605
|
-
], ApplicationCommand.prototype, "
|
|
4690
|
+
], ApplicationCommand.prototype, "startBackend", 1);
|
|
4606
4691
|
__decorateClass([
|
|
4607
4692
|
Target.Public({ short: true }),
|
|
4608
4693
|
__decorateParam(0, App()),
|
|
4609
4694
|
__decorateParam(1, Option("open", { type: "boolean", desc: "open web browser", default: false })),
|
|
4610
4695
|
__decorateParam(2, Option("turbo", { type: "boolean", desc: "turbo", default: false }))
|
|
4611
|
-
], ApplicationCommand.prototype, "
|
|
4696
|
+
], ApplicationCommand.prototype, "startFrontend", 1);
|
|
4612
4697
|
__decorateClass([
|
|
4613
4698
|
Target.Public({ short: true }),
|
|
4614
4699
|
__decorateParam(0, App()),
|
|
4615
4700
|
__decorateParam(1, Option("open", { type: "boolean", desc: "open web browser", default: false }))
|
|
4616
|
-
], ApplicationCommand.prototype, "
|
|
4701
|
+
], ApplicationCommand.prototype, "startCsr", 1);
|
|
4617
4702
|
__decorateClass([
|
|
4618
4703
|
Target.Public({ short: true }),
|
|
4619
4704
|
__decorateParam(0, App()),
|
|
4620
4705
|
__decorateParam(1, Option("open", { type: "boolean", desc: "open ios simulator", default: false })),
|
|
4621
4706
|
__decorateParam(2, Option("release", { type: "boolean", desc: "release mode", default: false }))
|
|
4622
|
-
], ApplicationCommand.prototype, "
|
|
4707
|
+
], ApplicationCommand.prototype, "startIos", 1);
|
|
4623
4708
|
__decorateClass([
|
|
4624
4709
|
Target.Public({ short: true }),
|
|
4625
4710
|
__decorateParam(0, App()),
|
|
4626
4711
|
__decorateParam(1, Option("open", { type: "boolean", desc: "open android simulator", default: false })),
|
|
4627
4712
|
__decorateParam(2, Option("release", { type: "boolean", desc: "release mode", default: false }))
|
|
4628
|
-
], ApplicationCommand.prototype, "
|
|
4713
|
+
], ApplicationCommand.prototype, "startAndroid", 1);
|
|
4629
4714
|
__decorateClass([
|
|
4630
4715
|
Target.Public(),
|
|
4631
4716
|
__decorateParam(0, App())
|
|
@@ -4693,9 +4778,6 @@ ApplicationCommand = __decorateClass([
|
|
|
4693
4778
|
], ApplicationCommand);
|
|
4694
4779
|
|
|
4695
4780
|
// pkgs/@akanjs/cli/src/package/package.runner.ts
|
|
4696
|
-
var esbuild2 = __toESM(require("esbuild"));
|
|
4697
|
-
var import_esbuild_plugin_d = require("esbuild-plugin-d.ts");
|
|
4698
|
-
var import_fs11 = __toESM(require("fs"));
|
|
4699
4781
|
var import_promises3 = __toESM(require("fs/promises"));
|
|
4700
4782
|
var PackageRunner = class {
|
|
4701
4783
|
async version(workspace) {
|
|
@@ -4721,113 +4803,137 @@ var PackageRunner = class {
|
|
|
4721
4803
|
async buildPackage(pkg) {
|
|
4722
4804
|
const rootPackageJson = pkg.workspace.readJson("package.json");
|
|
4723
4805
|
const pkgJson = pkg.readJson("package.json");
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
|
|
4727
|
-
if (pkg.name === "@akanjs/config") {
|
|
4728
|
-
buildResult = await esbuild2.build({
|
|
4729
|
-
write: false,
|
|
4730
|
-
entryPoints: [`${pkg.cwdPath}/**/*.ts`],
|
|
4731
|
-
bundle: false,
|
|
4732
|
-
packages: "external",
|
|
4733
|
-
format: "cjs",
|
|
4734
|
-
outdir: pkg.dist.cwdPath,
|
|
4735
|
-
logLevel: "error",
|
|
4736
|
-
outExtension: { ".js": pkgJson.type === "module" ? ".cjs" : ".js" },
|
|
4737
|
-
plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
|
|
4738
|
-
});
|
|
4739
|
-
await esbuild2.build({
|
|
4740
|
-
write: true,
|
|
4741
|
-
entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.css`, `${pkg.cwdPath}/**/*.js`],
|
|
4742
|
-
bundle: false,
|
|
4743
|
-
packages: "external",
|
|
4744
|
-
format: "esm",
|
|
4745
|
-
outdir: pkg.dist.cwdPath,
|
|
4746
|
-
logLevel: "error",
|
|
4747
|
-
outExtension: { ".js": pkgJson.type === "module" ? ".js" : ".mjs" },
|
|
4748
|
-
loader: { ".css": "copy", ".js": "copy" }
|
|
4749
|
-
});
|
|
4750
|
-
} else if (pkg.name === "@akanjs/cli") {
|
|
4751
|
-
buildResult = await esbuild2.build({
|
|
4752
|
-
write: false,
|
|
4753
|
-
entryPoints: [`${pkg.cwdPath}/index.ts`],
|
|
4806
|
+
const builder = new Builder({ executor: pkg, distExecutor: pkg.dist, pkgJson, rootPackageJson });
|
|
4807
|
+
if (pkg.name === "@akanjs/cli") {
|
|
4808
|
+
await builder.build({
|
|
4754
4809
|
bundle: true,
|
|
4755
|
-
|
|
4756
|
-
packages: "external",
|
|
4757
|
-
outdir: pkg.dist.cwdPath,
|
|
4758
|
-
logLevel: "error",
|
|
4759
|
-
plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
|
|
4760
|
-
});
|
|
4761
|
-
await esbuild2.build({
|
|
4762
|
-
write: true,
|
|
4763
|
-
entryPoints: [`${pkg.cwdPath}/src/templates/**/*.ts`, `${pkg.cwdPath}/src/templates/**/*.tsx`],
|
|
4764
|
-
packages: "external",
|
|
4765
|
-
outdir: `${pkg.dist.cwdPath}/src/templates`,
|
|
4766
|
-
outbase: `${pkg.cwdPath}/src/templates`,
|
|
4767
|
-
format: "cjs",
|
|
4768
|
-
platform: "node",
|
|
4769
|
-
footer: { js: "module.exports = module.exports.default;" }
|
|
4810
|
+
additionalEntryPoints: [`${pkg.cwdPath}/src/templates/**/*.ts`, `${pkg.cwdPath}/src/templates/**/*.tsx`]
|
|
4770
4811
|
});
|
|
4771
|
-
await pkg.workspace.exec(
|
|
4772
|
-
`rsync -aq --exclude="*.ts" --exclude="*.tsx" ${pkg.cwdPath}/src/templates/ ${pkg.dist.cwdPath}/src/templates/`
|
|
4773
|
-
);
|
|
4774
4812
|
} else {
|
|
4775
|
-
|
|
4776
|
-
"@akanjs/devkit",
|
|
4777
|
-
"@akanjs/document",
|
|
4778
|
-
"@akanjs/lint",
|
|
4779
|
-
"@akanjs/nest",
|
|
4780
|
-
"@akanjs/server",
|
|
4781
|
-
"@akanjs/service"
|
|
4782
|
-
].includes(pkg.name) ? "node" : ["@akanjs/client", "@akanjs/next", "@akanjs/store", "@akanjs/ui"].includes(pkg.name) ? "browser" : "neutral";
|
|
4783
|
-
buildResult = await esbuild2.build({
|
|
4784
|
-
write: false,
|
|
4785
|
-
entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.tsx`],
|
|
4786
|
-
bundle: false,
|
|
4787
|
-
packages: "external",
|
|
4788
|
-
splitting: false,
|
|
4789
|
-
platform,
|
|
4790
|
-
format: "cjs",
|
|
4791
|
-
outdir: pkg.dist.cwdPath,
|
|
4792
|
-
outExtension: { ".js": pkgJson.type === "module" ? ".cjs" : ".js" },
|
|
4793
|
-
logLevel: "error",
|
|
4794
|
-
plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
|
|
4795
|
-
});
|
|
4796
|
-
await esbuild2.build({
|
|
4797
|
-
write: true,
|
|
4798
|
-
entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.tsx`],
|
|
4799
|
-
bundle: false,
|
|
4800
|
-
packages: "external",
|
|
4801
|
-
splitting: false,
|
|
4802
|
-
platform,
|
|
4803
|
-
format: "esm",
|
|
4804
|
-
outdir: pkg.dist.cwdPath,
|
|
4805
|
-
outExtension: { ".js": pkgJson.type === "module" ? ".js" : ".mjs" },
|
|
4806
|
-
logLevel: "error",
|
|
4807
|
-
plugins: []
|
|
4808
|
-
});
|
|
4813
|
+
await builder.build();
|
|
4809
4814
|
}
|
|
4810
|
-
const dependencies = buildResult.outputFiles ? extractDependencies(buildResult.outputFiles, rootPackageJson, Object.keys(pkgJson.dependencies ?? {})) : {};
|
|
4811
|
-
const pkgPackageJson = {
|
|
4812
|
-
...pkgJson,
|
|
4813
|
-
main: "./index.js",
|
|
4814
|
-
engines: { node: ">=22" },
|
|
4815
|
-
dependencies,
|
|
4816
|
-
...["@akanjs/cli"].includes(pkg.name) ? {} : {
|
|
4817
|
-
exports: {
|
|
4818
|
-
".": {
|
|
4819
|
-
require: pkgJson.type === "module" ? "./index.cjs" : "./index.js",
|
|
4820
|
-
import: pkgJson.type === "module" ? "./index.js" : "./index.mjs"
|
|
4821
|
-
},
|
|
4822
|
-
...pkgJson.exports ?? {}
|
|
4823
|
-
}
|
|
4824
|
-
}
|
|
4825
|
-
};
|
|
4826
|
-
if (buildResult.outputFiles)
|
|
4827
|
-
buildResult.outputFiles.map((file) => pkg.dist.writeFile(file.path, file.text));
|
|
4828
|
-
pkg.dist.writeJson("package.json", pkgPackageJson);
|
|
4829
|
-
pkg.writeJson("package.json", pkgPackageJson);
|
|
4830
4815
|
}
|
|
4816
|
+
// async buildPackage(pkg: Pkg) {
|
|
4817
|
+
// const rootPackageJson = pkg.workspace.readJson("package.json") as PackageJson;
|
|
4818
|
+
// const pkgJson = pkg.readJson("package.json") as PackageJson;
|
|
4819
|
+
// // 1. remove dist directory
|
|
4820
|
+
// if (fs.existsSync(pkg.dist.cwdPath)) await pkg.workspace.exec(`rm -rf ${pkg.dist.cwdPath}`);
|
|
4821
|
+
// // 2. esbuild
|
|
4822
|
+
// let buildResult: esbuild.BuildResult;
|
|
4823
|
+
// if (pkg.name === "@akanjs/config") {
|
|
4824
|
+
// buildResult = await esbuild.build({
|
|
4825
|
+
// write: false,
|
|
4826
|
+
// entryPoints: [`${pkg.cwdPath}/**/*.ts`],
|
|
4827
|
+
// bundle: false,
|
|
4828
|
+
// packages: "external",
|
|
4829
|
+
// format: "cjs",
|
|
4830
|
+
// outdir: pkg.dist.cwdPath,
|
|
4831
|
+
// logLevel: "error",
|
|
4832
|
+
// outExtension: { ".js": pkgJson.type === "module" ? ".cjs" : ".js" },
|
|
4833
|
+
// plugins: [dtsPlugin({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })],
|
|
4834
|
+
// });
|
|
4835
|
+
// await esbuild.build({
|
|
4836
|
+
// write: true,
|
|
4837
|
+
// entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.css`, `${pkg.cwdPath}/**/*.js`],
|
|
4838
|
+
// bundle: false,
|
|
4839
|
+
// packages: "external",
|
|
4840
|
+
// format: "esm",
|
|
4841
|
+
// outdir: pkg.dist.cwdPath,
|
|
4842
|
+
// logLevel: "error",
|
|
4843
|
+
// outExtension: { ".js": pkgJson.type === "module" ? ".js" : ".mjs" },
|
|
4844
|
+
// loader: { ".css": "copy", ".js": "copy" },
|
|
4845
|
+
// });
|
|
4846
|
+
// } else if (pkg.name === "@akanjs/cli") {
|
|
4847
|
+
// buildResult = await esbuild.build({
|
|
4848
|
+
// write: false,
|
|
4849
|
+
// entryPoints: [`${pkg.cwdPath}/index.ts`, `${pkg.cwdPath}/README.md`],
|
|
4850
|
+
// bundle: true,
|
|
4851
|
+
// format: "cjs",
|
|
4852
|
+
// packages: "external",
|
|
4853
|
+
// outdir: pkg.dist.cwdPath,
|
|
4854
|
+
// logLevel: "error",
|
|
4855
|
+
// plugins: [dtsPlugin({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })],
|
|
4856
|
+
// loader: { ".md": "copy" },
|
|
4857
|
+
// });
|
|
4858
|
+
// await esbuild.build({
|
|
4859
|
+
// write: true,
|
|
4860
|
+
// entryPoints: [`${pkg.cwdPath}/src/templates/**/*.ts`, `${pkg.cwdPath}/src/templates/**/*.tsx`],
|
|
4861
|
+
// packages: "external",
|
|
4862
|
+
// outdir: `${pkg.dist.cwdPath}/src/templates`,
|
|
4863
|
+
// outbase: `${pkg.cwdPath}/src/templates`,
|
|
4864
|
+
// format: "cjs",
|
|
4865
|
+
// platform: "node",
|
|
4866
|
+
// footer: { js: "module.exports = module.exports.default;" },
|
|
4867
|
+
// });
|
|
4868
|
+
// await pkg.workspace.exec(
|
|
4869
|
+
// `rsync -aq --exclude="*.ts" --exclude="*.tsx" ${pkg.cwdPath}/src/templates/ ${pkg.dist.cwdPath}/src/templates/`
|
|
4870
|
+
// );
|
|
4871
|
+
// } else {
|
|
4872
|
+
// const platform: "node" | "browser" | "neutral" = [
|
|
4873
|
+
// "@akanjs/devkit",
|
|
4874
|
+
// "@akanjs/document",
|
|
4875
|
+
// "@akanjs/lint",
|
|
4876
|
+
// "@akanjs/nest",
|
|
4877
|
+
// "@akanjs/server",
|
|
4878
|
+
// "@akanjs/service",
|
|
4879
|
+
// ].includes(pkg.name)
|
|
4880
|
+
// ? "node"
|
|
4881
|
+
// : ["@akanjs/client", "@akanjs/next", "@akanjs/store", "@akanjs/ui"].includes(pkg.name)
|
|
4882
|
+
// ? "browser"
|
|
4883
|
+
// : "neutral";
|
|
4884
|
+
// buildResult = await esbuild.build({
|
|
4885
|
+
// write: false,
|
|
4886
|
+
// entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.tsx`],
|
|
4887
|
+
// bundle: false,
|
|
4888
|
+
// packages: "external",
|
|
4889
|
+
// splitting: false,
|
|
4890
|
+
// platform,
|
|
4891
|
+
// format: "cjs",
|
|
4892
|
+
// outdir: pkg.dist.cwdPath,
|
|
4893
|
+
// outExtension: { ".js": pkgJson.type === "module" ? ".cjs" : ".js" },
|
|
4894
|
+
// logLevel: "error",
|
|
4895
|
+
// plugins: [dtsPlugin({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })],
|
|
4896
|
+
// });
|
|
4897
|
+
// await esbuild.build({
|
|
4898
|
+
// write: true,
|
|
4899
|
+
// entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.tsx`],
|
|
4900
|
+
// bundle: false,
|
|
4901
|
+
// packages: "external",
|
|
4902
|
+
// splitting: false,
|
|
4903
|
+
// platform,
|
|
4904
|
+
// format: "esm",
|
|
4905
|
+
// outdir: pkg.dist.cwdPath,
|
|
4906
|
+
// outExtension: { ".js": pkgJson.type === "module" ? ".js" : ".mjs" },
|
|
4907
|
+
// logLevel: "error",
|
|
4908
|
+
// plugins: [],
|
|
4909
|
+
// });
|
|
4910
|
+
// }
|
|
4911
|
+
// // 3. generate package.json
|
|
4912
|
+
// const dependencies = buildResult.outputFiles
|
|
4913
|
+
// ? extractDependencies(buildResult.outputFiles, rootPackageJson, Object.keys(pkgJson.dependencies ?? {}))
|
|
4914
|
+
// : {};
|
|
4915
|
+
// const pkgPackageJson: PackageJson = {
|
|
4916
|
+
// ...pkgJson,
|
|
4917
|
+
// main: "./index.js",
|
|
4918
|
+
// engines: { node: ">=22" },
|
|
4919
|
+
// dependencies,
|
|
4920
|
+
// ...(["@akanjs/cli"].includes(pkg.name)
|
|
4921
|
+
// ? {}
|
|
4922
|
+
// : {
|
|
4923
|
+
// exports: {
|
|
4924
|
+
// ".": {
|
|
4925
|
+
// require: pkgJson.type === "module" ? "./index.cjs" : "./index.js",
|
|
4926
|
+
// import: pkgJson.type === "module" ? "./index.js" : "./index.mjs",
|
|
4927
|
+
// },
|
|
4928
|
+
// ...(pkgJson.exports ?? {}),
|
|
4929
|
+
// },
|
|
4930
|
+
// }),
|
|
4931
|
+
// };
|
|
4932
|
+
// //! Temporary fix for barrel library
|
|
4933
|
+
// if (buildResult.outputFiles) buildResult.outputFiles.map((file) => pkg.dist.writeFile(file.path, file.text));
|
|
4934
|
+
// pkg.dist.writeJson("package.json", pkgPackageJson);
|
|
4935
|
+
// pkg.writeJson("package.json", pkgPackageJson);
|
|
4936
|
+
// }
|
|
4831
4937
|
};
|
|
4832
4938
|
|
|
4833
4939
|
// pkgs/@akanjs/cli/src/package/package.script.ts
|
|
@@ -4853,7 +4959,7 @@ var PackageScript = class {
|
|
|
4853
4959
|
|
|
4854
4960
|
// pkgs/@akanjs/cli/src/cloud/cloud.runner.ts
|
|
4855
4961
|
var import_prompts7 = require("@inquirer/prompts");
|
|
4856
|
-
var
|
|
4962
|
+
var import_chalk4 = __toESM(require("chalk"));
|
|
4857
4963
|
var import_latest_version = __toESM(require("latest-version"));
|
|
4858
4964
|
var import_open2 = __toESM(require("open"));
|
|
4859
4965
|
var QRcode = __toESM(require("qrcode"));
|
|
@@ -4863,17 +4969,17 @@ var CloudRunner = class {
|
|
|
4863
4969
|
const config = getHostConfig();
|
|
4864
4970
|
const self = config.auth ? await getSelf(config.auth.token) : null;
|
|
4865
4971
|
if (self) {
|
|
4866
|
-
Logger.rawLog(
|
|
4972
|
+
Logger.rawLog(import_chalk4.default.green(`
|
|
4867
4973
|
\u2713 Already logged in akan cloud as ${self.nickname}
|
|
4868
4974
|
`));
|
|
4869
4975
|
return true;
|
|
4870
4976
|
}
|
|
4871
4977
|
const remoteId = (0, import_uuid.v4)();
|
|
4872
4978
|
const signinUrl = `${akanCloudClientUrl}/signin?remoteId=${remoteId}`;
|
|
4873
|
-
Logger.rawLog(
|
|
4874
|
-
${
|
|
4875
|
-
Logger.rawLog(
|
|
4876
|
-
Logger.rawLog(
|
|
4979
|
+
Logger.rawLog(import_chalk4.default.bold(`
|
|
4980
|
+
${import_chalk4.default.green("\u27A4")} Authentication Required`));
|
|
4981
|
+
Logger.rawLog(import_chalk4.default.dim("Please visit or click the following URL:"));
|
|
4982
|
+
Logger.rawLog(import_chalk4.default.cyan.underline(signinUrl) + "\n");
|
|
4877
4983
|
try {
|
|
4878
4984
|
const qrcode = await new Promise((resolve, reject) => {
|
|
4879
4985
|
QRcode.toString(signinUrl, { type: "terminal", small: true }, (err, data) => {
|
|
@@ -4884,11 +4990,11 @@ ${import_chalk2.default.green("\u27A4")} Authentication Required`));
|
|
|
4884
4990
|
});
|
|
4885
4991
|
Logger.rawLog(qrcode);
|
|
4886
4992
|
await (0, import_open2.default)(signinUrl);
|
|
4887
|
-
Logger.rawLog(
|
|
4993
|
+
Logger.rawLog(import_chalk4.default.dim("Opening browser..."));
|
|
4888
4994
|
} catch {
|
|
4889
|
-
Logger.rawLog(
|
|
4995
|
+
Logger.rawLog(import_chalk4.default.yellow("Could not open browser. Please visit the URL manually."));
|
|
4890
4996
|
}
|
|
4891
|
-
Logger.rawLog(
|
|
4997
|
+
Logger.rawLog(import_chalk4.default.dim("Waiting for authentication..."));
|
|
4892
4998
|
const MAX_RETRY = 300;
|
|
4893
4999
|
for (let i = 0; i < MAX_RETRY; i++) {
|
|
4894
5000
|
const res = await fetch(`${akanCloudBackendUrl}/user/getRemoteAuthToken/${remoteId}`);
|
|
@@ -4896,37 +5002,37 @@ ${import_chalk2.default.green("\u27A4")} Authentication Required`));
|
|
|
4896
5002
|
const self2 = jwt ? await getSelf(jwt) : null;
|
|
4897
5003
|
if (jwt && self2) {
|
|
4898
5004
|
setHostConfig(akanCloudHost, { auth: { token: jwt, self: self2 } });
|
|
4899
|
-
Logger.rawLog(
|
|
4900
|
-
Logger.rawLog(
|
|
5005
|
+
Logger.rawLog(import_chalk4.default.green(`\r\u2713 Authentication successful!`));
|
|
5006
|
+
Logger.rawLog(import_chalk4.default.green.bold(`
|
|
4901
5007
|
\u2728 Welcome aboard, ${self2.nickname}!`));
|
|
4902
|
-
Logger.rawLog(
|
|
5008
|
+
Logger.rawLog(import_chalk4.default.dim("You're now ready to use Akan CLI!\n"));
|
|
4903
5009
|
return true;
|
|
4904
5010
|
}
|
|
4905
5011
|
await sleep(2e3);
|
|
4906
5012
|
}
|
|
4907
|
-
throw new Error(
|
|
5013
|
+
throw new Error(import_chalk4.default.red("\u2716 Authentication timed out after 10 minutes. Please try again."));
|
|
4908
5014
|
}
|
|
4909
5015
|
logout() {
|
|
4910
5016
|
const config = getHostConfig();
|
|
4911
5017
|
if (config.auth) {
|
|
4912
5018
|
setHostConfig(akanCloudHost, {});
|
|
4913
|
-
Logger.rawLog(
|
|
5019
|
+
Logger.rawLog(import_chalk4.default.magenta.bold(`
|
|
4914
5020
|
\u{1F44B} Goodbye, ${config.auth.self.nickname}!`));
|
|
4915
|
-
Logger.rawLog(
|
|
4916
|
-
Logger.rawLog(
|
|
4917
|
-
Logger.rawLog(
|
|
5021
|
+
Logger.rawLog(import_chalk4.default.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n"));
|
|
5022
|
+
Logger.rawLog(import_chalk4.default.cyan("You have been successfully logged out."));
|
|
5023
|
+
Logger.rawLog(import_chalk4.default.dim("Thank you for using Akan CLI. Come back soon! \u{1F31F}\n"));
|
|
4918
5024
|
} else {
|
|
4919
|
-
Logger.rawLog(
|
|
4920
|
-
Logger.rawLog(
|
|
5025
|
+
Logger.rawLog(import_chalk4.default.yellow.bold("\n\u26A0\uFE0F No active session found"));
|
|
5026
|
+
Logger.rawLog(import_chalk4.default.dim("You were not logged in to begin with\n"));
|
|
4921
5027
|
}
|
|
4922
5028
|
}
|
|
4923
5029
|
async setLlm() {
|
|
4924
5030
|
await AiSession.init({ useExisting: true });
|
|
4925
|
-
Logger.rawLog(
|
|
5031
|
+
Logger.rawLog(import_chalk4.default.green("LLM model set successfully"));
|
|
4926
5032
|
}
|
|
4927
5033
|
resetLlm() {
|
|
4928
5034
|
AiSession.setLlmConfig(null);
|
|
4929
|
-
Logger.rawLog(
|
|
5035
|
+
Logger.rawLog(import_chalk4.default.green("LLM model reset successfully"));
|
|
4930
5036
|
}
|
|
4931
5037
|
async getAkanPkgs(workspace) {
|
|
4932
5038
|
const pkgs = await workspace.getPkgs();
|
|
@@ -5108,7 +5214,7 @@ LibraryCommand = __decorateClass([
|
|
|
5108
5214
|
|
|
5109
5215
|
// pkgs/@akanjs/cli/src/module/module.script.ts
|
|
5110
5216
|
var import_prompts8 = require("@inquirer/prompts");
|
|
5111
|
-
var
|
|
5217
|
+
var import_fs10 = __toESM(require("fs"));
|
|
5112
5218
|
|
|
5113
5219
|
// pkgs/@akanjs/cli/src/module/module.runner.ts
|
|
5114
5220
|
var ModuleRunner = class {
|
|
@@ -5307,7 +5413,7 @@ var ModuleScript = class {
|
|
|
5307
5413
|
return;
|
|
5308
5414
|
const Name = capitalize(name);
|
|
5309
5415
|
const relatedCnsts = getRelatedCnsts(`${sys2.cwdPath}/lib/${name}/${name}.constant.ts`);
|
|
5310
|
-
const constant =
|
|
5416
|
+
const constant = import_fs10.default.readFileSync(`${sys2.cwdPath}/lib/${name}/${name}.constant.ts`, "utf-8");
|
|
5311
5417
|
const session = new AiSession();
|
|
5312
5418
|
const promptRst = requestView({
|
|
5313
5419
|
sysName: sys2.name,
|
|
@@ -5318,8 +5424,8 @@ var ModuleScript = class {
|
|
|
5318
5424
|
exampleFiles: randomPicks(unitExampleFiles, Math.min(10, unitExampleFiles.length))
|
|
5319
5425
|
});
|
|
5320
5426
|
const content = await session.editTypescript(promptRst);
|
|
5321
|
-
|
|
5322
|
-
|
|
5427
|
+
import_fs10.default.writeFileSync(`${sys2.cwdPath}/prompt.txt`, promptRst);
|
|
5428
|
+
import_fs10.default.writeFileSync(`${sys2.cwdPath}/result.txt`, content);
|
|
5323
5429
|
}
|
|
5324
5430
|
async createView(sys2) {
|
|
5325
5431
|
const libs = await sys2.getModules();
|
|
@@ -5338,7 +5444,7 @@ var ModuleScript = class {
|
|
|
5338
5444
|
const viewExampleFiles = (await sys2.getViewsSourceCode()).filter((f) => f.filepath.includes(`${name}.View.tsx`));
|
|
5339
5445
|
const Name = capitalize(name);
|
|
5340
5446
|
const relatedCnsts = getRelatedCnsts(`${sys2.cwdPath}/lib/${name}/${name}.constant.ts`);
|
|
5341
|
-
const constant =
|
|
5447
|
+
const constant = import_fs10.default.readFileSync(`${sys2.cwdPath}/lib/${name}/${name}.constant.ts`, "utf-8");
|
|
5342
5448
|
const session = new AiSession();
|
|
5343
5449
|
const promptRst = requestView({
|
|
5344
5450
|
sysName: sys2.name,
|
|
@@ -5349,8 +5455,8 @@ var ModuleScript = class {
|
|
|
5349
5455
|
exampleFiles: randomPicks(viewExampleFiles, Math.min(20, viewExampleFiles.length))
|
|
5350
5456
|
});
|
|
5351
5457
|
const content = await session.editTypescript(promptRst);
|
|
5352
|
-
|
|
5353
|
-
|
|
5458
|
+
import_fs10.default.writeFileSync(`${sys2.cwdPath}/prompt.txt`, promptRst);
|
|
5459
|
+
import_fs10.default.writeFileSync(`${sys2.cwdPath}/result.txt`, content);
|
|
5354
5460
|
}
|
|
5355
5461
|
};
|
|
5356
5462
|
|
|
@@ -5654,5 +5760,4 @@ void runCommands(
|
|
|
5654
5760
|
//! 2. csr폴더를 현 위치로 복사 후 압축 후 삭제
|
|
5655
5761
|
//! execSync를 가져오기 싫으니 일단 2번 방법으로 해보자
|
|
5656
5762
|
//! add path in tsconfig.json
|
|
5657
|
-
//! Temporary fix for barrel library
|
|
5658
5763
|
//! 파일을 {name}.View.tsx에 저장.
|