Skip to content

Commit

Permalink
feat: update Angular to 12
Browse files Browse the repository at this point in the history
  • Loading branch information
v.potekhin committed Jul 13, 2023
1 parent dae8c9d commit 5cbf5e9
Show file tree
Hide file tree
Showing 24 changed files with 33,548 additions and 40,966 deletions.
33 changes: 33 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = {
root: true,
extends: [
'@tinkoff/eslint-config-angular',
'@tinkoff/eslint-config-angular/html',
'@tinkoff/eslint-config-angular/rxjs',
'@tinkoff/eslint-config-angular/imports',
'@tinkoff/eslint-config-angular/promise',
'@tinkoff/eslint-config-angular/file-progress',
'@tinkoff/eslint-config-angular/line-statements',
'@tinkoff/eslint-config-angular/member-ordering',
'@tinkoff/eslint-config-angular/decorator-position',
'@tinkoff/eslint-config-angular/experimental',
'@tinkoff/eslint-config-angular/function-return-type',
],
rules: {
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/member-ordering': 'off'
},
ignorePatterns: ['projects/**/test.ts', '*.json', '*.less', '*.md', '*.js', '*.spec.ts'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: [require.resolve('./tsconfig.eslint.json')],
},
env: {
jest: true,
},
};
23 changes: 23 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## PR Checklist

## PR Type

What kind of change does this PR introduce?

- [ ] Bugfix
- [ ] Feature
- [ ] Refactoring
- [ ] Code style update
- [ ] Build or CI related changes
- [ ] Documentation content changes

## What is the current behavior?

Closes # <!-- link to a relevant issue. -->

## What is the new behavior?

## Does this PR introduce a breaking change?

- [ ] Yes
- [ ] No
56 changes: 56 additions & 0 deletions .github/actions/nodejs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Action for Node.js
description: Node.js setup cache

inputs:
node-version:
description: Node.js version
required: false
default: 16.20

runs:
using: composite
steps:
- name: Use Node.js ${{ inputs.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
registry-url: 'https://registry.npmjs.org'

- name: Restore node_modules from cache
id: cache-node-modules
uses: actions/cache@v3
with:
path: |
**/node_modules
!**/node_modules/.cache
key: modules-cache__nodejs-${{ inputs.node-version }}__${{ hashfiles('**/package-lock.json') }}

- name: Restore from cache of builds
id: build-cache
if: steps.cache-node-modules.outputs.cache-hit == 'true'
uses: actions/cache@v3
with:
path: |
**/node_modules/.cache
key: builds-cache-hash__${{ hashFiles('**/package-lock.json') }}-${{ github.ref }}
restore-keys: builds-cache__nodejs-${{ inputs.node-version }}__${{ hashFiles('**/package-lock.json') }}

- name: Restore from global NPM cache
if: steps.cache-node-modules.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: ~/.npm
key: npm-cache__nodejs-${{ inputs.node-version }}__${{ hashFiles('**/package-lock.json') }}
restore-keys: npm-cache-hash__

- run: npm ci
env:
CYPRESS_CACHE_FOLDER: ./node_modules/cache-cypress
if: steps.cache-node-modules.outputs.cache-hit != 'true'
shell: bash

- name: environment
shell: bash
run: |
node -v
npm -v
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build
on:
pull_request:
push:
branches: [master]

jobs:
build-packages:
name: Packages
if: ${{ !contains(github.head_ref, 'release/') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js and Cache
uses: ./.github/actions/nodejs

- name: Build packages
run: npm run build

concurrency:
group: build-${{ github.head_ref }}
cancel-in-progress: true
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Lint
on: [pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js and Cache
uses: ./.github/actions/nodejs

- name: Lint check
run: |
npm run typecheck
npm run format -- --check
npm run lint
concurrency:
group: lint-${{ github.head_ref }}
cancel-in-progress: true
23 changes: 23 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Tests

on:
pull_request:
push:
branches:
- master

jobs:
tests:
if: ${{ !contains(github.head_ref, 'release/') }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js and Cache
uses: ./.github/actions/nodejs

- name: Run tests
run: npm run test

concurrency:
group: test-${{ github.head_ref }}
cancel-in-progress: true
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

13 changes: 9 additions & 4 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"aot": true,
"outputPath": "dist/demo",
"index": "projects/demo/src/index.html",
"main": "projects/demo/src/main.ts",
Expand All @@ -66,7 +65,13 @@
"styles": [
"projects/demo/src/styles.css"
],
"scripts": []
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
Expand All @@ -80,7 +85,6 @@
"outputHashing": "all",
"sourceMap": false,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
Expand All @@ -96,7 +100,8 @@
}
]
}
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand Down
Loading

0 comments on commit 5cbf5e9

Please sign in to comment.