@geekmidas/cli 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/{CronGenerator-BPTqNYOR.d.cts → CronGenerator-DWS3CCZt.d.cts} +4 -4
- package/dist/{CronGenerator-YAj59JUd.d.mts → CronGenerator-DZjdkEjI.d.mts} +4 -4
- package/dist/{EndpointGenerator-ChAD1INz.d.cts → EndpointGenerator-Dh7kMtuL.d.mts} +4 -4
- package/dist/{EndpointGenerator-Cj3O1U8-.d.mts → EndpointGenerator-zBsie_7s.d.cts} +4 -4
- package/dist/{FunctionGenerator-429-9NER.d.cts → FunctionGenerator-BmDHo27U.d.mts} +4 -4
- package/dist/{FunctionGenerator-BQ4ehoID.d.mts → FunctionGenerator-DXjXBxUd.d.cts} +4 -4
- package/dist/{Generator-BjHK_qce.d.mts → Generator-BGY-2dgI.d.cts} +3 -3
- package/dist/{Generator-DxQMCQp7.d.cts → Generator-yi9DH5TN.d.mts} +3 -3
- package/dist/{OpenApiTsGenerator-C4mHHaku.mjs → OpenApiTsGenerator-0ZDYWro5.mjs} +1 -1
- package/dist/{OpenApiTsGenerator-C4mHHaku.mjs.map → OpenApiTsGenerator-0ZDYWro5.mjs.map} +1 -1
- package/dist/{OpenApiTsGenerator-Be-sKGTT.cjs → OpenApiTsGenerator-wLwpaq_I.cjs} +1 -1
- package/dist/{OpenApiTsGenerator-Be-sKGTT.cjs.map → OpenApiTsGenerator-wLwpaq_I.cjs.map} +1 -1
- package/dist/{SubscriberGenerator-7uX42xyG.d.mts → SubscriberGenerator-Bb-z3Kvx.d.cts} +4 -4
- package/dist/{SubscriberGenerator-Dtb3HS4i.d.cts → SubscriberGenerator-CwsXqCpS.d.mts} +4 -4
- package/dist/{api-BKIN0s0S.mjs → api-Bp5TIl1R.mjs} +29 -46
- package/dist/api-Bp5TIl1R.mjs.map +1 -0
- package/dist/{api-B3SCEHPf.cjs → api-D4W9-tdZ.cjs} +29 -46
- package/dist/api-D4W9-tdZ.cjs.map +1 -0
- package/dist/build/index.cjs +5 -3
- package/dist/build/index.d.cts +1 -1
- package/dist/build/index.d.mts +1 -1
- package/dist/build/index.mjs +5 -3
- package/dist/build/manifests.cjs +1 -1
- package/dist/build/manifests.d.cts +1 -1
- package/dist/build/manifests.d.mts +1 -1
- package/dist/build/manifests.mjs +1 -1
- package/dist/build/providerResolver.d.cts +1 -1
- package/dist/build/providerResolver.d.mts +1 -1
- package/dist/build/types.d.cts +2 -2
- package/dist/build/types.d.mts +2 -2
- package/dist/{build-B8C_qHir.mjs → build-BLriHKgm.mjs} +3 -3
- package/dist/{build-B8C_qHir.mjs.map → build-BLriHKgm.mjs.map} +1 -1
- package/dist/{build-D0Wr49bf.cjs → build-Z3yGHcy2.cjs} +3 -3
- package/dist/{build-D0Wr49bf.cjs.map → build-Z3yGHcy2.cjs.map} +1 -1
- package/dist/{config-CLEDqKO3.cjs → config-BP1IZynR.cjs} +17 -6
- package/dist/config-BP1IZynR.cjs.map +1 -0
- package/dist/{config-Ba-Gbpbc.d.cts → config-CIzRhm_D.d.mts} +2 -2
- package/dist/{config-DBsmMDhf.d.mts → config-CvehIYsb.d.cts} +2 -2
- package/dist/{config-Dp8RonV_.mjs → config-UCK12Lrr.mjs} +17 -6
- package/dist/config-UCK12Lrr.mjs.map +1 -0
- package/dist/config.d.cts +1 -1
- package/dist/config.d.mts +1 -1
- package/dist/dev/index.cjs +3 -1
- package/dist/dev/index.d.cts +2 -2
- package/dist/dev/index.d.mts +2 -2
- package/dist/dev/index.mjs +3 -1
- package/dist/{dev-B734w3L1.mjs → dev-BimlVcuk.mjs} +6 -1
- package/dist/dev-BimlVcuk.mjs.map +1 -0
- package/dist/{dev-DHqYn8k4.cjs → dev-Dcrb_ZSL.cjs} +6 -1
- package/dist/dev-Dcrb_ZSL.cjs.map +1 -0
- package/dist/{docker-5d8Yh5_X.cjs → docker-2-ipZDOJ.cjs} +1 -1
- package/dist/{docker-5d8Yh5_X.cjs.map → docker-2-ipZDOJ.cjs.map} +1 -1
- package/dist/{docker-DlUqdFle.mjs → docker-31GNwU3F.mjs} +1 -1
- package/dist/{docker-DlUqdFle.mjs.map → docker-31GNwU3F.mjs.map} +1 -1
- package/dist/{env-HfuJRlg5.d.cts → env-CQ3hXAAW.d.mts} +2 -2
- package/dist/{env-B-OKjgI4.cjs → env-CS0jvg7k.cjs} +1 -1
- package/dist/{env-B-OKjgI4.cjs.map → env-CS0jvg7k.cjs.map} +1 -1
- package/dist/{env-nd-iQPYM.d.mts → env-D4YFgMqo.d.cts} +2 -2
- package/dist/{env-tv1HlZlw.mjs → env-DEeVOvVu.mjs} +1 -1
- package/dist/{env-tv1HlZlw.mjs.map → env-DEeVOvVu.mjs.map} +1 -1
- package/dist/generators/CronGenerator.d.cts +4 -4
- package/dist/generators/CronGenerator.d.mts +4 -4
- package/dist/generators/EndpointGenerator.d.cts +4 -4
- package/dist/generators/EndpointGenerator.d.mts +4 -4
- package/dist/generators/FunctionGenerator.d.cts +4 -4
- package/dist/generators/FunctionGenerator.d.mts +4 -4
- package/dist/generators/Generator.d.cts +3 -3
- package/dist/generators/Generator.d.mts +3 -3
- package/dist/generators/OpenApiTsGenerator.cjs +1 -1
- package/dist/generators/OpenApiTsGenerator.mjs +1 -1
- package/dist/generators/SubscriberGenerator.d.cts +4 -4
- package/dist/generators/SubscriberGenerator.d.mts +4 -4
- package/dist/generators/index.d.cts +7 -7
- package/dist/generators/index.d.mts +7 -7
- package/dist/{index-C523No_B.d.mts → index-DG6xNQMH.d.cts} +25 -8
- package/dist/{index-DrzN4xkQ.d.cts → index-DZgrOOOW.d.mts} +25 -8
- package/dist/index.cjs +21 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +21 -21
- package/dist/index.mjs.map +1 -1
- package/dist/init/generators/config.cjs +1 -1
- package/dist/init/generators/config.d.cts +2 -2
- package/dist/init/generators/config.d.mts +2 -2
- package/dist/init/generators/config.mjs +1 -1
- package/dist/init/generators/docker.cjs +1 -1
- package/dist/init/generators/docker.d.cts +1 -1
- package/dist/init/generators/docker.d.mts +1 -1
- package/dist/init/generators/docker.mjs +1 -1
- package/dist/init/generators/env.cjs +1 -1
- package/dist/init/generators/env.d.cts +2 -2
- package/dist/init/generators/env.d.mts +2 -2
- package/dist/init/generators/env.mjs +1 -1
- package/dist/init/generators/index.cjs +9 -4
- package/dist/init/generators/index.d.cts +5 -5
- package/dist/init/generators/index.d.mts +5 -5
- package/dist/init/generators/index.mjs +9 -4
- package/dist/init/generators/models.cjs +1 -1
- package/dist/init/generators/models.d.cts +1 -1
- package/dist/init/generators/models.d.mts +1 -1
- package/dist/init/generators/models.mjs +1 -1
- package/dist/init/generators/monorepo.cjs +1 -1
- package/dist/init/generators/monorepo.d.cts +1 -1
- package/dist/init/generators/monorepo.d.mts +1 -1
- package/dist/init/generators/monorepo.mjs +1 -1
- package/dist/init/generators/package.cjs +6 -1
- package/dist/init/generators/package.d.cts +2 -2
- package/dist/init/generators/package.d.mts +2 -2
- package/dist/init/generators/package.mjs +6 -1
- package/dist/init/generators/source.cjs +1 -1
- package/dist/init/generators/source.d.cts +2 -2
- package/dist/init/generators/source.d.mts +2 -2
- package/dist/init/generators/source.mjs +1 -1
- package/dist/init/index.cjs +14 -14
- package/dist/init/index.d.cts +1 -1
- package/dist/init/index.d.mts +1 -1
- package/dist/init/index.mjs +14 -14
- package/dist/init/templates/api.cjs +1 -1
- package/dist/init/templates/api.d.cts +1 -1
- package/dist/init/templates/api.d.mts +1 -1
- package/dist/init/templates/api.mjs +1 -1
- package/dist/init/templates/index.cjs +8 -6
- package/dist/init/templates/index.d.cts +2 -2
- package/dist/init/templates/index.d.mts +2 -2
- package/dist/init/templates/index.mjs +6 -6
- package/dist/init/templates/minimal.cjs +1 -1
- package/dist/init/templates/minimal.d.cts +1 -1
- package/dist/init/templates/minimal.d.mts +1 -1
- package/dist/init/templates/minimal.mjs +1 -1
- package/dist/init/templates/serverless.cjs +1 -1
- package/dist/init/templates/serverless.d.cts +1 -1
- package/dist/init/templates/serverless.d.mts +1 -1
- package/dist/init/templates/serverless.mjs +1 -1
- package/dist/init/templates/worker.cjs +1 -1
- package/dist/init/templates/worker.d.cts +1 -1
- package/dist/init/templates/worker.d.mts +1 -1
- package/dist/init/templates/worker.mjs +1 -1
- package/dist/init/utils.cjs +1 -1
- package/dist/init/utils.mjs +1 -1
- package/dist/{init-CtOnZn3G.mjs → init-BMA7xi8r.mjs} +37 -21
- package/dist/init-BMA7xi8r.mjs.map +1 -0
- package/dist/{init-qLFsWR-R.cjs → init-D-7WEk-b.cjs} +37 -21
- package/dist/init-D-7WEk-b.cjs.map +1 -0
- package/dist/{manifests-DIA_2QYd.mjs → manifests-BNKG6AXf.mjs} +1 -1
- package/dist/{manifests-DIA_2QYd.mjs.map → manifests-BNKG6AXf.mjs.map} +1 -1
- package/dist/{manifests-VJ9-2JpW.cjs → manifests-D13Ej8AE.cjs} +1 -1
- package/dist/{manifests-VJ9-2JpW.cjs.map → manifests-D13Ej8AE.cjs.map} +1 -1
- package/dist/{minimal-C4GsE45s.mjs → minimal-BkyASH_C.mjs} +15 -9
- package/dist/minimal-BkyASH_C.mjs.map +1 -0
- package/dist/{minimal-Bdhhpp7v.cjs → minimal-CSFggzdH.cjs} +15 -9
- package/dist/minimal-CSFggzdH.cjs.map +1 -0
- package/dist/{models-cvNg6Oea.mjs → models-BWlDfviw.mjs} +1 -1
- package/dist/{models-cvNg6Oea.mjs.map → models-BWlDfviw.mjs.map} +1 -1
- package/dist/{models-DyNwdOcz.cjs → models-BapGSoHC.cjs} +1 -1
- package/dist/{models-DyNwdOcz.cjs.map → models-BapGSoHC.cjs.map} +1 -1
- package/dist/{monorepo-Cknwzj5C.mjs → monorepo-BBOWhkcd.mjs} +1 -1
- package/dist/{monorepo-Cknwzj5C.mjs.map → monorepo-BBOWhkcd.mjs.map} +1 -1
- package/dist/{monorepo-sEK8gW59.cjs → monorepo-CFtxHeDh.cjs} +1 -1
- package/dist/{monorepo-sEK8gW59.cjs.map → monorepo-CFtxHeDh.cjs.map} +1 -1
- package/dist/openapi-CTae4ybf.cjs +98 -0
- package/dist/openapi-CTae4ybf.cjs.map +1 -0
- package/dist/openapi-Dn9MeKg3.mjs +74 -0
- package/dist/openapi-Dn9MeKg3.mjs.map +1 -0
- package/dist/{openapi-react-query-DxHjXQvg.cjs → openapi-react-query-Cp-w8_05.cjs} +1 -1
- package/dist/{openapi-react-query-DxHjXQvg.cjs.map → openapi-react-query-Cp-w8_05.cjs.map} +1 -1
- package/dist/{openapi-react-query-o7Mp1Jd5.mjs → openapi-react-query-_-B3s8v_.mjs} +1 -1
- package/dist/{openapi-react-query-o7Mp1Jd5.mjs.map → openapi-react-query-_-B3s8v_.mjs.map} +1 -1
- package/dist/openapi-react-query.cjs +1 -1
- package/dist/openapi-react-query.mjs +1 -1
- package/dist/openapi.cjs +6 -3
- package/dist/openapi.d.cts +23 -3
- package/dist/openapi.d.mts +23 -3
- package/dist/openapi.mjs +3 -3
- package/dist/{package-C7WhWU8m.d.mts → package-6h-7QfJZ.d.cts} +2 -2
- package/dist/{package-DvWEMz6z.d.cts → package-BCe_KvGv.d.mts} +2 -2
- package/dist/{package-CIfmeuSW.mjs → package-C3If80n1.mjs} +7 -1
- package/dist/package-C3If80n1.mjs.map +1 -0
- package/dist/{package-PP-o1nvq.cjs → package-Dk8IMBOB.cjs} +6 -1
- package/dist/package-Dk8IMBOB.cjs.map +1 -0
- package/dist/{serverless-Yav3GRVz.cjs → serverless-AGOS-l3G.cjs} +15 -10
- package/dist/serverless-AGOS-l3G.cjs.map +1 -0
- package/dist/{serverless-DkHBF2vC.mjs → serverless-D5HjJByU.mjs} +15 -10
- package/dist/serverless-D5HjJByU.mjs.map +1 -0
- package/dist/{source-DT5Xhiob.cjs → source-C1cyfHcF.cjs} +1 -1
- package/dist/{source-DT5Xhiob.cjs.map → source-C1cyfHcF.cjs.map} +1 -1
- package/dist/{source-D6v2BnKT.d.mts → source-C3LiNUV9.d.mts} +2 -2
- package/dist/{source-DnaH_MLA.mjs → source-CkQHBpwu.mjs} +1 -1
- package/dist/{source-DnaH_MLA.mjs.map → source-CkQHBpwu.mjs.map} +1 -1
- package/dist/{source-D8fK9qRo.d.cts → source-Dtcjbokc.d.cts} +2 -2
- package/dist/templates-C0EMmhwb.mjs +88 -0
- package/dist/templates-C0EMmhwb.mjs.map +1 -0
- package/dist/templates-CbgQ9dw0.cjs +123 -0
- package/dist/templates-CbgQ9dw0.cjs.map +1 -0
- package/dist/{types-Cxl8-uwV.d.mts → types-Bi7VzDUZ.d.mts} +31 -2
- package/dist/{types-C4KITv-y.d.mts → types-D2xYkOal.d.mts} +2 -2
- package/dist/{types-DLFN49M3.d.cts → types-DA-r8HWZ.d.cts} +2 -2
- package/dist/{types-DB99_qIy.d.cts → types-KmjzMgu8.d.cts} +31 -2
- package/dist/types.d.cts +2 -2
- package/dist/types.d.mts +2 -2
- package/dist/{utils-C31-SWHP.mjs → utils-CKEzCxc1.mjs} +1 -1
- package/dist/{utils-C31-SWHP.mjs.map → utils-CKEzCxc1.mjs.map} +1 -1
- package/dist/{utils-BX3F4fT8.cjs → utils-DSdN2MTt.cjs} +1 -1
- package/dist/{utils-BX3F4fT8.cjs.map → utils-DSdN2MTt.cjs.map} +1 -1
- package/dist/{worker--8O5a3Hv.cjs → worker-CGhlqNH-.cjs} +15 -9
- package/dist/worker-CGhlqNH-.cjs.map +1 -0
- package/dist/{worker-Jme7uOOJ.mjs → worker-CiP420As.mjs} +15 -9
- package/dist/worker-CiP420As.mjs.map +1 -0
- package/examples/gkm.config.ts +3 -5
- package/package.json +4 -4
- package/src/__tests__/openapi.spec.ts +395 -302
- package/src/dev/__tests__/index.spec.ts +114 -119
- package/src/dev/index.ts +18 -0
- package/src/init/generators/config.ts +23 -5
- package/src/init/generators/package.ts +11 -4
- package/src/init/index.ts +26 -7
- package/src/init/templates/api.ts +38 -56
- package/src/init/templates/index.ts +46 -11
- package/src/init/templates/minimal.ts +23 -10
- package/src/init/templates/serverless.ts +23 -11
- package/src/init/templates/worker.ts +23 -10
- package/src/openapi.ts +83 -45
- package/src/types.ts +30 -0
- package/dist/api-B3SCEHPf.cjs.map +0 -1
- package/dist/api-BKIN0s0S.mjs.map +0 -1
- package/dist/config-CLEDqKO3.cjs.map +0 -1
- package/dist/config-Dp8RonV_.mjs.map +0 -1
- package/dist/dev-B734w3L1.mjs.map +0 -1
- package/dist/dev-DHqYn8k4.cjs.map +0 -1
- package/dist/init-CtOnZn3G.mjs.map +0 -1
- package/dist/init-qLFsWR-R.cjs.map +0 -1
- package/dist/minimal-Bdhhpp7v.cjs.map +0 -1
- package/dist/minimal-C4GsE45s.mjs.map +0 -1
- package/dist/openapi-BQWPWyNB.cjs +0 -56
- package/dist/openapi-BQWPWyNB.cjs.map +0 -1
- package/dist/openapi-DBX8cJJ8.mjs +0 -50
- package/dist/openapi-DBX8cJJ8.mjs.map +0 -1
- package/dist/package-CIfmeuSW.mjs.map +0 -1
- package/dist/package-PP-o1nvq.cjs.map +0 -1
- package/dist/serverless-DkHBF2vC.mjs.map +0 -1
- package/dist/serverless-Yav3GRVz.cjs.map +0 -1
- package/dist/templates-CBFUwpBy.mjs +0 -64
- package/dist/templates-CBFUwpBy.mjs.map +0 -1
- package/dist/templates-DM_rtYYW.cjs +0 -87
- package/dist/templates-DM_rtYYW.cjs.map +0 -1
- package/dist/worker--8O5a3Hv.cjs.map +0 -1
- package/dist/worker-Jme7uOOJ.mjs.map +0 -1
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
require('../../api-D4W9-tdZ.cjs');
|
|
2
|
+
require('../../minimal-CSFggzdH.cjs');
|
|
3
|
+
require('../../serverless-AGOS-l3G.cjs');
|
|
4
|
+
require('../../worker-CGhlqNH-.cjs');
|
|
5
|
+
require('../../templates-CbgQ9dw0.cjs');
|
|
6
|
+
const require_package = require('../../package-Dk8IMBOB.cjs');
|
|
2
7
|
|
|
3
8
|
exports.generatePackageJson = require_package.generatePackageJson;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../../index-
|
|
2
|
-
import { generatePackageJson } from "../../package-
|
|
1
|
+
import "../../index-DG6xNQMH.cjs";
|
|
2
|
+
import { generatePackageJson } from "../../package-6h-7QfJZ.cjs";
|
|
3
3
|
export { generatePackageJson };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../../index-
|
|
2
|
-
import { generatePackageJson } from "../../package-
|
|
1
|
+
import "../../index-DZgrOOOW.mjs";
|
|
2
|
+
import { generatePackageJson } from "../../package-BCe_KvGv.mjs";
|
|
3
3
|
export { generatePackageJson };
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "../../api-Bp5TIl1R.mjs";
|
|
2
|
+
import "../../minimal-BkyASH_C.mjs";
|
|
3
|
+
import "../../serverless-D5HjJByU.mjs";
|
|
4
|
+
import "../../worker-CiP420As.mjs";
|
|
5
|
+
import "../../templates-C0EMmhwb.mjs";
|
|
6
|
+
import { generatePackageJson } from "../../package-C3If80n1.mjs";
|
|
2
7
|
|
|
3
8
|
export { generatePackageJson };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../../index-
|
|
2
|
-
import { generateSourceFiles } from "../../source-
|
|
1
|
+
import "../../index-DG6xNQMH.cjs";
|
|
2
|
+
import { generateSourceFiles } from "../../source-Dtcjbokc.cjs";
|
|
3
3
|
export { generateSourceFiles };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../../index-
|
|
2
|
-
import { generateSourceFiles } from "../../source-
|
|
1
|
+
import "../../index-DZgrOOOW.mjs";
|
|
2
|
+
import { generateSourceFiles } from "../../source-C3LiNUV9.mjs";
|
|
3
3
|
export { generateSourceFiles };
|
package/dist/init/index.cjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
require('../config-
|
|
2
|
-
require('../docker-
|
|
3
|
-
require('../env-
|
|
4
|
-
require('../models-
|
|
5
|
-
require('../monorepo-
|
|
6
|
-
require('../
|
|
7
|
-
require('../
|
|
8
|
-
require('../
|
|
9
|
-
require('../
|
|
10
|
-
require('../
|
|
11
|
-
require('../
|
|
12
|
-
require('../
|
|
13
|
-
require('../utils-
|
|
14
|
-
const require_init = require('../init-
|
|
1
|
+
require('../config-BP1IZynR.cjs');
|
|
2
|
+
require('../docker-2-ipZDOJ.cjs');
|
|
3
|
+
require('../env-CS0jvg7k.cjs');
|
|
4
|
+
require('../models-BapGSoHC.cjs');
|
|
5
|
+
require('../monorepo-CFtxHeDh.cjs');
|
|
6
|
+
require('../api-D4W9-tdZ.cjs');
|
|
7
|
+
require('../minimal-CSFggzdH.cjs');
|
|
8
|
+
require('../serverless-AGOS-l3G.cjs');
|
|
9
|
+
require('../worker-CGhlqNH-.cjs');
|
|
10
|
+
require('../templates-CbgQ9dw0.cjs');
|
|
11
|
+
require('../package-Dk8IMBOB.cjs');
|
|
12
|
+
require('../source-C1cyfHcF.cjs');
|
|
13
|
+
require('../utils-DSdN2MTt.cjs');
|
|
14
|
+
const require_init = require('../init-D-7WEk-b.cjs');
|
|
15
15
|
|
|
16
16
|
exports.initCommand = require_init.initCommand;
|
package/dist/init/index.d.cts
CHANGED
package/dist/init/index.d.mts
CHANGED
package/dist/init/index.mjs
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import "../config-
|
|
2
|
-
import "../docker-
|
|
3
|
-
import "../env-
|
|
4
|
-
import "../models-
|
|
5
|
-
import "../monorepo-
|
|
6
|
-
import "../
|
|
7
|
-
import "../
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
12
|
-
import "../
|
|
13
|
-
import "../utils-
|
|
14
|
-
import { initCommand } from "../init-
|
|
1
|
+
import "../config-UCK12Lrr.mjs";
|
|
2
|
+
import "../docker-31GNwU3F.mjs";
|
|
3
|
+
import "../env-DEeVOvVu.mjs";
|
|
4
|
+
import "../models-BWlDfviw.mjs";
|
|
5
|
+
import "../monorepo-BBOWhkcd.mjs";
|
|
6
|
+
import "../api-Bp5TIl1R.mjs";
|
|
7
|
+
import "../minimal-BkyASH_C.mjs";
|
|
8
|
+
import "../serverless-D5HjJByU.mjs";
|
|
9
|
+
import "../worker-CiP420As.mjs";
|
|
10
|
+
import "../templates-C0EMmhwb.mjs";
|
|
11
|
+
import "../package-C3If80n1.mjs";
|
|
12
|
+
import "../source-CkQHBpwu.mjs";
|
|
13
|
+
import "../utils-CKEzCxc1.mjs";
|
|
14
|
+
import { initCommand } from "../init-BMA7xi8r.mjs";
|
|
15
15
|
|
|
16
16
|
export { initCommand };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
require('../../api-
|
|
2
|
-
require('../../minimal-
|
|
3
|
-
require('../../serverless-
|
|
4
|
-
require('../../worker
|
|
5
|
-
const require_templates = require('../../templates-
|
|
1
|
+
require('../../api-D4W9-tdZ.cjs');
|
|
2
|
+
require('../../minimal-CSFggzdH.cjs');
|
|
3
|
+
require('../../serverless-AGOS-l3G.cjs');
|
|
4
|
+
require('../../worker-CGhlqNH-.cjs');
|
|
5
|
+
const require_templates = require('../../templates-CbgQ9dw0.cjs');
|
|
6
6
|
|
|
7
|
+
exports.OPENAPI_OUTPUT_PATH = require_templates.OPENAPI_OUTPUT_PATH;
|
|
7
8
|
exports.getTemplate = require_templates.getTemplate;
|
|
8
|
-
exports.
|
|
9
|
+
exports.loggerTypeChoices = require_templates.loggerTypeChoices;
|
|
10
|
+
exports.routesStructureChoices = require_templates.routesStructureChoices;
|
|
9
11
|
exports.templateChoices = require_templates.templateChoices;
|
|
10
12
|
exports.templates = require_templates.templates;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GeneratedFile,
|
|
2
|
-
export { GeneratedFile,
|
|
1
|
+
import { GeneratedFile, LoggerType, OPENAPI_OUTPUT_PATH, RoutesStructure, TemplateConfig, TemplateName, TemplateOptions, getTemplate, loggerTypeChoices, routesStructureChoices, templateChoices, templates } from "../../index-DG6xNQMH.cjs";
|
|
2
|
+
export { GeneratedFile, LoggerType, OPENAPI_OUTPUT_PATH, RoutesStructure, TemplateConfig, TemplateName, TemplateOptions, getTemplate, loggerTypeChoices, routesStructureChoices, templateChoices, templates };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GeneratedFile,
|
|
2
|
-
export { GeneratedFile,
|
|
1
|
+
import { GeneratedFile, LoggerType, OPENAPI_OUTPUT_PATH, RoutesStructure, TemplateConfig, TemplateName, TemplateOptions, getTemplate, loggerTypeChoices, routesStructureChoices, templateChoices, templates } from "../../index-DZgrOOOW.mjs";
|
|
2
|
+
export { GeneratedFile, LoggerType, OPENAPI_OUTPUT_PATH, RoutesStructure, TemplateConfig, TemplateName, TemplateOptions, getTemplate, loggerTypeChoices, routesStructureChoices, templateChoices, templates };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import "../../api-
|
|
2
|
-
import "../../minimal-
|
|
3
|
-
import "../../serverless-
|
|
4
|
-
import "../../worker-
|
|
5
|
-
import { getTemplate,
|
|
1
|
+
import "../../api-Bp5TIl1R.mjs";
|
|
2
|
+
import "../../minimal-BkyASH_C.mjs";
|
|
3
|
+
import "../../serverless-D5HjJByU.mjs";
|
|
4
|
+
import "../../worker-CiP420As.mjs";
|
|
5
|
+
import { OPENAPI_OUTPUT_PATH, getTemplate, loggerTypeChoices, routesStructureChoices, templateChoices, templates } from "../../templates-C0EMmhwb.mjs";
|
|
6
6
|
|
|
7
|
-
export { getTemplate,
|
|
7
|
+
export { OPENAPI_OUTPUT_PATH, getTemplate, loggerTypeChoices, routesStructureChoices, templateChoices, templates };
|
package/dist/init/utils.cjs
CHANGED
package/dist/init/utils.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { checkDirectoryExists, detectPackageManager, getInstallCommand, getRunCommand, validateProjectName } from "../utils-
|
|
1
|
+
import { checkDirectoryExists, detectPackageManager, getInstallCommand, getRunCommand, validateProjectName } from "../utils-CKEzCxc1.mjs";
|
|
2
2
|
|
|
3
3
|
export { checkDirectoryExists, detectPackageManager, getInstallCommand, getRunCommand, validateProjectName };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { generateConfigFiles } from "./config-
|
|
2
|
-
import { generateDockerFiles } from "./docker-
|
|
3
|
-
import { generateEnvFiles } from "./env-
|
|
4
|
-
import { generateModelsPackage } from "./models-
|
|
5
|
-
import { generateMonorepoFiles } from "./monorepo-
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { checkDirectoryExists, detectPackageManager, getInstallCommand, getRunCommand, validateProjectName } from "./utils-
|
|
1
|
+
import { generateConfigFiles } from "./config-UCK12Lrr.mjs";
|
|
2
|
+
import { generateDockerFiles } from "./docker-31GNwU3F.mjs";
|
|
3
|
+
import { generateEnvFiles } from "./env-DEeVOvVu.mjs";
|
|
4
|
+
import { generateModelsPackage } from "./models-BWlDfviw.mjs";
|
|
5
|
+
import { generateMonorepoFiles } from "./monorepo-BBOWhkcd.mjs";
|
|
6
|
+
import { getTemplate, loggerTypeChoices, routesStructureChoices, templateChoices } from "./templates-C0EMmhwb.mjs";
|
|
7
|
+
import { generatePackageJson } from "./package-C3If80n1.mjs";
|
|
8
|
+
import { generateSourceFiles } from "./source-CkQHBpwu.mjs";
|
|
9
|
+
import { checkDirectoryExists, detectPackageManager, getInstallCommand, getRunCommand, validateProjectName } from "./utils-CKEzCxc1.mjs";
|
|
10
10
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
11
11
|
import { dirname, join } from "node:path";
|
|
12
12
|
import { execSync } from "node:child_process";
|
|
@@ -58,9 +58,16 @@ async function initCommand(projectName, options = {}) {
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
type: options.yes ? null : "select",
|
|
61
|
-
name: "
|
|
62
|
-
message: "
|
|
63
|
-
choices:
|
|
61
|
+
name: "loggerType",
|
|
62
|
+
message: "Logger:",
|
|
63
|
+
choices: loggerTypeChoices,
|
|
64
|
+
initial: 0
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
type: options.yes ? null : "select",
|
|
68
|
+
name: "routesStructure",
|
|
69
|
+
message: "Routes structure:",
|
|
70
|
+
choices: routesStructureChoices,
|
|
64
71
|
initial: 0
|
|
65
72
|
},
|
|
66
73
|
{
|
|
@@ -99,7 +106,8 @@ async function initCommand(projectName, options = {}) {
|
|
|
99
106
|
template: options.template || answers.template || "minimal",
|
|
100
107
|
telescope: options.yes ? true : answers.telescope ?? true,
|
|
101
108
|
database: options.yes ? true : answers.database ?? true,
|
|
102
|
-
|
|
109
|
+
loggerType: options.yes ? "pino" : answers.loggerType ?? "pino",
|
|
110
|
+
routesStructure: options.yes ? "centralized-endpoints" : answers.routesStructure ?? "centralized-endpoints",
|
|
103
111
|
monorepo,
|
|
104
112
|
apiPath: monorepo ? options.apiPath ?? answers.apiPath ?? "apps/api" : ""
|
|
105
113
|
};
|
|
@@ -129,17 +137,25 @@ async function initCommand(projectName, options = {}) {
|
|
|
129
137
|
await mkdir(dirname(fullPath), { recursive: true });
|
|
130
138
|
await writeFile(fullPath, content);
|
|
131
139
|
}
|
|
132
|
-
if (!options.skipInstall)
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
if (!options.skipInstall) {
|
|
141
|
+
try {
|
|
142
|
+
execSync(getInstallCommand(pkgManager), {
|
|
143
|
+
cwd: targetDir,
|
|
144
|
+
stdio: "inherit"
|
|
145
|
+
});
|
|
146
|
+
} catch {
|
|
147
|
+
console.error("\n Warning: Failed to install dependencies.");
|
|
148
|
+
}
|
|
149
|
+
try {
|
|
150
|
+
execSync("npx @biomejs/biome format --write --unsafe .", {
|
|
151
|
+
cwd: targetDir,
|
|
152
|
+
stdio: "inherit"
|
|
153
|
+
});
|
|
154
|
+
} catch {}
|
|
139
155
|
}
|
|
140
156
|
const devCommand = getRunCommand(pkgManager, "dev");
|
|
141
157
|
}
|
|
142
158
|
|
|
143
159
|
//#endregion
|
|
144
160
|
export { initCommand };
|
|
145
|
-
//# sourceMappingURL=init-
|
|
161
|
+
//# sourceMappingURL=init-BMA7xi8r.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-BMA7xi8r.mjs","names":["projectName?: string","options: InitOptions","value: string","templateOptions: TemplateOptions"],"sources":["../src/init/index.ts"],"sourcesContent":["import { execSync } from 'node:child_process';\nimport { mkdir, writeFile } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport prompts from 'prompts';\nimport { generateConfigFiles } from './generators/config.js';\nimport { generateDockerFiles } from './generators/docker.js';\nimport { generateEnvFiles } from './generators/env.js';\nimport { generateModelsPackage } from './generators/models.js';\nimport { generateMonorepoFiles } from './generators/monorepo.js';\nimport { generatePackageJson } from './generators/package.js';\nimport { generateSourceFiles } from './generators/source.js';\nimport {\n type TemplateName,\n type TemplateOptions,\n getTemplate,\n loggerTypeChoices,\n routesStructureChoices,\n templateChoices,\n} from './templates/index.js';\nimport {\n checkDirectoryExists,\n detectPackageManager,\n getInstallCommand,\n getRunCommand,\n validateProjectName,\n} from './utils.js';\n\nexport interface InitOptions {\n template?: TemplateName;\n skipInstall?: boolean;\n yes?: boolean;\n monorepo?: boolean;\n apiPath?: string;\n}\n\n/**\n * Main init command - scaffolds a new project\n */\nexport async function initCommand(\n projectName?: string,\n options: InitOptions = {},\n): Promise<void> {\n const cwd = process.cwd();\n const pkgManager = detectPackageManager(cwd);\n\n // Handle Ctrl+C gracefully\n prompts.override({});\n const onCancel = () => {\n process.exit(0);\n };\n\n // Gather answers via prompts\n const answers = await prompts(\n [\n {\n type: projectName ? null : 'text',\n name: 'name',\n message: 'Project name:',\n initial: 'my-api',\n validate: (value: string) => {\n const nameValid = validateProjectName(value);\n if (nameValid !== true) return nameValid;\n const dirValid = checkDirectoryExists(value, cwd);\n if (dirValid !== true) return dirValid;\n return true;\n },\n },\n {\n type: options.template || options.yes ? null : 'select',\n name: 'template',\n message: 'Template:',\n choices: templateChoices,\n initial: 0,\n },\n {\n type: options.yes ? null : 'confirm',\n name: 'telescope',\n message: 'Include Telescope (debugging dashboard)?',\n initial: true,\n },\n {\n type: options.yes ? null : 'confirm',\n name: 'database',\n message: 'Include database support (Kysely)?',\n initial: true,\n },\n {\n type: options.yes ? null : 'select',\n name: 'loggerType',\n message: 'Logger:',\n choices: loggerTypeChoices,\n initial: 0,\n },\n {\n type: options.yes ? null : 'select',\n name: 'routesStructure',\n message: 'Routes structure:',\n choices: routesStructureChoices,\n initial: 0,\n },\n {\n type: options.yes || options.monorepo !== undefined ? null : 'confirm',\n name: 'monorepo',\n message: 'Setup as monorepo?',\n initial: false,\n },\n {\n type: (prev) =>\n (prev === true || options.monorepo) && !options.apiPath\n ? 'text'\n : null,\n name: 'apiPath',\n message: 'API app path:',\n initial: 'apps/api',\n },\n ],\n { onCancel },\n );\n\n // Build final options\n const name = projectName || answers.name;\n if (!name) {\n console.error(' Error: Project name is required\\n');\n process.exit(1);\n }\n\n // Validate name if provided via argument\n if (projectName) {\n const nameValid = validateProjectName(projectName);\n if (nameValid !== true) {\n console.error(` Error: ${nameValid}\\n`);\n process.exit(1);\n }\n const dirValid = checkDirectoryExists(projectName, cwd);\n if (dirValid !== true) {\n console.error(` Error: ${dirValid}\\n`);\n process.exit(1);\n }\n }\n\n const monorepo =\n options.monorepo ?? (options.yes ? false : (answers.monorepo ?? false));\n const templateOptions: TemplateOptions = {\n name,\n template: options.template || answers.template || 'minimal',\n telescope: options.yes ? true : (answers.telescope ?? true),\n database: options.yes ? true : (answers.database ?? true),\n loggerType: options.yes ? 'pino' : (answers.loggerType ?? 'pino'),\n routesStructure: options.yes\n ? 'centralized-endpoints'\n : (answers.routesStructure ?? 'centralized-endpoints'),\n monorepo,\n apiPath: monorepo ? (options.apiPath ?? answers.apiPath ?? 'apps/api') : '',\n };\n\n const targetDir = join(cwd, name);\n const template = getTemplate(templateOptions.template);\n\n const isMonorepo = templateOptions.monorepo;\n const apiPath = templateOptions.apiPath;\n\n // Create project directory\n await mkdir(targetDir, { recursive: true });\n\n // For monorepo, app files go in the specified apiPath (e.g., apps/api)\n const appDir = isMonorepo ? join(targetDir, apiPath) : targetDir;\n if (isMonorepo) {\n await mkdir(appDir, { recursive: true });\n }\n\n // Collect app files\n const appFiles = [\n ...generatePackageJson(templateOptions, template),\n ...generateConfigFiles(templateOptions, template),\n ...generateEnvFiles(templateOptions, template),\n ...generateSourceFiles(templateOptions, template),\n ...generateDockerFiles(templateOptions, template),\n ];\n\n // Collect root monorepo files (includes packages/models)\n const rootFiles = [\n ...generateMonorepoFiles(templateOptions, template),\n ...generateModelsPackage(templateOptions),\n ];\n\n // Write root files (for monorepo)\n for (const { path, content } of rootFiles) {\n const fullPath = join(targetDir, path);\n await mkdir(dirname(fullPath), { recursive: true });\n await writeFile(fullPath, content);\n }\n\n // Write app files\n for (const { path, content } of appFiles) {\n const fullPath = join(appDir, path);\n const displayPath = isMonorepo ? `${apiPath}/${path}` : path;\n await mkdir(dirname(fullPath), { recursive: true });\n await writeFile(fullPath, content);\n }\n\n // Install dependencies\n if (!options.skipInstall) {\n try {\n execSync(getInstallCommand(pkgManager), {\n cwd: targetDir,\n stdio: 'inherit',\n });\n } catch {\n console.error('\\n Warning: Failed to install dependencies.');\n }\n\n // Format generated files with biome\n try {\n execSync('npx @biomejs/biome format --write --unsafe .', {\n cwd: targetDir,\n stdio: 'inherit',\n });\n } catch {\n // Silently ignore format errors\n }\n }\n\n // Print next steps\n const devCommand = getRunCommand(pkgManager, 'dev');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAsCA,eAAsB,YACpBA,aACAC,UAAuB,CAAE,GACV;CACf,MAAM,MAAM,QAAQ,KAAK;CACzB,MAAM,aAAa,qBAAqB,IAAI;AAG5C,SAAQ,SAAS,CAAE,EAAC;CACpB,MAAM,WAAW,MAAM;AACrB,UAAQ,KAAK,EAAE;CAChB;CAGD,MAAM,U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AAI,UAAU;EACxC,MAAM,WAAW,KAAK,QAAQ,KAAK;EACnC,MAAM,cAAc,cAAc,EAAE,QAAQ,GAAG,KAAK,IAAI;AACxD,QAAM,MAAM,QAAQ,SAAS,EAAE,EAAE,WAAW,KAAM,EAAC;AACnD,QAAM,UAAU,UAAU,QAAQ;CACnC;AAGD,MAAK,QAAQ,aAAa;AACxB,MAAI;AACF,YAAS,kBAAkB,WAAW,EAAE;IACtC,KAAK;IACL,OAAO;GACR,EAAC;EACH,QAAO;AACN,WAAQ,MAAM,+CAA+C;EAC9D;AAGD,MAAI;AACF,YAAS,gDAAgD;IACvD,KAAK;IACL,OAAO;GACR,EAAC;EACH,QAAO,CAEP;CACF;CAGD,MAAM,aAAa,cAAc,YAAY,MAAM;AACpD"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-CUT6urMc.cjs');
|
|
2
|
-
const require_config = require('./config-
|
|
3
|
-
const require_docker = require('./docker-
|
|
4
|
-
const require_env = require('./env-
|
|
5
|
-
const require_models = require('./models-
|
|
6
|
-
const require_monorepo = require('./monorepo-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const require_utils = require('./utils-
|
|
2
|
+
const require_config = require('./config-BP1IZynR.cjs');
|
|
3
|
+
const require_docker = require('./docker-2-ipZDOJ.cjs');
|
|
4
|
+
const require_env = require('./env-CS0jvg7k.cjs');
|
|
5
|
+
const require_models = require('./models-BapGSoHC.cjs');
|
|
6
|
+
const require_monorepo = require('./monorepo-CFtxHeDh.cjs');
|
|
7
|
+
const require_templates = require('./templates-CbgQ9dw0.cjs');
|
|
8
|
+
const require_package = require('./package-Dk8IMBOB.cjs');
|
|
9
|
+
const require_source = require('./source-C1cyfHcF.cjs');
|
|
10
|
+
const require_utils = require('./utils-DSdN2MTt.cjs');
|
|
11
11
|
const node_fs_promises = require_chunk.__toESM(require("node:fs/promises"));
|
|
12
12
|
const node_path = require_chunk.__toESM(require("node:path"));
|
|
13
13
|
const node_child_process = require_chunk.__toESM(require("node:child_process"));
|
|
@@ -59,9 +59,16 @@ async function initCommand(projectName, options = {}) {
|
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
type: options.yes ? null : "select",
|
|
62
|
-
name: "
|
|
63
|
-
message: "
|
|
64
|
-
choices: require_templates.
|
|
62
|
+
name: "loggerType",
|
|
63
|
+
message: "Logger:",
|
|
64
|
+
choices: require_templates.loggerTypeChoices,
|
|
65
|
+
initial: 0
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: options.yes ? null : "select",
|
|
69
|
+
name: "routesStructure",
|
|
70
|
+
message: "Routes structure:",
|
|
71
|
+
choices: require_templates.routesStructureChoices,
|
|
65
72
|
initial: 0
|
|
66
73
|
},
|
|
67
74
|
{
|
|
@@ -100,7 +107,8 @@ async function initCommand(projectName, options = {}) {
|
|
|
100
107
|
template: options.template || answers.template || "minimal",
|
|
101
108
|
telescope: options.yes ? true : answers.telescope ?? true,
|
|
102
109
|
database: options.yes ? true : answers.database ?? true,
|
|
103
|
-
|
|
110
|
+
loggerType: options.yes ? "pino" : answers.loggerType ?? "pino",
|
|
111
|
+
routesStructure: options.yes ? "centralized-endpoints" : answers.routesStructure ?? "centralized-endpoints",
|
|
104
112
|
monorepo,
|
|
105
113
|
apiPath: monorepo ? options.apiPath ?? answers.apiPath ?? "apps/api" : ""
|
|
106
114
|
};
|
|
@@ -130,13 +138,21 @@ async function initCommand(projectName, options = {}) {
|
|
|
130
138
|
await (0, node_fs_promises.mkdir)((0, node_path.dirname)(fullPath), { recursive: true });
|
|
131
139
|
await (0, node_fs_promises.writeFile)(fullPath, content);
|
|
132
140
|
}
|
|
133
|
-
if (!options.skipInstall)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
141
|
+
if (!options.skipInstall) {
|
|
142
|
+
try {
|
|
143
|
+
(0, node_child_process.execSync)(require_utils.getInstallCommand(pkgManager), {
|
|
144
|
+
cwd: targetDir,
|
|
145
|
+
stdio: "inherit"
|
|
146
|
+
});
|
|
147
|
+
} catch {
|
|
148
|
+
console.error("\n Warning: Failed to install dependencies.");
|
|
149
|
+
}
|
|
150
|
+
try {
|
|
151
|
+
(0, node_child_process.execSync)("npx @biomejs/biome format --write --unsafe .", {
|
|
152
|
+
cwd: targetDir,
|
|
153
|
+
stdio: "inherit"
|
|
154
|
+
});
|
|
155
|
+
} catch {}
|
|
140
156
|
}
|
|
141
157
|
const devCommand = require_utils.getRunCommand(pkgManager, "dev");
|
|
142
158
|
}
|
|
@@ -148,4 +164,4 @@ Object.defineProperty(exports, 'initCommand', {
|
|
|
148
164
|
return initCommand;
|
|
149
165
|
}
|
|
150
166
|
});
|
|
151
|
-
//# sourceMappingURL=init-
|
|
167
|
+
//# sourceMappingURL=init-D-7WEk-b.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-D-7WEk-b.cjs","names":["projectName?: string","options: InitOptions","value: string","templateChoices","loggerTypeChoices","routesStructureChoices","templateOptions: TemplateOptions"],"sources":["../src/init/index.ts"],"sourcesContent":["import { execSync } from 'node:child_process';\nimport { mkdir, writeFile } from 'node:fs/promises';\nimport { dirname, join } from 'node:path';\nimport prompts from 'prompts';\nimport { generateConfigFiles } from './generators/config.js';\nimport { generateDockerFiles } from './generators/docker.js';\nimport { generateEnvFiles } from './generators/env.js';\nimport { generateModelsPackage } from './generators/models.js';\nimport { generateMonorepoFiles } from './generators/monorepo.js';\nimport { generatePackageJson } from './generators/package.js';\nimport { generateSourceFiles } from './generators/source.js';\nimport {\n type TemplateName,\n type TemplateOptions,\n getTemplate,\n loggerTypeChoices,\n routesStructureChoices,\n templateChoices,\n} from './templates/index.js';\nimport {\n checkDirectoryExists,\n detectPackageManager,\n getInstallCommand,\n getRunCommand,\n validateProjectName,\n} from './utils.js';\n\nexport interface InitOptions {\n template?: TemplateName;\n skipInstall?: boolean;\n yes?: boolean;\n monorepo?: boolean;\n apiPath?: string;\n}\n\n/**\n * Main init command - scaffolds a new project\n */\nexport async function initCommand(\n projectName?: string,\n options: InitOptions = {},\n): Promise<void> {\n const cwd = process.cwd();\n const pkgManager = detectPackageManager(cwd);\n\n // Handle Ctrl+C gracefully\n prompts.override({});\n const onCancel = () => {\n process.exit(0);\n };\n\n // Gather answers via prompts\n const answers = await prompts(\n [\n {\n type: projectName ? null : 'text',\n name: 'name',\n message: 'Project name:',\n initial: 'my-api',\n validate: (value: string) => {\n const nameValid = validateProjectName(value);\n if (nameValid !== true) return nameValid;\n const dirValid = checkDirectoryExists(value, cwd);\n if (dirValid !== true) return dirValid;\n return true;\n },\n },\n {\n type: options.template || options.yes ? null : 'select',\n name: 'template',\n message: 'Template:',\n choices: templateChoices,\n initial: 0,\n },\n {\n type: options.yes ? null : 'confirm',\n name: 'telescope',\n message: 'Include Telescope (debugging dashboard)?',\n initial: true,\n },\n {\n type: options.yes ? null : 'confirm',\n name: 'database',\n message: 'Include database support (Kysely)?',\n initial: true,\n },\n {\n type: options.yes ? null : 'select',\n name: 'loggerType',\n message: 'Logger:',\n choices: loggerTypeChoices,\n initial: 0,\n },\n {\n type: options.yes ? null : 'select',\n name: 'routesStructure',\n message: 'Routes structure:',\n choices: routesStructureChoices,\n initial: 0,\n },\n {\n type: options.yes || options.monorepo !== undefined ? null : 'confirm',\n name: 'monorepo',\n message: 'Setup as monorepo?',\n initial: false,\n },\n {\n type: (prev) =>\n (prev === true || options.monorepo) && !options.apiPath\n ? 'text'\n : null,\n name: 'apiPath',\n message: 'API app path:',\n initial: 'apps/api',\n },\n ],\n { onCancel },\n );\n\n // Build final options\n const name = projectName || answers.name;\n if (!name) {\n console.error(' Error: Project name is required\\n');\n process.exit(1);\n }\n\n // Validate name if provided via argument\n if (projectName) {\n const nameValid = validateProjectName(projectName);\n if (nameValid !== true) {\n console.error(` Error: ${nameValid}\\n`);\n process.exit(1);\n }\n const dirValid = checkDirectoryExists(projectName, cwd);\n if (dirValid !== true) {\n console.error(` Error: ${dirValid}\\n`);\n process.exit(1);\n }\n }\n\n const monorepo =\n options.monorepo ?? (options.yes ? false : (answers.monorepo ?? false));\n const templateOptions: TemplateOptions = {\n name,\n template: options.template || answers.template || 'minimal',\n telescope: options.yes ? true : (answers.telescope ?? true),\n database: options.yes ? true : (answers.database ?? true),\n loggerType: options.yes ? 'pino' : (answers.loggerType ?? 'pino'),\n routesStructure: options.yes\n ? 'centralized-endpoints'\n : (answers.routesStructure ?? 'centralized-endpoints'),\n monorepo,\n apiPath: monorepo ? (options.apiPath ?? answers.apiPath ?? 'apps/api') : '',\n };\n\n const targetDir = join(cwd, name);\n const template = getTemplate(templateOptions.template);\n\n const isMonorepo = templateOptions.monorepo;\n const apiPath = templateOptions.apiPath;\n\n // Create project directory\n await mkdir(targetDir, { recursive: true });\n\n // For monorepo, app files go in the specified apiPath (e.g., apps/api)\n const appDir = isMonorepo ? join(targetDir, apiPath) : targetDir;\n if (isMonorepo) {\n await mkdir(appDir, { recursive: true });\n }\n\n // Collect app files\n const appFiles = [\n ...generatePackageJson(templateOptions, template),\n ...generateConfigFiles(templateOptions, template),\n ...generateEnvFiles(templateOptions, template),\n ...generateSourceFiles(templateOptions, template),\n ...generateDockerFiles(templateOptions, template),\n ];\n\n // Collect root monorepo files (includes packages/models)\n const rootFiles = [\n ...generateMonorepoFiles(templateOptions, template),\n ...generateModelsPackage(templateOptions),\n ];\n\n // Write root files (for monorepo)\n for (const { path, content } of rootFiles) {\n const fullPath = join(targetDir, path);\n await mkdir(dirname(fullPath), { recursive: true });\n await writeFile(fullPath, content);\n }\n\n // Write app files\n for (const { path, content } of appFiles) {\n const fullPath = join(appDir, path);\n const displayPath = isMonorepo ? `${apiPath}/${path}` : path;\n await mkdir(dirname(fullPath), { recursive: true });\n await writeFile(fullPath, content);\n }\n\n // Install dependencies\n if (!options.skipInstall) {\n try {\n execSync(getInstallCommand(pkgManager), {\n cwd: targetDir,\n stdio: 'inherit',\n });\n } catch {\n console.error('\\n Warning: Failed to install dependencies.');\n }\n\n // Format generated files with biome\n try {\n execSync('npx @biomejs/biome format --write --unsafe .', {\n cwd: targetDir,\n stdio: 'inherit',\n });\n } catch {\n // Silently ignore format errors\n }\n }\n\n // Print next steps\n const devCommand = getRunCommand(pkgManager, 'dev');\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAsCA,eAAsB,YACpBA,aACAC,UAAuB,CAAE,GACV;CACf,MAAM,MAAM,QAAQ,KAAK;CACzB,MAAM,aAAa,mCAAqB,IAAI;AAG5C,iBAAQ,SAAS,CAAE,EAAC;CACpB,MAAM,WAAW,MAAM;AACrB,UAAQ,KAAK,EAAE;CAChB;CAGD,MAAM,UAAU,MAAM,qBACpB;EACE;GACE,MAAM,cAAc,OAAO;GAC3B,MAAM;GACN,SAAS;GACT,SAAS;GACT,UAAU,CAACC,UAAkB;IAC3B,MAAM,YAAY,kCAAoB,MAAM;AAC5C,QAAI,cAAc,KAAM,QAAO;IAC/B,MAAM,WAAW,mCAAqB,OAAO,IAAI;AACjD,QAAI,aAAa,KAAM,QAAO;AAC9B,WAAO;GACR;EACF;EACD;GACE,MAAM,QAAQ,YAAY,QAAQ,MAAM,OAAO;GAC/C,MAAM;GACN,SAAS;GACT,SAASC;GACT,SAAS;EACV;EACD;GACE,MAAM,QAAQ,MAAM,OAAO;GAC3B,MAAM;GACN,SAAS;GACT,SAAS;EACV;EACD;GACE,MAAM,QAAQ,MAAM,OAAO;GAC3B,MAAM;GACN,SAAS;GACT,SAAS;EACV;EACD;GACE,MAAM,QAAQ,MAAM,OAAO;GAC3B,MAAM;GACN,SAAS;GACT,SAASC;GACT,SAAS;EACV;EACD;GACE,MAAM,QAAQ,MAAM,OAAO;GAC3B,MAAM;GACN,SAAS;GACT,SAASC;GACT,SAAS;EACV;EACD;GACE,MAAM,QAAQ,OAAO,QAAQ,sBAAyB,OAAO;GAC7D,MAAM;GACN,SAAS;GACT,SAAS;EACV;EACD;GACE,MAAM,CAAC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AG,mCAAoB,iBAAiB,SAAS;EACjD,GAAG,6BAAiB,iBAAiB,SAAS;EAC9C,GAAG,mCAAoB,iBAAiB,SAAS;EACjD,GAAG,mCAAoB,iBAAiB,SAAS;CAClD;CAGD,MAAM,YAAY,CAChB,GAAG,uCAAsB,iBAAiB,SAAS,EACnD,GAAG,qCAAsB,gBAAgB,AAC1C;AAGD,MAAK,MAAM,EAAE,MAAM,SAAS,IAAI,WAAW;EACzC,MAAM,WAAW,oBAAK,WAAW,KAAK;AACtC,QAAM,4BAAM,uBAAQ,SAAS,EAAE,EAAE,WAAW,KAAM,EAAC;AACnD,QAAM,gCAAU,UAAU,QAAQ;CACnC;AAGD,MAAK,MAAM,EAAE,MAAM,SAAS,IAAI,UAAU;EACxC,MAAM,WAAW,oBAAK,QAAQ,KAAK;EACnC,MAAM,cAAc,cAAc,EAAE,QAAQ,GAAG,KAAK,IAAI;AACxD,QAAM,4BAAM,uBAAQ,SAAS,EAAE,EAAE,WAAW,KAAM,EAAC;AACnD,QAAM,gCAAU,UAAU,QAAQ;CACnC;AAGD,MAAK,QAAQ,aAAa;AACxB,MAAI;AACF,oCAAS,gCAAkB,WAAW,EAAE;IACtC,KAAK;IACL,OAAO;GACR,EAAC;EACH,QAAO;AACN,WAAQ,MAAM,+CAA+C;EAC9D;AAGD,MAAI;AACF,oCAAS,gDAAgD;IACvD,KAAK;IACL,OAAO;GACR,EAAC;EACH,QAAO,CAEP;CACF;CAGD,MAAM,aAAa,4BAAc,YAAY,MAAM;AACpD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifests-
|
|
1
|
+
{"version":3,"file":"manifests-BNKG6AXf.mjs","names":["outputDir: string","routes: RouteInfo[]","functions: FunctionInfo[]","crons: CronInfo[]","subscribers: SubscriberInfo[]","appInfo: ServerAppInfo"],"sources":["../src/build/manifests.ts"],"sourcesContent":["import { mkdir, writeFile } from 'node:fs/promises';\nimport { join, relative } from 'path';\nimport type {\n CronInfo,\n FunctionInfo,\n RouteInfo,\n SubscriberInfo,\n} from '../types';\n\nconst logger = console;\n\nexport type ManifestProvider = 'aws' | 'server';\n\nexport interface ServerAppInfo {\n handler: string;\n endpoints: string;\n}\n\nexport async function generateAwsManifest(\n outputDir: string,\n routes: RouteInfo[],\n functions: FunctionInfo[],\n crons: CronInfo[],\n subscribers: SubscriberInfo[],\n): Promise<void> {\n const manifestDir = join(outputDir, 'manifest');\n await mkdir(manifestDir, { recursive: true });\n\n // Filter out 'ALL' method routes (server-specific)\n const awsRoutes = routes.filter((r) => r.method !== 'ALL');\n\n const content = `export const manifest = {\n routes: ${JSON.stringify(awsRoutes, null, 2)},\n functions: ${JSON.stringify(functions, null, 2)},\n crons: ${JSON.stringify(crons, null, 2)},\n subscribers: ${JSON.stringify(subscribers, null, 2)},\n} as const;\n\n// Derived types\nexport type Route = (typeof manifest.routes)[number];\nexport type Function = (typeof manifest.functions)[number];\nexport type Cron = (typeof manifest.crons)[number];\nexport type Subscriber = (typeof manifest.subscribers)[number];\n\n// Useful union types\nexport type Authorizer = Route['authorizer'];\nexport type HttpMethod = Route['method'];\nexport type RoutePath = Route['path'];\n`;\n\n const manifestPath = join(manifestDir, 'aws.ts');\n await writeFile(manifestPath, content);\n\n logger.log(\n `Generated AWS manifest with ${awsRoutes.length} routes, ${functions.length} functions, ${crons.length} crons, ${subscribers.length} subscribers`,\n );\n logger.log(`Manifest: ${relative(process.cwd(), manifestPath)}`);\n}\n\nexport async function generateServerManifest(\n outputDir: string,\n appInfo: ServerAppInfo,\n routes: RouteInfo[],\n subscribers: SubscriberInfo[],\n): Promise<void> {\n const manifestDir = join(outputDir, 'manifest');\n await mkdir(manifestDir, { recursive: true });\n\n // For server, extract route metadata (path, method, authorizer)\n const serverRoutes = routes\n .filter((r) => r.method !== 'ALL')\n .map((r) => ({\n path: r.path,\n method: r.method,\n authorizer: r.authorizer,\n }));\n\n // Server subscribers only need name and events\n const serverSubscribers = subscribers.map((s) => ({\n name: s.name,\n subscribedEvents: s.subscribedEvents,\n }));\n\n const content = `export const manifest = {\n app: ${JSON.stringify(appInfo, null, 2)},\n routes: ${JSON.stringify(serverRoutes, null, 2)},\n subscribers: ${JSON.stringify(serverSubscribers, null, 2)},\n} as const;\n\n// Derived types\nexport type Route = (typeof manifest.routes)[number];\nexport type Subscriber = (typeof manifest.subscribers)[number];\n\n// Useful union types\nexport type Authorizer = Route['authorizer'];\nexport type HttpMethod = Route['method'];\nexport type RoutePath = Route['path'];\n`;\n\n const manifestPath = join(manifestDir, 'server.ts');\n await writeFile(manifestPath, content);\n\n logger.log(\n `Generated server manifest with ${serverRoutes.length} routes, ${serverSubscribers.length} subscribers`,\n );\n logger.log(`Manifest: ${relative(process.cwd(), manifestPath)}`);\n}\n"],"mappings":";;;;AASA,MAAM,SAAS;AASf,eAAsB,oBACpBA,WACAC,QACAC,WACAC,OACAC,aACe;CACf,MAAM,cAAc,KAAK,WAAW,WAAW;AAC/C,OAAM,MAAM,aAAa,EAAE,WAAW,KAAM,EAAC;CAG7C,MAAM,YAAY,OAAO,OAAO,CAAC,MAAM,EAAE,WAAW,MAAM;CAE1D,MAAM,WAAW;YACP,KAAK,UAAU,WAAW,MAAM,EAAE,CAAC;eAChC,KAAK,UAAU,WAAW,MAAM,EAAE,CAAC;WACvC,KAAK,UAAU,OAAO,MAAM,EAAE,CAAC;iBACzB,KAAK,UAAU,aAAa,MAAM,EAAE,CAAC;;;;;;;;;;;;;;CAepD,MAAM,eAAe,KAAK,aAAa,SAAS;AAChD,OAAM,UAAU,cAAc,QAAQ;AAEtC,QAAO,KACJ,8BAA8B,UAAU,OAAO,WAAW,UAAU,OAAO,cAAc,MAAM,OAAO,UAAU,YAAY,OAAO,cACrI;AACD,QAAO,KAAK,YAAY,SAAS,QAAQ,KAAK,EAAE,aAAa,CAAC,EAAE;AACjE;AAED,eAAsB,uBACpBJ,WACAK,SACAJ,QACAG,aACe;CACf,MAAM,cAAc,KAAK,WAAW,WAAW;AAC/C,OAAM,MAAM,aAAa,EAAE,WAAW,KAAM,EAAC;CAG7C,MAAM,eAAe,OAClB,OAAO,CAAC,MAAM,EAAE,WAAW,MAAM,CACjC,IAAI,CAAC,OAAO;EACX,MAAM,EAAE;EACR,QAAQ,EAAE;EACV,YAAY,EAAE;CACf,GAAE;CAGL,MAAM,oBAAoB,YAAY,IAAI,CAAC,OAAO;EAChD,MAAM,EAAE;EACR,kBAAkB,EAAE;CACrB,GAAE;CAEH,MAAM,WAAW;SACV,KAAK,UAAU,SAAS,MAAM,EAAE,CAAC;YAC9B,KAAK,UAAU,cAAc,MAAM,EAAE,CAAC;iBACjC,KAAK,UAAU,mBAAmB,MAAM,EAAE,CAAC;;;;;;;;;;;;CAa1D,MAAM,eAAe,KAAK,aAAa,YAAY;AACnD,OAAM,UAAU,cAAc,QAAQ;AAEtC,QAAO,KACJ,iCAAiC,aAAa,OAAO,WAAW,kBAAkB,OAAO,cAC3F;AACD,QAAO,KAAK,YAAY,SAAS,QAAQ,KAAK,EAAE,aAAa,CAAC,EAAE;AACjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifests-
|
|
1
|
+
{"version":3,"file":"manifests-D13Ej8AE.cjs","names":["outputDir: string","routes: RouteInfo[]","functions: FunctionInfo[]","crons: CronInfo[]","subscribers: SubscriberInfo[]","appInfo: ServerAppInfo"],"sources":["../src/build/manifests.ts"],"sourcesContent":["import { mkdir, writeFile } from 'node:fs/promises';\nimport { join, relative } from 'path';\nimport type {\n CronInfo,\n FunctionInfo,\n RouteInfo,\n SubscriberInfo,\n} from '../types';\n\nconst logger = console;\n\nexport type ManifestProvider = 'aws' | 'server';\n\nexport interface ServerAppInfo {\n handler: string;\n endpoints: string;\n}\n\nexport async function generateAwsManifest(\n outputDir: string,\n routes: RouteInfo[],\n functions: FunctionInfo[],\n crons: CronInfo[],\n subscribers: SubscriberInfo[],\n): Promise<void> {\n const manifestDir = join(outputDir, 'manifest');\n await mkdir(manifestDir, { recursive: true });\n\n // Filter out 'ALL' method routes (server-specific)\n const awsRoutes = routes.filter((r) => r.method !== 'ALL');\n\n const content = `export const manifest = {\n routes: ${JSON.stringify(awsRoutes, null, 2)},\n functions: ${JSON.stringify(functions, null, 2)},\n crons: ${JSON.stringify(crons, null, 2)},\n subscribers: ${JSON.stringify(subscribers, null, 2)},\n} as const;\n\n// Derived types\nexport type Route = (typeof manifest.routes)[number];\nexport type Function = (typeof manifest.functions)[number];\nexport type Cron = (typeof manifest.crons)[number];\nexport type Subscriber = (typeof manifest.subscribers)[number];\n\n// Useful union types\nexport type Authorizer = Route['authorizer'];\nexport type HttpMethod = Route['method'];\nexport type RoutePath = Route['path'];\n`;\n\n const manifestPath = join(manifestDir, 'aws.ts');\n await writeFile(manifestPath, content);\n\n logger.log(\n `Generated AWS manifest with ${awsRoutes.length} routes, ${functions.length} functions, ${crons.length} crons, ${subscribers.length} subscribers`,\n );\n logger.log(`Manifest: ${relative(process.cwd(), manifestPath)}`);\n}\n\nexport async function generateServerManifest(\n outputDir: string,\n appInfo: ServerAppInfo,\n routes: RouteInfo[],\n subscribers: SubscriberInfo[],\n): Promise<void> {\n const manifestDir = join(outputDir, 'manifest');\n await mkdir(manifestDir, { recursive: true });\n\n // For server, extract route metadata (path, method, authorizer)\n const serverRoutes = routes\n .filter((r) => r.method !== 'ALL')\n .map((r) => ({\n path: r.path,\n method: r.method,\n authorizer: r.authorizer,\n }));\n\n // Server subscribers only need name and events\n const serverSubscribers = subscribers.map((s) => ({\n name: s.name,\n subscribedEvents: s.subscribedEvents,\n }));\n\n const content = `export const manifest = {\n app: ${JSON.stringify(appInfo, null, 2)},\n routes: ${JSON.stringify(serverRoutes, null, 2)},\n subscribers: ${JSON.stringify(serverSubscribers, null, 2)},\n} as const;\n\n// Derived types\nexport type Route = (typeof manifest.routes)[number];\nexport type Subscriber = (typeof manifest.subscribers)[number];\n\n// Useful union types\nexport type Authorizer = Route['authorizer'];\nexport type HttpMethod = Route['method'];\nexport type RoutePath = Route['path'];\n`;\n\n const manifestPath = join(manifestDir, 'server.ts');\n await writeFile(manifestPath, content);\n\n logger.log(\n `Generated server manifest with ${serverRoutes.length} routes, ${serverSubscribers.length} subscribers`,\n );\n logger.log(`Manifest: ${relative(process.cwd(), manifestPath)}`);\n}\n"],"mappings":";;;;;AASA,MAAM,SAAS;AASf,eAAsB,oBACpBA,WACAC,QACAC,WACAC,OACAC,aACe;CACf,MAAM,cAAc,eAAK,WAAW,WAAW;AAC/C,OAAM,4BAAM,aAAa,EAAE,WAAW,KAAM,EAAC;CAG7C,MAAM,YAAY,OAAO,OAAO,CAAC,MAAM,EAAE,WAAW,MAAM;CAE1D,MAAM,WAAW;YACP,KAAK,UAAU,WAAW,MAAM,EAAE,CAAC;eAChC,KAAK,UAAU,WAAW,MAAM,EAAE,CAAC;WACvC,KAAK,UAAU,OAAO,MAAM,EAAE,CAAC;iBACzB,KAAK,UAAU,aAAa,MAAM,EAAE,CAAC;;;;;;;;;;;;;;CAepD,MAAM,eAAe,eAAK,aAAa,SAAS;AAChD,OAAM,gCAAU,cAAc,QAAQ;AAEtC,QAAO,KACJ,8BAA8B,UAAU,OAAO,WAAW,UAAU,OAAO,cAAc,MAAM,OAAO,UAAU,YAAY,OAAO,cACrI;AACD,QAAO,KAAK,YAAY,mBAAS,QAAQ,KAAK,EAAE,aAAa,CAAC,EAAE;AACjE;AAED,eAAsB,uBACpBJ,WACAK,SACAJ,QACAG,aACe;CACf,MAAM,cAAc,eAAK,WAAW,WAAW;AAC/C,OAAM,4BAAM,aAAa,EAAE,WAAW,KAAM,EAAC;CAG7C,MAAM,eAAe,OAClB,OAAO,CAAC,MAAM,EAAE,WAAW,MAAM,CACjC,IAAI,CAAC,OAAO;EACX,MAAM,EAAE;EACR,QAAQ,EAAE;EACV,YAAY,EAAE;CACf,GAAE;CAGL,MAAM,oBAAoB,YAAY,IAAI,CAAC,OAAO;EAChD,MAAM,EAAE;EACR,kBAAkB,EAAE;CACrB,GAAE;CAEH,MAAM,WAAW;SACV,KAA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