@nathapp/na-cli 1.0.8 → 1.0.10

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.
Files changed (163) hide show
  1. package/dist/templates/db-schema/.gitlab-ci.yml +139 -0
  2. package/dist/templates/db-schema/Makefile +885 -0
  3. package/dist/templates/k8s-deployment/.gitlab-ci.yml +158 -0
  4. package/dist/templates/k8s-deployment/Makefile +233 -0
  5. package/dist/templates/k8s-deployment/resources/charts/mysql/charts/mysql-install/script/Makefile +12 -0
  6. package/dist/templates/k8s-deployment/resources/charts/redis/charts/redis-install/script/Makefile +8 -0
  7. package/dist/templates/k8s-deployment/services/charts/hooks/charts/pre-delete-rsc/script/Makefile +56 -0
  8. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-cypress/Makefile +9 -0
  9. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/script/Makefile +14 -0
  10. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/_t-0100-readiness-liveness.ts +84 -0
  11. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/hub.ts +372 -0
  12. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contact.ts +158 -0
  13. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-contract.ts +328 -0
  14. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-kyc.ts +304 -0
  15. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-app.ts +823 -0
  16. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-onboard-web.ts +493 -0
  17. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-profile.ts +277 -0
  18. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/individual-whitelist.ts +133 -0
  19. package/dist/templates/k8s-deployment/services/charts/tests/charts/e2e-test-js/tests/t-0200-start.ts +172 -0
  20. package/dist/templates/nestjs-api/.dockerignore +9 -0
  21. package/dist/templates/nestjs-api/.env +35 -0
  22. package/dist/templates/nestjs-api/.env.local +5 -29
  23. package/dist/templates/nestjs-api/.gitlab-ci.yml +180 -0
  24. package/dist/templates/nestjs-api/.nvmrc +1 -0
  25. package/dist/templates/nestjs-api/.prettierrc +4 -0
  26. package/dist/templates/nestjs-api/Makefile +95 -0
  27. package/dist/templates/nestjs-api/README.md +15 -0
  28. package/dist/templates/nestjs-api/nest-cli.json +10 -0
  29. package/dist/templates/nestjs-api/ormconfig.ts +16 -0
  30. package/dist/templates/nestjs-api/package.json +9 -9
  31. package/dist/templates/nestjs-api/src/app.controller.spec.ts +24 -0
  32. package/dist/templates/nestjs-api/src/app.controller.ts +27 -0
  33. package/dist/templates/nestjs-api/src/app.module.ts +33 -0
  34. package/dist/templates/nestjs-api/src/app.service.ts +27 -0
  35. package/dist/templates/nestjs-api/src/main.ts +31 -0
  36. package/dist/templates/nestjs-api/test/app.e2e-spec.ts +47 -0
  37. package/dist/templates/nestjs-api/tsconfig.build.json +5 -0
  38. package/dist/templates/nestjs-api/tsconfig.json +28 -0
  39. package/dist/templates/nestjs-api/tsconfig.spec.json +9 -0
  40. package/dist/templates/nestjs-library/.gitlab-ci.yml +134 -0
  41. package/dist/templates/nestjs-library/.nvmrc +1 -0
  42. package/dist/templates/nestjs-library/.prettierrc +6 -0
  43. package/dist/templates/nestjs-library/Makefile +60 -0
  44. package/dist/templates/nestjs-library/lib/index.ts +2 -0
  45. package/dist/templates/nestjs-library/test/app/controller/hello.controller.spec.ts +20 -0
  46. package/dist/templates/nestjs-library/test/app/controller/hello.controller.ts +7 -0
  47. package/dist/templates/nestjs-library/tsconfig.build.json +8 -0
  48. package/dist/templates/nestjs-library/tsconfig.json +21 -0
  49. package/dist/templates/nestjs-library/tsconfig.spec.json +9 -0
  50. package/dist/templates/ts-library/.dockerignore +2 -0
  51. package/dist/templates/ts-library/.eslintrc.js +24 -0
  52. package/dist/templates/ts-library/.gitlab-ci.yml +136 -0
  53. package/dist/templates/ts-library/.prettierrc +6 -0
  54. package/dist/templates/ts-library/Makefile +58 -0
  55. package/dist/templates/ts-library/index.ts +1 -0
  56. package/dist/templates/ts-library/lib/index.ts +1 -0
  57. package/dist/templates/ts-library/lib/samples/index.ts +5 -0
  58. package/dist/templates/ts-library/lib/samples/samples-function.ts +3 -0
  59. package/dist/templates/ts-library/test/sample.e2e-spec.ts +10 -0
  60. package/dist/templates/ts-library/tsconfig.build.json +4 -0
  61. package/dist/templates/ts-library/tsconfig.json +18 -0
  62. package/dist/templates/turbo-nestjs-vuexy/.dockerignore +2 -0
  63. package/dist/templates/turbo-nestjs-vuexy/.gitignore-rename +40 -0
  64. package/dist/templates/turbo-nestjs-vuexy/.npmrc-rename +0 -0
  65. package/dist/templates/turbo-nestjs-vuexy/Makefile +48 -0
  66. package/dist/templates/vuexy-portal/.dockerignore +2 -0
  67. package/dist/templates/vuexy-portal/.env +1 -0
  68. package/dist/templates/vuexy-portal/.gitlab-ci.yml +233 -0
  69. package/dist/templates/vuexy-portal/.npmrc-rename +2 -0
  70. package/dist/templates/vuexy-portal/.nvmrc +1 -0
  71. package/dist/templates/vuexy-portal/Makefile +55 -0
  72. package/dist/templates/vuexy-portal/src/@core/composable/createUrl.ts +20 -0
  73. package/dist/templates/vuexy-portal/src/@core/composable/useCookie.ts +43 -0
  74. package/dist/templates/vuexy-portal/src/@core/composable/useGenerateImageVariant.ts +25 -0
  75. package/dist/templates/vuexy-portal/src/@core/composable/useResponsiveSidebar.ts +29 -0
  76. package/dist/templates/vuexy-portal/src/@core/composable/useSkins.ts +42 -0
  77. package/dist/templates/vuexy-portal/src/@core/enums.ts +21 -0
  78. package/dist/templates/vuexy-portal/src/@core/index.ts +43 -0
  79. package/dist/templates/vuexy-portal/src/@core/initCore.ts +93 -0
  80. package/dist/templates/vuexy-portal/src/@core/libs/apex-chart/apexCharConfig.ts +701 -0
  81. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/chartjsConfig.ts +372 -0
  82. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/BarChart.ts +58 -0
  83. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/BubbleChart.ts +58 -0
  84. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/DoughnutChart.ts +58 -0
  85. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/LineChart.ts +58 -0
  86. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/PolarAreaChart.ts +58 -0
  87. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/RadarChart.ts +58 -0
  88. package/dist/templates/vuexy-portal/src/@core/libs/chartjs/components/ScatterChart.ts +58 -0
  89. package/dist/templates/vuexy-portal/src/@core/stores/config.ts +80 -0
  90. package/dist/templates/vuexy-portal/src/@core/types.ts +49 -0
  91. package/dist/templates/vuexy-portal/src/@core/utils/formatters.ts +48 -0
  92. package/dist/templates/vuexy-portal/src/@core/utils/helpers.ts +32 -0
  93. package/dist/templates/vuexy-portal/src/@core/utils/plugins.ts +53 -0
  94. package/dist/templates/vuexy-portal/src/@core/utils/validators.ts +105 -0
  95. package/dist/templates/vuexy-portal/src/@core/utils/vuetify.ts +13 -0
  96. package/dist/templates/vuexy-portal/src/@custom/composables/toasts.ts +45 -0
  97. package/dist/templates/vuexy-portal/src/@custom/composables/validator.ts +160 -0
  98. package/dist/templates/vuexy-portal/src/@custom/enums/index.ts +0 -0
  99. package/dist/templates/vuexy-portal/src/@custom/types/common.ts +17 -0
  100. package/dist/templates/vuexy-portal/src/@custom/types/index.ts +0 -0
  101. package/dist/templates/vuexy-portal/src/@custom/types/pagination.ts +19 -0
  102. package/dist/templates/vuexy-portal/src/@custom/types/user.ts +5 -0
  103. package/dist/templates/vuexy-portal/src/@custom/utils/formatters.ts +83 -0
  104. package/dist/templates/vuexy-portal/src/@custom/utils/index.ts +0 -0
  105. package/dist/templates/vuexy-portal/src/@custom/utils/validators.ts +51 -0
  106. package/dist/templates/vuexy-portal/src/@layouts/components.ts +11 -0
  107. package/dist/templates/vuexy-portal/src/@layouts/config.ts +43 -0
  108. package/dist/templates/vuexy-portal/src/@layouts/enums.ts +27 -0
  109. package/dist/templates/vuexy-portal/src/@layouts/index.ts +49 -0
  110. package/dist/templates/vuexy-portal/src/@layouts/plugins/casl.ts +48 -0
  111. package/dist/templates/vuexy-portal/src/@layouts/stores/config.ts +115 -0
  112. package/dist/templates/vuexy-portal/src/@layouts/symbols.ts +1 -0
  113. package/dist/templates/vuexy-portal/src/@layouts/types.ts +126 -0
  114. package/dist/templates/vuexy-portal/src/@layouts/utils.ts +180 -0
  115. package/dist/templates/vuexy-portal/src/api/api.ts +1 -0
  116. package/dist/templates/vuexy-portal/src/api/commonApi.ts +25 -0
  117. package/dist/templates/vuexy-portal/src/api/index.ts +58 -0
  118. package/dist/templates/vuexy-portal/src/api/requestInterceptor.ts +21 -0
  119. package/dist/templates/vuexy-portal/src/api/responseInterceptor.ts +52 -0
  120. package/dist/templates/vuexy-portal/src/api/types.ts +14 -0
  121. package/dist/templates/vuexy-portal/src/api/useApi.ts +68 -0
  122. package/dist/templates/vuexy-portal/src/api/useFetchApi.ts +41 -0
  123. package/dist/templates/vuexy-portal/src/api/userApi.ts +11 -0
  124. package/dist/templates/vuexy-portal/src/composables/useApiFetch.ts +48 -0
  125. package/dist/templates/vuexy-portal/src/composables/useJwt.ts +108 -0
  126. package/dist/templates/vuexy-portal/src/main.ts +17 -0
  127. package/dist/templates/vuexy-portal/src/navigation/horizontal/index.ts +5 -0
  128. package/dist/templates/vuexy-portal/src/navigation/index.ts +7 -0
  129. package/dist/templates/vuexy-portal/src/navigation/vertical/index.ts +5 -0
  130. package/dist/templates/vuexy-portal/src/plugins/1.router/additional-routes.ts +23 -0
  131. package/dist/templates/vuexy-portal/src/plugins/1.router/guards.ts +50 -0
  132. package/dist/templates/vuexy-portal/src/plugins/1.router/index.ts +45 -0
  133. package/dist/templates/vuexy-portal/src/plugins/2.pinia.ts +8 -0
  134. package/dist/templates/vuexy-portal/src/plugins/casl/ability.ts +10 -0
  135. package/dist/templates/vuexy-portal/src/plugins/casl/composables/useAbility.ts +4 -0
  136. package/dist/templates/vuexy-portal/src/plugins/casl/index.ts +14 -0
  137. package/dist/templates/vuexy-portal/src/plugins/i18n/index.ts +29 -0
  138. package/dist/templates/vuexy-portal/src/plugins/iconify/build-icons.ts +299 -0
  139. package/dist/templates/vuexy-portal/src/plugins/iconify/index.ts +5 -0
  140. package/dist/templates/vuexy-portal/src/plugins/layouts.ts +13 -0
  141. package/dist/templates/vuexy-portal/src/plugins/toast/index.ts +9 -0
  142. package/dist/templates/vuexy-portal/src/plugins/vuetify/defaults.ts +192 -0
  143. package/dist/templates/vuexy-portal/src/plugins/vuetify/icons.ts +84 -0
  144. package/dist/templates/vuexy-portal/src/plugins/vuetify/index.ts +47 -0
  145. package/dist/templates/vuexy-portal/src/plugins/vuetify/theme.ts +155 -0
  146. package/dist/templates/vuexy-portal/src/plugins/webfontloader.ts +19 -0
  147. package/dist/templates/vuexy-portal/src/stores/auth.ts +22 -0
  148. package/dist/templates/vuexy-portal/src/stores/common.ts +41 -0
  149. package/dist/templates/vuexy-portal/src/stores/index.ts +0 -0
  150. package/dist/templates/vuexy-portal/src/utils/constants.ts +3 -0
  151. package/dist/templates/vuexy-portal/src/utils/paginationMeta.ts +10 -0
  152. package/dist/templates/vuexy-portal/themeConfig.ts +66 -0
  153. package/dist/templates/vuexy-portal/tsconfig.json +86 -0
  154. package/dist/templates/vuexy-portal/vite.config.ts +111 -0
  155. package/dist/utils/jwt-keys.js +26 -0
  156. package/dist/utils/jwt-keys.js.map +1 -0
  157. package/dist/utils/template.js +4 -1
  158. package/dist/utils/template.js.map +1 -1
  159. package/package.json +4 -1
  160. package/alias-script.sh +0 -30
  161. package/bunfig.toml +0 -3
  162. package/nax/config.json +0 -23
  163. package/nax/features/enhancements/prd.json +0 -61
@@ -0,0 +1,134 @@
1
+ stages:
2
+ - test
3
+ # run test cases
4
+ - prepare
5
+ - build
6
+ - build-commit
7
+ - release
8
+ - notify
9
+
10
+ run-test:
11
+ stage: test
12
+ image:
13
+ name: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
14
+ script:
15
+ - make test
16
+ rules:
17
+ - if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/'
18
+ when: never
19
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
20
+ - if: '$CI_COMMIT_REF_PROTECTED == "true"'
21
+ - if: '$CI_COMMIT_MESSAGE =~ /run-test/'
22
+ - if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
23
+ - if: '$CI_COMMIT_MESSAGE =~ /run-release/ && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
24
+ # NOT triggerred by bot
25
+ # merge request
26
+ # commit to protected branch
27
+ # commit message contains `run-test` keyword
28
+ # commit message contains `run-prerelease` keyword and commit branch is nott default branch (master)
29
+ # commit message contains `run-release` keyword and commit branch is default branch (master)
30
+
31
+
32
+ run-pre-prepare:
33
+ stage: prepare
34
+ image: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
35
+ artifacts:
36
+ paths:
37
+ - package.json
38
+ script:
39
+ - make version-prerelease
40
+ rules:
41
+ # NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
42
+ - if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
43
+ when: never
44
+ # Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
45
+ - if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
46
+
47
+ run-prepare:
48
+ stage: prepare
49
+ image: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
50
+ artifacts:
51
+ paths:
52
+ - package.json
53
+ script:
54
+ - make version-patch
55
+ rules:
56
+ # NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
57
+ - if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
58
+ when: never
59
+ # Commit into default branch (master)
60
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
61
+
62
+
63
+ run-build:
64
+ stage: build
65
+ image:
66
+ name: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
67
+ before_script:
68
+ - bun install --frozen-lockfile
69
+ - npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
70
+ script:
71
+ - make build
72
+ - make release
73
+
74
+ rules:
75
+ # NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
76
+ - if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
77
+ when: never
78
+ # Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
79
+ - if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
80
+ # Commit into default branch (master)
81
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
82
+
83
+
84
+ run-build-commit:
85
+ stage: build-commit
86
+ image: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
87
+ before_script:
88
+ - git config --global user.name "$GITLAB_USER_NAME"
89
+ - git config --global user.email "$GITLAB_USER_EMAIL"
90
+ script:
91
+ - git add -A
92
+ - git commit -m "$(make version)" -m "== release-by-bot ($CI_COMMIT_SHA) =="
93
+ - git tag -a "$(make version)" -m "$(cat image-tag.txt) ($(cat image-digest.txt))"
94
+ - git push "https://${GITLAB_USER_NAME}:${CI_GIT_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:${CI_COMMIT_BRANCH}"
95
+ - git push "https://${GITLAB_USER_NAME}:${CI_GIT_TOKEN}@${CI_REPOSITORY_URL#*@}" --tags
96
+ rules:
97
+ # NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
98
+ - if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
99
+ when: never
100
+ # Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
101
+ - if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
102
+ # Commit into default branch (master)
103
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
104
+
105
+ run-release:
106
+ stage: release
107
+ image: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
108
+ script:
109
+ - echo "Bumped version $(make version)"
110
+ rules:
111
+ # NOT commit message contains `run-without-release` keyword and NOT merge request
112
+ - if: '$CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event"'
113
+ when: never
114
+ # Tag was created
115
+ - if: '$CI_COMMIT_TAG != null'
116
+
117
+
118
+ run-notify:
119
+ stage: notify
120
+ image: nathapp/node-bun:24.22.0-1.4.3-alpine-ci
121
+ before_script:
122
+ - apk --no-cache add curl
123
+ script:
124
+ - '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'
125
+ rules:
126
+ # NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
127
+ - if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
128
+ when: never
129
+ - if: '$TELEGRAM_BOT_TOKEN == null || $TELEGRAM_BOT_TOKEN == "" || $TELEGRAM_CHAT_ID == null || $TELEGRAM_CHAT_ID == ""'
130
+ when: never
131
+ # Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
132
+ - if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
133
+ # Commit into default branch (master)
134
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
@@ -0,0 +1 @@
1
+ v22.22.2
@@ -0,0 +1,6 @@
1
+ {
2
+ "singleQuote": false,
3
+ "trailingComma": "all",
4
+ "arrowParens": "avoid",
5
+ "endOfLine": "auto"
6
+ }
@@ -0,0 +1,60 @@
1
+ MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
2
+ ROOT_PATH := $(shell pwd)
3
+ SERVICE_NAME := <%= projectName %>
4
+
5
+ .PHONY: test build release
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
+ test:
51
+ @bun install --frozen-lockfile
52
+ @bun run test
53
+
54
+ build:
55
+ @bun run build
56
+
57
+ release:
58
+ @npm publish --access public
59
+
60
+
@@ -0,0 +1,2 @@
1
+ //export * from "./abc";
2
+
@@ -0,0 +1,20 @@
1
+ import { Test, TestingModule } from "@nestjs/testing";
2
+ import { HelloController } from "./hello.controller";
3
+
4
+ describe("HelloController", () => {
5
+ let module: TestingModule;
6
+
7
+ beforeEach(async () => {
8
+ module = await Test.createTestingModule({
9
+ controllers: [HelloController],
10
+ }).compile();
11
+ });
12
+
13
+ afterEach(async () => {
14
+ await module.close();
15
+ });
16
+
17
+ it("resolves from the Nest testing module", () => {
18
+ expect(module.get(HelloController)).toBeInstanceOf(HelloController);
19
+ });
20
+ });
@@ -0,0 +1,7 @@
1
+ import { Controller } from "@nestjs/common";
2
+
3
+
4
+ @Controller('hello')
5
+ export class HelloController {
6
+
7
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "rootDir": "./lib"
5
+ },
6
+ "include": ["lib/**/*"],
7
+ "exclude": ["node_modules", "test", "dist", "**/*.spec.ts"]
8
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "commonjs",
4
+ "moduleResolution": "node",
5
+ "target": "ES2022",
6
+ "lib": ["ES2022"],
7
+ "declaration": true,
8
+ "noImplicitAny": false,
9
+ "removeComments": true,
10
+ "noLib": false,
11
+ "emitDecoratorMetadata": true,
12
+ "experimentalDecorators": true,
13
+ "esModuleInterop": true,
14
+ "forceConsistentCasingInFileNames": true,
15
+ "sourceMap": false,
16
+ "outDir": "./dist",
17
+ "skipLibCheck": true
18
+ },
19
+ "include": ["lib/**/*"],
20
+ "exclude": ["node_modules", "dist", "**/*.spec.ts"]
21
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "compilerOptions": {
4
+ "noEmit": true,
5
+ "types": ["vitest/globals", "node"]
6
+ },
7
+ "include": ["lib/**/*", "test/**/*"],
8
+ "exclude": ["node_modules", "dist"]
9
+ }
@@ -0,0 +1,2 @@
1
+ dist
2
+ node_modules
@@ -0,0 +1,24 @@
1
+ module.exports = {
2
+ parser: '@typescript-eslint/parser',
3
+ parserOptions: {
4
+ project: 'tsconfig.json',
5
+ sourceType: 'module',
6
+ },
7
+ plugins: ['@typescript-eslint/eslint-plugin'],
8
+ extends: [
9
+ 'plugin:@typescript-eslint/recommended',
10
+ 'plugin:prettier/recommended',
11
+ ],
12
+ root: true,
13
+ env: {
14
+ node: true,
15
+ jest: true,
16
+ },
17
+ ignorePatterns: ['.eslintrc.js'],
18
+ rules: {
19
+ '@typescript-eslint/interface-name-prefix': 'off',
20
+ '@typescript-eslint/explicit-function-return-type': 'off',
21
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
22
+ '@typescript-eslint/no-explicit-any': 'off',
23
+ },
24
+ };
@@ -0,0 +1,136 @@
1
+ stages:
2
+ - test
3
+ # run test cases
4
+ - prepare
5
+ - build
6
+ - build-commit
7
+ - release
8
+ - notify
9
+
10
+ run-test:
11
+ stage: test
12
+ image:
13
+ name: registry-intl.cn-hongkong.aliyuncs.com/gkci/node:16.20.1-alpine-ci-1
14
+ script:
15
+ - make test
16
+ rules:
17
+ - if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/'
18
+ when: never
19
+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
20
+ - if: '$CI_COMMIT_REF_PROTECTED == "true"'
21
+ - if: '$CI_COMMIT_MESSAGE =~ /run-test/'
22
+ - if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
23
+ - if: '$CI_COMMIT_MESSAGE =~ /run-release/ && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
24
+ # NOT triggerred by bot
25
+ # merge request
26
+ # commit to protected branch
27
+ # commit message contains `run-test` keyword
28
+ # commit message contains `run-prerelease` keyword and commit branch is nott default branch (master)
29
+ # commit message contains `run-release` keyword and commit branch is default branch (master)
30
+
31
+
32
+ run-pre-prepare:
33
+ stage: prepare
34
+ image: registry-intl.cn-hongkong.aliyuncs.com/gkci/node:10.20.0-alpine-ci-1
35
+ artifacts:
36
+ paths:
37
+ - package.json
38
+ - package-lock.json
39
+ script:
40
+ - make version-prerelease
41
+ rules:
42
+ # NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
43
+ - if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
44
+ when: never
45
+ # Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
46
+ - if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
47
+
48
+ run-prepare:
49
+ stage: prepare
50
+ image: registry-intl.cn-hongkong.aliyuncs.com/gkci/node:10.20.0-alpine-ci-1
51
+ artifacts:
52
+ paths:
53
+ - package.json
54
+ - package-lock.json
55
+ script:
56
+ - make version-patch
57
+ rules:
58
+ # NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
59
+ - if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
60
+ when: never
61
+ # Commit into default branch (master)
62
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
63
+
64
+
65
+ run-build:
66
+ stage: build
67
+ image:
68
+ name: registry-intl.cn-hongkong.aliyuncs.com/gkci/node:16.20.1-alpine-ci-1
69
+ before_script:
70
+ - npm ci --cache .npm --prefer-offline
71
+ - npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
72
+ script:
73
+ - make build
74
+ - make release
75
+
76
+ rules:
77
+ # NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
78
+ - if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
79
+ when: never
80
+ # Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
81
+ - if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
82
+ # Commit into default branch (master)
83
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
84
+
85
+
86
+ run-build-commit:
87
+ stage: build-commit
88
+ image: registry-intl.cn-hongkong.aliyuncs.com/gkci/node:10.20.0-alpine-ci-1
89
+ before_script:
90
+ - git config --global user.name "$GITLAB_USER_NAME"
91
+ - git config --global user.email "$GITLAB_USER_EMAIL"
92
+ script:
93
+ - git add -A
94
+ - git commit -m "$(make version)" -m "== release-by-bot ($CI_COMMIT_SHA) =="
95
+ - git tag -a "$(make version)" -m "$(cat image-tag.txt) ($(cat image-digest.txt))"
96
+ - git push "https://${GITLAB_USER_NAME}:${CI_GIT_TOKEN}@${CI_REPOSITORY_URL#*@}" "HEAD:${CI_COMMIT_BRANCH}"
97
+ - git push "https://${GITLAB_USER_NAME}:${CI_GIT_TOKEN}@${CI_REPOSITORY_URL#*@}" --tags
98
+ rules:
99
+ # NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
100
+ - if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
101
+ when: never
102
+ # Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
103
+ - if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
104
+ # Commit into default branch (master)
105
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
106
+
107
+ run-release:
108
+ stage: release
109
+ image: registry-intl.cn-hongkong.aliyuncs.com/gkci/node:10.20.0-alpine-ci-1
110
+ script:
111
+ - echo "Bumped version $(make version)"
112
+ rules:
113
+ # NOT commit message contains `run-without-release` keyword and NOT merge request
114
+ - if: '$CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event"'
115
+ when: never
116
+ # Tag was created
117
+ - if: '$CI_COMMIT_TAG != null'
118
+
119
+
120
+ run-notify:
121
+ stage: notify
122
+ image: registry-intl.cn-hongkong.aliyuncs.com/gkci/node:10.20.0-alpine-ci-1
123
+ before_script:
124
+ - apk --no-cache add curl
125
+ script:
126
+ - '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'
127
+ rules:
128
+ # NOT triggerred by bot and NOT commit message contains `run-without-release` keyword and NOT merge request and NOT tag was created
129
+ - if: '$CI_COMMIT_MESSAGE =~ /release-by-bot/ || $CI_COMMIT_MESSAGE =~ /run-without-release/ || $CI_PIPELINE_SOURCE == "merge_request_event" || $CI_COMMIT_TAG != null'
130
+ when: never
131
+ - if: '$TELEGRAM_BOT_TOKEN == null || $TELEGRAM_BOT_TOKEN == "" || $TELEGRAM_CHAT_ID == null || $TELEGRAM_CHAT_ID == ""'
132
+ when: never
133
+ # Commit message contains `run-prerelease` keyword and commit branch is not default branch (master)
134
+ - if: '$CI_COMMIT_MESSAGE =~ /run-prerelease/ && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH'
135
+ # Commit into default branch (master)
136
+ - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
@@ -0,0 +1,6 @@
1
+ {
2
+ "singleQuote": false,
3
+ "trailingComma": "all",
4
+ "arrowParens": "avoid",
5
+ "endOfLine": "auto"
6
+ }
@@ -0,0 +1,58 @@
1
+ MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
2
+ ROOT_PATH := $(shell pwd)
3
+ SERVICE_NAME := <%= projectName %>
4
+
5
+ .PHONY: test
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
+ test:
51
+ @npm ci --cache .npm --prefer-offline
52
+ @npm test
53
+
54
+ build:
55
+ @npm run build
56
+
57
+ release:
58
+ @npm publish --access public
@@ -0,0 +1 @@
1
+ export * from './dist';
@@ -0,0 +1 @@
1
+ export * from "./samples";
@@ -0,0 +1,5 @@
1
+ import { sample_function } from "./samples-function";
2
+
3
+ export {
4
+ sample_function
5
+ }
@@ -0,0 +1,3 @@
1
+ export const sample_function = (value: string) => {
2
+ return "this is a sample function returned result"
3
+ };
@@ -0,0 +1,10 @@
1
+ import { describe, expect, test } from '@jest/globals';
2
+
3
+
4
+ describe("Sample Function (e2e)", () => {
5
+ it("Sample", () => {
6
+ // run test here
7
+ });
8
+
9
+
10
+ });
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "exclude": ["node_modules", "test", "dist", "**/*spec.ts"]
4
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "CommonJS",
4
+ "target": "ES2018",
5
+ "declaration": true,
6
+ "noImplicitAny": false,
7
+ "removeComments": true,
8
+ "noLib": false,
9
+ "emitDecoratorMetadata": true,
10
+ "experimentalDecorators": true,
11
+ "sourceMap": false,
12
+ "outDir": "./dist",
13
+ "rootDir": "./lib",
14
+ "skipLibCheck": true
15
+ },
16
+ "include": ["lib/**/*", "../index.ts"],
17
+ "exclude": ["node_modules", "**/*.spec.ts"]
18
+ }
@@ -0,0 +1,2 @@
1
+ node_modules
2
+ npm-debug.log
@@ -0,0 +1,40 @@
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+ # Dependencies
4
+ node_modules
5
+ .pnp
6
+ .pnp.js
7
+
8
+ # Local env files
9
+ .env
10
+ .env.local
11
+ .env.development.local
12
+ .env.test.local
13
+ .env.production.local
14
+
15
+ # Testing
16
+ coverage
17
+
18
+ # Turbo
19
+ !.turbo/
20
+ .turbo/*
21
+ !.turbo/config.json
22
+
23
+ # Vercel
24
+ .vercel
25
+
26
+ # Build Outputs
27
+ .next/
28
+ out/
29
+ build
30
+ dist
31
+
32
+
33
+ # Debug
34
+ npm-debug.log*
35
+ yarn-debug.log*
36
+ yarn-error.log*
37
+
38
+ # Misc
39
+ .DS_Store
40
+ *.pem
@@ -0,0 +1,48 @@
1
+ MAKEFILE := $(abspath $(lastword $(MAKEFILE_LIST)))
2
+ ROOT_PATH := $(shell pwd)
3
+ SERVICE_NAME := <%= projectName %>
4
+
5
+ .PHONY: test
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)
@@ -0,0 +1,2 @@
1
+ node_modules
2
+ dist
@@ -0,0 +1 @@
1
+ VITE_API_BASE_URL= http://localhost:8080