Skip to content

Commit

Permalink
feat: initialize new logger package
Browse files Browse the repository at this point in the history
  • Loading branch information
winprn committed Oct 28, 2024
1 parent 742ea7f commit 64b2d30
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/logger/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Topology Logger

This package makes it easy to log messages in a structured way.

## Usage

This package is intended to be used as a dependency for the Topology Protocol. However, you can use it as a standalone package. For that, you can install it using:

```bash
# yarn
yarn add @topology-foundation/logger

# npm
npm install @topology-foundation/logger
```

### Build

To build the package, you can run:

```bash
yarn build
```

### Tests

To run the tests, you can run:

```bash
yarn test
```
24 changes: 24 additions & 0 deletions packages/logger/asconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"entries": ["./src/index.asc.ts"],
"targets": {
"debug": {
"outFile": "dist/asc/debug.wasm",
"textFile": "dist/asc/debug.wat",
"sourceMap": true,
"debug": true
},
"release": {
"outFile": "dist/asc/release.wasm",
"textFile": "dist/asc/release.wat",
"sourceMap": true,
"optimizeLevel": 3,
"shrinkLevel": 0,
"converge": false,
"noAssert": false
}
},
"options": {
"bindings": "esm",
"disableWarning": [235]
}
}
39 changes: 39 additions & 0 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@topology-foundation/logger",
"version": "0.2.0",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/topology-foundation/ts-topology.git"
},
"type": "module",
"types": "./dist/src/index.d.ts",
"files": [
"src",
"dist",
"!dist/test",
"!**/*.tsbuildinfo"
],
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"import": "./dist/src/index.js"
},
"./wasm": {
"types": "./dist/src/index.d.ts",
"import": "./src/index.asc.ts"
}
},
"scripts": {
"asbuild": "yarn asbuild:debug && yarn asbuild:release",
"asbuild:debug": "asc --config asconfig.json --target debug",
"asbuild:release": "asc --config asconfig.json --target release",
"build": "tsc -b",
"clean": "rm -rf dist/ node_modules/",
"prepack": "tsc -b",
"test": "vitest"
},
"devDependencies": {
"assemblyscript": "^0.27.29"
}
}
Empty file added packages/logger/src/index.ts
Empty file.
13 changes: 13 additions & 0 deletions packages/logger/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "dist"
},
"references": [
{
"path": "../object"
}
],
"include": ["src/**/*.ts"],
"exclude": ["src/**/*.asc.ts"]
}
6 changes: 6 additions & 0 deletions packages/logger/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://typedoc.org/schema.json",
"includeVersion": true,
"entryPoints": ["src/index.ts"],
"readme": "README.md"
}

0 comments on commit 64b2d30

Please sign in to comment.