Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate @storybook/client-logger to TypeScript #5151

Merged
merged 5 commits into from
Jan 6, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/client-logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"license": "MIT",
"main": "dist/index.js",
"jsnext:main": "src/index.js",
"types": "src/index.d.ts",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be dist/index.d.ts I think?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this – thanks for pointing it out.

"scripts": {
"prepare": "node ../../scripts/prepare.js"
},
Expand Down
7 changes: 0 additions & 7 deletions lib/client-logger/src/index.js

This file was deleted.

7 changes: 7 additions & 0 deletions lib/client-logger/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const { console } = global;

export const logger = {
info: (message: any): void => console.log(message),
warn: (message: any): void => console.warn(message),
error: (message: any): void => console.error(message),
};
12 changes: 12 additions & 0 deletions lib/client-logger/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "./src"
},
"include": [
"src/**/*"
],
"exclude": [
"src/__tests__/**/*"
]
}