mirror of
https://github.com/hoverkraft-tech/compose-action.git
synced 2026-01-10 22:53:06 +08:00
Compare commits
4 Commits
fc33f5d84a
...
3125b50565
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3125b50565 | ||
|
|
248470ecc5 | ||
|
|
5d59cf29d8 | ||
|
|
e9bb59d794 |
4
.github/workflows/__check-action.yml
vendored
4
.github/workflows/__check-action.yml
vendored
@ -173,13 +173,13 @@ jobs:
|
||||
env:
|
||||
DOCKER_COMPOSE_VERSION: ${{ matrix.expected-compose-version || '' }}
|
||||
steps:
|
||||
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Set up Docker context
|
||||
if: ${{ matrix.docker-context }}
|
||||
uses: docker/setup-docker-action@efe9e3891a4f7307e689f2100b33a155b900a608 # v4.5.0
|
||||
uses: docker/setup-docker-action@e61617a16c407a86262fb923c35a616ddbe070b3 # v4.6.0
|
||||
with:
|
||||
context: ${{ matrix.docker-context }}
|
||||
|
||||
|
||||
4
.github/workflows/__check-dist.yml
vendored
4
.github/workflows/__check-dist.yml
vendored
@ -12,12 +12,12 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- id: setup-node
|
||||
uses: hoverkraft-tech/ci-github-nodejs/actions/setup-node@a9809af04394e66675b8644865be1ddcec02cdcd # 0.20.0
|
||||
uses: hoverkraft-tech/ci-github-nodejs/actions/setup-node@338755b95043af1f8aa17409529fd20a9d2ef659 # 0.20.6
|
||||
|
||||
- name: Build dist/ Directory
|
||||
id: package
|
||||
|
||||
2
.github/workflows/__check-nodejs.yml
vendored
2
.github/workflows/__check-nodejs.yml
vendored
@ -7,7 +7,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
test-nodejs:
|
||||
uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/continuous-integration.yml@a9809af04394e66675b8644865be1ddcec02cdcd # 0.20.0
|
||||
uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/continuous-integration.yml@338755b95043af1f8aa17409529fd20a9d2ef659 # 0.20.6
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write
|
||||
|
||||
2
.github/workflows/__shared-ci.yml
vendored
2
.github/workflows/__shared-ci.yml
vendored
@ -7,7 +7,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
linter:
|
||||
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@c314229c3ca6914f7023ffca7afc26753ab99b41 # 0.30.1
|
||||
uses: hoverkraft-tech/ci-github-common/.github/workflows/linter.yml@5ac504609f6ef35c5ac94bd8199063aa32104721 # 0.31.3
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
|
||||
2
.github/workflows/greetings.yml
vendored
2
.github/workflows/greetings.yml
vendored
@ -10,7 +10,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
greetings:
|
||||
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@c314229c3ca6914f7023ffca7afc26753ab99b41 # 0.30.1
|
||||
uses: hoverkraft-tech/ci-github-common/.github/workflows/greetings.yml@5ac504609f6ef35c5ac94bd8199063aa32104721 # 0.31.3
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
|
||||
4
.github/workflows/main-ci.yml
vendored
4
.github/workflows/main-ci.yml
vendored
@ -38,7 +38,7 @@ jobs:
|
||||
outputs:
|
||||
artifact-id: ${{ steps.upload-artifact.outputs.artifact-id }}
|
||||
steps:
|
||||
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
@ -62,7 +62,7 @@ jobs:
|
||||
app-id: ${{ vars.CI_BOT_APP_ID }}
|
||||
private-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }}
|
||||
|
||||
- uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@c314229c3ca6914f7023ffca7afc26753ab99b41 # 0.30.1
|
||||
- uses: hoverkraft-tech/ci-github-common/actions/create-and-merge-pull-request@5ac504609f6ef35c5ac94bd8199063aa32104721 # 0.31.3
|
||||
with:
|
||||
github-token: ${{ steps.generate-token.outputs.token }}
|
||||
branch: docs/actions-workflows-documentation-update
|
||||
|
||||
2
.github/workflows/need-fix-to-issue.yml
vendored
2
.github/workflows/need-fix-to-issue.yml
vendored
@ -19,7 +19,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
main:
|
||||
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@c314229c3ca6914f7023ffca7afc26753ab99b41 # 0.30.1
|
||||
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@5ac504609f6ef35c5ac94bd8199063aa32104721 # 0.31.3
|
||||
permissions:
|
||||
contents: read
|
||||
issues: write
|
||||
|
||||
2
.github/workflows/semantic-pull-request.yml
vendored
2
.github/workflows/semantic-pull-request.yml
vendored
@ -11,7 +11,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
main:
|
||||
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@c314229c3ca6914f7023ffca7afc26753ab99b41 # 0.30.1
|
||||
uses: hoverkraft-tech/ci-github-common/.github/workflows/semantic-pull-request.yml@5ac504609f6ef35c5ac94bd8199063aa32104721 # 0.31.3
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@ -8,7 +8,7 @@ permissions: {}
|
||||
|
||||
jobs:
|
||||
main:
|
||||
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@c314229c3ca6914f7023ffca7afc26753ab99b41 # 0.30.1
|
||||
uses: hoverkraft-tech/ci-github-common/.github/workflows/stale.yml@5ac504609f6ef35c5ac94bd8199063aa32104721 # 0.31.3
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
80
AGENTS.md
Normal file
80
AGENTS.md
Normal file
@ -0,0 +1,80 @@
|
||||
# AGENTS.md — agent instructions and operational contract
|
||||
|
||||
This file exists so automated contributors (Copilot agents, bots, scripts) follow the same guardrails as human maintainers when working in `hoverkraft-tech/compose-action`. It summarizes what to read, which commands to run, and what is out of scope for agents.
|
||||
|
||||
## Organization-wide guidelines
|
||||
|
||||
- Always read and obey [hoverkraft-tech/.github/AGENTS.md](https://github.com/hoverkraft-tech/.github/blob/main/AGENTS.md) before touching this repository.
|
||||
- Apply any additional instructions surfaced by the workspace (global Visual Studio Code prompts, repo-specific notices) alongside this contract.
|
||||
|
||||
## Canonical docs
|
||||
|
||||
- [README.md](./README.md) — product overview, supported inputs, and workflow examples. This is the primary contract for action users.
|
||||
- [CONTRIBUTING.md](./CONTRIBUTING.md) — PR expectations, release hygiene, and how to collaborate with maintainers.
|
||||
- [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) — behavioral expectations for every interaction.
|
||||
|
||||
## Instructional docs
|
||||
|
||||
- Source of truth for runtime logic lives under [`src/`](./src). Tests mirror the same structure under [`src/**/*.test.ts`](./src).
|
||||
- GitHub Action fixtures and sample compose files live under [`test/`](./test). Use them when reproducing CI flows locally.
|
||||
- Build artifacts belong in `dist/`. Never edit generated files by hand; instead update the matching TypeScript source and rerun the packaging commands described below.
|
||||
|
||||
## High-level rules (mandatory)
|
||||
|
||||
- Favor small, reviewable diffs. Coordinate large refactors with maintainers before starting.
|
||||
- Keep behavior changes documented: update `README.md` and any affected workflow snippets.
|
||||
- Never hardcode secrets, tokens, or personal data. Use GitHub Actions secrets or ask maintainers to provision them.
|
||||
- Node 20+ is required. Match the tooling versions declared in `package.json`.
|
||||
|
||||
## Agent operational contract (when modifying code)
|
||||
|
||||
Before opening a PR or pushing a branch:
|
||||
|
||||
1. Read the relevant sections of `README.md` and inspect any affected files in `src/` and `test/`.
|
||||
2. Implement changes in TypeScript source only; regenerate bundles with `npm run package` when shipping executable artifacts.
|
||||
3. Run local validation limited to impacted areas at minimum:
|
||||
- `npm run lint` (or `npm run lint:ci` when you need JSON output for CI).
|
||||
- `npm run build` (type-check only).
|
||||
- `npm run test` for quick feedback; `npm run test:ci` to reproduce CI (coverage + serial runs).
|
||||
4. For action behavior changes, exercise the representative workflow under `test/` (e.g., `test/docker-compose.yml`) to confirm compose invocations behave as expected.
|
||||
5. Add or update unit tests alongside any new logic, covering at least the happy path plus one failure or edge scenario.
|
||||
6. Keep commits self-contained and use conventional commit messages compatible with `@commitlint/config-conventional`.
|
||||
|
||||
When opening a PR:
|
||||
|
||||
- Target a feature branch off `main`.
|
||||
- Describe intent, touched areas, and the manual + automated test plan.
|
||||
- Reference the docs you followed (for example: "Validated against readme > Usage" or "Followed CONTRIBUTING.md".).
|
||||
- Ensure CI (lint, build, tests, package) is green before requesting human review.
|
||||
|
||||
## Validation & quality gates
|
||||
|
||||
- **Build:** `npm run build` must succeed (TypeScript compile cleanly, no `tsc` errors).
|
||||
- **Lint:** `npm run lint:ci` must pass with no new warnings. Attach `eslint-report.json` to CI artifacts when relevant.
|
||||
- **Tests:** `npm run test:ci` must pass and update coverage artifacts (see `coverage/`).
|
||||
- **Bundle:** `npm run package` must regenerate `dist/` outputs; include updated bundles in the PR if runtime code changed.
|
||||
|
||||
## Allowed agent actions (examples)
|
||||
|
||||
- Fix documentation, typos, or metadata referenced by the GitHub Marketplace listing.
|
||||
- Add or update unit tests, mocks, and fixtures in `src/` or `test/`.
|
||||
- Refactor TypeScript modules in small, behavior-preserving increments (with tests and package outputs refreshed).
|
||||
- Adjust CI/workflow helpers under `test/` to improve local reproducibility.
|
||||
|
||||
## Disallowed actions (must not do)
|
||||
|
||||
- Do not commit generated `dist/` artifacts without updating the corresponding TypeScript source and documenting the command used.
|
||||
- Do not introduce new runtime dependencies without maintainer approval; prefer built-in Node APIs or existing deps.
|
||||
- Do not modify Dockerfiles or GitHub Actions workflows to add secrets, credentials, or privileged steps.
|
||||
- Do not land breaking changes to the public action inputs/outputs without updating `README.md` and gaining explicit maintainer sign-off.
|
||||
|
||||
## Guidance summary (quick checklist)
|
||||
|
||||
1. Read `README.md` + relevant source/test files.
|
||||
2. Make the minimal change; add tests.
|
||||
3. Run `npm run lint`, `npm run build`, `npm run test:ci`, and `npm run package`.
|
||||
4. Open a PR referencing the docs you followed and include the test plan.
|
||||
|
||||
## If uncertain
|
||||
|
||||
Open an issue or draft PR in this repository describing the scenario, what docs you read, and the question you still have. Ping maintainers instead of guessing. When in doubt about the workflow contract, defer to the `README.md` and organization-wide AGENTS file.
|
||||
67
dist/index.js
generated
vendored
67
dist/index.js
generated
vendored
@ -33176,18 +33176,28 @@ class DockerComposeService {
|
||||
...this.getCommonOptions(optionsInputs),
|
||||
commandOptions: upFlags,
|
||||
};
|
||||
if (services.length > 0) {
|
||||
await (0, docker_compose_1.upMany)(services, options);
|
||||
return;
|
||||
try {
|
||||
if (services.length > 0) {
|
||||
await (0, docker_compose_1.upMany)(services, options);
|
||||
return;
|
||||
}
|
||||
await (0, docker_compose_1.upAll)(options);
|
||||
}
|
||||
catch (error) {
|
||||
throw this.formatDockerComposeError(error);
|
||||
}
|
||||
await (0, docker_compose_1.upAll)(options);
|
||||
}
|
||||
async down({ downFlags, ...optionsInputs }) {
|
||||
const options = {
|
||||
...this.getCommonOptions(optionsInputs),
|
||||
commandOptions: downFlags,
|
||||
};
|
||||
await (0, docker_compose_1.down)(options);
|
||||
try {
|
||||
await (0, docker_compose_1.down)(options);
|
||||
}
|
||||
catch (error) {
|
||||
throw this.formatDockerComposeError(error);
|
||||
}
|
||||
}
|
||||
async logs({ services, ...optionsInputs }) {
|
||||
const options = {
|
||||
@ -33212,6 +33222,53 @@ class DockerComposeService {
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Formats docker-compose errors into proper Error objects with readable messages
|
||||
*/
|
||||
formatDockerComposeError(error) {
|
||||
// If it's already an Error, return it
|
||||
if (error instanceof Error) {
|
||||
return error;
|
||||
}
|
||||
// Handle docker-compose result objects
|
||||
if (this.isDockerComposeResult(error)) {
|
||||
const parts = [];
|
||||
// Add exit code information
|
||||
if (error.exitCode !== null) {
|
||||
parts.push(`Docker Compose command failed with exit code ${error.exitCode}`);
|
||||
}
|
||||
else {
|
||||
parts.push("Docker Compose command failed");
|
||||
}
|
||||
// Add error stream output if available
|
||||
if (error.err && error.err.trim()) {
|
||||
parts.push("\nError output:");
|
||||
parts.push(error.err.trim());
|
||||
}
|
||||
// Add standard output if available and different from error output
|
||||
if (error.out && error.out.trim() && error.out !== error.err) {
|
||||
parts.push("\nStandard output:");
|
||||
parts.push(error.out.trim());
|
||||
}
|
||||
return new Error(parts.join("\n"));
|
||||
}
|
||||
// Handle string errors
|
||||
if (typeof error === "string") {
|
||||
return new Error(error);
|
||||
}
|
||||
// Fallback for unknown error types
|
||||
return new Error(JSON.stringify(error));
|
||||
}
|
||||
/**
|
||||
* Type guard to check if an object is a docker-compose result
|
||||
*/
|
||||
isDockerComposeResult(error) {
|
||||
return (typeof error === "object" &&
|
||||
error !== null &&
|
||||
"exitCode" in error &&
|
||||
"err" in error &&
|
||||
"out" in error);
|
||||
}
|
||||
}
|
||||
exports.DockerComposeService = DockerComposeService;
|
||||
|
||||
|
||||
67
dist/post.js
generated
vendored
67
dist/post.js
generated
vendored
@ -26253,18 +26253,28 @@ class DockerComposeService {
|
||||
...this.getCommonOptions(optionsInputs),
|
||||
commandOptions: upFlags,
|
||||
};
|
||||
if (services.length > 0) {
|
||||
await (0, docker_compose_1.upMany)(services, options);
|
||||
return;
|
||||
try {
|
||||
if (services.length > 0) {
|
||||
await (0, docker_compose_1.upMany)(services, options);
|
||||
return;
|
||||
}
|
||||
await (0, docker_compose_1.upAll)(options);
|
||||
}
|
||||
catch (error) {
|
||||
throw this.formatDockerComposeError(error);
|
||||
}
|
||||
await (0, docker_compose_1.upAll)(options);
|
||||
}
|
||||
async down({ downFlags, ...optionsInputs }) {
|
||||
const options = {
|
||||
...this.getCommonOptions(optionsInputs),
|
||||
commandOptions: downFlags,
|
||||
};
|
||||
await (0, docker_compose_1.down)(options);
|
||||
try {
|
||||
await (0, docker_compose_1.down)(options);
|
||||
}
|
||||
catch (error) {
|
||||
throw this.formatDockerComposeError(error);
|
||||
}
|
||||
}
|
||||
async logs({ services, ...optionsInputs }) {
|
||||
const options = {
|
||||
@ -26289,6 +26299,53 @@ class DockerComposeService {
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Formats docker-compose errors into proper Error objects with readable messages
|
||||
*/
|
||||
formatDockerComposeError(error) {
|
||||
// If it's already an Error, return it
|
||||
if (error instanceof Error) {
|
||||
return error;
|
||||
}
|
||||
// Handle docker-compose result objects
|
||||
if (this.isDockerComposeResult(error)) {
|
||||
const parts = [];
|
||||
// Add exit code information
|
||||
if (error.exitCode !== null) {
|
||||
parts.push(`Docker Compose command failed with exit code ${error.exitCode}`);
|
||||
}
|
||||
else {
|
||||
parts.push("Docker Compose command failed");
|
||||
}
|
||||
// Add error stream output if available
|
||||
if (error.err && error.err.trim()) {
|
||||
parts.push("\nError output:");
|
||||
parts.push(error.err.trim());
|
||||
}
|
||||
// Add standard output if available and different from error output
|
||||
if (error.out && error.out.trim() && error.out !== error.err) {
|
||||
parts.push("\nStandard output:");
|
||||
parts.push(error.out.trim());
|
||||
}
|
||||
return new Error(parts.join("\n"));
|
||||
}
|
||||
// Handle string errors
|
||||
if (typeof error === "string") {
|
||||
return new Error(error);
|
||||
}
|
||||
// Fallback for unknown error types
|
||||
return new Error(JSON.stringify(error));
|
||||
}
|
||||
/**
|
||||
* Type guard to check if an object is a docker-compose result
|
||||
*/
|
||||
isDockerComposeResult(error) {
|
||||
return (typeof error === "object" &&
|
||||
error !== null &&
|
||||
"exitCode" in error &&
|
||||
"err" in error &&
|
||||
"out" in error);
|
||||
}
|
||||
}
|
||||
exports.DockerComposeService = DockerComposeService;
|
||||
|
||||
|
||||
3
eslint.config.mjs
Normal file
3
eslint.config.mjs
Normal file
@ -0,0 +1,3 @@
|
||||
import { default as tsDevToolsCore } from "@ts-dev-tools/core/dist/eslint-plugin-ts-dev-tools/index.js";
|
||||
|
||||
export default tsDevToolsCore.default;
|
||||
168
package-lock.json
generated
168
package-lock.json
generated
@ -16,7 +16,7 @@
|
||||
"docker-compose": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ts-dev-tools/core": "^1.9.8",
|
||||
"@ts-dev-tools/core": "^1.9.10",
|
||||
"@vercel/ncc": "^0.38.4",
|
||||
"eslint-plugin-github": "^6.0.0",
|
||||
"eslint-plugin-jsonc": "^2.21.0"
|
||||
@ -2346,9 +2346,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-android-arm64": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.97.0.tgz",
|
||||
"integrity": "sha512-oLCGuX+1zqTIUjTfCxiZO/Ad4p4wo2MksBSpjdgOC7htyfIg/Se9PK2xU2jzSXlIyzBivwK6AJFqJpcbzJlmsQ==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.99.0.tgz",
|
||||
"integrity": "sha512-V4jhmKXgQQdRnm73F+r3ZY4pUEsijQeSraFeaCGng7abSNJGs76X6l82wHnmjLGFAeY00LWtjcELs7ZmbJ9+lA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -2363,9 +2363,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-darwin-arm64": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.97.0.tgz",
|
||||
"integrity": "sha512-Rg7Yy0ICS4HiF+/ZcmjB7h67YOw23Iw06ETHP+0UHQkNuecFew9aDycGG62ohCb1/+QC5uVTW9naR4F8L3FndQ==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.99.0.tgz",
|
||||
"integrity": "sha512-Rp41nf9zD5FyLZciS9l1GfK8PhYqrD5kEGxyTOA2esTLeAy37rZxetG2E3xteEolAkeb2WDkVrlxPtibeAncMg==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -2380,9 +2380,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-darwin-x64": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.97.0.tgz",
|
||||
"integrity": "sha512-Kr2rgG7yEnv6ivreQtwKAetGeovfWMxsWzTPlM4BMkhI6jsj10BFN+tP5kUHrES66e7eaoFs0SNepHulCpofdw==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.99.0.tgz",
|
||||
"integrity": "sha512-WVonp40fPPxo5Gs0POTI57iEFv485TvNKOHMwZRhigwZRhZY2accEAkYIhei9eswF4HN5B44Wybkz7Gd1Qr/5Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -2397,9 +2397,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-freebsd-x64": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.97.0.tgz",
|
||||
"integrity": "sha512-kAWTFHVR3KLcYQ7oEpRQV+WtEAPWZODQ/FsIVGVNAjzIfm9myuiLh7Kys8Vh3QwATPCuPg1w7FGexIm/A1a1lQ==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.99.0.tgz",
|
||||
"integrity": "sha512-H30bjOOttPmG54gAqu6+HzbLEzuNOYO2jZYrIq4At+NtLJwvNhXz28Hf5iEAFZIH/4hMpLkM4VN7uc+5UlNW3Q==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -2414,9 +2414,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-arm-gnueabihf": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.97.0.tgz",
|
||||
"integrity": "sha512-w4wYc5KRO6Mdxq9wXh6fAMuxB1LX7btj74+fTZG7/eP7ZiCTsxIM0GR4l7xQjRJOFd9rzlu7ZPq3LM7e9wmPTg==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.99.0.tgz",
|
||||
"integrity": "sha512-0Z/Th0SYqzSRDPs6tk5lQdW0i73UCupnim3dgq2oW0//UdLonV/5wIZCArfKGC7w9y4h8TxgXpgtIyD1kKzzlQ==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@ -2431,9 +2431,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-arm-musleabihf": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.97.0.tgz",
|
||||
"integrity": "sha512-DY+3aV2k9YyCRQ5/Zw83cG0xXvgnA6d31JSGfWkOAq9Aa22GeBE/NOzqqMw72HcxRKvYcJsCVpBwQaTICuBGIQ==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.99.0.tgz",
|
||||
"integrity": "sha512-xo0wqNd5bpbzQVNpAIFbHk1xa+SaS/FGBABCd942SRTnrpxl6GeDj/s1BFaGcTl8MlwlKVMwOcyKrw/2Kdfquw==",
|
||||
"cpu": [
|
||||
"arm"
|
||||
],
|
||||
@ -2448,9 +2448,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-arm64-gnu": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.97.0.tgz",
|
||||
"integrity": "sha512-4B/H4CSc8LZSBTzQHMHQbbZww8B1qaQO+1iBxeKYo1LBD5ZAUZwgYCyM1VUPgqEfUY358a1/Nhn4RIwAbnEFWw==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.99.0.tgz",
|
||||
"integrity": "sha512-u26I6LKoLTPTd4Fcpr0aoAtjnGf5/ulMllo+QUiBhupgbVCAlaj4RyXH/mvcjcsl2bVBv9E/gYJZz2JjxQWXBA==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -2465,9 +2465,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-arm64-musl": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.97.0.tgz",
|
||||
"integrity": "sha512-Wg8ZPEXR3HHDlzvxqFH9XVc6xfnXaEjMmAuJ9priQmMin42O4B5TwvLmBNlW5Is30faKopGXiiH/Gjmcw/x4xg==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.99.0.tgz",
|
||||
"integrity": "sha512-qhftDo2D37SqCEl3ZTa367NqWSZNb1Ddp34CTmShLKFrnKdNiUn55RdokLnHtf1AL5ssaQlYDwBECX7XiBWOhw==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -2482,9 +2482,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-riscv64-gnu": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.97.0.tgz",
|
||||
"integrity": "sha512-OJNHq6KGPdOh+YVk67T3MfRzLIy9MDMZCzH1f+xgh+kKPWzC4RqlqDNuoyqYiIxjO6kAVZZUQYvx4XVSKluJxw==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.99.0.tgz",
|
||||
"integrity": "sha512-zxn/xkf519f12FKkpL5XwJipsylfSSnm36h6c1zBDTz4fbIDMGyIhHfWfwM7uUmHo9Aqw1pLxFpY39Etv398+Q==",
|
||||
"cpu": [
|
||||
"riscv64"
|
||||
],
|
||||
@ -2499,9 +2499,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-s390x-gnu": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.97.0.tgz",
|
||||
"integrity": "sha512-yZV1kKNzewd/lwWYBw6IRy7ckbduQsUt5LisM8NXt8T0Dg+jhkyy4y7M6X57/KyvT//vHCuRvpnwTr9lk1M9IA==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.99.0.tgz",
|
||||
"integrity": "sha512-Y1eSDKDS5E4IVC7Oxw+NbYAKRmJPMJTIjW+9xOWwteDHkFqpocKe0USxog+Q1uhzalD9M0p9eXWEWdGQCMDBMQ==",
|
||||
"cpu": [
|
||||
"s390x"
|
||||
],
|
||||
@ -2516,9 +2516,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-x64-gnu": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.97.0.tgz",
|
||||
"integrity": "sha512-Ck7cJMsZX19B0dvsl1v9a8VLeL9kEfUc0zMBjkgYmJfhVuINHcnZlQs8E5zTfD+dpP1wYzUhwgqv3o6hl9QaXA==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.99.0.tgz",
|
||||
"integrity": "sha512-YVJMfk5cFWB8i2/nIrbk6n15bFkMHqWnMIWkVx7r2KwpTxHyFMfu2IpeVKo1ITDSmt5nBrGdLHD36QRlu2nDLg==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -2533,9 +2533,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-linux-x64-musl": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.97.0.tgz",
|
||||
"integrity": "sha512-COlEtnuyWfVjvylxhxoSd2HkAI85flvrQu3vGtt4Bm3+ZVdteFCNQskk3q8XfD0Cs+FdtnvDMbhApHyFKaEfsQ==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.99.0.tgz",
|
||||
"integrity": "sha512-2+SDPrie5f90A1b9EirtVggOgsqtsYU5raZwkDYKyS1uvJzjqHCDhG/f4TwQxHmIc5YkczdQfwvN91lwmjsKYQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -2550,9 +2550,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-wasm32-wasi": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-wasm32-wasi/-/binding-wasm32-wasi-0.97.0.tgz",
|
||||
"integrity": "sha512-5Rt1uEe1VTw6aUluz8/nBNUbyCVGzwMJbXvPv+b4So+mFlkL+X2cTHb9LH8hcBgJ2TDITLT32J2TcV8Q8EPaKw==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-wasm32-wasi/-/binding-wasm32-wasi-0.99.0.tgz",
|
||||
"integrity": "sha512-DKA4j0QerUWSMADziLM5sAyM7V53Fj95CV9SjP77bPfEfT7MnvFKnneaRMqPK1cpzjAGiQF52OBUIKyk0dwOQA==",
|
||||
"cpu": [
|
||||
"wasm32"
|
||||
],
|
||||
@ -2567,22 +2567,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-wasm32-wasi/node_modules/@napi-rs/wasm-runtime": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.0.7.tgz",
|
||||
"integrity": "sha512-SeDnOO0Tk7Okiq6DbXmmBODgOAb9dp9gjlphokTUxmt8U3liIP1ZsozBahH69j/RJv+Rfs6IwUKHTgQYJ/HBAw==",
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.0.tgz",
|
||||
"integrity": "sha512-Fq6DJW+Bb5jaWE69/qOE0D1TUN9+6uWhCeZpdnSBk14pjLcCWR7Q8n49PTSPHazM37JqrsdpEthXy2xn6jWWiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"@emnapi/core": "^1.5.0",
|
||||
"@emnapi/runtime": "^1.5.0",
|
||||
"@emnapi/core": "^1.7.1",
|
||||
"@emnapi/runtime": "^1.7.1",
|
||||
"@tybys/wasm-util": "^0.10.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-win32-arm64-msvc": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.97.0.tgz",
|
||||
"integrity": "sha512-e2HDWO997STh7gADYJcjrZ+Fh5cSF8fwT6rRchNoV/hSwbJSC6ZpYFFFQEw2qZ2qyMeTmqQ6QVf7T9oKV18UXg==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.99.0.tgz",
|
||||
"integrity": "sha512-EaB3AvsxqdNUhh9FOoAxRZ2L4PCRwDlDb//QXItwyOJrX7XS+uGK9B1KEUV4FZ/7rDhHsWieLt5e07wl2Ti5AQ==",
|
||||
"cpu": [
|
||||
"arm64"
|
||||
],
|
||||
@ -2597,9 +2597,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-parser/binding-win32-x64-msvc": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.97.0.tgz",
|
||||
"integrity": "sha512-DQ92RUXw67ynu6fUzlFN/gr/rN3nxEQ35AC3EJYAgNKy/GFFJbNKGwFxGnmooje29XhBwibaRdxDs1OIgZBHvQ==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.99.0.tgz",
|
||||
"integrity": "sha512-sJN1Q8h7ggFOyDn0zsHaXbP/MklAVUvhrbq0LA46Qum686P3SZQHjbATqJn9yaVEvaSKXCshgl0vQ1gWkGgpcQ==",
|
||||
"cpu": [
|
||||
"x64"
|
||||
],
|
||||
@ -2614,9 +2614,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@oxc-project/types": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.97.0.tgz",
|
||||
"integrity": "sha512-lxmZK4xFrdvU0yZiDwgVQTCvh2gHWBJCBk5ALsrtsBWhs0uDIi+FTOnXRQeQfs304imdvTdaakT/lqwQ8hkOXQ==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.99.0.tgz",
|
||||
"integrity": "sha512-LLDEhXB7g1m5J+woRSgfKsFPS3LhR9xRhTeIoEBm5WrkwMxn6eZ0Ld0c0K5eHB57ChZX6I3uSmmLjZ8pcjlRcw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"funding": {
|
||||
@ -2647,13 +2647,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@prettier/plugin-oxc": {
|
||||
"version": "0.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@prettier/plugin-oxc/-/plugin-oxc-0.0.5.tgz",
|
||||
"integrity": "sha512-A0uIVkwFrEFQJCU/Wpga6pS5t8UQDdVGB+5e7pVMtlPRw69KDmlozcAoLggwdp3FoVpzNGhngMmgfiE8KLs+BA==",
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@prettier/plugin-oxc/-/plugin-oxc-0.1.3.tgz",
|
||||
"integrity": "sha512-aABz3zIRilpWMekbt1FL1JVBQrQLR8L4Td2SRctECrWSsXGTNn/G1BqNSKCdbvQS1LWstAXfqcXzDki7GAAJyg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"oxc-parser": "0.97.0"
|
||||
"oxc-parser": "0.99.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
@ -2694,16 +2694,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@ts-dev-tools/core": {
|
||||
"version": "1.9.8",
|
||||
"resolved": "https://registry.npmjs.org/@ts-dev-tools/core/-/core-1.9.8.tgz",
|
||||
"integrity": "sha512-zXrQaqjvIcyRbvtpZ67uBnfwma2dJ5RAUt9FQwloXCHeVoucNQVoqcvXJLXJDZje2elQDbmRyrcfx2oChAxvEA==",
|
||||
"version": "1.9.10",
|
||||
"resolved": "https://registry.npmjs.org/@ts-dev-tools/core/-/core-1.9.10.tgz",
|
||||
"integrity": "sha512-0iexvtF+qQ+1ecWQY3GpaeM92egHw+BUEabmabzB2QiBhcJLpwm91N7oLZjZ0oWpXVL1UQeExNNwi6GGhBzo5g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@commitlint/cli": "^20.0.0",
|
||||
"@commitlint/config-conventional": "^20.0.0",
|
||||
"@eslint/js": "^9.25.0",
|
||||
"@prettier/plugin-oxc": "^0.0.5",
|
||||
"@prettier/plugin-oxc": "^0.1.1",
|
||||
"@types/jest": "^30.0.0",
|
||||
"@types/node": "^24.0.1",
|
||||
"eslint": "^9.25.0",
|
||||
@ -3171,9 +3171,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@ts-dev-tools/core/node_modules/glob": {
|
||||
"version": "10.4.5",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz",
|
||||
"integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==",
|
||||
"version": "10.5.0",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz",
|
||||
"integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
@ -9840,13 +9840,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/oxc-parser": {
|
||||
"version": "0.97.0",
|
||||
"resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.97.0.tgz",
|
||||
"integrity": "sha512-gxUfidyxJY97BJ+JEN/PxiIxIU1Y1FAPyMTncgNymgd/Cb+TYprsXZqjVnVCmTUlIBoA1XVjbfP0+Iz+uAt7Ow==",
|
||||
"version": "0.99.0",
|
||||
"resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.99.0.tgz",
|
||||
"integrity": "sha512-MpS1lbd2vR0NZn1v0drpgu7RUFu3x9Rd0kxExObZc2+F+DIrV0BOMval/RO3BYGwssIOerII6iS8EbbpCCZQpQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@oxc-project/types": "^0.97.0"
|
||||
"@oxc-project/types": "^0.99.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || >=22.12.0"
|
||||
@ -9855,21 +9855,21 @@
|
||||
"url": "https://github.com/sponsors/Boshen"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@oxc-parser/binding-android-arm64": "0.97.0",
|
||||
"@oxc-parser/binding-darwin-arm64": "0.97.0",
|
||||
"@oxc-parser/binding-darwin-x64": "0.97.0",
|
||||
"@oxc-parser/binding-freebsd-x64": "0.97.0",
|
||||
"@oxc-parser/binding-linux-arm-gnueabihf": "0.97.0",
|
||||
"@oxc-parser/binding-linux-arm-musleabihf": "0.97.0",
|
||||
"@oxc-parser/binding-linux-arm64-gnu": "0.97.0",
|
||||
"@oxc-parser/binding-linux-arm64-musl": "0.97.0",
|
||||
"@oxc-parser/binding-linux-riscv64-gnu": "0.97.0",
|
||||
"@oxc-parser/binding-linux-s390x-gnu": "0.97.0",
|
||||
"@oxc-parser/binding-linux-x64-gnu": "0.97.0",
|
||||
"@oxc-parser/binding-linux-x64-musl": "0.97.0",
|
||||
"@oxc-parser/binding-wasm32-wasi": "0.97.0",
|
||||
"@oxc-parser/binding-win32-arm64-msvc": "0.97.0",
|
||||
"@oxc-parser/binding-win32-x64-msvc": "0.97.0"
|
||||
"@oxc-parser/binding-android-arm64": "0.99.0",
|
||||
"@oxc-parser/binding-darwin-arm64": "0.99.0",
|
||||
"@oxc-parser/binding-darwin-x64": "0.99.0",
|
||||
"@oxc-parser/binding-freebsd-x64": "0.99.0",
|
||||
"@oxc-parser/binding-linux-arm-gnueabihf": "0.99.0",
|
||||
"@oxc-parser/binding-linux-arm-musleabihf": "0.99.0",
|
||||
"@oxc-parser/binding-linux-arm64-gnu": "0.99.0",
|
||||
"@oxc-parser/binding-linux-arm64-musl": "0.99.0",
|
||||
"@oxc-parser/binding-linux-riscv64-gnu": "0.99.0",
|
||||
"@oxc-parser/binding-linux-s390x-gnu": "0.99.0",
|
||||
"@oxc-parser/binding-linux-x64-gnu": "0.99.0",
|
||||
"@oxc-parser/binding-linux-x64-musl": "0.99.0",
|
||||
"@oxc-parser/binding-wasm32-wasi": "0.99.0",
|
||||
"@oxc-parser/binding-win32-arm64-msvc": "0.99.0",
|
||||
"@oxc-parser/binding-win32-x64-msvc": "0.99.0"
|
||||
}
|
||||
},
|
||||
"node_modules/p-limit": {
|
||||
|
||||
42
package.json
42
package.json
@ -31,7 +31,7 @@
|
||||
"docker-compose": "^1.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ts-dev-tools/core": "^1.9.8",
|
||||
"@ts-dev-tools/core": "^1.9.10",
|
||||
"@vercel/ncc": "^0.38.4",
|
||||
"eslint-plugin-github": "^6.0.0",
|
||||
"eslint-plugin-jsonc": "^2.21.0"
|
||||
@ -85,43 +85,13 @@
|
||||
"**/src/**/*.[jt]s?(x)"
|
||||
]
|
||||
},
|
||||
"eslintConfig": {
|
||||
"root": true,
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"plugins": [
|
||||
"@typescript-eslint",
|
||||
"jest"
|
||||
],
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:jest/recommended",
|
||||
"prettier"
|
||||
],
|
||||
"env": {
|
||||
"es2021": true
|
||||
},
|
||||
"parserOptions": {
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
},
|
||||
"ecmaVersion": 12,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"settings": {
|
||||
"jest": {
|
||||
"version": "detect"
|
||||
}
|
||||
},
|
||||
"ignorePatterns": [
|
||||
"dist",
|
||||
"node_modules"
|
||||
]
|
||||
},
|
||||
"prettier": {
|
||||
"semi": true,
|
||||
"printWidth": 100,
|
||||
"trailingComma": "es5"
|
||||
"trailingComma": "es5",
|
||||
"plugins": [
|
||||
"@prettier/plugin-oxc"
|
||||
]
|
||||
},
|
||||
"commitlint": {
|
||||
"extends": [
|
||||
@ -140,6 +110,6 @@
|
||||
}
|
||||
},
|
||||
"tsDevTools": {
|
||||
"version": "20220617100200-prettier-cache"
|
||||
"version": "20250623095500-add-prettier-oxc"
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,6 +112,130 @@ describe("DockerComposeService", () => {
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("should throw formatted error when upAll fails with docker-compose result", async () => {
|
||||
const upInputs: UpInputs = {
|
||||
dockerFlags: [],
|
||||
composeFiles: ["docker-compose.yml"],
|
||||
services: [],
|
||||
composeFlags: [],
|
||||
upFlags: [],
|
||||
cwd: "/current/working/dir",
|
||||
serviceLogger: jest.fn(),
|
||||
};
|
||||
|
||||
const dockerComposeError = {
|
||||
exitCode: 1,
|
||||
err: "Error: unable to pull image\nfailed to resolve reference",
|
||||
out: "",
|
||||
};
|
||||
|
||||
upAllMock.mockRejectedValue(dockerComposeError);
|
||||
|
||||
await expect(service.up(upInputs)).rejects.toThrow(
|
||||
"Docker Compose command failed with exit code 1"
|
||||
);
|
||||
await expect(service.up(upInputs)).rejects.toThrow("unable to pull image");
|
||||
});
|
||||
|
||||
it("should throw formatted error when upMany fails with docker-compose result", async () => {
|
||||
const upInputs: UpInputs = {
|
||||
dockerFlags: [],
|
||||
composeFiles: ["docker-compose.yml"],
|
||||
services: ["web"],
|
||||
composeFlags: [],
|
||||
upFlags: [],
|
||||
cwd: "/current/working/dir",
|
||||
serviceLogger: jest.fn(),
|
||||
};
|
||||
|
||||
const dockerComposeError = {
|
||||
exitCode: 1,
|
||||
err: "Service 'web' failed to start",
|
||||
out: "Starting web...",
|
||||
};
|
||||
|
||||
upManyMock.mockRejectedValue(dockerComposeError);
|
||||
|
||||
await expect(service.up(upInputs)).rejects.toThrow(
|
||||
"Docker Compose command failed with exit code 1"
|
||||
);
|
||||
await expect(service.up(upInputs)).rejects.toThrow("Service 'web' failed to start");
|
||||
await expect(service.up(upInputs)).rejects.toThrow("Starting web...");
|
||||
});
|
||||
|
||||
it("should pass through docker-compose result without exit code", async () => {
|
||||
const upInputs: UpInputs = {
|
||||
dockerFlags: [],
|
||||
composeFiles: ["docker-compose.yml"],
|
||||
services: [],
|
||||
composeFlags: [],
|
||||
upFlags: [],
|
||||
cwd: "/current/working/dir",
|
||||
serviceLogger: jest.fn(),
|
||||
};
|
||||
|
||||
const dockerComposeError = {
|
||||
exitCode: null,
|
||||
err: "Some error without exit code",
|
||||
out: "",
|
||||
};
|
||||
|
||||
upAllMock.mockRejectedValue(dockerComposeError);
|
||||
|
||||
await expect(service.up(upInputs)).rejects.toThrow("Some error without exit code");
|
||||
});
|
||||
|
||||
it("should pass through standard Error objects", async () => {
|
||||
const upInputs: UpInputs = {
|
||||
dockerFlags: [],
|
||||
composeFiles: ["docker-compose.yml"],
|
||||
services: [],
|
||||
composeFlags: [],
|
||||
upFlags: [],
|
||||
cwd: "/current/working/dir",
|
||||
serviceLogger: jest.fn(),
|
||||
};
|
||||
|
||||
const standardError = new Error("Standard error message");
|
||||
upAllMock.mockRejectedValue(standardError);
|
||||
|
||||
await expect(service.up(upInputs)).rejects.toThrow("Standard error message");
|
||||
});
|
||||
|
||||
it("should pass through error strings", async () => {
|
||||
const upInputs: UpInputs = {
|
||||
dockerFlags: [],
|
||||
composeFiles: ["docker-compose.yml"],
|
||||
services: [],
|
||||
composeFlags: [],
|
||||
upFlags: [],
|
||||
cwd: "/current/working/dir",
|
||||
serviceLogger: jest.fn(),
|
||||
};
|
||||
|
||||
const unknownError = "Some unknown error";
|
||||
upAllMock.mockRejectedValue(unknownError);
|
||||
|
||||
await expect(service.up(upInputs)).rejects.toThrow("Some unknown error");
|
||||
});
|
||||
|
||||
it("should handle unknown error types gracefully", async () => {
|
||||
const upInputs: UpInputs = {
|
||||
dockerFlags: [],
|
||||
composeFiles: ["docker-compose.yml"],
|
||||
services: [],
|
||||
composeFlags: [],
|
||||
upFlags: [],
|
||||
cwd: "/current/working/dir",
|
||||
serviceLogger: jest.fn(),
|
||||
};
|
||||
|
||||
const unknownError = { unexpected: "error format" };
|
||||
upAllMock.mockRejectedValue(unknownError);
|
||||
|
||||
await expect(service.up(upInputs)).rejects.toThrow(JSON.stringify(unknownError));
|
||||
});
|
||||
});
|
||||
|
||||
describe("down", () => {
|
||||
@ -139,6 +263,30 @@ describe("DockerComposeService", () => {
|
||||
callback: expect.any(Function),
|
||||
});
|
||||
});
|
||||
|
||||
it("should throw formatted error when down fails with docker-compose result", async () => {
|
||||
const downInputs: DownInputs = {
|
||||
dockerFlags: [],
|
||||
composeFiles: [],
|
||||
composeFlags: [],
|
||||
downFlags: [],
|
||||
cwd: "/current/working/dir",
|
||||
serviceLogger: jest.fn(),
|
||||
};
|
||||
|
||||
const dockerComposeError = {
|
||||
exitCode: 1,
|
||||
err: "Error stopping containers",
|
||||
out: "",
|
||||
};
|
||||
|
||||
downMock.mockRejectedValue(dockerComposeError);
|
||||
|
||||
await expect(service.down(downInputs)).rejects.toThrow(
|
||||
"Docker Compose command failed with exit code 1"
|
||||
);
|
||||
await expect(service.down(downInputs)).rejects.toThrow("Error stopping containers");
|
||||
});
|
||||
});
|
||||
|
||||
describe("logs", () => {
|
||||
|
||||
@ -2,6 +2,7 @@ import {
|
||||
down,
|
||||
IDockerComposeLogOptions,
|
||||
IDockerComposeOptions,
|
||||
IDockerComposeResult,
|
||||
logs,
|
||||
upAll,
|
||||
upMany,
|
||||
@ -27,12 +28,16 @@ export class DockerComposeService {
|
||||
commandOptions: upFlags,
|
||||
};
|
||||
|
||||
if (services.length > 0) {
|
||||
await upMany(services, options);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (services.length > 0) {
|
||||
await upMany(services, options);
|
||||
return;
|
||||
}
|
||||
|
||||
await upAll(options);
|
||||
await upAll(options);
|
||||
} catch (error) {
|
||||
throw this.formatDockerComposeError(error);
|
||||
}
|
||||
}
|
||||
|
||||
async down({ downFlags, ...optionsInputs }: DownInputs): Promise<void> {
|
||||
@ -41,7 +46,11 @@ export class DockerComposeService {
|
||||
commandOptions: downFlags,
|
||||
};
|
||||
|
||||
await down(options);
|
||||
try {
|
||||
await down(options);
|
||||
} catch (error) {
|
||||
throw this.formatDockerComposeError(error);
|
||||
}
|
||||
}
|
||||
|
||||
async logs({ services, ...optionsInputs }: LogsInputs): Promise<{
|
||||
@ -79,4 +88,61 @@ export class DockerComposeService {
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats docker-compose errors into proper Error objects with readable messages
|
||||
*/
|
||||
private formatDockerComposeError(error: unknown): Error {
|
||||
// If it's already an Error, return it
|
||||
if (error instanceof Error) {
|
||||
return error;
|
||||
}
|
||||
|
||||
// Handle docker-compose result objects
|
||||
if (this.isDockerComposeResult(error)) {
|
||||
const parts: string[] = [];
|
||||
|
||||
// Add exit code information
|
||||
if (error.exitCode !== null) {
|
||||
parts.push(`Docker Compose command failed with exit code ${error.exitCode}`);
|
||||
} else {
|
||||
parts.push("Docker Compose command failed");
|
||||
}
|
||||
|
||||
// Add error stream output if available
|
||||
if (error.err && error.err.trim()) {
|
||||
parts.push("\nError output:");
|
||||
parts.push(error.err.trim());
|
||||
}
|
||||
|
||||
// Add standard output if available and different from error output
|
||||
if (error.out && error.out.trim() && error.out !== error.err) {
|
||||
parts.push("\nStandard output:");
|
||||
parts.push(error.out.trim());
|
||||
}
|
||||
|
||||
return new Error(parts.join("\n"));
|
||||
}
|
||||
|
||||
// Handle string errors
|
||||
if (typeof error === "string") {
|
||||
return new Error(error);
|
||||
}
|
||||
|
||||
// Fallback for unknown error types
|
||||
return new Error(JSON.stringify(error));
|
||||
}
|
||||
|
||||
/**
|
||||
* Type guard to check if an object is a docker-compose result
|
||||
*/
|
||||
private isDockerComposeResult(error: unknown): error is IDockerComposeResult {
|
||||
return (
|
||||
typeof error === "object" &&
|
||||
error !== null &&
|
||||
"exitCode" in error &&
|
||||
"err" in error &&
|
||||
"out" in error
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user