diff --git a/packages/logger/README.md b/packages/logger/README.md new file mode 100644 index 00000000..fe1439e4 --- /dev/null +++ b/packages/logger/README.md @@ -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 +``` diff --git a/packages/logger/asconfig.json b/packages/logger/asconfig.json new file mode 100644 index 00000000..42582929 --- /dev/null +++ b/packages/logger/asconfig.json @@ -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] + } +} diff --git a/packages/logger/package.json b/packages/logger/package.json new file mode 100644 index 00000000..149ba22b --- /dev/null +++ b/packages/logger/package.json @@ -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" + } +} diff --git a/packages/logger/src/index.ts b/packages/logger/src/index.ts new file mode 100644 index 00000000..e69de29b diff --git a/packages/logger/tsconfig.json b/packages/logger/tsconfig.json new file mode 100644 index 00000000..3e8b28b1 --- /dev/null +++ b/packages/logger/tsconfig.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "dist" + }, + "references": [ + { + "path": "../object" + } + ], + "include": ["src/**/*.ts"], + "exclude": ["src/**/*.asc.ts"] +} diff --git a/packages/logger/typedoc.json b/packages/logger/typedoc.json new file mode 100644 index 00000000..c9c65c9c --- /dev/null +++ b/packages/logger/typedoc.json @@ -0,0 +1,6 @@ +{ + "$schema": "https://typedoc.org/schema.json", + "includeVersion": true, + "entryPoints": ["src/index.ts"], + "readme": "README.md" +}