Skip to content

Commit

Permalink
fix(tree-explorer): update bson verison, align README and add type de…
Browse files Browse the repository at this point in the history
…finitions to package.json
  • Loading branch information
gagik committed Jan 17, 2025
1 parent f7dd1cc commit 85d81de
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 29 deletions.
40 changes: 16 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,23 @@
# Devtools Shared Monorepo
# mongodb-log-writer

This repository contains packages that are shared dependencies of Compass, the MongoDB extension for VSCode and MongoSH.
A library for writing MongoDB logv2 messages.

To start working:
```js
import { MongoLogManager, mongoLogId } from 'mongodb-log-writer';

```
npm run bootstrap
```

Lint code and dependencies

```
npm run check
```
const manager = new MongoLogManager({
directory: os.homedir() + '/.app-logs',
retentionDays: 30,
onwarn: console.warn,
onerror: console.error,
gzip: true
});
await manager.cleanupOldLogfiles();

Run tests

```
npm run test
```

To create a new workspace:

```
npm run create-workspace
const writer = manager.createLogWriter();
writer.info('component', mongoLogId(12345), 'context', 'message', { foo: 'bar' });
```

## Contributing
## LICENSE

For contributing, please refer to [CONTRIBUTING.md](CONTRIBUTING.md)
Apache-2.0
25 changes: 20 additions & 5 deletions packages/mongodb-log-writer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,26 @@
"logv2"
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./.esm-wrapper.mjs"
"require": {
"default": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"import": {
"default": "./.esm-wrapper.mjs",
"types": "./dist/index.d.ts"
}
},
"./mongo-log-writer": "./dist/mongo-log-writer.js",
"./mongo-log-manager": "./dist/mongo-log-manager.js"
"./mongo-log-writer": {
"default": "./dist/mongo-log-writer.js",
"types": "./dist/mongo-log-writer.d.ts"
},
"./mongo-log-manager": {
"default": "./dist/mongo-log-manager.js",
"types": "./dist/mongo-log-manager.d.ts"
}
},
"files": [
"LICENSE",
Expand All @@ -49,9 +62,11 @@
},
"license": "Apache-2.0",
"dependencies": {
"bson": "^6.8.0",
"heap-js": "^2.3.0"
},
"peerDependencies": {
"bson": "6.x"
},
"devDependencies": {
"@mongodb-js/eslint-config-devtools": "0.9.10",
"@mongodb-js/mocha-config-devtools": "^1.0.4",
Expand Down

0 comments on commit 85d81de

Please sign in to comment.