Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Angular 19 #82

Merged
merged 7 commits into from
Nov 28, 2024
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
34 changes: 0 additions & 34 deletions .eslintrc.json

This file was deleted.

8 changes: 6 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ jobs:
- name: Run tests # Build Schematics and move
run: yarn test --configuration=ci --code-coverage

- name: Upload coverage reports
run: bash <(curl -s https://codecov.io/bash)
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Deploy Github Pages
uses: peaceiris/actions-gh-pages@v4
Expand Down
4 changes: 2 additions & 2 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"**/*.{ts}": [
"eslint --cache --fix",
"**/*.ts": [
"eslint --fix",
"prettier --write"
]
}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

> Angular pipe for cutting translations ✂️ 🌍 (plugin for [@ngx-translate](https://github.com/ngx-translate/core))

> ✓ _Angular 18, Ivy, Angular Universal (SSR) and Zoneless compatible_
> ✓ _Angular 19, Angular Universal (SSR) and Zoneless compatible_

Here's the [demo](http://bartholomej.github.io/ngx-translate-cut/) or [stackblitz live preview](https://stackblitz.com/edit/ngx-translate-cut)

Expand All @@ -19,14 +19,15 @@ Here's the [demo](http://bartholomej.github.io/ngx-translate-cut/) or [stackblit
2. Use `npm` (or `yarn`) to install the package

```bash
npm install ngx-translate-cut # For Angular 18. See compatibility table
npm install ngx-translate-cut # For Angular 19. See compatibility table
```

Choose the version corresponding to your Angular version:

| Angular | ngx-translate-cut | Install |
| ------------------- | ----------------- | ---------------------------------- |
| **ng18** | 18.x | `npm install ngx-translate-cut` |
| **ng19** | 19.x | `npm install ngx-translate-cut` |
| **ng18** | 18.x | `npm install ngx-translate-cut@18` |
| **ng17** | 17.x | `npm install ngx-translate-cut@17` |
| **ng16** | 5.x | `npm install ngx-translate-cut@5` |
| **ng15** | 4.x | `npm install ngx-translate-cut@4` |
Expand Down
16 changes: 9 additions & 7 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser-esbuild",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist/demo",
"outputPath": {
"base": "dist/demo"
},
"index": "projects/demo/src/index.html",
"main": "projects/demo/src/main.ts",
"polyfills": "projects/demo/src/polyfills.ts",
"polyfills": [
"projects/demo/src/polyfills.ts"
],
"tsConfig": "projects/demo/tsconfig.app.json",
"assets": [
"projects/demo/src/favicon.ico",
Expand All @@ -71,10 +74,10 @@
],
"scripts": [],
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
"namedChunks": true,
"browser": "projects/demo/src/main.ts"
},
"configurations": {
"production": {
Expand All @@ -89,7 +92,6 @@
"sourceMap": false,
"namedChunks": false,
"extractLicenses": true,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
Expand Down
63 changes: 63 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// @ts-check
const eslint = require('@eslint/js');
const tseslint = require('typescript-eslint');
const angular = require('angular-eslint');

module.exports = tseslint.config(
{
files: ['**/*.ts'],
extends: [
eslint.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
...angular.configs.tsRecommended,
],
processor: angular.processInlineTemplates,
rules: {
'max-lines': ['warn', 400],
'no-console': 'warn',
'prefer-const': 'warn',
'no-debugger': 'error',
'@typescript-eslint/explicit-member-accessibility': [
'warn',
{
'ignoredMethodNames': ['constructor'],
},
],
'@typescript-eslint/explicit-function-return-type': ['warn'],
'@typescript-eslint/no-explicit-any': 'warn',
'@angular-eslint/no-output-native': 'warn',
'@angular-eslint/no-input-rename': ['warn'],
'@angular-eslint/no-output-on-prefix': ['warn'],
'@angular-eslint/no-pipe-impure': ['warn'],
'@angular-eslint/prefer-standalone': ['off'],
'@angular-eslint/use-lifecycle-interface': 'error',
'@angular-eslint/prefer-on-push-component-change-detection': ['error'],
'@angular-eslint/directive-selector': [
'error',
{
'type': 'attribute',
'prefix': ['app', 'ui'],
'style': 'camelCase',
},
],
'@angular-eslint/component-selector': [
'error',
{
'type': 'element',
'prefix': ['app', 'lib'],
'style': 'kebab-case',
},
],
},
},
{
files: ['**/*.html'],
extends: [...angular.configs.templateRecommended, ...angular.configs.templateAccessibility],
'rules': {
'@angular-eslint/template/elements-content': 'warn',
'@angular-eslint/template/prefer-self-closing-tags': ['warn'],
'@angular-eslint/template/prefer-control-flow': ['error'],
},
},
);
49 changes: 26 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,41 @@
"prepare": "husky install"
},
"dependencies": {
"@angular/animations": "^18.0.2",
"@angular/common": "^18.0.2",
"@angular/compiler": "^18.0.2",
"@angular/core": "^18.0.2",
"@angular/forms": "^18.0.2",
"@angular/platform-browser": "^18.0.2",
"@angular/platform-browser-dynamic": "^18.0.2",
"@angular/router": "^18.0.2",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"@angular/animations": "^19.0.1",
"@angular/common": "^19.0.1",
"@angular/compiler": "^19.0.1",
"@angular/core": "^19.0.1",
"@angular/forms": "^19.0.1",
"@angular/platform-browser": "^19.0.1",
"@angular/platform-browser-dynamic": "^19.0.1",
"@angular/router": "^19.0.1",
"@ngx-translate/core": "^16.0.3",
"@ngx-translate/http-loader": "^16.0.0",
"angular-eslint": "^18.1.0",
"rxjs": "~7.8.1",
"tslib": "^2.6.3",
"zone.js": "~0.14.7"
"typescript-eslint": "^7.16.1",
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.0.3",
"@angular-eslint/builder": "18.0.1",
"@angular-eslint/eslint-plugin": "18.0.1",
"@angular-eslint/eslint-plugin-template": "18.0.1",
"@angular-eslint/schematics": "18.0.1",
"@angular-eslint/template-parser": "18.0.1",
"@angular/cli": "^18.0.3",
"@angular/compiler-cli": "^18.0.2",
"@angular/language-service": "^18.0.2",
"@angular-devkit/build-angular": "^19.0.2",
"@angular-eslint/builder": "18.4.2",
"@angular-eslint/eslint-plugin": "18.4.2",
"@angular-eslint/eslint-plugin-template": "18.4.2",
"@angular-eslint/schematics": "18.4.2",
"@angular-eslint/template-parser": "18.4.2",
"@angular/cli": "^19.0.2",
"@angular/compiler-cli": "^19.0.1",
"@angular/language-service": "^19.0.1",
"@babel/helper-environment-visitor": "^7.24.7",
"@types/fs-extra": "^11.0.4",
"@types/jasmine": "~5.1.4",
"@types/jasminewd2": "~2.0.13",
"@types/node": "^20.14.2",
"@typescript-eslint/eslint-plugin": "^7.12.0",
"@typescript-eslint/parser": "^7.12.0",
"@vendure/ngx-translate-extract": "^9.1.1",
"eslint": "^9.4.0",
"eslint": "^9.7.0",
"eslint-plugin-import": "2.29.1",
"eslint-plugin-jsdoc": "48.2.9",
"eslint-plugin-prefer-arrow": "latest",
Expand All @@ -73,12 +76,12 @@
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"lint-staged": "^15.2.5",
"ng-packagr": "^18.0.0",
"ng-packagr": "^19.0.1",
"prettier": "^3.3.1",
"protractor": "~7.0.0",
"ts-node": "~10.9.2",
"tslint-config-prettier": "^1.18.0",
"typescript": "~5.4.5"
"typescript": "~5.6.3"
},
"homepage": "https://github.com/bartholomej/ngx-translate-cut",
"license": "MIT",
Expand Down
6 changes: 4 additions & 2 deletions projects/demo/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { Component } from '@angular/core';
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { VERSION } from '../environments/version';

@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
styleUrls: ['./app.component.css'],
standalone: false,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class AppComponent {
public version = VERSION;
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"esModuleInterop": true,
"declaration": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"module": "esnext",
"moduleResolution": "node",
Expand Down
Loading