Skip to content

Commit

Permalink
fixes #33.
Browse files Browse the repository at this point in the history
Updated packages.
Added typescript support.
  • Loading branch information
Kames, Justin (SPLXE) - KLM authored and Kames, Justin (SPLXE) - KLM committed Jan 31, 2020
1 parent b593391 commit 698c2c0
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 27 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
.idea
coverage/
package-lock.json
sample-project
sample-project
ts-sample-project

14 changes: 11 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
/dist/
/node_modules/
.idea
coverage/
node_modules/
sample-project/
package-lock.json
sample-project
ts-sample-project
.travis.yml
jest.config.js
tsconfig.json
tslint.json
src/
tests/
src/
5 changes: 3 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ module.exports = {
testURL: "http://localhost/",
collectCoverage: true,
collectCoverageFrom: [
"src/**/*.{ts,tsx,js,jsx}"
"src/**/*.ts",
"!src/**/**/*.d.ts",
]
}
}
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,31 @@
"license": "MIT",
"author": "Justin Kames",
"description": "vuejs-logger, provides customizable logging functionality for Vue.js.",
"version": "1.5.3",
"version": "1.5.4",
"repository": {
"type": "git",
"url": "https://github.com/justinkames/vuejs-logger.git"
},
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"build": "tsc && npm test && mkdir -p ./dist/lib/types && cp src/lib/types/index.d.ts ./dist/lib/types/index.d.ts",
"tsc": "tsc --watch",
"test": "tsc && jest",
"upload-coverage": "codecov -t $CODECOV_TOKEN",
"publish": "npm run build && npm publish"
"publish": "npm run build && npm test && npm publish"
},
"devDependencies": {
"@types/jest": "23.3.1",
"@types/node": "10.5.3",
"jest": "23.4.1",
"ts-jest": "23.0.1",
"typescript": "2.9.2",
"chai": "4.1.2",
"vue": "2.5.16",
"codecov": "3.0.4"
"@types/jest": "25.1.1",
"@types/node": "13.5.3",
"jest": "25.1.0",
"ts-jest": "25.1.0",
"typescript": "3.7.5",
"chai": "4.2.0",
"codecov": "3.6.2"
},
"dependencies": {
"vue": "2.6.11",
"es6-object-assign": "1.1.0"
}
},
"typings": "dist/lib/types/index.d.ts"
}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ObjectAssign from "es6-object-assign";
ObjectAssign.polyfill();
import VueLogger from "./vue-logger/vue-logger";
import VueLogger from "./vue-logger";
export default VueLogger;
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions src/lib/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Augment the typings of Vue.js
*/
import Vue = require('vue');

import * as VueLogger from '../../index';

export interface Log {
debug(...args: any[]): void;

info(...args: any[]): void;

warn(...args: any[]): void;

error(...args: any[]): void;

fatal(...args: any[]): void;
}

declare module 'vue/types/vue' {
interface Vue {
$log: Log;
}
}

export default VueLogger;
File renamed without changes.
4 changes: 2 additions & 2 deletions tests/config.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {strict, strictEqual} from "assert";
import VueLogger from "../src";
import {LogLevels} from "../src/vue-logger/enum/log-levels";
import VueLogger from "../src/index";
import {LogLevels} from "../src/enum/log-levels";

describe("isValidOptions()", () => {

Expand Down
6 changes: 3 additions & 3 deletions tests/install.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {notStrictEqual, strictEqual} from "assert";
import chai from "chai";
import Vue from "vue/dist/vue.min";
import VueLogger from "../src";
import {LogLevels} from "../src/vue-logger/enum/log-levels";
import {ILoggerOptions} from "../src/vue-logger/interfaces/logger-options";
import VueLogger from "../src/index";
import {LogLevels} from "../src/enum/log-levels";
import {ILoggerOptions} from "../src/interfaces/logger-options";
const expect = chai.expect;

describe("vue-logger.ts", () => {
Expand Down
6 changes: 3 additions & 3 deletions tests/output.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import chai from "chai";
import Vue from "vue/dist/vue.min";
import VueLogger from "../src";
import {LogLevels} from "../src/vue-logger/enum/log-levels";
import {ILoggerOptions} from "../src/vue-logger/interfaces/logger-options";
import VueLogger from "../src/index";
import {LogLevels} from "../src/enum/log-levels";
import {ILoggerOptions} from "../src/interfaces/logger-options";

const expect = chai.expect;

Expand Down
3 changes: 3 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"allow-named-functions"
]
},
"rules": {
"quotemark": [true, "single", "avoid-escape"]
},
"rulesDirectory": []
}

0 comments on commit 698c2c0

Please sign in to comment.