Skip to content

Commit

Permalink
fix angular plugin, fix types, update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
uNmAnNeR committed Jul 4, 2021
1 parent 13050af commit 5fe86dc
Show file tree
Hide file tree
Showing 13 changed files with 5,061 additions and 7,342 deletions.
12,262 changes: 4,987 additions & 7,275 deletions package-lock.json

Large diffs are not rendered by default.

40 changes: 20 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,37 @@
"homepage": "https://imask.js.org/",
"repository": "https://github.com/uNmAnNeR/imaskjs",
"devDependencies": {
"@babel/core": "^7.12.13",
"@babel/plugin-proposal-object-rest-spread": "^7.12.13",
"@babel/preset-env": "^7.12.13",
"@babel/preset-flow": "^7.12.13",
"@babel/register": "^7.12.13",
"@rollup/plugin-babel": "^5.2.3",
"@rollup/plugin-commonjs": "^17.1.0",
"@babel/core": "^7.14.6",
"@babel/plugin-proposal-object-rest-spread": "^7.14.7",
"@babel/preset-env": "^7.14.7",
"@babel/preset-flow": "^7.14.5",
"@babel/register": "^7.14.5",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^19.0.0",
"@rollup/plugin-eslint": "^8.0.1",
"@rollup/plugin-node-resolve": "^11.1.1",
"@rollup/plugin-replace": "^2.3.4",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-replace": "^2.4.2",
"babel-eslint": "^10.1.0",
"babel-plugin-istanbul": "^6.0.0",
"chai": "^4.3.0",
"core-js": "^3.8.3",
"coveralls": "^3.1.0",
"chai": "^4.3.4",
"core-js": "^3.15.2",
"coveralls": "^3.1.1",
"cross-env": "^7.0.3",
"documentation": "^13.1.1",
"eslint": "^7.19.0",
"eslint-plugin-flowtype": "^5.2.0",
"eslint": "^7.30.0",
"eslint-plugin-flowtype": "^5.8.0",
"flow-bin": "^0.144.0",
"lerna": "^3.22.1",
"mocha": "^8.2.1",
"lerna": "^4.0.0",
"mocha": "^9.0.2",
"nyc": "^15.1.0",
"opencollective-postinstall": "^2.0.3",
"rimraf": "^3.0.2",
"rollup": "^2.38.5",
"rollup-plugin-copy": "^3.3.0",
"rollup-plugin-multi-input": "^1.2.0",
"rollup": "^2.52.7",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-multi-input": "^1.3.1",
"rollup-plugin-polyfill": "^3.0.0",
"rollup-plugin-terser": "^7.0.2",
"sinon": "^9.2.4"
"sinon": "^11.1.1"
},
"engines": {
"npm": ">=4.0.0",
Expand Down
23 changes: 16 additions & 7 deletions packages/angular-imask/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,23 @@
"main": "example/main.ts",
"polyfills": "example/polyfills.ts",
"tsConfig": "tsconfig.example.json",
"aot": false,
"assets": [],
"styles": [],
"scripts": []
"scripts": [],
"vendorChunk": true,
"extractLicenses": false,
"buildOptimizer": false,
"sourceMap": true,
"optimization": false,
"namedChunks": true
},
"configurations": {
"production": {
"fileReplacements": [],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
Expand All @@ -48,7 +51,8 @@
}
]
}
}
},
"defaultConfiguration": ""
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
Expand Down Expand Up @@ -76,12 +80,17 @@
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"builder": "@angular-devkit/build-angular:ng-packagr",
"options": {
"tsConfig": "tsconfig.json",
"project": "ng-package.json"
}
},
, "configurations": {
"production": {
"tsConfig": "tsconfig.lib.prod.json"
}
}
},
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-imask/example/polyfills.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import 'zone.js/dist/zone';
import 'zone.js';
38 changes: 16 additions & 22 deletions packages/angular-imask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,32 +18,26 @@
"input",
"mask"
],
"peerDependencies": {
"@angular/common": ">=6.0.0",
"@angular/core": ">=6.0.0",
"@angular/forms": ">=6.0.0",
"@angular/platform-browser": ">=6.0.0"
},
"peerDependencies": {},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.25",
"@angular-devkit/build-ng-packagr": "^0.803.25",
"@angular/cli": "^8.3.26",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/compiler-cli": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/forms": "^8.2.14",
"@angular/language-service": "^8.2.14",
"@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^8.2.14",
"ng-packagr": "^5.7.1",
"@angular-devkit/build-angular": "~12.1.1",
"@angular/cli": "^12.1.1",
"@angular/common": "^12.1.1",
"@angular/compiler": "^12.1.1",
"@angular/compiler-cli": "^12.1.1",
"@angular/core": "^12.1.1",
"@angular/forms": "^12.1.1",
"@angular/language-service": "^12.1.1",
"@angular/platform-browser": "^12.1.1",
"@angular/platform-browser-dynamic": "^12.1.1",
"ng-packagr": "^12.1.0",
"rxjs": "^6.5.2",
"tsickle": "^0.36.0",
"typescript": "<3.6.0",
"zone.js": "~0.9.1"
"typescript": "4.3.5",
"zone.js": "~0.11.4"
},
"dependencies": {
"imask": "^6.0.7"
"imask": "^6.0.7",
"tslib": "^2.0.0"
},
"publishConfig": {
"directory": "dist"
Expand Down
8 changes: 5 additions & 3 deletions packages/angular-imask/src/default-imask-factory.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { IMaskFactory } from "./imask-factory";
import IMask from 'imask';
import { Injectable } from "@angular/core";

@Injectable({providedIn: 'root'})
import IMask from 'imask';


@Injectable({ providedIn: 'root' })
export class DefaultImaskFactory implements IMaskFactory {
create<Opts extends IMask.AnyMaskedOptions>(el: IMask.MaskElement | IMask.HTMLMaskingElement, opts: Opts) {
return IMask(el, opts);
}
}
}
1 change: 1 addition & 0 deletions packages/angular-imask/src/directive.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { IMaskDirective } from './imask.directive';
import { IMaskFactory } from './imask-factory';
import { DefaultImaskFactory } from './default-imask-factory';


@NgModule({
imports: [CommonModule],
declarations: [IMaskDirective],
Expand Down
10 changes: 4 additions & 6 deletions packages/angular-imask/src/imask-factory.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { Injectable } from '@angular/core';

type AnyMaskedOptions = import('imask').default.AnyMaskedOptions;
type HTMLMaskingElement = import('imask').default.HTMLMaskingElement;
type MaskElement = import('imask').default.MaskElement;
type InputMask<T> = import('imask').default.InputMask<T>;
import IMask from 'imask';

@Injectable({providedIn: "root"})

@Injectable({ providedIn: 'root' })
export abstract class IMaskFactory {
abstract create<Opts extends AnyMaskedOptions>(el: MaskElement | HTMLMaskingElement, opts: Opts): InputMask<Opts>
abstract create<Opts extends IMask.AnyMaskedOptions>(el: IMask.MaskElement | IMask.HTMLMaskingElement, opts: Opts): IMask.InputMask<Opts>
}
3 changes: 2 additions & 1 deletion packages/angular-imask/src/imask.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {
} from '@angular/core';
import { NG_VALUE_ACCESSOR, ControlValueAccessor, COMPOSITION_BUFFER_MODE } from '@angular/forms';

import {IMaskFactory} from "./imask-factory";
import { IMaskFactory } from './imask-factory';
import IMask from 'imask';


export const MASKEDINPUT_VALUE_ACCESSOR: Provider = {
Expand Down
2 changes: 1 addition & 1 deletion packages/angular-imask/tsconfig.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"example/polyfills.ts"
],
"include": [
"src/**/*.ts"
"src/**/*.d.ts"
],
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
Expand Down
9 changes: 5 additions & 4 deletions packages/angular-imask/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"outDir": "dist",
"target": "es2015",
"module": "es2015",
"module": "es2020",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
Expand All @@ -12,7 +12,7 @@
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"strict": true,
"baseUrl": "./",
"baseUrl": ".",
"paths": {
"@angular/*": ["node_modules/@angular/*"],
"rxjs/*": ["node_modules/rxjs/*"],
Expand All @@ -28,9 +28,10 @@
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"annotateForClosureCompiler": true,
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"strictInjectionParameters": true
"strictInjectionParameters": true,
"enableResourceInlining": true,
"enableIvy": false
}
}
4 changes: 2 additions & 2 deletions packages/imask/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ declare namespace IMask {
};

type PIPE_TYPE_VALUES = typeof PIPE_TYPE[keyof typeof PIPE_TYPE];
export function createPipe(masked: AnyMasked | AnyMask, from?: PIPE_TYPE_VALUES, to?: PIPE_TYPE_VALUES): any;
export function pipe(value: any, masked: AnyMasked | AnyMask, from?: PIPE_TYPE_VALUES, to?: PIPE_TYPE_VALUES): any;
export function createPipe(masked: AnyMasked | AnyMaskedOptions, from?: PIPE_TYPE_VALUES, to?: PIPE_TYPE_VALUES): any;
export function pipe(value: any, masked: AnyMasked | AnyMaskedOptions, from?: PIPE_TYPE_VALUES, to?: PIPE_TYPE_VALUES): any;
}

export import InputMask = IMask.InputMask;
Expand Down
1 change: 1 addition & 0 deletions packages/imask/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"watch": "rollup -c -w",
"build": "rollup -c",
"flow": "flow",
"lint": "eslint src/",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"keywords": [
Expand Down

0 comments on commit 5fe86dc

Please sign in to comment.