paymongo-cli 1.4.1 → 1.4.2
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/.github/workflows/ci-cd.yml +2 -46
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/release.yml +1 -1
- package/README.md +1 -1
- package/TESTING.md +1 -14
- package/package.json +6 -5
- package/jest.config.ts +0 -30
|
@@ -12,7 +12,7 @@ jobs:
|
|
|
12
12
|
strategy:
|
|
13
13
|
matrix:
|
|
14
14
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
15
|
-
node-version: [
|
|
15
|
+
node-version: [20, 22]
|
|
16
16
|
|
|
17
17
|
steps:
|
|
18
18
|
- name: Checkout code
|
|
@@ -39,50 +39,6 @@ jobs:
|
|
|
39
39
|
|
|
40
40
|
- name: Upload coverage reports
|
|
41
41
|
uses: codecov/codecov-action@v3
|
|
42
|
-
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '
|
|
42
|
+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20'
|
|
43
43
|
with:
|
|
44
44
|
file: ./coverage/lcov.info
|
|
45
|
-
|
|
46
|
-
release:
|
|
47
|
-
needs: test
|
|
48
|
-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
|
|
49
|
-
runs-on: ubuntu-latest
|
|
50
|
-
|
|
51
|
-
steps:
|
|
52
|
-
- name: Checkout code
|
|
53
|
-
uses: actions/checkout@v4
|
|
54
|
-
|
|
55
|
-
- name: Setup Node.js
|
|
56
|
-
uses: actions/setup-node@v4
|
|
57
|
-
with:
|
|
58
|
-
node-version: 18
|
|
59
|
-
registry-url: 'https://registry.npmjs.org'
|
|
60
|
-
|
|
61
|
-
- name: Install dependencies
|
|
62
|
-
run: npm ci
|
|
63
|
-
|
|
64
|
-
- name: Build project
|
|
65
|
-
run: npm run build
|
|
66
|
-
|
|
67
|
-
- name: Run tests
|
|
68
|
-
run: npm test -- --passWithNoTests
|
|
69
|
-
|
|
70
|
-
- name: Publish to npm
|
|
71
|
-
run: npm publish --access public
|
|
72
|
-
env:
|
|
73
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
74
|
-
|
|
75
|
-
- name: Create GitHub release
|
|
76
|
-
uses: actions/create-release@v1
|
|
77
|
-
env:
|
|
78
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
79
|
-
with:
|
|
80
|
-
tag_name: v${{ github.run_number }}
|
|
81
|
-
release_name: Release v${{ github.run_number }}
|
|
82
|
-
body: |
|
|
83
|
-
## Changes
|
|
84
|
-
- Automated release from CI/CD pipeline
|
|
85
|
-
- All tests passed
|
|
86
|
-
- Code quality checks completed
|
|
87
|
-
draft: false
|
|
88
|
-
prerelease: false
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -58,7 +58,7 @@ jobs:
|
|
|
58
58
|
body: |
|
|
59
59
|
## Changes
|
|
60
60
|
|
|
61
|
-
See [CHANGELOG.md](https://github.com/
|
|
61
|
+
See [CHANGELOG.md](https://github.com/leodyversemilla07/paymongo-cli/blob/main/CHANGELOG.md) for details.
|
|
62
62
|
|
|
63
63
|
## Installation
|
|
64
64
|
|
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ PayMongo CLI is the official-feel command-line tool designed to streamline your
|
|
|
28
28
|
|
|
29
29
|
### Prerequisites
|
|
30
30
|
|
|
31
|
-
- **Node.js**:
|
|
31
|
+
- **Node.js**: v20.0.0 or higher
|
|
32
32
|
- **ngrok account**: Required for webhook forwarding (free tier works great!)
|
|
33
33
|
|
|
34
34
|
### Install via npm (Recommended)
|
package/TESTING.md
CHANGED
|
@@ -8,7 +8,7 @@ This document tracks the progress of improving test coverage for the PayMongo CL
|
|
|
8
8
|
|
|
9
9
|
- **Overall Coverage**: ~65-70% statements (estimated post-all command testing completion)
|
|
10
10
|
- **Target**: ≥80% statements/branches/functions/lines
|
|
11
|
-
- **Progress**: API client, init command, config command, login command, dev command, env command,
|
|
11
|
+
- **Progress**: API client, init command, config command, login command, dev command, env command, trigger command, webhooks command, CLI entry point, and payments command testing completed
|
|
12
12
|
- **Total Tests**: 380 passing tests across 23 test suites
|
|
13
13
|
|
|
14
14
|
## Completed Work
|
|
@@ -107,18 +107,6 @@ This document tracks the progress of improving test coverage for the PayMongo CL
|
|
|
107
107
|
- Resolved Commander.js testing by using `command.parseAsync()` pattern
|
|
108
108
|
- All 12 tests passing, comprehensive validation and error handling covered
|
|
109
109
|
|
|
110
|
-
- **GUI Command Testing**: ✅ **COMPLETED**
|
|
111
|
-
- Created comprehensive test file `tests/unit/gui-command.test.ts` with 11 test cases achieving 100% coverage
|
|
112
|
-
- Coverage improved to full coverage for src/commands/gui.ts
|
|
113
|
-
- Added tests for:
|
|
114
|
-
- GUI dashboard startup with default/custom port and host options
|
|
115
|
-
- WebServer integration and graceful shutdown handling
|
|
116
|
-
- SIGINT/SIGTERM signal handling for clean shutdown
|
|
117
|
-
- No configuration error handling
|
|
118
|
-
- Server startup error scenarios
|
|
119
|
-
- Resolved complex WebServer mocking and signal handler testing
|
|
120
|
-
- All 11 tests passing, comprehensive startup and shutdown scenarios covered
|
|
121
|
-
|
|
122
110
|
- **Trigger Command Testing**: ✅ **COMPLETED**
|
|
123
111
|
- Created comprehensive test file `tests/unit/trigger-command.test.ts` with 16 test cases achieving 100% coverage
|
|
124
112
|
- Coverage improved to full coverage for src/commands/trigger.ts
|
|
@@ -175,7 +163,6 @@ This document tracks the progress of improving test coverage for the PayMongo CL
|
|
|
175
163
|
| src/commands/dev.ts | ~60% | ~50% | ~70% | ~60% | ✅ **Completed** |
|
|
176
164
|
| **src/commands/payments.ts** | **100%** | **100%** | **100%** | **100%** | ✅ **Completed** |
|
|
177
165
|
| **src/commands/env.ts** | **100%** | **100%** | **100%** | **100%** | ✅ **Completed** |
|
|
178
|
-
| **src/commands/gui.ts** | **100%** | **100%** | **100%** | **100%** | ✅ **Completed** |
|
|
179
166
|
| **src/commands/trigger.ts** | **100%** | **100%** | **100%** | **100%** | ✅ **Completed** |
|
|
180
167
|
| **src/commands/webhooks.ts** | **100%** | **100%** | **100%** | **100%** | ✅ **Completed** |
|
|
181
168
|
| All other command files | 0% | 0% | 0% | Not started |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paymongo-cli",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Developer-first CLI tool for PayMongo integration development with local webhook forwarding, payment testing, and team collaboration features. See USER_GUIDE.md for comprehensive documentation.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"start": "node dist/index.js",
|
|
15
15
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
16
16
|
"test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch",
|
|
17
|
-
"lint": "NODE_OPTIONS='--max-old-space-size=4096' eslint src/**/*.ts tests/**/*.ts",
|
|
17
|
+
"lint": "cross-env NODE_OPTIONS='--max-old-space-size=4096' eslint src/**/*.ts tests/**/*.ts",
|
|
18
18
|
"lint:fix": "eslint src/**/*.ts --fix",
|
|
19
|
-
"lint:src": "NODE_OPTIONS='--max-old-space-size=4096' eslint src/**/*.ts",
|
|
20
|
-
"lint:tests": "NODE_OPTIONS='--max-old-space-size=4096' eslint tests/**/*.ts",
|
|
19
|
+
"lint:src": "cross-env NODE_OPTIONS='--max-old-space-size=4096' eslint src/**/*.ts",
|
|
20
|
+
"lint:tests": "cross-env NODE_OPTIONS='--max-old-space-size=4096' eslint tests/**/*.ts",
|
|
21
21
|
"format": "prettier --write src/**/*.ts",
|
|
22
22
|
"benchmark": "npx tsx scripts/benchmark.ts",
|
|
23
23
|
"prepare": "npm run build"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/leodyversemilla07/paymongo-cli#readme",
|
|
42
42
|
"engines": {
|
|
43
|
-
"node": ">=
|
|
43
|
+
"node": ">=20.0.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@inquirer/prompts": "^8.2.0",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"@eslint/js": "^9.0.0",
|
|
58
58
|
"@types/jest": "^30.0.0",
|
|
59
59
|
"@types/node": "^25.0.10",
|
|
60
|
+
"cross-env": "^10.1.0",
|
|
60
61
|
"eslint": "^9.0.0",
|
|
61
62
|
"globals": "^17.1.0",
|
|
62
63
|
"jest": "^30.2.0",
|
package/jest.config.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { Config } from 'jest';
|
|
2
|
-
|
|
3
|
-
const config: Config = {
|
|
4
|
-
preset: 'ts-jest/presets/default-esm',
|
|
5
|
-
testEnvironment: 'node',
|
|
6
|
-
roots: ['<rootDir>/src', '<rootDir>/tests'],
|
|
7
|
-
testMatch: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],
|
|
8
|
-
transform: {
|
|
9
|
-
'^.+\\.ts$': [
|
|
10
|
-
'ts-jest',
|
|
11
|
-
{
|
|
12
|
-
useESM: true,
|
|
13
|
-
tsconfig: {
|
|
14
|
-
module: 'NodeNext',
|
|
15
|
-
moduleResolution: 'NodeNext',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
},
|
|
20
|
-
extensionsToTreatAsEsm: ['.ts'],
|
|
21
|
-
moduleNameMapper: {
|
|
22
|
-
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
23
|
-
},
|
|
24
|
-
collectCoverageFrom: ['src/**/*.ts', '!src/**/*.d.ts'],
|
|
25
|
-
coverageDirectory: 'coverage',
|
|
26
|
-
coverageReporters: ['text', 'lcov', 'html'],
|
|
27
|
-
injectGlobals: true,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export default config;
|