Skip to content

Commit 90d3a0f

Browse files
kylecarbscode-asher
authored andcommitted
Allow logger package to be publishable (#37)
1 parent 68cb387 commit 90d3a0f

File tree

5 files changed

+44
-4
lines changed

5 files changed

+44
-4
lines changed

packages/logger/.npmignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
src
2+
tsconfig.build.json
3+
webpack.config.js
4+
yarn.lock

packages/logger/README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Logger
22

3-
Beautiful client logging inspired by https://github.com/uber-go/zap.
3+
Beautiful logging inspired by https://github.com/uber-go/zap.
4+
5+
- Built for node and the browser
6+
- Zero dependencies
7+
- Uses groups in the browser to reduce clutter
48

59
## Example Usage
610

packages/logger/package.json

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
2-
"name": "@coder/logger",
3-
"description": "Beautiful client logging inspired by https://github.com/uber-go/zap.",
4-
"main": "src/index.ts"
2+
"name": "@coder/logger",
3+
"description": "Beautiful logging inspired by https://github.com/uber-go/zap.",
4+
"scripts": {
5+
"build": "tsc -p tsconfig.build.json && cp ./out/packages/logger/src/* ./out && rm -rf out/packages && ../../node_modules/.bin/webpack --config ./webpack.config.js",
6+
"postinstall": "if [ ! -d out ];then npm run build; fi"
7+
},
8+
"version": "1.0.3",
9+
"main": "out/main.js",
10+
"types": "out/index.d.ts",
11+
"author": "Coder",
12+
"license": "MIT"
513
}

packages/logger/tsconfig.build.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"declarationDir": "out",
5+
"declaration": true,
6+
"emitDeclarationOnly": true
7+
}
8+
}

packages/logger/webpack.config.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const path = require("path");
2+
const merge = require("webpack-merge");
3+
4+
module.exports = merge(require(path.join(__dirname, "../../scripts", "webpack.general.config.js"))(), {
5+
devtool: "none",
6+
mode: "production",
7+
target: "node",
8+
output: {
9+
path: path.join(__dirname, "out"),
10+
filename: "main.js",
11+
libraryTarget: "commonjs",
12+
},
13+
entry: [
14+
"./packages/logger/src/index.ts"
15+
],
16+
});

0 commit comments

Comments
 (0)