Skip to content

Commit

Permalink
feat(ref: no-ref): update ng 19
Browse files Browse the repository at this point in the history
* fix(ref: no-ref): updage ng 19

* fix(ref: no-ref): update ng 19

* fix(ref: no-ref): update ng 19

* fix(ref: no-ref): add ngxtension
  • Loading branch information
andriikamaldinov1 authored Nov 22, 2024
1 parent 000b0ea commit 08d1628
Show file tree
Hide file tree
Showing 20 changed files with 101 additions and 83 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/tmp
/out-tsc
/bazel-out

/cypress/screenshots
# Node
/node_modules
npm-debug.log
Expand Down
2 changes: 1 addition & 1 deletion .stylelintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/tmp
/out-tsc
/bazel-out
/src/styles.scss


# Node
/node_modules
Expand Down
8 changes: 7 additions & 1 deletion .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": ["stylelint-config-recommended-scss"],
"customSyntax": "postcss-scss",
"plugins": ["stylelint-prettier"],
"plugins": ["stylelint-scss", "stylelint-prettier"],
"rules": {
"no-empty-source": null,
"scss/comment-no-empty": null,
Expand All @@ -12,6 +12,12 @@
{
"ignoreTypes": ["/^mat-/", "markdown", ":host", ":root"]
}
],
"scss/at-rule-no-unknown": [
true,
{
"ignoreAtRules": ["tailwind"]
}
]
}
}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 19.0.0(2024-11-21)

### Feature

- update ng 19.x

# 18.0.4(2024-10-25)

### Feature
Expand Down
Binary file modified bun.lockb
Binary file not shown.
17 changes: 11 additions & 6 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ module.exports = tseslint.config(
extends: [
// Apply the recommended core rules
eslint.configs.recommended,
// Apply the recommended TypeScript rules
...tseslint.configs.recommended,
// Optionally apply stylistic rules from typescript-eslint that improve code consistency
...tseslint.configs.stylistic,
// Apply the recommended Angular rules
...tseslint.configs.recommendedTypeChecked,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
...angular.configs.tsRecommended,
],
// Set the custom processor which will allow us to have our inline Component templates extracted
Expand Down Expand Up @@ -105,7 +103,6 @@ module.exports = tseslint.config(
'no-unused-private-class-members': 'error',
'no-invalid-regexp': 'error',
curly: ['error', 'all'],
'@typescript-eslint/restrict-template-expressions': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/adjacent-overload-signatures': 'error',
'no-console': ['warn'],
Expand Down Expand Up @@ -158,6 +155,14 @@ module.exports = tseslint.config(
'@typescript-eslint/unbound-method': 'off',
'import/no-cycle': 'off',
'import/extensions': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/restrict-template-expressions': [
'error',
{
allowNullish: true,
allowNumber: true,
},
],
},
},
{
Expand Down
72 changes: 38 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,61 +49,65 @@
"url": "https://github.com/JsDaddy/ngx-copypaste.git"
},
"dependencies": {
"@angular/animations": "18.2.9",
"@angular/common": "18.2.9",
"@angular/compiler": "18.2.9",
"@angular/core": "18.2.9",
"@angular/forms": "18.2.9",
"@angular/platform-browser": "18.2.9",
"@angular/platform-browser-dynamic": "18.2.9",
"@angular/router": "^18.2.9",
"@angular/animations": "19.0.0",
"@angular/common": "19.0.0",
"@angular/compiler": "19.0.0",
"@angular/core": "19.0.0",
"@angular/forms": "19.0.0",
"@angular/platform-browser": "19.0.0",
"@angular/platform-browser-dynamic": "19.0.0",
"@angular/router": "^19.0.0",
"highlight.js": "^11.10.0",
"ngx-highlightjs": "^12.0.0",
"ngxtension": "^4.1.0",
"rxjs": "7.8.1",
"snyk": "^1.1294.0"
"snyk": "^1.1294.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "18.2.10",
"@angular-eslint/builder": "18.4.0",
"@angular-eslint/eslint-plugin": "18.4.0",
"@angular-eslint/eslint-plugin-template": "18.4.0",
"@angular-eslint/schematics": "18.4.0",
"@angular-eslint/template-parser": "18.4.0",
"@angular/cli": "18.2.10",
"@angular/compiler-cli": "18.2.9",
"@angular/language-service": "18.2.9",
"@commitlint/cli": "19.5.0",
"@commitlint/config-conventional": "19.5.0",
"@angular-devkit/build-angular": "19.0.0",
"@angular-eslint/builder": "18.4.1",
"@angular-eslint/eslint-plugin": "18.4.1",
"@angular-eslint/eslint-plugin-template": "18.4.1",
"@angular-eslint/schematics": "18.4.1",
"@angular-eslint/template-parser": "18.4.1",
"@angular/cli": "19.0.0",
"@angular/compiler-cli": "19.0.0",
"@angular/language-service": "19.0.0",
"@commitlint/cli": "19.6.0",
"@commitlint/config-conventional": "19.6.0",
"@types/jasmine": "~5.1.4",
"@types/node": "22.7.9",
"@typescript-eslint/eslint-plugin": "^8.11.0",
"@types/node": "22.9.1",
"@typescript-eslint/eslint-plugin": "^8.15.0",
"@web/test-runner": "^0.19.0",
"angular-eslint": "^18.4.0",
"cypress": "^13.15.1",
"eslint": "9.13.0",
"angular-eslint": "^18.4.1",
"cypress": "^13.16.0",
"eslint": "9.15.0",
"eslint-config-prettier": "9.1.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-json": "4.0.1",
"eslint-plugin-prettier": "5.2.1",
"jasmine-core": "5.4.0",
"jasmine-spec-reporter": "7.0.0",
"lint-staged": "15.2.10",
"ng-packagr": "18.2.1",
"npm-check-updates": "^17.1.6",
"postcss-scss": "4.0.9",
"ng-packagr": "19.0.0",
"npm-check-updates": "^17.1.11",
"prettier": "3.3.3",
"puppeteer": "^23.6.0",
"semantic-release": "24.1.3",
"puppeteer": "^23.9.0",
"semantic-release": "24.2.0",
"semantic-release-export-data": "^1.1.0",
"stylelint": "16.10.0",
"stylelint-config-prettier": "9.0.5",
"stylelint-config-recommended-scss": "14.1.0",
"stylelint-prettier": "5.0.2",
"type-coverage": "^2.29.7",
"typescript": "5.4.5",
"typescript-eslint": "^8.11.0",
"tailwindcss": "^3.4.14",
"bun-types": "^1.1.33"
"typescript": "5.6.3",
"typescript-eslint": "^8.15.0",
"tailwindcss": "^3.4.15",
"bun-types": "^1.1.36",
"postcss": "8.4.49",
"postcss-nesting": "13.0.1",
"cssnano": "7.0.6",
"postcss-scss": "4.0.9"
},
"typeCoverage": {
"atLeast": 92,
Expand Down
8 changes: 8 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
plugins: {
'postcss-nesting': {},
tailwindcss: {},
autoprefixer: {},
cssnano: { preset: 'default' },
},
};
2 changes: 1 addition & 1 deletion projects/ngx-copypaste-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-copypaste",
"version": "18.0.2",
"version": "19.0.0",
"license": "MIT",
"keywords": [
"ng2-copypaste",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('NgxCopyPasteDirective', () => {
it('should create an instance', () => {
expect(1).toEqual(1);
void expect(1).toEqual(1);
});
});
12 changes: 7 additions & 5 deletions projects/ngx-copypaste-lib/src/lib/ngx-copypaste.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,30 @@ export class NgxCopyPasteDirective {
if (select) {
select.removeAllRanges();
}
const element: HTMLElement = this._elementRef.nativeElement;
const element = this._elementRef.nativeElement as HTMLElement;
if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement) {
this._elementRef.nativeElement.select();
element.select();
} else {
const range: Range = document.createRange();
range.selectNodeContents(this._elementRef.nativeElement);
range.selectNodeContents(element);
select = window.getSelection();
if (select) {
select.addRange(range);
}
}
this.successCb.emit();
// eslint-disable-next-line @typescript-eslint/no-deprecated
document.execCommand('copy');
}

public async copy(): Promise<void> {
this.copyWithSelection();
try {
if (!navigator.clipboard) {
if (typeof navigator.clipboard === 'undefined') {
this.copyWithSelection();
return;
}
const element: HTMLElement = this._elementRef.nativeElement;
const element = this._elementRef.nativeElement as HTMLElement;
const value =
element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement
? element.value
Expand Down
5 changes: 1 addition & 4 deletions projects/ngx-copypaste-lib/src/test/copy.cy-spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import { CypressTestMaskModule } from './utils/cypress-test.module';
import { CypressTestMaskComponent } from './utils/cypress-test.component';

describe('Test Date Hh:m0', () => {
it('should return value from ctrl+V', () => {
cy.mount(CypressTestMaskComponent, {
imports: [CypressTestMaskModule],
});
cy.mount(CypressTestMaskComponent);

cy.get('#masked').type('testing').should('have.value', 'testing');
cy.get('#btn').click();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { Component } from '@angular/core';
import { FormControl } from '@angular/forms';
import { FormControl, ReactiveFormsModule } from '@angular/forms';
import { NgxCopyPasteDirective } from 'ngx-copypaste';

@Component({
selector: 'jsdaddy-open-source-test',
standalone: true,
imports: [ReactiveFormsModule, NgxCopyPasteDirective],
template: `
<input id="masked" ngxCopyPaste #cv="copy" (successCb)="copy()" [formControl]="form" />
<button (click)="cv.copy()" id="btn">Copy</button>
Expand Down
12 changes: 0 additions & 12 deletions projects/ngx-copypaste-lib/src/test/utils/cypress-test.module.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
describe('AppComponent', () => {
it('First test', () => {
expect(1).toEqual(1);
void expect(1).toEqual(1);
});
});
10 changes: 1 addition & 9 deletions src/app/cards/cards.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { NgOptimizedImage } from '@angular/common';
import { NgxCopyPasteDirective } from 'ngx-copypaste';
import { HighlightModule } from 'ngx-highlightjs';
import { AssetPipe } from '@libraries/asset/asset.pipe';
import { ColorPipe } from '@open-source/color/color.pipe';
import { CardItem } from './cards.type';
import { CopiedComponent } from '../shared/copied/copied.component';
import { CardType } from './cards.enum';
Expand All @@ -14,14 +13,7 @@ import { toSignal } from '@angular/core/rxjs-interop';
@Component({
selector: 'jsdaddy-open-source-cards',
standalone: true,
imports: [
NgOptimizedImage,
NgxCopyPasteDirective,
HighlightModule,
AssetPipe,
ColorPipe,
CopiedComponent,
],
imports: [NgOptimizedImage, NgxCopyPasteDirective, HighlightModule, AssetPipe, CopiedComponent],
providers: [ScrollService],
templateUrl: './cards.component.html',
styleUrls: ['./cards.component.scss'],
Expand Down
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,7 @@ bootstrapApplication(AppComponent, {
},
},
],
}).catch((err: unknown) => {
// eslint-disable-next-line no-console
}).catch((err) => console.error(err));
console.error(err);
});
2 changes: 2 additions & 0 deletions src/styles.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@use './libraries/styles/scroll-bar';

@tailwind base;
@tailwind components;
@tailwind utilities;
11 changes: 7 additions & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@
"removeComments": true,
"resolveJsonModule": true,
"paths": {
"ngx-copypaste": ["./projects/ngx-copypaste-lib/src/public-api"],
"@libraries/*": ["./src/libraries/*"],
"@open-source/*": ["./src/libraries/open-source/*"],
"@libraries/*": ["./src/libraries/*"]
"ngx-copypaste": ["./projects/ngx-copypaste-lib/src/public-api"]
},
"skipLibCheck": true,
"noImplicitAny": true
"noImplicitAny": true,
"isolatedModules": true
},
"angularCompilerOptions": {
"strictStandalone": true,
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
Expand All @@ -43,7 +45,8 @@
"extendedDiagnostics": {
"checks": {
"invalidBananaInBox": "error",
"nullishCoalescingNotNullable": "warning"
"nullishCoalescingNotNullable": "warning",
"unusedStandaloneImports": "suppress"
},
"defaultCategory": "suppress"
}
Expand Down

0 comments on commit 08d1628

Please sign in to comment.