@nathapp/na-cli 1.0.7 → 1.0.9
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/dist/templates/db-schema/.gitlab-ci.yml +139 -0
- package/dist/templates/db-schema/Makefile +885 -0
- package/dist/templates/k8s-deployment/.gitlab-ci.yml +158 -0
- package/dist/templates/k8s-deployment/Makefile +233 -0
- package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/script/Makefile +12 -0
- package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/script/Makefile +8 -0
- package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/script/Makefile +56 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/Makefile +9 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/script/Makefile +14 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/_t-0100-readiness-liveness.ts +84 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/hub.ts +372 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contact.ts +158 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contract.ts +328 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-kyc.ts +304 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-app.ts +823 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-web.ts +493 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-profile.ts +277 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-whitelist.ts +133 -0
- package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/t-0200-start.ts +172 -0
- package/dist/templates/nestjs-api/.dockerignore +9 -0
- package/dist/templates/nestjs-api/.env +31 -0
- package/dist/templates/nestjs-api/.gitignore-rename +1 -0
- package/dist/templates/nestjs-api/.gitlab-ci.yml +180 -0
- package/dist/templates/nestjs-api/.nvmrc +1 -0
- package/dist/templates/nestjs-api/.oxlintrc.json +18 -0
- package/dist/templates/nestjs-api/.prettierrc +4 -0
- package/dist/templates/nestjs-api/Dockerfile +15 -21
- package/dist/templates/nestjs-api/Makefile +95 -0
- package/dist/templates/nestjs-api/README.md +22 -30
- package/dist/templates/nestjs-api/nest-cli.json +10 -0
- package/dist/templates/nestjs-api/ormconfig.ts +18 -0
- package/dist/templates/nestjs-api/package.json +58 -72
- package/dist/templates/nestjs-api/src/app.controller.spec.ts +24 -0
- package/dist/templates/nestjs-api/src/app.controller.ts +27 -0
- package/dist/templates/nestjs-api/src/app.module.ts +31 -0
- package/dist/templates/nestjs-api/src/app.service.ts +27 -0
- package/dist/templates/nestjs-api/src/main.ts +31 -0
- package/dist/templates/nestjs-api/test/app.e2e-spec.ts +47 -0
- package/dist/templates/nestjs-api/tsconfig.build.json +5 -0
- package/dist/templates/nestjs-api/tsconfig.json +28 -0
- package/dist/templates/nestjs-api/tsconfig.spec.json +9 -0
- package/dist/templates/nestjs-api/vitest.config.mts +33 -0
- package/dist/templates/nestjs-library/.gitignore-rename +1 -0
- package/dist/templates/nestjs-library/.gitlab-ci.yml +134 -0
- package/dist/templates/nestjs-library/.npmignore-rename +5 -2
- package/dist/templates/nestjs-library/.nvmrc +1 -0
- package/dist/templates/nestjs-library/.oxlintrc.json +18 -0
- package/dist/templates/nestjs-library/.prettierrc +6 -0
- package/dist/templates/nestjs-library/Makefile +60 -0
- package/dist/templates/nestjs-library/README.md +24 -0
- package/dist/templates/nestjs-library/lib/index.ts +2 -0
- package/dist/templates/nestjs-library/package.json +43 -33
- package/dist/templates/nestjs-library/test/app/controller/hello.controller.spec.ts +20 -0
- package/dist/templates/nestjs-library/test/app/controller/hello.controller.ts +7 -0
- package/dist/templates/nestjs-library/tsconfig.build.json +8 -0
- package/dist/templates/nestjs-library/tsconfig.json +21 -0
- package/dist/templates/nestjs-library/tsconfig.spec.json +9 -0
- package/dist/templates/nestjs-library/vitest.config.mts +29 -0
- package/dist/templates/ts-library/.dockerignore +2 -0
- package/dist/templates/ts-library/.eslintrc.js +24 -0
- package/dist/templates/ts-library/.gitlab-ci.yml +136 -0
- package/dist/templates/ts-library/.prettierrc +6 -0
- package/dist/templates/ts-library/Makefile +58 -0
- package/dist/templates/ts-library/index.ts +1 -0
- package/dist/templates/ts-library/lib/index.ts +1 -0
- package/dist/templates/ts-library/lib/samples/index.ts +5 -0
- package/dist/templates/ts-library/lib/samples/samples-function.ts +3 -0
- package/dist/templates/ts-library/test/sample.e2e-spec.ts +10 -0
- package/dist/templates/ts-library/tsconfig.build.json +4 -0
- package/dist/templates/ts-library/tsconfig.json +18 -0
- package/dist/templates/turbo-nestjs-vuexy/.dockerignore +2 -0
- package/dist/templates/turbo-nestjs-vuexy/.gitignore-rename +40 -0
- package/dist/templates/turbo-nestjs-vuexy/.npmrc-rename +0 -0
- package/dist/templates/turbo-nestjs-vuexy/Makefile +48 -0
- package/dist/templates/vuexy-portal/.dockerignore +2 -0
- package/dist/templates/vuexy-portal/.env +1 -0
- package/dist/templates/vuexy-portal/.gitlab-ci.yml +233 -0
- package/dist/templates/vuexy-portal/.npmrc-rename +2 -0
- package/dist/templates/vuexy-portal/.nvmrc +1 -0
- package/dist/templates/vuexy-portal/Makefile +55 -0
- package/dist/templates/vuexy-portal/src/@core/composable/createUrl.ts +20 -0
- package/dist/templates/vuexy-portal/src/@core/composable/useCookie.ts +43 -0
- package/dist/templates/vuexy-portal/src/@core/composable/useGenerateImageVariant.ts +25 -0
- package/dist/templates/vuexy-portal/src/@core/composable/useResponsiveSidebar.ts +29 -0
- package/dist/templates/vuexy-portal/src/@core/composable/useSkins.ts +42 -0
- package/dist/templates/vuexy-portal/src/@core/enums.ts +21 -0
- package/dist/templates/vuexy-portal/src/@core/index.ts +43 -0
- package/dist/templates/vuexy-portal/src/@core/initCore.ts +93 -0
- package/dist/templates/vuexy-portal/src/@core/libs/apex-chart/apexCharConfig.ts +701 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/chartjsConfig.ts +372 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/BarChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/BubbleChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/DoughnutChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/LineChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/PolarAreaChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/RadarChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/ScatterChart.ts +58 -0
- package/dist/templates/vuexy-portal/src/@core/stores/config.ts +80 -0
- package/dist/templates/vuexy-portal/src/@core/types.ts +49 -0
- package/dist/templates/vuexy-portal/src/@core/utils/formatters.ts +48 -0
- package/dist/templates/vuexy-portal/src/@core/utils/helpers.ts +32 -0
- package/dist/templates/vuexy-portal/src/@core/utils/plugins.ts +53 -0
- package/dist/templates/vuexy-portal/src/@core/utils/validators.ts +105 -0
- package/dist/templates/vuexy-portal/src/@core/utils/vuetify.ts +13 -0
- package/dist/templates/vuexy-portal/src/@custom/composables/toasts.ts +45 -0
- package/dist/templates/vuexy-portal/src/@custom/composables/validator.ts +160 -0
- package/dist/templates/vuexy-portal/src/@custom/enums/index.ts +0 -0
- package/dist/templates/vuexy-portal/src/@custom/types/common.ts +17 -0
- package/dist/templates/vuexy-portal/src/@custom/types/index.ts +0 -0
- package/dist/templates/vuexy-portal/src/@custom/types/pagination.ts +19 -0
- package/dist/templates/vuexy-portal/src/@custom/types/user.ts +5 -0
- package/dist/templates/vuexy-portal/src/@custom/utils/formatters.ts +83 -0
- package/dist/templates/vuexy-portal/src/@custom/utils/index.ts +0 -0
- package/dist/templates/vuexy-portal/src/@custom/utils/validators.ts +51 -0
- package/dist/templates/vuexy-portal/src/@layouts/components.ts +11 -0
- package/dist/templates/vuexy-portal/src/@layouts/config.ts +43 -0
- package/dist/templates/vuexy-portal/src/@layouts/enums.ts +27 -0
- package/dist/templates/vuexy-portal/src/@layouts/index.ts +49 -0
- package/dist/templates/vuexy-portal/src/@layouts/plugins/casl.ts +48 -0
- package/dist/templates/vuexy-portal/src/@layouts/stores/config.ts +115 -0
- package/dist/templates/vuexy-portal/src/@layouts/symbols.ts +1 -0
- package/dist/templates/vuexy-portal/src/@layouts/types.ts +126 -0
- package/dist/templates/vuexy-portal/src/@layouts/utils.ts +180 -0
- package/dist/templates/vuexy-portal/src/api/api.ts +1 -0
- package/dist/templates/vuexy-portal/src/api/commonApi.ts +25 -0
- package/dist/templates/vuexy-portal/src/api/index.ts +58 -0
- package/dist/templates/vuexy-portal/src/api/requestInterceptor.ts +21 -0
- package/dist/templates/vuexy-portal/src/api/responseInterceptor.ts +52 -0
- package/dist/templates/vuexy-portal/src/api/types.ts +14 -0
- package/dist/templates/vuexy-portal/src/api/useApi.ts +68 -0
- package/dist/templates/vuexy-portal/src/api/useFetchApi.ts +41 -0
- package/dist/templates/vuexy-portal/src/api/userApi.ts +11 -0
- package/dist/templates/vuexy-portal/src/composables/useApiFetch.ts +48 -0
- package/dist/templates/vuexy-portal/src/composables/useJwt.ts +108 -0
- package/dist/templates/vuexy-portal/src/main.ts +17 -0
- package/dist/templates/vuexy-portal/src/navigation/horizontal/index.ts +5 -0
- package/dist/templates/vuexy-portal/src/navigation/index.ts +7 -0
- package/dist/templates/vuexy-portal/src/navigation/vertical/index.ts +5 -0
- package/dist/templates/vuexy-portal/src/plugins/1.router/additional-routes.ts +23 -0
- package/dist/templates/vuexy-portal/src/plugins/1.router/guards.ts +50 -0
- package/dist/templates/vuexy-portal/src/plugins/1.router/index.ts +45 -0
- package/dist/templates/vuexy-portal/src/plugins/2.pinia.ts +8 -0
- package/dist/templates/vuexy-portal/src/plugins/casl/ability.ts +10 -0
- package/dist/templates/vuexy-portal/src/plugins/casl/composables/useAbility.ts +4 -0
- package/dist/templates/vuexy-portal/src/plugins/casl/index.ts +14 -0
- package/dist/templates/vuexy-portal/src/plugins/i18n/index.ts +29 -0
- package/dist/templates/vuexy-portal/src/plugins/iconify/build-icons.ts +299 -0
- package/dist/templates/vuexy-portal/src/plugins/iconify/index.ts +5 -0
- package/dist/templates/vuexy-portal/src/plugins/layouts.ts +13 -0
- package/dist/templates/vuexy-portal/src/plugins/toast/index.ts +9 -0
- package/dist/templates/vuexy-portal/src/plugins/vuetify/defaults.ts +192 -0
- package/dist/templates/vuexy-portal/src/plugins/vuetify/icons.ts +84 -0
- package/dist/templates/vuexy-portal/src/plugins/vuetify/index.ts +47 -0
- package/dist/templates/vuexy-portal/src/plugins/vuetify/theme.ts +155 -0
- package/dist/templates/vuexy-portal/src/plugins/webfontloader.ts +19 -0
- package/dist/templates/vuexy-portal/src/stores/auth.ts +22 -0
- package/dist/templates/vuexy-portal/src/stores/common.ts +41 -0
- package/dist/templates/vuexy-portal/src/stores/index.ts +0 -0
- package/dist/templates/vuexy-portal/src/utils/constants.ts +3 -0
- package/dist/templates/vuexy-portal/src/utils/paginationMeta.ts +10 -0
- package/dist/templates/vuexy-portal/themeConfig.ts +66 -0
- package/dist/templates/vuexy-portal/tsconfig.json +86 -0
- package/dist/templates/vuexy-portal/vite.config.ts +111 -0
- package/dist/utils/template.js +2 -0
- package/dist/utils/template.js.map +1 -1
- package/package.json +4 -1
- package/alias-script.sh +0 -30
- package/bunfig.toml +0 -3
- package/dist/templates/nestjs-api/test/jest-e2e.json +0 -12
- package/dist/templates/nestjs-api/test/jest-test.json +0 -26
- package/dist/templates/nestjs-library/test/jest-test.json +0 -23
- package/nax/config.json +0 -23
- package/nax/features/enhancements/prd.json +0 -61
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# Project must implement Makefile for commands (test, version-prerelease, version-patch, name, version, image)
|
|
2
|
+
# command:
|
|
3
|
+
# - test: run project test cases
|
|
4
|
+
# - version-prerelease: bump prerelease version
|
|
5
|
+
# - version-patch: bump release version
|
|
6
|
+
# - name: display project name
|
|
7
|
+
# - version: display project version
|
|
8
|
+
# - image: display project name and version (e.g. hello-world:1.0.0)
|
|
9
|
+
#
|
|
10
|
+
stages:
|
|
11
|
+
# run test cases
|
|
12
|
+
- test
|
|
13
|
+
# build container image and push to registry
|
|
14
|
+
- prepare
|
|
15
|
+
- build-init
|
|
16
|
+
- build
|
|
17
|
+
- build-commit
|
|
18
|
+
# mark release commit as verified
|
|
19
|
+
- release
|
|
20
|
+
- notify
|
|
21
|
+
|
|
22
|
+
run-test:
|
|
23
|
+
stage: test
|
|
24
|
+
image: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
|
|
25
|
+
script:
|
|
26
|
+
- make test
|
|
27
|
+
rules:
|
|
28
|
+
# NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT tag was created
|
|
29
|
+
- if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_COMMIT_TAG != null'
|
|
30
|
+
when: never
|
|
31
|
+
# Merge request
|
|
32
|
+
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
33
|
+
# Commit to protected branch or commit branch is default branch (master)
|
|
34
|
+
- if: '$CI_COMMIT_REF_PROTECTED == "true" || $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
35
|
+
# Commit message contains `run-test` keyword
|
|
36
|
+
- if: '$CI_COMMIT_MESSAGE =~ /run-test/'
|
|
37
|
+
# Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
|
|
38
|
+
- if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
|
|
39
|
+
|
|
40
|
+
run-pre-prepare:
|
|
41
|
+
stage: prepare
|
|
42
|
+
image: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
|
|
43
|
+
artifacts:
|
|
44
|
+
paths:
|
|
45
|
+
- package.json
|
|
46
|
+
- image-tag.txt
|
|
47
|
+
- postman-collection.json
|
|
48
|
+
script:
|
|
49
|
+
- make spec
|
|
50
|
+
- make version-prerelease
|
|
51
|
+
- make image | awk '{ printf("%s/%s/%s", ENVIRON["CONTAINER_REGISTRY_URL"], ENVIRON["CONTAINER_REGISTRY_NAMESPACE"], $0)}' > image-tag.txt
|
|
52
|
+
rules:
|
|
53
|
+
# NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
|
|
54
|
+
- if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
|
|
55
|
+
when: never
|
|
56
|
+
# Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
|
|
57
|
+
- if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
|
|
58
|
+
|
|
59
|
+
run-prepare:
|
|
60
|
+
stage: prepare
|
|
61
|
+
image: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
|
|
62
|
+
artifacts:
|
|
63
|
+
paths:
|
|
64
|
+
- package.json
|
|
65
|
+
- image-tag.txt
|
|
66
|
+
- postman-collection.json
|
|
67
|
+
script:
|
|
68
|
+
- make spec
|
|
69
|
+
- make version-patch
|
|
70
|
+
- make image | awk '{ printf("%s/%s/%s", ENVIRON["CONTAINER_REGISTRY_URL"], ENVIRON["CONTAINER_REGISTRY_NAMESPACE"], $0)}' > image-tag.txt
|
|
71
|
+
rules:
|
|
72
|
+
# NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
|
|
73
|
+
- if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
|
|
74
|
+
when: never
|
|
75
|
+
# Commit into default branch (master)
|
|
76
|
+
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
77
|
+
|
|
78
|
+
run-build-warmer:
|
|
79
|
+
stage: build-init
|
|
80
|
+
image:
|
|
81
|
+
name: registry-intl.cn-hongkong.aliyuncs.com/gkci/kaniko-warmer:debug
|
|
82
|
+
entrypoint: [""]
|
|
83
|
+
before_script:
|
|
84
|
+
- echo "$DOCKER_AUTH_CONFIG" > /kaniko/.docker/config.json
|
|
85
|
+
script:
|
|
86
|
+
- warmer `cat $CI_PROJECT_DIR/Dockerfile | grep FROM | awk -F" " '{ printf("--image=%s ", $2) }'`
|
|
87
|
+
rules:
|
|
88
|
+
# NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
|
|
89
|
+
- if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
|
|
90
|
+
when: never
|
|
91
|
+
# Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
|
|
92
|
+
- if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
|
|
93
|
+
# Commit into default branch (master)
|
|
94
|
+
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
95
|
+
|
|
96
|
+
run-build:
|
|
97
|
+
stage: build
|
|
98
|
+
image:
|
|
99
|
+
name: gcr.io/kaniko-project/executor:v1.23.2-debug
|
|
100
|
+
entrypoint: [""]
|
|
101
|
+
artifacts:
|
|
102
|
+
paths:
|
|
103
|
+
- image-digest.txt
|
|
104
|
+
before_script:
|
|
105
|
+
- echo "$DOCKER_AUTH_CONFIG" > /kaniko/.docker/config.json
|
|
106
|
+
variables:
|
|
107
|
+
GIT_SUBMODULE_FORCE_HTTPS: "true"
|
|
108
|
+
GIT_SUBMODULE_STRATEGY: recursive
|
|
109
|
+
GIT_DEPTH: 1
|
|
110
|
+
GIT_STRATEGY: clone
|
|
111
|
+
script:
|
|
112
|
+
- echo "BUILDING... `cat $CI_PROJECT_DIR/image-tag.txt`"
|
|
113
|
+
- if [ -f $CI_PROJECT_DIR/dependency.txt ] && ! [ -z "`cat $CI_PROJECT_DIR/dependency.txt`" ]; then cat $CI_PROJECT_DIR/dependency.txt | awk '{$1=$1;print;exit}' > $CI_PROJECT_DIR/dep.txt; else echo > $CI_PROJECT_DIR/dep.txt; fi
|
|
114
|
+
- echo -n 'LABEL DEPENDENCY='; cat $CI_PROJECT_DIR/dep.txt
|
|
115
|
+
- |
|
|
116
|
+
if [[ -n "$CONTAINER_CACHE_REPO" ]]; then
|
|
117
|
+
executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --digest-file $CI_PROJECT_DIR/image-digest.txt --destination "`cat $CI_PROJECT_DIR/image-tag.txt`" --label "dependency=`cat $CI_PROJECT_DIR/dep.txt`" --cache=true --cache-repo=$CONTAINER_CACHE_REPO --cache-ttl=24h
|
|
118
|
+
else
|
|
119
|
+
executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --digest-file $CI_PROJECT_DIR/image-digest.txt --destination "`cat $CI_PROJECT_DIR/image-tag.txt`" --label "dependency=`cat $CI_PROJECT_DIR/dep.txt`"
|
|
120
|
+
fi
|
|
121
|
+
- echo "PUSHED `cat $CI_PROJECT_DIR/image-tag.txt` (`cat $CI_PROJECT_DIR/image-digest.txt`)"
|
|
122
|
+
rules:
|
|
123
|
+
# NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
|
|
124
|
+
- if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
|
|
125
|
+
when: never
|
|
126
|
+
# Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
|
|
127
|
+
- if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
|
|
128
|
+
# Commit into default branch (master)
|
|
129
|
+
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
130
|
+
|
|
131
|
+
run-build-commit:
|
|
132
|
+
stage: build-commit
|
|
133
|
+
image: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
|
|
134
|
+
before_script:
|
|
135
|
+
- git config --global user.name "$GITLAB_USER_NAME"
|
|
136
|
+
- git config --global user.email "$GITLAB_USER_EMAIL"
|
|
137
|
+
script:
|
|
138
|
+
- git add -A
|
|
139
|
+
- git commit -m "$(make version)" -m "== release-by-bot ($CI_COMMIT_SHA) =="
|
|
140
|
+
- git tag -a "$(make version)" -m "$(cat image-tag.txt) ($(cat image-digest.txt))"
|
|
141
|
+
- git push "https://${GITLAB_USER_NAME}:${CI_GIT_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:${CI_COMMIT_BRANCH}"
|
|
142
|
+
- git push "https://${GITLAB_USER_NAME}:${CI_GIT_TOKEN}@${CI_REPOSITORY_URL#*@}" --tags
|
|
143
|
+
rules:
|
|
144
|
+
# NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
|
|
145
|
+
- if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
|
|
146
|
+
when: never
|
|
147
|
+
# Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
|
|
148
|
+
- if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
|
|
149
|
+
# Commit into default branch (master)
|
|
150
|
+
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
151
|
+
|
|
152
|
+
run-release:
|
|
153
|
+
stage: release
|
|
154
|
+
image: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
|
|
155
|
+
script:
|
|
156
|
+
- echo "Bumped version $(make version)"
|
|
157
|
+
rules:
|
|
158
|
+
# NOT commit message contains `run-without-release` keyword and NOT merge request
|
|
159
|
+
- if: '$CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event"'
|
|
160
|
+
when: never
|
|
161
|
+
# Tag was created
|
|
162
|
+
- if: '$CI_COMMIT_TAG != null'
|
|
163
|
+
|
|
164
|
+
run-notify:
|
|
165
|
+
stage: notify
|
|
166
|
+
image: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
|
|
167
|
+
before_script:
|
|
168
|
+
- apk --no-cache add curl
|
|
169
|
+
script:
|
|
170
|
+
- 'curl -X POST -H "Content-Type: application/json" -d "{\"chat_id\": \"$TELEGRAM_CHAT_ID\", \"text\": \"CI: $CI_PROJECT_NAMESPACE/$CI_PROJECT_NAME version:$(make version) has been released \"}" https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/sendMessage'
|
|
171
|
+
rules:
|
|
172
|
+
# NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
|
|
173
|
+
- if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
|
|
174
|
+
when: never
|
|
175
|
+
- if: '$TELEGRAM_BOT_TOKEN == null || $TELEGRAM_BOT_TOKEN == "" || $TELEGRAM_CHAT_ID == null || $TELEGRAM_CHAT_ID == ""'
|
|
176
|
+
when: never
|
|
177
|
+
# Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
|
|
178
|
+
- if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
|
|
179
|
+
# Commit into default branch (master)
|
|
180
|
+
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v22.22.2
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
|
3
|
+
"plugins": ["typescript", "oxc"],
|
|
4
|
+
"categories": {
|
|
5
|
+
"correctness": "error"
|
|
6
|
+
},
|
|
7
|
+
"env": {
|
|
8
|
+
"node": true,
|
|
9
|
+
"es2022": true,
|
|
10
|
+
"vitest": true
|
|
11
|
+
},
|
|
12
|
+
"ignorePatterns": ["dist/", "node_modules/", "coverage/", ".turbo/"],
|
|
13
|
+
"rules": {
|
|
14
|
+
"typescript/no-explicit-any": "off",
|
|
15
|
+
"typescript/explicit-module-boundary-types": "off",
|
|
16
|
+
"no-unused-vars": "off"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,39 +1,33 @@
|
|
|
1
|
-
##
|
|
1
|
+
## multi-stage build optimized for kaniko cache
|
|
2
|
+
## keep the bun image version in step with `packageManager`: bun.lock is versioned per bun release
|
|
2
3
|
FROM nathapp/apline-jq:3.18 AS deps
|
|
3
4
|
|
|
4
5
|
# https://stackoverflow.com/a/58487433
|
|
5
|
-
#
|
|
6
|
+
# Strip the version so a release bump does not invalidate the dependency layers
|
|
7
|
+
COPY package.json /tmp/
|
|
8
|
+
RUN jq '{ name, dependencies, devDependencies, scripts, packageManager }' < /tmp/package.json > /tmp/deps.json
|
|
6
9
|
|
|
7
|
-
COPY package.json package-lock.json /tmp/
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
RUN jq '{ name, lockfileVersion, requires, packages, dependencies }' < /tmp/package-lock.json > /tmp/deps-lock.json
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
FROM nathapp/node-bun:22.21.0-1.2.23-alpine AS builder
|
|
11
|
+
FROM nathapp/node-bun:24.22.0-1.4.3-alpine-builder AS builder
|
|
14
12
|
WORKDIR /app/
|
|
15
13
|
|
|
16
14
|
COPY --from=deps /tmp/deps.json ./package.json
|
|
17
|
-
COPY
|
|
18
|
-
|
|
19
|
-
ADD ./bun.lockb ./tsconfig.json ./tsconfig.build.json ./nest-cli.json /app/
|
|
15
|
+
COPY bun.lock ./
|
|
20
16
|
|
|
21
17
|
## install dependencies first
|
|
22
|
-
RUN bun install --
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
RUN bun install --frozen-lockfile
|
|
19
|
+
COPY tsconfig.json tsconfig.build.json nest-cli.json ./
|
|
20
|
+
COPY src ./src
|
|
25
21
|
RUN bun run build
|
|
26
22
|
|
|
27
23
|
|
|
28
|
-
FROM nathapp/node-bun:22.
|
|
24
|
+
FROM nathapp/node-bun:24.22.0-1.4.3-alpine
|
|
29
25
|
WORKDIR /app/
|
|
30
26
|
|
|
31
|
-
COPY bun.lockb ./
|
|
32
27
|
COPY --from=deps /tmp/deps.json ./package.json
|
|
33
|
-
COPY
|
|
34
|
-
|
|
35
|
-
RUN bun install --freeze-lockfile --production
|
|
28
|
+
COPY bun.lock ./
|
|
29
|
+
RUN bun install --frozen-lockfile --production --ignore-scripts
|
|
36
30
|
|
|
37
31
|
COPY --from=builder /app/dist /app/dist
|
|
38
|
-
COPY package
|
|
39
|
-
CMD ["bun", "run", "start:prod"]
|
|
32
|
+
COPY package.json ./
|
|
33
|
+
CMD ["bun", "run", "start:prod"]
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
|
|
2
|
+
ROOT_PATH := $(shell pwd)
|
|
3
|
+
SERVICE_NAME := <%= projectName %>
|
|
4
|
+
|
|
5
|
+
.PHONY: version name image test spec spec-file
|
|
6
|
+
|
|
7
|
+
version-major: version-sync
|
|
8
|
+
@npm -s version major --no-git-tag-version
|
|
9
|
+
|
|
10
|
+
version-minor: version-sync
|
|
11
|
+
@npm -s version minor --no-git-tag-version
|
|
12
|
+
|
|
13
|
+
version-patch: version-sync
|
|
14
|
+
@npm -s version patch --no-git-tag-version
|
|
15
|
+
|
|
16
|
+
version-prerelease: version-sync
|
|
17
|
+
@npm -s version prerelease --preid=rc --no-git-tag-version
|
|
18
|
+
|
|
19
|
+
version-latest:
|
|
20
|
+
@(git tag --sort=-creatordate || echo) | awk 'NR==1 { \
|
|
21
|
+
split($$0, n, "-"); \
|
|
22
|
+
if (n[1] != "") { \
|
|
23
|
+
split(n[1], v, "."); \
|
|
24
|
+
if (v[1] ~ /^[0-9]+$$/ && v[2] ~ /^[0-9]+$$/ && v[3] ~ /^[0-9]+$$/) { \
|
|
25
|
+
print $$0; \
|
|
26
|
+
exit 0; \
|
|
27
|
+
} \
|
|
28
|
+
} \
|
|
29
|
+
print "1.0.0-rc.0"; \
|
|
30
|
+
} \
|
|
31
|
+
END { \
|
|
32
|
+
if (NR == 0) { \
|
|
33
|
+
print "1.0.0-rc.0"; \
|
|
34
|
+
} \
|
|
35
|
+
}'
|
|
36
|
+
|
|
37
|
+
version-sync:
|
|
38
|
+
@git checkout $(CI_COMMIT_BRANCH)
|
|
39
|
+
@git pull --tags 2&>/dev/null || true
|
|
40
|
+
@git tag --sort=-creatordate | head -10
|
|
41
|
+
@cat package.json | jq -r --arg PKG_VERSION `make --no-print-directory -f$(MAKEFILE) version-latest` '.version=$$PKG_VERSION' > package.json;
|
|
42
|
+
@echo -n "Current Git tag: "; cat package.json | jq -r '.version'
|
|
43
|
+
|
|
44
|
+
version:
|
|
45
|
+
@echo $(shell node -p "require('$(ROOT_PATH)/package.json').version")
|
|
46
|
+
|
|
47
|
+
name:
|
|
48
|
+
@echo $(SERVICE_NAME)
|
|
49
|
+
|
|
50
|
+
image:
|
|
51
|
+
@echo $(SERVICE_NAME):$(shell node -p "require('$(ROOT_PATH)/package.json').version")
|
|
52
|
+
|
|
53
|
+
test:
|
|
54
|
+
@bun install --frozen-lockfile
|
|
55
|
+
@bun run test
|
|
56
|
+
|
|
57
|
+
spec:
|
|
58
|
+
@set -e -o pipefail; \
|
|
59
|
+
if [ -f "$(ROOT_PATH)/spec.yaml" ]; then \
|
|
60
|
+
make --no-print-directory -f$(MAKEFILE) spec-file > $(ROOT_PATH)/all-spec.yaml; \
|
|
61
|
+
openapi2postmanv2 -s $(ROOT_PATH)/all-spec.yaml -o postman-collection.json | \
|
|
62
|
+
awk ' \
|
|
63
|
+
BEGIN{ result = 0; error = "" } \
|
|
64
|
+
{ \
|
|
65
|
+
if (0 < index($$0, "Conversion successful, collection written to file")) { \
|
|
66
|
+
result = 1; \
|
|
67
|
+
} \
|
|
68
|
+
error = error $$0; \
|
|
69
|
+
} \
|
|
70
|
+
END{ \
|
|
71
|
+
if (result != 1) { \
|
|
72
|
+
print error; \
|
|
73
|
+
exit(-1); \
|
|
74
|
+
} \
|
|
75
|
+
}'; \
|
|
76
|
+
rm -f $(ROOT_PATH)/all-spec.yaml; \
|
|
77
|
+
fi;
|
|
78
|
+
|
|
79
|
+
spec-file:
|
|
80
|
+
@cat $(ROOT_PATH)/spec.yaml;
|
|
81
|
+
@for file in `find $(ROOT_PATH)/src -iname "*-spec.yaml"`; do \
|
|
82
|
+
echo ""; \
|
|
83
|
+
cat $$file; \
|
|
84
|
+
done;
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
gen-keypair:
|
|
88
|
+
@openssl genrsa -out private.pem 2048
|
|
89
|
+
@openssl rsa -in private.pem -pubout -out public.pem
|
|
90
|
+
|
|
91
|
+
view-privatekey:
|
|
92
|
+
@awk '{printf "%s\\n", $$0}' private.pem
|
|
93
|
+
|
|
94
|
+
view-publickey:
|
|
95
|
+
@awk '{printf "%s\\n", $$0}' public.pem
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
# <%= projectName %>
|
|
2
2
|
|
|
3
|
-
## Issue
|
|
4
|
-
|
|
5
|
-
1. if u having Cannot find module 'typescript' error. https://github.com/toonvanstrijp/nestjs-i18n/issues/551
|
|
6
|
-
|
|
7
3
|
### Getting Started
|
|
8
4
|
|
|
9
5
|
The <%= projectName %> API endpoints.
|
|
10
6
|
|
|
7
|
+
Stack: NestJS 12, `@nathapp/nestjs-*` 4.x, Bun, Vitest, oxlint. Requires Node >= 22.12 (see `.nvmrc`).
|
|
8
|
+
|
|
11
9
|
### How to setup environment?
|
|
12
10
|
|
|
13
11
|
1. Clone this repository.
|
|
@@ -16,39 +14,34 @@ The <%= projectName %> API endpoints.
|
|
|
16
14
|
|
|
17
15
|
3. Install package dependencies.
|
|
18
16
|
```
|
|
19
|
-
|
|
17
|
+
bun install
|
|
20
18
|
```
|
|
21
19
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
2. Run unit-test command.
|
|
27
|
-
|
|
28
|
-
- To run single module unit-test.
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
npm run test-this src/app-service.test.ts
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
- To run all unit-test.
|
|
35
|
-
```
|
|
36
|
-
npm run test
|
|
37
|
-
```
|
|
20
|
+
4. Start the API in watch mode (reads `.env`, then `.env.local`). With `ENV_NAME=local` (the `.env` default) the Swagger UI is served at `/swagger-ui.html`.
|
|
21
|
+
```
|
|
22
|
+
bun run start:dev
|
|
23
|
+
```
|
|
38
24
|
|
|
39
|
-
### How to
|
|
25
|
+
### How to run tests?
|
|
40
26
|
|
|
41
|
-
|
|
27
|
+
Unit specs live next to the code as `src/**/*.spec.ts`; e2e specs live in `test/**/*.e2e-spec.ts`.
|
|
42
28
|
|
|
43
|
-
|
|
29
|
+
- Run all unit tests: `bun run test`
|
|
30
|
+
- Run one spec: `bunx vitest run src/app.controller.spec.ts`
|
|
31
|
+
- Run e2e tests: `bun run test:e2e`
|
|
32
|
+
- Coverage: `bun run test:cov`
|
|
33
|
+
- Watch mode: `bun run test:watch`
|
|
44
34
|
|
|
45
|
-
|
|
35
|
+
Use `vi` (not `jest`) for mocks and spies, and `createMock` from `@golevelup/ts-vitest`.
|
|
46
36
|
|
|
47
|
-
|
|
48
|
-
npm run debug-this src/app-service.test.ts
|
|
49
|
-
```
|
|
37
|
+
### Quality checks
|
|
50
38
|
|
|
51
|
-
|
|
39
|
+
```
|
|
40
|
+
bun run lint
|
|
41
|
+
bun run type-check
|
|
42
|
+
bun run type-check:spec
|
|
43
|
+
bun run build
|
|
44
|
+
```
|
|
52
45
|
|
|
53
46
|
### How to release version?
|
|
54
47
|
|
|
@@ -68,4 +61,3 @@ Git pipeline will perform unit-test, build container image and push to the conta
|
|
|
68
61
|
|
|
69
62
|
If you want to merge into `default` branch without triggering the pipeline, write commit message that contain `run-without-release`.
|
|
70
63
|
|
|
71
|
-
chatbot: 0
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DataSource, DataSourceOptions } from 'typeorm';
|
|
2
|
+
|
|
3
|
+
const config = {
|
|
4
|
+
name: 'default',
|
|
5
|
+
type: 'mysql',
|
|
6
|
+
host: 'localhost',
|
|
7
|
+
port: 3306,
|
|
8
|
+
username: 'typeorm',
|
|
9
|
+
password: 'password',
|
|
10
|
+
database: 'database-test',
|
|
11
|
+
entities: ['./src/auth-module/**/*.entity{.ts,.js}'],
|
|
12
|
+
synchronize: false,
|
|
13
|
+
migrations: ['./src/migrations/*{.ts,.js}'],
|
|
14
|
+
// migrationsTableName: 'migrations_typeorm',
|
|
15
|
+
migrationsRun: true,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const connectionSource = new DataSource(config as DataSourceOptions);
|
|
@@ -5,20 +5,25 @@
|
|
|
5
5
|
"author": "<%= author %>",
|
|
6
6
|
"private": true,
|
|
7
7
|
"license": "UNLICENSED",
|
|
8
|
+
"engines": {
|
|
9
|
+
"node": ">=22.12.0"
|
|
10
|
+
},
|
|
8
11
|
"scripts": {
|
|
9
|
-
"clean": "rimraf dist/ .turbo/",
|
|
12
|
+
"clean": "rimraf dist/ .turbo/ coverage/",
|
|
10
13
|
"build": "nest build",
|
|
14
|
+
"type-check": "tsc -p tsconfig.build.json --noEmit",
|
|
15
|
+
"type-check:spec": "tsc -p tsconfig.spec.json",
|
|
11
16
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
12
17
|
"start": "nest start --env-file=.env --env-file=.env.local",
|
|
13
18
|
"start:dev": "nest start --env-file=.env --env-file=.env.local --watch",
|
|
14
19
|
"start:debug": "nest start --env-file=.env --env-file=.env.local --debug --watch",
|
|
15
20
|
"start:prod": "ENV_NAME=production bun dist/main",
|
|
16
|
-
"lint": "
|
|
17
|
-
"
|
|
18
|
-
"test
|
|
19
|
-
"test:
|
|
20
|
-
"test:
|
|
21
|
-
"test:e2e": "
|
|
21
|
+
"lint": "oxlint src test --max-warnings=0",
|
|
22
|
+
"lint:fix": "oxlint src test --fix",
|
|
23
|
+
"test": "vitest run --exclude \"test/**/*.e2e-spec.ts\"",
|
|
24
|
+
"test:cov": "vitest run --coverage --exclude \"test/**/*.e2e-spec.ts\"",
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"test:e2e": "vitest run test/",
|
|
22
27
|
"typeorm": "ts-node ./node_modules/typeorm/cli",
|
|
23
28
|
"migration:run": "npm run typeorm migration:run -- -d ./ormconfig.ts",
|
|
24
29
|
"migration:generate": "npm run typeorm -- -d ./ormconfig.ts migration:generate ./src/migrations/$npm_config_name",
|
|
@@ -27,72 +32,53 @@
|
|
|
27
32
|
"migration:sql": "ts-node -r tsconfig-paths/register ./node_modules/@nathapp/typeorm-migrate-to-sql/bin/typeorm-migrate-sql.js -d ./src/migrations/ -c ./ormconfig.ts -n $npm_config_name"
|
|
28
33
|
},
|
|
29
34
|
"dependencies": {
|
|
30
|
-
|
|
31
|
-
<%if (isFastify) { -%>"@fastify/
|
|
32
|
-
"@
|
|
33
|
-
"@nathapp/
|
|
34
|
-
"@nathapp/
|
|
35
|
-
"@nathapp/nestjs-
|
|
36
|
-
"@nathapp/nestjs-
|
|
37
|
-
"@nathapp/nestjs-
|
|
38
|
-
"@nathapp/nestjs-
|
|
39
|
-
"@nestjs
|
|
40
|
-
"@nestjs
|
|
41
|
-
"@nestjs/
|
|
42
|
-
"@nestjs/
|
|
43
|
-
"@nestjs/
|
|
44
|
-
"@nestjs/
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
"
|
|
35
|
+
"@casl/ability": "^6.8.1",
|
|
36
|
+
<%if (isFastify) { -%>"@fastify/helmet": "^13.2.0",
|
|
37
|
+
"@fastify/static": "^10.1.6",
|
|
38
|
+
<% } -%>"@nathapp/auth": "^1.0.2",
|
|
39
|
+
"@nathapp/common": "^0.1.15",
|
|
40
|
+
"@nathapp/nestjs-app": "~4.2.2",
|
|
41
|
+
"@nathapp/nestjs-auth": "~4.2.2",
|
|
42
|
+
"@nathapp/nestjs-common": "~4.2.2",
|
|
43
|
+
"@nathapp/nestjs-data": "~4.2.2",
|
|
44
|
+
"@nathapp/nestjs-logging": "~4.2.2",
|
|
45
|
+
"@nathapp/nestjs-microservices": "~4.2.2",
|
|
46
|
+
"@nestjs/common": "^12.1.3",
|
|
47
|
+
"@nestjs/config": "^12.0.1",
|
|
48
|
+
"@nestjs/core": "^12.1.3",
|
|
49
|
+
"@nestjs/microservices": "^12.1.3",
|
|
50
|
+
"@nestjs/passport": "^12.0.0",
|
|
51
|
+
"@nestjs/platform-<%= nestjsPlatform %>": "^12.1.3",
|
|
52
|
+
"@nestjs/swagger": "^12.0.2",
|
|
53
|
+
"class-transformer": "^0.5.1",
|
|
54
|
+
"class-validator": "^0.14.0",
|
|
55
|
+
<%if (!isFastify) { -%>"helmet": "^8.3.0",
|
|
56
|
+
<% } -%>"mysql2": "^3.24.6",
|
|
57
|
+
"nestjs-i18n": "^10.8.5",
|
|
58
|
+
"passport": "^0.7.0",
|
|
50
59
|
"reflect-metadata": "^0.2.2",
|
|
51
|
-
"rxjs": "^7.2
|
|
60
|
+
"rxjs": "^7.8.2"
|
|
52
61
|
},
|
|
53
62
|
"devDependencies": {
|
|
54
|
-
"@golevelup/ts-
|
|
55
|
-
"@nestjs/cli": "^
|
|
56
|
-
"@nestjs/schematics": "^
|
|
57
|
-
"@nestjs/testing": "^
|
|
58
|
-
|
|
59
|
-
"@types/
|
|
60
|
-
"@types/node": "^22.0.0",
|
|
61
|
-
"@types/supertest": "^2.0
|
|
62
|
-
"@
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"ts-node": "^10.0.0",
|
|
74
|
-
"tsconfig-paths": "4.1.1",
|
|
75
|
-
"typescript": "^5"
|
|
76
|
-
},
|
|
77
|
-
"jest": {
|
|
78
|
-
"moduleFileExtensions": [
|
|
79
|
-
"js",
|
|
80
|
-
"json",
|
|
81
|
-
"ts"
|
|
82
|
-
],
|
|
83
|
-
"rootDir": "src",
|
|
84
|
-
"testRegex": ".*\\.spec\\.ts$",
|
|
85
|
-
"transform": {
|
|
86
|
-
"^.+\\.(t|j)s$": "ts-jest"
|
|
87
|
-
},
|
|
88
|
-
"collectCoverageFrom": [
|
|
89
|
-
"**/*.(t|j)s"
|
|
90
|
-
],
|
|
91
|
-
"coverageDirectory": "../coverage",
|
|
92
|
-
"testEnvironment": "node",
|
|
93
|
-
"moduleNameMapper": {
|
|
94
|
-
"^@/(.*)$": "<rootDir>/../src/$1"
|
|
95
|
-
}
|
|
63
|
+
"@golevelup/ts-vitest": "^4.0.0",
|
|
64
|
+
"@nestjs/cli": "^12.0.8",
|
|
65
|
+
"@nestjs/schematics": "^12.0.0",
|
|
66
|
+
"@nestjs/testing": "^12.1.3",
|
|
67
|
+
"@swc/core": "^1.16.13",
|
|
68
|
+
<%if (!isFastify) { -%>"@types/express": "^5.0.0",
|
|
69
|
+
<% } -%>"@types/node": "^22.0.0",
|
|
70
|
+
"@types/supertest": "^7.2.0",
|
|
71
|
+
"@vitest/coverage-v8": "^4.1.11",
|
|
72
|
+
"oxlint": "^1.87.0",
|
|
73
|
+
"prettier": "^3.6.0",
|
|
74
|
+
"rimraf": "^6.0.1",
|
|
75
|
+
"source-map-support": "^0.5.21",
|
|
76
|
+
"supertest": "^7.2.2",
|
|
77
|
+
"ts-node": "^10.9.2",
|
|
78
|
+
"tsconfig-paths": "^4.2.0",
|
|
79
|
+
"typescript": "^5.9.0",
|
|
80
|
+
"unplugin-swc": "^2.0.0",
|
|
81
|
+
"vitest": "^4.1.11"
|
|
96
82
|
},
|
|
97
|
-
"packageManager": "bun@1.
|
|
98
|
-
}
|
|
83
|
+
"packageManager": "bun@1.4.3"
|
|
84
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Test, TestingModule } from '@nestjs/testing';
|
|
2
|
+
import { AppController } from './app.controller';
|
|
3
|
+
import { AppService } from '@/app.service';
|
|
4
|
+
|
|
5
|
+
describe('AppController', () => {
|
|
6
|
+
let appController: AppController;
|
|
7
|
+
let appService: AppService;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
const app: TestingModule = await Test.createTestingModule({
|
|
11
|
+
controllers: [AppController],
|
|
12
|
+
providers: [AppService],
|
|
13
|
+
}).compile();
|
|
14
|
+
|
|
15
|
+
appController = app.get<AppController>(AppController);
|
|
16
|
+
appService = app.get(AppService);
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
describe('root', () => {
|
|
20
|
+
it('should return "App Version"', () => {
|
|
21
|
+
expect(appController.get()).toEqual(appService.displayVersion());
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
});
|