Skip to content

Commit

Permalink
deps(workbench): update @scion/workbench to Angular 17
Browse files Browse the repository at this point in the history
closes #485

BREAKING CHANGE: Updating `@scion/workbench` to Angular 17 introduced a breaking change.

To migrate:
- update your application to Angular 17.x; for detailed migration instructions, refer to https://v17.angular.io/guide/update-to-latest-version;
- update @scion/components to version 17; for detailed migration instructions, refer to https://github.com/SchweizerischeBundesbahnen/scion-toolkit/blob/master/CHANGELOG_COMPONENTS.md;
- If deploying the application in a subdirectory, use a relative directory path for the browser to load the icon files relative to the document base URL (as specified in the `<base>` HTML tag). Note that using a relative path requires to exclude the icon files from the application build. Depending on building the application with esbuild `@angular-devkit/build-angular:application` or webpack `@angular-devkit/build-angular:browser`, different steps are required to exclude the icons from the build.

  ** Using @angular-devkit/build-angular:application (esbuild) **
  Configure the `@scion/workbench` SCSS module to load the icon font relative to the document base URL:
  ```scss
  use '@scion/workbench' with (
   $icon-font: (
     directory: 'path/to/font' // no leading slash, typically `assets/fonts`
   )
  ;
  ``

  Add the path to the `externalDependencies` build option in the `angular.json` file:
  ```json
  "externalDependencies": [
    "path/to/font/scion-workbench-icons.*"
  ]
  ```

  ** Using @angular-devkit/build-angular:browser (webpack) **
  Configure the `@scion/workbench` SCSS module to load the icon font relative to the document base URL:

  ```scss
  use '@scion/workbench' with (
    $icon-font: (
      directory: '^path/to/font' // no leading slash but with a caret (^), typically `^assets/fonts`
    )
  );
  ```
  • Loading branch information
Marcarrian authored and danielwiehl committed Nov 21, 2023
1 parent 25012d7 commit 637e8bd
Show file tree
Hide file tree
Showing 27 changed files with 10,596 additions and 12,188 deletions.
99 changes: 53 additions & 46 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: Continuous Integration and Delivery
on: [ push, pull_request ]
env:
NODE_VERSION: 18.16.0
NODE_VERSION: 20.9.0
jobs:
install:
name: 'Installing NPM modules'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: 'Caching NPM modules if necessary'
uses: actions/cache@v2
uses: actions/cache@v3
id: node-modules-cache
with:
path: ./node_modules
Expand All @@ -24,12 +24,12 @@ jobs:
needs: install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: 'Restoring NPM modules from cache'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ./node_modules
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -42,8 +42,8 @@ jobs:
workbench-version: ${{ steps.workbench-package-json.outputs.version }}
workbench-client-version: ${{ steps.workbench-client-package-json.outputs.version }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: 'Reading package.json version of scion/workbench'
Expand All @@ -57,28 +57,28 @@ jobs:
with:
path: projects/scion/workbench-client/package.json
- name: 'Restoring NPM modules from cache'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ./node_modules
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: 'Building @scion/workbench-client'
run: npm run workbench-client:build
- name: 'Uploading dist/scion/workbench-client'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: workbench-client-dist
path: dist/scion/workbench-client
- name: 'Building @scion/workbench'
run: npm run workbench:build
- name: 'Uploading dist/scion/workbench'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: workbench-dist
path: dist/scion/workbench
- name: 'Building TypeDoc for @scion/workbench-client'
run: npm run workbench-client:typedoc
- name: 'Uploading dist/workbench-client-api'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: workbench-client-api
path: dist/workbench-client-api
Expand All @@ -93,6 +93,8 @@ jobs:
cmd: npm run workbench-testing-app:ci:build
- name: workbench-testing-app-basehref
cmd: npm run workbench-testing-app:basehref:build
- name: workbench-testing-app-basehref-webpack
cmd: npm run workbench-testing-app:basehref-webpack:build
- name: workbench-testing-app-vercel
cmd: npm run workbench-testing-app:vercel:build
- name: workbench-client-testing-app-ci
Expand All @@ -102,28 +104,28 @@ jobs:
- name: workbench-getting-started-app
cmd: npm run workbench-getting-started-app:build
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: 'Restoring NPM modules from cache'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ./node_modules
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- name: 'Downloading dist/scion/workbench'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-dist
path: dist/scion/workbench
- name: 'Downloading dist/scion/workbench-client'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-client-dist
path: dist/scion/workbench-client
- name: 'Building ${{ matrix.app.name }}'
run: ${{ matrix.app.cmd }}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.app.name }}
path: dist/${{ matrix.app.name }}
Expand All @@ -132,22 +134,22 @@ jobs:
needs: build-libs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: 'Downloading dist/scion/workbench'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-dist
path: dist/scion/workbench
- name: 'Downloading dist/scion/workbench-client'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-client-dist
path: dist/scion/workbench-client
- name: 'Restoring NPM modules from cache'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ./node_modules
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -160,37 +162,42 @@ jobs:
matrix:
shard: [ 1/15, 2/15, 3/15, 4/15, 5/15, 6/15, 7/15, 8/15, 9/15, 10/15, 11/15, 12/15, 13/15, 14/15, 15/15 ]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: 'Downloading dist/scion/workbench'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-dist
path: dist/scion/workbench
- name: 'Downloading dist/scion/workbench-client'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-client-dist
path: dist/scion/workbench-client
- name: 'Downloading app: workbench-testing-app-ci (dist)'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-testing-app-ci
path: dist/workbench-testing-app-ci
- name: 'Downloading app: workbench-testing-app-basehref (dist)'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-testing-app-basehref
path: dist/workbench-testing-app-basehref
- name: 'Downloading app: workbench-testing-app-basehref-webpack (dist)'
uses: actions/download-artifact@v3
with:
name: workbench-testing-app-basehref-webpack
path: dist/workbench-testing-app-basehref-webpack
- name: 'Downloading app: workbench-client-testing-app-ci (dist)'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-client-testing-app-ci
path: dist/workbench-client-testing-app-ci
- name: 'Restoring NPM modules from cache'
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ./node_modules
key: node_modules-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
Expand All @@ -208,7 +215,7 @@ jobs:
outputs:
should-release: ${{ steps.tag-release-commit.outputs.is-release-commit }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: 'If release commit present, add release tag'
uses: SchweizerischeBundesbahnen/scion-toolkit/.github/actions/tag-release-commit@master
id: tag-release-commit
Expand All @@ -228,7 +235,7 @@ jobs:
outputs:
should-release: ${{ steps.tag-release-commit.outputs.is-release-commit }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: 'If release commit present, add release tag'
uses: SchweizerischeBundesbahnen/scion-toolkit/.github/actions/tag-release-commit@master
id: tag-release-commit
Expand All @@ -242,34 +249,34 @@ jobs:
needs: [ workbench-release-guard, workbench-client-release-guard ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: 'Downloading app: workbench-testing-app-vercel (dist)'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-testing-app-vercel
path: dist/workbench-testing-app-vercel
- name: 'Downloading app: workbench-client-testing-app-vercel (dist)'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-client-testing-app-vercel
path: dist/workbench-client-testing-app-vercel
- name: 'Downloading app: workbench-getting-started-app (dist)'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-getting-started-app
path: dist/workbench-getting-started-app
- name: 'Deploying workbench-testing-app to Vercel'
uses: SchweizerischeBundesbahnen/scion-toolkit/.github/actions/vercel-deploy@master
with:
dist-folder: dist/workbench-testing-app-vercel
dist-folder: dist/workbench-testing-app-vercel/browser
vercel-token: ${{ secrets.VERCEL_TOKEN }}
org-id: ${{ secrets.VERCEL_ORG_ID }}
project-id: ${{ secrets.VERCEL_WORKBENCH_TESTING_APP_PROJECT_ID }}
aliases: scion-workbench-testing-app.vercel.app
- name: 'Deploying workbench-client-testing-app to Vercel'
uses: SchweizerischeBundesbahnen/scion-toolkit/.github/actions/vercel-deploy@master
with:
dist-folder: dist/workbench-client-testing-app-vercel
dist-folder: dist/workbench-client-testing-app-vercel/browser
vercel-token: ${{ secrets.VERCEL_TOKEN }}
org-id: ${{ secrets.VERCEL_ORG_ID }}
project-id: ${{ secrets.VERCEL_WORKBENCH_CLIENT_TESTING_APP_PROJECT_ID }}
Expand All @@ -279,7 +286,7 @@ jobs:
- name: 'Deploying workbench-getting-started-app to Vercel'
uses: SchweizerischeBundesbahnen/scion-toolkit/.github/actions/vercel-deploy@master
with:
dist-folder: dist/workbench-getting-started-app
dist-folder: dist/workbench-getting-started-app/browser
vercel-token: ${{ secrets.VERCEL_TOKEN }}
org-id: ${{ secrets.VERCEL_ORG_ID }}
project-id: ${{ secrets.VERCEL_WORKBENCH_GETTING_STARTED_APP_PROJECT_ID }}
Expand All @@ -292,9 +299,9 @@ jobs:
- workbench-release-guard
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: 'Downloading dist/scion/workbench'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-dist
path: dist/scion/workbench
Expand All @@ -317,14 +324,14 @@ jobs:
- workbench-client-release-guard
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: 'Downloading dist/scion/workbench-client'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-client-dist
path: dist/scion/workbench-client
- name: 'Downloading dist/workbench-client-api'
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: workbench-client-api
path: dist/workbench-client-api
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ This section explains how to submit a pull request.
<summary><strong>Development</strong></summary>
<br>

Make sure to use Node.js version 18.16.0 for contributing to SCION. We suggest using [Node Version Manager](https://github.com/nvm-sh/nvm) if you need different Node.js versions for other projects.
Make sure to use Node.js version 20.9.0 for contributing to SCION. We suggest using [Node Version Manager](https://github.com/nvm-sh/nvm) if you need different Node.js versions for other projects.

For development, you can uncomment the section `PATH-OVERRIDE-FOR-DEVELOPMENT` in `tsconfig.json`. This allows running tests or serving applications without having to build dependent modules first.

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ SCION Workbench enables the creation of Angular web applications that require a
***

### Versions
- `v17.0.0-beta.1` and newer are compatible with Angular version 17.x.
- `v16.0.0-beta.1` and newer are compatible with Angular version 16.x.
- `v15.0.0-beta.1` and newer are compatible with Angular version 15.x.
- `v14.0.0-beta.1` and newer are compatible with Angular version 14.x.
Expand Down
Loading

0 comments on commit 637e8bd

Please sign in to comment.