@routier/pouchdb-plugin 0.0.1-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/package.json +54 -0
- package/readme.md +3 -0
- package/rspack.config.mjs +63 -0
- package/src/PouchDbPlugin.ts +930 -0
- package/src/PouchDbTranslator.ts +96 -0
- package/src/index.ts +1 -0
- package/src/tests/comments.test.ts +46 -0
- package/src/tests/datastore/PouchDbDatastore.ts +26 -0
- package/src/tests/events.test.ts +65 -0
- package/src/tests/player.test.ts +59 -0
- package/src/tests/products.test.ts +1520 -0
- package/src/tests/schemas/blogPost.ts +13 -0
- package/src/tests/schemas/comments.ts +12 -0
- package/src/tests/schemas/event.ts +14 -0
- package/src/tests/schemas/inventoryItem.ts +18 -0
- package/src/tests/schemas/player.ts +9 -0
- package/src/tests/schemas/playerMatch.ts +11 -0
- package/src/tests/schemas/product.ts +14 -0
- package/src/tests/schemas/user.ts +17 -0
- package/src/tests/schemas/userProfile.ts +69 -0
- package/src/tests/userProfiles.test.ts +63 -0
- package/src/utilities.ts +12 -0
- package/tsconfig.json +29 -0
- package/vitest.config.ts +11 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
+
|
|
6
|
+
## 0.0.1-alpha.1 (2025-09-18)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @routier/pouchdb-plugin
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@routier/pouchdb-plugin",
|
|
3
|
+
"version": "0.0.1-alpha.1",
|
|
4
|
+
"main": "./dist/index.js",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
|
+
"source": "./src/index.ts",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build:types": "tsc --emitDeclarationOnly",
|
|
12
|
+
"build:bundle": "rspack build",
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"build2": "npm run build:bundle && npm run build:types",
|
|
15
|
+
"tsc": "tsc",
|
|
16
|
+
"test": "vitest --run",
|
|
17
|
+
"test:watch": "vitest --watch",
|
|
18
|
+
"test:coverage": "vitest --coverage"
|
|
19
|
+
},
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"author": "James DeMeuse <james.demeuse@gmail.com>",
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"repository": "routier",
|
|
24
|
+
"keywords": [
|
|
25
|
+
"orm",
|
|
26
|
+
"typescript",
|
|
27
|
+
"web",
|
|
28
|
+
"indexeddb",
|
|
29
|
+
"electron",
|
|
30
|
+
"data access layer",
|
|
31
|
+
"entities",
|
|
32
|
+
"entity framework",
|
|
33
|
+
"database"
|
|
34
|
+
],
|
|
35
|
+
"description": "PouchDB plugin for routier",
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"events": "^3.3.0",
|
|
38
|
+
"pouchdb": "^9.0.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependencies": {
|
|
41
|
+
"@routier/core": "^0.0.1"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@faker-js/faker": "^10.0.0",
|
|
45
|
+
"@routier/core": "^0.0.1-alpha.1",
|
|
46
|
+
"@routier/datastore": "^0.0.1-alpha.1",
|
|
47
|
+
"@routier/test-utils": "^0.0.1-alpha.1",
|
|
48
|
+
"@rspack/cli": "^1.1.8",
|
|
49
|
+
"@rspack/core": "^1.1.8",
|
|
50
|
+
"@types/pouchdb": "^6.4.2",
|
|
51
|
+
"ts-loader": "^9.5.2",
|
|
52
|
+
"vitest": "^3.1.3"
|
|
53
|
+
}
|
|
54
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { dirname, resolve } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { defineConfig } from "@rspack/cli";
|
|
4
|
+
import { ProvidePlugin } from "@rspack/core";
|
|
5
|
+
|
|
6
|
+
// import { createRequire } from "node:module";
|
|
7
|
+
// const require = createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
|
|
11
|
+
export default defineConfig({
|
|
12
|
+
entry: "./src/index.ts", // Entry point for your library
|
|
13
|
+
output: {
|
|
14
|
+
path: resolve(__dirname, "dist"),
|
|
15
|
+
filename: "index.js", // Default output file name
|
|
16
|
+
library: {
|
|
17
|
+
type: "module"
|
|
18
|
+
},
|
|
19
|
+
globalObject: "this", // Ensures compatibility with both browser and Node.js
|
|
20
|
+
clean: true, // Cleans the output directory before each build
|
|
21
|
+
},
|
|
22
|
+
experiments: {
|
|
23
|
+
outputModule: true
|
|
24
|
+
},
|
|
25
|
+
module: {
|
|
26
|
+
rules: [
|
|
27
|
+
{
|
|
28
|
+
test: /\.ts$/, // Match TypeScript files
|
|
29
|
+
use: {
|
|
30
|
+
loader: "ts-loader",
|
|
31
|
+
options: {
|
|
32
|
+
transpileOnly: false, // Ensure type-checking is performed
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
exclude: [
|
|
36
|
+
/node_modules/,
|
|
37
|
+
/\.test\.ts$/, // Exclude test files
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
resolve: {
|
|
43
|
+
extensions: [".ts", ".js"],
|
|
44
|
+
fallback: {
|
|
45
|
+
"perf_hooks": false,
|
|
46
|
+
// "buffer": require.resolve("buffer/"),
|
|
47
|
+
// "process": require.resolve("process/browser"),
|
|
48
|
+
// "stream": require.resolve("stream-browserify"),
|
|
49
|
+
// "util": require.resolve("util/"),
|
|
50
|
+
// "events": require.resolve("events/"),
|
|
51
|
+
// add more as needed if you see errors
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
plugins: [
|
|
55
|
+
// new ProvidePlugin({
|
|
56
|
+
// Buffer: ["buffer", "Buffer"],
|
|
57
|
+
// process: ["process"],
|
|
58
|
+
// }),
|
|
59
|
+
],
|
|
60
|
+
target: "web", // Compile for both browser and Node.js
|
|
61
|
+
mode: "development", // Set production mode
|
|
62
|
+
devtool: "source-map"
|
|
63
|
+
});
|