Skip to content
Closed
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CP_API_KEY="cp_42858fd467d094364e7577a3daf8613258da53e77e0195dffbff66c300dcf2cb"
32 changes: 17 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,39 @@ name: CI

on:
push:
branches:
- master
branches: [main]
pull_request:
branches: [main]

permissions:
actions: read
contents: read

jobs:
main:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

# This enables task distribution via Nx Cloud
# Run this command as early as possible, before dependencies are installed
# Learn more at https://nx.dev/ci/reference/nx-cloud-cli#npx-nxcloud-startcirun
- run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
- run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="test"

# Cache node_modules
- uses: actions/setup-node@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
node-version-file: .nvmrc
cache: npm

- run: npm ci --legacy-peer-deps
- uses: nrwl/nx-set-shas@v4
- name: Set base and head for Nx affected commands
uses: nrwl/nx-set-shas@v4

# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: npx nx-cloud record -- echo Hello World
# Nx Affected runs only tasks affected by the changes in this PR/commit. Learn more: https://nx.dev/ci/features/affected
- run: npx nx affected -t lint test build e2e-ci
- name: Install dependencies
run: npm ci

- name: Run tests
run: npx nx run-many -t test --configuration=ci
39 changes: 39 additions & 0 deletions .github/workflows/code-pushup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Code PushUp

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read
actions: read
pull-requests: write

env:
CP_API_KEY: ${{ secrets.CP_API_KEY }}

jobs:
code_pushup:
timeout-minutes: 15
runs-on: ubuntu-latest
name: Code PushUp
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- name: Install dependencies
run: npm ci

- name: Run Code PushUp action
uses: code-pushup/github-action@v0
with:
bin: npx @code-pushup/cli -- --no-progress --verbose
retention: 14
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ Thumbs.db
.nx/workspace-data

.angular
.env
.code-pushup
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.1
12 changes: 0 additions & 12 deletions apps/ng-demo-e2e/eslint.config.js

This file was deleted.

63 changes: 0 additions & 63 deletions apps/ng-demo-e2e/playwright.config.ts

This file was deleted.

9 changes: 0 additions & 9 deletions apps/ng-demo-e2e/project.json

This file was deleted.

8 changes: 0 additions & 8 deletions apps/ng-demo-e2e/src/example.spec.ts

This file was deleted.

25 changes: 0 additions & 25 deletions apps/ng-demo-e2e/tsconfig.json

This file was deleted.

48 changes: 18 additions & 30 deletions apps/ng-demo/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,22 @@
const nx = require('@nx/eslint-plugin');
const baseConfig = require('../../eslint.config.js');
import angular from '@code-pushup/eslint-config/angular';
import storybook from '@code-pushup/eslint-config/storybook';
import tsESLint from 'typescript-eslint';
import baseConfig from '../../eslint.config.js';

module.exports = [
...baseConfig,
...nx.configs['flat/angular'],
...nx.configs['flat/angular-template'],
{
files: ['**/*.ts'],
rules: {
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
prefix: 'app',
style: 'camelCase',
},
],
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'app',
style: 'kebab-case',
},
],
export default tsESLint.config(...baseConfig, ...angular, ...storybook, {
files: ['**/*.ts'],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
{
files: ['**/*.html'],
// Override or add rules here
rules: {},
rules: {
'@angular-eslint/prefer-standalone': 'error',

'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/prefer-readonly': 'warn',
'@typescript-eslint/prefer-readonly-parameter-types': 'warn',
'@typescript-eslint/prefer-ts-expect-error': 'error',
},
];
});
11 changes: 6 additions & 5 deletions apps/ng-demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Component } from '@angular/core';

@Component({
selector: 'app-root',
template: `
selector: 'app-root',
template: `
<app-header></app-header>
<router-outlet></router-outlet>
`,
styles: [
`
styles: [
`
:host {
display: block;
max-width: var(--screen-width);
Expand All @@ -16,6 +16,7 @@ import { Component } from '@angular/core';
box-sizing: border-box;
}
`,
],
],
standalone: false
})
export class AppComponent {}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import { Article } from '../../models/articles';
import { DateagoPipe } from '../../pipes/dateago.pipe';

@Component({
selector: 'app-article-card',
templateUrl: './article-card.component.html',
styleUrls: ['./article-card.component.scss'],
selector: 'app-article-card',
templateUrl: './article-card.component.html',
styleUrls: ['./article-card.component.scss'],
standalone: false
})
export class ArticleCardComponent implements OnChanges {
@Input() article!: Article;
Expand Down
9 changes: 5 additions & 4 deletions apps/ng-demo/src/components/header/header.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ import { Component, NgModule } from '@angular/core';
import { RouterModule } from '@angular/router';

@Component({
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.scss'],
selector: 'app-header',
templateUrl: './header.component.html',
styleUrls: ['./header.component.scss'],
standalone: false
})
export class HeaderComponent {
constructor() {}
Expand All @@ -16,4 +17,4 @@ export class HeaderComponent {
imports: [CommonModule, RouterModule.forChild([])],
exports: [HeaderComponent],
})
export class HeaderModule {}
export class HeaderModule {}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import { fromEvent, Subscription } from 'rxjs';
import { debounceTime } from 'rxjs/operators';

@Directive({
/* eslint-disable @angular-eslint/directive-selector */
selector: '[scrollTracker]',
/* eslint-disable @angular-eslint/directive-selector */
selector: '[scrollTracker]',
standalone: false
})
export class ScrollTrackerDirective implements OnDestroy, OnInit {
@Output() scrollingFinished = new EventEmitter<void>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { UserStore } from '../../state/user.store';
import { UserArticlesStore } from '../../state/user-articles.store';

@Component({
selector: 'app-article-detail',
template: `
selector: 'app-article-detail',
template: `
<aside>
<app-reactions
*ngIf="reaction$ | async as reactions"
Expand All @@ -25,8 +25,8 @@ import { UserArticlesStore } from '../../state/user-articles.store';
<app-user-detail *ngIf="user" [user]="user"></app-user-detail>
</ng-container>
`,
styles: [
`
styles: [
`
:host {
display: grid;
grid-gap: 1rem;
Expand All @@ -37,8 +37,9 @@ import { UserArticlesStore } from '../../state/user-articles.store';
grid-template-columns: 4rem minmax(0, 7fr) minmax(0, 3fr);
}
`,
],
viewProviders: [ArticleDetailStore, UserStore, CommentsStore],
],
viewProviders: [ArticleDetailStore, UserStore, CommentsStore],
standalone: false
})
export class ArticleDetailComponent implements OnInit {
article$ = this.articleDetailStore.article$.pipe(
Expand Down
Loading
Loading