4 Commits

Author SHA1 Message Date
a01f4d83c0 v2.0.14
Some checks failed
Default (tags) / security (push) Successful in 53s
Default (tags) / test (push) Successful in 1m2s
Default (tags) / release (push) Failing after 59s
Default (tags) / metadata (push) Successful in 1m12s
2025-11-17 02:59:44 +00:00
46db52184b fix(smartmongo.plugins): Use default import for mongodb-memory-server (Deno compatibility), update hints and bump package version to 2.0.13 2025-11-17 02:59:44 +00:00
e22c0d4644 2.0.12
Some checks failed
Default (tags) / security (push) Successful in 36s
Default (tags) / test (push) Successful in 57s
Default (tags) / release (push) Failing after 51s
Default (tags) / metadata (push) Successful in 59s
2025-04-06 19:00:35 +00:00
bb838fd16f fix(ci/config): Update CI workflow environment variables, refine package metadata, and improve configuration settings 2025-04-06 19:00:35 +00:00
11 changed files with 56 additions and 23 deletions

View File

@@ -6,8 +6,8 @@ on:
- '**'
env:
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
@@ -26,7 +26,7 @@ jobs:
- name: Install pnpm and npmci
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
pnpm install -g @ship.zone/npmci
- name: Run npm prepare
run: npmci npm prepare

View File

@@ -6,8 +6,8 @@ on:
- '*'
env:
IMAGE: registry.gitlab.com/hosttoday/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
IMAGE: code.foss.global/host.today/ht-docker-node:npmci
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
NPMCI_TOKEN_NPM: ${{secrets.NPMCI_TOKEN_NPM}}
NPMCI_TOKEN_NPM2: ${{secrets.NPMCI_TOKEN_NPM2}}
NPMCI_GIT_GITHUBTOKEN: ${{secrets.NPMCI_GIT_GITHUBTOKEN}}
@@ -26,7 +26,7 @@ jobs:
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Audit production dependencies
@@ -54,7 +54,7 @@ jobs:
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Test stable
@@ -82,7 +82,7 @@ jobs:
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Release
@@ -104,7 +104,7 @@ jobs:
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @shipzone/npmci
pnpm install -g @ship.zone/npmci
npmci npm prepare
- name: Code quality

3
.gitignore vendored
View File

@@ -3,7 +3,6 @@
# artifacts
coverage/
public/
pages/
# installs
node_modules/
@@ -17,4 +16,4 @@ node_modules/
dist/
dist_*/
# custom
#------# custom

View File

@@ -1,5 +1,21 @@
# Changelog
## 2025-11-17 - 2.0.14 - fix(smartmongo.plugins)
Use default import for mongodb-memory-server (Deno compatibility), update hints and bump package version to 2.0.13
- Replace namespace import with default import for mongodb-memory-server to ensure compatibility with Deno (ts/smartmongo.plugins.ts).
- Add readme.hints.md documenting the Deno compatibility change and the reason for using a default import.
- Bump package.json version to 2.0.13.
- Note: ts/00_commitinfo_data.ts still lists version 2.0.12 and may need to be updated to match package.json.
## 2025-04-06 - 2.0.12 - fix(ci/config)
Update CI workflow environment variables, refine package metadata, and improve configuration settings
- Updated workflow YAML files to use new IMAGE and npmci package names
- Adjusted package.json homepage, added bugs field and pnpm overrides
- Minor formatting improvements in readme.md and .gitignore
- Enhanced tsconfig with baseUrl and paths for improved module resolution
## 2025-04-06 - 2.0.11 - fix(dependencies)
Update dependency names and versions in CI workflows and package configuration

View File

@@ -1,6 +1,6 @@
{
"name": "@push.rocks/smartmongo",
"version": "2.0.11",
"version": "2.0.14",
"private": false,
"description": "A module for creating and managing a local MongoDB instance for testing purposes.",
"main": "dist_ts/index.js",
@@ -52,10 +52,16 @@
"database management",
"typescript"
],
"homepage": "https://code.foss.global/push.rocks/smartmongo",
"homepage": "https://code.foss.global/push.rocks/smartmongo#readme",
"repository": {
"type": "git",
"url": "https://code.foss.global/push.rocks/smartmongo.git"
},
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6"
"packageManager": "pnpm@10.7.0+sha512.6b865ad4b62a1d9842b61d674a393903b871d9244954f652b8842c2b553c72176b278f64c463e52d40fff8aba385c235c8c9ecf5cc7de4fd78b8bb6d49633ab6",
"bugs": {
"url": "https://code.foss.global/push.rocks/smartmongo/issues"
},
"pnpm": {
"overrides": {}
}
}

View File

@@ -1 +1,10 @@
# Project Hints
## Deno Compatibility
### mongodb-memory-server Import
- The package uses a **default import** for `mongodb-memory-server` in `ts/smartmongo.plugins.ts`
- Syntax: `import mongoPlugin from 'mongodb-memory-server';`
- This works in both Node.js and Deno environments
- **Why:** Deno wraps CommonJS exports in a `default` property, so default imports are required
- Fixed in version 2.0.13 (changed from `import * as mongoPlugin`)

View File

@@ -1,4 +1,5 @@
# @push.rocks/smartmongo
create a local mongodb for testing
## Install
@@ -52,7 +53,7 @@ console.log(mongoDescriptor.mongoDbUrl); // Use this URL to connect with Mongoos
Once your tests have completed or you're done using the MongoDB instance, its crucial to properly stop and clean up the resources. `@push.rocks/smartmongo` provides two methods for this purpose:
1. **stop()**: Stops the MongoDB instance without persisting any data.
```typescript
await myDbInstance.stop();
```
@@ -85,7 +86,7 @@ Using `@push.rocks/smartmongo` significantly simplifies the process of managing
## License and Legal Information
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.
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.
**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.

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartmongo',
version: '2.0.11',
version: '2.0.14',
description: 'A module for creating and managing a local MongoDB instance for testing purposes.'
}

View File

@@ -58,11 +58,11 @@ export class SmartMongo {
public async stopAndDumpToDir(
dirArg: string,
nameFunctionArg?: (doc: any) => string,
emptyDirArg = true
emptyDirArg = true,
) {
const mongodumpInstance = new plugins.mongodump.MongoDump();
const mongodumpTarget = await mongodumpInstance.addMongoTargetByMongoDescriptor(
await this.getMongoDescriptor()
await this.getMongoDescriptor(),
);
await mongodumpTarget.dumpAllCollectionsToDir(dirArg, nameFunctionArg, emptyDirArg);
await mongodumpInstance.stop();

View File

@@ -7,6 +7,6 @@ import * as smartpromise from '@push.rocks/smartpromise';
export { mongodump, smartdata, smartpath, smartpromise };
// thirdparty
import * as mongoPlugin from 'mongodb-memory-server';
import mongoPlugin from 'mongodb-memory-server';
export { mongoPlugin };

View File

@@ -6,9 +6,11 @@
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
"verbatimModuleSyntax": true,
"baseUrl": ".",
"paths": {}
},
"exclude": [
"dist_*/**/*.d.ts"
]
}
}