@push.rocks/smartmongo 2.0.11 → 2.0.14
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/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/smartmongo.plugins.d.ts +1 -1
- package/dist_ts/smartmongo.plugins.js +2 -2
- package/package.json +5 -2
- package/readme.hints.md +10 -1
- package/readme.md +3 -2
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/index.ts +2 -2
- package/ts/smartmongo.plugins.ts +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@push.rocks/smartmongo',
|
|
6
|
-
version: '2.0.
|
|
6
|
+
version: '2.0.14',
|
|
7
7
|
description: 'A module for creating and managing a local MongoDB instance for testing purposes.'
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsT0FBTyxFQUFFLFFBQVE7SUFDakIsV0FBVyxFQUFFLG1GQUFtRjtDQUNqRyxDQUFBIn0=
|
|
@@ -3,5 +3,5 @@ import * as smartdata from '@push.rocks/smartdata';
|
|
|
3
3
|
import * as smartpath from '@push.rocks/smartpath';
|
|
4
4
|
import * as smartpromise from '@push.rocks/smartpromise';
|
|
5
5
|
export { mongodump, smartdata, smartpath, smartpromise };
|
|
6
|
-
import
|
|
6
|
+
import mongoPlugin from 'mongodb-memory-server';
|
|
7
7
|
export { mongoPlugin };
|
|
@@ -5,6 +5,6 @@ import * as smartpath from '@push.rocks/smartpath';
|
|
|
5
5
|
import * as smartpromise from '@push.rocks/smartpromise';
|
|
6
6
|
export { mongodump, smartdata, smartpath, smartpromise };
|
|
7
7
|
// thirdparty
|
|
8
|
-
import
|
|
8
|
+
import mongoPlugin from 'mongodb-memory-server';
|
|
9
9
|
export { mongoPlugin };
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRtb25nby5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvc21hcnRtb25nby5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG1CQUFtQjtBQUNuQixPQUFPLEtBQUssU0FBUyxNQUFNLHVCQUF1QixDQUFDO0FBQ25ELE9BQU8sS0FBSyxTQUFTLE1BQU0sdUJBQXVCLENBQUM7QUFDbkQsT0FBTyxLQUFLLFNBQVMsTUFBTSx1QkFBdUIsQ0FBQztBQUNuRCxPQUFPLEtBQUssWUFBWSxNQUFNLDBCQUEwQixDQUFDO0FBRXpELE9BQU8sRUFBRSxTQUFTLEVBQUUsU0FBUyxFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsQ0FBQztBQUV6RCxhQUFhO0FBQ2IsT0FBTyxXQUFXLE1BQU0sdUJBQXVCLENBQUM7QUFFaEQsT0FBTyxFQUFFLFdBQVcsRUFBRSxDQUFDIn0=
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@push.rocks/smartmongo",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.14",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A module for creating and managing a local MongoDB instance for testing purposes.",
|
|
6
6
|
"main": "dist_ts/index.js",
|
|
@@ -47,11 +47,14 @@
|
|
|
47
47
|
"database management",
|
|
48
48
|
"typescript"
|
|
49
49
|
],
|
|
50
|
-
"homepage": "https://code.foss.global/push.rocks/smartmongo",
|
|
50
|
+
"homepage": "https://code.foss.global/push.rocks/smartmongo#readme",
|
|
51
51
|
"repository": {
|
|
52
52
|
"type": "git",
|
|
53
53
|
"url": "https://code.foss.global/push.rocks/smartmongo.git"
|
|
54
54
|
},
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://code.foss.global/push.rocks/smartmongo/issues"
|
|
57
|
+
},
|
|
55
58
|
"scripts": {
|
|
56
59
|
"test": "(tstest test/ --web)",
|
|
57
60
|
"build": "(tsbuild --web --allowimplicitany)",
|
package/readme.hints.md
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
# Project Hints
|
|
2
|
+
|
|
3
|
+
## Deno Compatibility
|
|
4
|
+
|
|
5
|
+
### mongodb-memory-server Import
|
|
6
|
+
- The package uses a **default import** for `mongodb-memory-server` in `ts/smartmongo.plugins.ts`
|
|
7
|
+
- Syntax: `import mongoPlugin from 'mongodb-memory-server';`
|
|
8
|
+
- This works in both Node.js and Deno environments
|
|
9
|
+
- **Why:** Deno wraps CommonJS exports in a `default` property, so default imports are required
|
|
10
|
+
- Fixed in version 2.0.13 (changed from `import * as mongoPlugin`)
|
package/readme.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# @push.rocks/smartmongo
|
|
2
|
+
|
|
2
3
|
create a local mongodb for testing
|
|
3
4
|
|
|
4
5
|
## Install
|
|
@@ -52,7 +53,7 @@ console.log(mongoDescriptor.mongoDbUrl); // Use this URL to connect with Mongoos
|
|
|
52
53
|
Once your tests have completed or you're done using the MongoDB instance, it’s crucial to properly stop and clean up the resources. `@push.rocks/smartmongo` provides two methods for this purpose:
|
|
53
54
|
|
|
54
55
|
1. **stop()**: Stops the MongoDB instance without persisting any data.
|
|
55
|
-
|
|
56
|
+
|
|
56
57
|
```typescript
|
|
57
58
|
await myDbInstance.stop();
|
|
58
59
|
```
|
|
@@ -85,7 +86,7 @@ Using `@push.rocks/smartmongo` significantly simplifies the process of managing
|
|
|
85
86
|
|
|
86
87
|
## License and Legal Information
|
|
87
88
|
|
|
88
|
-
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
|
89
|
+
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
|
|
89
90
|
|
|
90
91
|
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
|
91
92
|
|
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/index.ts
CHANGED
|
@@ -58,11 +58,11 @@ export class SmartMongo {
|
|
|
58
58
|
public async stopAndDumpToDir(
|
|
59
59
|
dirArg: string,
|
|
60
60
|
nameFunctionArg?: (doc: any) => string,
|
|
61
|
-
emptyDirArg = true
|
|
61
|
+
emptyDirArg = true,
|
|
62
62
|
) {
|
|
63
63
|
const mongodumpInstance = new plugins.mongodump.MongoDump();
|
|
64
64
|
const mongodumpTarget = await mongodumpInstance.addMongoTargetByMongoDescriptor(
|
|
65
|
-
await this.getMongoDescriptor()
|
|
65
|
+
await this.getMongoDescriptor(),
|
|
66
66
|
);
|
|
67
67
|
await mongodumpTarget.dumpAllCollectionsToDir(dirArg, nameFunctionArg, emptyDirArg);
|
|
68
68
|
await mongodumpInstance.stop();
|
package/ts/smartmongo.plugins.ts
CHANGED
|
@@ -7,6 +7,6 @@ import * as smartpromise from '@push.rocks/smartpromise';
|
|
|
7
7
|
export { mongodump, smartdata, smartpath, smartpromise };
|
|
8
8
|
|
|
9
9
|
// thirdparty
|
|
10
|
-
import
|
|
10
|
+
import mongoPlugin from 'mongodb-memory-server';
|
|
11
11
|
|
|
12
12
|
export { mongoPlugin };
|