Skip to content

Commit

Permalink
chore(release): 16.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jkuri committed Oct 8, 2023
1 parent 2298b21 commit 73ff360
Show file tree
Hide file tree
Showing 22 changed files with 507 additions and 2,569 deletions.
20 changes: 0 additions & 20 deletions .abstruse.yml

This file was deleted.

28 changes: 0 additions & 28 deletions e2e/protractor.conf.js

This file was deleted.

14 changes: 0 additions & 14 deletions e2e/src/app.e2e-spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions e2e/src/app.po.ts

This file was deleted.

13 changes: 0 additions & 13 deletions e2e/tsconfig.e2e.json

This file was deleted.

45 changes: 18 additions & 27 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"@angular/platform-browser": "^16.2.8",
"@angular/platform-browser-dynamic": "^16.2.8",
"@angular/router": "^16.2.8",
"core-js": "^3.5.0",
"rxjs": "^6.6.0",
"rxjs": "~7.8.0",
"tslib": "^2.6.2",
"zone.js": "~0.13.3"
},
Expand All @@ -43,34 +42,26 @@
"@angular/cli": "^16.2.5",
"@angular/compiler-cli": "^16.2.8",
"@angular/language-service": "^16.2.8",
"@types/body-parser": "^1.17.1",
"@types/cors": "^2.8.6",
"@types/express": "^4.17.2",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.8",
"@types/multer": "^1.3.10",
"@types/node": "^12.11.1",
"@types/rimraf": "^2.0.3",
"body-parser": "^1.19.0",
"bulma": "^0.8.0",
"codelyzer": "^6.0.0",
"@types/body-parser": "^1.19.3",
"@types/cors": "^2.8.14",
"@types/express": "^4.17.18",
"@types/jasmine": "~4.3.0",
"@types/multer": "^1.4.8",
"@types/node": "^20.8.3",
"body-parser": "^1.20.2",
"bulma": "^0.9.4",
"cors": "^2.8.5",
"eslint": "^6.7.2",
"express": "^4.17.1",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"express": "^4.18.2",
"jasmine-core": "~4.6.0",
"karma": "~6.4.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.1.0",
"multer": "^1.4.2",
"ng-packagr": "^16.2.3",
"prettier": "^2.0.5",
"protractor": "~7.0.0",
"rimraf": "^3.0.0",
"ts-node": "~8.5.4",
"tslint": "~6.1.0",
"typescript": "4.9.5"
"prettier": "^3.0.3",
"rimraf": "^5.0.5",
"typescript": "~5.1.3"
}
}
}
6 changes: 0 additions & 6 deletions projects/ngx-uploader/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,11 @@ module.exports = function (config) {
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage'),
reports: ['html', 'lcovonly'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
Expand Down
8 changes: 4 additions & 4 deletions projects/ngx-uploader/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngx-uploader",
"version": "11.0.0",
"version": "16.0.0",
"homepage": "https://ngx-uploader.com",
"repository": {
"type": "git",
Expand All @@ -14,10 +14,10 @@
"url": "https://github.com/bleenco/ngx-uploader/issues"
},
"peerDependencies": {
"@angular/common": ">= 10.0.0",
"@angular/core": ">= 10.0.0"
"@angular/common": ">= 13.0.0",
"@angular/core": ">= 13.0.0"
},
"dependencies": {
"tslib": "^2.0.0"
"tslib": "^2.3.0"
}
}
16 changes: 8 additions & 8 deletions projects/ngx-uploader/src/lib/ng-file-drop.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import { Subscription } from 'rxjs';
selector: '[ngFileDrop]'
})
export class NgFileDropDirective implements OnInit, OnDestroy {
@Input() options: UploaderOptions;
@Input() uploadInput: EventEmitter<UploadInput>;
@Input() options!: UploaderOptions;
@Input() uploadInput!: EventEmitter<UploadInput>;
@Output() uploadOutput: EventEmitter<UploadOutput>;

upload: NgUploaderService;
el: HTMLInputElement;
upload!: NgUploaderService;
el!: HTMLInputElement;

_sub: Subscription[];
_sub!: Subscription[];

constructor(public elementRef: ElementRef) {
this.uploadOutput = new EventEmitter<UploadOutput>();
Expand Down Expand Up @@ -46,9 +46,9 @@ export class NgFileDropDirective implements OnInit, OnDestroy {
}

ngOnDestroy() {
if(this._sub) {
this._sub.forEach(sub => sub.unsubscribe())
}
if (this._sub) {
this._sub.forEach(sub => sub.unsubscribe())
}
}

stopEvent = (e: Event) => {
Expand Down
12 changes: 6 additions & 6 deletions projects/ngx-uploader/src/lib/ng-file-select.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import { Subscription } from 'rxjs';
selector: '[ngFileSelect]'
})
export class NgFileSelectDirective implements OnInit, OnDestroy {
@Input() options: UploaderOptions;
@Input() uploadInput: EventEmitter<any>;
@Input() options!: UploaderOptions;
@Input() uploadInput!: EventEmitter<any>;
@Output() uploadOutput: EventEmitter<UploadOutput>;

upload: NgUploaderService;
el: HTMLInputElement;
upload!: NgUploaderService;
el!: HTMLInputElement;

_sub: Subscription[];
_sub!: Subscription[];

constructor(public elementRef: ElementRef) {
this.uploadOutput = new EventEmitter<UploadOutput>();
Expand Down Expand Up @@ -43,7 +43,7 @@ export class NgFileSelectDirective implements OnInit, OnDestroy {
}

ngOnDestroy() {
if (this.el){
if (this.el) {
this.el.removeEventListener('change', this.fileListener, false);
this._sub.forEach(sub => sub.unsubscribe());
}
Expand Down
25 changes: 12 additions & 13 deletions projects/ngx-uploader/src/lib/ngx-uploader.class.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { EventEmitter } from '@angular/core';
import { Observable, Subject, Subscription } from 'rxjs';
import { mergeMap, finalize } from 'rxjs/operators';
import { Observable, Subject, Subscription, mergeMap, finalize } from 'rxjs';
import { UploadFile, UploadOutput, UploadInput, UploadStatus, BlobFile } from './interfaces';

export function humanizeBytes(bytes: number): string {
Expand Down Expand Up @@ -44,33 +43,33 @@ export class NgUploaderService {
}

handleFiles(incomingFiles: FileList): void {
const allowedIncomingFiles: File[] = [].reduce.call(
const allowedIncomingFiles = [].reduce.call(
incomingFiles,
(acc: File[], checkFile: File, i: number) => {
const futureQueueLength = acc.length + this.queue.length + 1;
(acc: unknown, checkFile: File, i: number) => {
const futureQueueLength = (acc as File[]).length + this.queue.length + 1;
if (
this.isContentTypeAllowed(checkFile.type) &&
futureQueueLength <= this.maxUploads &&
this.isFileSizeAllowed(checkFile.size)
) {
acc = acc.concat(checkFile);
acc = (acc as File[]).concat(checkFile);
} else {
const rejectedFile: UploadFile = this.makeUploadFile(checkFile, i);
this.serviceEvents.emit({ type: 'rejected', file: rejectedFile });
}

return acc;
},
[]
);
return acc as File[];
}, [] as File[]) as File[];



this.queue.push(
...[].map.call(allowedIncomingFiles, (file: File, i: number) => {
...allowedIncomingFiles.map((file: File, i: number) => {
const uploadFile: UploadFile = this.makeUploadFile(file, i);
this.serviceEvents.emit({ type: 'addedToQueue', file: uploadFile });
return uploadFile;
})
);
)

this.serviceEvents.emit({ type: 'allAddedToQueue' });
}
Expand Down Expand Up @@ -347,7 +346,7 @@ export class NgUploaderService {

private parseResponseHeaders(httpHeaders: string): { [key: string]: string } {
if (!httpHeaders) {
return;
return {};
}

return httpHeaders
Expand Down
23 changes: 3 additions & 20 deletions projects/ngx-uploader/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,14 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"declarationMap": true,
"module": "es2015",
"moduleResolution": "node",
"declaration": true,
"sourceMap": true,
"declarationMap": true,
"inlineSources": true,
"experimentalDecorators": true,
"importHelpers": true,
"types": [],
"lib": [
"dom",
"es2015"
]
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true,
"flatModuleId": "AUTOGENERATED",
"flatModuleOutFile": "AUTOGENERATED"
"types": []
},
"exclude": [
"src/test.ts",
"**/*.spec.ts"
]
}
3 changes: 2 additions & 1 deletion projects/ngx-uploader/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
Expand All @@ -6,4 +7,4 @@
"angularCompilerOptions": {
"compilationMode": "partial"
}
}
}
7 changes: 2 additions & 5 deletions projects/ngx-uploader/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": [
"jasmine",
"node"
"jasmine"
]
},
"files": [
"src/test.ts"
],
"include": [
"**/*.spec.ts",
"**/*.d.ts"
Expand Down
Loading

0 comments on commit 73ff360

Please sign in to comment.