Skip to content

Commit 60813b2

Browse files
pavel-s-epamsha4bemichelu89
authored
Change project structure to monorepo with library, demo project, and generator (#154)
* Add comments for further refactoring * Setup nx workspace Description: - Moved the current implementation to _legacy folder - Initialized nx workspace from scratch - Angular 20.x - Jest - Playwright - Added demo application - Setup all the commands to run demo application and all the quality checks * Update package.json * Add @esmf/semantic-ui-components library scaffold * Add @esmf/semantic-ui-schematic library scaffold * Add @nx/plugin dependency * Remove components and schematic libraries * Add @esmf/semantic-ui-schematic library scaffold * Add table generator Description The table generator creates an example file ba running the command - nx command - nx g @esmf/semantic-ui-schematic:table --name=test --project=demo - ng command - npm run ng -- g @esmf/semantic-ui-schematic:table --name=test --project=demo * Add table generator Description The table generator creates an example file ba running the command - nx command - nx g @esmf/semantic-ui-schematic:table --name=test --project=demo - ng command - npm run ng -- g @esmf/semantic-ui-schematic:table --name=test --project=demo * Tiny change for table generator schema * Make generators buildable * Add required dependencies * Add TableCellTooltipDirective to schematic library components * Add HighlightDirective to schematic library components * Add very basic TableCell component to schematic library components * Test highlight.directive.ts Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Migrate highlight.directive.ts to signals Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Update highlight.directive.ts usage in table-cell.html Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * feat: Resize column directive (#9) * Add resize-column.directive.ts Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Migrate resize-column.directive.ts to signals Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> --------- Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Copied generators to the new structure This is the old schematic generators that works with predefined generation output locations * Add paginator-select-config.provider.ts (#11) Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Update Inquirer initialization * Fix generation running * Generate types to the defined component path * Generate all the erequired components by specified path property * Add export-table-dialog.component.ts (#13) Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Add table-cell-link.component.ts (#15) Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Add Prompt for generation destination folder * Remove console.log * feat: Move TableCellComponent to general components (#17) * Add table-cell.component.ts Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Remove legacy ResizeDirective source Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Remove legacy ExportTableDialog source Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Remove legacy TableCellLinkComponent source Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> --------- Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Make TableService generic RemoteTableService and StaticTableService are generic. CustomRemoteTableService if generated on request * Make ChipList component generic * Remove useless test * Add output signal to ChipList * Rename directive EsmfHorizontalOverflowDirective * feat: Move ConfigMenuComponent to general components (#20) * Add config-menu.component.ts Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Update schematic lib entities to have "Esmf" prefix JSSdkLocalStorageService => EsmfLocalStorageService Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Remove ConfigMenuComponent legacy code Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Remove EsmfPaginatorSelectConfigProvider from Table Module template Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> --------- Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Add generic Static and Remote table data source implementation * Improve table component generation logic * make CommandBar component standalone * Remove redundant config interface * Generate types file to the correct directory * Move ShowDescription pipe * Remove redundant validate-input directive * Move some styles form general styles file * Make ColumnMenu component generic * Move custom changes to schematic generation * Move custom changes to schematic generation. Part 2 * Add trackBy function * Add Command Bar host class * Add local-storage.service.ts (#23) Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Remove semantic explanation from table header * Extract RQL Extension interfaces from table generation * Add requestParam input property to simplify adding params to table requests * Set strict dependency versions * Decouple Table and Config Menu components Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Fix jest config Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> * Align prettier version and plugins to run prettier with a project configuration * Update prettier directory to run after generation * Set tsconfig strict option for schematic library * Remove any and enum types * Update FilterEnums type * Set SelectionModel type * Add schematic lib translations * Add missing transloco config * Add control flow to table and toolbar * Update demo app * Add transloco scoped translations * Init translocoat demo app * Add predefined material theme * Add styles to the main demo app component * Add types to getConfigurationFileConfig * Update package-lock * Add the updated package.json * Update command-bar generation * Update table generation * Set the right @angular/cdk version at peerDependencies * Update remote data handling at generation template * Update schematic general components with integration changes * Update GitHub action commands and package.json * Fix schematic translations at demo app * Update GitHub Actions command --------- Signed-off-by: Pavel Shalamkov <hpl7fe@bosch.com> Co-authored-by: Anton Shabatin <anton.shabatin@bosch.com> Co-authored-by: Anton Shabatin <131185633+sha4be@users.noreply.github.com> Co-authored-by: Michele Santoro <10807610+michelu89@users.noreply.github.com>
1 parent 775ccaf commit 60813b2

File tree

568 files changed

+68783
-6165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

568 files changed

+68783
-6165
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
max_line_length = off
13+
trim_trailing_whitespace = false

.github/workflows/push_request_check.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
pull_request:
77
branches: [ '**' ]
88
paths-ignore:
9-
- 'documentation/decisions/**'
9+
- '../../_legacy/documentation/decisions/**'
1010

1111
jobs:
1212
build:
@@ -37,13 +37,13 @@ jobs:
3737
cache-dependency-path: '**/package-lock.json'
3838

3939
- name: Install Dependencies
40-
run: npm install
40+
run: npm ci --ignore-scripts
4141

4242
- name: Testing Project
43-
run: npm run test
43+
run: npx nx test schematic
4444

4545
- name: Linting Project
46-
run: npm run lint
46+
run: npx nx lint schematic
4747

4848
- name: Build Project
49-
run: npm run build
49+
run: npx nx build schematic

.github/workflows/tagged_release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ jobs:
5858
file_pattern: 'documentation/js-sdk-guide/antora.yml'
5959

6060
- name: Install Dependencies
61-
run: npm install
61+
run: npm ci --ignore-scripts
6262

6363
- name: Set app version
6464
run: npm version ${{ github.event.inputs.release_version }} --no-git-tag-version
6565

6666
- name: Build Project
67-
run: npm run build
67+
run: npx nx build schematic
6868

6969
# This should be removed as soon as we go towards nodejs package repository
7070
- name: Pack Project as tgz
71-
run: npm pack
71+
run: cd dist/libs/schematic && npm pack
7272

7373
- name: "Create Github release (full)"
7474
if: ${{ !contains( github.event.inputs.release_version, '-rc' ) }}

.gitignore

Lines changed: 46 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,47 @@
1-
# Outputs
2-
src/**/*.js
3-
src/**/*.js.map
4-
src/**/*.d.ts
5-
6-
# IDEs
7-
.idea/
8-
jsconfig.json
9-
.vscode/
10-
11-
# Misc
12-
jest-stare/
13-
.yalc/
14-
node_modules/
15-
.npm
16-
npm-debug.log*
17-
yarn-error.log*
18-
*wizard.config.json
19-
20-
# Mac OSX Finder files.
21-
**/.DS_Store
1+
# See https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files for more about ignoring files.
2+
3+
# compiled output
4+
dist
5+
tmp
6+
out-tsc
7+
libs/schematic/.tmp-generators
8+
9+
# dependencies
10+
node_modules
11+
12+
# IDEs and editors
13+
/.idea
14+
.project
15+
.classpath
16+
.c9/
17+
*.launch
18+
.settings/
19+
*.sublime-workspace
20+
21+
# IDE - VSCode
22+
.vscode/*
23+
!.vscode/settings.json
24+
!.vscode/tasks.json
25+
!.vscode/launch.json
26+
!.vscode/extensions.json
27+
28+
# misc
29+
/.sass-cache
30+
/connect.lock
31+
/coverage
32+
/libpeerconnection.log
33+
npm-debug.log
34+
yarn-error.log
35+
testem.log
36+
/typings
37+
38+
# System Files
2239
.DS_Store
40+
Thumbs.db
41+
42+
.nx/cache
43+
.nx/workspace-data
44+
.cursor/rules/nx-rules.mdc
45+
.github/instructions/nx.instructions.md
46+
47+
.angular

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sh ./.husky/run-transloco-scoped-lib.sh

.husky/run-transloco-scoped-lib.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
#
3+
# Copyright Robert Bosch Manufacturing Solutions GmbH, Germany. All rights reserved.
4+
#
5+
6+
echo "Retrieve staged files that match the specified patterns"
7+
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '^libs/schematic.*/assets/i18n/.*.json$')
8+
9+
if [ "$STAGED_FILES" = "" ]; then
10+
exit 0
11+
fi
12+
13+
echo "Format the staged files"
14+
transloco-scoped-libs --skip-gitignore
15+
16+
# Add the updated files back to the staging area
17+
git diff --name-only --diff-filter=M | grep '\.vendor\.json$' | xargs git add
18+
19+
exit 0

.nxignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore the legacy workspace so Nx plugins don't attempt to process it
2+
_legacy/**

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add files here to ignore them from prettier formatting
2+
/dist
3+
/coverage
4+
/.nx/cache
5+
/.nx/workspace-data
6+
.angular

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"printWidth": 140,
33
"singleQuote": true,
44
"useTabs": false,
5-
"tabWidth": 4,
5+
"tabWidth": 2,
66
"semi": true,
77
"bracketSpacing": false,
88
"arrowParens": "avoid"

.verdaccio/config.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# path to a directory with all packages
2+
storage: ../tmp/local-registry/storage
3+
4+
# a list of other known repositories we can talk to
5+
uplinks:
6+
npmjs:
7+
url: https://registry.npmjs.org/
8+
maxage: 60m
9+
10+
packages:
11+
'**':
12+
# give all users (including non-authenticated users) full access
13+
# because it is a local registry
14+
access: $all
15+
publish: $all
16+
unpublish: $all
17+
18+
# if package is not available locally, proxy requests to npm registry
19+
proxy: npmjs
20+
21+
# log settings
22+
log:
23+
type: stdout
24+
format: pretty
25+
level: warn
26+
27+
publish:
28+
allow_offline: true # set offline to true to allow publish offline

0 commit comments

Comments
 (0)