Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [no-issue] upgrade to v1020 of Web SDK and migrate to ng cli #25

Merged
merged 21 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# For the full list of supported browsers by the Angular framework, please see:
# https://angular.io/guide/browser-support

# You can see what browsers were selected by your queries by running:
# npx browserslist

last 2 Chrome versions
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
31 changes: 29 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,21 @@
"plugin:@angular-eslint/template/process-inline-templates",
"plugin:prettier/recommended" // <--- here we inherit from the recommended setup from eslint-plugin-prettier for TS
],
"rules": {},
"rules": {
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"@typescript-eslint/no-explicit-any": "warn"
},
"parserOptions": {
"project": ["tsconfig.json"]
}
Expand All @@ -37,7 +51,20 @@
}
]
}
]
],
"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "all",
"argsIgnorePattern": "^_",
"caughtErrors": "all",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"ignoreRestSiblings": true
}
],
"@typescript-eslint/no-explicit-any": "warn"
},
"parserOptions": {
"project": ["tsconfig.spec.json"]
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ jobs:
runs-on: ubuntu-22.04
name: Cypress tests
container:
image: cypress/browsers:node16.16.0-chrome107-ff107
image: cypress/browsers:node-20.11.1-chrome-123.0.6312.58-1-ff-124.0-edge-122.0.2365.92-1
options: --user 1001
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'
cache: 'npm'

- name: Install dependencies
Expand All @@ -45,37 +45,42 @@ jobs:
npm version prepatch --no-git-tag-version --preid $(git rev-parse --short HEAD)

- name: Build
run: npm run build:ci
run: npm run build

- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build
if-no-files-found: error
retention-days: 5
path: |
dist/apps/sag-pkg-community-plugins/**
dist/sag-pkg-community-plugins/**

- name: Copy files for http-server into apps subfolder
run: |
mkdir -p dist/apps/sag-pkg-community-plugins
cp -r dist/sag-pkg-community-plugins/* dist/apps/sag-pkg-community-plugins

- name: Cypress run
uses: cypress-io/github-action@v5
with:
start: npm run http-server
install: false
wait-on: 'http://localhost:9000/apps/sag-pkg-community-plugins/index.html'
wait-on: 'http://localhost:4200/apps/sag-pkg-community-plugins/index.html'
browser: chrome
record: false
config-file: cypress.config.ts

- name: Upload cypress screenshots
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: failure()
with:
retention-days: 5
name: cypress-screenshots
path: cypress/screenshots

- name: Upload cypress videos
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: always()
with:
retention-days: 5
Expand Down
52 changes: 26 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ jobs:
timeout-minutes: 8
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'
cache: 'npm'

- name: Install dependencies
Expand All @@ -37,23 +37,23 @@ jobs:
run: npm run lint

- name: Build
run: npm run build:ci
run: npm run build

- name: Zip build
run: |
cd dist/apps/sag-pkg-community-plugins
cd dist/sag-pkg-community-plugins
zip -r -q ../../build.zip *
cd ../../..
cd ../..
rm -r dist/apps

- name: Upload build artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: build
if-no-files-found: error
retention-days: 5
path: |
dist/build.zip
build.zip

release:
name: Release
Expand All @@ -65,14 +65,14 @@ jobs:
version: ${{ steps.save-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
node-version: '20'

- name: Save initial Version
id: save-initial-version
Expand All @@ -98,30 +98,30 @@ jobs:
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-depth: 1
ref: v${{ needs.release.outputs.version }}

- name: Setup Node.js
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build:ci
run: npm run build

- name: Zip build
run: |
cd dist/apps/sag-pkg-community-plugins
zip -r -q ../../../cumulocity-community-plugins-${{ needs.release.outputs.version }}.zip *
cd ../../..
rm -r dist/apps
cd dist/sag-pkg-community-plugins
zip -r -q ../../cumulocity-community-plugins-${{ needs.release.outputs.version }}.zip *
cd ../..
rm -r dist

- name: Release
uses: softprops/action-gh-release@v1
with:
Expand Down
Loading
Loading