@aakash58/chatbot 1.1.19 → 1.1.21
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/.editorconfig +17 -0
- package/.vscode/extensions.json +4 -0
- package/.vscode/launch.json +41 -0
- package/.vscode/settings.json +14 -0
- package/.vscode/tasks.json +60 -0
- package/README.md +298 -22
- package/angular.json +132 -0
- package/docs/PUBLISHING_GUIDE.md +104 -0
- package/package.json +75 -29
- package/projects/app-doohbot/public/assets/const/app-const.json +15 -0
- package/projects/app-doohbot/public/assets/const/doohclick_license.json +6 -0
- package/projects/app-doohbot/public/favicon.ico +0 -0
- package/projects/app-doohbot/src/app/app.config.ts +13 -0
- package/projects/app-doohbot/src/app/app.html +31 -0
- package/projects/app-doohbot/src/app/app.routes.ts +3 -0
- package/projects/app-doohbot/src/app/app.scss +279 -0
- package/projects/app-doohbot/src/app/app.spec.ts +23 -0
- package/projects/app-doohbot/src/app/app.ts +72 -0
- package/projects/app-doohbot/src/index.html +15 -0
- package/projects/app-doohbot/src/main.ts +6 -0
- package/projects/app-doohbot/src/styles.scss +15 -0
- package/projects/app-doohbot/tsconfig.app.json +15 -0
- package/projects/app-doohbot/tsconfig.spec.json +14 -0
- package/projects/doohbot/README.md +64 -0
- package/projects/doohbot/docs/README.md +140 -0
- package/projects/doohbot/ng-package.json +10 -0
- package/projects/doohbot/package.json +16 -0
- package/projects/doohbot/src/lib/app/chat/chat-ui-state.service.ts +194 -0
- package/projects/doohbot/src/lib/app/chat/chat.service.ts +547 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-button/chat-button.component.html +27 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-button/chat-button.component.scss +115 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-button/chat-button.component.ts +35 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-footer/chat-footer.component.html +3 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-footer/chat-footer.component.scss +20 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-footer/chat-footer.component.ts +12 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-header/chat-header.component.html +34 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-header/chat-header.component.scss +78 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-header/chat-header.component.ts +52 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.html +77 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.scss +346 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.ts +188 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-window/chat-window.component.html +146 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-window/chat-window.component.scss +187 -0
- package/projects/doohbot/src/lib/app/chat/components/chat-window/chat-window.component.ts +256 -0
- package/projects/doohbot/src/lib/app/chat/components/message-input/message-input.component.html +17 -0
- package/projects/doohbot/src/lib/app/chat/components/message-input/message-input.component.scss +59 -0
- package/projects/doohbot/src/lib/app/chat/components/message-input/message-input.component.ts +28 -0
- package/projects/doohbot/src/lib/app/chat/components/message-list/message-list.component.html +138 -0
- package/projects/doohbot/src/lib/app/chat/components/message-list/message-list.component.scss +436 -0
- package/projects/doohbot/src/lib/app/chat/components/message-list/message-list.component.ts +106 -0
- package/projects/doohbot/src/lib/app/chat/model/chat-history.model.ts +57 -0
- package/projects/doohbot/src/lib/app/chat/model/chat-request.model.ts +17 -0
- package/projects/doohbot/src/lib/app/chat/model/chat-response.model.ts +9 -0
- package/projects/doohbot/src/lib/app/chat/model/chat-session.model.ts +14 -0
- package/{lib/app/chat/model/chat-stream-message.model.d.ts → projects/doohbot/src/lib/app/chat/model/chat-stream-message.model.ts} +6 -5
- package/projects/doohbot/src/lib/app/chat/model/chat-stream-response.model.ts +12 -0
- package/projects/doohbot/src/lib/app/chat/services/chat-api.service.ts +82 -0
- package/projects/doohbot/src/lib/app/chat/services/chat-audio.service.ts +44 -0
- package/projects/doohbot/src/lib/app/chat/services/chat-history.service.ts +303 -0
- package/projects/doohbot/src/lib/app/login/login-form.component.html +80 -0
- package/projects/doohbot/src/lib/app/login/login-form.component.scss +189 -0
- package/projects/doohbot/src/lib/app/login/login-form.component.ts +45 -0
- package/projects/doohbot/src/lib/app/personalization/personalization-dialog.component.html +81 -0
- package/projects/doohbot/src/lib/app/personalization/personalization-dialog.component.scss +179 -0
- package/projects/doohbot/src/lib/app/personalization/personalization-dialog.component.ts +217 -0
- package/projects/doohbot/src/lib/app/personalization/personalization.service.ts +197 -0
- package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.html +111 -0
- package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.scss +218 -0
- package/projects/doohbot/src/lib/app/personalization/sections/account/account-section.component.ts +121 -0
- package/projects/doohbot/src/lib/app/personalization/sections/instructions/instructions-section.component.html +46 -0
- package/projects/doohbot/src/lib/app/personalization/sections/instructions/instructions-section.component.scss +138 -0
- package/projects/doohbot/src/lib/app/personalization/sections/instructions/instructions-section.component.ts +28 -0
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/color-picker-dialog.component.ts +92 -0
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/preferences-section.component.html +198 -0
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/preferences-section.component.scss +107 -0
- package/projects/doohbot/src/lib/app/personalization/sections/preferences/preferences-section.component.ts +103 -0
- package/projects/doohbot/src/lib/app/personalization/sections/profile/profile-section.component.html +46 -0
- package/projects/doohbot/src/lib/app/personalization/sections/profile/profile-section.component.scss +131 -0
- package/projects/doohbot/src/lib/app/personalization/sections/profile/profile-section.component.ts +23 -0
- package/projects/doohbot/src/lib/app/personalization/sections/settings/setting-section.component.html +33 -0
- package/projects/doohbot/src/lib/app/personalization/sections/settings/setting-section.component.scss +61 -0
- package/projects/doohbot/src/lib/app/personalization/sections/settings/setting-section.component.ts +20 -0
- package/projects/doohbot/src/lib/app/personalization/sections/terms/terms-section.component.html +30 -0
- package/projects/doohbot/src/lib/app/personalization/sections/terms/terms-section.component.scss +59 -0
- package/projects/doohbot/src/lib/app/personalization/sections/terms/terms-section.component.ts +12 -0
- package/projects/doohbot/src/lib/constant/doohbot-constant.ts +40 -0
- package/projects/doohbot/src/lib/constant/html-entities.ts +8 -0
- package/projects/doohbot/src/lib/constant/utf8.ts +9 -0
- package/projects/doohbot/src/lib/core/app-const.ts +63 -0
- package/projects/doohbot/src/lib/core/auth/account-api.service.ts +53 -0
- package/projects/doohbot/src/lib/core/auth/auth.service.ts +478 -0
- package/projects/doohbot/src/lib/core/auth/models/auth-result.model.ts +4 -0
- package/projects/doohbot/src/lib/core/auth/models/federated-login-request.model.ts +5 -0
- package/projects/doohbot/src/lib/core/auth/models/login-request.model.ts +6 -0
- package/projects/doohbot/src/lib/core/auth/storage.service.ts +113 -0
- package/projects/doohbot/src/lib/core/directives/draggable/draggable-dialog.directive.ts +123 -0
- package/projects/doohbot/src/lib/core/directives/draggable/draggable-dialog.module.ts +9 -0
- package/projects/doohbot/src/lib/core/directives/fullscreen/fullscreen.directive.ts +58 -0
- package/projects/doohbot/src/lib/core/directives/fullscreen/fullscreen.module.ts +9 -0
- package/projects/doohbot/src/lib/core/directives/popout/popout.directive.ts +169 -0
- package/projects/doohbot/src/lib/core/directives/popout/popout.module.ts +9 -0
- package/projects/doohbot/src/lib/core/directives/resizable/resizable-dialog.directive.ts +197 -0
- package/projects/doohbot/src/lib/core/directives/resizable/resizable-dialog.module.ts +9 -0
- package/projects/doohbot/src/lib/core/enums/api-request-state.enum.ts +9 -0
- package/projects/doohbot/src/lib/core/environments/environment.prod.ts +14 -0
- package/projects/doohbot/src/lib/core/environments/environment.ts +14 -0
- package/projects/doohbot/src/lib/core/helpers/crypto-helper.service.ts +72 -0
- package/projects/doohbot/src/lib/core/http/http-stream.service.ts +105 -0
- package/projects/doohbot/src/lib/core/http/http.service.ts +148 -0
- package/projects/doohbot/src/lib/core/interceptors/auth.interceptor.ts +118 -0
- package/projects/doohbot/src/lib/core/interceptors/license.interceptor.ts +50 -0
- package/projects/doohbot/src/lib/core/models/api-config.model.ts +82 -0
- package/projects/doohbot/src/lib/core/models/api-request.model.ts +92 -0
- package/projects/doohbot/src/lib/core/models/api-response.model.ts +13 -0
- package/projects/doohbot/src/lib/core/models/doohbot-config.model.ts +109 -0
- package/{lib/core/models/license.model.d.ts → projects/doohbot/src/lib/core/models/license.model.ts} +27 -23
- package/projects/doohbot/src/lib/core/models/message.ts +18 -0
- package/projects/doohbot/src/lib/core/models/theme-config.model.ts +48 -0
- package/projects/doohbot/src/lib/core/services/core-config.service.ts +53 -0
- package/projects/doohbot/src/lib/core/services/doohbot-api.service.ts +207 -0
- package/projects/doohbot/src/lib/core/services/license.service.ts +171 -0
- package/projects/doohbot/src/lib/core/services/markdown.service.ts +73 -0
- package/projects/doohbot/src/lib/core/services/theme.service.ts +305 -0
- package/{lib/core/types/auth-mode.type.d.ts → projects/doohbot/src/lib/core/types/auth-mode.type.ts} +4 -4
- package/{lib/core/types/auth-status.type.d.ts → projects/doohbot/src/lib/core/types/auth-status.type.ts} +5 -4
- package/{lib/core/types/chat-stream.type.d.ts → projects/doohbot/src/lib/core/types/chat-stream.type.ts} +4 -4
- package/{lib/core/types/message-role.type.d.ts → projects/doohbot/src/lib/core/types/message-role.type.ts} +4 -4
- package/{lib/core/types/prompt-mode.type.d.ts → projects/doohbot/src/lib/core/types/prompt-mode.type.ts} +5 -4
- package/{lib/core/types/snackbar-error.type.d.ts → projects/doohbot/src/lib/core/types/snackbar-error.type.ts} +5 -4
- package/{lib/core/types/tenant-resolution-strategy.type.d.ts → projects/doohbot/src/lib/core/types/tenant-resolution-strategy.type.ts} +4 -4
- package/projects/doohbot/src/lib/core/utils/error-handler.util.ts +31 -0
- package/projects/doohbot/src/lib/core/utils/logger.service.ts +45 -0
- package/projects/doohbot/src/lib/doohbot-input.ts +19 -0
- package/projects/doohbot/src/lib/doohbot.component.html +34 -0
- package/projects/doohbot/src/lib/doohbot.component.scss +17 -0
- package/projects/doohbot/src/lib/doohbot.component.spec.ts +31 -0
- package/projects/doohbot/src/lib/doohbot.component.ts +545 -0
- package/projects/doohbot/src/lib/elements.ts +25 -0
- package/projects/doohbot/src/lib/predefined_messages.ts +14 -0
- package/projects/doohbot/src/lib/shared/chips/chips.component.html +9 -0
- package/projects/doohbot/src/lib/shared/chips/chips.component.scss +29 -0
- package/projects/doohbot/src/lib/shared/chips/chips.component.spec.ts +22 -0
- package/projects/doohbot/src/lib/shared/chips/chips.component.ts +20 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.component.html +29 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.component.scss +100 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.component.ts +42 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.service.ts +62 -0
- package/projects/doohbot/src/lib/shared/dialog/dialog.utils.ts +102 -0
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.html +30 -0
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.scss +53 -0
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.spec.ts +22 -0
- package/projects/doohbot/src/lib/shared/dropdown-menu/dropdown-menu.component.ts +35 -0
- package/projects/doohbot/src/lib/shared/input-dialog/input-dialog.component.html +16 -0
- package/projects/doohbot/src/lib/shared/input-dialog/input-dialog.component.scss +45 -0
- package/projects/doohbot/src/lib/shared/input-dialog/input-dialog.component.ts +46 -0
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.html +5 -0
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.scss +0 -0
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.spec.ts +22 -0
- package/projects/doohbot/src/lib/shared/menu-item/menu-item.component.ts +20 -0
- package/projects/doohbot/src/lib/shared/pipes/simple-markdown.pipe.ts +19 -0
- package/projects/doohbot/src/lib/shared/popout/popout.html +1 -0
- package/projects/doohbot/src/lib/shared/popout/popout.scss +0 -0
- package/projects/doohbot/src/lib/shared/popout/popout.spec.ts +23 -0
- package/projects/doohbot/src/lib/shared/popout/popout.ts +11 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.html +7 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.scss +125 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.spec.ts +21 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.component.ts +44 -0
- package/projects/doohbot/src/lib/shared/snackbar/snackbar.service.ts +54 -0
- package/{lib/shared/snackbar/snackbar.utils.d.ts → projects/doohbot/src/lib/shared/snackbar/snackbar.utils.ts} +49 -33
- package/projects/doohbot/src/lib/styles/_theme.scss +132 -0
- package/projects/doohbot/src/lib/styles/material-override.scss +302 -0
- package/projects/doohbot/src/lib/styles/utility.scss +588 -0
- package/projects/doohbot/src/public-api.ts +42 -0
- package/projects/doohbot/tsconfig.lib.json +15 -0
- package/projects/doohbot/tsconfig.lib.prod.json +11 -0
- package/projects/doohbot/tsconfig.spec.json +10 -0
- package/proxy.conf.json +8 -0
- package/publish.config.js +25 -0
- package/scripts/publishing/index.ts +67 -0
- package/scripts/publishing/pipeline/01-clean.ts +11 -0
- package/scripts/publishing/pipeline/02-validate-pre.ts +8 -0
- package/scripts/publishing/pipeline/03-build.ts +7 -0
- package/scripts/publishing/pipeline/04-validate-post.ts +8 -0
- package/scripts/publishing/pipeline/05-prepare-package.ts +29 -0
- package/scripts/publishing/pipeline/06-version.ts +23 -0
- package/scripts/publishing/pipeline/07-publish.ts +14 -0
- package/scripts/publishing/pipeline/08-cleanup.ts +5 -0
- package/scripts/publishing/types.ts +36 -0
- package/scripts/publishing/utils/command.ts +15 -0
- package/scripts/publishing/utils/config.ts +17 -0
- package/scripts/validate.ts +166 -0
- package/tsconfig.json +45 -0
- package/tsconfig.scripts.json +15 -0
- package/esm2022/aakash58-chatbot.mjs +0 -5
- package/esm2022/lib/app/chat/chat-ui-state.service.mjs +0 -170
- package/esm2022/lib/app/chat/chat.service.mjs +0 -445
- package/esm2022/lib/app/chat/components/chat-button/chat-button.component.mjs +0 -50
- package/esm2022/lib/app/chat/components/chat-footer/chat-footer.component.mjs +0 -12
- package/esm2022/lib/app/chat/components/chat-header/chat-header.component.mjs +0 -66
- package/esm2022/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.mjs +0 -186
- package/esm2022/lib/app/chat/components/chat-window/chat-window.component.mjs +0 -312
- package/esm2022/lib/app/chat/components/message-input/message-input.component.mjs +0 -36
- package/esm2022/lib/app/chat/components/message-list/message-list.component.mjs +0 -115
- package/esm2022/lib/app/chat/model/chat-history.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-request.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-response.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-session.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-stream-message.model.mjs +0 -2
- package/esm2022/lib/app/chat/model/chat-stream-response.model.mjs +0 -2
- package/esm2022/lib/app/chat/services/chat-api.service.mjs +0 -61
- package/esm2022/lib/app/chat/services/chat-audio.service.mjs +0 -50
- package/esm2022/lib/app/chat/services/chat-history.service.mjs +0 -252
- package/esm2022/lib/app/login/login-form.component.mjs +0 -46
- package/esm2022/lib/app/personalization/personalization-dialog.component.mjs +0 -194
- package/esm2022/lib/app/personalization/personalization.service.mjs +0 -149
- package/esm2022/lib/app/personalization/sections/account/account-section.component.mjs +0 -122
- package/esm2022/lib/app/personalization/sections/preferences/color-picker-dialog.component.mjs +0 -86
- package/esm2022/lib/app/personalization/sections/preferences/preferences-section.component.mjs +0 -115
- package/esm2022/lib/app/personalization/sections/profile/profile-section.component.mjs +0 -29
- package/esm2022/lib/app/personalization/sections/settings/setting-section.component.mjs +0 -30
- package/esm2022/lib/app/personalization/sections/terms/terms-section.component.mjs +0 -12
- package/esm2022/lib/constant/doohbot-constant.mjs +0 -28
- package/esm2022/lib/constant/html-entities.mjs +0 -9
- package/esm2022/lib/constant/utf8.mjs +0 -10
- package/esm2022/lib/core/app-const.mjs +0 -61
- package/esm2022/lib/core/auth/account-api.service.mjs +0 -40
- package/esm2022/lib/core/auth/auth.service.mjs +0 -391
- package/esm2022/lib/core/auth/models/auth-result.model.mjs +0 -3
- package/esm2022/lib/core/auth/models/federated-login-request.model.mjs +0 -6
- package/esm2022/lib/core/auth/models/login-request.model.mjs +0 -6
- package/esm2022/lib/core/auth/storage.service.mjs +0 -110
- package/esm2022/lib/core/directives/draggable/draggable-dialog.directive.mjs +0 -112
- package/esm2022/lib/core/directives/fullscreen/fullscreen.directive.mjs +0 -55
- package/esm2022/lib/core/directives/resizable/resizable-dialog.directive.mjs +0 -179
- package/esm2022/lib/core/environments/environment.mjs +0 -15
- package/esm2022/lib/core/environments/environment.prod.mjs +0 -15
- package/esm2022/lib/core/helpers/crypto-helper.service.mjs +0 -52
- package/esm2022/lib/core/http/http-stream.service.mjs +0 -97
- package/esm2022/lib/core/http/http.service.mjs +0 -103
- package/esm2022/lib/core/interceptors/auth.interceptor.mjs +0 -96
- package/esm2022/lib/core/interceptors/license.interceptor.mjs +0 -44
- package/esm2022/lib/core/models/api-config.model.mjs +0 -18
- package/esm2022/lib/core/models/api-request.model.mjs +0 -2
- package/esm2022/lib/core/models/api-response.model.mjs +0 -8
- package/esm2022/lib/core/models/doohbot-config.model.mjs +0 -18
- package/esm2022/lib/core/models/license.model.mjs +0 -2
- package/esm2022/lib/core/models/message.mjs +0 -2
- package/esm2022/lib/core/models/theme-config.model.mjs +0 -2
- package/esm2022/lib/core/services/core-config.service.mjs +0 -52
- package/esm2022/lib/core/services/license.service.mjs +0 -145
- package/esm2022/lib/core/services/markdown.service.mjs +0 -64
- package/esm2022/lib/core/services/theme.service.mjs +0 -248
- package/esm2022/lib/core/types/auth-mode.type.mjs +0 -2
- package/esm2022/lib/core/types/auth-status.type.mjs +0 -5
- package/esm2022/lib/core/types/chat-stream.type.mjs +0 -2
- package/esm2022/lib/core/types/message-role.type.mjs +0 -2
- package/esm2022/lib/core/types/prompt-mode.type.mjs +0 -5
- package/esm2022/lib/core/types/snackbar-error.type.mjs +0 -5
- package/esm2022/lib/core/types/tenant-resolution-strategy.type.mjs +0 -2
- package/esm2022/lib/core/utils/logger.service.mjs +0 -42
- package/esm2022/lib/doohbot-input.mjs +0 -20
- package/esm2022/lib/doohbot.component.mjs +0 -444
- package/esm2022/lib/predefined_messages.mjs +0 -15
- package/esm2022/lib/shared/chips/chips.component.mjs +0 -28
- package/esm2022/lib/shared/dialog/dialog.component.mjs +0 -36
- package/esm2022/lib/shared/dialog/dialog.service.mjs +0 -64
- package/esm2022/lib/shared/dialog/dialog.utils.mjs +0 -85
- package/esm2022/lib/shared/dropdown-menu/dropdown-menu.component.mjs +0 -29
- package/esm2022/lib/shared/input-dialog/input-dialog.component.mjs +0 -38
- package/esm2022/lib/shared/menu-item/menu-item.component.mjs +0 -24
- package/esm2022/lib/shared/pipes/simple-markdown.pipe.mjs +0 -27
- package/esm2022/lib/shared/snackbar/snackbar.component.mjs +0 -43
- package/esm2022/lib/shared/snackbar/snackbar.service.mjs +0 -46
- package/esm2022/lib/shared/snackbar/snackbar.utils.mjs +0 -43
- package/esm2022/public-api.mjs +0 -37
- package/fesm2022/aakash58-chatbot.mjs +0 -5193
- package/fesm2022/aakash58-chatbot.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/app/chat/chat-ui-state.service.d.ts +0 -96
- package/lib/app/chat/chat.service.d.ts +0 -88
- package/lib/app/chat/components/chat-button/chat-button.component.d.ts +0 -16
- package/lib/app/chat/components/chat-footer/chat-footer.component.d.ts +0 -5
- package/lib/app/chat/components/chat-header/chat-header.component.d.ts +0 -24
- package/lib/app/chat/components/chat-history-sidebar/chat-history-sidebar.component.d.ts +0 -49
- package/lib/app/chat/components/chat-window/chat-window.component.d.ts +0 -107
- package/lib/app/chat/components/message-input/message-input.component.d.ts +0 -12
- package/lib/app/chat/components/message-list/message-list.component.d.ts +0 -40
- package/lib/app/chat/model/chat-history.model.d.ts +0 -51
- package/lib/app/chat/model/chat-request.model.d.ts +0 -10
- package/lib/app/chat/model/chat-response.model.d.ts +0 -9
- package/lib/app/chat/model/chat-session.model.d.ts +0 -12
- package/lib/app/chat/model/chat-stream-response.model.d.ts +0 -10
- package/lib/app/chat/services/chat-api.service.d.ts +0 -30
- package/lib/app/chat/services/chat-audio.service.d.ts +0 -19
- package/lib/app/chat/services/chat-history.service.d.ts +0 -53
- package/lib/app/login/login-form.component.d.ts +0 -20
- package/lib/app/personalization/personalization-dialog.component.d.ts +0 -53
- package/lib/app/personalization/personalization.service.d.ts +0 -66
- package/lib/app/personalization/sections/account/account-section.component.d.ts +0 -30
- package/lib/app/personalization/sections/preferences/color-picker-dialog.component.d.ts +0 -17
- package/lib/app/personalization/sections/preferences/preferences-section.component.d.ts +0 -27
- package/lib/app/personalization/sections/profile/profile-section.component.d.ts +0 -17
- package/lib/app/personalization/sections/settings/setting-section.component.d.ts +0 -10
- package/lib/app/personalization/sections/terms/terms-section.component.d.ts +0 -5
- package/lib/constant/doohbot-constant.d.ts +0 -12
- package/lib/constant/html-entities.d.ts +0 -8
- package/lib/constant/utf8.d.ts +0 -9
- package/lib/core/app-const.d.ts +0 -11
- package/lib/core/auth/account-api.service.d.ts +0 -20
- package/lib/core/auth/auth.service.d.ts +0 -90
- package/lib/core/auth/models/auth-result.model.d.ts +0 -4
- package/lib/core/auth/models/federated-login-request.model.d.ts +0 -5
- package/lib/core/auth/models/login-request.model.d.ts +0 -6
- package/lib/core/auth/storage.service.d.ts +0 -21
- package/lib/core/directives/draggable/draggable-dialog.directive.d.ts +0 -23
- package/lib/core/directives/fullscreen/fullscreen.directive.d.ts +0 -14
- package/lib/core/directives/resizable/resizable-dialog.directive.d.ts +0 -30
- package/lib/core/environments/environment.d.ts +0 -7
- package/lib/core/environments/environment.prod.d.ts +0 -7
- package/lib/core/helpers/crypto-helper.service.d.ts +0 -12
- package/lib/core/http/http-stream.service.d.ts +0 -18
- package/lib/core/http/http.service.d.ts +0 -20
- package/lib/core/interceptors/auth.interceptor.d.ts +0 -18
- package/lib/core/interceptors/license.interceptor.d.ts +0 -11
- package/lib/core/models/api-config.model.d.ts +0 -58
- package/lib/core/models/api-request.model.d.ts +0 -77
- package/lib/core/models/api-response.model.d.ts +0 -6
- package/lib/core/models/doohbot-config.model.d.ts +0 -81
- package/lib/core/models/message.d.ts +0 -16
- package/lib/core/models/theme-config.model.d.ts +0 -28
- package/lib/core/services/core-config.service.d.ts +0 -23
- package/lib/core/services/license.service.d.ts +0 -33
- package/lib/core/services/markdown.service.d.ts +0 -8
- package/lib/core/services/theme.service.d.ts +0 -40
- package/lib/core/utils/logger.service.d.ts +0 -11
- package/lib/doohbot-input.d.ts +0 -19
- package/lib/doohbot.component.d.ts +0 -108
- package/lib/predefined_messages.d.ts +0 -2
- package/lib/shared/chips/chips.component.d.ts +0 -10
- package/lib/shared/dialog/dialog.component.d.ts +0 -19
- package/lib/shared/dialog/dialog.service.d.ts +0 -29
- package/lib/shared/dialog/dialog.utils.d.ts +0 -41
- package/lib/shared/dropdown-menu/dropdown-menu.component.d.ts +0 -11
- package/lib/shared/input-dialog/input-dialog.component.d.ts +0 -20
- package/lib/shared/menu-item/menu-item.component.d.ts +0 -9
- package/lib/shared/pipes/simple-markdown.pipe.d.ts +0 -10
- package/lib/shared/snackbar/snackbar.component.d.ts +0 -14
- package/lib/shared/snackbar/snackbar.service.d.ts +0 -19
- package/public-api.d.ts +0 -11
- /package/{src → projects/doohbot/src}/assets/bot.mp3 +0 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { loadConfig } from './utils/config';
|
|
2
|
+
import { cleanStep } from './pipeline/01-clean';
|
|
3
|
+
import { validatePreStep } from './pipeline/02-validate-pre';
|
|
4
|
+
import { buildStep } from './pipeline/03-build';
|
|
5
|
+
import { validatePostStep } from './pipeline/04-validate-post';
|
|
6
|
+
import { preparePackageStep } from './pipeline/05-prepare-package';
|
|
7
|
+
import { versionStep } from './pipeline/06-version';
|
|
8
|
+
import { publishStep } from './pipeline/07-publish';
|
|
9
|
+
import { cleanupStep } from './pipeline/08-cleanup';
|
|
10
|
+
import { PublishContext, VersionIncrement } from './types';
|
|
11
|
+
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
const dryRun = args.includes('--dry-run');
|
|
14
|
+
const patch = args.includes('--patch');
|
|
15
|
+
const minor = args.includes('--minor');
|
|
16
|
+
const major = args.includes('--major');
|
|
17
|
+
const useRootPkg = args.includes('--root');
|
|
18
|
+
const projectName = args.find(a => !a.startsWith('--'));
|
|
19
|
+
|
|
20
|
+
if (!projectName) {
|
|
21
|
+
console.error('Usage: npm run publish -- <project-name> [--dry-run] [--patch|--minor|--major] [--root]');
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const config = loadConfig();
|
|
26
|
+
const project = config.projects[projectName];
|
|
27
|
+
|
|
28
|
+
if (!project) {
|
|
29
|
+
console.error(`[ERROR] Project ${projectName} not found in config.`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const versionIncrement: VersionIncrement | undefined = patch ? 'patch' : minor ? 'minor' : major ? 'major' : undefined;
|
|
34
|
+
|
|
35
|
+
const context: PublishContext = {
|
|
36
|
+
project,
|
|
37
|
+
projectName,
|
|
38
|
+
dryRun,
|
|
39
|
+
versionIncrement,
|
|
40
|
+
config,
|
|
41
|
+
sourcePackageJson: useRootPkg ? 'package.json' : project.packageJson
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
async function runPipeline() {
|
|
45
|
+
console.log(`\n🚀 Starting Modular Publishing Pipeline for: ${projectName}`);
|
|
46
|
+
console.log(`📦 Source Package JSON: ${context.sourcePackageJson}`);
|
|
47
|
+
if (dryRun) console.log('⚠️ DRY RUN MODE ENABLED');
|
|
48
|
+
|
|
49
|
+
try {
|
|
50
|
+
await cleanStep(context);
|
|
51
|
+
await versionStep(context);
|
|
52
|
+
await validatePreStep(context);
|
|
53
|
+
await buildStep(context);
|
|
54
|
+
await validatePostStep(context);
|
|
55
|
+
await preparePackageStep(context);
|
|
56
|
+
await publishStep(context);
|
|
57
|
+
await cleanupStep(context);
|
|
58
|
+
|
|
59
|
+
console.log('\n✅ Pipeline completed successfully!');
|
|
60
|
+
} catch (error) {
|
|
61
|
+
console.error('\n❌ Pipeline failed!');
|
|
62
|
+
console.error(error);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
runPipeline();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { PublishContext } from '../types';
|
|
4
|
+
|
|
5
|
+
export const cleanStep = async (context: PublishContext): Promise<void> => {
|
|
6
|
+
const distPath = path.resolve(process.cwd(), context.project.distPath);
|
|
7
|
+
if (fs.existsSync(distPath)) {
|
|
8
|
+
console.log(`[CLEAN] Removing ${distPath}`);
|
|
9
|
+
fs.rmSync(distPath, { recursive: true, force: true });
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { runCommand } from '../utils/command';
|
|
2
|
+
import { PublishContext } from '../types';
|
|
3
|
+
|
|
4
|
+
export const validatePreStep = async (context: PublishContext): Promise<void> => {
|
|
5
|
+
console.log('[VALIDATE] Running pre-build checks...');
|
|
6
|
+
const rootFlag = context.sourcePackageJson === 'package.json' ? ' --root' : '';
|
|
7
|
+
runCommand(`ts-node -P tsconfig.scripts.json scripts/validate.ts ${context.projectName}${rootFlag}`);
|
|
8
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { runCommand } from '../utils/command';
|
|
2
|
+
import { PublishContext } from '../types';
|
|
3
|
+
|
|
4
|
+
export const buildStep = async (context: PublishContext): Promise<void> => {
|
|
5
|
+
console.log(`[BUILD] Building project: ${context.projectName}`);
|
|
6
|
+
runCommand(`ng build ${context.projectName} --configuration production`);
|
|
7
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { runCommand } from '../utils/command';
|
|
2
|
+
import { PublishContext } from '../types';
|
|
3
|
+
|
|
4
|
+
export const validatePostStep = async (context: PublishContext): Promise<void> => {
|
|
5
|
+
console.log('[VALIDATE] Running post-build checks...');
|
|
6
|
+
const rootFlag = context.sourcePackageJson === 'package.json' ? ' --root' : '';
|
|
7
|
+
runCommand(`ts-node -P tsconfig.scripts.json scripts/validate.ts ${context.projectName}${rootFlag}`);
|
|
8
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { runCommand } from '../utils/command';
|
|
2
|
+
import { PublishContext } from '../types';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
|
|
6
|
+
export const preparePackageStep = async (context: PublishContext): Promise<void> => {
|
|
7
|
+
console.log('[PREPARE] Checking package integrity...');
|
|
8
|
+
const distFullPath = path.resolve(process.cwd(), context.project.distPath);
|
|
9
|
+
const distPkgPath = path.join(distFullPath, 'package.json');
|
|
10
|
+
const sourcePkgPath = path.resolve(process.cwd(), context.sourcePackageJson);
|
|
11
|
+
const sourcePkg = JSON.parse(fs.readFileSync(sourcePkgPath, 'utf8'));
|
|
12
|
+
|
|
13
|
+
if (fs.existsSync(distPkgPath)) {
|
|
14
|
+
const distPkg = JSON.parse(fs.readFileSync(distPkgPath, 'utf8'));
|
|
15
|
+
|
|
16
|
+
// Sync name, version, and peerDependencies from the source specified in context
|
|
17
|
+
console.log(`[PREPARE] Syncing dist/package.json with metadata from ${context.sourcePackageJson}`);
|
|
18
|
+
distPkg.name = sourcePkg.name;
|
|
19
|
+
distPkg.version = sourcePkg.version;
|
|
20
|
+
if (sourcePkg.peerDependencies) {
|
|
21
|
+
distPkg.peerDependencies = sourcePkg.peerDependencies;
|
|
22
|
+
}
|
|
23
|
+
fs.writeFileSync(distPkgPath, JSON.stringify(distPkg, null, 2));
|
|
24
|
+
|
|
25
|
+
console.log(`[PREPARE] Packing package: ${distPkg.name}@${distPkg.version}`);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
runCommand(`npm pack --dry-run`, distFullPath);
|
|
29
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { runCommand } from '../utils/command';
|
|
2
|
+
import { PublishContext } from '../types';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import * as fs from 'fs';
|
|
5
|
+
|
|
6
|
+
export const versionStep = async (context: PublishContext): Promise<void> => {
|
|
7
|
+
const pkgPath = path.resolve(process.cwd(), context.sourcePackageJson);
|
|
8
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
9
|
+
|
|
10
|
+
if (context.versionIncrement) {
|
|
11
|
+
console.log(`[VERSION] Incrementing version (${context.versionIncrement}) in ${pkgPath}`);
|
|
12
|
+
// If we are versioning the root package, we might want to be careful.
|
|
13
|
+
// But the user requested to be able to publish from root package json.
|
|
14
|
+
const dir = path.dirname(pkgPath);
|
|
15
|
+
runCommand(`npm version ${context.versionIncrement} --no-git-tag-version`, dir);
|
|
16
|
+
|
|
17
|
+
// Refresh pkg after versioning
|
|
18
|
+
const updatedPkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
19
|
+
console.log(`[VERSION] New version: ${updatedPkg.version}`);
|
|
20
|
+
} else {
|
|
21
|
+
console.log(`[VERSION] Using existing version from ${context.sourcePackageJson}: ${pkg.version}`);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { runCommand } from '../utils/command';
|
|
2
|
+
import { PublishContext } from '../types';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
|
|
5
|
+
export const publishStep = async (context: PublishContext): Promise<void> => {
|
|
6
|
+
if (context.dryRun) {
|
|
7
|
+
console.log('[PUBLISH] Dry run: skipping registry push.');
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const distFullPath = path.resolve(process.cwd(), context.project.distPath);
|
|
12
|
+
console.log(`[PUBLISH] Publishing from ${distFullPath}`);
|
|
13
|
+
runCommand(`npm publish --access public`, distFullPath);
|
|
14
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface ProjectConfig {
|
|
2
|
+
path: string;
|
|
3
|
+
distPath: string;
|
|
4
|
+
packageJson: string;
|
|
5
|
+
ngPackageJson: string;
|
|
6
|
+
validate: {
|
|
7
|
+
peerDependencies: string[];
|
|
8
|
+
forbiddenDependencies: string[];
|
|
9
|
+
allowedNonPeerDependencies: string[];
|
|
10
|
+
checkRuntimeInDist: boolean;
|
|
11
|
+
checkPlatformCreation: boolean;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface PublishConfig {
|
|
16
|
+
projects: Record<string, ProjectConfig>;
|
|
17
|
+
publishing: {
|
|
18
|
+
registry: string;
|
|
19
|
+
vcs: {
|
|
20
|
+
provider: string;
|
|
21
|
+
tag: boolean;
|
|
22
|
+
push: boolean;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export type VersionIncrement = 'patch' | 'minor' | 'major';
|
|
28
|
+
|
|
29
|
+
export interface PublishContext {
|
|
30
|
+
project: ProjectConfig;
|
|
31
|
+
projectName: string;
|
|
32
|
+
dryRun: boolean;
|
|
33
|
+
versionIncrement?: VersionIncrement;
|
|
34
|
+
config: PublishConfig;
|
|
35
|
+
sourcePackageJson: string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { execSync } from 'child_process';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Runs a shell command synchronously and inherits stdio.
|
|
5
|
+
* @param command The command to execute.
|
|
6
|
+
* @param cwd The working directory for the command.
|
|
7
|
+
*/
|
|
8
|
+
export function runCommand(command: string, cwd: string = process.cwd()): void {
|
|
9
|
+
console.log(`[EXEC] ${command}`);
|
|
10
|
+
try {
|
|
11
|
+
execSync(command, { stdio: 'inherit', cwd });
|
|
12
|
+
} catch (error) {
|
|
13
|
+
throw error;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import { PublishConfig } from '../types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Loads the publishing configuration from the root directory.
|
|
6
|
+
*/
|
|
7
|
+
export function loadConfig(): PublishConfig {
|
|
8
|
+
const configPath = path.resolve(process.cwd(), 'publish.config.js');
|
|
9
|
+
try {
|
|
10
|
+
// Using require because the config file itself might still be JS/CommonJS
|
|
11
|
+
// or we could convert it to TS later, but for now this works.
|
|
12
|
+
return require(configPath);
|
|
13
|
+
} catch (e) {
|
|
14
|
+
console.error(`[ERROR] Could not load config from ${configPath}`);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
|
|
4
|
+
// Interface for project configuration
|
|
5
|
+
interface ProjectConfig {
|
|
6
|
+
path: string;
|
|
7
|
+
distPath: string;
|
|
8
|
+
packageJson: string;
|
|
9
|
+
validate: {
|
|
10
|
+
peerDependencies: string[];
|
|
11
|
+
forbiddenDependencies: string[];
|
|
12
|
+
checkRuntimeInDist: boolean;
|
|
13
|
+
checkPlatformCreation: boolean;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const configPath = path.resolve(process.cwd(), 'publish.config.js');
|
|
18
|
+
let config: any;
|
|
19
|
+
try {
|
|
20
|
+
config = require(configPath);
|
|
21
|
+
} catch (e) {
|
|
22
|
+
console.error(`[ERROR] Could not load config from ${configPath}. Ensure it is a valid CommonJS file.`);
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function validateProject(projectName: string, project: ProjectConfig, options: { useRoot: boolean }) {
|
|
27
|
+
const pkgRelativePath = options.useRoot ? 'package.json' : project.packageJson;
|
|
28
|
+
const pkgPath = path.resolve(process.cwd(), pkgRelativePath);
|
|
29
|
+
const mode = options.useRoot ? 'WORKSPACE ROOT' : 'LIBRARY';
|
|
30
|
+
|
|
31
|
+
console.log(`\n==================================================`);
|
|
32
|
+
console.log(`🔍 Validating ${projectName} [${mode} MODE]`);
|
|
33
|
+
console.log(`📦 File: ${pkgRelativePath}`);
|
|
34
|
+
console.log(`==================================================`);
|
|
35
|
+
|
|
36
|
+
let errors = 0;
|
|
37
|
+
let warnings = 0;
|
|
38
|
+
const checks: string[] = [];
|
|
39
|
+
|
|
40
|
+
if (!fs.existsSync(pkgPath)) {
|
|
41
|
+
console.error(`[ERROR] package.json not found at ${pkgPath}`);
|
|
42
|
+
return 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8'));
|
|
46
|
+
const deps = pkg.dependencies || {};
|
|
47
|
+
const peerDeps = pkg.peerDependencies || {};
|
|
48
|
+
|
|
49
|
+
// 1. Forbidden Dependencies Check
|
|
50
|
+
if (!options.useRoot) {
|
|
51
|
+
let forbiddenFound = false;
|
|
52
|
+
project.validate.forbiddenDependencies.forEach((dep: string) => {
|
|
53
|
+
if (deps[dep]) {
|
|
54
|
+
console.error(`[CRITICAL] NG0400 Risk: '${dep}' found in 'dependencies' in ${pkgRelativePath}. It must be in 'peerDependencies'.`);
|
|
55
|
+
errors++;
|
|
56
|
+
forbiddenFound = true;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
checks.push(forbiddenFound ? '❌ Forbidden Dependencies' : '✅ No Forbidden Dependencies');
|
|
60
|
+
} else {
|
|
61
|
+
checks.push('⏭️ Forbidden Dependencies (Skipped for Workspace Root)');
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// 2. Peer Dependencies Presence Check
|
|
65
|
+
let peersValid = true;
|
|
66
|
+
project.validate.peerDependencies.forEach((dep: string) => {
|
|
67
|
+
if (!peerDeps[dep]) {
|
|
68
|
+
console.warn(`[WARNING] '${dep}' missing from 'peerDependencies' in ${pkgRelativePath}. Recommended for library compatibility.`);
|
|
69
|
+
warnings++;
|
|
70
|
+
peersValid = false;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
const peerIcon = peersValid ? '✅' : '⚠️ ';
|
|
74
|
+
checks.push(`${peerIcon} Peer Dependencies (Completeness)`);
|
|
75
|
+
|
|
76
|
+
// 3. Platform Creation Check
|
|
77
|
+
if (project.validate.checkPlatformCreation) {
|
|
78
|
+
const srcPath = path.resolve(process.cwd(), project.path, 'src');
|
|
79
|
+
if (fs.existsSync(srcPath)) {
|
|
80
|
+
const files = getAllFiles(srcPath, ['.ts']);
|
|
81
|
+
let platformFound = false;
|
|
82
|
+
files.forEach(file => {
|
|
83
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
84
|
+
if (content.includes('platformBrowserDynamic')) {
|
|
85
|
+
console.error(`[CRITICAL] NG0400 Cause: 'platformBrowserDynamic()' found in ${path.relative(process.cwd(), file)}. Libraries should not create platforms.`);
|
|
86
|
+
errors++;
|
|
87
|
+
platformFound = true;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
checks.push(platformFound ? '❌ Platform Creation Check' : '✅ No Platform Creation (platformBrowserDynamic)');
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// 4. Runtime in Dist Check
|
|
95
|
+
if (project.validate.checkRuntimeInDist) {
|
|
96
|
+
const distPath = path.resolve(process.cwd(), project.distPath);
|
|
97
|
+
if (fs.existsSync(distPath)) {
|
|
98
|
+
const distFiles = getAllFiles(distPath, ['.mjs', '.js']);
|
|
99
|
+
let runtimeFound = false;
|
|
100
|
+
distFiles.forEach(file => {
|
|
101
|
+
const content = fs.readFileSync(file, 'utf8');
|
|
102
|
+
if (content.includes('ɵdefineComponent') && content.includes('providePlatform')) {
|
|
103
|
+
console.error(`[CRITICAL] NG0400 Risk: Angular runtime code detected in bundle: ${path.relative(process.cwd(), file)}`);
|
|
104
|
+
errors++;
|
|
105
|
+
runtimeFound = true;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
checks.push(runtimeFound ? '❌ Runtime Dist Check' : '✅ No Runtime code in bundle');
|
|
109
|
+
} else {
|
|
110
|
+
checks.push('⏭️ Runtime Dist Check (Dist folder not found)');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
console.log('\nSummary of checks:');
|
|
115
|
+
checks.forEach(c => console.log(` ${c}`));
|
|
116
|
+
|
|
117
|
+
if (errors === 0) {
|
|
118
|
+
console.log(`\n[SUCCESS] Project ${projectName} passed validation with ${warnings} warning(s).\n`);
|
|
119
|
+
} else {
|
|
120
|
+
console.error(`\n[FAILURE] Project ${projectName} failed with ${errors} error(s) and ${warnings} warning(s).\n`);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return errors;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function getAllFiles(dir: string, extensions: string[], fileList: string[] = []): string[] {
|
|
127
|
+
const files = fs.readdirSync(dir);
|
|
128
|
+
files.forEach(file => {
|
|
129
|
+
const name = path.join(dir, file);
|
|
130
|
+
if (fs.statSync(name).isDirectory()) {
|
|
131
|
+
getAllFiles(name, extensions, fileList);
|
|
132
|
+
} else {
|
|
133
|
+
if (extensions.some(ext => name.endsWith(ext))) {
|
|
134
|
+
fileList.push(name);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
return fileList;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
async function run() {
|
|
142
|
+
const args = process.argv.slice(2);
|
|
143
|
+
const useRoot = args.includes('--root');
|
|
144
|
+
const projectArgs = args.filter(arg => !arg.startsWith('--'));
|
|
145
|
+
|
|
146
|
+
let totalErrors = 0;
|
|
147
|
+
|
|
148
|
+
const projectsToValidate = projectArgs.length > 0 ? projectArgs : Object.keys(config.projects);
|
|
149
|
+
|
|
150
|
+
for (const projectName of projectsToValidate) {
|
|
151
|
+
const project = config.projects[projectName];
|
|
152
|
+
if (project) {
|
|
153
|
+
totalErrors += await validateProject(projectName, project, { useRoot });
|
|
154
|
+
} else {
|
|
155
|
+
console.error(`[ERROR] Project '${projectName}' not found in publish.config.js`);
|
|
156
|
+
totalErrors++;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
process.exit(totalErrors > 0 ? 1 : 0);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
run().catch(err => {
|
|
164
|
+
console.error(err);
|
|
165
|
+
process.exit(1);
|
|
166
|
+
});
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */
|
|
2
|
+
/* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */
|
|
3
|
+
{
|
|
4
|
+
"compileOnSave": false,
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"paths": {
|
|
7
|
+
"doohbot": ["./dist/doohbot"]
|
|
8
|
+
},
|
|
9
|
+
"strict": true,
|
|
10
|
+
"noImplicitOverride": true,
|
|
11
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
12
|
+
"noImplicitReturns": true,
|
|
13
|
+
"noFallthroughCasesInSwitch": true,
|
|
14
|
+
"skipLibCheck": true,
|
|
15
|
+
"isolatedModules": true,
|
|
16
|
+
"experimentalDecorators": true,
|
|
17
|
+
"importHelpers": true,
|
|
18
|
+
"target": "ES2022",
|
|
19
|
+
"module": "esnext",
|
|
20
|
+
"moduleResolution": "node",
|
|
21
|
+
"useDefineForClassFields": false
|
|
22
|
+
},
|
|
23
|
+
"angularCompilerOptions": {
|
|
24
|
+
"enableI18nLegacyMessageIdFormat": false,
|
|
25
|
+
"strictInjectionParameters": true,
|
|
26
|
+
"strictInputAccessModifiers": true,
|
|
27
|
+
"typeCheckHostBindings": true,
|
|
28
|
+
"strictTemplates": true
|
|
29
|
+
},
|
|
30
|
+
"files": [],
|
|
31
|
+
"references": [
|
|
32
|
+
{
|
|
33
|
+
"path": "./projects/doohbot/tsconfig.lib.json"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"path": "./projects/doohbot/tsconfig.spec.json"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "./projects/app-doohbot/tsconfig.app.json"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"path": "./projects/app-doohbot/tsconfig.spec.json"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"strict": true,
|
|
9
|
+
"outDir": "dist-scripts"
|
|
10
|
+
},
|
|
11
|
+
"include": [
|
|
12
|
+
"scripts/publishing/**/*.ts",
|
|
13
|
+
"scripts/validate.ts"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
export * from './public-api';
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWFrYXNoNTgtY2hhdGJvdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL2Rvb2hib3Qvc3JjL2Fha2FzaDU4LWNoYXRib3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
|