Skip to content

Commit

Permalink
Merge pull request #258 from crazyfactory/233-update-all-packages
Browse files Browse the repository at this point in the history
233 update all packages
  • Loading branch information
paibamboo authored Nov 16, 2020
2 parents ea485cf + 6925bbb commit 2d15fe3
Show file tree
Hide file tree
Showing 10 changed files with 4,235 additions and 7,558 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# builds
lib/
dist/
lib.es2015/
umd/*.js
coverage/
Expand Down
11,725 changes: 4,198 additions & 7,527 deletions package-lock.json

Large diffs are not rendered by default.

36 changes: 19 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,38 @@
},
"dependencies": {},
"devDependencies": {
"@types/jest": "^23.3.2",
"@types/jest": "^26.0.15",
"@types/node": "^14.14.7",
"del": "^6.0.0",
"del-cli": "^3.0.1",
"es6-shim": "^0.35.2",
"husky": "^0.14.0",
"husky": "^4.3.0",
"isomorphic-fetch": "^3.0.0",
"jest": "^23.6.0",
"jest": "^26.6.3",
"node-fetch": "^2.6.1",
"semantic-release": "^8.0.3",
"ts-jest": "^23.10.3",
"ts-jest": "^26.4.4",
"ts-node": "^9.0.0",
"tslint": "^5.4.1",
"tslint": "^6.1.3",
"tslint-microsoft-contrib": "^6.2.0",
"typescript": "^3.9.7",
"validate-commit-msg": "^2.10.1",
"webpack": "^3.0.0"
"typescript": "^4.0.5",
"validate-commit-msg": "^2.14.0",
"webpack": "^5.4.0",
"webpack-cli": "^4.2.0"
},
"husky": {
"hooks": {
"pre-commit": "npm run lint -s",
"commit-msg": "validate-commit-msg",
"pre-push": "npm run test && npm run build -s"
}
},
"scripts": {
"test": "jest",
"test:no-cache": "jest --no-cache",
"test:watch": "jest --watch",
"build": "npm run clean && tsc -p . && tsc -p tsconfig.es2015.json && webpack ./webpack.config.js",
"clean": "del-cli ./lib ./lib.es2015 ./coverage ./umd/**/*.js",
"lint": "tslint --format stylish --project ./tsconfig.json --type-check './src/**/*.ts'",
"lint-fix": "npm run lint -s -- --fix",
"semantic-release": "semantic-release pre && npm publish && semantic-release post",
"precommit": "npm run lint -s",
"commitmsg": "validate-commit-msg",
"prepush": "npm run test && npm run build -s"
"lint": "tslint --format stylish --project ./tsconfig.json './src/**/*.ts'",
"lint-fix": "npm run lint -s -- --fix"
},
"jest": {
"transform": {
Expand All @@ -68,6 +70,6 @@
"node_modules",
"./"
],
"setupTestFrameworkScriptFile": "./JestBootstrap.ts"
"setupFilesAfterEnv": ["./JestBootstrap.ts"]
}
}
2 changes: 1 addition & 1 deletion src/Service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type ServiceRequest = IFetchRequest & {
* Can be used for hub-classes as well by passing down the client-value
*/
export class Service {
public readonly client: Client;
public readonly client!: Client;

constructor(config?: ServiceRequest | Client | Service) {
if (config instanceof Service) {
Expand Down
2 changes: 1 addition & 1 deletion src/internal/formatting.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("formatting", () => {
[{c: 0}, "c=0"],
[{a: 0, b: "bob"}, "a=0&b=bob"],
[{z: "last", a: "first"}, "a=first&z=last"]
].forEach((v: [object, string]) => {
].forEach((v) => {
const obj: any = v[0];
const exp = v[1];
it("transforms `" + JSON.stringify(obj) + "` into `" + exp + "`", () => {
Expand Down
4 changes: 3 additions & 1 deletion src/middlewares/ContentTypeMiddleware.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {ContentTypeMiddleware} from "./ContentTypeMiddleware";
import {IFetchRequest} from "./FetchMiddleware";
import {IFetchRequest, IFetchResponse} from "./FetchMiddleware";

describe("ContentTypeMiddleware", () => {
it("should add a content type application/json by default", () => {
const spy = jest.fn((options: IFetchRequest) => {
const contentType = options.headers && options.headers["content-type"];
expect(contentType).toBe("application/json");
return null as any as Promise<IFetchResponse<any>>;
});
const mw = new ContentTypeMiddleware();
mw.process({}, spy);
Expand All @@ -14,6 +15,7 @@ describe("ContentTypeMiddleware", () => {
const spy = jest.fn((options: IFetchRequest) => {
const contentType = options.headers && options.headers["content-type"];
expect(contentType).toBe("text/plain");
return null as any as Promise<IFetchResponse<any>>;
});
const mw = new ContentTypeMiddleware("text/plain");
mw.process({}, spy);
Expand Down
4 changes: 3 additions & 1 deletion src/middlewares/IncludeCredentialsMiddleware.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {IFetchRequest} from "./FetchMiddleware";
import {IFetchRequest, IFetchResponse} from "./FetchMiddleware";
import {IncludeCredentialsMiddleware} from "./IncludeCredentialsMiddleware";

describe("IncludeCredentialsMiddleware", () => {
Expand All @@ -14,13 +14,15 @@ describe("IncludeCredentialsMiddleware", () => {
const middleware = new IncludeCredentialsMiddleware();
const spy = jest.fn((options: IFetchRequest) => {
expect(options.credentials).toBe("include");
return null as any as Promise<IFetchResponse<any>>;
});
middleware.process({}, spy);
});
it("should be able to set value of credentials via constructor", () => {
const middleware = new IncludeCredentialsMiddleware("omit");
const spy = jest.fn((options: IFetchRequest) => {
expect(options.credentials).toBe("omit");
return null as any as Promise<IFetchResponse<any>>;
});
middleware.process({}, spy);
});
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/MockMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export interface IMockMiddlewareHandler<IN, OUT> {
delay?: number;
}

declare const Response: { new<T>(body: any, init: any): IFetchResponse<T> };
declare const Response: new<T>(body: any, init: any) => IFetchResponse<T>;

export class MockMiddleware<IN, OUT> implements IMiddleware<IN, OUT> {

Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"lib": ["es5", "scripthost", "dom", "es6"],
"noImplicitAny": true,
"esModuleInterop": false,
"strict": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"strictNullChecks": true,
Expand Down
16 changes: 7 additions & 9 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"no-document-write": true,
"no-eval": true,
"no-exec-script": true,
"no-function-constructor-with-string-args": true,
"function-constructor": true,
"no-http-string": [
true,
"http://www.example.com/?.*",
Expand Down Expand Up @@ -49,21 +49,20 @@
"no-constant-condition": true,
"no-control-regex": true,
"no-debugger": true,
"no-duplicate-case": true,
"no-duplicate-switch-case": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-increment-decrement": true,
"increment-decrement": true,
"no-invalid-regexp": true,
"no-invalid-this": true,
"no-jquery-raw-elements": true,
"no-regex-spaces": true,
"no-sparse-arrays": true,
"no-stateless-class": true,
"no-unnecessary-class": true,
"no-string-literal": true,
"no-unnecessary-bind": true,
"unnecessary-bind": true,
"no-unnecessary-override": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-with-statement": true,
"promise-must-complete": true,
"radix": true,
Expand All @@ -75,7 +74,6 @@
],
"use-isnan": true,
"use-named-parameter": true,
"valid-typeof": true,
"class-name": true,
"comment-format": [
true,
Expand Down Expand Up @@ -119,7 +117,7 @@
"new-parens": true,
"no-construct": true,
"no-default-export": true,
"no-empty-interfaces": true,
"no-empty-interface": true,
"no-for-in": true,
"no-function-expression": true,
"no-inferrable-types": false,
Expand All @@ -132,7 +130,7 @@
"no-unnecessary-local-variable": true,
"no-var-keyword": true,
"no-var-requires": true,
"no-var-self": true,
"no-this-assignment": true,
"object-literal-sort-keys": false,
"one-variable-per-declaration": true,
"prefer-array-literal": true,
Expand Down

0 comments on commit 2d15fe3

Please sign in to comment.