fam-archetype-app 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -0
- package/package.json +25 -0
- package/src/collection.json +10 -0
- package/src/fam-archetype-app/files/.editorconfig +16 -0
- package/src/fam-archetype-app/files/.prettierignore +15 -0
- package/src/fam-archetype-app/files/.prettierrc.json +29 -0
- package/src/fam-archetype-app/files/LICENSE.md +21 -0
- package/src/fam-archetype-app/files/README.md +59 -0
- package/src/fam-archetype-app/files/angular.json.template +178 -0
- package/src/fam-archetype-app/files/cli +361 -0
- package/src/fam-archetype-app/files/eslint.config.js +89 -0
- package/src/fam-archetype-app/files/package-lock.json.template +18812 -0
- package/src/fam-archetype-app/files/package.json.template +62 -0
- package/src/fam-archetype-app/files/src/assets/fonts/DiBaScreen-Regular.woff2 +0 -0
- package/src/fam-archetype-app/files/src/assets/translations/translations-ca.json +284 -0
- package/src/fam-archetype-app/files/src/assets/translations/translations-en.json +28 -0
- package/src/fam-archetype-app/files/src/assets/translations/translations-es.json +28 -0
- package/src/fam-archetype-app/files/src/core/layout/component/footer/footer.component.html.template +3 -0
- package/src/fam-archetype-app/files/src/core/layout/component/footer/footer.component.scss +8 -0
- package/src/fam-archetype-app/files/src/core/layout/component/layout/layout.component.html +19 -0
- package/src/fam-archetype-app/files/src/core/layout/component/layout/layout.component.scss +28 -0
- package/src/fam-archetype-app/files/src/core/layout/component/main-info-popup/main-info-popup.component.html +33 -0
- package/src/fam-archetype-app/files/src/core/layout/component/main-info-popup/main-info-popup.component.scss +3 -0
- package/src/fam-archetype-app/files/src/core/layout/component/menu/menu.component.html +3 -0
- package/src/fam-archetype-app/files/src/core/layout/component/menu/menu.component.scss +163 -0
- package/src/fam-archetype-app/files/src/core/layout/component/menuitem/menuitem.component.html +39 -0
- package/src/fam-archetype-app/files/src/core/layout/component/menuitem/menuitem.component.scss +44 -0
- package/src/fam-archetype-app/files/src/core/layout/component/not-found/not-found.component.html +12 -0
- package/src/fam-archetype-app/files/src/core/layout/component/not-found/not-found.component.scss +17 -0
- package/src/fam-archetype-app/files/src/core/layout/component/sidebar/sidebar.component.html +13 -0
- package/src/fam-archetype-app/files/src/core/layout/component/sidebar/sidebar.component.scss +33 -0
- package/src/fam-archetype-app/files/src/core/layout/component/top-menu/top-menu.component.html +12 -0
- package/src/fam-archetype-app/files/src/core/layout/component/top-menu/top-menu.component.scss +9 -0
- package/src/fam-archetype-app/files/src/core/layout/component/topbar/_mixins.scss +8 -0
- package/src/fam-archetype-app/files/src/core/layout/component/topbar/topbar.component.html.template +45 -0
- package/src/fam-archetype-app/files/src/core/layout/component/topbar/topbar.component.scss +77 -0
- package/src/fam-archetype-app/files/src/environments/environment.dev.ts.template +12 -0
- package/src/fam-archetype-app/files/src/environments/environment.int.ts.template +12 -0
- package/src/fam-archetype-app/files/src/environments/environment.pre.ts.template +12 -0
- package/src/fam-archetype-app/files/src/environments/environment.ts.template +12 -0
- package/src/fam-archetype-app/files/src/index.html.template +18 -0
- package/src/fam-archetype-app/files/src/shared/filters/diba-filters/diba-filters.component.html +69 -0
- package/src/fam-archetype-app/files/src/shared/filters/diba-filters/diba-filters.component.scss +0 -0
- package/src/fam-archetype-app/files/src/shared/styles/_movements.scss +19 -0
- package/src/fam-archetype-app/files/src/shared/styles/global/_core.scss +20 -0
- package/src/fam-archetype-app/files/src/shared/styles/global/_icons.scss +37 -0
- package/src/fam-archetype-app/files/src/shared/styles/global/_tooltips.scss +14 -0
- package/src/fam-archetype-app/files/src/shared/styles/global/_typography.scss +68 -0
- package/src/fam-archetype-app/files/src/shared/styles/global/_utils.scss +24 -0
- package/src/fam-archetype-app/files/src/shared/styles/global/layout.scss +5 -0
- package/src/fam-archetype-app/files/src/shared/table/column-visibility-selector/column-visibility-selector.component.html +10 -0
- package/src/fam-archetype-app/files/src/shared/table/column-visibility-selector/column-visibility-selector.component.scss +0 -0
- package/src/fam-archetype-app/files/src/shared/table/diba-table/diba-table.component.html +136 -0
- package/src/fam-archetype-app/files/src/shared/table/diba-table/diba-table.component.scss +0 -0
- package/src/fam-archetype-app/files/src/styles.scss +109 -0
- package/src/fam-archetype-app/files/src/tailwind.css +3 -0
- package/src/fam-archetype-app/files/tailwind.config.js +36 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/commands/commands.txt +1 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/commands/db_to_entities.txt +1 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/commands/test_db_connection.txt +1 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/databases.yaml +188 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/downloads/.keep +0 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/lib/.keep +0 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamActivitat.entity +26 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamActivitatsUbicacio.entity +40 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamAlumne.entity +76 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamArea.entity +33 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamComanda.entity +37 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamCurs.entity +50 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamDocument.entity +53 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamDocumentTipus.entity +26 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamEntitatBase.entity +84 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamExpedient.entity +71 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamExpedientDocument.entity +51 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamExpedientEstat.entity +26 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamExpedientTipus.entity +26 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamJerarquia.entity +33 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamLinia.entity +56 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamMatricula.entity +63 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamTipusArticle.entity +26 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamUbicacio.entity +35 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FamZona.entity +27 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/Funcionalitat.entity +65 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/FuncionalitatGrupFunc.entity +58 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/GrupFuncionalitat.entity +54 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/PerfilGrupFuncionalitat.entity +50 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/VusPerfil.entity +31 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/models/app/model.yaml +4 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/telosys-tools.cfg +31 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/telosys.env +5 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/README.md +12 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/database.properties +23 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/include/init_var_entity.vm +169 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/include/macros.vm +218 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/app_config_ts.vm +56 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/app_routes_ts.vm +21 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/core/layout/component/menu/menu_component_ts.vm +30 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/core/layout/component/top-menu/top-menu_component_ts.vm +36 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/core/layout/service/menu_model_service_ts.vm +49 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/create-Xxx_use-case_ts.vm +18 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/create-file-Xxx_use-case_ts.vm +17 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/delete-Xxx_use-case_ts.vm +17 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/download-Xxx-file_use-case_ts.vm +24 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/find-Xxx_use-case_ts.vm +18 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/search-Xxx_use-case_ts.vm +25 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/application/update-Xxx_use-case_ts.vm +18 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/domain/Xxx_entity_ts.vm +36 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/domain/Xxx_repository_interface_ts.vm +27 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/mappers/Xxx_jsona_mapper_ts.vm +52 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/mappers/Xxx_mapper_ts.vm +36 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/Xxx_routes_ts.vm +15 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/detail/Xxx_detail_html.vm +178 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/detail/Xxx_detail_scss.vm +0 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/detail/Xxx_detail_spec_ts.vm +29 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/detail/Xxx_detail_ts.vm +382 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/list/Xxx_list_html.vm +37 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/list/Xxx_list_scss.vm +10 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/list/Xxx_list_spec_ts.vm +29 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/pages/list/Xxx_list_ts.vm +430 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/inbound/resources/Xxx_resource_ts.vm +43 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/modules/infrastructure/outbound/Xxx_repository_impl_ts.vm +162 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/main-angular/test_code.vm +3 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/templates.cfg +52 -0
- package/src/fam-archetype-app/files/tools/cli/TelosysTools/templates/fam-app-templates/tools-test/test-api_Xxx_rest.vm +181 -0
- package/src/fam-archetype-app/files/tools/cli/telosys +5 -0
- package/src/fam-archetype-app/files/tools/cli/telosys-cli-4.2.0-001.jar +0 -0
- package/src/fam-archetype-app/files/tools/cli/telosys-cli.cfg +55 -0
- package/src/fam-archetype-app/files/tools/cli/telosys-term.sh +30 -0
- package/src/fam-archetype-app/files/tools/cli/telosys.bat +4 -0
- package/src/fam-archetype-app/files/tools/cli/telosys.ico +0 -0
- package/src/fam-archetype-app/files/tools/db/develop/data/.keep +0 -0
- package/src/fam-archetype-app/files/tools/db/production/data/.keep +0 -0
- package/src/fam-archetype-app/files/tools/db/production/migrations/.keep +0 -0
- package/src/fam-archetype-app/files/tools/docs/.keep +0 -0
- package/src/fam-archetype-app/files/tools/test/test-api.rest +80 -0
- package/src/fam-archetype-app/files/tsconfig.app.json +15 -0
- package/src/fam-archetype-app/files/tsconfig.json +42 -0
- package/src/fam-archetype-app/files/tsconfig.spec.json +15 -0
- package/src/fam-archetype-app/files/vercel.json +9 -0
- package/src/fam-archetype-app/index.d.ts +2 -0
- package/src/fam-archetype-app/index.js +18 -0
- package/src/fam-archetype-app/index.js.map +1 -0
- package/src/fam-archetype-app/index_spec.d.ts +1 -0
- package/src/fam-archetype-app/index_spec.js +23 -0
- package/src/fam-archetype-app/index_spec.js.map +1 -0
- package/src/fam-archetype-app/schema.json +21 -0
- package/tsconfig.json +24 -0
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
VERSION=1.0.0
|
|
4
|
+
|
|
5
|
+
# Color variables
|
|
6
|
+
red=$"`tput setaf 1`"
|
|
7
|
+
green=$"`tput setaf 2`"
|
|
8
|
+
yellow=$"`tput setaf 3`"
|
|
9
|
+
blue=$"`tput setaf 4`"
|
|
10
|
+
reset=$"`tput sgr0`"
|
|
11
|
+
|
|
12
|
+
# Format variables
|
|
13
|
+
now='+%Y-%m-%d_%H:%M:%S'
|
|
14
|
+
|
|
15
|
+
# Global variables
|
|
16
|
+
RUN_CODE_GEN=0
|
|
17
|
+
RUN_P_LOCAL=0
|
|
18
|
+
RUN_P_DEV=0
|
|
19
|
+
RUN_P_INT=0
|
|
20
|
+
RUN_P_PRE=0
|
|
21
|
+
RUN_P_PRO=0
|
|
22
|
+
RUN_BUILD=0
|
|
23
|
+
RUN_CLEAN=0
|
|
24
|
+
RUN_INSTALL=0
|
|
25
|
+
RUN_UPDATE=0
|
|
26
|
+
RUN_SERVE=0
|
|
27
|
+
RUN_TEST=0
|
|
28
|
+
RUN_AUDIT=0
|
|
29
|
+
RUN_FORMAT=0
|
|
30
|
+
RUN_DB_TEST=0
|
|
31
|
+
RUN_DB_REVERSE=0
|
|
32
|
+
|
|
33
|
+
# Local Development type (Native:NLD or Container:CLD)
|
|
34
|
+
IS_NLD=0
|
|
35
|
+
IS_CLD=0
|
|
36
|
+
|
|
37
|
+
# #############################################################################
|
|
38
|
+
#
|
|
39
|
+
# Private section
|
|
40
|
+
#
|
|
41
|
+
# #############################################################################
|
|
42
|
+
|
|
43
|
+
function print_help {
|
|
44
|
+
echo
|
|
45
|
+
echo 'usage: cli [--help] [--version]'
|
|
46
|
+
echo ' <command>'
|
|
47
|
+
echo
|
|
48
|
+
echo 'Available commands are:'
|
|
49
|
+
echo
|
|
50
|
+
echo ' code-gen Run code generation tool'
|
|
51
|
+
echo
|
|
52
|
+
echo ' c, clean Run rm -rf dist/ (remove dist folder)'
|
|
53
|
+
echo ' i, install Run npm install'
|
|
54
|
+
echo ' u, update Run npm update'
|
|
55
|
+
echo ' local Run npx ng build --configuration=local'
|
|
56
|
+
echo ' dev Run npx ng build --configuration=dev'
|
|
57
|
+
echo ' int Run npx ng build --configuration=int'
|
|
58
|
+
echo ' pre Run npx ng build --configuration=pre'
|
|
59
|
+
echo ' pro Run npx ng build --configuration=pro'
|
|
60
|
+
echo ' f, format Run npx prettier --write'
|
|
61
|
+
echo ' a, audit Run eslint'
|
|
62
|
+
echo ' s, serve Run npx ng serve'
|
|
63
|
+
echo ' t, test Run npx ng test'
|
|
64
|
+
echo ' dbtest Run telosys db connection test'
|
|
65
|
+
echo ' dbrev Run telosys db reverse engineering to extract models from database'
|
|
66
|
+
echo
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function print_version {
|
|
70
|
+
echo <%= name %> project CLI v$VERSION
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function configure_paths {
|
|
74
|
+
if [ -f $HOME/.env ]; then
|
|
75
|
+
|
|
76
|
+
# If .env file existe then is Native Local Development
|
|
77
|
+
IS_NLD=1
|
|
78
|
+
|
|
79
|
+
# Load .env variables
|
|
80
|
+
export $(cat $HOME/.env | sed 's/#.*//g' | xargs)
|
|
81
|
+
|
|
82
|
+
# Configure java
|
|
83
|
+
export JAVA_HOME=$WS_HOME/tools/jdk/jdk-21.0.2
|
|
84
|
+
|
|
85
|
+
# Configure maven
|
|
86
|
+
export M2_HOME=$WS_HOME/tools/maven/maven-3.9.9
|
|
87
|
+
|
|
88
|
+
# Configure node
|
|
89
|
+
export NODE_HOME=$WS_HOME/tools/node/node-22.12.0
|
|
90
|
+
|
|
91
|
+
# This is only necessary when running Maven in a MINGW environment
|
|
92
|
+
export MAVEN_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED"
|
|
93
|
+
|
|
94
|
+
# Expose all paths
|
|
95
|
+
export PATH=$PATH:$JAVA_HOME:$M2_HOME/bin:$NODE_HOME
|
|
96
|
+
else
|
|
97
|
+
# If .env file not existe then is Container Local Development
|
|
98
|
+
IS_CLD=1
|
|
99
|
+
fi
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function init_code_gen_tool {
|
|
103
|
+
echo "${blue}[`date $now`] Task: initialize code generation tool...${reset}"
|
|
104
|
+
groupId=$(mvn help:evaluate -Dexpression=project.groupId -q -DforceStdout)
|
|
105
|
+
artifactId=$(mvn help:evaluate -Dexpression=project.artifactId -q -DforceStdout)
|
|
106
|
+
projectContext=$(mvn help:evaluate -Dexpression=app-context -q -DforceStdout)
|
|
107
|
+
sed -i "s/PROJECT_ROOT_PKG/${groupId}.${artifactId//-/.}/g" tools/cli/TelosysTools/telosys-tools.cfg
|
|
108
|
+
sed -i "s/PROJECT_BASE_PKG/${groupId}/g" tools/cli/TelosysTools/telosys-tools.cfg
|
|
109
|
+
sed -i "s/PROJECT_CONTEXT/${projectContext}/g" tools/cli/TelosysTools/telosys-tools.cfg
|
|
110
|
+
echo "${green}[`date $now`] Result: code generation tool initialized successfully${reset}"
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function clean_directories() {
|
|
114
|
+
echo "${yellow}[`date $now`] Run: clean old source code${reset}"
|
|
115
|
+
rm -rf "$(pwd)/src/modules/"*
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function rename_directories() {
|
|
119
|
+
start_dir=$1
|
|
120
|
+
# Busca todos los directorios, ordena por profundidad inversa para renombrar de adentro hacia afuera
|
|
121
|
+
find "$start_dir" -depth -type d | while read -r dir; do
|
|
122
|
+
base=$(basename "$dir")
|
|
123
|
+
# Convierte camelCase o PascalCase a kebab-case
|
|
124
|
+
kebab=$(echo "$base" | sed -r 's/([a-z0-9])([A-Z])/\1-\2/g' | sed 's/_/-/g' | tr 'A-Z' 'a-z')
|
|
125
|
+
if [[ "$base" != "$kebab" ]]; then
|
|
126
|
+
mv -v "$dir" "$(dirname "$dir")/$kebab"
|
|
127
|
+
fi
|
|
128
|
+
done
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function rename_files_to_kebab_case() {
|
|
132
|
+
start_dir=$1
|
|
133
|
+
# Busca todos los archivos, ordena por profundidad inversa para evitar conflictos
|
|
134
|
+
find "$start_dir" -depth -type f | while read -r file; do
|
|
135
|
+
base=$(basename "$file")
|
|
136
|
+
dir=$(dirname "$file")
|
|
137
|
+
# Convierte camelCase o PascalCase a kebab-case
|
|
138
|
+
kebab=$(echo "$base" | sed -r 's/([a-z0-9])([A-Z])/\1-\2/g' | sed 's/_/-/g' | tr 'A-Z' 'a-z')
|
|
139
|
+
if [[ "$base" != "$kebab" ]]; then
|
|
140
|
+
mv -v "$file" "$dir/$kebab"
|
|
141
|
+
fi
|
|
142
|
+
done
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
function run_code_gen_tool {
|
|
146
|
+
echo "${blue}[`date $now`] Task: code generation...${reset}"
|
|
147
|
+
clean_directories
|
|
148
|
+
echo "${yellow}[`date $now`] Run: Telosys tool${reset}"
|
|
149
|
+
sh tools/cli/telosys -h tools/cli -i tools/cli/TelosysTools/commands/commands.txt
|
|
150
|
+
echo "${blue}[`date $now`] Task: Refactoring code generation...${reset}"
|
|
151
|
+
rename_directories 'src/modules';
|
|
152
|
+
rename_files_to_kebab_case 'src/modules';
|
|
153
|
+
echo "${green}[`date $now`] Result: code generated successfully${reset}"
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function ng_clean {
|
|
157
|
+
echo "${blue}[`date $now`] Task: clean project...${reset}"
|
|
158
|
+
echo "${yellow}[`date $now`] Run: rm -rf dist/${reset}"
|
|
159
|
+
rm -rf dist/
|
|
160
|
+
echo "${green}[`date $now`] Result: Project cleaned successfully${reset}"
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function ng_install {
|
|
164
|
+
echo "${blue}[`date $now`] Task: install project dependencies...${reset}"
|
|
165
|
+
echo "${yellow}[`date $now`] Run: npm install${reset}"
|
|
166
|
+
npm install
|
|
167
|
+
echo "${green}[`date $now`] Result: Project dependencies install successfully${reset}"
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function ng_update {
|
|
171
|
+
echo "${blue}[`date $now`] Task: update project dependencies...${reset}"
|
|
172
|
+
echo "${yellow}[`date $now`] Run: npm update${reset}"
|
|
173
|
+
npm update
|
|
174
|
+
echo "${green}[`date $now`] Result: Project dependencies update successfully${reset}"
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function ng_package() {
|
|
178
|
+
echo "${blue}[`date $now`] Task: build project with $1 profile...${reset}"
|
|
179
|
+
echo "${yellow}[`date $now`] Run: npx ng build --configuration=$1${reset}"
|
|
180
|
+
npx ng build --configuration=$1
|
|
181
|
+
echo "${green}[`date $now`] Result: Project compiled successfully${reset}"
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function ng_audit {
|
|
185
|
+
echo "${blue}[`date $now`] Task: audit source code...${reset}"
|
|
186
|
+
echo "${yellow}[`date $now`] Run: npm run lint${reset}"
|
|
187
|
+
npm run lint
|
|
188
|
+
echo "${green}[`date $now`] Result: Source code audit successfully${reset}"
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function ng_format {
|
|
192
|
+
echo "${blue}[`date $now`] Task: format source code...${reset}"
|
|
193
|
+
echo "${yellow}[`date $now`] Run: npx prettier --write .${reset}"
|
|
194
|
+
npx prettier --write .
|
|
195
|
+
echo "${green}[`date $now`] Result: Source code formated successfully${reset}"
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function ng_run {
|
|
199
|
+
echo "${blue}[`date $now`] Task: run app to local environment...${reset}"
|
|
200
|
+
echo "${yellow}[`date $now`] Run: npx ng serve${reset}"
|
|
201
|
+
npx ng serve
|
|
202
|
+
echo "${green}[`date $now`] Result: app run successfully${reset}"
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function ng_test {
|
|
206
|
+
echo "${blue}[`date $now`] Task: test project...${reset}"
|
|
207
|
+
echo "${yellow}[`date $now`] Run: npx ng test${reset}"
|
|
208
|
+
npx ng test
|
|
209
|
+
echo "${green}[`date $now`] Result: project tested successfully${reset}"
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function run_db_test {
|
|
213
|
+
echo "${blue}[`date $now`] Task: test db connection...${reset}"
|
|
214
|
+
sh tools/cli/telosys -h tools/cli -i tools/cli/TelosysTools/commands/test_db_connection.txt
|
|
215
|
+
echo "${green}[`date $now`] Test DB executed${reset}"
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
function run_db_reverse_model {
|
|
219
|
+
echo "${blue}[`date $now`] Task: test db connection...${reset}"
|
|
220
|
+
sh tools/cli/telosys -h tools/cli -i tools/cli/TelosysTools/commands/db_to_entities.txt
|
|
221
|
+
echo "${green}[`date $now`] Test DB executed${reset}"
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
# #############################################################################
|
|
225
|
+
#
|
|
226
|
+
# Main
|
|
227
|
+
#
|
|
228
|
+
# #############################################################################
|
|
229
|
+
|
|
230
|
+
if [ -z $1 ]
|
|
231
|
+
then
|
|
232
|
+
print_help
|
|
233
|
+
exit 1
|
|
234
|
+
elif [ -n $1 ]
|
|
235
|
+
then
|
|
236
|
+
configure_paths
|
|
237
|
+
|
|
238
|
+
for arg in "$@"
|
|
239
|
+
do
|
|
240
|
+
case $arg in
|
|
241
|
+
--version)
|
|
242
|
+
print_version
|
|
243
|
+
exit 1
|
|
244
|
+
;;
|
|
245
|
+
--help)
|
|
246
|
+
print_help
|
|
247
|
+
exit 1
|
|
248
|
+
;;
|
|
249
|
+
code-gen)
|
|
250
|
+
RUN_CODE_GEN=1
|
|
251
|
+
;;
|
|
252
|
+
local)
|
|
253
|
+
RUN_P_LOCAL=1
|
|
254
|
+
;;
|
|
255
|
+
dev)
|
|
256
|
+
RUN_P_DEV=1
|
|
257
|
+
;;
|
|
258
|
+
int)
|
|
259
|
+
RUN_P_INT=1
|
|
260
|
+
;;
|
|
261
|
+
pre)
|
|
262
|
+
RUN_P_PRE=1
|
|
263
|
+
;;
|
|
264
|
+
pro)
|
|
265
|
+
RUN_P_PRO=1
|
|
266
|
+
;;
|
|
267
|
+
c|clean)
|
|
268
|
+
RUN_CLEAN=1
|
|
269
|
+
;;
|
|
270
|
+
i|install)
|
|
271
|
+
RUN_INSTALL=1
|
|
272
|
+
;;
|
|
273
|
+
u|update)
|
|
274
|
+
RUN_UPDATE=1
|
|
275
|
+
;;
|
|
276
|
+
f|format)
|
|
277
|
+
RUN_FORMAT=1
|
|
278
|
+
;;
|
|
279
|
+
a|audit)
|
|
280
|
+
RUN_AUDIT=1
|
|
281
|
+
;;
|
|
282
|
+
s|serve)
|
|
283
|
+
RUN_SERVE=1
|
|
284
|
+
;;
|
|
285
|
+
t|test)
|
|
286
|
+
RUN_TEST=1
|
|
287
|
+
;;
|
|
288
|
+
dbtest)
|
|
289
|
+
RUN_DB_TEST=1
|
|
290
|
+
;;
|
|
291
|
+
dbrev)
|
|
292
|
+
RUN_DB_REVERSE=1
|
|
293
|
+
;;
|
|
294
|
+
esac
|
|
295
|
+
done
|
|
296
|
+
fi
|
|
297
|
+
|
|
298
|
+
# Run script
|
|
299
|
+
echo
|
|
300
|
+
|
|
301
|
+
if [ $RUN_CODE_GEN -eq 1 ]; then
|
|
302
|
+
run_code_gen_tool;
|
|
303
|
+
fi
|
|
304
|
+
|
|
305
|
+
if [ $RUN_CLEAN -eq 1 ]; then
|
|
306
|
+
ng_clean
|
|
307
|
+
fi
|
|
308
|
+
|
|
309
|
+
if [ $RUN_INSTALL -eq 1 ]; then
|
|
310
|
+
ng_install
|
|
311
|
+
fi
|
|
312
|
+
|
|
313
|
+
if [ $RUN_UPDATE -eq 1 ]; then
|
|
314
|
+
ng_update
|
|
315
|
+
fi
|
|
316
|
+
|
|
317
|
+
if [ $RUN_P_LOCAL -eq 1 ]; then
|
|
318
|
+
ng_package 'local'
|
|
319
|
+
fi
|
|
320
|
+
|
|
321
|
+
if [ $RUN_P_DEV -eq 1 ]; then
|
|
322
|
+
ng_package 'dev'
|
|
323
|
+
fi
|
|
324
|
+
|
|
325
|
+
if [ $RUN_P_INT -eq 1 ]; then
|
|
326
|
+
ng_package 'int'
|
|
327
|
+
fi
|
|
328
|
+
|
|
329
|
+
if [ $RUN_P_PRE -eq 1 ]; then
|
|
330
|
+
ng_package 'pre'
|
|
331
|
+
fi
|
|
332
|
+
|
|
333
|
+
if [ $RUN_P_PRO -eq 1 ]; then
|
|
334
|
+
ng_package 'pro'
|
|
335
|
+
fi
|
|
336
|
+
|
|
337
|
+
if [ $RUN_FORMAT -eq 1 ]; then
|
|
338
|
+
ng_format
|
|
339
|
+
fi
|
|
340
|
+
|
|
341
|
+
if [ $RUN_AUDIT -eq 1 ]; then
|
|
342
|
+
ng_audit
|
|
343
|
+
fi
|
|
344
|
+
|
|
345
|
+
if [ $RUN_SERVE -eq 1 ]; then
|
|
346
|
+
ng_run
|
|
347
|
+
fi
|
|
348
|
+
|
|
349
|
+
if [ $RUN_TEST -eq 1 ]; then
|
|
350
|
+
ng_test
|
|
351
|
+
fi
|
|
352
|
+
|
|
353
|
+
if [ $RUN_DB_TEST -eq 1 ]; then
|
|
354
|
+
run_db_test
|
|
355
|
+
fi
|
|
356
|
+
|
|
357
|
+
if [ $RUN_DB_REVERSE -eq 1 ]; then
|
|
358
|
+
run_db_reverse_model
|
|
359
|
+
fi
|
|
360
|
+
|
|
361
|
+
echo
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
root: true,
|
|
3
|
+
ignorePatterns: ['**/dist/**'],
|
|
4
|
+
plugins: ['prettier'],
|
|
5
|
+
extends: ['prettier'],
|
|
6
|
+
rules: {
|
|
7
|
+
'padding-line-between-statements': [
|
|
8
|
+
'error',
|
|
9
|
+
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
|
|
10
|
+
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
|
|
11
|
+
{ blankLine: 'any', prev: ['case', 'default'], next: 'break' },
|
|
12
|
+
{ blankLine: 'any', prev: 'case', next: 'case' },
|
|
13
|
+
{ blankLine: 'always', prev: '*', next: 'return' },
|
|
14
|
+
{ blankLine: 'always', prev: 'block', next: '*' },
|
|
15
|
+
{ blankLine: 'always', prev: '*', next: 'block' },
|
|
16
|
+
{ blankLine: 'always', prev: 'block-like', next: '*' },
|
|
17
|
+
{ blankLine: 'always', prev: '*', next: 'block-like' },
|
|
18
|
+
{ blankLine: 'always', prev: ['import'], next: ['const', 'let', 'var'] }
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
overrides: [
|
|
22
|
+
{
|
|
23
|
+
files: ['*.ts'],
|
|
24
|
+
parserOptions: {
|
|
25
|
+
project: ['tsconfig.json', 'e2e/tsconfig.json'],
|
|
26
|
+
createDefaultProgram: true
|
|
27
|
+
},
|
|
28
|
+
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'plugin:@angular-eslint/recommended', 'plugin:@angular-eslint/template/process-inline-templates', 'prettier'],
|
|
29
|
+
rules: {
|
|
30
|
+
'@angular-eslint/component-selector': [
|
|
31
|
+
'error',
|
|
32
|
+
{
|
|
33
|
+
type: 'element',
|
|
34
|
+
prefix: 'p',
|
|
35
|
+
style: 'kebab-case'
|
|
36
|
+
}
|
|
37
|
+
],
|
|
38
|
+
'@angular-eslint/directive-selector': [
|
|
39
|
+
'error',
|
|
40
|
+
{
|
|
41
|
+
type: 'attribute',
|
|
42
|
+
prefix: 'p',
|
|
43
|
+
style: 'camelCase'
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
'@angular-eslint/component-class-suffix': [
|
|
47
|
+
'error',
|
|
48
|
+
{
|
|
49
|
+
suffixes: ['']
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
'@angular-eslint/template/eqeqeq': [
|
|
53
|
+
'error',
|
|
54
|
+
{
|
|
55
|
+
allowNullOrUndefined: true
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
'@angular-eslint/no-host-metadata-property': 'off',
|
|
59
|
+
'@angular-eslint/no-output-on-prefix': 'off',
|
|
60
|
+
'@typescript-eslint/ban-types': 'off',
|
|
61
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
62
|
+
'@typescript-eslint/no-inferrable-types': 'off',
|
|
63
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
64
|
+
curly: 0,
|
|
65
|
+
'@typescript-eslint/member-ordering': [
|
|
66
|
+
'error',
|
|
67
|
+
{
|
|
68
|
+
default: ['public-static-field', 'static-field', 'instance-field', 'public-instance-method', 'public-static-field']
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
'no-console': 0,
|
|
72
|
+
'prefer-const': 0
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
files: ['*.html'],
|
|
77
|
+
extends: ['plugin:@angular-eslint/template/recommended', 'prettier'],
|
|
78
|
+
rules: {}
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
files: ['*.js'],
|
|
82
|
+
rules: {
|
|
83
|
+
parserOptions: {
|
|
84
|
+
allowImportExportEverywhere: true
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
]
|
|
89
|
+
};
|