Skip to content

Commit

Permalink
feat: update to Angular 14 (#89)
Browse files Browse the repository at this point in the history
* build(storybook): improve storybook integration

* build(lint): fix config for lint-staged

* build(dependabot): use version strategy "increase"

* refactor: move components into their own secondary entry points

* build(deps-dev): bump `@typescript/*` to 5.38.1

* build(deps-dev): bump `eslint` to 8.24.0

* build: use node 18

* feat: update to angular 14

Fixes Update to Angular 14 #88

* build: replace standard-version with release-it

* ci: fix missing project for build step

* ci: run test only in coverage step

* ci: run lint in a separate step
  • Loading branch information
christophka committed Oct 1, 2022
1 parent bdcbb0b commit de38da8
Show file tree
Hide file tree
Showing 125 changed files with 36,813 additions and 40,904 deletions.
58 changes: 58 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,64 @@
* recommended set provided by the @angular-eslint project would go here.
*/
}
},
/**
* -----------------------------------------------------
* Rules for storybook files
* -----------------------------------------------------
*/
{
// Rules for test files
"files": [
"*.spec.ts",
"*.jest-mocks.ts",
"setup-jest.ts",
// Testing modules
"**/testing/**"
],
"rules": {
"@angular-eslint/component-class-suffix": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/naming-convention": "off",
// many errors right now with Angulars `waitForAsync`
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-unused-vars": "off",
"@typescript-eslint/require-await": "off",
"@typescript-eslint/unbound-method": "off"
}
},
/**
* -----------------------------------------------------
* Rules for storybook files
* -----------------------------------------------------
*/
{
"files": ["**/stories/**", "**/*.stories.ts"],
"extends": ["plugin:storybook/recommended"],
"rules": {
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-member-access": "off"
}
},
/**
* -----------------------------------------------------
* Rules for configuration files
* -----------------------------------------------------
*/
{
"files": ["**/jest.config.js", "**/jest.config.*.js"],
"parserOptions": {
"ecmaVersion": 2020
},
"env": {
"es6": true
}
}
]
}
2 changes: 2 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ updates:
## Keeping npm dependencies up to date
- package-ecosystem: 'npm' # See documentation for possible values
directory: '/' # Location of package manifests
versioning-strategy: increase
open-pull-requests-limit: 15
schedule:
interval: 'monthly'
Expand All @@ -29,6 +30,7 @@ updates:
# This should be updated with storybook
- dependency-name: '@storybook/*'
- dependency-name: '@compodoc/*'
- dependency-name: '@mdx-js/react'

## Keeping GitHub Actions up to date
- package-ecosystem: 'github-actions'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: '18'
- run: npm ci
- name: coverage report
run: npm run test:coverage
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Lint

on: ['push', 'pull_request']

jobs:
lint:
name: Lint
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
- run: npm ci
- run: npm run lint
8 changes: 2 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ['16', '17']
node: ['16', '18']

name: Node ${{ matrix.node }} build

Expand All @@ -19,9 +19,5 @@ jobs:
with:
node-version: ${{ matrix.node }}
- run: npm ci
- name: lint
run: npm run lint
- name: build
run: npm run build
- name: test
run: npm test
run: npm run build app-design
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ storybook-static

# Other files
CHANGELOG.md
tsconfig.json
documentation.json
angular.json
.eslintrc.json
32 changes: 32 additions & 0 deletions .release-it.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Configuration for release-it
* @see https://github.com/release-it/release-it
*/
module.exports = {
plugins: {
'@release-it/bumper': {
in: 'package.json',
// Bump version in all package.json files
out: ['projects/*/package.json'],
},
'@release-it/conventional-changelog': {
preset: 'conventionalcommits',
infile: 'projects/app-design/CHANGELOG.md',
header: '# Changelog',
},
},
git: {
// Follow conventional commit message format
commitMessage: 'chore: release ${version}',
// For now, the push should be done manually
push: false,
// Release branches are most likely created before there is an upstream branch
requireUpstream: false,
// Tags are created after the release
tag: false,
},
npm: {
// We don't want to publish anything to npm
publish: false,
},
};
6 changes: 5 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
module.exports = {
framework: '@storybook/angular',
stories: [
// Any stories inside
'../stories/**/*.stories.mdx',
'../stories/**/*.stories.@(js|ts)',
// Any stories inside projects
'../projects/**/*.stories.mdx',
'../projects/**/*.stories.@(js|ts)',
],
Expand All @@ -11,5 +14,6 @@ module.exports = {
],
core: {
builder: 'webpack5',
disableTelemetry: true,
},
};
14 changes: 12 additions & 2 deletions .storybook/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,23 @@
"extends": "../tsconfig.json",
"compilerOptions": {
"types": ["node"],
"allowSyntheticDefaultImports": true
"allowSyntheticDefaultImports": true,
"sourceMap": true
},
"exclude": [
// Test projects
"../projects/dev-app",
// Test files
"../src/test.ts",
"../src/**/*.spec.ts",
"../projects/**/*.spec.ts"
],
"include": ["../src/**/*", "../projects/**/*"],
"include": [
// All projects
"../projects/**/*",
// All the stories
"../stories/**/*.stories.*",
"../stories/**/*.ts"
],
"files": ["./typings.d.ts"]
}
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ This is the repository that contains
## Storybook

```sh
npm run storybook
npm run storybook:start
# or directily via ng
ng run app-design:storybook
ng run storybook:storybook
```

This project is set up to use storybook for developing components. See above how to start up storybook.
You can also build storybook using

```sh
ng run app-design:build-storybook
ng run storybook:build-storybook
```

[ci-main-badge]: https://github.com/ckapps/angular-components/workflows/CI/badge.svg
Expand Down
82 changes: 63 additions & 19 deletions angular.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"cli": {
"defaultCollection": "@angular-eslint/schematics"
"schematicCollections": [
"@angular-eslint/schematics"
]
},
"version": 1,
"newProjectRoot": "projects",
Expand Down Expand Up @@ -36,22 +38,6 @@
"projects/app-design/**/*.html"
]
}
},
"build-storybook": {
"builder": "@storybook/angular:build-storybook",
"options": {
"browserTarget": "app-design:build",
"styles": [
".storybook/storybook-preview.scss"
]
}
},
"storybook": {
"builder": "@storybook/angular:start-storybook",
"options": {
"browserTarget": "app-design:build-storybook",
"port": 6006
}
}
}
},
Expand Down Expand Up @@ -148,7 +134,65 @@
}
}
}
},
"storybook": {
"projectType": "application",
"root": "stories",
"sourceRoot": "stories",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/storybook",
"index": "stories/index.html",
"main": "stories/main.ts",
"tsConfig": ".storybook/tsconfig.json",
"styles": [
"stories/storybook-preview.scss"
],
"scripts": []
},
"configurations": {
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
}
},
"defaultConfiguration": "development"
},
"storybook": {
"builder": "@storybook/angular:start-storybook",
"options": {
"browserTarget": "storybook:build:development",
"port": 6006,
"compodocArgs": [
"-e",
"json",
"--disablePrivate",
"--disableInternal",
"--disableLifeCycleHooks"
]
}
},
"build-storybook": {
"builder": "@storybook/angular:build-storybook",
"options": {
"browserTarget": "storybook:build",
"outputDir": "dist/storybook",
"compodocArgs": [
"-e",
"json",
"--disablePrivate",
"--disableInternal",
"--disableLifeCycleHooks"
]
}
}
}
}
},
"defaultProject": "app-design"
}
}

0 comments on commit de38da8

Please sign in to comment.