Skip to content

Commit

Permalink
feat: switch to ng cli (#43)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Upgraded to Angular 17, switched to ng cli instead of deprecated c8ycli and upgraded chartjs lib
  • Loading branch information
reey authored Aug 21, 2024
1 parent b27f17d commit e57933c
Show file tree
Hide file tree
Showing 158 changed files with 34,552 additions and 59,262 deletions.
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
6 changes: 3 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package.json
package-lock.json
dist
package.json
package-lock.json
dist
node_modules
60 changes: 30 additions & 30 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
{
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser
"extends": [
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"eslint-config-prettier", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
"parserOptions": {
"ecmaVersion": 2020, // Allows for the parsing of modern ECMAScript features
"sourceType": "module" // Allows for the use of imports
},
"rules": {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_",
"ignoreRestSiblings": false
}
],
"sort-imports": "off",
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"no-console": "warn",
"@typescript-eslint/no-var-requires": "error"
}
}
{
"parser": "@typescript-eslint/parser", // Specifies the ESLint parser
"extends": [
"plugin:@typescript-eslint/recommended", // Uses the recommended rules from the @typescript-eslint/eslint-plugin
"eslint-config-prettier", // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
"plugin:prettier/recommended" // Enables eslint-plugin-prettier and eslint-config-prettier. This will display prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
],
"parserOptions": {
"ecmaVersion": 2020, // Allows for the parsing of modern ECMAScript features
"sourceType": "module" // Allows for the use of imports
},
"rules": {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/no-unused-vars": [
"error",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_",
"ignoreRestSiblings": false
}
],
"sort-imports": "off",
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
"no-console": "warn",
"@typescript-eslint/no-var-requires": "error"
}
}
106 changes: 55 additions & 51 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,55 @@
name: Main CI

on:
pull_request:
branches: [main]

env:
NODE_VERSION: '16'

# concurrency:
# group: ${{ github.ref }}
# cancel-in-progress: true

jobs:
build:
name: 🚧 Lint, Test, Build & (optionally) Release
runs-on: ubuntu-latest
steps:
- name: Set RELEASE_VERSION env variable
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Check out Git repository
uses: actions/checkout@v3

- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Set C8Y_VERSION env variable
run: echo "C8Y_VERSION=$(node -p -e "require('./package.json').dependencies['@c8y/ngx-components']")" >> $GITHUB_ENV

- name: Install Node.js dependencies
run: npm ci

# - name: 🕵️‍♂️ Lint
# run: npm run lint --if-present

- name: 🧪 Test
run: npm test --if-present

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

- name: Upload Subtenant Artifact
uses: actions/upload-artifact@v3
with:
name: subtenant-management-${{ env.C8Y_VERSION }}-${{ github.event.number }}-${{ github.run_id }}
path: dist/apps/sag-pkg-subtenant-management/

name: Main CI

on:
pull_request:
branches: [main]

env:
NODE_VERSION: '20'

# concurrency:
# group: ${{ github.ref }}
# cancel-in-progress: true

jobs:
build:
name: 🚧 Lint, Test, Build & (optionally) Release
runs-on: ubuntu-latest
steps:
- name: Set RELEASE_VERSION env variable
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: Check out Git repository
uses: actions/checkout@v4

- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Save Version
id: save-version
run: echo "version=$(cat package.json | jq '.version' | xargs)-PR-${{ github.event.number }}-${{ github.sha }}-${{ github.run_id }}" >> $GITHUB_OUTPUT

- name: Set tmp version
run: npm pkg set version='${{ steps.save-version.outputs.version }}'

- name: Install Node.js dependencies
run: npm ci

# - name: 🕵️‍♂️ Lint
# run: npm run lint --if-present

- name: 🧪 Test
run: npm test --if-present

- name: 🚧 Build
run: npm run build

- name: Upload Subtenant Artifact
uses: actions/upload-artifact@v4
with:
name: subtenant-management-${{ steps.save-version.outputs.version }}
path: dist/sag-pkg-subtenant-management/

Loading

0 comments on commit e57933c

Please sign in to comment.