Skip to content

Commit

Permalink
Fix core UI schematics (#211)
Browse files Browse the repository at this point in the history
* fix: update parse5 to no default export for schemantics

* refactor: update schemantics dev readme

* ci: update github actions

* refactor: use placeholders for versions
  • Loading branch information
boeckMt authored Jan 9, 2024
1 parent 13f74ba commit 2ade9eb
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 54 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.13.0
node-version: 20.10.0

# This builds the project for projects/demo-maps and outputs the result to the 'dist' folder.
# https://github.com/angular/angular-cli/issues/9016#issuecomment-526825531
Expand All @@ -22,7 +22,7 @@ jobs:
npx ng build demo-maps --configuration=production --base-href=/ukis-frontend-libraries/
- name: Deploy
uses: JamesIves/github-pages-deploy-action@4.1.1
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: dist/demo-maps # The folder the action should deploy.
32 changes: 16 additions & 16 deletions .github/workflows/package-main-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
needs: checkHeadBranch
steps:
# - uses: actions/checkout@v3
# - uses: actions/checkout@v4
# needs uses: actions/checkout@ if script/module is required
- name: checkTitelTag
uses: actions/github-script@v6
Expand Down Expand Up @@ -61,14 +61,14 @@ jobs:
needs: checkTitelTag
if: ${{ needs.checkTitelTag.outputs.VERSION_TAG != '' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: checkout tag
run: |
git fetch --all --tags
git checkout ${{ needs.checkTitelTag.outputs.VERSION_TAG }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18.13.0
node-version: 20.10.0
- run: rm -f .npmrc
- uses: ./.github/actions/check-tag-on-npm
with:
Expand All @@ -81,14 +81,14 @@ jobs:
runs-on: ubuntu-latest
if: ${{ needs.checkTitelTag.outputs.VERSION_TAG != '' }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: checkout tag
run: |
git fetch --all --tags
git checkout ${{ needs.checkTitelTag.outputs.VERSION_TAG }}
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18.13.0
node-version: 20.10.0
- name: build
run: |
npm ci
Expand Down Expand Up @@ -123,7 +123,7 @@ jobs:
if: ${{ needs.checkTitelTag.outputs.VERSION_TAG != '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: checkout tag
run: |
git fetch --all --tags
Expand All @@ -138,15 +138,15 @@ jobs:
needs: [checkHeadBranch, checkTitelTag, checkTagOnNpm, build, checkLabel, gh-release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download dist result from job build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: "dist"
path: dist
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18.13.0
node-version: 20.10.0
registry-url: https://npm.pkg.github.com/
scope: "@dlr-eoc"
- run: npm ci
Expand All @@ -169,15 +169,15 @@ jobs:
needs: [checkHeadBranch, checkTitelTag, checkTagOnNpm, build, checkLabel, gh-release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download dist result from job build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: "dist"
path: dist
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18.13.0
node-version: 20.10.0
registry-url: https://registry.npmjs.org/
scope: "@dlr-eoc"
- run: npm ci
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/package-pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
# check out before using actions reference from the same repository!
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.13.0
node-version: 20.10.0
- run: rm -f .npmrc
- uses: ./.github/actions/check-tag-on-npm
with:
Expand All @@ -38,10 +38,10 @@ jobs:
needs: checkTagOnNpm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.13.0
node-version: 20.10.0
- uses: ./.github/actions/test
- name: build
run: |
Expand All @@ -57,15 +57,15 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download dist result from job build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: "dist"
path: dist
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18.13.0
node-version: 20.10.0
registry-url: https://npm.pkg.github.com/
scope: "@dlr-eoc"
- run: npm ci
Expand All @@ -88,15 +88,15 @@ jobs:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Download dist result from job build
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: "dist"
path: dist
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: 18.13.0
node-version: 20.10.0
registry-url: https://registry.npmjs.org/
scope: "@dlr-eoc"
- run: npm ci
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18.13.0
node-version: 20.10.0
- uses: ./.github/actions/test
- uses: ./.github/actions/build
16 changes: 9 additions & 7 deletions TUTORIALS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ For this tutorial to work you need a code editor of your choice (e.g. Visual Stu
## Setting up UKIS core-ui
### 1. Generate a new [Angular application](https://angular.io/cli/new) in the same Version like specified in our package.json [@angular/core](package.json).
For this you have to install `@angular/cli` in this specific Version first.
- For this tutorial use version `14.1.1`
- See ukis-frontend-libraries package.json [version of @angular/core](package.json)
```
npm install -g @angular/cli@14.1.1
npm install -g @angular/cli@<version>
```

- Then run:
Expand All @@ -24,10 +24,10 @@ ng new project-tutorial-map --style=scss
cd project-tutorial-map
```
### 3. Add Clarity Angular
- At the moment Clarity does not support angular schematics ([github ng add issue](https://github.com/vmware-clarity/ng-clarity/issues/120)). Therefore Clarity has to be installed manually.
- At the moment Clarity does not support angular schematics ([github ng add issue](https://github.com/vmware-clarity/ng-clarity/issues/120)). Therefore Clarity has to be installed manually. For the versions also see ukis-frontend-libraries [package.json](package.json)
- Run
```
npm install @cds/core @clr/angular @clr/ui
npm install @cds/core@<version> @clr/angular@<version> @clr/ui@<version> @clr/icons@<version>
```
- Add Clarity styles and scripts in the angular.json:
```
Expand Down Expand Up @@ -67,14 +67,16 @@ npm install @cds/core @clr/angular @clr/ui


### 4. Run the ng add command for the UKIS core-ui
- First you have to match the dependency of rxjs ([for ukis-frontend-libraries@10.1.0](package.json)), to do this you need to run
- First you have to match the dependency of rxjs ([for ukis-frontend-libraries](package.json)), to do this you need to run
```
npm install rxjs@6.6.7
npm install rxjs@<version>
```
- Then run
```
ng add @dlr-eoc/core-ui@10.1.0 --project=project-tutorial-map
ng add @dlr-eoc/core-ui@<version> --project=project-tutorial-map
```
to add files and styles from ukis-frontend-libraries in the desired version.

- Answer the promt with `Y`
- In this tutorial more additional options of the core-ui ng add like routing are not required.
- [for more information see core-ui ng-add](projects/core-ui/schematics/ng-add/schema.json)
Expand Down
15 changes: 6 additions & 9 deletions projects/core-ui/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ https://blog.angular.io/schematics-an-introduction-dc1dfbc2a2b2
}
```
2. build the schematics `ng build core-ui`
2. build the schematics `ng build --configuration=production core-ui `
3. set Versions in build `node scripts/library/index.js --set`
3. create a new project `ng new my-project`
4. create a new project `ng new my-project`
4. link to the Schematics in the new project `npm link $PATH_TO_SCHEMATIC_PROJECT` e.g. (`npm link ../frontend-libraries/dist/core-ui`)
5. link to the Schematics in the new project `npm link $PATH_TO_SCHEMATIC_PROJECT` e.g. (`npm link ../frontend-libraries/dist/core-ui`)
5. run the schematics in the new project `schematics @dlr-eoc/core-ui:ng-add` or `ng generate @dlr-eoc/core-ui:ng-add --project=<my-project>` or `ng generate @dlr-eoc/core-ui:ng-add --project=<my-project> --routing=true`
6. run the schematics in the new project `schematics @dlr-eoc/core-ui:ng-add` or `ng generate @dlr-eoc/core-ui:ng-add` or `ng generate @dlr-eoc/core-ui:ng-add --routing=true`
7. Update -> run step 1. and 2 again (You don't have to unlink and relink)
6. Update -> run step 2. again (You don't have to unlink and relink)
to unlink use
Expand All @@ -32,8 +30,7 @@ to unlink use
remove files in test app:
- `git clean -fd`
- `git checkout .`
- `git clean -fd && git checkout .`
### Unit Testing
Expand Down
2 changes: 1 addition & 1 deletion projects/core-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@angular-devkit/core": "^16.2.1",
"@angular-devkit/schematics": "^16.2.1",
"@schematics/angular": "^16.2.1",
"parse5-html-rewriting-stream": "^6.0.1",
"parse5-html-rewriting-stream": "^7.0.0",
"tslib": "^2.4.0"
},
"peerDependencies": {
Expand Down

0 comments on commit 2ade9eb

Please sign in to comment.