@akanjs/cli 0.0.92 → 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 +1 -1
- package/index.js +281 -191
- package/index.mjs +6220 -0
- package/package.json +10 -1
- 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/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/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,15 +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
|
-
var import_chalk = __toESM(require("chalk"));
|
|
762
758
|
|
|
763
759
|
// pkgs/@akanjs/devkit/src/dependencyScanner.ts
|
|
764
|
-
var
|
|
760
|
+
var fs5 = __toESM(require("fs"));
|
|
765
761
|
var path3 = __toESM(require("path"));
|
|
766
762
|
var ts2 = __toESM(require("typescript"));
|
|
767
763
|
var TypeScriptDependencyScanner = class {
|
|
@@ -806,7 +802,7 @@ var TypeScriptDependencyScanner = class {
|
|
|
806
802
|
async #findTypeScriptFiles(directory) {
|
|
807
803
|
const files = [];
|
|
808
804
|
const processDirectory = async (dir) => {
|
|
809
|
-
const entries = await
|
|
805
|
+
const entries = await fs5.promises.readdir(dir, { withFileTypes: true });
|
|
810
806
|
for (const entry of entries) {
|
|
811
807
|
const fullPath = path3.join(dir, entry.name);
|
|
812
808
|
if (entry.isDirectory()) {
|
|
@@ -824,7 +820,7 @@ var TypeScriptDependencyScanner = class {
|
|
|
824
820
|
return;
|
|
825
821
|
this.#visitedFiles.add(filePath);
|
|
826
822
|
try {
|
|
827
|
-
const fileContent = await
|
|
823
|
+
const fileContent = await fs5.promises.readFile(filePath, "utf-8");
|
|
828
824
|
const imports = this.#extractImports(fileContent, filePath);
|
|
829
825
|
const resolvedImports = imports.map((importPath) => {
|
|
830
826
|
if (importPath.startsWith(".")) {
|
|
@@ -839,11 +835,11 @@ var TypeScriptDependencyScanner = class {
|
|
|
839
835
|
}
|
|
840
836
|
}
|
|
841
837
|
#ensureExtension(filePath) {
|
|
842
|
-
if (
|
|
838
|
+
if (fs5.existsSync(`${filePath}.ts`))
|
|
843
839
|
return `${filePath}.ts`;
|
|
844
|
-
else if (
|
|
840
|
+
else if (fs5.existsSync(`${filePath}.tsx`))
|
|
845
841
|
return `${filePath}.tsx`;
|
|
846
|
-
else if (
|
|
842
|
+
else if (fs5.existsSync(filePath))
|
|
847
843
|
return filePath;
|
|
848
844
|
return `${filePath}.ts`;
|
|
849
845
|
}
|
|
@@ -914,8 +910,8 @@ var Executor = class {
|
|
|
914
910
|
constructor(name, cwdPath) {
|
|
915
911
|
this.logger = new Logger(name);
|
|
916
912
|
this.cwdPath = cwdPath;
|
|
917
|
-
if (!
|
|
918
|
-
|
|
913
|
+
if (!import_fs4.default.existsSync(cwdPath))
|
|
914
|
+
import_fs4.default.mkdirSync(cwdPath, { recursive: true });
|
|
919
915
|
}
|
|
920
916
|
exec(command, options = {}) {
|
|
921
917
|
const proc = (0, import_child_process.exec)(command, { cwd: this.cwdPath, ...options });
|
|
@@ -974,31 +970,31 @@ var Executor = class {
|
|
|
974
970
|
}
|
|
975
971
|
mkdir(dirPath) {
|
|
976
972
|
const writePath = this.#getPath(dirPath);
|
|
977
|
-
if (!
|
|
978
|
-
|
|
973
|
+
if (!import_fs4.default.existsSync(writePath))
|
|
974
|
+
import_fs4.default.mkdirSync(writePath, { recursive: true });
|
|
979
975
|
this.logger.verbose(`Make directory ${writePath}`);
|
|
980
976
|
return this;
|
|
981
977
|
}
|
|
982
978
|
exists(filePath) {
|
|
983
979
|
const readPath = this.#getPath(filePath);
|
|
984
|
-
return
|
|
980
|
+
return import_fs4.default.existsSync(readPath);
|
|
985
981
|
}
|
|
986
982
|
writeFile(filePath, content, { overwrite = true } = {}) {
|
|
987
983
|
const writePath = this.#getPath(filePath);
|
|
988
984
|
const dir = import_path3.default.dirname(writePath);
|
|
989
|
-
if (!
|
|
990
|
-
|
|
985
|
+
if (!import_fs4.default.existsSync(dir))
|
|
986
|
+
import_fs4.default.mkdirSync(dir, { recursive: true });
|
|
991
987
|
const contentStr = typeof content === "string" ? content : JSON.stringify(content, null, 2);
|
|
992
|
-
if (
|
|
993
|
-
const currentContent =
|
|
988
|
+
if (import_fs4.default.existsSync(writePath)) {
|
|
989
|
+
const currentContent = import_fs4.default.readFileSync(writePath, "utf8");
|
|
994
990
|
if (currentContent === contentStr || !overwrite)
|
|
995
991
|
this.logger.verbose(`File ${writePath} is unchanged`);
|
|
996
992
|
else {
|
|
997
|
-
|
|
993
|
+
import_fs4.default.writeFileSync(writePath, contentStr, "utf8");
|
|
998
994
|
this.logger.verbose(`File ${writePath} is changed`);
|
|
999
995
|
}
|
|
1000
996
|
} else {
|
|
1001
|
-
|
|
997
|
+
import_fs4.default.writeFileSync(writePath, contentStr, "utf8");
|
|
1002
998
|
this.logger.verbose(`File ${writePath} is created`);
|
|
1003
999
|
}
|
|
1004
1000
|
return this;
|
|
@@ -1014,11 +1010,11 @@ var Executor = class {
|
|
|
1014
1010
|
}
|
|
1015
1011
|
readFile(filePath) {
|
|
1016
1012
|
const readPath = this.#getPath(filePath);
|
|
1017
|
-
return
|
|
1013
|
+
return import_fs4.default.readFileSync(readPath, "utf8");
|
|
1018
1014
|
}
|
|
1019
1015
|
readJson(filePath) {
|
|
1020
1016
|
const readPath = this.#getPath(filePath);
|
|
1021
|
-
return JSON.parse(
|
|
1017
|
+
return JSON.parse(import_fs4.default.readFileSync(readPath, "utf8"));
|
|
1022
1018
|
}
|
|
1023
1019
|
async cp(srcPath, destPath) {
|
|
1024
1020
|
const src = this.#getPath(srcPath);
|
|
@@ -1052,7 +1048,7 @@ var Executor = class {
|
|
|
1052
1048
|
overwrite = true
|
|
1053
1049
|
}, dict = {}) {
|
|
1054
1050
|
if (targetPath.endsWith(".js") || targetPath.endsWith(".jsx")) {
|
|
1055
|
-
const getContent =
|
|
1051
|
+
const getContent = require(templatePath);
|
|
1056
1052
|
const result = getContent.default(scanResult ?? null, dict);
|
|
1057
1053
|
if (result === null)
|
|
1058
1054
|
return;
|
|
@@ -1087,7 +1083,7 @@ var Executor = class {
|
|
|
1087
1083
|
overwrite = true
|
|
1088
1084
|
}) {
|
|
1089
1085
|
const templatePath = `${__dirname}/src/templates${template ? `/${template}` : ""}`.replace(".ts", ".js");
|
|
1090
|
-
if (
|
|
1086
|
+
if (import_fs4.default.statSync(templatePath).isFile()) {
|
|
1091
1087
|
const filename = import_path3.default.basename(templatePath);
|
|
1092
1088
|
await this.#applyTemplateFile(
|
|
1093
1089
|
{ templatePath, targetPath: import_path3.default.join(basePath2, filename), scanResult, overwrite },
|
|
@@ -1098,7 +1094,7 @@ var Executor = class {
|
|
|
1098
1094
|
await Promise.all(
|
|
1099
1095
|
subdirs.map(async (subdir) => {
|
|
1100
1096
|
const subpath = import_path3.default.join(templatePath, subdir);
|
|
1101
|
-
if (
|
|
1097
|
+
if (import_fs4.default.statSync(subpath).isFile())
|
|
1102
1098
|
await this.#applyTemplateFile(
|
|
1103
1099
|
{ templatePath: subpath, targetPath: import_path3.default.join(basePath2, subdir), scanResult, overwrite },
|
|
1104
1100
|
dict
|
|
@@ -1204,7 +1200,7 @@ var WorkspaceExecutor = class _WorkspaceExecutor extends Executor {
|
|
|
1204
1200
|
if (AVOID_DIRS.includes(dir))
|
|
1205
1201
|
return;
|
|
1206
1202
|
const dirPath = import_path3.default.join(dirname, dir);
|
|
1207
|
-
if (
|
|
1203
|
+
if (import_fs4.default.lstatSync(dirPath).isDirectory()) {
|
|
1208
1204
|
results.push(`${name}/${prefix}${dir}`);
|
|
1209
1205
|
if (maxDepth > 0)
|
|
1210
1206
|
await getDirs(dirPath, maxDepth - 1, results, `${prefix}${dir}/`);
|
|
@@ -1231,8 +1227,8 @@ var WorkspaceExecutor = class _WorkspaceExecutor extends Executor {
|
|
|
1231
1227
|
if (AVOID_DIRS.includes(dir))
|
|
1232
1228
|
return;
|
|
1233
1229
|
const dirPath = import_path3.default.join(dirname, dir);
|
|
1234
|
-
if (
|
|
1235
|
-
const hasTargetFile =
|
|
1230
|
+
if (import_fs4.default.lstatSync(dirPath).isDirectory()) {
|
|
1231
|
+
const hasTargetFile = import_fs4.default.existsSync(import_path3.default.join(dirPath, targetFilename));
|
|
1236
1232
|
if (hasTargetFile)
|
|
1237
1233
|
results.push(`${prefix}${dir}`);
|
|
1238
1234
|
if (maxDepth > 0)
|
|
@@ -1302,11 +1298,11 @@ var SysExecutor = class extends Executor {
|
|
|
1302
1298
|
const pathSplitLength = path7.split("/").length;
|
|
1303
1299
|
return tsconfig.compilerOptions.paths[path7][0].split("/").slice(1, 1 + pathSplitLength).join("/");
|
|
1304
1300
|
}).filter((libName) => libName !== this.name);
|
|
1305
|
-
if (!
|
|
1306
|
-
|
|
1301
|
+
if (!import_fs4.default.existsSync(`${this.cwdPath}/lib/__scalar`))
|
|
1302
|
+
import_fs4.default.mkdirSync(`${this.cwdPath}/lib/__scalar`, { recursive: true });
|
|
1307
1303
|
const files = getDefaultFileScan();
|
|
1308
1304
|
const dirnames = (await import_promises.default.readdir(`${this.cwdPath}/lib`)).filter(
|
|
1309
|
-
(name) =>
|
|
1305
|
+
(name) => import_fs4.default.lstatSync(`${this.cwdPath}/lib/${name}`).isDirectory()
|
|
1310
1306
|
);
|
|
1311
1307
|
const databaseDirs = dirnames.filter((name) => !name.startsWith("_"));
|
|
1312
1308
|
const serviceDirs = dirnames.filter((name) => name.startsWith("_") && !name.startsWith("__"));
|
|
@@ -1434,27 +1430,27 @@ var SysExecutor = class extends Executor {
|
|
|
1434
1430
|
return { filepath, content };
|
|
1435
1431
|
}
|
|
1436
1432
|
async getDatabaseModules() {
|
|
1437
|
-
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`));
|
|
1438
1434
|
return databaseModules;
|
|
1439
1435
|
}
|
|
1440
1436
|
async getServiceModules() {
|
|
1441
|
-
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`));
|
|
1442
1438
|
return serviceModules;
|
|
1443
1439
|
}
|
|
1444
1440
|
async getScalarModules() {
|
|
1445
|
-
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`));
|
|
1446
1442
|
return scalarModules;
|
|
1447
1443
|
}
|
|
1448
1444
|
async getViewComponents() {
|
|
1449
|
-
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`));
|
|
1450
1446
|
return viewComponents;
|
|
1451
1447
|
}
|
|
1452
1448
|
async getUnitComponents() {
|
|
1453
|
-
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`));
|
|
1454
1450
|
return unitComponents;
|
|
1455
1451
|
}
|
|
1456
1452
|
async getTemplateComponents() {
|
|
1457
|
-
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`));
|
|
1458
1454
|
return templateComponents;
|
|
1459
1455
|
}
|
|
1460
1456
|
async getViewsSourceCode() {
|
|
@@ -1509,9 +1505,9 @@ var AppExecutor = class _AppExecutor extends SysExecutor {
|
|
|
1509
1505
|
}
|
|
1510
1506
|
async syncAssets(libDeps) {
|
|
1511
1507
|
const projectPublicLibPath = `${this.cwdPath}/public/libs`;
|
|
1512
|
-
if (
|
|
1508
|
+
if (import_fs4.default.existsSync(projectPublicLibPath))
|
|
1513
1509
|
await import_promises.default.rm(projectPublicLibPath, { recursive: true });
|
|
1514
|
-
const targetDeps = libDeps.filter((dep) =>
|
|
1510
|
+
const targetDeps = libDeps.filter((dep) => import_fs4.default.existsSync(`${this.workspace.workspaceRoot}/libs/${dep}/public`));
|
|
1515
1511
|
await Promise.all(targetDeps.map((dep) => import_promises.default.mkdir(`${projectPublicLibPath}/${dep}`, { recursive: true })));
|
|
1516
1512
|
await Promise.all(
|
|
1517
1513
|
targetDeps.map(
|
|
@@ -1594,14 +1590,14 @@ var defaultHostConfig = {};
|
|
|
1594
1590
|
var defaultAkanGlobalConfig = { cloudHost: {}, llm: null };
|
|
1595
1591
|
|
|
1596
1592
|
// pkgs/@akanjs/devkit/src/auth.ts
|
|
1597
|
-
var
|
|
1593
|
+
var import_fs5 = __toESM(require("fs"));
|
|
1598
1594
|
var getAkanGlobalConfig = () => {
|
|
1599
|
-
const akanConfig =
|
|
1595
|
+
const akanConfig = import_fs5.default.existsSync(configPath) ? JSON.parse(import_fs5.default.readFileSync(configPath, "utf8")) : defaultAkanGlobalConfig;
|
|
1600
1596
|
return akanConfig;
|
|
1601
1597
|
};
|
|
1602
1598
|
var setAkanGlobalConfig = (akanConfig) => {
|
|
1603
|
-
|
|
1604
|
-
|
|
1599
|
+
import_fs5.default.mkdirSync(basePath, { recursive: true });
|
|
1600
|
+
import_fs5.default.writeFileSync(configPath, JSON.stringify(akanConfig, null, 2));
|
|
1605
1601
|
};
|
|
1606
1602
|
var getHostConfig = (host = akanCloudHost) => {
|
|
1607
1603
|
const akanConfig = getAkanGlobalConfig();
|
|
@@ -1624,7 +1620,7 @@ var getSelf = async (token) => {
|
|
|
1624
1620
|
|
|
1625
1621
|
// pkgs/@akanjs/devkit/src/capacitorApp.ts
|
|
1626
1622
|
var import_project = require("@trapezedev/project");
|
|
1627
|
-
var
|
|
1623
|
+
var import_fs6 = __toESM(require("fs"));
|
|
1628
1624
|
var CapacitorApp = class {
|
|
1629
1625
|
constructor(app) {
|
|
1630
1626
|
this.app = app;
|
|
@@ -1650,7 +1646,7 @@ var CapacitorApp = class {
|
|
|
1650
1646
|
await this.project.commit();
|
|
1651
1647
|
}
|
|
1652
1648
|
async releaseIos() {
|
|
1653
|
-
const isAdded =
|
|
1649
|
+
const isAdded = import_fs6.default.existsSync(`${this.app.cwdPath}/ios/App/Podfile`);
|
|
1654
1650
|
if (!isAdded) {
|
|
1655
1651
|
await this.app.spawn("npx cap add ios");
|
|
1656
1652
|
await this.app.spawn("npx @capacitor/assets generate");
|
|
@@ -1659,7 +1655,7 @@ var CapacitorApp = class {
|
|
|
1659
1655
|
await this.app.spawn("cross-env", ["APP_OPERATION_MODE=release", "npx", "cap", "sync", "ios"]);
|
|
1660
1656
|
}
|
|
1661
1657
|
async releaseAndroid() {
|
|
1662
|
-
const isAdded =
|
|
1658
|
+
const isAdded = import_fs6.default.existsSync(`${this.app.cwdPath}/android/app/build.gradle`);
|
|
1663
1659
|
if (!isAdded) {
|
|
1664
1660
|
await this.app.spawn("npx cap add android");
|
|
1665
1661
|
await this.app.spawn("npx @capacitor/assets generate");
|
|
@@ -1899,9 +1895,9 @@ var Target = {
|
|
|
1899
1895
|
|
|
1900
1896
|
// pkgs/@akanjs/devkit/src/commandDecorators/command.ts
|
|
1901
1897
|
var import_prompts3 = require("@inquirer/prompts");
|
|
1902
|
-
var import_commander = require("commander");
|
|
1903
|
-
var import_fs9 = __toESM(require("fs"));
|
|
1904
1898
|
var import_chalk2 = __toESM(require("chalk"));
|
|
1899
|
+
var import_commander = require("commander");
|
|
1900
|
+
var import_fs7 = __toESM(require("fs"));
|
|
1905
1901
|
var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
1906
1902
|
var handleOption = (programCommand, argMeta) => {
|
|
1907
1903
|
const {
|
|
@@ -1997,8 +1993,8 @@ var getArgumentValue = async (argMeta, value, workspace) => {
|
|
|
1997
1993
|
throw new Error(`Invalid system type: ${argMeta.type}`);
|
|
1998
1994
|
};
|
|
1999
1995
|
var runCommands = async (...commands) => {
|
|
2000
|
-
const hasPackageJson =
|
|
2001
|
-
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";
|
|
2002
1998
|
import_commander.program.version(version).description("Akan CLI");
|
|
2003
1999
|
for (const command of commands) {
|
|
2004
2000
|
const targetMetas = getTargetMetas(command);
|
|
@@ -2169,6 +2165,81 @@ var AiSession = class _AiSession {
|
|
|
2169
2165
|
}
|
|
2170
2166
|
};
|
|
2171
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
|
+
|
|
2172
2243
|
// pkgs/@akanjs/cli/src/library/library.runner.ts
|
|
2173
2244
|
var import_compare_versions = require("compare-versions");
|
|
2174
2245
|
var import_dotenv2 = __toESM(require("dotenv"));
|
|
@@ -2304,8 +2375,8 @@ var import_runnables2 = require("@langchain/core/runnables");
|
|
|
2304
2375
|
var import_openai3 = require("@langchain/openai");
|
|
2305
2376
|
var import_plugin_react = __toESM(require("@vitejs/plugin-react"));
|
|
2306
2377
|
var import_dotenv3 = __toESM(require("dotenv"));
|
|
2307
|
-
var
|
|
2308
|
-
var
|
|
2378
|
+
var esbuild2 = __toESM(require("esbuild"));
|
|
2379
|
+
var import_fs9 = __toESM(require("fs"));
|
|
2309
2380
|
var import_promises2 = __toESM(require("fs/promises"));
|
|
2310
2381
|
var import_js_yaml2 = __toESM(require("js-yaml"));
|
|
2311
2382
|
var import_open = __toESM(require("open"));
|
|
@@ -3892,7 +3963,7 @@ var ApplicationRunner = class {
|
|
|
3892
3963
|
async buildBackend(app) {
|
|
3893
3964
|
await this.#prepareCommand(app, "start", "backend");
|
|
3894
3965
|
const akanConfig = await app.getConfig("build");
|
|
3895
|
-
const buildResult = await
|
|
3966
|
+
const buildResult = await esbuild2.build({
|
|
3896
3967
|
write: false,
|
|
3897
3968
|
entryPoints: [`${app.cwdPath}/main.ts`],
|
|
3898
3969
|
bundle: true,
|
|
@@ -3917,7 +3988,7 @@ var ApplicationRunner = class {
|
|
|
3917
3988
|
}
|
|
3918
3989
|
async startBackend(app, { open: open2 = false } = {}) {
|
|
3919
3990
|
const { env } = await this.#prepareCommand(app, "start", "backend");
|
|
3920
|
-
const ctx = await
|
|
3991
|
+
const ctx = await esbuild2.context({
|
|
3921
3992
|
write: true,
|
|
3922
3993
|
entryPoints: [`${app.cwdPath}/main.ts`],
|
|
3923
3994
|
bundle: true,
|
|
@@ -3936,7 +4007,7 @@ var ApplicationRunner = class {
|
|
|
3936
4007
|
const { env } = await this.#prepareCommand(app, "build", "frontend");
|
|
3937
4008
|
const akanConfig = await app.getConfig("build");
|
|
3938
4009
|
await app.spawn("npx", ["next", "build", "--no-lint"], { env });
|
|
3939
|
-
const buildResult = await
|
|
4010
|
+
const buildResult = await esbuild2.build({
|
|
3940
4011
|
entryPoints: [`${app.cwdPath}/next.config.ts`],
|
|
3941
4012
|
outdir: `${app.dist.cwdPath}/frontend`,
|
|
3942
4013
|
bundle: true,
|
|
@@ -4052,7 +4123,7 @@ var ApplicationRunner = class {
|
|
|
4052
4123
|
setTimeout(() => (0, import_open.default)("http://localhost:4201"), 3e3);
|
|
4053
4124
|
}
|
|
4054
4125
|
async #prepareIos(app) {
|
|
4055
|
-
const isAdded =
|
|
4126
|
+
const isAdded = import_fs9.default.existsSync(`${app.cwdPath}/ios/App/Podfile`);
|
|
4056
4127
|
if (!isAdded) {
|
|
4057
4128
|
await app.spawn("npx", ["cap", "add", "ios"]);
|
|
4058
4129
|
await app.spawn("npx", ["@capacitor/assets", "generate"]);
|
|
@@ -4087,7 +4158,7 @@ var ApplicationRunner = class {
|
|
|
4087
4158
|
await capacitorApp.releaseIos();
|
|
4088
4159
|
}
|
|
4089
4160
|
async #prepareAndroid(app) {
|
|
4090
|
-
const isAdded =
|
|
4161
|
+
const isAdded = import_fs9.default.existsSync(`${app.cwdPath}/android/app/build.gradle`);
|
|
4091
4162
|
if (!isAdded) {
|
|
4092
4163
|
await app.spawn("npx", ["cap", "add", "android"]);
|
|
4093
4164
|
await app.spawn("npx", ["@capacitor/assets", "generate"]);
|
|
@@ -4174,14 +4245,14 @@ var ApplicationRunner = class {
|
|
|
4174
4245
|
const buildRoot = `${app.workspace.workspaceRoot}/releases/builds/${app.name}`;
|
|
4175
4246
|
const appVersionInfo = import_js_yaml2.default.load(app.readFile("config.yaml"));
|
|
4176
4247
|
const platformVersion = appVersionInfo.platforms.android.versionName;
|
|
4177
|
-
if (
|
|
4248
|
+
if (import_fs9.default.existsSync(buildRoot))
|
|
4178
4249
|
await import_promises2.default.rm(buildRoot, { recursive: true, force: true });
|
|
4179
4250
|
await import_promises2.default.mkdir(buildRoot, { recursive: true });
|
|
4180
|
-
if (rebuild || !
|
|
4251
|
+
if (rebuild || !import_fs9.default.existsSync(`${app.dist.cwdPath}/backend`))
|
|
4181
4252
|
await this.buildBackend(app);
|
|
4182
|
-
if (rebuild || !
|
|
4253
|
+
if (rebuild || !import_fs9.default.existsSync(`${app.dist.cwdPath}/frontend`))
|
|
4183
4254
|
await this.buildFrontend(app);
|
|
4184
|
-
if (rebuild || !
|
|
4255
|
+
if (rebuild || !import_fs9.default.existsSync(`${app.dist.cwdPath}/csr`))
|
|
4185
4256
|
await this.buildCsr(app);
|
|
4186
4257
|
const buildVersion = `${platformVersion}-${buildNum}`;
|
|
4187
4258
|
const buildPath = `${buildRoot}/${buildVersion}`;
|
|
@@ -4196,7 +4267,7 @@ var ApplicationRunner = class {
|
|
|
4196
4267
|
buildRoot,
|
|
4197
4268
|
"./"
|
|
4198
4269
|
]);
|
|
4199
|
-
if (
|
|
4270
|
+
if (import_fs9.default.existsSync(`${app.dist.cwdPath}/csr`)) {
|
|
4200
4271
|
await import_promises2.default.cp(`${app.dist.cwdPath}/csr`, "./csr", { recursive: true });
|
|
4201
4272
|
await app.workspace.spawn("zip", [
|
|
4202
4273
|
"-r",
|
|
@@ -4206,7 +4277,7 @@ var ApplicationRunner = class {
|
|
|
4206
4277
|
await import_promises2.default.rm("./csr", { recursive: true, force: true });
|
|
4207
4278
|
}
|
|
4208
4279
|
const sourceRoot = `${app.workspace.workspaceRoot}/releases/sources/${app.name}`;
|
|
4209
|
-
if (
|
|
4280
|
+
if (import_fs9.default.existsSync(sourceRoot)) {
|
|
4210
4281
|
const MAX_RETRY = 3;
|
|
4211
4282
|
for (let i = 0; i < MAX_RETRY; i++) {
|
|
4212
4283
|
try {
|
|
@@ -4226,7 +4297,7 @@ var ApplicationRunner = class {
|
|
|
4226
4297
|
await Promise.all(
|
|
4227
4298
|
[".next", "ios", "android", "public/libs"].map(async (path7) => {
|
|
4228
4299
|
const targetPath = `${sourceRoot}/apps/${app.name}/${path7}`;
|
|
4229
|
-
if (
|
|
4300
|
+
if (import_fs9.default.existsSync(targetPath))
|
|
4230
4301
|
await import_promises2.default.rm(targetPath, { recursive: true, force: true });
|
|
4231
4302
|
})
|
|
4232
4303
|
);
|
|
@@ -4254,8 +4325,8 @@ var ApplicationRunner = class {
|
|
|
4254
4325
|
[]
|
|
4255
4326
|
)
|
|
4256
4327
|
]);
|
|
4257
|
-
|
|
4258
|
-
|
|
4328
|
+
import_fs9.default.writeFileSync(`${sourceRoot}/tsconfig.json`, JSON.stringify(tsconfig, null, 2));
|
|
4329
|
+
import_fs9.default.writeFileSync(
|
|
4259
4330
|
`${sourceRoot}/README.md`,
|
|
4260
4331
|
`# ${app.name}
|
|
4261
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.
|
|
@@ -4707,9 +4778,6 @@ ApplicationCommand = __decorateClass([
|
|
|
4707
4778
|
], ApplicationCommand);
|
|
4708
4779
|
|
|
4709
4780
|
// pkgs/@akanjs/cli/src/package/package.runner.ts
|
|
4710
|
-
var esbuild2 = __toESM(require("esbuild"));
|
|
4711
|
-
var import_esbuild_plugin_d = require("esbuild-plugin-d.ts");
|
|
4712
|
-
var import_fs11 = __toESM(require("fs"));
|
|
4713
4781
|
var import_promises3 = __toESM(require("fs/promises"));
|
|
4714
4782
|
var PackageRunner = class {
|
|
4715
4783
|
async version(workspace) {
|
|
@@ -4735,114 +4803,137 @@ var PackageRunner = class {
|
|
|
4735
4803
|
async buildPackage(pkg) {
|
|
4736
4804
|
const rootPackageJson = pkg.workspace.readJson("package.json");
|
|
4737
4805
|
const pkgJson = pkg.readJson("package.json");
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
if (pkg.name === "@akanjs/config") {
|
|
4742
|
-
buildResult = await esbuild2.build({
|
|
4743
|
-
write: false,
|
|
4744
|
-
entryPoints: [`${pkg.cwdPath}/**/*.ts`],
|
|
4745
|
-
bundle: false,
|
|
4746
|
-
packages: "external",
|
|
4747
|
-
format: "cjs",
|
|
4748
|
-
outdir: pkg.dist.cwdPath,
|
|
4749
|
-
logLevel: "error",
|
|
4750
|
-
outExtension: { ".js": pkgJson.type === "module" ? ".cjs" : ".js" },
|
|
4751
|
-
plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
|
|
4752
|
-
});
|
|
4753
|
-
await esbuild2.build({
|
|
4754
|
-
write: true,
|
|
4755
|
-
entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.css`, `${pkg.cwdPath}/**/*.js`],
|
|
4756
|
-
bundle: false,
|
|
4757
|
-
packages: "external",
|
|
4758
|
-
format: "esm",
|
|
4759
|
-
outdir: pkg.dist.cwdPath,
|
|
4760
|
-
logLevel: "error",
|
|
4761
|
-
outExtension: { ".js": pkgJson.type === "module" ? ".js" : ".mjs" },
|
|
4762
|
-
loader: { ".css": "copy", ".js": "copy" }
|
|
4763
|
-
});
|
|
4764
|
-
} else if (pkg.name === "@akanjs/cli") {
|
|
4765
|
-
buildResult = await esbuild2.build({
|
|
4766
|
-
write: false,
|
|
4767
|
-
entryPoints: [`${pkg.cwdPath}/index.ts`, `${pkg.cwdPath}/README.md`],
|
|
4806
|
+
const builder = new Builder({ executor: pkg, distExecutor: pkg.dist, pkgJson, rootPackageJson });
|
|
4807
|
+
if (pkg.name === "@akanjs/cli") {
|
|
4808
|
+
await builder.build({
|
|
4768
4809
|
bundle: true,
|
|
4769
|
-
|
|
4770
|
-
packages: "external",
|
|
4771
|
-
outdir: pkg.dist.cwdPath,
|
|
4772
|
-
logLevel: "error",
|
|
4773
|
-
plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })],
|
|
4774
|
-
loader: { ".md": "copy" }
|
|
4810
|
+
additionalEntryPoints: [`${pkg.cwdPath}/src/templates/**/*.ts`, `${pkg.cwdPath}/src/templates/**/*.tsx`]
|
|
4775
4811
|
});
|
|
4776
|
-
await esbuild2.build({
|
|
4777
|
-
write: true,
|
|
4778
|
-
entryPoints: [`${pkg.cwdPath}/src/templates/**/*.ts`, `${pkg.cwdPath}/src/templates/**/*.tsx`],
|
|
4779
|
-
packages: "external",
|
|
4780
|
-
outdir: `${pkg.dist.cwdPath}/src/templates`,
|
|
4781
|
-
outbase: `${pkg.cwdPath}/src/templates`,
|
|
4782
|
-
format: "cjs",
|
|
4783
|
-
platform: "node",
|
|
4784
|
-
footer: { js: "module.exports = module.exports.default;" }
|
|
4785
|
-
});
|
|
4786
|
-
await pkg.workspace.exec(
|
|
4787
|
-
`rsync -aq --exclude="*.ts" --exclude="*.tsx" ${pkg.cwdPath}/src/templates/ ${pkg.dist.cwdPath}/src/templates/`
|
|
4788
|
-
);
|
|
4789
4812
|
} else {
|
|
4790
|
-
|
|
4791
|
-
"@akanjs/devkit",
|
|
4792
|
-
"@akanjs/document",
|
|
4793
|
-
"@akanjs/lint",
|
|
4794
|
-
"@akanjs/nest",
|
|
4795
|
-
"@akanjs/server",
|
|
4796
|
-
"@akanjs/service"
|
|
4797
|
-
].includes(pkg.name) ? "node" : ["@akanjs/client", "@akanjs/next", "@akanjs/store", "@akanjs/ui"].includes(pkg.name) ? "browser" : "neutral";
|
|
4798
|
-
buildResult = await esbuild2.build({
|
|
4799
|
-
write: false,
|
|
4800
|
-
entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.tsx`],
|
|
4801
|
-
bundle: false,
|
|
4802
|
-
packages: "external",
|
|
4803
|
-
splitting: false,
|
|
4804
|
-
platform,
|
|
4805
|
-
format: "cjs",
|
|
4806
|
-
outdir: pkg.dist.cwdPath,
|
|
4807
|
-
outExtension: { ".js": pkgJson.type === "module" ? ".cjs" : ".js" },
|
|
4808
|
-
logLevel: "error",
|
|
4809
|
-
plugins: [(0, import_esbuild_plugin_d.dtsPlugin)({ tsconfig: `${pkg.cwdPath}/tsconfig.json` })]
|
|
4810
|
-
});
|
|
4811
|
-
await esbuild2.build({
|
|
4812
|
-
write: true,
|
|
4813
|
-
entryPoints: [`${pkg.cwdPath}/**/*.ts`, `${pkg.cwdPath}/**/*.tsx`],
|
|
4814
|
-
bundle: false,
|
|
4815
|
-
packages: "external",
|
|
4816
|
-
splitting: false,
|
|
4817
|
-
platform,
|
|
4818
|
-
format: "esm",
|
|
4819
|
-
outdir: pkg.dist.cwdPath,
|
|
4820
|
-
outExtension: { ".js": pkgJson.type === "module" ? ".js" : ".mjs" },
|
|
4821
|
-
logLevel: "error",
|
|
4822
|
-
plugins: []
|
|
4823
|
-
});
|
|
4813
|
+
await builder.build();
|
|
4824
4814
|
}
|
|
4825
|
-
const dependencies = buildResult.outputFiles ? extractDependencies(buildResult.outputFiles, rootPackageJson, Object.keys(pkgJson.dependencies ?? {})) : {};
|
|
4826
|
-
const pkgPackageJson = {
|
|
4827
|
-
...pkgJson,
|
|
4828
|
-
main: "./index.js",
|
|
4829
|
-
engines: { node: ">=22" },
|
|
4830
|
-
dependencies,
|
|
4831
|
-
...["@akanjs/cli"].includes(pkg.name) ? {} : {
|
|
4832
|
-
exports: {
|
|
4833
|
-
".": {
|
|
4834
|
-
require: pkgJson.type === "module" ? "./index.cjs" : "./index.js",
|
|
4835
|
-
import: pkgJson.type === "module" ? "./index.js" : "./index.mjs"
|
|
4836
|
-
},
|
|
4837
|
-
...pkgJson.exports ?? {}
|
|
4838
|
-
}
|
|
4839
|
-
}
|
|
4840
|
-
};
|
|
4841
|
-
if (buildResult.outputFiles)
|
|
4842
|
-
buildResult.outputFiles.map((file) => pkg.dist.writeFile(file.path, file.text));
|
|
4843
|
-
pkg.dist.writeJson("package.json", pkgPackageJson);
|
|
4844
|
-
pkg.writeJson("package.json", pkgPackageJson);
|
|
4845
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
|
+
// }
|
|
4846
4937
|
};
|
|
4847
4938
|
|
|
4848
4939
|
// pkgs/@akanjs/cli/src/package/package.script.ts
|
|
@@ -5123,7 +5214,7 @@ LibraryCommand = __decorateClass([
|
|
|
5123
5214
|
|
|
5124
5215
|
// pkgs/@akanjs/cli/src/module/module.script.ts
|
|
5125
5216
|
var import_prompts8 = require("@inquirer/prompts");
|
|
5126
|
-
var
|
|
5217
|
+
var import_fs10 = __toESM(require("fs"));
|
|
5127
5218
|
|
|
5128
5219
|
// pkgs/@akanjs/cli/src/module/module.runner.ts
|
|
5129
5220
|
var ModuleRunner = class {
|
|
@@ -5322,7 +5413,7 @@ var ModuleScript = class {
|
|
|
5322
5413
|
return;
|
|
5323
5414
|
const Name = capitalize(name);
|
|
5324
5415
|
const relatedCnsts = getRelatedCnsts(`${sys2.cwdPath}/lib/${name}/${name}.constant.ts`);
|
|
5325
|
-
const constant =
|
|
5416
|
+
const constant = import_fs10.default.readFileSync(`${sys2.cwdPath}/lib/${name}/${name}.constant.ts`, "utf-8");
|
|
5326
5417
|
const session = new AiSession();
|
|
5327
5418
|
const promptRst = requestView({
|
|
5328
5419
|
sysName: sys2.name,
|
|
@@ -5333,8 +5424,8 @@ var ModuleScript = class {
|
|
|
5333
5424
|
exampleFiles: randomPicks(unitExampleFiles, Math.min(10, unitExampleFiles.length))
|
|
5334
5425
|
});
|
|
5335
5426
|
const content = await session.editTypescript(promptRst);
|
|
5336
|
-
|
|
5337
|
-
|
|
5427
|
+
import_fs10.default.writeFileSync(`${sys2.cwdPath}/prompt.txt`, promptRst);
|
|
5428
|
+
import_fs10.default.writeFileSync(`${sys2.cwdPath}/result.txt`, content);
|
|
5338
5429
|
}
|
|
5339
5430
|
async createView(sys2) {
|
|
5340
5431
|
const libs = await sys2.getModules();
|
|
@@ -5353,7 +5444,7 @@ var ModuleScript = class {
|
|
|
5353
5444
|
const viewExampleFiles = (await sys2.getViewsSourceCode()).filter((f) => f.filepath.includes(`${name}.View.tsx`));
|
|
5354
5445
|
const Name = capitalize(name);
|
|
5355
5446
|
const relatedCnsts = getRelatedCnsts(`${sys2.cwdPath}/lib/${name}/${name}.constant.ts`);
|
|
5356
|
-
const constant =
|
|
5447
|
+
const constant = import_fs10.default.readFileSync(`${sys2.cwdPath}/lib/${name}/${name}.constant.ts`, "utf-8");
|
|
5357
5448
|
const session = new AiSession();
|
|
5358
5449
|
const promptRst = requestView({
|
|
5359
5450
|
sysName: sys2.name,
|
|
@@ -5364,8 +5455,8 @@ var ModuleScript = class {
|
|
|
5364
5455
|
exampleFiles: randomPicks(viewExampleFiles, Math.min(20, viewExampleFiles.length))
|
|
5365
5456
|
});
|
|
5366
5457
|
const content = await session.editTypescript(promptRst);
|
|
5367
|
-
|
|
5368
|
-
|
|
5458
|
+
import_fs10.default.writeFileSync(`${sys2.cwdPath}/prompt.txt`, promptRst);
|
|
5459
|
+
import_fs10.default.writeFileSync(`${sys2.cwdPath}/result.txt`, content);
|
|
5369
5460
|
}
|
|
5370
5461
|
};
|
|
5371
5462
|
|
|
@@ -5669,5 +5760,4 @@ void runCommands(
|
|
|
5669
5760
|
//! 2. csr폴더를 현 위치로 복사 후 압축 후 삭제
|
|
5670
5761
|
//! execSync를 가져오기 싫으니 일단 2번 방법으로 해보자
|
|
5671
5762
|
//! add path in tsconfig.json
|
|
5672
|
-
//! Temporary fix for barrel library
|
|
5673
5763
|
//! 파일을 {name}.View.tsx에 저장.
|