Skip to content

Commit

Permalink
feat: bundle for both ESM and CJS; migrate to vitest
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelvesavuori committed Apr 27, 2024
1 parent 7236c22 commit 42d5baf
Show file tree
Hide file tree
Showing 10 changed files with 3,681 additions and 5,261 deletions.
8,352 changes: 3,396 additions & 4,956 deletions package-lock.json

Large diffs are not rendered by default.

60 changes: 27 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
{
"name": "mikrolog",
"description": "The JSON logger you always wanted for Lambda.",
"version": "2.1.14",
"version": "2.1.15",
"author": "Mikael Vesavuori",
"license": "MIT",
"main": "./lib/index.js",
"type": "module",
"main": "lib/index.cjs",
"module": "lib/index.js",
"exports": {
".": {
"require": "./lib/index.cjs",
"import": "./lib/index.js"
}
},
"repository": {
"type": "git",
"url": "git+https://github.com/mikaelvesavuori/mikrolog.git"
Expand All @@ -31,12 +39,13 @@
],
"scripts": {
"start": "npx ts-node src/index.ts",
"test": "npx c8 -reporter=lcov ava",
"build": "npm run clean && npx tsc --project tsconfig.build.json",
"clean": "rm -rf lib",
"test": "npx vitest run --coverage",
"test:watch": "npx vitest",
"build": "npm run clean && tsup src --format esm,cjs --dts && mv dist lib",
"clean": "rm -rf lib && rm -rf dist",
"package": "npm pack",
"prepublishOnly": "npm run build",
"prepare": "husky install",
"prepare": "husky",
"docs": "npm run docs:clean && npm run docs:typedoc",
"docs:clean": "rm -rf docs",
"docs:typedoc": "npx typedoc --entryPoints src --entryPointStrategy expand --exclude '**/*+(test).ts' --externalPattern 'node_modules/**/*' --excludeExternals --out docs/"
Expand All @@ -45,33 +54,18 @@
"aws-metadata-utils": "1"
},
"devDependencies": {
"@ava/typescript": "3",
"@types/node": "18",
"@typescript-eslint/eslint-plugin": "5",
"@typescript-eslint/parser": "5",
"ava": "5",
"c8": "7",
"@types/node": "20",
"@typescript-eslint/eslint-plugin": "7",
"@typescript-eslint/parser": "7",
"@vitest/coverage-v8": "1",
"eslint": "8",
"eslint-config-prettier": "8",
"eslint-plugin-prettier": "4",
"husky": "8",
"prettier": "2",
"ts-node": "10",
"typedoc": "^0.23.23",
"typescript": "4"
},
"ava": {
"typescript": {
"rewritePaths": {
"src/": "lib/"
},
"compile": false
},
"files": [
"tests/**/*.ts"
],
"require": [
"ts-node/register"
]
"eslint-config-prettier": "9",
"eslint-plugin-prettier": "5",
"husky": "9",
"prettier": "3",
"tsup": "8",
"typescript": "5",
"typedoc": "0",
"vitest": "1"
}
}
4 changes: 2 additions & 2 deletions src/entities/MikroLog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
LogOutput,
Message,
HttpStatusCode
} from '../interfaces/MikroLog';
import { StaticMetadataConfigInput, DynamicMetadataOutput } from '../interfaces/Metadata';
} from '../interfaces/MikroLog.js';
import { StaticMetadataConfigInput, DynamicMetadataOutput } from '../interfaces/Metadata.js';

/**
* @description MikroLog is a Lambda-oriented lightweight JSON logger.
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './entities/MikroLog';
export * from './entities/MikroLog.js';
2 changes: 1 addition & 1 deletion src/interfaces/MikroLog.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StaticMetadataConfigInput, DynamicMetadataOutput } from './Metadata';
import { StaticMetadataConfigInput, DynamicMetadataOutput } from './Metadata.js';

/**
* @description Input when instantiating a new MikroLog instance.
Expand Down
2 changes: 1 addition & 1 deletion testdata/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { StaticMetadataConfigInput } from '../src/interfaces/Metadata';
import { StaticMetadataConfigInput } from '../src/interfaces/Metadata.js';

export const metadataConfig: StaticMetadataConfigInput = {
version: 1,
Expand Down
Loading

0 comments on commit 42d5baf

Please sign in to comment.