Skip to content

Commit

Permalink
Merge pull request #28 from juanjotorres90/feature/update-angular-19
Browse files Browse the repository at this point in the history
build: ⬆️ add support for Angular 19
  • Loading branch information
juanjotorres90 authored Dec 7, 2024
2 parents 084523e + cf99749 commit a34d6e9
Show file tree
Hide file tree
Showing 27 changed files with 4,799 additions and 3,733 deletions.
29 changes: 29 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,35 @@
"avatar_url": "https://avatars3.githubusercontent.com/u/5524772?v=4",
"profile": "https://github.com/whegar",
"contributions": ["ideas", "question", "infra", "maintenance", "review"]
},
{
"login": "ghollingworthh",
"name": "Glen Hollingworth",
"avatar_url": "https://avatars.githubusercontent.com/u/26550815?v=4?s=100",
"profile": "https://github.com/ghollingworthh",
"contributions": [
"code",
"doc",
"ideas",
"question",
"infra",
"maintenance",
"review"
]
},
{
"login": "EphraimHaber",
"name": "EphraimHaber",
"avatar_url": "https://avatars.githubusercontent.com/u/61934858?v=4?s=100",
"profile": "https://github.com/EphraimHaber",
"contributions": [
"code",
"doc",
"ideas",
"question",
"maintenance",
"review"
]
}
],
"contributorsPerLine": 7,
Expand Down
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

48 changes: 0 additions & 48 deletions .eslintrc.json

This file was deleted.

12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [19.0.0] - 2024-12-07

### Added

- Add support for Angular 19 ([#25](https://github.com/juanjotorres90/ngx-material-intl-tel-input/issues/25)).
- Add 'useMask' option to enable masking of the phone number input.

### Changed

- Upgrade project to nx 20.2.
- Upgrade project to use ESLint 9.

## [18.2.1] - 2024-11-22

### Added
Expand Down
52 changes: 29 additions & 23 deletions README.md

Large diffs are not rendered by default.

36 changes: 0 additions & 36 deletions apps/ngx-material-intl-tel-input/.eslintrc.json

This file was deleted.

53 changes: 53 additions & 0 deletions apps/ngx-material-intl-tel-input/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
const { FlatCompat } = require('@eslint/eslintrc');
const js = require('@eslint/js');
const baseConfig = require('../../eslint.config.js');

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended
});

module.exports = [
...baseConfig,
...compat
.config({
extends: [
'plugin:@nx/angular',
'plugin:@angular-eslint/template/process-inline-templates'
]
})
.map((config) => ({
...config,
files: ['**/*.ts'],
rules: {
...config.rules,
'@angular-eslint/directive-selector': [
'error',
{
type: 'attribute',
prefix: 'ngxMaterialIntlTelInput',
style: 'camelCase'
}
],
'@angular-eslint/component-selector': [
'error',
{
type: 'element',
prefix: 'ngx-material-intl-tel-input',
style: 'kebab-case'
}
]
}
})),
...compat
.config({
extends: ['plugin:@nx/angular-template']
})
.map((config) => ({
...config,
files: ['**/*.html'],
rules: {
...config.rules
}
}))
];
11 changes: 5 additions & 6 deletions apps/ngx-material-intl-tel-input/jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable */
export default {
displayName: 'ngx-material-intl-tel-input',
preset: '../../jest.preset.js',
Expand All @@ -9,14 +8,14 @@ export default {
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
stringifyContentPathRegex: '\\.(html|svg)$'
}
]
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
'jest-preset-angular/build/serializers/html-comment'
]
};
5 changes: 5 additions & 0 deletions apps/ngx-material-intl-tel-input/src/app/app.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
<ngx-material-intl-tel-input
(currentValue)="getValue($event)"
fieldControlName="phone"
[emojiFlags]="false"
[includeDialCode]="false"
[useMask]="false"
[forceSelectedCountryCode]="false"
[showMaskPlaceholder]="true"
></ngx-material-intl-tel-input>
<button mat-flat-button type="submit" [disabled]="!formTestGroup.valid">
Submit
Expand Down
1 change: 0 additions & 1 deletion apps/ngx-material-intl-tel-input/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { RouterModule } from '@angular/router';
import { NgxMaterialIntlTelInputComponent } from 'ngx-material-intl-tel-input';

@Component({
standalone: true,
imports: [
NgxMaterialIntlTelInputComponent,
RouterModule,
Expand Down
4 changes: 2 additions & 2 deletions apps/ngx-material-intl-tel-input/src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand All @@ -11,7 +11,7 @@
/>
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<link
Expand Down
23 changes: 13 additions & 10 deletions apps/ngx-material-intl-tel-input/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,22 @@
@use '@angular/material' as mat;
@use './m3-theme';

@include mat.core();
@include mat.elevation-classes();
@include mat.app-background();

:root {
--mdc-theme-primary: #209ffc;
--mdc-theme-secondary: #023871;
--mdc-theme-error: #f44336;
--mdc-typography-font-family: Roboto, 'Helvetica Neue', sans-serif;
--mdc-theme-primary-rgb: 32, 159, 252;
--mat-option-selected-state-label-text-color: #209ffc;
--mat-select-focused-arrow-color: #209ffc;
--mdc-outlined-text-field-focus-outline-color: #209ffc;

@include mat.all-component-themes(m3-theme.$light-theme);

& {
--mdc-theme-primary: #209ffc;
--mdc-theme-secondary: #023871;
--mdc-theme-error: #f44336;
--mdc-typography-font-family: Roboto, 'Helvetica Neue', sans-serif;
--mdc-theme-primary-rgb: 32, 159, 252;
--mat-option-selected-state-label-text-color: #209ffc;
--mat-select-focused-arrow-color: #209ffc;
--mdc-outlined-text-field-focus-outline-color: #209ffc;
}
}

html,
Expand Down
14 changes: 6 additions & 8 deletions apps/ngx-material-intl-tel-input/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
globalThis.ngJest = {
testEnvironmentOptions: {
errorOnUnknownElements: true,
errorOnUnknownProperties: true,
},
};
import 'jest-preset-angular/setup-jest';
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';

setupZoneTestEnv({
errorOnUnknownElements: true,
errorOnUnknownProperties: true
});
71 changes: 71 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
const { FlatCompat } = require('@eslint/eslintrc');
const js = require('@eslint/js');
const nxEslintPlugin = require('@nx/eslint-plugin');
const stylisticPlugin = require('@stylistic/eslint-plugin');

const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended
});

module.exports = [
{ plugins: { '@nx': nxEslintPlugin, '@stylistic': stylisticPlugin } },
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
rules: {
'@nx/enforce-module-boundaries': [
'error',
{
enforceBuildableLibDependency: true,
allow: [],
depConstraints: [
{
sourceTag: '*',
onlyDependOnLibsWithTags: ['*']
}
]
}
]
}
},
...compat
.config({
extends: ['plugin:@nx/typescript']
})
.map((config) => ({
...config,
files: ['**/*.ts', '**/*.tsx'],
rules: {
...config.rules,
'@stylistic/no-extra-semi': 'error'
}
})),
...compat
.config({
extends: ['plugin:@nx/javascript']
})
.map((config) => ({
...config,
files: ['**/*.js', '**/*.jsx'],
rules: {
...config.rules,
'@stylistic/no-extra-semi': 'error'
}
})),
...compat
.config({
env: {
jest: true
}
})
.map((config) => ({
...config,
files: ['**/*.spec.ts', '**/*.spec.tsx', '**/*.spec.js', '**/*.spec.jsx'],
rules: {
...config.rules
}
})),
{
ignores: ['**/*.json']
}
];
8 changes: 4 additions & 4 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getJestProjects } from '@nx/jest';
import { getJestProjectsAsync } from '@nx/jest';

export default {
projects: getJestProjects(),
};
export default async () => ({
projects: await getJestProjectsAsync()
});
Loading

0 comments on commit a34d6e9

Please sign in to comment.