Skip to content
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
45 changes: 40 additions & 5 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,51 @@ module.exports = {
parser: '@typescript-eslint/parser',
ignorePatterns: ['projects/angular-ui/**/*'],
plugins: ['@angular-eslint', 'header'],
env: {
es6: true,
node: true
},
overrides: [
{
files: ['*.ts'],
extends:
'./node_modules/@villedemontreal/lint-config/rules/eslint-angular.json',
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking'
],
parserOptions: {
project: ['tsconfig.json']
sourceType: 'module',
project: ['./tsconfig.json']
},
rules: {
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/adjacent-overload-signatures': 'off',
'@typescript-eslint/array-type': [
'error',
{
default: 'array'
}
],
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/member-ordering': 'warn',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-unsafe-return': 'warn',
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/unbound-method': 'warn',
'@typescript-eslint/await-thenable': 'warn',
'@typescript-eslint/no-inferrable-types': 'warn',
'@typescript-eslint/require-await': 'warn',
'@typescript-eslint/no-unused-vars': 'error',
'prefer-const': 'error',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-misused-promises': 'warn',
'@typescript-eslint/no-empty-interface': 'warn',
'no-console': 'warn',
'max-lines-per-function': ['warn', 180],
'@typescript-eslint/no-empty-function': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'header/header': [
2,
'block',
Expand All @@ -31,5 +66,5 @@ module.exports = {
rules: {}
}
],
extends: ['plugin:storybook/recommended']
extends: ['plugin:storybook/recommended', 'prettier']
};
28 changes: 21 additions & 7 deletions .github/workflows/build-node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,27 @@ on:
pull_request:
jobs:
build:
name: Build, Lint and Test Project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 16
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm run test-ci
node-version: 20

- name: Install dependencies
run: npm ci

- name: Build project
run: npm run build

# Because the storybook project use the built version of angular-ui,
# we need to run these steps after building the project.
- name: Lint project
run: npm run lint

- name: Test project
run: npm run test-ci
2 changes: 1 addition & 1 deletion .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
steps:
# 👇 Version 2 of the action
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0 # 👈 Required to retrieve git history
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ jobs:
build:
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: '16'
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run build
Expand All @@ -19,10 +19,10 @@ jobs:
needs: build
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: '16'
node-version: 20
cache: 'npm'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
Expand Down
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16.14-alpine
FROM node:20-alpine
LABEL MAINTAINER="VdMtl"

# Create app directory
Expand All @@ -7,11 +7,13 @@ RUN mkdir -p /usr/src/lib && chown -R node:node /usr
WORKDIR /usr/src/lib

# Install all dependencies
COPY --chown=node:node . /usr/src/lib
COPY --chown=node:node package* .

# Install deps
RUN npm ci --ignore-scripts

# Copy source code
COPY --chown=node:node . /usr/src/lib

# Build library
RUN npm run build-storybook

Expand Down
9 changes: 5 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"main": "projects/angular-ui/src/test.ts",
"tsConfig": "projects/angular-ui/tsconfig.spec.json",
"karmaConfig": "projects/angular-ui/karma.conf.js",
"include": ["**/*.spec.ts"]
"include": ["**/*.spec.ts"],
"polyfills": ["zone.js", "zone.js/testing"]
}
},
"lint": {
Expand Down Expand Up @@ -116,18 +117,18 @@
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"browserTarget": "storybook-angular:build:production"
"buildTarget": "storybook-angular:build:production"
},
"development": {
"browserTarget": "storybook-angular:build:development"
"buildTarget": "storybook-angular:build:development"
}
},
"defaultConfiguration": "development"
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "storybook-angular:build"
"buildTarget": "storybook-angular:build"
}
},
"test": {
Expand Down
Loading
Loading