Skip to content
This repository was archived by the owner on Oct 31, 2024. It is now read-only.

Commit b63a6eb

Browse files
committed
feat: Finishes API, docs, and test
1 parent b5e913d commit b63a6eb

14 files changed

+878
-172
lines changed

.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
*.cjs
1+
*.cjs
2+
*.mjs

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
FORCE_COLOR=1 pnpm run lint-staged --shell
4+
FORCE_COLOR=1 pnpm lint-staged --shell

.release-it.json

+9
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,14 @@
66
"github": {
77
"release": true,
88
"web": true
9+
},
10+
"hooks": {
11+
"before:init": [
12+
"pnpm clean",
13+
"pnpm build",
14+
"pnpm typecheck",
15+
"pnpm xo",
16+
"pnpm test"
17+
]
918
}
1019
}

LICENSE

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
MIT License
22

3+
Copyright (c) 2022 Erfan Safari
34
Copyright (c) 2023 Jakob Heuser
45

56
Permission is hereby granted, free of charge, to any person obtaining a copy

README.md

+228-104
Large diffs are not rendered by default.

ava.config.mjs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const config = {
2+
extensions: {
3+
ts: "module",
4+
},
5+
files: ["test/*.spec.ts", "test/**/*.spec.ts"],
6+
require: ["dotenv/config"],
7+
nodeArguments: [
8+
"--loader=ts-node/esm",
9+
"--require=./ava.env.cjs",
10+
"--trace-warnings",
11+
],
12+
};
13+
14+
export default config;

ava.env.cjs

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/* eslint-disable */
2+
3+
// https://github.com/nodejs/node/issues/30810
4+
5+
const originalEmit = process.emit;
6+
process.emit = function (name, data, ...args) {
7+
if (
8+
name === "warning" &&
9+
typeof data === "object" &&
10+
data.name === "ExperimentalWarning" &&
11+
(data.message.includes("--experimental-loader") ||
12+
data.message.includes("Custom ESM Loaders is an experimental feature") ||
13+
data.message.includes(
14+
"The Node.js specifier resolution flag is experimental"
15+
) ||
16+
data.message.includes(
17+
"Importing JSON modules is an experimental feature"
18+
))
19+
)
20+
return false;
21+
22+
return originalEmit.apply(process, arguments);
23+
};

package.json

+8-6
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
"homepage": "https://github.com/taskless/mongo-data-api/",
88
"repository": "taskless/mongo-data-api.git",
99
"scripts": {
10-
"lint-staged": "lint-staged",
11-
"make": "make",
10+
"build": "tsup",
11+
"clean": "shx rm -rf dist",
1212
"prepare": "husky install",
13-
"test": "echo \"Error: no test specified\" && exit 0",
14-
"tsup": "tsup",
13+
"test": "ava",
1514
"typecheck": "tsc --noEmit",
16-
"xo": "xo"
15+
"yeet": "release-it"
1716
},
1817
"tsup": {
1918
"entry": [
@@ -52,20 +51,23 @@
5251
},
5352
"dependencies": {
5453
"bson": "^5.2.0",
54+
"mongodb": "^5.3.0",
5555
"tslib": "^2.5.0"
5656
},
5757
"devDependencies": {
5858
"@commitlint/cli": "^15.0.0",
5959
"@commitlint/config-conventional": "^15.0.0",
6060
"@types/node": "^18.15.11",
61+
"ava": "^4.3.0",
62+
"dotenv": "^16.0.3",
6163
"esbuild": "0.17.16",
6264
"husky": "^7.0.4",
6365
"lint-staged": "13.0.3",
64-
"mongodb": "^5.3.0",
6566
"npm-run-all": "^4.1.5",
6667
"release-it": "^15.10.2",
6768
"shx": "^0.3.4",
6869
"syncpack": "^7.2.1",
70+
"ts-node": "10.9.1",
6971
"tsup": "^6.7.0",
7072
"typescript": "^5.0.4",
7173
"xo": "0.54.2"

0 commit comments

Comments
 (0)