From 361bb16a3f4455f7bf0e6ff8e26743ed6b20e22b Mon Sep 17 00:00:00 2001 From: Tsiry Sandratraina Date: Tue, 5 Mar 2024 07:01:21 +0000 Subject: [PATCH] make it work with Node.js and Bun fix ci update ci ci: fix example --- .fluentci/.devcontainer/devcontainer.json | 25 - .../.fluentci/.devcontainer/devcontainer.json | 25 - .fluentci/.fluentci/.github/workflows/ci.yml | 28 - .fluentci/.fluentci/.vscode/settings.json | 3 - .fluentci/.fluentci/CODE_OF_CONDUCT.md | 132 ----- .fluentci/.fluentci/CONTRIBUTING.md | 70 --- .fluentci/.fluentci/LICENSE | 19 - .fluentci/.fluentci/README.md | 88 --- .fluentci/.fluentci/ci.ts | 12 - .fluentci/.fluentci/deno.json | 9 - .fluentci/.fluentci/deno.lock | 68 --- .fluentci/.fluentci/fixtures/.gitlab-ci.yml | 19 - .fluentci/.fluentci/flake.lock | 61 --- .fluentci/.fluentci/flake.nix | 26 - .fluentci/.fluentci/import_map.json | 28 - .fluentci/.fluentci/mod.ts | 4 - .fluentci/.fluentci/src/dagger/index.ts | 4 - .fluentci/.fluentci/src/dagger/jobs.ts | 197 ------- .fluentci/.fluentci/src/dagger/list_jobs.ts | 21 - .fluentci/.fluentci/src/dagger/pipeline.ts | 27 - .fluentci/.fluentci/src/dagger/runner.ts | 3 - .fluentci/.fluentci/src/github/config.ts | 52 -- .fluentci/.fluentci/src/github/init.ts | 3 - .fluentci/.fluentci/src/gitlab/index.ts | 4 - .fluentci/.fluentci/src/gitlab/jobs.ts | 9 - .fluentci/.fluentci/src/gitlab/pipeline.ts | 10 - .../.fluentci/src/gitlab/pipeline_test.ts | 8 - .fluentci/.github/workflows/ci.yml | 28 - .fluentci/.gitignore | 2 - .fluentci/.vscode/settings.json | 3 - .fluentci/CODE_OF_CONDUCT.md | 132 ----- .fluentci/CONTRIBUTING.md | 70 --- .fluentci/LICENSE | 19 - .fluentci/README.md | 69 --- .fluentci/ci.ts | 12 - .fluentci/deno.json | 9 - .fluentci/deno.lock | 68 --- .../.fluentci/.devcontainer/devcontainer.json | 25 - .../.fluentci/.devcontainer/devcontainer.json | 25 - .../.fluentci/.github/workflows/ci.yml | 28 - .../.fluentci/.fluentci/.vscode/settings.json | 3 - .../.fluentci/.fluentci/CODE_OF_CONDUCT.md | 132 ----- .../.fluentci/.fluentci/CONTRIBUTING.md | 70 --- .fluentci/example/.fluentci/.fluentci/LICENSE | 19 - .../example/.fluentci/.fluentci/README.md | 88 --- .fluentci/example/.fluentci/.fluentci/ci.ts | 12 - .../example/.fluentci/.fluentci/deno.json | 9 - .../example/.fluentci/.fluentci/deno.lock | 66 --- .../.fluentci/fixtures/.gitlab-ci.yml | 19 - .../example/.fluentci/.fluentci/flake.lock | 61 --- .../example/.fluentci/.fluentci/flake.nix | 26 - .../.fluentci/.fluentci/import_map.json | 27 - .fluentci/example/.fluentci/.fluentci/mod.ts | 4 - .../.fluentci/.fluentci/src/dagger/index.ts | 4 - .../.fluentci/.fluentci/src/dagger/jobs.ts | 111 ---- .../.fluentci/src/dagger/list_jobs.ts | 21 - .../.fluentci/src/dagger/pipeline.ts | 27 - .../.fluentci/.fluentci/src/dagger/runner.ts | 3 - .../.fluentci/.fluentci/src/gitlab/index.ts | 4 - .../.fluentci/.fluentci/src/gitlab/jobs.ts | 9 - .../.fluentci/src/gitlab/pipeline.ts | 10 - .../.fluentci/src/gitlab/pipeline_test.ts | 8 - .../.fluentci/.github/workflows/ci.yml | 28 - .../example/.fluentci/.vscode/settings.json | 3 - .../example/.fluentci/CODE_OF_CONDUCT.md | 132 ----- .fluentci/example/.fluentci/CONTRIBUTING.md | 70 --- .fluentci/example/.fluentci/LICENSE | 19 - .fluentci/example/.fluentci/README.md | 58 -- .fluentci/example/.fluentci/ci.ts | 12 - .fluentci/example/.fluentci/deno.json | 9 - .fluentci/example/.fluentci/deno.lock | 67 --- .../example/.fluentci/fixtures/.gitlab-ci.yml | 19 - .fluentci/example/.fluentci/flake.lock | 61 --- .fluentci/example/.fluentci/flake.nix | 26 - .fluentci/example/.fluentci/import_map.json | 27 - .fluentci/example/.fluentci/mod.ts | 4 - .../example/.fluentci/src/dagger/index.ts | 4 - .../example/.fluentci/src/dagger/jobs.ts | 188 ------- .../example/.fluentci/src/dagger/list_jobs.ts | 21 - .../example/.fluentci/src/dagger/pipeline.ts | 27 - .../example/.fluentci/src/dagger/runner.ts | 3 - .../example/.fluentci/src/gitlab/index.ts | 4 - .../example/.fluentci/src/gitlab/jobs.ts | 9 - .../example/.fluentci/src/gitlab/pipeline.ts | 10 - .../.fluentci/src/gitlab/pipeline_test.ts | 8 - .fluentci/example/.vscode/settings.json | 3 - .fluentci/example/README.md | 16 - .fluentci/example/main.tsx | 20 - .fluentci/fixtures/.gitlab-ci.yml | 19 - .fluentci/flake.lock | 61 --- .fluentci/flake.nix | 26 - .fluentci/import_map.json | 28 - .fluentci/mod.ts | 4 - .fluentci/src/dagger/index.ts | 4 - .fluentci/src/dagger/jobs.ts | 197 ------- .fluentci/src/dagger/list_jobs.ts | 21 - .fluentci/src/dagger/pipeline.ts | 27 - .fluentci/src/dagger/runner.ts | 3 - .fluentci/src/github/config.ts | 52 -- .fluentci/src/github/init.ts | 3 - .fluentci/src/gitlab/index.ts | 4 - .fluentci/src/gitlab/jobs.ts | 9 - .fluentci/src/gitlab/pipeline.ts | 10 - .fluentci/src/gitlab/pipeline_test.ts | 8 - .github/workflows/ci.yml | 16 +- .github/workflows/codesee-arch-diagram.yml | 23 - .github/workflows/example.yml | 4 +- .github/workflows/zenith.yml | 2 +- README.md | 4 +- deno.json | 3 + deno.lock | 193 ++++++- deps.ts | 51 +- example/.fluentci/deno.lock | 429 +++++++-------- example/.fluentci/deps.ts | 51 +- example/.fluentci/sdk/builder.ts | 5 +- example/.fluentci/sdk/client.gen.ts | 511 ++++++++++++++---- .../sdk/common/errors/DaggerSDKError.ts | 46 ++ .../errors/DockerImageRefValidationError.ts | 28 + .../EngineSessionConnectParamsParseError.ts | 31 ++ .../EngineSessionConnectionTimeoutError.ts | 31 ++ .../errors/EngineSessionErrorOptions.ts | 20 + .../.fluentci/sdk/common/errors/ExecError.ts | 54 ++ .../sdk/common/errors/GraphQLRequestError.ts | 36 ++ .../errors/InitEngineSessionBinaryError.ts | 17 + .../common/errors/NotAwaitedRequestError.ts | 17 + .../errors/TooManyNestedObjectsError.ts | 27 + .../sdk/common/errors/UnknownDaggerError.ts | 17 + .../sdk/common/errors/errors-codes.ts | 63 +++ example/.fluentci/sdk/common/errors/index.ts | 12 + example/.fluentci/sdk/common/errors/types.ts | 16 + example/.fluentci/sdk/common/utils.ts | 4 + example/.fluentci/src/dagger/index.ts | 3 +- example/.fluentci/src/dagger/jobs.ts | 256 +++++---- example/.fluentci/src/dagger/pipeline.ts | 2 +- sdk/builder.ts | 5 +- sdk/client.gen.ts | 511 ++++++++++++++---- sdk/common/errors/DaggerSDKError.ts | 46 ++ .../errors/DockerImageRefValidationError.ts | 28 + .../EngineSessionConnectParamsParseError.ts | 31 ++ .../EngineSessionConnectionTimeoutError.ts | 31 ++ .../errors/EngineSessionErrorOptions.ts | 20 + sdk/common/errors/ExecError.ts | 54 ++ sdk/common/errors/GraphQLRequestError.ts | 36 ++ .../errors/InitEngineSessionBinaryError.ts | 17 + sdk/common/errors/NotAwaitedRequestError.ts | 17 + .../errors/TooManyNestedObjectsError.ts | 27 + sdk/common/errors/UnknownDaggerError.ts | 17 + sdk/common/errors/errors-codes.ts | 63 +++ sdk/common/errors/index.ts | 12 + sdk/common/errors/types.ts | 16 + sdk/common/utils.ts | 4 + src/dagger/index.ts | 3 +- src/dagger/jobs.ts | 251 ++++----- 153 files changed, 2375 insertions(+), 4288 deletions(-) delete mode 100644 .fluentci/.devcontainer/devcontainer.json delete mode 100644 .fluentci/.fluentci/.devcontainer/devcontainer.json delete mode 100644 .fluentci/.fluentci/.github/workflows/ci.yml delete mode 100644 .fluentci/.fluentci/.vscode/settings.json delete mode 100644 .fluentci/.fluentci/CODE_OF_CONDUCT.md delete mode 100644 .fluentci/.fluentci/CONTRIBUTING.md delete mode 100644 .fluentci/.fluentci/LICENSE delete mode 100644 .fluentci/.fluentci/README.md delete mode 100644 .fluentci/.fluentci/ci.ts delete mode 100644 .fluentci/.fluentci/deno.json delete mode 100644 .fluentci/.fluentci/deno.lock delete mode 100644 .fluentci/.fluentci/fixtures/.gitlab-ci.yml delete mode 100644 .fluentci/.fluentci/flake.lock delete mode 100644 .fluentci/.fluentci/flake.nix delete mode 100644 .fluentci/.fluentci/import_map.json delete mode 100644 .fluentci/.fluentci/mod.ts delete mode 100644 .fluentci/.fluentci/src/dagger/index.ts delete mode 100644 .fluentci/.fluentci/src/dagger/jobs.ts delete mode 100644 .fluentci/.fluentci/src/dagger/list_jobs.ts delete mode 100644 .fluentci/.fluentci/src/dagger/pipeline.ts delete mode 100644 .fluentci/.fluentci/src/dagger/runner.ts delete mode 100644 .fluentci/.fluentci/src/github/config.ts delete mode 100644 .fluentci/.fluentci/src/github/init.ts delete mode 100644 .fluentci/.fluentci/src/gitlab/index.ts delete mode 100644 .fluentci/.fluentci/src/gitlab/jobs.ts delete mode 100644 .fluentci/.fluentci/src/gitlab/pipeline.ts delete mode 100644 .fluentci/.fluentci/src/gitlab/pipeline_test.ts delete mode 100644 .fluentci/.github/workflows/ci.yml delete mode 100644 .fluentci/.gitignore delete mode 100644 .fluentci/.vscode/settings.json delete mode 100644 .fluentci/CODE_OF_CONDUCT.md delete mode 100644 .fluentci/CONTRIBUTING.md delete mode 100644 .fluentci/LICENSE delete mode 100644 .fluentci/README.md delete mode 100644 .fluentci/ci.ts delete mode 100644 .fluentci/deno.json delete mode 100644 .fluentci/deno.lock delete mode 100644 .fluentci/example/.fluentci/.devcontainer/devcontainer.json delete mode 100644 .fluentci/example/.fluentci/.fluentci/.devcontainer/devcontainer.json delete mode 100644 .fluentci/example/.fluentci/.fluentci/.github/workflows/ci.yml delete mode 100644 .fluentci/example/.fluentci/.fluentci/.vscode/settings.json delete mode 100644 .fluentci/example/.fluentci/.fluentci/CODE_OF_CONDUCT.md delete mode 100644 .fluentci/example/.fluentci/.fluentci/CONTRIBUTING.md delete mode 100644 .fluentci/example/.fluentci/.fluentci/LICENSE delete mode 100644 .fluentci/example/.fluentci/.fluentci/README.md delete mode 100644 .fluentci/example/.fluentci/.fluentci/ci.ts delete mode 100644 .fluentci/example/.fluentci/.fluentci/deno.json delete mode 100644 .fluentci/example/.fluentci/.fluentci/deno.lock delete mode 100644 .fluentci/example/.fluentci/.fluentci/fixtures/.gitlab-ci.yml delete mode 100644 .fluentci/example/.fluentci/.fluentci/flake.lock delete mode 100644 .fluentci/example/.fluentci/.fluentci/flake.nix delete mode 100644 .fluentci/example/.fluentci/.fluentci/import_map.json delete mode 100644 .fluentci/example/.fluentci/.fluentci/mod.ts delete mode 100644 .fluentci/example/.fluentci/.fluentci/src/dagger/index.ts delete mode 100644 .fluentci/example/.fluentci/.fluentci/src/dagger/jobs.ts delete mode 100644 .fluentci/example/.fluentci/.fluentci/src/dagger/list_jobs.ts delete mode 100644 .fluentci/example/.fluentci/.fluentci/src/dagger/pipeline.ts delete mode 100644 .fluentci/example/.fluentci/.fluentci/src/dagger/runner.ts delete mode 100644 .fluentci/example/.fluentci/.fluentci/src/gitlab/index.ts delete mode 100644 .fluentci/example/.fluentci/.fluentci/src/gitlab/jobs.ts delete mode 100644 .fluentci/example/.fluentci/.fluentci/src/gitlab/pipeline.ts delete mode 100644 .fluentci/example/.fluentci/.fluentci/src/gitlab/pipeline_test.ts delete mode 100644 .fluentci/example/.fluentci/.github/workflows/ci.yml delete mode 100644 .fluentci/example/.fluentci/.vscode/settings.json delete mode 100644 .fluentci/example/.fluentci/CODE_OF_CONDUCT.md delete mode 100644 .fluentci/example/.fluentci/CONTRIBUTING.md delete mode 100644 .fluentci/example/.fluentci/LICENSE delete mode 100644 .fluentci/example/.fluentci/README.md delete mode 100644 .fluentci/example/.fluentci/ci.ts delete mode 100644 .fluentci/example/.fluentci/deno.json delete mode 100644 .fluentci/example/.fluentci/deno.lock delete mode 100644 .fluentci/example/.fluentci/fixtures/.gitlab-ci.yml delete mode 100644 .fluentci/example/.fluentci/flake.lock delete mode 100644 .fluentci/example/.fluentci/flake.nix delete mode 100644 .fluentci/example/.fluentci/import_map.json delete mode 100644 .fluentci/example/.fluentci/mod.ts delete mode 100644 .fluentci/example/.fluentci/src/dagger/index.ts delete mode 100644 .fluentci/example/.fluentci/src/dagger/jobs.ts delete mode 100644 .fluentci/example/.fluentci/src/dagger/list_jobs.ts delete mode 100644 .fluentci/example/.fluentci/src/dagger/pipeline.ts delete mode 100644 .fluentci/example/.fluentci/src/dagger/runner.ts delete mode 100644 .fluentci/example/.fluentci/src/gitlab/index.ts delete mode 100644 .fluentci/example/.fluentci/src/gitlab/jobs.ts delete mode 100644 .fluentci/example/.fluentci/src/gitlab/pipeline.ts delete mode 100644 .fluentci/example/.fluentci/src/gitlab/pipeline_test.ts delete mode 100644 .fluentci/example/.vscode/settings.json delete mode 100644 .fluentci/example/README.md delete mode 100644 .fluentci/example/main.tsx delete mode 100644 .fluentci/fixtures/.gitlab-ci.yml delete mode 100644 .fluentci/flake.lock delete mode 100644 .fluentci/flake.nix delete mode 100644 .fluentci/import_map.json delete mode 100644 .fluentci/mod.ts delete mode 100644 .fluentci/src/dagger/index.ts delete mode 100644 .fluentci/src/dagger/jobs.ts delete mode 100644 .fluentci/src/dagger/list_jobs.ts delete mode 100644 .fluentci/src/dagger/pipeline.ts delete mode 100644 .fluentci/src/dagger/runner.ts delete mode 100644 .fluentci/src/github/config.ts delete mode 100644 .fluentci/src/github/init.ts delete mode 100644 .fluentci/src/gitlab/index.ts delete mode 100644 .fluentci/src/gitlab/jobs.ts delete mode 100644 .fluentci/src/gitlab/pipeline.ts delete mode 100644 .fluentci/src/gitlab/pipeline_test.ts delete mode 100644 .github/workflows/codesee-arch-diagram.yml create mode 100644 example/.fluentci/sdk/common/errors/DaggerSDKError.ts create mode 100644 example/.fluentci/sdk/common/errors/DockerImageRefValidationError.ts create mode 100644 example/.fluentci/sdk/common/errors/EngineSessionConnectParamsParseError.ts create mode 100644 example/.fluentci/sdk/common/errors/EngineSessionConnectionTimeoutError.ts create mode 100644 example/.fluentci/sdk/common/errors/EngineSessionErrorOptions.ts create mode 100644 example/.fluentci/sdk/common/errors/ExecError.ts create mode 100644 example/.fluentci/sdk/common/errors/GraphQLRequestError.ts create mode 100644 example/.fluentci/sdk/common/errors/InitEngineSessionBinaryError.ts create mode 100644 example/.fluentci/sdk/common/errors/NotAwaitedRequestError.ts create mode 100644 example/.fluentci/sdk/common/errors/TooManyNestedObjectsError.ts create mode 100644 example/.fluentci/sdk/common/errors/UnknownDaggerError.ts create mode 100644 example/.fluentci/sdk/common/errors/errors-codes.ts create mode 100644 example/.fluentci/sdk/common/errors/index.ts create mode 100644 example/.fluentci/sdk/common/errors/types.ts create mode 100644 example/.fluentci/sdk/common/utils.ts create mode 100644 sdk/common/errors/DaggerSDKError.ts create mode 100644 sdk/common/errors/DockerImageRefValidationError.ts create mode 100644 sdk/common/errors/EngineSessionConnectParamsParseError.ts create mode 100644 sdk/common/errors/EngineSessionConnectionTimeoutError.ts create mode 100644 sdk/common/errors/EngineSessionErrorOptions.ts create mode 100644 sdk/common/errors/ExecError.ts create mode 100644 sdk/common/errors/GraphQLRequestError.ts create mode 100644 sdk/common/errors/InitEngineSessionBinaryError.ts create mode 100644 sdk/common/errors/NotAwaitedRequestError.ts create mode 100644 sdk/common/errors/TooManyNestedObjectsError.ts create mode 100644 sdk/common/errors/UnknownDaggerError.ts create mode 100644 sdk/common/errors/errors-codes.ts create mode 100644 sdk/common/errors/index.ts create mode 100644 sdk/common/errors/types.ts create mode 100644 sdk/common/utils.ts diff --git a/.fluentci/.devcontainer/devcontainer.json b/.fluentci/.devcontainer/devcontainer.json deleted file mode 100644 index 39a38ae..0000000 --- a/.fluentci/.devcontainer/devcontainer.json +++ /dev/null @@ -1,25 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/debian -{ - "name": "Debian", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/base:bullseye", - "features": { - "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/nix:1": {} - }, - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "nix develop --experimental-features \"nix-command flakes\"" - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} diff --git a/.fluentci/.fluentci/.devcontainer/devcontainer.json b/.fluentci/.fluentci/.devcontainer/devcontainer.json deleted file mode 100644 index 39a38ae..0000000 --- a/.fluentci/.fluentci/.devcontainer/devcontainer.json +++ /dev/null @@ -1,25 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/debian -{ - "name": "Debian", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/base:bullseye", - "features": { - "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/nix:1": {} - }, - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "nix develop --experimental-features \"nix-command flakes\"" - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} diff --git a/.fluentci/.fluentci/.github/workflows/ci.yml b/.fluentci/.fluentci/.github/workflows/ci.yml deleted file mode 100644 index a7f9464..0000000 --- a/.fluentci/.fluentci/.github/workflows/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Codecov - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.34 - - name: Create coverage files - run: deno test --allow-read --coverage=coverage --lock-write # create coverage files - - name: Create coverage report - run: deno coverage ./coverage --lcov > coverage.lcov # create coverage report - - name: Collect coverage - uses: codecov/codecov-action@v3 # upload the report on Codecov - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - file: ./coverage.lcov diff --git a/.fluentci/.fluentci/.vscode/settings.json b/.fluentci/.fluentci/.vscode/settings.json deleted file mode 100644 index cbac569..0000000 --- a/.fluentci/.fluentci/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "deno.enable": true -} diff --git a/.fluentci/.fluentci/CODE_OF_CONDUCT.md b/.fluentci/.fluentci/CODE_OF_CONDUCT.md deleted file mode 100644 index e9c20f9..0000000 --- a/.fluentci/.fluentci/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,132 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -- Demonstrating empathy and kindness toward other people -- Being respectful of differing opinions, viewpoints, and experiences -- Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -- Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -- The use of sexualized language or imagery, and sexual attention or advances of - any kind -- Trolling, insulting or derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or email address, - without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -[GitHub Issues](https://github.com/fluent-ci-templates/deno-pipeline/issues). -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations diff --git a/.fluentci/.fluentci/CONTRIBUTING.md b/.fluentci/.fluentci/CONTRIBUTING.md deleted file mode 100644 index e50de72..0000000 --- a/.fluentci/.fluentci/CONTRIBUTING.md +++ /dev/null @@ -1,70 +0,0 @@ -# Contributing Guidelines - -Thank you for your interest in contributing to our project. Whether it's a bug -report, new feature, correction, or additional documentation, we greatly value -feedback and contributions from our community. - -Please read through this document before submitting any issues or pull requests -to ensure we have all the necessary information to effectively respond to your -bug report or contribution. - -## Reporting Bugs/Feature Requests - -We welcome you to use the GitHub issue tracker to report bugs or suggest -features. - -When filing an issue, please check existing open, or recently closed, issues to -make sure somebody else hasn't already reported the issue. Please try to include -as much information as you can. Details like these are incredibly useful: - -- A reproducible test case or series of steps -- The version of our code being used -- Any modifications you've made relevant to the bug -- Anything unusual about your environment or deployment - -## Contributing via Pull Requests - -Contributions via pull requests are much appreciated. Before sending us a pull -request, please ensure that: - -1. You are working against the latest source on the _master_ branch. -2. You check existing open, and recently merged, pull requests to make sure - someone else hasn't addressed the problem already. -3. You open an issue to discuss any significant work - we would hate for your - time to be wasted. - -To send us a pull request, please: - -1. Fork the repository. -2. Modify the source; please focus on the specific change you are contributing. - If you also reformat all the code, it will be hard for us to focus on your - change. -3. Ensure local tests pass. -4. Commit to your fork using clear commit messages. -5. Send us a pull request, answering any default questions in the pull request - interface. -6. Pay attention to any automated CI failures reported in the pull request, and - stay involved in the conversation. - -GitHub provides additional document on -[forking a repository](https://help.github.com/articles/fork-a-repo/) and -[creating a pull request](https://help.github.com/articles/creating-a-pull-request/). - -## Finding contributions to work on - -Looking at the existing issues is a great way to find something to contribute -on. As our projects, by default, use the default GitHub issue labels -(enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any -'help wanted' issues is a great place to start. - -## Code of Conduct - -This project has adopted the -[Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, -available at -https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. - -## Licensing - -See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to -confirm the licensing of your contribution. diff --git a/.fluentci/.fluentci/LICENSE b/.fluentci/.fluentci/LICENSE deleted file mode 100644 index d9ab36a..0000000 --- a/.fluentci/.fluentci/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2023 Tsiry Sandratraina - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/.fluentci/.fluentci/README.md b/.fluentci/.fluentci/README.md deleted file mode 100644 index 23f6a94..0000000 --- a/.fluentci/.fluentci/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Deno Pipeline - -[![deno module](https://shield.deno.dev/x/deno_pipeline)](https://deno.land/x/deno_pipeline) -![deno compatibility](https://shield.deno.dev/deno/^1.34) -[![](https://img.shields.io/codecov/c/gh/fluent-ci-templates/deno-pipeline)](https://codecov.io/gh/fluent-ci-templates/deno-pipeline) - -A ready-to-use GitLab CI Pipeline and Jobs for your Deno projects. - -## ๐Ÿš€ Usage - -Quick start: - -```ts -import { GitLab } from "https://deno.land/x/deno_pipeline/mod.ts"; - -const { pipeline } = GitLab; - -pipeline.write(); // Write the pipeline to the file .gitlab-ci.yml -``` - -Or, if you want to use the predefined jobs: - -```ts -import { GitlabCI } from "https://deno.land/x/fluent_gitlab_ci/mod.ts"; -import { GitLab } from "https://deno.land/x/deno_pipeline/mod.ts"; - -const { fmt, lint, test } = GitLab; - -const const pipeline = new GitlabCI() - .image("denoland/deno:alpine") - .addJob("fmt", fmt) - .addJob("lint", lint) - .addJob("test", test); - -pipeline.write(); // Write the pipeline to the file .gitlab-ci.yml -``` - -It will generate the following `.gitlab-ci.yml` file: - -```yaml -# Do not edit this file directly. It is generated by Fluent GitLab CI - -image: denoland/deno:alpine - -fmt: - image: denoland/deno:alpine - script: - - deno fmt --check - -lint: - image: denoland/deno:alpine - script: - - deno lint - -test: - image: denoland/deno:alpine - script: - - deno test -``` - -## ๐Ÿงช Advanced Usage - -This package also provides a ready-to-use pipeline for -[Dagger](https://dagger.io/), just run the following command on your Deno -project: - -```sh -dagger run deno run -A https://deno.land/x/deno_pipeline/ci.ts -``` - -Or, if you want to use the predefined jobs: - -```ts -import Client, { connect } from "@dagger.io/dagger"; -import { Dagger } from "https://deno.land/x/deno_pipeline/mod.ts"; - -const { fmt, lint, test } = Dagger; - -function pipeline(src = ".") { - connect(async (client: Client) => { - await fmt(client, src); - await lint(client, src); - await test(client, src); - }); -} - -pipeline(); -``` diff --git a/.fluentci/.fluentci/ci.ts b/.fluentci/.fluentci/ci.ts deleted file mode 100644 index 67e5a80..0000000 --- a/.fluentci/.fluentci/ci.ts +++ /dev/null @@ -1,12 +0,0 @@ -const command = new Deno.Command(Deno.execPath(), { - args: [ - "run", - "-A", - "--import-map=https://deno.land/x/deno_pipeline/import_map.json", - "https://deno.land/x/deno_pipeline/src/dagger/runner.ts", - ], -}); - -const { stdout } = await command.output(); - -console.log(new TextDecoder().decode(stdout)); diff --git a/.fluentci/.fluentci/deno.json b/.fluentci/.fluentci/deno.json deleted file mode 100644 index 4240219..0000000 --- a/.fluentci/.fluentci/deno.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "importMap": "import_map.json", - "tasks": { - "esm:add": "deno run -A https://esm.sh/v128 add", - "esm:update": "deno run -A https://esm.sh/v128 update", - "esm:remove": "deno run -A https://esm.sh/v128 remove", - "ci:dagger": "dagger run deno run -A src/dagger/runner.ts" - } -} diff --git a/.fluentci/.fluentci/deno.lock b/.fluentci/.fluentci/deno.lock deleted file mode 100644 index a364136..0000000 --- a/.fluentci/.fluentci/deno.lock +++ /dev/null @@ -1,68 +0,0 @@ -{ - "version": "2", - "remote": { - "https://deno.land/std@0.150.0/media_types/_util.ts": "ce9b4fc4ba1c447dafab619055e20fd88236ca6bdd7834a21f98bd193c3fbfa1", - "https://deno.land/std@0.150.0/media_types/mod.ts": "2d4b6f32a087029272dc59e0a55ae3cc4d1b27b794ccf528e94b1925795b3118", - "https://deno.land/std@0.150.0/media_types/vendor/mime-db.v1.52.0.ts": "724cee25fa40f1a52d3937d6b4fbbfdd7791ff55e1b7ac08d9319d5632c7f5af", - "https://deno.land/std@0.191.0/fmt/colors.ts": "d67e3cd9f472535241a8e410d33423980bec45047e343577554d3356e1f0ef4e", - "https://deno.land/x/codecov_pipeline@v0.1.0/src/dagger/jobs.ts": "e980479e0bcd759773286145f3345ce7e1662c7d6734bfc4bbf8e6bfc93b974e", - "https://deno.land/x/nix_installer_pipeline@v0.3.6/src/dagger/steps.ts": "a34aea3753c7079de5877f592ce31f30d05d552155729ff3e695d77326405133", - "https://deno.land/x/xhr@0.3.0/mod.ts": "094aacd627fd9635cd942053bf8032b5223b909858fa9dc8ffa583752ff63b20", - "https://esm.sh/stringify-tree@1.1.1": "8d994a105481fa944515323d89bd2596c1de79f3d9bd1386266463934716eca0", - "https://esm.sh/v128/*@dagger.io/dagger@0.6.3": "cb691a77c0cdaee22f2b8393731b5143c83ce22dbbea204cdbfd203768d15b64", - "https://esm.sh/v128/@dagger.io/dagger@0.6.3/X-ZS8q/denonext/dagger.mjs": "fd0901784d75b99615b5409c3654b5c7edfc5ba377c9e1a5a67ffff4f7d3ac32", - "https://esm.sh/v128/adm-zip@0.5.10": "d9c54d6d2dd788462781a57d923295bd79304e6fd74b242fd4b30e35b39c5dcf", - "https://esm.sh/v128/adm-zip@0.5.10/denonext/adm-zip.mjs": "07a9731547905e0ca55ae917e1969d7f6d04fb3773f906ce3306891337eb4849", - "https://esm.sh/v128/chownr@2.0.0/denonext/chownr.mjs": "30b8f17084dfbe475a5052b615f706b06ddd17dca0535103340d485c6b94e952", - "https://esm.sh/v128/cross-fetch@3.1.8/denonext/cross-fetch.mjs": "8fba9e7c3fbaf0d2168beb63ce0cd21b5bfbfbd77e2fcbf8d957d533a71222f6", - "https://esm.sh/v128/cross-spawn@7.0.3/denonext/cross-spawn.mjs": "0569a26e7ad4b3376516cbc9b1942e10961a58030eadcea8c848e6b956eb355c", - "https://esm.sh/v128/data-uri-to-buffer@4.0.1/denonext/data-uri-to-buffer.mjs": "70ef987b1da58391495ecfad9888d996469224faf3cd996d81dc2e059feb9f31", - "https://esm.sh/v128/env-paths@3.0.0": "8400fb23319be9b30d7b40d1c865541c5b3c7726cdf9b74000bc0f1678d52ecf", - "https://esm.sh/v128/env-paths@3.0.0/denonext/env-paths.mjs": "77984a05eb16450087f25060a070ed500ec546719d471143e16d976ca73ca956", - "https://esm.sh/v128/execa@7.1.1": "a40c7030df81ab0847a5d844f4c5c6420af973dff05fef88e53cbb9b8667fdc2", - "https://esm.sh/v128/execa@7.1.1/denonext/execa.mjs": "9d5943544c0df3761b52f2c095f89a03ca6c028d818a8f0475ff883b0408f154", - "https://esm.sh/v128/fetch-blob@3.2.0/denonext/fetch-blob.mjs": "0531568b36c0f6db3e9825fbb2d08dee51100eb675c2bf1d98d6971a92010721", - "https://esm.sh/v128/fetch-blob@3.2.0/denonext/file.js": "fd82828163a4e7bdc15190d8c3dbfd92f93274d05bd7f7f5ab81093e3ad7e9c2", - "https://esm.sh/v128/fetch-blob@3.2.0/denonext/from.js": "7d3258c7960755497f90879806f0b815d5e564c2ac1523238af5cb9552ff5c45", - "https://esm.sh/v128/formdata-polyfill@4.0.10/denonext/esm.min.js": "b6d65a204e81eca699d9eb6f867e9efffa42db39a8f161690915a89e5eb1766f", - "https://esm.sh/v128/fs-minipass@2.1.0/denonext/fs-minipass.mjs": "74b00283d556b281bdfd6a669576d852f2c43702043c411985f8f8188d208c5d", - "https://esm.sh/v128/get-stream@6.0.1/denonext/get-stream.mjs": "a947a16f8cb3052fd654a84f8b36b40ce96b6a5acfb3ad4ab69d814bcf3351fb", - "https://esm.sh/v128/graphql-request@6.1.0": "17f00c323eb825811ce14e2b0e88a0c873acb666c382ac963d1edeb03e01f372", - "https://esm.sh/v128/graphql-request@6.1.0/denonext/graphql-request.mjs": "0b15f49d44489423ae6f06004725b6d050b6359da4969e6569bd6ad45065bd94", - "https://esm.sh/v128/graphql-tag@2.12.6": "5bfa27da9c9918fb52a01b8579891e804e0365d91118df1f2e0957a72dacdc39", - "https://esm.sh/v128/graphql-tag@2.12.6/denonext/graphql-tag.mjs": "331d09949efc4ac60c84a69b52a7da8b333210493900e54953ae4604c9874527", - "https://esm.sh/v128/graphql@16.7.1/denonext/graphql.mjs": "418ad7c07b0f2d687f33b6275d3b5f317f4afbef1f462f318229f458dff45416", - "https://esm.sh/v128/human-signals@4.3.1/denonext/human-signals.mjs": "3889110cedd907804443d018cffe0a1d892d5e7467661376caf967feff55cbe9", - "https://esm.sh/v128/is-stream@3.0.0/denonext/is-stream.mjs": "5c8b65f2fa051c4b18e88bbae11dac8bba9caf57752577d69bcea86d1f05c5b7", - "https://esm.sh/v128/isexe@2.0.0/denonext/isexe.mjs": "3cfefd270d1bfdfb864ee98dbb8f41d150cbf480925158f4a8f0ade8a9e17d6c", - "https://esm.sh/v128/merge-stream@2.0.0/denonext/merge-stream.mjs": "2c2af22401c294158d6bff659d157e3d2c028c218cc1bd2246534a45a4c03c61", - "https://esm.sh/v128/mimic-fn@4.0.0/denonext/mimic-fn.mjs": "10bcf0f2f20cbbba0c289ef7bf4d2422639bbc1c36c247be876afd6fe2d67138", - "https://esm.sh/v128/minipass@3.3.6/denonext/minipass.mjs": "59bbe430514455e78cb30c389b21af66efb2bf010cda071820a17d8c76d0d1cf", - "https://esm.sh/v128/minipass@5.0.0/denonext/minipass.mjs": "de0e049728f8c387b58c86439eb9d69a16b6a88756a6bc694e2fecbd7fd00401", - "https://esm.sh/v128/minizlib@2.1.2/denonext/minizlib.mjs": "0d919b6a0c60d5a31e14d748ff9d62aeae2923b604bcc6a22f90fa4bbd400d68", - "https://esm.sh/v128/mkdirp@1.0.4/denonext/mkdirp.mjs": "ee129b32e55dd8bede6b1bbd1978f7775fa5e2720d5a7ae07bf1e8c99abd77c7", - "https://esm.sh/v128/node-color-log@10.0.2": "05a277987c64153af1252167135076155fdc6b39ca260b2bdc39750da12d2a2d", - "https://esm.sh/v128/node-color-log@10.0.2/denonext/node-color-log.mjs": "2504391bd0ce1dd4c2bf0ed0b839b8a3ad84c028d9dd17cc58dccd2e14dacfde", - "https://esm.sh/v128/node-domexception@1.0.0/denonext/node-domexception.mjs": "bb35ba54c1a2b35870618876c0c96310a28ae58aecff33c8eed58a582e270ff4", - "https://esm.sh/v128/node-fetch@3.3.1": "916dcee177a69fb0e46970c528cb66fcd4973488f861844c0a235bfc645b0506", - "https://esm.sh/v128/node-fetch@3.3.1/denonext/node-fetch.mjs": "dc3a8f1f2fc9eb26d0d33e49f3750acc265d51a1a54bbd670c5d9f640b633a93", - "https://esm.sh/v128/node-fetch@3.3.1/denonext/src/utils/multipart-parser.js": "713b1b8cbafc4bfb7358debeb35d507e0d2328f0a28b8a2a7d79a3e5e4f5e5b8", - "https://esm.sh/v128/npm-run-path@5.1.0/denonext/npm-run-path.mjs": "3540b8c2dd1430f10d580f323f3a51aa30094da27a9220cce03ce69884b163bb", - "https://esm.sh/v128/onetime@6.0.0/denonext/onetime.mjs": "6e362222575d815f37fb813168d7069dd6a0f6bb6f972ed54d1bccb0f9fb3e1b", - "https://esm.sh/v128/original-fs@1.2.0/denonext/original-fs.mjs": "2b1098818e54d2c6748ff5b0dd9ea5f6a61b4b6d0f63fb625f21773d11cfc667", - "https://esm.sh/v128/path-key@3.1.1/denonext/path-key.mjs": "add83c631278b7df9b33ae84e41142db88bb291295bcc27eb4e77a1cbdfa71d0", - "https://esm.sh/v128/path-key@4.0.0/denonext/path-key.mjs": "2c2e3922bd0e6e414fa2752ff800bdc6b9208035ce797fa22e49b859f8259417", - "https://esm.sh/v128/shebang-command@2.0.0/denonext/shebang-command.mjs": "404e0fb09a782ca9495d53c721bb84b673b7b2e1054e021852143a6b91ca0e4f", - "https://esm.sh/v128/shebang-regex@3.0.0/denonext/shebang-regex.mjs": "03983ba59dd2cba9402935e21b46d05f5249364cba9f5757aef23c6c2fea65b9", - "https://esm.sh/v128/signal-exit@3.0.7/denonext/signal-exit.mjs": "2a176e5f9b351fa8057213c627a1503d63bf308b64447ef47f1ca6fbb2a91c81", - "https://esm.sh/v128/strip-final-newline@3.0.0/denonext/strip-final-newline.mjs": "03d9be4e8a249d63cbbddeb2fb675a1bbbcb335283e604d4ce56c88c90e6f102", - "https://esm.sh/v128/tar@6.1.15": "0460339f8aba5f287e8bebe258fe3fe13cb12f85820693f25724f0d98ef1258e", - "https://esm.sh/v128/tar@6.1.15/denonext/tar.mjs": "6194d892de8457b3b1f11d5cbacda1d540b453b45e8cb9f5f610abfb3e490b65", - "https://esm.sh/v128/tslib@2.6.0/denonext/tslib.mjs": "2215292e6fcf28a7a081eee911f127bb3c44cdd61ff0651e3e384d7a49b4e42b", - "https://esm.sh/v128/web-streams-polyfill@3.2.1/denonext/dist/ponyfill.es2018.js": "a2edb52a93494cda06386b3d6a168016b366e78f02c5eff1f94a0240be12ac96", - "https://esm.sh/v128/which@2.0.2/denonext/which.mjs": "86bf76e4937edb7fa3464d7bb9a426ef273684d1cefbec5ba5f1bdcb5cafff91", - "https://esm.sh/v128/yallist@4.0.0/denonext/yallist.mjs": "61f180d807dda50bac17028eda05d5722a3fecef6e98a9064e2353ea6864fd82", - "https://esm.sh/v130/lodash.flatten@4.4.0/denonext/lodash.flatten.mjs": "8e86ab607deea15cc3c1acfb5eae278ecbc5b80f24167b4e8f4c56df3278cd55", - "https://esm.sh/v130/stringify-tree@1.1.1/denonext/stringify-tree.mjs": "40a9d40e0282b5432302a3da68b88aa11685bc0b8a0b70246168deed5c5773fe" - } -} diff --git a/.fluentci/.fluentci/fixtures/.gitlab-ci.yml b/.fluentci/.fluentci/fixtures/.gitlab-ci.yml deleted file mode 100644 index 299e4c6..0000000 --- a/.fluentci/.fluentci/fixtures/.gitlab-ci.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Do not edit this file directly. It is generated by Fluent GitLab CI - -image: denoland/deno:alpine - -fmt: - image: denoland/deno:alpine - script: - - deno fmt --check - -lint: - image: denoland/deno:alpine - script: - - deno lint - -test: - image: denoland/deno:alpine - script: - - deno test - diff --git a/.fluentci/.fluentci/flake.lock b/.fluentci/.fluentci/flake.lock deleted file mode 100644 index af7453c..0000000 --- a/.fluentci/.fluentci/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1687709756, - "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1688910226, - "narHash": "sha256-kLTsFu9CAU2Gb288JhIBN/WlX4UUUDz4WiC/U59nvwk=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "2540432a940aee979be6ccfefba9ea0652c273a0", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "release-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/.fluentci/.fluentci/flake.nix b/.fluentci/.fluentci/flake.nix deleted file mode 100644 index b13ea7d..0000000 --- a/.fluentci/.fluentci/flake.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - description = "A Nix-flake-based Deno development environment"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/release-23.05"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem - (system: let - pkgs = import nixpkgs { - inherit system; - }; - in { - devShells.default = pkgs.mkShell { - buildInputs = [ - pkgs.deno - ]; - }; - }); -} \ No newline at end of file diff --git a/.fluentci/.fluentci/import_map.json b/.fluentci/.fluentci/import_map.json deleted file mode 100644 index 12c59ff..0000000 --- a/.fluentci/.fluentci/import_map.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "imports": { - "@dagger.io/dagger": "https://esm.sh/v128/*@dagger.io/dagger@0.6.3", - "fluent_gitlab_ci": "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts", - "fluent_github_actions": "https://deno.land/x/fluent_github_actions@v0.1.2/mod.ts", - "url": "node:url", - "readline": "node:readline", - "process": "node:process", - "path": "node:path", - "os": "node:os", - "fs": "node:fs", - "crypto": "node:crypto" - }, - "scopes": { - "https://esm.sh/v128/": { - "@lifeomic/axios-fetch": "https://esm.sh/v128/@lifeomic/axios-fetch@3.0.1", - "adm-zip": "https://esm.sh/v128/adm-zip@0.5.10", - "env-paths": "https://esm.sh/v128/env-paths@3.0.0", - "execa": "https://esm.sh/v128/execa@7.1.1", - "graphql-request": "https://esm.sh/v128/graphql-request@6.1.0", - "graphql-tag": "https://esm.sh/v128/graphql-tag@2.12.6", - "graphql": "https://esm.sh/v128/graphql@16.7.1", - "node-color-log": "https://esm.sh/v128/node-color-log@10.0.2", - "node-fetch": "https://esm.sh/v128/node-fetch@3.3.1", - "tar": "https://esm.sh/v128/tar@6.1.15" - } - } -} \ No newline at end of file diff --git a/.fluentci/.fluentci/mod.ts b/.fluentci/.fluentci/mod.ts deleted file mode 100644 index 6152fb6..0000000 --- a/.fluentci/.fluentci/mod.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as GitLab from "./src/gitlab/index.ts"; -import * as Dagger from "./src/dagger/index.ts"; - -export { Dagger, GitLab }; diff --git a/.fluentci/.fluentci/src/dagger/index.ts b/.fluentci/.fluentci/src/dagger/index.ts deleted file mode 100644 index 392c001..0000000 --- a/.fluentci/.fluentci/src/dagger/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import pipeline from "./pipeline.ts"; -import { fmt, lint, test } from "./jobs.ts"; - -export { fmt, lint, pipeline, test }; diff --git a/.fluentci/.fluentci/src/dagger/jobs.ts b/.fluentci/.fluentci/src/dagger/jobs.ts deleted file mode 100644 index 658ed39..0000000 --- a/.fluentci/.fluentci/src/dagger/jobs.ts +++ /dev/null @@ -1,197 +0,0 @@ -import Client from "@dagger.io/dagger"; -import { upload } from "https://deno.land/x/codecov_pipeline@v0.1.0/src/dagger/jobs.ts"; -import { withDevbox } from "https://deno.land/x/nix_installer_pipeline@v0.3.6/src/dagger/steps.ts"; -import { existsSync } from "fs"; - -export enum Job { - fmt = "fmt", - lint = "lint", - test = "test", - deploy = "deploy", - codecov = "codecov", -} - -const baseCtr = (client: Client, pipeline: string) => { - if (existsSync("devbox.json")) { - return withDevbox( - client - .pipeline(pipeline) - .container() - .from("alpine:latest") - .withExec(["apk", "update"]) - .withExec(["apk", "add", "bash", "curl"]) - .withMountedCache("/nix", client.cacheVolume("nix")) - .withMountedCache("/etc/nix", client.cacheVolume("nix-etc")) - ); - } - return client.pipeline(pipeline).container().from("denoland/deno:alpine"); -}; - -export const lint = async (client: Client, src = ".") => { - const context = client.host().directory(src); - let command = ["deno", "lint"]; - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - } - - const ctr = baseCtr(client, Job.lint) - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export const fmt = async (client: Client, src = ".") => { - const context = client.host().directory(src); - let command = ["deno", "fmt"]; - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - } - - const ctr = baseCtr(client, Job.fmt) - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export const test = async ( - client: Client, - src = ".", - options: { ignore: string[] } = { ignore: [] } -) => { - const context = client.host().directory(src); - let command = ["deno", "test", "-A", "--coverage=coverage", "--lock-write"]; - - if (options.ignore.length > 0) { - command = command.concat([`--ignore=${options.ignore.join(",")}`]); - } - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - } - - const ctr = baseCtr(client, Job.test) - .from("denoland/deno:alpine") - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withMountedCache("/root/.cache/deno", client.cacheVolume("deno-cache")) - .withExec(command) - .withExec(["sh", "-c", "deno coverage ./coverage --lcov > coverage.lcov"]); - - await ctr.file("/app/coverage.lcov").export("./coverage.lcov"); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export const deploy = async (client: Client, src = ".") => { - const context = client.host().directory(src); - let installDeployCtl = [ - "deno", - "install", - "--allow-all", - "--no-check", - "-r", - "-f", - "https://deno.land/x/deploy/deployctl.ts", - ]; - const project = Deno.env.get("DENO_PROJECT"); - const noStatic = Deno.env.get("NO_STATIC"); - const exclude = Deno.env.get("EXCLUDE"); - - let command = ["deployctl", "deploy"]; - - if (noStatic) { - command = command.concat(["--no-static"]); - } - - if (exclude) { - command = command.concat([`--exclude=${exclude}`]); - } - - if (!Deno.env.get("DENO_DEPLOY_TOKEN")) { - throw new Error("DENO_DEPLOY_TOKEN environment variable is not set"); - } - - if (!project) { - throw new Error("DENO_PROJECT environment variable is not set"); - } - - const script = Deno.env.get("DENO_MAIN_SCRIPT") || "main.tsx"; - command = command.concat([`--project=${project}`, script]); - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - installDeployCtl = [ - "sh", - "-c", - `devbox run -- ${installDeployCtl.join(" ")}`, - ]; - } - - const ctr = baseCtr(client, Job.deploy) - .from("denoland/deno:alpine") - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withEnvVariable("PATH", "/root/.deno/bin:$PATH", { expand: true }) - .withEnvVariable("DENO_DEPLOY_TOKEN", Deno.env.get("DENO_DEPLOY_TOKEN")!) - .withEnvVariable( - "DENO_MAIN_SCRIPT", - Deno.env.get("DENO_MAIN_SCRIPT") || "main.tsx" - ) - .withExec(installDeployCtl) - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export type JobExec = ( - client: Client, - src?: string -) => - | Promise - | (( - client: Client, - src?: string, - options?: { - ignore: string[]; - } - ) => Promise); - -export const codecov = upload; - -export const runnableJobs: Record = { - [Job.fmt]: fmt, - [Job.lint]: lint, - [Job.test]: test, - [Job.deploy]: deploy, - [Job.codecov]: upload, -}; - -export const jobDescriptions: Record = { - [Job.fmt]: "Format your code", - [Job.lint]: "Lint your code", - [Job.test]: "Run your tests", - [Job.deploy]: "Deploy your code to Deno Deploy", - [Job.codecov]: "Upload your code coverage to Codecov", -}; diff --git a/.fluentci/.fluentci/src/dagger/list_jobs.ts b/.fluentci/.fluentci/src/dagger/list_jobs.ts deleted file mode 100644 index 12bb3cb..0000000 --- a/.fluentci/.fluentci/src/dagger/list_jobs.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { brightGreen } from "https://deno.land/std@0.191.0/fmt/colors.ts"; -import { runnableJobs, jobDescriptions, Job } from "./jobs.ts"; -import { stringifyTree } from "https://esm.sh/stringify-tree@1.1.1"; - -const tree = { - name: brightGreen("deno_pipeline"), - children: (Object.keys(runnableJobs) as Job[]).map((job) => ({ - name: jobDescriptions[job] - ? `${brightGreen(job)} - ${jobDescriptions[job]}` - : brightGreen(job), - children: [], - })), -}; - -console.log( - stringifyTree( - tree, - (t) => t.name, - (t) => t.children - ) -); diff --git a/.fluentci/.fluentci/src/dagger/pipeline.ts b/.fluentci/.fluentci/src/dagger/pipeline.ts deleted file mode 100644 index bad7372..0000000 --- a/.fluentci/.fluentci/src/dagger/pipeline.ts +++ /dev/null @@ -1,27 +0,0 @@ -import Client, { connect } from "@dagger.io/dagger"; -import * as jobs from "./jobs.ts"; - -const { fmt, lint, test, runnableJobs } = jobs; - -export default function pipeline(src = ".", args: string[] = []) { - connect(async (client: Client) => { - if (args.length > 0) { - await runSpecificJobs(client, args as jobs.Job[]); - return; - } - - await fmt(client, src); - await lint(client, src); - await test(client, src); - }); -} - -async function runSpecificJobs(client: Client, args: jobs.Job[]) { - for (const name of args) { - const job = runnableJobs[name]; - if (!job) { - throw new Error(`Job ${name} not found`); - } - await job(client); - } -} diff --git a/.fluentci/.fluentci/src/dagger/runner.ts b/.fluentci/.fluentci/src/dagger/runner.ts deleted file mode 100644 index e23879e..0000000 --- a/.fluentci/.fluentci/src/dagger/runner.ts +++ /dev/null @@ -1,3 +0,0 @@ -import pipeline from "./pipeline.ts"; - -pipeline(".", Deno.args); diff --git a/.fluentci/.fluentci/src/github/config.ts b/.fluentci/.fluentci/src/github/config.ts deleted file mode 100644 index 481e992..0000000 --- a/.fluentci/.fluentci/src/github/config.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { JobSpec, Workflow } from "fluent_github_actions"; - -export function generateYaml() { - const workflow = new Workflow("Codecov"); - - const push = { - branches: ["main"], - }; - - const setupDagger = `\ - curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh - sudo mv bin/dagger /usr/local/bin - dagger version`; - - const tests: JobSpec = { - "runs-on": "ubuntu-latest", - steps: [ - { - uses: "actions/checkout@v2", - }, - { - uses: "denoland/setup-deno@v1", - with: { - "deno-version": "v1.37", - }, - }, - { - name: "Setup Fluent CI CLI", - run: "deno install -A -r https://cli.fluentci.io -n fluentci", - }, - { - name: "Setup Dagger", - run: setupDagger, - }, - { - name: "List Jobs", - run: "fluentci ls .", - }, - { - name: "Run Dagger Pipelines", - run: "dagger run fluentci . fmt lint test codecov", - env: { - CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}", - }, - }, - ], - }; - - workflow.on({ push }).jobs({ tests }); - - workflow.save(".github/workflows/ci.yml"); -} diff --git a/.fluentci/.fluentci/src/github/init.ts b/.fluentci/.fluentci/src/github/init.ts deleted file mode 100644 index 6097dd5..0000000 --- a/.fluentci/.fluentci/src/github/init.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { generateYaml } from "./config.ts"; - -generateYaml(); diff --git a/.fluentci/.fluentci/src/gitlab/index.ts b/.fluentci/.fluentci/src/gitlab/index.ts deleted file mode 100644 index 392c001..0000000 --- a/.fluentci/.fluentci/src/gitlab/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import pipeline from "./pipeline.ts"; -import { fmt, lint, test } from "./jobs.ts"; - -export { fmt, lint, pipeline, test }; diff --git a/.fluentci/.fluentci/src/gitlab/jobs.ts b/.fluentci/.fluentci/src/gitlab/jobs.ts deleted file mode 100644 index 46be50c..0000000 --- a/.fluentci/.fluentci/src/gitlab/jobs.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Job } from "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts"; - -export const fmt = new Job() - .image("denoland/deno:alpine") - .script("deno fmt --check"); - -export const lint = new Job().image("denoland/deno:alpine").script("deno lint"); - -export const test = new Job().image("denoland/deno:alpine").script("deno test"); diff --git a/.fluentci/.fluentci/src/gitlab/pipeline.ts b/.fluentci/.fluentci/src/gitlab/pipeline.ts deleted file mode 100644 index 366de64..0000000 --- a/.fluentci/.fluentci/src/gitlab/pipeline.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { GitlabCI } from "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts"; -import { fmt, lint, test } from "./jobs.ts"; - -const pipeline = new GitlabCI() - .image("denoland/deno:alpine") - .addJob("fmt", fmt) - .addJob("lint", lint) - .addJob("test", test); - -export default pipeline; diff --git a/.fluentci/.fluentci/src/gitlab/pipeline_test.ts b/.fluentci/.fluentci/src/gitlab/pipeline_test.ts deleted file mode 100644 index ca24710..0000000 --- a/.fluentci/.fluentci/src/gitlab/pipeline_test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import pipeline from "./pipeline.ts"; -import { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts"; - -Deno.test(function pipelineTest() { - const expected = Deno.readTextFileSync("./fixtures/.gitlab-ci.yml"); - const actual = pipeline.toString(); - assertEquals(actual, expected); -}); diff --git a/.fluentci/.github/workflows/ci.yml b/.fluentci/.github/workflows/ci.yml deleted file mode 100644 index b467bdb..0000000 --- a/.fluentci/.github/workflows/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -# Do not edit this file directly. It is generated by Fluent Github Actions - -name: Codecov -on: - push: - branches: - - main -jobs: - tests: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.37 - - name: Setup Fluent CI CLI - run: deno install -A -r https://cli.fluentci.io -n fluentci - - name: Setup Dagger - run: | - curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh - sudo mv bin/dagger /usr/local/bin - dagger version - - name: List Jobs - run: fluentci ls . - - name: Run Dagger Pipelines - run: dagger run fluentci . fmt lint test codecov - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/.fluentci/.gitignore b/.fluentci/.gitignore deleted file mode 100644 index a2442bb..0000000 --- a/.fluentci/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -coverage/ -coverage.lcov \ No newline at end of file diff --git a/.fluentci/.vscode/settings.json b/.fluentci/.vscode/settings.json deleted file mode 100644 index cbac569..0000000 --- a/.fluentci/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "deno.enable": true -} diff --git a/.fluentci/CODE_OF_CONDUCT.md b/.fluentci/CODE_OF_CONDUCT.md deleted file mode 100644 index e9c20f9..0000000 --- a/.fluentci/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,132 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -- Demonstrating empathy and kindness toward other people -- Being respectful of differing opinions, viewpoints, and experiences -- Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -- Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -- The use of sexualized language or imagery, and sexual attention or advances of - any kind -- Trolling, insulting or derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or email address, - without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -[GitHub Issues](https://github.com/fluent-ci-templates/deno-pipeline/issues). -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations diff --git a/.fluentci/CONTRIBUTING.md b/.fluentci/CONTRIBUTING.md deleted file mode 100644 index e50de72..0000000 --- a/.fluentci/CONTRIBUTING.md +++ /dev/null @@ -1,70 +0,0 @@ -# Contributing Guidelines - -Thank you for your interest in contributing to our project. Whether it's a bug -report, new feature, correction, or additional documentation, we greatly value -feedback and contributions from our community. - -Please read through this document before submitting any issues or pull requests -to ensure we have all the necessary information to effectively respond to your -bug report or contribution. - -## Reporting Bugs/Feature Requests - -We welcome you to use the GitHub issue tracker to report bugs or suggest -features. - -When filing an issue, please check existing open, or recently closed, issues to -make sure somebody else hasn't already reported the issue. Please try to include -as much information as you can. Details like these are incredibly useful: - -- A reproducible test case or series of steps -- The version of our code being used -- Any modifications you've made relevant to the bug -- Anything unusual about your environment or deployment - -## Contributing via Pull Requests - -Contributions via pull requests are much appreciated. Before sending us a pull -request, please ensure that: - -1. You are working against the latest source on the _master_ branch. -2. You check existing open, and recently merged, pull requests to make sure - someone else hasn't addressed the problem already. -3. You open an issue to discuss any significant work - we would hate for your - time to be wasted. - -To send us a pull request, please: - -1. Fork the repository. -2. Modify the source; please focus on the specific change you are contributing. - If you also reformat all the code, it will be hard for us to focus on your - change. -3. Ensure local tests pass. -4. Commit to your fork using clear commit messages. -5. Send us a pull request, answering any default questions in the pull request - interface. -6. Pay attention to any automated CI failures reported in the pull request, and - stay involved in the conversation. - -GitHub provides additional document on -[forking a repository](https://help.github.com/articles/fork-a-repo/) and -[creating a pull request](https://help.github.com/articles/creating-a-pull-request/). - -## Finding contributions to work on - -Looking at the existing issues is a great way to find something to contribute -on. As our projects, by default, use the default GitHub issue labels -(enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any -'help wanted' issues is a great place to start. - -## Code of Conduct - -This project has adopted the -[Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, -available at -https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. - -## Licensing - -See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to -confirm the licensing of your contribution. diff --git a/.fluentci/LICENSE b/.fluentci/LICENSE deleted file mode 100644 index d9ab36a..0000000 --- a/.fluentci/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2023 Tsiry Sandratraina - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/.fluentci/README.md b/.fluentci/README.md deleted file mode 100644 index b8517c1..0000000 --- a/.fluentci/README.md +++ /dev/null @@ -1,69 +0,0 @@ -# Deno Pipeline - -[![deno module](https://shield.deno.dev/x/deno_pipeline)](https://deno.land/x/deno_pipeline) -![deno compatibility](https://shield.deno.dev/deno/^1.34) -[![](https://img.shields.io/codecov/c/gh/fluent-ci-templates/deno-pipeline)](https://codecov.io/gh/fluent-ci-templates/deno-pipeline) - -A ready-to-use CI/CD Pipeline for your Deno projects. - -## ๐Ÿš€ Usage - -Run the following command: - -```bash -dagger run fluentci deno_pipeline -``` - -Or, if you want to use it as a template: - -```bash -fluentci init -t deno -``` - -This will create a `.fluentci` folder in your project. - -Now you can run the pipeline with: - -```bash -dagger run fluentci . -``` - -## Environment variables (Deno Deploy) - -| Variable | Description | Default | -| ----------------- | ------------------------- | ---------- | -| DENO_PROJECT | Your project name | | -| NO_STATIC | Disable static assets | `false` | -| EXCLUDE | Exclude files from deploy | | -| DENO_DEPLOY_TOKEN | Your Deno Deploy token | | -| DENO_MAIN_SCRIPT | Your main script | `main.tsx` | - -## Jobs - -| Job | Description | Options | -| ------ | ------------------------------ | ---------------------- | -| fmt | Format your code | | -| lint | Lint your code | | -| test | Run your tests | `{ ignore: string[] }` | -| deploy | Deploy your app to Deno Deploy | | - -## Programmatic usage - -You can also use this pipeline programmatically: - -```ts -import { Client, connect } from "https://esm.sh/@dagger.io/dagger@0.8.1"; -import { Dagger } from "https://deno.land/x/deno_pipeline/mod.ts"; - -const { fmt, lint, test } = Dagger; - -function pipeline(src = ".") { - connect(async (client: Client) => { - await fmt(client, src); - await lint(client, src); - await test(client, src); - }); -} - -pipeline(); -``` diff --git a/.fluentci/ci.ts b/.fluentci/ci.ts deleted file mode 100644 index 67e5a80..0000000 --- a/.fluentci/ci.ts +++ /dev/null @@ -1,12 +0,0 @@ -const command = new Deno.Command(Deno.execPath(), { - args: [ - "run", - "-A", - "--import-map=https://deno.land/x/deno_pipeline/import_map.json", - "https://deno.land/x/deno_pipeline/src/dagger/runner.ts", - ], -}); - -const { stdout } = await command.output(); - -console.log(new TextDecoder().decode(stdout)); diff --git a/.fluentci/deno.json b/.fluentci/deno.json deleted file mode 100644 index 4240219..0000000 --- a/.fluentci/deno.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "importMap": "import_map.json", - "tasks": { - "esm:add": "deno run -A https://esm.sh/v128 add", - "esm:update": "deno run -A https://esm.sh/v128 update", - "esm:remove": "deno run -A https://esm.sh/v128 remove", - "ci:dagger": "dagger run deno run -A src/dagger/runner.ts" - } -} diff --git a/.fluentci/deno.lock b/.fluentci/deno.lock deleted file mode 100644 index e6af1f4..0000000 --- a/.fluentci/deno.lock +++ /dev/null @@ -1,68 +0,0 @@ -{ - "version": "3", - "remote": { - "https://deno.land/std@0.150.0/media_types/_util.ts": "ce9b4fc4ba1c447dafab619055e20fd88236ca6bdd7834a21f98bd193c3fbfa1", - "https://deno.land/std@0.150.0/media_types/mod.ts": "2d4b6f32a087029272dc59e0a55ae3cc4d1b27b794ccf528e94b1925795b3118", - "https://deno.land/std@0.150.0/media_types/vendor/mime-db.v1.52.0.ts": "724cee25fa40f1a52d3937d6b4fbbfdd7791ff55e1b7ac08d9319d5632c7f5af", - "https://deno.land/std@0.191.0/fmt/colors.ts": "d67e3cd9f472535241a8e410d33423980bec45047e343577554d3356e1f0ef4e", - "https://deno.land/x/codecov_pipeline@v0.1.1/src/dagger/jobs.ts": "ea5ea4fb985f879fdd1c0aed77ac635ba090606c1ecce9d5f5c107493d287984", - "https://deno.land/x/nix_installer_pipeline@v0.3.6/src/dagger/steps.ts": "a34aea3753c7079de5877f592ce31f30d05d552155729ff3e695d77326405133", - "https://deno.land/x/xhr@0.3.0/mod.ts": "094aacd627fd9635cd942053bf8032b5223b909858fa9dc8ffa583752ff63b20", - "https://esm.sh/stringify-tree@1.1.1": "a0515b0f4fe97a6972047a588b7982592d9079e7aeac3323b0d26448a757cf84", - "https://esm.sh/v128/*@dagger.io/dagger@0.6.3": "cb691a77c0cdaee22f2b8393731b5143c83ce22dbbea204cdbfd203768d15b64", - "https://esm.sh/v128/@dagger.io/dagger@0.6.3/X-ZS8q/denonext/dagger.mjs": "fd0901784d75b99615b5409c3654b5c7edfc5ba377c9e1a5a67ffff4f7d3ac32", - "https://esm.sh/v128/adm-zip@0.5.10": "d9c54d6d2dd788462781a57d923295bd79304e6fd74b242fd4b30e35b39c5dcf", - "https://esm.sh/v128/adm-zip@0.5.10/denonext/adm-zip.mjs": "07a9731547905e0ca55ae917e1969d7f6d04fb3773f906ce3306891337eb4849", - "https://esm.sh/v128/chownr@2.0.0/denonext/chownr.mjs": "30b8f17084dfbe475a5052b615f706b06ddd17dca0535103340d485c6b94e952", - "https://esm.sh/v128/cross-fetch@3.1.8/denonext/cross-fetch.mjs": "8fba9e7c3fbaf0d2168beb63ce0cd21b5bfbfbd77e2fcbf8d957d533a71222f6", - "https://esm.sh/v128/cross-spawn@7.0.3/denonext/cross-spawn.mjs": "0569a26e7ad4b3376516cbc9b1942e10961a58030eadcea8c848e6b956eb355c", - "https://esm.sh/v128/data-uri-to-buffer@4.0.1/denonext/data-uri-to-buffer.mjs": "70ef987b1da58391495ecfad9888d996469224faf3cd996d81dc2e059feb9f31", - "https://esm.sh/v128/env-paths@3.0.0": "8400fb23319be9b30d7b40d1c865541c5b3c7726cdf9b74000bc0f1678d52ecf", - "https://esm.sh/v128/env-paths@3.0.0/denonext/env-paths.mjs": "77984a05eb16450087f25060a070ed500ec546719d471143e16d976ca73ca956", - "https://esm.sh/v128/execa@7.1.1": "a40c7030df81ab0847a5d844f4c5c6420af973dff05fef88e53cbb9b8667fdc2", - "https://esm.sh/v128/execa@7.1.1/denonext/execa.mjs": "9d5943544c0df3761b52f2c095f89a03ca6c028d818a8f0475ff883b0408f154", - "https://esm.sh/v128/fetch-blob@3.2.0/denonext/fetch-blob.mjs": "0531568b36c0f6db3e9825fbb2d08dee51100eb675c2bf1d98d6971a92010721", - "https://esm.sh/v128/fetch-blob@3.2.0/denonext/file.js": "fd82828163a4e7bdc15190d8c3dbfd92f93274d05bd7f7f5ab81093e3ad7e9c2", - "https://esm.sh/v128/fetch-blob@3.2.0/denonext/from.js": "7d3258c7960755497f90879806f0b815d5e564c2ac1523238af5cb9552ff5c45", - "https://esm.sh/v128/formdata-polyfill@4.0.10/denonext/esm.min.js": "b6d65a204e81eca699d9eb6f867e9efffa42db39a8f161690915a89e5eb1766f", - "https://esm.sh/v128/fs-minipass@2.1.0/denonext/fs-minipass.mjs": "74b00283d556b281bdfd6a669576d852f2c43702043c411985f8f8188d208c5d", - "https://esm.sh/v128/get-stream@6.0.1/denonext/get-stream.mjs": "a947a16f8cb3052fd654a84f8b36b40ce96b6a5acfb3ad4ab69d814bcf3351fb", - "https://esm.sh/v128/graphql-request@6.1.0": "17f00c323eb825811ce14e2b0e88a0c873acb666c382ac963d1edeb03e01f372", - "https://esm.sh/v128/graphql-request@6.1.0/denonext/graphql-request.mjs": "0b15f49d44489423ae6f06004725b6d050b6359da4969e6569bd6ad45065bd94", - "https://esm.sh/v128/graphql-tag@2.12.6": "5bfa27da9c9918fb52a01b8579891e804e0365d91118df1f2e0957a72dacdc39", - "https://esm.sh/v128/graphql-tag@2.12.6/denonext/graphql-tag.mjs": "331d09949efc4ac60c84a69b52a7da8b333210493900e54953ae4604c9874527", - "https://esm.sh/v128/graphql@16.7.1/denonext/graphql.mjs": "418ad7c07b0f2d687f33b6275d3b5f317f4afbef1f462f318229f458dff45416", - "https://esm.sh/v128/human-signals@4.3.1/denonext/human-signals.mjs": "3889110cedd907804443d018cffe0a1d892d5e7467661376caf967feff55cbe9", - "https://esm.sh/v128/is-stream@3.0.0/denonext/is-stream.mjs": "5c8b65f2fa051c4b18e88bbae11dac8bba9caf57752577d69bcea86d1f05c5b7", - "https://esm.sh/v128/isexe@2.0.0/denonext/isexe.mjs": "3cfefd270d1bfdfb864ee98dbb8f41d150cbf480925158f4a8f0ade8a9e17d6c", - "https://esm.sh/v128/merge-stream@2.0.0/denonext/merge-stream.mjs": "2c2af22401c294158d6bff659d157e3d2c028c218cc1bd2246534a45a4c03c61", - "https://esm.sh/v128/mimic-fn@4.0.0/denonext/mimic-fn.mjs": "10bcf0f2f20cbbba0c289ef7bf4d2422639bbc1c36c247be876afd6fe2d67138", - "https://esm.sh/v128/minipass@3.3.6/denonext/minipass.mjs": "59bbe430514455e78cb30c389b21af66efb2bf010cda071820a17d8c76d0d1cf", - "https://esm.sh/v128/minipass@5.0.0/denonext/minipass.mjs": "de0e049728f8c387b58c86439eb9d69a16b6a88756a6bc694e2fecbd7fd00401", - "https://esm.sh/v128/minizlib@2.1.2/denonext/minizlib.mjs": "0d919b6a0c60d5a31e14d748ff9d62aeae2923b604bcc6a22f90fa4bbd400d68", - "https://esm.sh/v128/mkdirp@1.0.4/denonext/mkdirp.mjs": "ee129b32e55dd8bede6b1bbd1978f7775fa5e2720d5a7ae07bf1e8c99abd77c7", - "https://esm.sh/v128/node-color-log@10.0.2": "05a277987c64153af1252167135076155fdc6b39ca260b2bdc39750da12d2a2d", - "https://esm.sh/v128/node-color-log@10.0.2/denonext/node-color-log.mjs": "2504391bd0ce1dd4c2bf0ed0b839b8a3ad84c028d9dd17cc58dccd2e14dacfde", - "https://esm.sh/v128/node-domexception@1.0.0/denonext/node-domexception.mjs": "bb35ba54c1a2b35870618876c0c96310a28ae58aecff33c8eed58a582e270ff4", - "https://esm.sh/v128/node-fetch@3.3.1": "916dcee177a69fb0e46970c528cb66fcd4973488f861844c0a235bfc645b0506", - "https://esm.sh/v128/node-fetch@3.3.1/denonext/node-fetch.mjs": "dc3a8f1f2fc9eb26d0d33e49f3750acc265d51a1a54bbd670c5d9f640b633a93", - "https://esm.sh/v128/node-fetch@3.3.1/denonext/src/utils/multipart-parser.js": "713b1b8cbafc4bfb7358debeb35d507e0d2328f0a28b8a2a7d79a3e5e4f5e5b8", - "https://esm.sh/v128/npm-run-path@5.1.0/denonext/npm-run-path.mjs": "3540b8c2dd1430f10d580f323f3a51aa30094da27a9220cce03ce69884b163bb", - "https://esm.sh/v128/onetime@6.0.0/denonext/onetime.mjs": "6e362222575d815f37fb813168d7069dd6a0f6bb6f972ed54d1bccb0f9fb3e1b", - "https://esm.sh/v128/original-fs@1.2.0/denonext/original-fs.mjs": "2b1098818e54d2c6748ff5b0dd9ea5f6a61b4b6d0f63fb625f21773d11cfc667", - "https://esm.sh/v128/path-key@3.1.1/denonext/path-key.mjs": "add83c631278b7df9b33ae84e41142db88bb291295bcc27eb4e77a1cbdfa71d0", - "https://esm.sh/v128/path-key@4.0.0/denonext/path-key.mjs": "2c2e3922bd0e6e414fa2752ff800bdc6b9208035ce797fa22e49b859f8259417", - "https://esm.sh/v128/shebang-command@2.0.0/denonext/shebang-command.mjs": "404e0fb09a782ca9495d53c721bb84b673b7b2e1054e021852143a6b91ca0e4f", - "https://esm.sh/v128/shebang-regex@3.0.0/denonext/shebang-regex.mjs": "03983ba59dd2cba9402935e21b46d05f5249364cba9f5757aef23c6c2fea65b9", - "https://esm.sh/v128/signal-exit@3.0.7/denonext/signal-exit.mjs": "2a176e5f9b351fa8057213c627a1503d63bf308b64447ef47f1ca6fbb2a91c81", - "https://esm.sh/v128/strip-final-newline@3.0.0/denonext/strip-final-newline.mjs": "03d9be4e8a249d63cbbddeb2fb675a1bbbcb335283e604d4ce56c88c90e6f102", - "https://esm.sh/v128/tar@6.1.15": "0460339f8aba5f287e8bebe258fe3fe13cb12f85820693f25724f0d98ef1258e", - "https://esm.sh/v128/tar@6.1.15/denonext/tar.mjs": "6194d892de8457b3b1f11d5cbacda1d540b453b45e8cb9f5f610abfb3e490b65", - "https://esm.sh/v128/tslib@2.6.0/denonext/tslib.mjs": "2215292e6fcf28a7a081eee911f127bb3c44cdd61ff0651e3e384d7a49b4e42b", - "https://esm.sh/v128/web-streams-polyfill@3.2.1/denonext/dist/ponyfill.es2018.js": "a2edb52a93494cda06386b3d6a168016b366e78f02c5eff1f94a0240be12ac96", - "https://esm.sh/v128/which@2.0.2/denonext/which.mjs": "86bf76e4937edb7fa3464d7bb9a426ef273684d1cefbec5ba5f1bdcb5cafff91", - "https://esm.sh/v128/yallist@4.0.0/denonext/yallist.mjs": "61f180d807dda50bac17028eda05d5722a3fecef6e98a9064e2353ea6864fd82", - "https://esm.sh/v132/lodash.flatten@4.4.0/denonext/lodash.flatten.mjs": "8e86ab607deea15cc3c1acfb5eae278ecbc5b80f24167b4e8f4c56df3278cd55", - "https://esm.sh/v132/stringify-tree@1.1.1/denonext/stringify-tree.mjs": "eaa9333a5219638ad170d12e12603ae00ae80fc8bf02cc112cfec7294e6bcb43" - } -} diff --git a/.fluentci/example/.fluentci/.devcontainer/devcontainer.json b/.fluentci/example/.fluentci/.devcontainer/devcontainer.json deleted file mode 100644 index 39a38ae..0000000 --- a/.fluentci/example/.fluentci/.devcontainer/devcontainer.json +++ /dev/null @@ -1,25 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/debian -{ - "name": "Debian", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/base:bullseye", - "features": { - "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/nix:1": {} - }, - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "nix develop --experimental-features \"nix-command flakes\"" - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} diff --git a/.fluentci/example/.fluentci/.fluentci/.devcontainer/devcontainer.json b/.fluentci/example/.fluentci/.fluentci/.devcontainer/devcontainer.json deleted file mode 100644 index 39a38ae..0000000 --- a/.fluentci/example/.fluentci/.fluentci/.devcontainer/devcontainer.json +++ /dev/null @@ -1,25 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/debian -{ - "name": "Debian", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/base:bullseye", - "features": { - "ghcr.io/devcontainers/features/github-cli:1": {}, - "ghcr.io/devcontainers/features/nix:1": {} - }, - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "nix develop --experimental-features \"nix-command flakes\"" - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" -} diff --git a/.fluentci/example/.fluentci/.fluentci/.github/workflows/ci.yml b/.fluentci/example/.fluentci/.fluentci/.github/workflows/ci.yml deleted file mode 100644 index a7f9464..0000000 --- a/.fluentci/example/.fluentci/.fluentci/.github/workflows/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Codecov - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.34 - - name: Create coverage files - run: deno test --allow-read --coverage=coverage --lock-write # create coverage files - - name: Create coverage report - run: deno coverage ./coverage --lcov > coverage.lcov # create coverage report - - name: Collect coverage - uses: codecov/codecov-action@v3 # upload the report on Codecov - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - file: ./coverage.lcov diff --git a/.fluentci/example/.fluentci/.fluentci/.vscode/settings.json b/.fluentci/example/.fluentci/.fluentci/.vscode/settings.json deleted file mode 100644 index cbac569..0000000 --- a/.fluentci/example/.fluentci/.fluentci/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "deno.enable": true -} diff --git a/.fluentci/example/.fluentci/.fluentci/CODE_OF_CONDUCT.md b/.fluentci/example/.fluentci/.fluentci/CODE_OF_CONDUCT.md deleted file mode 100644 index e9c20f9..0000000 --- a/.fluentci/example/.fluentci/.fluentci/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,132 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -- Demonstrating empathy and kindness toward other people -- Being respectful of differing opinions, viewpoints, and experiences -- Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -- Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -- The use of sexualized language or imagery, and sexual attention or advances of - any kind -- Trolling, insulting or derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or email address, - without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -[GitHub Issues](https://github.com/fluent-ci-templates/deno-pipeline/issues). -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations diff --git a/.fluentci/example/.fluentci/.fluentci/CONTRIBUTING.md b/.fluentci/example/.fluentci/.fluentci/CONTRIBUTING.md deleted file mode 100644 index e50de72..0000000 --- a/.fluentci/example/.fluentci/.fluentci/CONTRIBUTING.md +++ /dev/null @@ -1,70 +0,0 @@ -# Contributing Guidelines - -Thank you for your interest in contributing to our project. Whether it's a bug -report, new feature, correction, or additional documentation, we greatly value -feedback and contributions from our community. - -Please read through this document before submitting any issues or pull requests -to ensure we have all the necessary information to effectively respond to your -bug report or contribution. - -## Reporting Bugs/Feature Requests - -We welcome you to use the GitHub issue tracker to report bugs or suggest -features. - -When filing an issue, please check existing open, or recently closed, issues to -make sure somebody else hasn't already reported the issue. Please try to include -as much information as you can. Details like these are incredibly useful: - -- A reproducible test case or series of steps -- The version of our code being used -- Any modifications you've made relevant to the bug -- Anything unusual about your environment or deployment - -## Contributing via Pull Requests - -Contributions via pull requests are much appreciated. Before sending us a pull -request, please ensure that: - -1. You are working against the latest source on the _master_ branch. -2. You check existing open, and recently merged, pull requests to make sure - someone else hasn't addressed the problem already. -3. You open an issue to discuss any significant work - we would hate for your - time to be wasted. - -To send us a pull request, please: - -1. Fork the repository. -2. Modify the source; please focus on the specific change you are contributing. - If you also reformat all the code, it will be hard for us to focus on your - change. -3. Ensure local tests pass. -4. Commit to your fork using clear commit messages. -5. Send us a pull request, answering any default questions in the pull request - interface. -6. Pay attention to any automated CI failures reported in the pull request, and - stay involved in the conversation. - -GitHub provides additional document on -[forking a repository](https://help.github.com/articles/fork-a-repo/) and -[creating a pull request](https://help.github.com/articles/creating-a-pull-request/). - -## Finding contributions to work on - -Looking at the existing issues is a great way to find something to contribute -on. As our projects, by default, use the default GitHub issue labels -(enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any -'help wanted' issues is a great place to start. - -## Code of Conduct - -This project has adopted the -[Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, -available at -https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. - -## Licensing - -See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to -confirm the licensing of your contribution. diff --git a/.fluentci/example/.fluentci/.fluentci/LICENSE b/.fluentci/example/.fluentci/.fluentci/LICENSE deleted file mode 100644 index d9ab36a..0000000 --- a/.fluentci/example/.fluentci/.fluentci/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2023 Tsiry Sandratraina - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/.fluentci/example/.fluentci/.fluentci/README.md b/.fluentci/example/.fluentci/.fluentci/README.md deleted file mode 100644 index 23f6a94..0000000 --- a/.fluentci/example/.fluentci/.fluentci/README.md +++ /dev/null @@ -1,88 +0,0 @@ -# Deno Pipeline - -[![deno module](https://shield.deno.dev/x/deno_pipeline)](https://deno.land/x/deno_pipeline) -![deno compatibility](https://shield.deno.dev/deno/^1.34) -[![](https://img.shields.io/codecov/c/gh/fluent-ci-templates/deno-pipeline)](https://codecov.io/gh/fluent-ci-templates/deno-pipeline) - -A ready-to-use GitLab CI Pipeline and Jobs for your Deno projects. - -## ๐Ÿš€ Usage - -Quick start: - -```ts -import { GitLab } from "https://deno.land/x/deno_pipeline/mod.ts"; - -const { pipeline } = GitLab; - -pipeline.write(); // Write the pipeline to the file .gitlab-ci.yml -``` - -Or, if you want to use the predefined jobs: - -```ts -import { GitlabCI } from "https://deno.land/x/fluent_gitlab_ci/mod.ts"; -import { GitLab } from "https://deno.land/x/deno_pipeline/mod.ts"; - -const { fmt, lint, test } = GitLab; - -const const pipeline = new GitlabCI() - .image("denoland/deno:alpine") - .addJob("fmt", fmt) - .addJob("lint", lint) - .addJob("test", test); - -pipeline.write(); // Write the pipeline to the file .gitlab-ci.yml -``` - -It will generate the following `.gitlab-ci.yml` file: - -```yaml -# Do not edit this file directly. It is generated by Fluent GitLab CI - -image: denoland/deno:alpine - -fmt: - image: denoland/deno:alpine - script: - - deno fmt --check - -lint: - image: denoland/deno:alpine - script: - - deno lint - -test: - image: denoland/deno:alpine - script: - - deno test -``` - -## ๐Ÿงช Advanced Usage - -This package also provides a ready-to-use pipeline for -[Dagger](https://dagger.io/), just run the following command on your Deno -project: - -```sh -dagger run deno run -A https://deno.land/x/deno_pipeline/ci.ts -``` - -Or, if you want to use the predefined jobs: - -```ts -import Client, { connect } from "@dagger.io/dagger"; -import { Dagger } from "https://deno.land/x/deno_pipeline/mod.ts"; - -const { fmt, lint, test } = Dagger; - -function pipeline(src = ".") { - connect(async (client: Client) => { - await fmt(client, src); - await lint(client, src); - await test(client, src); - }); -} - -pipeline(); -``` diff --git a/.fluentci/example/.fluentci/.fluentci/ci.ts b/.fluentci/example/.fluentci/.fluentci/ci.ts deleted file mode 100644 index 67e5a80..0000000 --- a/.fluentci/example/.fluentci/.fluentci/ci.ts +++ /dev/null @@ -1,12 +0,0 @@ -const command = new Deno.Command(Deno.execPath(), { - args: [ - "run", - "-A", - "--import-map=https://deno.land/x/deno_pipeline/import_map.json", - "https://deno.land/x/deno_pipeline/src/dagger/runner.ts", - ], -}); - -const { stdout } = await command.output(); - -console.log(new TextDecoder().decode(stdout)); diff --git a/.fluentci/example/.fluentci/.fluentci/deno.json b/.fluentci/example/.fluentci/.fluentci/deno.json deleted file mode 100644 index 4240219..0000000 --- a/.fluentci/example/.fluentci/.fluentci/deno.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "importMap": "import_map.json", - "tasks": { - "esm:add": "deno run -A https://esm.sh/v128 add", - "esm:update": "deno run -A https://esm.sh/v128 update", - "esm:remove": "deno run -A https://esm.sh/v128 remove", - "ci:dagger": "dagger run deno run -A src/dagger/runner.ts" - } -} diff --git a/.fluentci/example/.fluentci/.fluentci/deno.lock b/.fluentci/example/.fluentci/.fluentci/deno.lock deleted file mode 100644 index 23cc878..0000000 --- a/.fluentci/example/.fluentci/.fluentci/deno.lock +++ /dev/null @@ -1,66 +0,0 @@ -{ - "version": "2", - "remote": { - "https://deno.land/std@0.150.0/media_types/_util.ts": "ce9b4fc4ba1c447dafab619055e20fd88236ca6bdd7834a21f98bd193c3fbfa1", - "https://deno.land/std@0.150.0/media_types/mod.ts": "2d4b6f32a087029272dc59e0a55ae3cc4d1b27b794ccf528e94b1925795b3118", - "https://deno.land/std@0.150.0/media_types/vendor/mime-db.v1.52.0.ts": "724cee25fa40f1a52d3937d6b4fbbfdd7791ff55e1b7ac08d9319d5632c7f5af", - "https://deno.land/std@0.191.0/fmt/colors.ts": "d67e3cd9f472535241a8e410d33423980bec45047e343577554d3356e1f0ef4e", - "https://deno.land/x/xhr@0.3.0/mod.ts": "094aacd627fd9635cd942053bf8032b5223b909858fa9dc8ffa583752ff63b20", - "https://esm.sh/stringify-tree@1.1.1": "8d994a105481fa944515323d89bd2596c1de79f3d9bd1386266463934716eca0", - "https://esm.sh/v128/*@dagger.io/dagger@0.6.3": "cb691a77c0cdaee22f2b8393731b5143c83ce22dbbea204cdbfd203768d15b64", - "https://esm.sh/v128/@dagger.io/dagger@0.6.3/X-ZS8q/denonext/dagger.mjs": "fd0901784d75b99615b5409c3654b5c7edfc5ba377c9e1a5a67ffff4f7d3ac32", - "https://esm.sh/v128/adm-zip@0.5.10": "d9c54d6d2dd788462781a57d923295bd79304e6fd74b242fd4b30e35b39c5dcf", - "https://esm.sh/v128/adm-zip@0.5.10/denonext/adm-zip.mjs": "07a9731547905e0ca55ae917e1969d7f6d04fb3773f906ce3306891337eb4849", - "https://esm.sh/v128/chownr@2.0.0/denonext/chownr.mjs": "30b8f17084dfbe475a5052b615f706b06ddd17dca0535103340d485c6b94e952", - "https://esm.sh/v128/cross-fetch@3.1.8/denonext/cross-fetch.mjs": "8fba9e7c3fbaf0d2168beb63ce0cd21b5bfbfbd77e2fcbf8d957d533a71222f6", - "https://esm.sh/v128/cross-spawn@7.0.3/denonext/cross-spawn.mjs": "0569a26e7ad4b3376516cbc9b1942e10961a58030eadcea8c848e6b956eb355c", - "https://esm.sh/v128/data-uri-to-buffer@4.0.1/denonext/data-uri-to-buffer.mjs": "70ef987b1da58391495ecfad9888d996469224faf3cd996d81dc2e059feb9f31", - "https://esm.sh/v128/env-paths@3.0.0": "8400fb23319be9b30d7b40d1c865541c5b3c7726cdf9b74000bc0f1678d52ecf", - "https://esm.sh/v128/env-paths@3.0.0/denonext/env-paths.mjs": "77984a05eb16450087f25060a070ed500ec546719d471143e16d976ca73ca956", - "https://esm.sh/v128/execa@7.1.1": "a40c7030df81ab0847a5d844f4c5c6420af973dff05fef88e53cbb9b8667fdc2", - "https://esm.sh/v128/execa@7.1.1/denonext/execa.mjs": "9d5943544c0df3761b52f2c095f89a03ca6c028d818a8f0475ff883b0408f154", - "https://esm.sh/v128/fetch-blob@3.2.0/denonext/fetch-blob.mjs": "0531568b36c0f6db3e9825fbb2d08dee51100eb675c2bf1d98d6971a92010721", - "https://esm.sh/v128/fetch-blob@3.2.0/denonext/file.js": "fd82828163a4e7bdc15190d8c3dbfd92f93274d05bd7f7f5ab81093e3ad7e9c2", - "https://esm.sh/v128/fetch-blob@3.2.0/denonext/from.js": "7d3258c7960755497f90879806f0b815d5e564c2ac1523238af5cb9552ff5c45", - "https://esm.sh/v128/formdata-polyfill@4.0.10/denonext/esm.min.js": "b6d65a204e81eca699d9eb6f867e9efffa42db39a8f161690915a89e5eb1766f", - "https://esm.sh/v128/fs-minipass@2.1.0/denonext/fs-minipass.mjs": "74b00283d556b281bdfd6a669576d852f2c43702043c411985f8f8188d208c5d", - "https://esm.sh/v128/get-stream@6.0.1/denonext/get-stream.mjs": "a947a16f8cb3052fd654a84f8b36b40ce96b6a5acfb3ad4ab69d814bcf3351fb", - "https://esm.sh/v128/graphql-request@6.1.0": "17f00c323eb825811ce14e2b0e88a0c873acb666c382ac963d1edeb03e01f372", - "https://esm.sh/v128/graphql-request@6.1.0/denonext/graphql-request.mjs": "0b15f49d44489423ae6f06004725b6d050b6359da4969e6569bd6ad45065bd94", - "https://esm.sh/v128/graphql-tag@2.12.6": "5bfa27da9c9918fb52a01b8579891e804e0365d91118df1f2e0957a72dacdc39", - "https://esm.sh/v128/graphql-tag@2.12.6/denonext/graphql-tag.mjs": "331d09949efc4ac60c84a69b52a7da8b333210493900e54953ae4604c9874527", - "https://esm.sh/v128/graphql@16.7.1/denonext/graphql.mjs": "418ad7c07b0f2d687f33b6275d3b5f317f4afbef1f462f318229f458dff45416", - "https://esm.sh/v128/human-signals@4.3.1/denonext/human-signals.mjs": "3889110cedd907804443d018cffe0a1d892d5e7467661376caf967feff55cbe9", - "https://esm.sh/v128/is-stream@3.0.0/denonext/is-stream.mjs": "5c8b65f2fa051c4b18e88bbae11dac8bba9caf57752577d69bcea86d1f05c5b7", - "https://esm.sh/v128/isexe@2.0.0/denonext/isexe.mjs": "3cfefd270d1bfdfb864ee98dbb8f41d150cbf480925158f4a8f0ade8a9e17d6c", - "https://esm.sh/v128/merge-stream@2.0.0/denonext/merge-stream.mjs": "2c2af22401c294158d6bff659d157e3d2c028c218cc1bd2246534a45a4c03c61", - "https://esm.sh/v128/mimic-fn@4.0.0/denonext/mimic-fn.mjs": "10bcf0f2f20cbbba0c289ef7bf4d2422639bbc1c36c247be876afd6fe2d67138", - "https://esm.sh/v128/minipass@3.3.6/denonext/minipass.mjs": "59bbe430514455e78cb30c389b21af66efb2bf010cda071820a17d8c76d0d1cf", - "https://esm.sh/v128/minipass@5.0.0/denonext/minipass.mjs": "de0e049728f8c387b58c86439eb9d69a16b6a88756a6bc694e2fecbd7fd00401", - "https://esm.sh/v128/minizlib@2.1.2/denonext/minizlib.mjs": "0d919b6a0c60d5a31e14d748ff9d62aeae2923b604bcc6a22f90fa4bbd400d68", - "https://esm.sh/v128/mkdirp@1.0.4/denonext/mkdirp.mjs": "ee129b32e55dd8bede6b1bbd1978f7775fa5e2720d5a7ae07bf1e8c99abd77c7", - "https://esm.sh/v128/node-color-log@10.0.2": "05a277987c64153af1252167135076155fdc6b39ca260b2bdc39750da12d2a2d", - "https://esm.sh/v128/node-color-log@10.0.2/denonext/node-color-log.mjs": "2504391bd0ce1dd4c2bf0ed0b839b8a3ad84c028d9dd17cc58dccd2e14dacfde", - "https://esm.sh/v128/node-domexception@1.0.0/denonext/node-domexception.mjs": "bb35ba54c1a2b35870618876c0c96310a28ae58aecff33c8eed58a582e270ff4", - "https://esm.sh/v128/node-fetch@3.3.1": "916dcee177a69fb0e46970c528cb66fcd4973488f861844c0a235bfc645b0506", - "https://esm.sh/v128/node-fetch@3.3.1/denonext/node-fetch.mjs": "dc3a8f1f2fc9eb26d0d33e49f3750acc265d51a1a54bbd670c5d9f640b633a93", - "https://esm.sh/v128/node-fetch@3.3.1/denonext/src/utils/multipart-parser.js": "713b1b8cbafc4bfb7358debeb35d507e0d2328f0a28b8a2a7d79a3e5e4f5e5b8", - "https://esm.sh/v128/npm-run-path@5.1.0/denonext/npm-run-path.mjs": "3540b8c2dd1430f10d580f323f3a51aa30094da27a9220cce03ce69884b163bb", - "https://esm.sh/v128/onetime@6.0.0/denonext/onetime.mjs": "6e362222575d815f37fb813168d7069dd6a0f6bb6f972ed54d1bccb0f9fb3e1b", - "https://esm.sh/v128/original-fs@1.2.0/denonext/original-fs.mjs": "2b1098818e54d2c6748ff5b0dd9ea5f6a61b4b6d0f63fb625f21773d11cfc667", - "https://esm.sh/v128/path-key@3.1.1/denonext/path-key.mjs": "add83c631278b7df9b33ae84e41142db88bb291295bcc27eb4e77a1cbdfa71d0", - "https://esm.sh/v128/path-key@4.0.0/denonext/path-key.mjs": "2c2e3922bd0e6e414fa2752ff800bdc6b9208035ce797fa22e49b859f8259417", - "https://esm.sh/v128/shebang-command@2.0.0/denonext/shebang-command.mjs": "404e0fb09a782ca9495d53c721bb84b673b7b2e1054e021852143a6b91ca0e4f", - "https://esm.sh/v128/shebang-regex@3.0.0/denonext/shebang-regex.mjs": "03983ba59dd2cba9402935e21b46d05f5249364cba9f5757aef23c6c2fea65b9", - "https://esm.sh/v128/signal-exit@3.0.7/denonext/signal-exit.mjs": "2a176e5f9b351fa8057213c627a1503d63bf308b64447ef47f1ca6fbb2a91c81", - "https://esm.sh/v128/strip-final-newline@3.0.0/denonext/strip-final-newline.mjs": "03d9be4e8a249d63cbbddeb2fb675a1bbbcb335283e604d4ce56c88c90e6f102", - "https://esm.sh/v128/tar@6.1.15": "0460339f8aba5f287e8bebe258fe3fe13cb12f85820693f25724f0d98ef1258e", - "https://esm.sh/v128/tar@6.1.15/denonext/tar.mjs": "6194d892de8457b3b1f11d5cbacda1d540b453b45e8cb9f5f610abfb3e490b65", - "https://esm.sh/v128/tslib@2.6.0/denonext/tslib.mjs": "2215292e6fcf28a7a081eee911f127bb3c44cdd61ff0651e3e384d7a49b4e42b", - "https://esm.sh/v128/web-streams-polyfill@3.2.1/denonext/dist/ponyfill.es2018.js": "a2edb52a93494cda06386b3d6a168016b366e78f02c5eff1f94a0240be12ac96", - "https://esm.sh/v128/which@2.0.2/denonext/which.mjs": "86bf76e4937edb7fa3464d7bb9a426ef273684d1cefbec5ba5f1bdcb5cafff91", - "https://esm.sh/v128/yallist@4.0.0/denonext/yallist.mjs": "61f180d807dda50bac17028eda05d5722a3fecef6e98a9064e2353ea6864fd82", - "https://esm.sh/v130/lodash.flatten@4.4.0/denonext/lodash.flatten.mjs": "8e86ab607deea15cc3c1acfb5eae278ecbc5b80f24167b4e8f4c56df3278cd55", - "https://esm.sh/v130/stringify-tree@1.1.1/denonext/stringify-tree.mjs": "40a9d40e0282b5432302a3da68b88aa11685bc0b8a0b70246168deed5c5773fe" - } -} diff --git a/.fluentci/example/.fluentci/.fluentci/fixtures/.gitlab-ci.yml b/.fluentci/example/.fluentci/.fluentci/fixtures/.gitlab-ci.yml deleted file mode 100644 index 299e4c6..0000000 --- a/.fluentci/example/.fluentci/.fluentci/fixtures/.gitlab-ci.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Do not edit this file directly. It is generated by Fluent GitLab CI - -image: denoland/deno:alpine - -fmt: - image: denoland/deno:alpine - script: - - deno fmt --check - -lint: - image: denoland/deno:alpine - script: - - deno lint - -test: - image: denoland/deno:alpine - script: - - deno test - diff --git a/.fluentci/example/.fluentci/.fluentci/flake.lock b/.fluentci/example/.fluentci/.fluentci/flake.lock deleted file mode 100644 index af7453c..0000000 --- a/.fluentci/example/.fluentci/.fluentci/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1687709756, - "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1688910226, - "narHash": "sha256-kLTsFu9CAU2Gb288JhIBN/WlX4UUUDz4WiC/U59nvwk=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "2540432a940aee979be6ccfefba9ea0652c273a0", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "release-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/.fluentci/example/.fluentci/.fluentci/flake.nix b/.fluentci/example/.fluentci/.fluentci/flake.nix deleted file mode 100644 index b13ea7d..0000000 --- a/.fluentci/example/.fluentci/.fluentci/flake.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - description = "A Nix-flake-based Deno development environment"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/release-23.05"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem - (system: let - pkgs = import nixpkgs { - inherit system; - }; - in { - devShells.default = pkgs.mkShell { - buildInputs = [ - pkgs.deno - ]; - }; - }); -} \ No newline at end of file diff --git a/.fluentci/example/.fluentci/.fluentci/import_map.json b/.fluentci/example/.fluentci/.fluentci/import_map.json deleted file mode 100644 index 801ea9a..0000000 --- a/.fluentci/example/.fluentci/.fluentci/import_map.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "imports": { - "@dagger.io/dagger": "https://esm.sh/v128/*@dagger.io/dagger@0.6.3", - "fluent_gitlab_ci": "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts", - "url": "node:url", - "readline": "node:readline", - "process": "node:process", - "path": "node:path", - "os": "node:os", - "fs": "node:fs", - "crypto": "node:crypto" - }, - "scopes": { - "https://esm.sh/v128/": { - "@lifeomic/axios-fetch": "https://esm.sh/v128/@lifeomic/axios-fetch@3.0.1", - "adm-zip": "https://esm.sh/v128/adm-zip@0.5.10", - "env-paths": "https://esm.sh/v128/env-paths@3.0.0", - "execa": "https://esm.sh/v128/execa@7.1.1", - "graphql-request": "https://esm.sh/v128/graphql-request@6.1.0", - "graphql-tag": "https://esm.sh/v128/graphql-tag@2.12.6", - "graphql": "https://esm.sh/v128/graphql@16.7.1", - "node-color-log": "https://esm.sh/v128/node-color-log@10.0.2", - "node-fetch": "https://esm.sh/v128/node-fetch@3.3.1", - "tar": "https://esm.sh/v128/tar@6.1.15" - } - } -} diff --git a/.fluentci/example/.fluentci/.fluentci/mod.ts b/.fluentci/example/.fluentci/.fluentci/mod.ts deleted file mode 100644 index 6152fb6..0000000 --- a/.fluentci/example/.fluentci/.fluentci/mod.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as GitLab from "./src/gitlab/index.ts"; -import * as Dagger from "./src/dagger/index.ts"; - -export { Dagger, GitLab }; diff --git a/.fluentci/example/.fluentci/.fluentci/src/dagger/index.ts b/.fluentci/example/.fluentci/.fluentci/src/dagger/index.ts deleted file mode 100644 index 392c001..0000000 --- a/.fluentci/example/.fluentci/.fluentci/src/dagger/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import pipeline from "./pipeline.ts"; -import { fmt, lint, test } from "./jobs.ts"; - -export { fmt, lint, pipeline, test }; diff --git a/.fluentci/example/.fluentci/.fluentci/src/dagger/jobs.ts b/.fluentci/example/.fluentci/.fluentci/src/dagger/jobs.ts deleted file mode 100644 index 42b4554..0000000 --- a/.fluentci/example/.fluentci/.fluentci/src/dagger/jobs.ts +++ /dev/null @@ -1,111 +0,0 @@ -import Client from "@dagger.io/dagger"; -import { existsSync } from "fs"; - -export enum Job { - fmt = "fmt", - lint = "lint", - test = "test", -} - -export const lint = async (client: Client, src = ".") => { - const context = client.host().directory(src); - let command = ["deno", "lint"]; - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - } - - const ctr = client - .pipeline(Job.lint) - .container() - .from("denoland/deno:alpine") - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export const fmt = async (client: Client, src = ".") => { - const context = client.host().directory(src); - let command = ["deno", "fmt"]; - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - } - - const ctr = client - .pipeline(Job.fmt) - .container() - .from("denoland/deno:alpine") - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export const test = async ( - client: Client, - src = ".", - options: { ignore: string[] } = { ignore: [] } -) => { - const context = client.host().directory(src); - let command = ["deno", "test", "-A", "--lock-write"]; - - if (options.ignore.length > 0) { - command = command.concat([`--ignore=${options.ignore.join(",")}`]); - } - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - } - - const ctr = client - .pipeline(Job.test) - .container() - .from("denoland/deno:alpine") - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withMountedCache("/root/.cache/deno", client.cacheVolume("deno-cache")) - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export type JobExec = ( - client: Client, - src?: string -) => - | Promise - | (( - client: Client, - src?: string, - options?: { - ignore: string[]; - } - ) => Promise); - -export const runnableJobs: Record = { - [Job.fmt]: fmt, - [Job.lint]: lint, - [Job.test]: test, -}; - -export const jobDescriptions: Record = { - [Job.fmt]: "Format your code", - [Job.lint]: "Lint your code", - [Job.test]: "Run your tests", -}; diff --git a/.fluentci/example/.fluentci/.fluentci/src/dagger/list_jobs.ts b/.fluentci/example/.fluentci/.fluentci/src/dagger/list_jobs.ts deleted file mode 100644 index 12bb3cb..0000000 --- a/.fluentci/example/.fluentci/.fluentci/src/dagger/list_jobs.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { brightGreen } from "https://deno.land/std@0.191.0/fmt/colors.ts"; -import { runnableJobs, jobDescriptions, Job } from "./jobs.ts"; -import { stringifyTree } from "https://esm.sh/stringify-tree@1.1.1"; - -const tree = { - name: brightGreen("deno_pipeline"), - children: (Object.keys(runnableJobs) as Job[]).map((job) => ({ - name: jobDescriptions[job] - ? `${brightGreen(job)} - ${jobDescriptions[job]}` - : brightGreen(job), - children: [], - })), -}; - -console.log( - stringifyTree( - tree, - (t) => t.name, - (t) => t.children - ) -); diff --git a/.fluentci/example/.fluentci/.fluentci/src/dagger/pipeline.ts b/.fluentci/example/.fluentci/.fluentci/src/dagger/pipeline.ts deleted file mode 100644 index bad7372..0000000 --- a/.fluentci/example/.fluentci/.fluentci/src/dagger/pipeline.ts +++ /dev/null @@ -1,27 +0,0 @@ -import Client, { connect } from "@dagger.io/dagger"; -import * as jobs from "./jobs.ts"; - -const { fmt, lint, test, runnableJobs } = jobs; - -export default function pipeline(src = ".", args: string[] = []) { - connect(async (client: Client) => { - if (args.length > 0) { - await runSpecificJobs(client, args as jobs.Job[]); - return; - } - - await fmt(client, src); - await lint(client, src); - await test(client, src); - }); -} - -async function runSpecificJobs(client: Client, args: jobs.Job[]) { - for (const name of args) { - const job = runnableJobs[name]; - if (!job) { - throw new Error(`Job ${name} not found`); - } - await job(client); - } -} diff --git a/.fluentci/example/.fluentci/.fluentci/src/dagger/runner.ts b/.fluentci/example/.fluentci/.fluentci/src/dagger/runner.ts deleted file mode 100644 index e23879e..0000000 --- a/.fluentci/example/.fluentci/.fluentci/src/dagger/runner.ts +++ /dev/null @@ -1,3 +0,0 @@ -import pipeline from "./pipeline.ts"; - -pipeline(".", Deno.args); diff --git a/.fluentci/example/.fluentci/.fluentci/src/gitlab/index.ts b/.fluentci/example/.fluentci/.fluentci/src/gitlab/index.ts deleted file mode 100644 index 392c001..0000000 --- a/.fluentci/example/.fluentci/.fluentci/src/gitlab/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import pipeline from "./pipeline.ts"; -import { fmt, lint, test } from "./jobs.ts"; - -export { fmt, lint, pipeline, test }; diff --git a/.fluentci/example/.fluentci/.fluentci/src/gitlab/jobs.ts b/.fluentci/example/.fluentci/.fluentci/src/gitlab/jobs.ts deleted file mode 100644 index 46be50c..0000000 --- a/.fluentci/example/.fluentci/.fluentci/src/gitlab/jobs.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Job } from "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts"; - -export const fmt = new Job() - .image("denoland/deno:alpine") - .script("deno fmt --check"); - -export const lint = new Job().image("denoland/deno:alpine").script("deno lint"); - -export const test = new Job().image("denoland/deno:alpine").script("deno test"); diff --git a/.fluentci/example/.fluentci/.fluentci/src/gitlab/pipeline.ts b/.fluentci/example/.fluentci/.fluentci/src/gitlab/pipeline.ts deleted file mode 100644 index 366de64..0000000 --- a/.fluentci/example/.fluentci/.fluentci/src/gitlab/pipeline.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { GitlabCI } from "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts"; -import { fmt, lint, test } from "./jobs.ts"; - -const pipeline = new GitlabCI() - .image("denoland/deno:alpine") - .addJob("fmt", fmt) - .addJob("lint", lint) - .addJob("test", test); - -export default pipeline; diff --git a/.fluentci/example/.fluentci/.fluentci/src/gitlab/pipeline_test.ts b/.fluentci/example/.fluentci/.fluentci/src/gitlab/pipeline_test.ts deleted file mode 100644 index ca24710..0000000 --- a/.fluentci/example/.fluentci/.fluentci/src/gitlab/pipeline_test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import pipeline from "./pipeline.ts"; -import { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts"; - -Deno.test(function pipelineTest() { - const expected = Deno.readTextFileSync("./fixtures/.gitlab-ci.yml"); - const actual = pipeline.toString(); - assertEquals(actual, expected); -}); diff --git a/.fluentci/example/.fluentci/.github/workflows/ci.yml b/.fluentci/example/.fluentci/.github/workflows/ci.yml deleted file mode 100644 index a7f9464..0000000 --- a/.fluentci/example/.fluentci/.github/workflows/ci.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Codecov - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: denoland/setup-deno@v1 - with: - deno-version: v1.34 - - name: Create coverage files - run: deno test --allow-read --coverage=coverage --lock-write # create coverage files - - name: Create coverage report - run: deno coverage ./coverage --lcov > coverage.lcov # create coverage report - - name: Collect coverage - uses: codecov/codecov-action@v3 # upload the report on Codecov - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - with: - file: ./coverage.lcov diff --git a/.fluentci/example/.fluentci/.vscode/settings.json b/.fluentci/example/.fluentci/.vscode/settings.json deleted file mode 100644 index cbac569..0000000 --- a/.fluentci/example/.fluentci/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "deno.enable": true -} diff --git a/.fluentci/example/.fluentci/CODE_OF_CONDUCT.md b/.fluentci/example/.fluentci/CODE_OF_CONDUCT.md deleted file mode 100644 index e9c20f9..0000000 --- a/.fluentci/example/.fluentci/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,132 +0,0 @@ -# Contributor Covenant Code of Conduct - -## Our Pledge - -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. - -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. - -## Our Standards - -Examples of behavior that contributes to a positive environment for our -community include: - -- Demonstrating empathy and kindness toward other people -- Being respectful of differing opinions, viewpoints, and experiences -- Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -- Focusing on what is best not just for us as individuals, but for the overall - community - -Examples of unacceptable behavior include: - -- The use of sexualized language or imagery, and sexual attention or advances of - any kind -- Trolling, insulting or derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or email address, - without their explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Enforcement Responsibilities - -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. - -Community leaders have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, and will communicate reasons for moderation -decisions when appropriate. - -## Scope - -This Code of Conduct applies within all community spaces, and also applies when -an individual is officially representing the community in public spaces. -Examples of representing our community include using an official e-mail address, -posting via an official social media account, or acting as an appointed -representative at an online or offline event. - -## Enforcement - -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -[GitHub Issues](https://github.com/fluent-ci-templates/deno-pipeline/issues). -All complaints will be reviewed and investigated promptly and fairly. - -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. - -## Enforcement Guidelines - -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: - -### 1. Correction - -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. - -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. - -### 2. Warning - -**Community Impact**: A violation through a single incident or series of -actions. - -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. - -### 3. Temporary Ban - -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. - -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. - -### 4. Permanent Ban - -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. - -**Consequence**: A permanent ban from any sort of public interaction within the -community. - -## Attribution - -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at -[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. - -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. - -For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at -[https://www.contributor-covenant.org/translations][translations]. - -[homepage]: https://www.contributor-covenant.org -[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq -[translations]: https://www.contributor-covenant.org/translations diff --git a/.fluentci/example/.fluentci/CONTRIBUTING.md b/.fluentci/example/.fluentci/CONTRIBUTING.md deleted file mode 100644 index e50de72..0000000 --- a/.fluentci/example/.fluentci/CONTRIBUTING.md +++ /dev/null @@ -1,70 +0,0 @@ -# Contributing Guidelines - -Thank you for your interest in contributing to our project. Whether it's a bug -report, new feature, correction, or additional documentation, we greatly value -feedback and contributions from our community. - -Please read through this document before submitting any issues or pull requests -to ensure we have all the necessary information to effectively respond to your -bug report or contribution. - -## Reporting Bugs/Feature Requests - -We welcome you to use the GitHub issue tracker to report bugs or suggest -features. - -When filing an issue, please check existing open, or recently closed, issues to -make sure somebody else hasn't already reported the issue. Please try to include -as much information as you can. Details like these are incredibly useful: - -- A reproducible test case or series of steps -- The version of our code being used -- Any modifications you've made relevant to the bug -- Anything unusual about your environment or deployment - -## Contributing via Pull Requests - -Contributions via pull requests are much appreciated. Before sending us a pull -request, please ensure that: - -1. You are working against the latest source on the _master_ branch. -2. You check existing open, and recently merged, pull requests to make sure - someone else hasn't addressed the problem already. -3. You open an issue to discuss any significant work - we would hate for your - time to be wasted. - -To send us a pull request, please: - -1. Fork the repository. -2. Modify the source; please focus on the specific change you are contributing. - If you also reformat all the code, it will be hard for us to focus on your - change. -3. Ensure local tests pass. -4. Commit to your fork using clear commit messages. -5. Send us a pull request, answering any default questions in the pull request - interface. -6. Pay attention to any automated CI failures reported in the pull request, and - stay involved in the conversation. - -GitHub provides additional document on -[forking a repository](https://help.github.com/articles/fork-a-repo/) and -[creating a pull request](https://help.github.com/articles/creating-a-pull-request/). - -## Finding contributions to work on - -Looking at the existing issues is a great way to find something to contribute -on. As our projects, by default, use the default GitHub issue labels -(enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any -'help wanted' issues is a great place to start. - -## Code of Conduct - -This project has adopted the -[Contributor Covenant](https://www.contributor-covenant.org/), version 2.1, -available at -https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. - -## Licensing - -See the [LICENSE](LICENSE) file for our project's licensing. We will ask you to -confirm the licensing of your contribution. diff --git a/.fluentci/example/.fluentci/LICENSE b/.fluentci/example/.fluentci/LICENSE deleted file mode 100644 index d9ab36a..0000000 --- a/.fluentci/example/.fluentci/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2023 Tsiry Sandratraina - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file diff --git a/.fluentci/example/.fluentci/README.md b/.fluentci/example/.fluentci/README.md deleted file mode 100644 index 1afc7c6..0000000 --- a/.fluentci/example/.fluentci/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# Deno Pipeline - -[![deno module](https://shield.deno.dev/x/deno_pipeline)](https://deno.land/x/deno_pipeline) -![deno compatibility](https://shield.deno.dev/deno/^1.34) -[![](https://img.shields.io/codecov/c/gh/fluent-ci-templates/deno-pipeline)](https://codecov.io/gh/fluent-ci-templates/deno-pipeline) - -A ready-to-use CI/CD Pipeline for your Deno projects. - -## ๐Ÿš€ Usage - -Run the following command: - -```bash -dagger run fluentci deno_pipeline -``` - -Or, if you want to use it as a template: - -```bash -fluentci init -t deno -``` - -This will create a `.fluentci` folder in your project. - -Now you can run the pipeline with: - -```bash -dagger run fluentci . -``` - -## Jobs - -| Job | Description | Options | -| ----- | ---------------- | ---------------------- | -| fmt | Format your code | | -| lint | Lint your code | | -| test | Run your tests | `{ ignore: string[] }` | - -## Programmatic usage - -You can also use this pipeline programmatically: - -```ts -import Client, { connect } from "@dagger.io/dagger"; -import { Dagger } from "https://deno.land/x/deno_pipeline/mod.ts"; - -const { fmt, lint, test } = Dagger; - -function pipeline(src = ".") { - connect(async (client: Client) => { - await fmt(client, src); - await lint(client, src); - await test(client, src); - }); -} - -pipeline(); -``` diff --git a/.fluentci/example/.fluentci/ci.ts b/.fluentci/example/.fluentci/ci.ts deleted file mode 100644 index 67e5a80..0000000 --- a/.fluentci/example/.fluentci/ci.ts +++ /dev/null @@ -1,12 +0,0 @@ -const command = new Deno.Command(Deno.execPath(), { - args: [ - "run", - "-A", - "--import-map=https://deno.land/x/deno_pipeline/import_map.json", - "https://deno.land/x/deno_pipeline/src/dagger/runner.ts", - ], -}); - -const { stdout } = await command.output(); - -console.log(new TextDecoder().decode(stdout)); diff --git a/.fluentci/example/.fluentci/deno.json b/.fluentci/example/.fluentci/deno.json deleted file mode 100644 index 4240219..0000000 --- a/.fluentci/example/.fluentci/deno.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "importMap": "import_map.json", - "tasks": { - "esm:add": "deno run -A https://esm.sh/v128 add", - "esm:update": "deno run -A https://esm.sh/v128 update", - "esm:remove": "deno run -A https://esm.sh/v128 remove", - "ci:dagger": "dagger run deno run -A src/dagger/runner.ts" - } -} diff --git a/.fluentci/example/.fluentci/deno.lock b/.fluentci/example/.fluentci/deno.lock deleted file mode 100644 index f8af4c3..0000000 --- a/.fluentci/example/.fluentci/deno.lock +++ /dev/null @@ -1,67 +0,0 @@ -{ - "version": "2", - "remote": { - "https://deno.land/std@0.150.0/media_types/_util.ts": "ce9b4fc4ba1c447dafab619055e20fd88236ca6bdd7834a21f98bd193c3fbfa1", - "https://deno.land/std@0.150.0/media_types/mod.ts": "2d4b6f32a087029272dc59e0a55ae3cc4d1b27b794ccf528e94b1925795b3118", - "https://deno.land/std@0.150.0/media_types/vendor/mime-db.v1.52.0.ts": "724cee25fa40f1a52d3937d6b4fbbfdd7791ff55e1b7ac08d9319d5632c7f5af", - "https://deno.land/std@0.191.0/fmt/colors.ts": "d67e3cd9f472535241a8e410d33423980bec45047e343577554d3356e1f0ef4e", - "https://deno.land/x/nix_installer_pipeline@v0.3.6/src/dagger/steps.ts": "a34aea3753c7079de5877f592ce31f30d05d552155729ff3e695d77326405133", - "https://deno.land/x/xhr@0.3.0/mod.ts": "094aacd627fd9635cd942053bf8032b5223b909858fa9dc8ffa583752ff63b20", - "https://esm.sh/stringify-tree@1.1.1": "8d994a105481fa944515323d89bd2596c1de79f3d9bd1386266463934716eca0", - "https://esm.sh/v128/*@dagger.io/dagger@0.6.3": "cb691a77c0cdaee22f2b8393731b5143c83ce22dbbea204cdbfd203768d15b64", - "https://esm.sh/v128/@dagger.io/dagger@0.6.3/X-ZS8q/denonext/dagger.mjs": "fd0901784d75b99615b5409c3654b5c7edfc5ba377c9e1a5a67ffff4f7d3ac32", - "https://esm.sh/v128/adm-zip@0.5.10": "d9c54d6d2dd788462781a57d923295bd79304e6fd74b242fd4b30e35b39c5dcf", - "https://esm.sh/v128/adm-zip@0.5.10/denonext/adm-zip.mjs": "07a9731547905e0ca55ae917e1969d7f6d04fb3773f906ce3306891337eb4849", - "https://esm.sh/v128/chownr@2.0.0/denonext/chownr.mjs": "30b8f17084dfbe475a5052b615f706b06ddd17dca0535103340d485c6b94e952", - "https://esm.sh/v128/cross-fetch@3.1.8/denonext/cross-fetch.mjs": "8fba9e7c3fbaf0d2168beb63ce0cd21b5bfbfbd77e2fcbf8d957d533a71222f6", - "https://esm.sh/v128/cross-spawn@7.0.3/denonext/cross-spawn.mjs": "0569a26e7ad4b3376516cbc9b1942e10961a58030eadcea8c848e6b956eb355c", - "https://esm.sh/v128/data-uri-to-buffer@4.0.1/denonext/data-uri-to-buffer.mjs": "70ef987b1da58391495ecfad9888d996469224faf3cd996d81dc2e059feb9f31", - "https://esm.sh/v128/env-paths@3.0.0": "8400fb23319be9b30d7b40d1c865541c5b3c7726cdf9b74000bc0f1678d52ecf", - "https://esm.sh/v128/env-paths@3.0.0/denonext/env-paths.mjs": "77984a05eb16450087f25060a070ed500ec546719d471143e16d976ca73ca956", - "https://esm.sh/v128/execa@7.1.1": "a40c7030df81ab0847a5d844f4c5c6420af973dff05fef88e53cbb9b8667fdc2", - "https://esm.sh/v128/execa@7.1.1/denonext/execa.mjs": "9d5943544c0df3761b52f2c095f89a03ca6c028d818a8f0475ff883b0408f154", - "https://esm.sh/v128/fetch-blob@3.2.0/denonext/fetch-blob.mjs": "0531568b36c0f6db3e9825fbb2d08dee51100eb675c2bf1d98d6971a92010721", - "https://esm.sh/v128/fetch-blob@3.2.0/denonext/file.js": "fd82828163a4e7bdc15190d8c3dbfd92f93274d05bd7f7f5ab81093e3ad7e9c2", - "https://esm.sh/v128/fetch-blob@3.2.0/denonext/from.js": "7d3258c7960755497f90879806f0b815d5e564c2ac1523238af5cb9552ff5c45", - "https://esm.sh/v128/formdata-polyfill@4.0.10/denonext/esm.min.js": "b6d65a204e81eca699d9eb6f867e9efffa42db39a8f161690915a89e5eb1766f", - "https://esm.sh/v128/fs-minipass@2.1.0/denonext/fs-minipass.mjs": "74b00283d556b281bdfd6a669576d852f2c43702043c411985f8f8188d208c5d", - "https://esm.sh/v128/get-stream@6.0.1/denonext/get-stream.mjs": "a947a16f8cb3052fd654a84f8b36b40ce96b6a5acfb3ad4ab69d814bcf3351fb", - "https://esm.sh/v128/graphql-request@6.1.0": "17f00c323eb825811ce14e2b0e88a0c873acb666c382ac963d1edeb03e01f372", - "https://esm.sh/v128/graphql-request@6.1.0/denonext/graphql-request.mjs": "0b15f49d44489423ae6f06004725b6d050b6359da4969e6569bd6ad45065bd94", - "https://esm.sh/v128/graphql-tag@2.12.6": "5bfa27da9c9918fb52a01b8579891e804e0365d91118df1f2e0957a72dacdc39", - "https://esm.sh/v128/graphql-tag@2.12.6/denonext/graphql-tag.mjs": "331d09949efc4ac60c84a69b52a7da8b333210493900e54953ae4604c9874527", - "https://esm.sh/v128/graphql@16.7.1/denonext/graphql.mjs": "418ad7c07b0f2d687f33b6275d3b5f317f4afbef1f462f318229f458dff45416", - "https://esm.sh/v128/human-signals@4.3.1/denonext/human-signals.mjs": "3889110cedd907804443d018cffe0a1d892d5e7467661376caf967feff55cbe9", - "https://esm.sh/v128/is-stream@3.0.0/denonext/is-stream.mjs": "5c8b65f2fa051c4b18e88bbae11dac8bba9caf57752577d69bcea86d1f05c5b7", - "https://esm.sh/v128/isexe@2.0.0/denonext/isexe.mjs": "3cfefd270d1bfdfb864ee98dbb8f41d150cbf480925158f4a8f0ade8a9e17d6c", - "https://esm.sh/v128/merge-stream@2.0.0/denonext/merge-stream.mjs": "2c2af22401c294158d6bff659d157e3d2c028c218cc1bd2246534a45a4c03c61", - "https://esm.sh/v128/mimic-fn@4.0.0/denonext/mimic-fn.mjs": "10bcf0f2f20cbbba0c289ef7bf4d2422639bbc1c36c247be876afd6fe2d67138", - "https://esm.sh/v128/minipass@3.3.6/denonext/minipass.mjs": "59bbe430514455e78cb30c389b21af66efb2bf010cda071820a17d8c76d0d1cf", - "https://esm.sh/v128/minipass@5.0.0/denonext/minipass.mjs": "de0e049728f8c387b58c86439eb9d69a16b6a88756a6bc694e2fecbd7fd00401", - "https://esm.sh/v128/minizlib@2.1.2/denonext/minizlib.mjs": "0d919b6a0c60d5a31e14d748ff9d62aeae2923b604bcc6a22f90fa4bbd400d68", - "https://esm.sh/v128/mkdirp@1.0.4/denonext/mkdirp.mjs": "ee129b32e55dd8bede6b1bbd1978f7775fa5e2720d5a7ae07bf1e8c99abd77c7", - "https://esm.sh/v128/node-color-log@10.0.2": "05a277987c64153af1252167135076155fdc6b39ca260b2bdc39750da12d2a2d", - "https://esm.sh/v128/node-color-log@10.0.2/denonext/node-color-log.mjs": "2504391bd0ce1dd4c2bf0ed0b839b8a3ad84c028d9dd17cc58dccd2e14dacfde", - "https://esm.sh/v128/node-domexception@1.0.0/denonext/node-domexception.mjs": "bb35ba54c1a2b35870618876c0c96310a28ae58aecff33c8eed58a582e270ff4", - "https://esm.sh/v128/node-fetch@3.3.1": "916dcee177a69fb0e46970c528cb66fcd4973488f861844c0a235bfc645b0506", - "https://esm.sh/v128/node-fetch@3.3.1/denonext/node-fetch.mjs": "dc3a8f1f2fc9eb26d0d33e49f3750acc265d51a1a54bbd670c5d9f640b633a93", - "https://esm.sh/v128/node-fetch@3.3.1/denonext/src/utils/multipart-parser.js": "713b1b8cbafc4bfb7358debeb35d507e0d2328f0a28b8a2a7d79a3e5e4f5e5b8", - "https://esm.sh/v128/npm-run-path@5.1.0/denonext/npm-run-path.mjs": "3540b8c2dd1430f10d580f323f3a51aa30094da27a9220cce03ce69884b163bb", - "https://esm.sh/v128/onetime@6.0.0/denonext/onetime.mjs": "6e362222575d815f37fb813168d7069dd6a0f6bb6f972ed54d1bccb0f9fb3e1b", - "https://esm.sh/v128/original-fs@1.2.0/denonext/original-fs.mjs": "2b1098818e54d2c6748ff5b0dd9ea5f6a61b4b6d0f63fb625f21773d11cfc667", - "https://esm.sh/v128/path-key@3.1.1/denonext/path-key.mjs": "add83c631278b7df9b33ae84e41142db88bb291295bcc27eb4e77a1cbdfa71d0", - "https://esm.sh/v128/path-key@4.0.0/denonext/path-key.mjs": "2c2e3922bd0e6e414fa2752ff800bdc6b9208035ce797fa22e49b859f8259417", - "https://esm.sh/v128/shebang-command@2.0.0/denonext/shebang-command.mjs": "404e0fb09a782ca9495d53c721bb84b673b7b2e1054e021852143a6b91ca0e4f", - "https://esm.sh/v128/shebang-regex@3.0.0/denonext/shebang-regex.mjs": "03983ba59dd2cba9402935e21b46d05f5249364cba9f5757aef23c6c2fea65b9", - "https://esm.sh/v128/signal-exit@3.0.7/denonext/signal-exit.mjs": "2a176e5f9b351fa8057213c627a1503d63bf308b64447ef47f1ca6fbb2a91c81", - "https://esm.sh/v128/strip-final-newline@3.0.0/denonext/strip-final-newline.mjs": "03d9be4e8a249d63cbbddeb2fb675a1bbbcb335283e604d4ce56c88c90e6f102", - "https://esm.sh/v128/tar@6.1.15": "0460339f8aba5f287e8bebe258fe3fe13cb12f85820693f25724f0d98ef1258e", - "https://esm.sh/v128/tar@6.1.15/denonext/tar.mjs": "6194d892de8457b3b1f11d5cbacda1d540b453b45e8cb9f5f610abfb3e490b65", - "https://esm.sh/v128/tslib@2.6.0/denonext/tslib.mjs": "2215292e6fcf28a7a081eee911f127bb3c44cdd61ff0651e3e384d7a49b4e42b", - "https://esm.sh/v128/web-streams-polyfill@3.2.1/denonext/dist/ponyfill.es2018.js": "a2edb52a93494cda06386b3d6a168016b366e78f02c5eff1f94a0240be12ac96", - "https://esm.sh/v128/which@2.0.2/denonext/which.mjs": "86bf76e4937edb7fa3464d7bb9a426ef273684d1cefbec5ba5f1bdcb5cafff91", - "https://esm.sh/v128/yallist@4.0.0/denonext/yallist.mjs": "61f180d807dda50bac17028eda05d5722a3fecef6e98a9064e2353ea6864fd82", - "https://esm.sh/v130/lodash.flatten@4.4.0/denonext/lodash.flatten.mjs": "8e86ab607deea15cc3c1acfb5eae278ecbc5b80f24167b4e8f4c56df3278cd55", - "https://esm.sh/v130/stringify-tree@1.1.1/denonext/stringify-tree.mjs": "40a9d40e0282b5432302a3da68b88aa11685bc0b8a0b70246168deed5c5773fe" - } -} diff --git a/.fluentci/example/.fluentci/fixtures/.gitlab-ci.yml b/.fluentci/example/.fluentci/fixtures/.gitlab-ci.yml deleted file mode 100644 index 299e4c6..0000000 --- a/.fluentci/example/.fluentci/fixtures/.gitlab-ci.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Do not edit this file directly. It is generated by Fluent GitLab CI - -image: denoland/deno:alpine - -fmt: - image: denoland/deno:alpine - script: - - deno fmt --check - -lint: - image: denoland/deno:alpine - script: - - deno lint - -test: - image: denoland/deno:alpine - script: - - deno test - diff --git a/.fluentci/example/.fluentci/flake.lock b/.fluentci/example/.fluentci/flake.lock deleted file mode 100644 index af7453c..0000000 --- a/.fluentci/example/.fluentci/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1687709756, - "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1688910226, - "narHash": "sha256-kLTsFu9CAU2Gb288JhIBN/WlX4UUUDz4WiC/U59nvwk=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "2540432a940aee979be6ccfefba9ea0652c273a0", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "release-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/.fluentci/example/.fluentci/flake.nix b/.fluentci/example/.fluentci/flake.nix deleted file mode 100644 index b13ea7d..0000000 --- a/.fluentci/example/.fluentci/flake.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - description = "A Nix-flake-based Deno development environment"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/release-23.05"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem - (system: let - pkgs = import nixpkgs { - inherit system; - }; - in { - devShells.default = pkgs.mkShell { - buildInputs = [ - pkgs.deno - ]; - }; - }); -} \ No newline at end of file diff --git a/.fluentci/example/.fluentci/import_map.json b/.fluentci/example/.fluentci/import_map.json deleted file mode 100644 index 801ea9a..0000000 --- a/.fluentci/example/.fluentci/import_map.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "imports": { - "@dagger.io/dagger": "https://esm.sh/v128/*@dagger.io/dagger@0.6.3", - "fluent_gitlab_ci": "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts", - "url": "node:url", - "readline": "node:readline", - "process": "node:process", - "path": "node:path", - "os": "node:os", - "fs": "node:fs", - "crypto": "node:crypto" - }, - "scopes": { - "https://esm.sh/v128/": { - "@lifeomic/axios-fetch": "https://esm.sh/v128/@lifeomic/axios-fetch@3.0.1", - "adm-zip": "https://esm.sh/v128/adm-zip@0.5.10", - "env-paths": "https://esm.sh/v128/env-paths@3.0.0", - "execa": "https://esm.sh/v128/execa@7.1.1", - "graphql-request": "https://esm.sh/v128/graphql-request@6.1.0", - "graphql-tag": "https://esm.sh/v128/graphql-tag@2.12.6", - "graphql": "https://esm.sh/v128/graphql@16.7.1", - "node-color-log": "https://esm.sh/v128/node-color-log@10.0.2", - "node-fetch": "https://esm.sh/v128/node-fetch@3.3.1", - "tar": "https://esm.sh/v128/tar@6.1.15" - } - } -} diff --git a/.fluentci/example/.fluentci/mod.ts b/.fluentci/example/.fluentci/mod.ts deleted file mode 100644 index 6152fb6..0000000 --- a/.fluentci/example/.fluentci/mod.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as GitLab from "./src/gitlab/index.ts"; -import * as Dagger from "./src/dagger/index.ts"; - -export { Dagger, GitLab }; diff --git a/.fluentci/example/.fluentci/src/dagger/index.ts b/.fluentci/example/.fluentci/src/dagger/index.ts deleted file mode 100644 index 392c001..0000000 --- a/.fluentci/example/.fluentci/src/dagger/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import pipeline from "./pipeline.ts"; -import { fmt, lint, test } from "./jobs.ts"; - -export { fmt, lint, pipeline, test }; diff --git a/.fluentci/example/.fluentci/src/dagger/jobs.ts b/.fluentci/example/.fluentci/src/dagger/jobs.ts deleted file mode 100644 index 611a5e0..0000000 --- a/.fluentci/example/.fluentci/src/dagger/jobs.ts +++ /dev/null @@ -1,188 +0,0 @@ -import Client from "@dagger.io/dagger"; -import { withDevbox } from "https://deno.land/x/nix_installer_pipeline@v0.3.6/src/dagger/steps.ts"; -import { existsSync } from "fs"; - -export enum Job { - fmt = "fmt", - lint = "lint", - test = "test", - deploy = "deploy", -} - -const baseCtr = (client: Client, pipeline: string) => { - if (existsSync("devbox.json")) { - return withDevbox( - client - .pipeline(pipeline) - .container() - .from("alpine:latest") - .withExec(["apk", "update"]) - .withExec(["apk", "add", "bash", "curl"]) - .withMountedCache("/nix", client.cacheVolume("nix")) - .withMountedCache("/etc/nix", client.cacheVolume("nix-etc")) - ); - } - return client.pipeline(pipeline).container().from("denoland/deno:alpine"); -}; - -export const lint = async (client: Client, src = ".") => { - const context = client.host().directory(src); - let command = ["deno", "lint"]; - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - } - - const ctr = baseCtr(client, Job.lint) - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export const fmt = async (client: Client, src = ".") => { - const context = client.host().directory(src); - let command = ["deno", "fmt"]; - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - } - - const ctr = baseCtr(client, Job.fmt) - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export const test = async ( - client: Client, - src = ".", - options: { ignore: string[] } = { ignore: [] } -) => { - const context = client.host().directory(src); - let command = ["deno", "test", "-A", "--lock-write"]; - - if (options.ignore.length > 0) { - command = command.concat([`--ignore=${options.ignore.join(",")}`]); - } - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - } - - const ctr = baseCtr(client, Job.test) - .from("denoland/deno:alpine") - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withMountedCache("/root/.cache/deno", client.cacheVolume("deno-cache")) - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export const deploy = async (client: Client, src = ".") => { - const context = client.host().directory(src); - let installDeployCtl = [ - "deno", - "install", - "--allow-all", - "--no-check", - "-r", - "-f", - "https://deno.land/x/deploy/deployctl.ts", - ]; - const project = Deno.env.get("DENO_PROJECT"); - const noStatic = Deno.env.get("NO_STATIC"); - const exclude = Deno.env.get("EXCLUDE"); - - let command = ["deployctl", "deploy"]; - - if (noStatic) { - command = command.concat(["--no-static"]); - } - - if (exclude) { - command = command.concat([`--exclude=${exclude}`]); - } - - if (!Deno.env.get("DENO_DEPLOY_TOKEN")) { - throw new Error("DENO_DEPLOY_TOKEN environment variable is not set"); - } - - if (!project) { - throw new Error("DENO_PROJECT environment variable is not set"); - } - - const script = Deno.env.get("DENO_MAIN_SCRIPT") || "main.tsx"; - command = command.concat([`--project=${project}`, script]); - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - installDeployCtl = [ - "sh", - "-c", - `devbox run -- ${installDeployCtl.join(" ")}`, - ]; - } - - const ctr = baseCtr(client, Job.deploy) - .from("denoland/deno:alpine") - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withEnvVariable("PATH", "/root/.deno/bin:$PATH", { expand: true }) - .withEnvVariable("DENO_DEPLOY_TOKEN", Deno.env.get("DENO_DEPLOY_TOKEN")!) - .withEnvVariable( - "DENO_MAIN_SCRIPT", - Deno.env.get("DENO_MAIN_SCRIPT") || "main.tsx" - ) - .withExec(installDeployCtl) - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export type JobExec = ( - client: Client, - src?: string -) => - | Promise - | (( - client: Client, - src?: string, - options?: { - ignore: string[]; - } - ) => Promise); - -export const runnableJobs: Record = { - [Job.fmt]: fmt, - [Job.lint]: lint, - [Job.test]: test, - [Job.deploy]: deploy, -}; - -export const jobDescriptions: Record = { - [Job.fmt]: "Format your code", - [Job.lint]: "Lint your code", - [Job.test]: "Run your tests", - [Job.deploy]: "Deploy your code to Deno Deploy", -}; diff --git a/.fluentci/example/.fluentci/src/dagger/list_jobs.ts b/.fluentci/example/.fluentci/src/dagger/list_jobs.ts deleted file mode 100644 index 12bb3cb..0000000 --- a/.fluentci/example/.fluentci/src/dagger/list_jobs.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { brightGreen } from "https://deno.land/std@0.191.0/fmt/colors.ts"; -import { runnableJobs, jobDescriptions, Job } from "./jobs.ts"; -import { stringifyTree } from "https://esm.sh/stringify-tree@1.1.1"; - -const tree = { - name: brightGreen("deno_pipeline"), - children: (Object.keys(runnableJobs) as Job[]).map((job) => ({ - name: jobDescriptions[job] - ? `${brightGreen(job)} - ${jobDescriptions[job]}` - : brightGreen(job), - children: [], - })), -}; - -console.log( - stringifyTree( - tree, - (t) => t.name, - (t) => t.children - ) -); diff --git a/.fluentci/example/.fluentci/src/dagger/pipeline.ts b/.fluentci/example/.fluentci/src/dagger/pipeline.ts deleted file mode 100644 index bad7372..0000000 --- a/.fluentci/example/.fluentci/src/dagger/pipeline.ts +++ /dev/null @@ -1,27 +0,0 @@ -import Client, { connect } from "@dagger.io/dagger"; -import * as jobs from "./jobs.ts"; - -const { fmt, lint, test, runnableJobs } = jobs; - -export default function pipeline(src = ".", args: string[] = []) { - connect(async (client: Client) => { - if (args.length > 0) { - await runSpecificJobs(client, args as jobs.Job[]); - return; - } - - await fmt(client, src); - await lint(client, src); - await test(client, src); - }); -} - -async function runSpecificJobs(client: Client, args: jobs.Job[]) { - for (const name of args) { - const job = runnableJobs[name]; - if (!job) { - throw new Error(`Job ${name} not found`); - } - await job(client); - } -} diff --git a/.fluentci/example/.fluentci/src/dagger/runner.ts b/.fluentci/example/.fluentci/src/dagger/runner.ts deleted file mode 100644 index e23879e..0000000 --- a/.fluentci/example/.fluentci/src/dagger/runner.ts +++ /dev/null @@ -1,3 +0,0 @@ -import pipeline from "./pipeline.ts"; - -pipeline(".", Deno.args); diff --git a/.fluentci/example/.fluentci/src/gitlab/index.ts b/.fluentci/example/.fluentci/src/gitlab/index.ts deleted file mode 100644 index 392c001..0000000 --- a/.fluentci/example/.fluentci/src/gitlab/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import pipeline from "./pipeline.ts"; -import { fmt, lint, test } from "./jobs.ts"; - -export { fmt, lint, pipeline, test }; diff --git a/.fluentci/example/.fluentci/src/gitlab/jobs.ts b/.fluentci/example/.fluentci/src/gitlab/jobs.ts deleted file mode 100644 index 46be50c..0000000 --- a/.fluentci/example/.fluentci/src/gitlab/jobs.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Job } from "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts"; - -export const fmt = new Job() - .image("denoland/deno:alpine") - .script("deno fmt --check"); - -export const lint = new Job().image("denoland/deno:alpine").script("deno lint"); - -export const test = new Job().image("denoland/deno:alpine").script("deno test"); diff --git a/.fluentci/example/.fluentci/src/gitlab/pipeline.ts b/.fluentci/example/.fluentci/src/gitlab/pipeline.ts deleted file mode 100644 index 366de64..0000000 --- a/.fluentci/example/.fluentci/src/gitlab/pipeline.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { GitlabCI } from "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts"; -import { fmt, lint, test } from "./jobs.ts"; - -const pipeline = new GitlabCI() - .image("denoland/deno:alpine") - .addJob("fmt", fmt) - .addJob("lint", lint) - .addJob("test", test); - -export default pipeline; diff --git a/.fluentci/example/.fluentci/src/gitlab/pipeline_test.ts b/.fluentci/example/.fluentci/src/gitlab/pipeline_test.ts deleted file mode 100644 index ca24710..0000000 --- a/.fluentci/example/.fluentci/src/gitlab/pipeline_test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import pipeline from "./pipeline.ts"; -import { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts"; - -Deno.test(function pipelineTest() { - const expected = Deno.readTextFileSync("./fixtures/.gitlab-ci.yml"); - const actual = pipeline.toString(); - assertEquals(actual, expected); -}); diff --git a/.fluentci/example/.vscode/settings.json b/.fluentci/example/.vscode/settings.json deleted file mode 100644 index cbac569..0000000 --- a/.fluentci/example/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "deno.enable": true -} diff --git a/.fluentci/example/README.md b/.fluentci/example/README.md deleted file mode 100644 index a6193e1..0000000 --- a/.fluentci/example/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# Deno Pipeline Example - -This is an example using the [Deno Pipeline](https://github.com/fluent-ci-templates/deno-pipeline). - -## ๐Ÿš€ Usage - -You need to set the following environment variables: - -- `DENO_DEPLOY_TOKEN`: Your Deno Deploy token. -- `DENO_PROJECT`: Your project name. - -Then, run the following command: - -```bash -dagger run fluentci . fmt lint deploy -``` \ No newline at end of file diff --git a/.fluentci/example/main.tsx b/.fluentci/example/main.tsx deleted file mode 100644 index dd48266..0000000 --- a/.fluentci/example/main.tsx +++ /dev/null @@ -1,20 +0,0 @@ -/** @jsx h */ -import { serve } from "https://deno.land/std@0.190.0/http/server.ts"; -import html, { h } from "https://deno.land/x/htm@0.2.1/mod.ts"; - -const handler = (req: Request) => - html({ - title: "Hello World!", - styles: [ - "html, body { margin: 0; height: 100%; }", - "body { background: #86efac; display: flex; flex-direction: column; align-items: center; justify-content: center; }", - ], - body: ( - - -

Hello Patricia!

- - ), - }); - -serve(handler); diff --git a/.fluentci/fixtures/.gitlab-ci.yml b/.fluentci/fixtures/.gitlab-ci.yml deleted file mode 100644 index 299e4c6..0000000 --- a/.fluentci/fixtures/.gitlab-ci.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Do not edit this file directly. It is generated by Fluent GitLab CI - -image: denoland/deno:alpine - -fmt: - image: denoland/deno:alpine - script: - - deno fmt --check - -lint: - image: denoland/deno:alpine - script: - - deno lint - -test: - image: denoland/deno:alpine - script: - - deno test - diff --git a/.fluentci/flake.lock b/.fluentci/flake.lock deleted file mode 100644 index af7453c..0000000 --- a/.fluentci/flake.lock +++ /dev/null @@ -1,61 +0,0 @@ -{ - "nodes": { - "flake-utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1687709756, - "narHash": "sha256-Y5wKlQSkgEK2weWdOu4J3riRd+kV/VCgHsqLNTTWQ/0=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "dbabf0ca0c0c4bce6ea5eaf65af5cb694d2082c7", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1688910226, - "narHash": "sha256-kLTsFu9CAU2Gb288JhIBN/WlX4UUUDz4WiC/U59nvwk=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "2540432a940aee979be6ccfefba9ea0652c273a0", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "release-23.05", - "repo": "nixpkgs", - "type": "github" - } - }, - "root": { - "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" - } - }, - "systems": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/.fluentci/flake.nix b/.fluentci/flake.nix deleted file mode 100644 index b13ea7d..0000000 --- a/.fluentci/flake.nix +++ /dev/null @@ -1,26 +0,0 @@ -{ - description = "A Nix-flake-based Deno development environment"; - - inputs = { - nixpkgs.url = "github:nixos/nixpkgs/release-23.05"; - flake-utils.url = "github:numtide/flake-utils"; - }; - - outputs = { - self, - nixpkgs, - flake-utils, - }: - flake-utils.lib.eachDefaultSystem - (system: let - pkgs = import nixpkgs { - inherit system; - }; - in { - devShells.default = pkgs.mkShell { - buildInputs = [ - pkgs.deno - ]; - }; - }); -} \ No newline at end of file diff --git a/.fluentci/import_map.json b/.fluentci/import_map.json deleted file mode 100644 index 12c59ff..0000000 --- a/.fluentci/import_map.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "imports": { - "@dagger.io/dagger": "https://esm.sh/v128/*@dagger.io/dagger@0.6.3", - "fluent_gitlab_ci": "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts", - "fluent_github_actions": "https://deno.land/x/fluent_github_actions@v0.1.2/mod.ts", - "url": "node:url", - "readline": "node:readline", - "process": "node:process", - "path": "node:path", - "os": "node:os", - "fs": "node:fs", - "crypto": "node:crypto" - }, - "scopes": { - "https://esm.sh/v128/": { - "@lifeomic/axios-fetch": "https://esm.sh/v128/@lifeomic/axios-fetch@3.0.1", - "adm-zip": "https://esm.sh/v128/adm-zip@0.5.10", - "env-paths": "https://esm.sh/v128/env-paths@3.0.0", - "execa": "https://esm.sh/v128/execa@7.1.1", - "graphql-request": "https://esm.sh/v128/graphql-request@6.1.0", - "graphql-tag": "https://esm.sh/v128/graphql-tag@2.12.6", - "graphql": "https://esm.sh/v128/graphql@16.7.1", - "node-color-log": "https://esm.sh/v128/node-color-log@10.0.2", - "node-fetch": "https://esm.sh/v128/node-fetch@3.3.1", - "tar": "https://esm.sh/v128/tar@6.1.15" - } - } -} \ No newline at end of file diff --git a/.fluentci/mod.ts b/.fluentci/mod.ts deleted file mode 100644 index 6152fb6..0000000 --- a/.fluentci/mod.ts +++ /dev/null @@ -1,4 +0,0 @@ -import * as GitLab from "./src/gitlab/index.ts"; -import * as Dagger from "./src/dagger/index.ts"; - -export { Dagger, GitLab }; diff --git a/.fluentci/src/dagger/index.ts b/.fluentci/src/dagger/index.ts deleted file mode 100644 index 392c001..0000000 --- a/.fluentci/src/dagger/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import pipeline from "./pipeline.ts"; -import { fmt, lint, test } from "./jobs.ts"; - -export { fmt, lint, pipeline, test }; diff --git a/.fluentci/src/dagger/jobs.ts b/.fluentci/src/dagger/jobs.ts deleted file mode 100644 index 862b599..0000000 --- a/.fluentci/src/dagger/jobs.ts +++ /dev/null @@ -1,197 +0,0 @@ -import Client from "@dagger.io/dagger"; -import { upload } from "https://deno.land/x/codecov_pipeline@v0.1.1/src/dagger/jobs.ts"; -import { withDevbox } from "https://deno.land/x/nix_installer_pipeline@v0.3.6/src/dagger/steps.ts"; -import { existsSync } from "fs"; - -export enum Job { - fmt = "fmt", - lint = "lint", - test = "test", - deploy = "deploy", - codecov = "codecov", -} - -const baseCtr = (client: Client, pipeline: string) => { - if (existsSync("devbox.json")) { - return withDevbox( - client - .pipeline(pipeline) - .container() - .from("alpine:latest") - .withExec(["apk", "update"]) - .withExec(["apk", "add", "bash", "curl"]) - .withMountedCache("/nix", client.cacheVolume("nix")) - .withMountedCache("/etc/nix", client.cacheVolume("nix-etc")) - ); - } - return client.pipeline(pipeline).container().from("denoland/deno:alpine"); -}; - -export const lint = async (client: Client, src = ".") => { - const context = client.host().directory(src); - let command = ["deno", "lint"]; - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - } - - const ctr = baseCtr(client, Job.lint) - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export const fmt = async (client: Client, src = ".") => { - const context = client.host().directory(src); - let command = ["deno", "fmt"]; - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - } - - const ctr = baseCtr(client, Job.fmt) - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export const test = async ( - client: Client, - src = ".", - options: { ignore: string[] } = { ignore: [] } -) => { - const context = client.host().directory(src); - let command = ["deno", "test", "-A", "--coverage=coverage", "--lock-write"]; - - if (options.ignore.length > 0) { - command = command.concat([`--ignore=${options.ignore.join(",")}`]); - } - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - } - - const ctr = baseCtr(client, Job.test) - .from("denoland/deno:alpine") - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withMountedCache("/root/.cache/deno", client.cacheVolume("deno-cache")) - .withExec(command) - .withExec(["sh", "-c", "deno coverage ./coverage --lcov > coverage.lcov"]); - - const result = await ctr.stdout(); - - await ctr.file("/app/coverage.lcov").export("./coverage.lcov"); - - console.log(result); -}; - -export const deploy = async (client: Client, src = ".") => { - const context = client.host().directory(src); - let installDeployCtl = [ - "deno", - "install", - "--allow-all", - "--no-check", - "-r", - "-f", - "https://deno.land/x/deploy/deployctl.ts", - ]; - const project = Deno.env.get("DENO_PROJECT"); - const noStatic = Deno.env.get("NO_STATIC"); - const exclude = Deno.env.get("EXCLUDE"); - - let command = ["deployctl", "deploy"]; - - if (noStatic) { - command = command.concat(["--no-static"]); - } - - if (exclude) { - command = command.concat([`--exclude=${exclude}`]); - } - - if (!Deno.env.get("DENO_DEPLOY_TOKEN")) { - throw new Error("DENO_DEPLOY_TOKEN environment variable is not set"); - } - - if (!project) { - throw new Error("DENO_PROJECT environment variable is not set"); - } - - const script = Deno.env.get("DENO_MAIN_SCRIPT") || "main.tsx"; - command = command.concat([`--project=${project}`, script]); - - if (existsSync("devbox.json")) { - command = ["sh", "-c", `devbox run -- ${command.join(" ")}`]; - installDeployCtl = [ - "sh", - "-c", - `devbox run -- ${installDeployCtl.join(" ")}`, - ]; - } - - const ctr = baseCtr(client, Job.deploy) - .from("denoland/deno:alpine") - .withDirectory("/app", context, { - exclude: [".git", ".devbox", ".fluentci"], - }) - .withWorkdir("/app") - .withEnvVariable("PATH", "/root/.deno/bin:$PATH", { expand: true }) - .withEnvVariable("DENO_DEPLOY_TOKEN", Deno.env.get("DENO_DEPLOY_TOKEN")!) - .withEnvVariable( - "DENO_MAIN_SCRIPT", - Deno.env.get("DENO_MAIN_SCRIPT") || "main.tsx" - ) - .withExec(installDeployCtl) - .withExec(command); - - const result = await ctr.stdout(); - - console.log(result); -}; - -export type JobExec = ( - client: Client, - src?: string -) => - | Promise - | (( - client: Client, - src?: string, - options?: { - ignore: string[]; - } - ) => Promise); - -export const codecov = upload; - -export const runnableJobs: Record = { - [Job.fmt]: fmt, - [Job.lint]: lint, - [Job.test]: test, - [Job.deploy]: deploy, - [Job.codecov]: upload, -}; - -export const jobDescriptions: Record = { - [Job.fmt]: "Format your code", - [Job.lint]: "Lint your code", - [Job.test]: "Run your tests", - [Job.deploy]: "Deploy your code to Deno Deploy", - [Job.codecov]: "Upload your code coverage to Codecov", -}; diff --git a/.fluentci/src/dagger/list_jobs.ts b/.fluentci/src/dagger/list_jobs.ts deleted file mode 100644 index 12bb3cb..0000000 --- a/.fluentci/src/dagger/list_jobs.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { brightGreen } from "https://deno.land/std@0.191.0/fmt/colors.ts"; -import { runnableJobs, jobDescriptions, Job } from "./jobs.ts"; -import { stringifyTree } from "https://esm.sh/stringify-tree@1.1.1"; - -const tree = { - name: brightGreen("deno_pipeline"), - children: (Object.keys(runnableJobs) as Job[]).map((job) => ({ - name: jobDescriptions[job] - ? `${brightGreen(job)} - ${jobDescriptions[job]}` - : brightGreen(job), - children: [], - })), -}; - -console.log( - stringifyTree( - tree, - (t) => t.name, - (t) => t.children - ) -); diff --git a/.fluentci/src/dagger/pipeline.ts b/.fluentci/src/dagger/pipeline.ts deleted file mode 100644 index bad7372..0000000 --- a/.fluentci/src/dagger/pipeline.ts +++ /dev/null @@ -1,27 +0,0 @@ -import Client, { connect } from "@dagger.io/dagger"; -import * as jobs from "./jobs.ts"; - -const { fmt, lint, test, runnableJobs } = jobs; - -export default function pipeline(src = ".", args: string[] = []) { - connect(async (client: Client) => { - if (args.length > 0) { - await runSpecificJobs(client, args as jobs.Job[]); - return; - } - - await fmt(client, src); - await lint(client, src); - await test(client, src); - }); -} - -async function runSpecificJobs(client: Client, args: jobs.Job[]) { - for (const name of args) { - const job = runnableJobs[name]; - if (!job) { - throw new Error(`Job ${name} not found`); - } - await job(client); - } -} diff --git a/.fluentci/src/dagger/runner.ts b/.fluentci/src/dagger/runner.ts deleted file mode 100644 index e23879e..0000000 --- a/.fluentci/src/dagger/runner.ts +++ /dev/null @@ -1,3 +0,0 @@ -import pipeline from "./pipeline.ts"; - -pipeline(".", Deno.args); diff --git a/.fluentci/src/github/config.ts b/.fluentci/src/github/config.ts deleted file mode 100644 index 9508e83..0000000 --- a/.fluentci/src/github/config.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { JobSpec, Workflow } from "fluent_github_actions"; - -export function generateYaml() { - const workflow = new Workflow("Codecov"); - - const push = { - branches: ["main"], - }; - - const setupDagger = `\ - curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.8.1 sh - sudo mv bin/dagger /usr/local/bin - dagger version`; - - const tests: JobSpec = { - "runs-on": "ubuntu-latest", - steps: [ - { - uses: "actions/checkout@v2", - }, - { - uses: "denoland/setup-deno@v1", - with: { - "deno-version": "v1.37", - }, - }, - { - name: "Setup Fluent CI CLI", - run: "deno install -A -r https://cli.fluentci.io -n fluentci", - }, - { - name: "Setup Dagger", - run: setupDagger, - }, - { - name: "Run Dagger Pipelines", - run: "dagger run fluentci . fmt lint test", - }, - { - name: "Upload to Codecov", - run: "dagger run fluentci codecov_pipeline", - env: { - CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}", - }, - }, - ], - }; - - workflow.on({ push }).jobs({ tests }); - - workflow.save(".github/workflows/ci.yml"); -} diff --git a/.fluentci/src/github/init.ts b/.fluentci/src/github/init.ts deleted file mode 100644 index 6097dd5..0000000 --- a/.fluentci/src/github/init.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { generateYaml } from "./config.ts"; - -generateYaml(); diff --git a/.fluentci/src/gitlab/index.ts b/.fluentci/src/gitlab/index.ts deleted file mode 100644 index 392c001..0000000 --- a/.fluentci/src/gitlab/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -import pipeline from "./pipeline.ts"; -import { fmt, lint, test } from "./jobs.ts"; - -export { fmt, lint, pipeline, test }; diff --git a/.fluentci/src/gitlab/jobs.ts b/.fluentci/src/gitlab/jobs.ts deleted file mode 100644 index 46be50c..0000000 --- a/.fluentci/src/gitlab/jobs.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { Job } from "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts"; - -export const fmt = new Job() - .image("denoland/deno:alpine") - .script("deno fmt --check"); - -export const lint = new Job().image("denoland/deno:alpine").script("deno lint"); - -export const test = new Job().image("denoland/deno:alpine").script("deno test"); diff --git a/.fluentci/src/gitlab/pipeline.ts b/.fluentci/src/gitlab/pipeline.ts deleted file mode 100644 index 366de64..0000000 --- a/.fluentci/src/gitlab/pipeline.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { GitlabCI } from "https://deno.land/x/fluent_gitlab_ci@v0.3.2/mod.ts"; -import { fmt, lint, test } from "./jobs.ts"; - -const pipeline = new GitlabCI() - .image("denoland/deno:alpine") - .addJob("fmt", fmt) - .addJob("lint", lint) - .addJob("test", test); - -export default pipeline; diff --git a/.fluentci/src/gitlab/pipeline_test.ts b/.fluentci/src/gitlab/pipeline_test.ts deleted file mode 100644 index ca24710..0000000 --- a/.fluentci/src/gitlab/pipeline_test.ts +++ /dev/null @@ -1,8 +0,0 @@ -import pipeline from "./pipeline.ts"; -import { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts"; - -Deno.test(function pipelineTest() { - const expected = Deno.readTextFileSync("./fixtures/.gitlab-ci.yml"); - const actual = pipeline.toString(); - assertEquals(actual, expected); -}); diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de479d0..d95c32b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,6 @@ # Do not edit this file directly. It is generated by Fluent Github Actions -name: Codecov +name: ci on: push: branches: @@ -13,8 +13,20 @@ jobs: - name: Setup Fluent CI CLI uses: fluentci-io/setup-fluentci@v4 - name: Run Dagger Pipelines - run: fluentci run . fmt lint test + run: | + fluentci run deno_pipeline fmt test + dagger -m github.com/fluent-ci-templates/rust-pipeline@main functions - name: Upload to Codecov run: fluentci run codecov_pipeline env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + publish: + needs: tests + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + steps: + - uses: actions/checkout@v4 + - name: Publish package + run: npx jsr publish --allow-slow-types diff --git a/.github/workflows/codesee-arch-diagram.yml b/.github/workflows/codesee-arch-diagram.yml deleted file mode 100644 index 806d41d..0000000 --- a/.github/workflows/codesee-arch-diagram.yml +++ /dev/null @@ -1,23 +0,0 @@ -# This workflow was added by CodeSee. Learn more at https://codesee.io/ -# This is v2.0 of this workflow file -on: - push: - branches: - - main - pull_request_target: - types: [opened, synchronize, reopened] - -name: CodeSee - -permissions: read-all - -jobs: - codesee: - runs-on: ubuntu-latest - continue-on-error: true - name: Analyze the repo with CodeSee - steps: - - uses: Codesee-io/codesee-action@v2 - with: - codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }} - codesee-url: https://app.codesee.io diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml index 8a20ac1..576bf5e 100644 --- a/.github/workflows/example.yml +++ b/.github/workflows/example.yml @@ -12,12 +12,12 @@ jobs: - uses: actions/checkout@v2 - uses: denoland/setup-deno@v1 with: - deno-version: v1.37 + deno-version: v1.41 - name: Setup Fluent CI CLI run: deno install -A -r https://cli.fluentci.io -n fluentci - name: Setup Dagger run: | - curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.11 sh + curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.10.0 sh sudo mv bin/dagger /usr/local/bin dagger version - name: Run Dagger Pipelines diff --git a/.github/workflows/zenith.yml b/.github/workflows/zenith.yml index 6436f09..9d4d927 100644 --- a/.github/workflows/zenith.yml +++ b/.github/workflows/zenith.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v2 - name: Setup Dagger Zenith run: | - curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.9.11 sh + curl -L https://dl.dagger.io/dagger/install.sh | DAGGER_VERSION=0.10.0 sh sudo mv bin/dagger /usr/local/bin dagger version - name: Run Dagger Pipelines diff --git a/README.md b/README.md index df1416f..ff60644 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ [![deno module](https://shield.deno.dev/x/rust_pipeline)](https://deno.land/x/rust_pipeline) ![deno compatibility](https://shield.deno.dev/deno/^1.37) [![](https://img.shields.io/codecov/c/gh/fluent-ci-templates/rust-pipeline)](https://codecov.io/gh/fluent-ci-templates/rust-pipeline) +[![](https://jsr.io/badges/@fluentci/rust)](https://jsr.io/@fluentci/rust) + A ready-to-use CI/CD Pipeline for your Rust projects. @@ -82,7 +84,7 @@ llvmCov( You can also use this pipeline programmatically: ```ts -import { build, test } from "https://pkg.fluentci.io/rust_pipeline@v0.8.4/mod.ts"; +import { build, test } from "jsr:@fluentci/rust"; await test(); await build(); diff --git a/deno.json b/deno.json index e0e77b5..365ec36 100644 --- a/deno.json +++ b/deno.json @@ -1,4 +1,7 @@ { + "name": "@fluentci/rust", + "version": "0.9.0", + "exports": "./mod.ts", "importMap": "import_map.json", "tasks": { "esm:add": "deno run -A https://esm.sh/v128 add", diff --git a/deno.lock b/deno.lock index b6af573..1f5925c 100644 --- a/deno.lock +++ b/deno.lock @@ -2,11 +2,136 @@ "version": "3", "packages": { "specifiers": { + "jsr:@std/assert@^0.217.0": "jsr:@std/assert@0.217.0", + "jsr:@std/assert@^0.218.2": "jsr:@std/assert@0.218.2", + "jsr:@std/flags@0.218.2": "jsr:@std/flags@0.218.2", + "jsr:@std/fmt@0.218.2": "jsr:@std/fmt@0.218.2", + "jsr:@std/fmt@^0.217.0": "jsr:@std/fmt@0.217.0", + "jsr:@std/fmt@^0.218.2": "jsr:@std/fmt@0.218.2", + "jsr:@std/path@0.218.2": "jsr:@std/path@0.218.2", + "jsr:@std/testing@0.217.0": "jsr:@std/testing@0.217.0", + "jsr:@std/testing@0.218.2": "jsr:@std/testing@0.218.2", + "jsr:@tsirysndr/env-js@0.1.2": "jsr:@tsirysndr/env-js@0.1.2", + "jsr:@tsirysndr/fluent-az-pipelines@0.3": "jsr:@tsirysndr/fluent-az-pipelines@0.3.0", + "jsr:@tsirysndr/fluent-circleci@0.3": "jsr:@tsirysndr/fluent-circleci@0.3.0", + "jsr:@tsirysndr/fluent-codepipeline@0.3": "jsr:@tsirysndr/fluent-codepipeline@0.3.0", + "jsr:@tsirysndr/fluent-gh-actions@0.3": "jsr:@tsirysndr/fluent-gh-actions@0.3.0", + "jsr:@tsirysndr/fluent-gitlab-ci@0.5": "jsr:@tsirysndr/fluent-gitlab-ci@0.5.0", "npm:buffer": "npm:buffer@6.0.3", "npm:dayjs": "npm:dayjs@1.11.10", - "npm:typescript": "npm:typescript@5.3.3" + "npm:graphql-request@6.1.0": "npm:graphql-request@6.1.0_graphql@16.8.1", + "npm:graphql@16.8.1": "npm:graphql@16.8.1", + "npm:lodash@4.17.21": "npm:lodash@4.17.21", + "npm:node-color-log@11.0.2": "npm:node-color-log@11.0.2", + "npm:stringify-tree@1.1.1": "npm:stringify-tree@1.1.1", + "npm:typescript": "npm:typescript@5.3.3", + "npm:yaml@2.3.1": "npm:yaml@2.3.1", + "npm:zod@3.22.1": "npm:zod@3.22.1" + }, + "jsr": { + "@std/assert@0.217.0": { + "integrity": "c98e279362ca6982d5285c3b89517b757c1e3477ee9f14eb2fdf80a45aaa9642", + "dependencies": [ + "jsr:@std/fmt@^0.217.0" + ] + }, + "@std/assert@0.218.2": { + "integrity": "7f0a5a1a8cf86607cd6c2c030584096e1ffad27fc9271429a8cb48cfbdee5eaf", + "dependencies": [ + "jsr:@std/fmt@^0.218.2" + ] + }, + "@std/flags@0.218.2": { + "integrity": "0d4e8ac15e7dfede26153c63a6d55d0aad56ae88beb2ede38c14c775dfc5b25e", + "dependencies": [ + "jsr:@std/assert@^0.218.2" + ] + }, + "@std/fmt@0.217.0": { + "integrity": "cb99f82500b8da20202fedfa8bb94dd0222e81f0494ed9087de20ee3d8a39a8d" + }, + "@std/fmt@0.218.2": { + "integrity": "99526449d2505aa758b6cbef81e7dd471d8b28ec0dcb1491d122b284c548788a" + }, + "@std/path@0.218.2": { + "integrity": "b568fd923d9e53ad76d17c513e7310bda8e755a3e825e6289a0ce536404e2662", + "dependencies": [ + "jsr:@std/assert@^0.218.2" + ] + }, + "@std/testing@0.217.0": { + "integrity": "97508b254ca1888d512215288bfb3f192a4e6e84336ba56b189c7862258a058b", + "dependencies": [ + "jsr:@std/assert@^0.217.0" + ] + }, + "@std/testing@0.218.2": { + "integrity": "49410b23584c924533786e6c117d71486c1daa65f4911fd6cfc95e4edba9de7f", + "dependencies": [ + "jsr:@std/assert@^0.218.2" + ] + }, + "@tsirysndr/env-js@0.1.2": { + "integrity": "16a8cf4e60c8b43f4d62dd762006de40d56e5b144a56c0954a11f99ee12c5d3a" + }, + "@tsirysndr/fluent-az-pipelines@0.3.0": { + "integrity": "a2a23089a186b0f04e45daa7a9df98527c54b845842c1ebe3b7f2cf03e5aec0d", + "dependencies": [ + "jsr:@std/testing@0.217.0", + "npm:yaml@2.3.1", + "npm:zod@3.22.1" + ] + }, + "@tsirysndr/fluent-circleci@0.3.0": { + "integrity": "f2ab207d83b7b2a728a6708a51c3ad93cf2d89b08a13460793e3b6c7af8f5dd9", + "dependencies": [ + "jsr:@std/testing@0.217.0", + "npm:yaml@2.3.1", + "npm:zod@3.22.1" + ] + }, + "@tsirysndr/fluent-codepipeline@0.3.0": { + "integrity": "3050df3fed469d6791831a0a83529de77732d14c27f4a1446788de2c740c73df", + "dependencies": [ + "jsr:@std/testing@0.217.0", + "npm:yaml@2.3.1", + "npm:zod@3.22.1" + ] + }, + "@tsirysndr/fluent-gh-actions@0.3.0": { + "integrity": "2eaff18fbe9b25042fbb321d3bec61a34a15f736ec95bd2da214dcd1c3b8d5cd", + "dependencies": [ + "jsr:@std/testing@0.217.0", + "npm:yaml@2.3.1", + "npm:zod@3.22.1" + ] + }, + "@tsirysndr/fluent-gitlab-ci@0.5.0": { + "integrity": "57e7d231375902358d2bd5b63766f8ffb7030157a9e3764d5e0b0fb7533dd3f9", + "dependencies": [ + "jsr:@std/testing@0.217.0", + "npm:yaml@2.3.1", + "npm:zod@3.22.1" + ] + } }, "npm": { + "@graphql-typed-document-node/core@3.2.0_graphql@16.8.1": { + "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", + "dependencies": { + "graphql": "graphql@16.8.1" + } + }, + "@types/lodash.flatten@4.4.9": { + "integrity": "sha512-JCW9xofpn9oJfFSccpBRF8IrB5guqmcKZIa7J9DnZqLd9wgGYbewaYnjbNw3Fb+St8BHVsnGmmS0A3j99LII3Q==", + "dependencies": { + "@types/lodash": "@types/lodash@4.14.202" + } + }, + "@types/lodash@4.14.202": { + "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", + "dependencies": {} + }, "base64-js@1.5.1": { "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", "dependencies": {} @@ -18,17 +143,83 @@ "ieee754": "ieee754@1.2.1" } }, + "cross-fetch@3.1.8": { + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", + "dependencies": { + "node-fetch": "node-fetch@2.7.0" + } + }, "dayjs@1.11.10": { "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==", "dependencies": {} }, + "graphql-request@6.1.0_graphql@16.8.1": { + "integrity": "sha512-p+XPfS4q7aIpKVcgmnZKhMNqhltk20hfXtkaIkTfjjmiKMJ5xrt5c743cL03y/K7y1rg3WrIC49xGiEQ4mxdNw==", + "dependencies": { + "@graphql-typed-document-node/core": "@graphql-typed-document-node/core@3.2.0_graphql@16.8.1", + "cross-fetch": "cross-fetch@3.1.8", + "graphql": "graphql@16.8.1" + } + }, + "graphql@16.8.1": { + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", + "dependencies": {} + }, "ieee754@1.2.1": { "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", "dependencies": {} }, + "lodash.flatten@4.4.0": { + "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==", + "dependencies": {} + }, + "lodash@4.17.21": { + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dependencies": {} + }, + "node-color-log@11.0.2": { + "integrity": "sha512-+gD5pQpVpEkEA3He9STku4VL1EO9SaOW3HElumCd3xWorulnfr2053NCSVwPCXrkwI5ihPYucQxSCSOuS1q+Eg==", + "dependencies": {} + }, + "node-fetch@2.7.0": { + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "whatwg-url@5.0.0" + } + }, + "stringify-tree@1.1.1": { + "integrity": "sha512-lVfVX+HJ9Gx2NUv0vJTRhqCPYlgzbdR25MF34Md1Bjq6jvJocOLgfHhusYtBSKi/bwpkgLGjtF/dVZlBbA6oZw==", + "dependencies": { + "@types/lodash.flatten": "@types/lodash.flatten@4.4.9", + "lodash.flatten": "lodash.flatten@4.4.0" + } + }, + "tr46@0.0.3": { + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dependencies": {} + }, "typescript@5.3.3": { "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", "dependencies": {} + }, + "webidl-conversions@3.0.1": { + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dependencies": {} + }, + "whatwg-url@5.0.0": { + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "tr46@0.0.3", + "webidl-conversions": "webidl-conversions@3.0.1" + } + }, + "yaml@2.3.1": { + "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", + "dependencies": {} + }, + "zod@3.22.1": { + "integrity": "sha512-+qUhAMl414+Elh+fRNtpU+byrwjDFOS1N7NioLY+tSlcADTx4TkCUua/hxJvxwDXcV4397/nZ420jy4n4+3WUg==", + "dependencies": {} } } }, diff --git a/deps.ts b/deps.ts index 3c08da8..747351a 100644 --- a/deps.ts +++ b/deps.ts @@ -1,23 +1,23 @@ -export { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts"; +export { assertEquals } from "jsr:@std/testing@0.218.2/asserts"; -export { connect, uploadContext } from "https://sdk.fluentci.io/v0.3.0/mod.ts"; -export { brightGreen } from "https://deno.land/std@0.191.0/fmt/colors.ts"; -export { withDevbox } from "https://nix.fluentci.io/v0.5.3/src/dagger/steps.ts"; -export { stringifyTree } from "https://esm.sh/stringify-tree@1.1.1"; -import gql from "https://esm.sh/graphql-tag@2.12.6"; +export type { DirectoryID, SecretID } from "./sdk/client.gen.ts"; +export { File, Directory, Secret, dag } from "./sdk/client.gen.ts"; +export { brightGreen } from "jsr:@std/fmt@0.218.2/colors"; +export { stringifyTree } from "npm:stringify-tree@1.1.1"; +import { gql } from "npm:graphql-request@6.1.0"; export { gql }; -export { - dirname, - join, - resolve, -} from "https://deno.land/std@0.203.0/path/mod.ts"; -export { parse } from "https://deno.land/std@0.205.0/flags/mod.ts"; -export { snakeCase, camelCase } from "https://cdn.skypack.dev/lodash"; +export { dirname, join, resolve } from "jsr:@std/path@0.218.2"; +export { parse } from "jsr:@std/flags@0.218.2"; -export { - ClientError, - GraphQLClient, -} from "https://esm.sh/v128/graphql-request@6.1.0"; +import * as _ from "npm:lodash@4.17.21"; +const snakeCase = _.default.snakeCase; +const camelCase = _.default.camelCase; +export { snakeCase, camelCase }; + +import * as env from "jsr:@tsirysndr/env-js@0.1.2"; +export { env }; + +export { ClientError, GraphQLClient } from "npm:graphql-request@6.1.0"; export { DaggerSDKError, UnknownDaggerError, @@ -31,15 +31,10 @@ export { EngineSessionConnectionTimeoutError, NotAwaitedRequestError, ERROR_CODES, -} from "https://esm.sh/@dagger.io/dagger@0.9.3"; - -export type { - CallbackFct, - ConnectOpts, -} from "https://sdk.fluentci.io/v0.3.0/mod.ts"; +} from "./sdk/common/errors/index.ts"; -export * as FluentGitlabCI from "https://deno.land/x/fluent_gitlab_ci@v0.4.2/mod.ts"; -export * as FluentGithubActions from "https://deno.land/x/fluent_github_actions@v0.2.1/mod.ts"; -export * as FluentCircleCI from "https://deno.land/x/fluent_circleci@v0.2.5/mod.ts"; -export * as FluentAzurePipelines from "https://deno.land/x/fluent_azure_pipelines@v0.2.0/mod.ts"; -export * as FluentAWSCodePipeline from "https://deno.land/x/fluent_aws_codepipeline@v0.2.3/mod.ts"; +export * as FluentGitlabCI from "jsr:@tsirysndr/fluent-gitlab-ci@0.5"; +export * as FluentGithubActions from "jsr:@tsirysndr/fluent-gh-actions@0.3"; +export * as FluentCircleCI from "jsr:@tsirysndr/fluent-circleci@0.3"; +export * as FluentAzurePipelines from "jsr:@tsirysndr/fluent-az-pipelines@0.3"; +export * as FluentAWSCodePipeline from "jsr:@tsirysndr/fluent-codepipeline@0.3"; diff --git a/example/.fluentci/deno.lock b/example/.fluentci/deno.lock index 1a439e8..e9c7801 100644 --- a/example/.fluentci/deno.lock +++ b/example/.fluentci/deno.lock @@ -1,234 +1,201 @@ { "version": "3", - "remote": { - "https://cdn.jsdelivr.net/gh/tsirysndr/tar@v0.1.1/deps.ts": "096395daebc7ed8a18f0484e4ffcc3a7f70e50946735f7df9611a7fcfd8272cc", - "https://cdn.jsdelivr.net/gh/tsirysndr/tar@v0.1.1/mod.ts": "e269d71c72ae68e82c1960e5db2a0c7419c97c9683ef717de0ab75d90f364713", - "https://cdn.jsdelivr.net/gh/tsirysndr/tar@v0.1.1/src/tar.ts": "9b02eaaa784b225ad7a23d2769cd492adf113ea7c11c02e3646849e98f4ae43b", - "https://cdn.skypack.dev/-/lodash@v4.17.21-K6GEbP02mWFnLA45zAmi/dist=es2019,mode=imports/optimized/lodash.js": "10c4df47937ffc78548d136dd535a021df5f57182a653260d715c0690dd22978", - "https://cdn.skypack.dev/lodash": "8280de0b3efd87f06ea0eb330d15b8de32c059556023b8c6524e9eb9e4844dc0", - "https://deno.land/std@0.129.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", - "https://deno.land/std@0.129.0/_util/os.ts": "49b92edea1e82ba295ec946de8ffd956ed123e2948d9bd1d3e901b04e4307617", - "https://deno.land/std@0.129.0/archive/tar.ts": "35ea1baddec7988cc4034765a2cee7613bc8074bd40940d3f5e98f63070a716a", - "https://deno.land/std@0.129.0/async/abortable.ts": "a896ac6b0d4237bd2d2d248217cfa1f0d85ccda93cb25ebda55e33850e526be6", - "https://deno.land/std@0.129.0/async/deadline.ts": "48ac998d7564969f3e6ec6b6f9bf0217ebd00239b1b2292feba61272d5dd58d0", - "https://deno.land/std@0.129.0/async/debounce.ts": "564273ef242bcfcda19a439132f940db8694173abffc159ea34f07d18fc42620", - "https://deno.land/std@0.129.0/async/deferred.ts": "bc18e28108252c9f67dfca2bbc4587c3cbf3aeb6e155f8c864ca8ecff992b98a", - "https://deno.land/std@0.129.0/async/delay.ts": "cbbdf1c87d1aed8edc7bae13592fb3e27e3106e0748f089c263390d4f49e5f6c", - "https://deno.land/std@0.129.0/async/mod.ts": "2240c6841157738414331f47dee09bb8c0482c5b1980b6e3234dd03515c8132f", - "https://deno.land/std@0.129.0/async/mux_async_iterator.ts": "f4d1d259b0c694d381770ddaaa4b799a94843eba80c17f4a2ec2949168e52d1e", - "https://deno.land/std@0.129.0/async/pool.ts": "97b0dd27c69544e374df857a40902e74e39532f226005543eabacb551e277082", - "https://deno.land/std@0.129.0/async/tee.ts": "1341feb1f5b1a96f8628d0f8fc07d8c43d3813423f18a63bf1b4785568d21b1f", - "https://deno.land/std@0.129.0/bytes/bytes_list.ts": "67eb118e0b7891d2f389dad4add35856f4ad5faab46318ff99653456c23b025d", - "https://deno.land/std@0.129.0/bytes/equals.ts": "fc16dff2090cced02497f16483de123dfa91e591029f985029193dfaa9d894c9", - "https://deno.land/std@0.129.0/bytes/mod.ts": "d3b455c0dbd4804644159d1e25946ade5ee385d2359894de49e2c6101b18b7a9", - "https://deno.land/std@0.129.0/encoding/base64.ts": "c8c16b4adaa60d7a8eee047c73ece26844435e8f7f1328d74593dbb2dd58ea4f", - "https://deno.land/std@0.129.0/encoding/base64url.ts": "55f9d13df02efac10c6f96169daa3e702606a64e8aa27c0295f645f198c27130", - "https://deno.land/std@0.129.0/fmt/colors.ts": "30455035d6d728394781c10755351742dd731e3db6771b1843f9b9e490104d37", - "https://deno.land/std@0.129.0/fmt/printf.ts": "e2c0f72146aed1efecf0c39ab928b26ae493a2278f670a871a0fbdcf36ff3379", - "https://deno.land/std@0.129.0/fs/_util.ts": "0fb24eb4bfebc2c194fb1afdb42b9c3dda12e368f43e8f2321f84fc77d42cb0f", - "https://deno.land/std@0.129.0/fs/ensure_dir.ts": "9dc109c27df4098b9fc12d949612ae5c9c7169507660dcf9ad90631833209d9d", - "https://deno.land/std@0.129.0/fs/ensure_file.ts": "7d353e64fee3d4d1e7c6b6726a2a5e987ba402c15fb49566309042887349c545", - "https://deno.land/std@0.129.0/io/buffer.ts": "bd0c4bf53db4b4be916ca5963e454bddfd3fcd45039041ea161dbf826817822b", - "https://deno.land/std@0.129.0/io/files.ts": "d199ef64e918a256320ba8d8d44ae91de87c9077df8f8d6cca013f1b9fbbe285", - "https://deno.land/std@0.129.0/io/readers.ts": "679471f3b9929b54393c9cd75b6bd178b4bc6d9aab5c0f1f9538f862cf4746fe", - "https://deno.land/std@0.129.0/io/util.ts": "078da53bba767bec0d45f7da44411f6dbf269e51ef7fcfea5e3714e04681c674", - "https://deno.land/std@0.129.0/node/_buffer.mjs": "f4a7df481d4eed06dc0151b833177d8ef74fc3a96dd4d2b073e690b6ced9474d", - "https://deno.land/std@0.129.0/node/_core.ts": "568d277be2e086af996cbdd599fec569f5280e9a494335ca23ad392b130d7bb9", - "https://deno.land/std@0.129.0/node/_events.mjs": "c0e3e0e290a8b81fee9d2973a529c8dcd5ebb4406782d1f91085274e2cb8490f", - "https://deno.land/std@0.129.0/node/_fixed_queue.ts": "455b3c484de48e810b13bdf95cd1658ecb1ba6bcb8b9315ffe994efcde3ba5f5", - "https://deno.land/std@0.129.0/node/_next_tick.ts": "64c361f6bca21df2a72dd77b84bd49d80d97a694dd3080703bc78f52146351d1", - "https://deno.land/std@0.129.0/node/_process/exiting.ts": "bc9694769139ffc596f962087155a8bfef10101d03423b9dcbc51ce6e1f88fce", - "https://deno.land/std@0.129.0/node/_util/_util_callbackify.ts": "79928ad80df3e469f7dcdb198118a7436d18a9f6c08bd7a4382332ad25a718cf", - "https://deno.land/std@0.129.0/node/_utils.ts": "c2c352e83c4c96f5ff994b1c8246bff2abcb21bfc3f1c06162cb3af1d201e615", - "https://deno.land/std@0.129.0/node/buffer.ts": "fbecbf3f237fa49bec96e97ecf56a7b92d48037b3d11219288e68943cc921600", - "https://deno.land/std@0.129.0/node/events.ts": "a1d40fc0dbccc944379ef968b80ea08f9fce579e88b5057fdb64e4f0812476dd", - "https://deno.land/std@0.129.0/node/internal/buffer.mjs": "6662fe7fe517329453545be34cea27a24f8ccd6d09afd4f609f11ade2b6dfca7", - "https://deno.land/std@0.129.0/node/internal/crypto/keys.ts": "16ce7b15a9fc5e4e3dee8fde75dae12f3d722558d5a1a6e65a9b4f86d64a21e9", - "https://deno.land/std@0.129.0/node/internal/crypto/util.mjs": "1de55a47fdbed6721b467a77ba48fdd1550c10b5eee77bbdb602eaffee365a5e", - "https://deno.land/std@0.129.0/node/internal/error_codes.ts": "ac03c4eae33de3a69d6c98e8678003207eecf75a6900eb847e3fea3c8c9e6d8f", - "https://deno.land/std@0.129.0/node/internal/errors.ts": "0d3a1eb03b654beb29b8354759a6902f45a840d4f957e9a3c632a24ce4c32632", - "https://deno.land/std@0.129.0/node/internal/hide_stack_frames.ts": "a91962ec84610bc7ec86022c4593cdf688156a5910c07b5bcd71994225c13a03", - "https://deno.land/std@0.129.0/node/internal/normalize_encoding.mjs": "3779ec8a7adf5d963b0224f9b85d1bc974a2ec2db0e858396b5d3c2c92138a0a", - "https://deno.land/std@0.129.0/node/internal/util.mjs": "684653b962fae84fd2bc08997291b1a50bed09b95dcfa7d35e3c4143163e879a", - "https://deno.land/std@0.129.0/node/internal/util/comparisons.ts": "680b55fe8bdf1613633bc469fa0440f43162c76dbe36af9aa2966310e1bb9f6e", - "https://deno.land/std@0.129.0/node/internal/util/debuglog.ts": "99e91bdf26f6c67861031f684817e1705a5bc300e81346585b396f413387edfb", - "https://deno.land/std@0.129.0/node/internal/util/inspect.mjs": "d1c2569c66a3dab45eec03208f22ad4351482527859c0011a28a6c797288a0aa", - "https://deno.land/std@0.129.0/node/internal/util/types.ts": "b2dacb8f1f5d28a51c4da5c5b75172b7fcf694073ce95ca141323657e18b0c60", - "https://deno.land/std@0.129.0/node/internal/validators.mjs": "a7e82eafb7deb85c332d5f8d9ffef052f46a42d4a121eada4a54232451acc49a", - "https://deno.land/std@0.129.0/node/internal_binding/_libuv_winerror.ts": "801e05c2742ae6cd42a5f0fd555a255a7308a65732551e962e5345f55eedc519", - "https://deno.land/std@0.129.0/node/internal_binding/_node.ts": "e4075ba8a37aef4eb5b592c8e3807c39cb49ca8653faf8e01a43421938076c1b", - "https://deno.land/std@0.129.0/node/internal_binding/_utils.ts": "1c50883b5751a9ea1b38951e62ed63bacfdc9d69ea665292edfa28e1b1c5bd94", - "https://deno.land/std@0.129.0/node/internal_binding/_winerror.ts": "8811d4be66f918c165370b619259c1f35e8c3e458b8539db64c704fbde0a7cd2", - "https://deno.land/std@0.129.0/node/internal_binding/buffer.ts": "722c62b85f966e0777b2d98c021b60e75d7f2c2dabc43413ef37d60dbd13a5d9", - "https://deno.land/std@0.129.0/node/internal_binding/constants.ts": "aff06aac49eda4234bd3a2b0b8e1fbfc67824e281c532ff9960831ab503014cc", - "https://deno.land/std@0.129.0/node/internal_binding/string_decoder.ts": "5cb1863763d1e9b458bc21d6f976f16d9c18b3b3f57eaf0ade120aee38fba227", - "https://deno.land/std@0.129.0/node/internal_binding/types.ts": "4c26fb74ba2e45de553c15014c916df6789529a93171e450d5afb016b4c765e7", - "https://deno.land/std@0.129.0/node/internal_binding/util.ts": "90364292e2bd598ab5d105b48ca49817b6708f2d1d9cbaf08b2b3ab5ca4c90a7", - "https://deno.land/std@0.129.0/node/internal_binding/uv.ts": "3821bc5e676d6955d68f581988c961d77dd28190aba5a9c59f16001a4deb34ba", - "https://deno.land/std@0.129.0/node/util.ts": "7fd6933b37af89a8e64d73dc6ee1732455a59e7e6d0965311fbd73cd634ea630", - "https://deno.land/std@0.129.0/node/util/types.mjs": "f9288198cacd374b41bae7e92a23179d3160f4c0eaf14e19be3a4e7057219a60", - "https://deno.land/std@0.129.0/path/_constants.ts": "df1db3ffa6dd6d1252cc9617e5d72165cd2483df90e93833e13580687b6083c3", - "https://deno.land/std@0.129.0/path/_interface.ts": "ee3b431a336b80cf445441109d089b70d87d5e248f4f90ff906820889ecf8d09", - "https://deno.land/std@0.129.0/path/_util.ts": "c1e9686d0164e29f7d880b2158971d805b6e0efc3110d0b3e24e4b8af2190d2b", - "https://deno.land/std@0.129.0/path/common.ts": "bee563630abd2d97f99d83c96c2fa0cca7cee103e8cb4e7699ec4d5db7bd2633", - "https://deno.land/std@0.129.0/path/glob.ts": "cb5255638de1048973c3e69e420c77dc04f75755524cb3b2e160fe9277d939ee", - "https://deno.land/std@0.129.0/path/mod.ts": "4275129bb766f0e475ecc5246aa35689eeade419d72a48355203f31802640be7", - "https://deno.land/std@0.129.0/path/posix.ts": "663e4a6fe30a145f56aa41a22d95114c4c5582d8b57d2d7c9ed27ad2c47636bb", - "https://deno.land/std@0.129.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9", - "https://deno.land/std@0.129.0/path/win32.ts": "e7bdf63e8d9982b4d8a01ef5689425c93310ece950e517476e22af10f41a136e", - "https://deno.land/std@0.129.0/streams/conversion.ts": "712585bfa0172a97fb68dd46e784ae8ad59d11b88079d6a4ab098ff42e697d21", - "https://deno.land/std@0.129.0/testing/_diff.ts": "9d849cd6877694152e01775b2d93f9d6b7aef7e24bfe3bfafc4d7a1ac8e9f392", - "https://deno.land/std@0.129.0/testing/asserts.ts": "0a95d9e8076dd3e7f0eeb605a67c148078b4b11f4abcd5eef115b0361b0736a2", - "https://deno.land/std@0.150.0/media_types/_util.ts": "ce9b4fc4ba1c447dafab619055e20fd88236ca6bdd7834a21f98bd193c3fbfa1", - "https://deno.land/std@0.150.0/media_types/mod.ts": "2d4b6f32a087029272dc59e0a55ae3cc4d1b27b794ccf528e94b1925795b3118", - "https://deno.land/std@0.150.0/media_types/vendor/mime-db.v1.52.0.ts": "724cee25fa40f1a52d3937d6b4fbbfdd7791ff55e1b7ac08d9319d5632c7f5af", - "https://deno.land/std@0.191.0/fmt/colors.ts": "d67e3cd9f472535241a8e410d33423980bec45047e343577554d3356e1f0ef4e", - "https://deno.land/std@0.191.0/testing/_diff.ts": "1a3c044aedf77647d6cac86b798c6417603361b66b54c53331b312caeb447aea", - "https://deno.land/std@0.191.0/testing/_format.ts": "a69126e8a469009adf4cf2a50af889aca364c349797e63174884a52ff75cf4c7", - "https://deno.land/std@0.191.0/testing/asserts.ts": "e16d98b4d73ffc4ed498d717307a12500ae4f2cbe668f1a215632d19fcffc22f", - "https://deno.land/std@0.203.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", - "https://deno.land/std@0.203.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", - "https://deno.land/std@0.203.0/path/_basename.ts": "057d420c9049821f983f784fd87fa73ac471901fb628920b67972b0f44319343", - "https://deno.land/std@0.203.0/path/_constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0", - "https://deno.land/std@0.203.0/path/_dirname.ts": "355e297236b2218600aee7a5301b937204c62e12da9db4b0b044993d9e658395", - "https://deno.land/std@0.203.0/path/_extname.ts": "eaaa5aae1acf1f03254d681bd6a8ce42a9cb5b7ff2213a9d4740e8ab31283664", - "https://deno.land/std@0.203.0/path/_format.ts": "4a99270d6810f082e614309164fad75d6f1a483b68eed97c830a506cc589f8b4", - "https://deno.land/std@0.203.0/path/_from_file_url.ts": "6eadfae2e6f63ad9ee46b26db4a1b16583055c0392acedfb50ed2fc694b6f581", - "https://deno.land/std@0.203.0/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b", - "https://deno.land/std@0.203.0/path/_is_absolute.ts": "05dac10b5e93c63198b92e3687baa2be178df5321c527dc555266c0f4f51558c", - "https://deno.land/std@0.203.0/path/_join.ts": "815f5e85b042285175b1492dd5781240ce126c23bd97bad6b8211fe7129c538e", - "https://deno.land/std@0.203.0/path/_normalize.ts": "a19ec8706b2707f9dd974662a5cd89fad438e62ab1857e08b314a8eb49a34d81", - "https://deno.land/std@0.203.0/path/_os.ts": "30b0c2875f360c9296dbe6b7f2d528f0f9c741cecad2e97f803f5219e91b40a2", - "https://deno.land/std@0.203.0/path/_parse.ts": "0f9b0ff43682dd9964eb1c4398610c4e165d8db9d3ac9d594220217adf480cfa", - "https://deno.land/std@0.203.0/path/_relative.ts": "27bdeffb5311a47d85be26d37ad1969979359f7636c5cd9fcf05dcd0d5099dc5", - "https://deno.land/std@0.203.0/path/_resolve.ts": "7a3616f1093735ed327e758313b79c3c04ea921808ca5f19ddf240cb68d0adf6", - "https://deno.land/std@0.203.0/path/_to_file_url.ts": "a141e4a525303e1a3a0c0571fd024552b5f3553a2af7d75d1ff3a503dcbb66d8", - "https://deno.land/std@0.203.0/path/_to_namespaced_path.ts": "0d5f4caa2ed98ef7a8786286df6af804b50e38859ae897b5b5b4c8c5930a75c8", - "https://deno.land/std@0.203.0/path/_util.ts": "4e191b1bac6b3bf0c31aab42e5ca2e01a86ab5a0d2e08b75acf8585047a86221", - "https://deno.land/std@0.203.0/path/basename.ts": "bdfa5a624c6a45564dc6758ef2077f2822978a6dbe77b0a3514f7d1f81362930", - "https://deno.land/std@0.203.0/path/common.ts": "ee7505ab01fd22de3963b64e46cff31f40de34f9f8de1fff6a1bd2fe79380000", - "https://deno.land/std@0.203.0/path/dirname.ts": "b6533f4ee4174a526dec50c279534df5345836dfdc15318400b08c62a62a39dd", - "https://deno.land/std@0.203.0/path/extname.ts": "62c4b376300795342fe1e4746c0de518b4dc9c4b0b4617bfee62a2973a9555cf", - "https://deno.land/std@0.203.0/path/format.ts": "110270b238514dd68455a4c54956215a1aff7e37e22e4427b7771cefe1920aa5", - "https://deno.land/std@0.203.0/path/from_file_url.ts": "9f5cb58d58be14c775ec2e57fc70029ac8b17ed3bd7fe93e475b07280adde0ac", - "https://deno.land/std@0.203.0/path/glob.ts": "593e2c3573883225c25c5a21aaa8e9382a696b8e175ea20a3b6a1471ad17aaed", - "https://deno.land/std@0.203.0/path/is_absolute.ts": "0b92eb35a0a8780e9f16f16bb23655b67dace6a8e0d92d42039e518ee38103c1", - "https://deno.land/std@0.203.0/path/join.ts": "31c5419f23d91655b08ec7aec403f4e4cd1a63d39e28f6e42642ea207c2734f8", - "https://deno.land/std@0.203.0/path/mod.ts": "6e1efb0b13121463aedb53ea51dabf5639a3172ab58c89900bbb72b486872532", - "https://deno.land/std@0.203.0/path/normalize.ts": "6ea523e0040979dd7ae2f1be5bf2083941881a252554c0f32566a18b03021955", - "https://deno.land/std@0.203.0/path/parse.ts": "be8de342bb9e1924d78dc4d93c45215c152db7bf738ec32475560424b119b394", - "https://deno.land/std@0.203.0/path/posix.ts": "0a1c1952d132323a88736d03e92bd236f3ed5f9f079e5823fae07c8d978ee61b", - "https://deno.land/std@0.203.0/path/relative.ts": "8bedac226afd360afc45d451a6c29fabceaf32978526bcb38e0c852661f66c61", - "https://deno.land/std@0.203.0/path/resolve.ts": "133161e4949fc97f9ca67988d51376b0f5eef8968a6372325ab84d39d30b80dc", - "https://deno.land/std@0.203.0/path/separator.ts": "40a3e9a4ad10bef23bc2cd6c610291b6c502a06237c2c4cd034a15ca78dedc1f", - "https://deno.land/std@0.203.0/path/to_file_url.ts": "00e6322373dd51ad109956b775e4e72e5f9fa68ce2c6b04e4af2a6eed3825d31", - "https://deno.land/std@0.203.0/path/to_namespaced_path.ts": "1b1db3055c343ab389901adfbda34e82b7386bcd1c744d54f9c1496ee0fd0c3d", - "https://deno.land/std@0.203.0/path/win32.ts": "8b3f80ef7a462511d5e8020ff490edcaa0a0d118f1b1e9da50e2916bdd73f9dd", - "https://deno.land/std@0.205.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", - "https://deno.land/std@0.205.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", - "https://deno.land/std@0.205.0/flags/mod.ts": "0948466fc437f017f00c0b972a422b3dc3317a790bcf326429d23182977eaf9f", - "https://deno.land/std@0.52.0/fmt/colors.ts": "ec9d653672a9a3c7b6eafe53c5bc797364a2db2dcf766ab649c1155fea7a80b2", - "https://deno.land/x/crc32@v0.2.0/mod.ts": "de7a3fa2d4ef24b96fc21e1cc4d2d65d1d2b1dcea92f63960e3e11bfa82df0fa", - "https://deno.land/x/fluent_aws_codepipeline@v0.2.3/mod.ts": "79cc758901d20a3573d7e3cc2db9f0a5fe56833f4d9befcedc072b94d542eec7", - "https://deno.land/x/fluent_aws_codepipeline@v0.2.3/src/buildspec.ts": "fb07cbbf9473586cea66c0c508412080c2d4ba4e7f4ea0985661afeed445710b", - "https://deno.land/x/fluent_aws_codepipeline@v0.2.3/src/spec.ts": "c0ce4c6e2685e23a3abdeb9fc18012253199dae355b06189d8248b052301a63e", - "https://deno.land/x/fluent_azure_pipelines@v0.2.0/mod.ts": "6f3c62419b96251dd1b5d8d6a172c0a8724a73b7feec786e540f51f0c8a0f0fd", - "https://deno.land/x/fluent_azure_pipelines@v0.2.0/src/config.ts": "619f4c64dad9b510c5788d4939a8afe013cb7dfc993dfd32f2ff4d0a2140075e", - "https://deno.land/x/fluent_azure_pipelines@v0.2.0/src/spec.ts": "cab6e4a6afb0f16e6c406cfab87264a963734720c468532c4f778228d1f1758d", - "https://deno.land/x/fluent_circleci@v0.2.5/mod.ts": "6a885bf35dbe08a7e971aa105763d724dd2a09c237b6292c9cd5de540237af37", - "https://deno.land/x/fluent_circleci@v0.2.5/src/config.ts": "d7e9902b4c2fddfa61ff6a509f3a09adee161fae9f93029dcbc8ec7a7bbd990b", - "https://deno.land/x/fluent_circleci@v0.2.5/src/job.ts": "b6ffb66ef10cf0e26460a88e1614ef864b606571e8d72376eeb09254f66a9926", - "https://deno.land/x/fluent_circleci@v0.2.5/src/spec.ts": "eda462e9ff535dbc7d3eb7e47253948d40ebaaf34d964e0931a6a25cdd823736", - "https://deno.land/x/fluent_github_actions@v0.2.1/mod.ts": "dc62b622791da77bc27f68e33cba618983a0770a9a12dcc9e0f9a61161bb90e5", - "https://deno.land/x/fluent_github_actions@v0.2.1/src/event.ts": "d44d42356a04aea7ba64ff9e9a12090f477605c27a940bbf80aba612e4e96d1e", - "https://deno.land/x/fluent_github_actions@v0.2.1/src/job_spec.ts": "93aa5b8b79cd8baaf875901322c4c38c27d4458439a831cb0ad86401b207a3dc", - "https://deno.land/x/fluent_github_actions@v0.2.1/src/step_spec.ts": "b399949d1fd9c45873cdda70d82c92e3d9d96ba9a1d5749f3010a1f242b20e35", - "https://deno.land/x/fluent_github_actions@v0.2.1/src/workflow.ts": "c9e3b7b3a59f7edff958eae8f27a8542f2a24889ea27c8aa016d0c0b0ca416c6", - "https://deno.land/x/fluent_github_actions@v0.2.1/src/workflow_spec.ts": "b5c696dc70ee3f777a565197c6a3a379d87d026e12d59942fef5b9dc72124c3a", - "https://deno.land/x/fluent_gitlab_ci@v0.4.2/mod.ts": "3becefe569f5c9814dffa1b534794a42b948481753a5903fa1b48d5337206ced", - "https://deno.land/x/fluent_gitlab_ci@v0.4.2/src/environment.ts": "f12ee4fb50e5100fccec29dc1d35aa430bfe8373e84286a8ab9f7b8e178f14e3", - "https://deno.land/x/fluent_gitlab_ci@v0.4.2/src/gitlabci.ts": "ef36465c41412ae94b919cfcb80b99ec1c04536dbf42ad09cd73abf3ea4d52a6", - "https://deno.land/x/fluent_gitlab_ci@v0.4.2/src/gitlabci_spec.ts": "37f4ecef3ea414f57c54a360bc0178f5fad21b4a9db59d29d1961cd368febaed", - "https://deno.land/x/fluent_gitlab_ci@v0.4.2/src/index.ts": "b5e374a24e3bca1d6fead0861f2c1b1e09e087a17e59297263f681ee71c972fe", - "https://deno.land/x/fluent_gitlab_ci@v0.4.2/src/job.ts": "65a5be7f5816846919907aab00530044b571570a54a8a0bc967f4269a2ce99b7", - "https://deno.land/x/spinners@v1.1.2/mod.ts": "ed5b3562d4ea6c6887bc7e9844612b08a3bc3a3678ca77cc7dfdf461c362751e", - "https://deno.land/x/spinners@v1.1.2/spinner-types.ts": "c67e6962a0c738aa57b4d3ad9fe06c8c0131f93360acbf95456f2ba200fd8826", - "https://deno.land/x/spinners@v1.1.2/terminal-spinner.ts": "1cf0c38a423781734e2e538323c1992027830d741e90f0b81f532e5bc993d035", - "https://deno.land/x/spinners@v1.1.2/util.ts": "7083203bedbda2e6144a14a7dd093747a7a01e73d95637c888bae8ac22a1c58b", - "https://deno.land/x/xhr@0.3.0/mod.ts": "094aacd627fd9635cd942053bf8032b5223b909858fa9dc8ffa583752ff63b20", - "https://deno.land/x/zod@v3.22.1/ZodError.ts": "4de18ff525e75a0315f2c12066b77b5c2ae18c7c15ef7df7e165d63536fdf2ea", - "https://deno.land/x/zod@v3.22.1/errors.ts": "5285922d2be9700cc0c70c95e4858952b07ae193aa0224be3cbd5cd5567eabef", - "https://deno.land/x/zod@v3.22.1/external.ts": "a6cfbd61e9e097d5f42f8a7ed6f92f93f51ff927d29c9fbaec04f03cbce130fe", - "https://deno.land/x/zod@v3.22.1/helpers/enumUtil.ts": "54efc393cc9860e687d8b81ff52e980def00fa67377ad0bf8b3104f8a5bf698c", - "https://deno.land/x/zod@v3.22.1/helpers/errorUtil.ts": "7a77328240be7b847af6de9189963bd9f79cab32bbc61502a9db4fe6683e2ea7", - "https://deno.land/x/zod@v3.22.1/helpers/parseUtil.ts": "f791e6e65a0340d85ad37d26cd7a3ba67126cd9957eac2b7163162155283abb1", - "https://deno.land/x/zod@v3.22.1/helpers/partialUtil.ts": "998c2fe79795257d4d1cf10361e74492f3b7d852f61057c7c08ac0a46488b7e7", - "https://deno.land/x/zod@v3.22.1/helpers/typeAliases.ts": "0fda31a063c6736fc3cf9090dd94865c811dfff4f3cb8707b932bf937c6f2c3e", - "https://deno.land/x/zod@v3.22.1/helpers/util.ts": "8baf19b19b2fca8424380367b90364b32503b6b71780269a6e3e67700bb02774", - "https://deno.land/x/zod@v3.22.1/index.ts": "d27aabd973613985574bc31f39e45cb5d856aa122ef094a9f38a463b8ef1a268", - "https://deno.land/x/zod@v3.22.1/locales/en.ts": "a7a25cd23563ccb5e0eed214d9b31846305ddbcdb9c5c8f508b108943366ab4c", - "https://deno.land/x/zod@v3.22.1/mod.ts": "64e55237cb4410e17d968cd08975566059f27638ebb0b86048031b987ba251c4", - "https://deno.land/x/zod@v3.22.1/types.ts": "4edc1823385f446532c8c9f676d84550c6dc54b17135e34508576647d9612d0e", - "https://esm.sh/@dagger.io/dagger@0.9.3": "9bd1df6375031727868e2a7aa24e7517d1eba916b49529a412f9a214a0d58992", - "https://esm.sh/graphql-tag@2.12.6": "132ebb1ed959bb4dac146160b0cd0fa678c7b9e6bd04f349bf4cacbfb46d0b53", - "https://esm.sh/nanoid@4.0.2": "eb872595ebf6390181971c3e477d1b0fe7ea8383d9b66ced7d09ac8f9c4cf2c7", - "https://esm.sh/stringify-tree@1.1.1": "bb68a933167b8d80b88481df0beff172fc9b645db0c32fbe7dc2d822f61ebaea", - "https://esm.sh/v128/cross-fetch@3.1.8/denonext/cross-fetch.mjs": "8fba9e7c3fbaf0d2168beb63ce0cd21b5bfbfbd77e2fcbf8d957d533a71222f6", - "https://esm.sh/v128/graphql-request@6.1.0": "17f00c323eb825811ce14e2b0e88a0c873acb666c382ac963d1edeb03e01f372", - "https://esm.sh/v128/graphql-request@6.1.0/denonext/graphql-request.mjs": "0b15f49d44489423ae6f06004725b6d050b6359da4969e6569bd6ad45065bd94", - "https://esm.sh/v128/graphql@16.7.1/denonext/graphql.mjs": "418ad7c07b0f2d687f33b6275d3b5f317f4afbef1f462f318229f458dff45416", - "https://esm.sh/v128/yaml@2.3.1": "8ef3aee065e93b03cebf8fd5a3418bc30131344b7f2b8c8ae27bf9f277416087", - "https://esm.sh/v128/yaml@2.3.1/denonext/yaml.mjs": "71f677b4bfc69271af9d98db5194e354f9a1863955e208e26d32a9ef78bd89f5", - "https://esm.sh/v131/yaml@2.3.1": "1fe2490feb3d9c6d2c71c64dbdbed90acd4164b00628b3c68a311b6731ca38b5", - "https://esm.sh/v131/yaml@2.3.1/denonext/yaml.mjs": "71f677b4bfc69271af9d98db5194e354f9a1863955e208e26d32a9ef78bd89f5", - "https://esm.sh/v135/@dagger.io/dagger@0.9.3/denonext/dagger.mjs": "998e8e63729621141c0a9b74128db8f81ab7446d1a5d4ff41a6a6b0944db4ddf", - "https://esm.sh/v135/adm-zip@0.5.10/denonext/adm-zip.mjs": "9441de5c60a276046d55945f45775d674a319e8e5fd3a8ab7131d8d192d9abb3", - "https://esm.sh/v135/chownr@2.0.0/denonext/chownr.mjs": "d7282b2612a9f13c62084c76fc72cdfb20503bccce959178b77b6def14d3ffd2", - "https://esm.sh/v135/cross-fetch@3.1.8/denonext/cross-fetch.mjs": "8fba9e7c3fbaf0d2168beb63ce0cd21b5bfbfbd77e2fcbf8d957d533a71222f6", - "https://esm.sh/v135/cross-spawn@7.0.3/denonext/cross-spawn.mjs": "4d5a257de3627fb09c512b23fed30f1b393e29a2c13f8325e89720b8ca6673c1", - "https://esm.sh/v135/env-paths@3.0.0/denonext/env-paths.mjs": "77984a05eb16450087f25060a070ed500ec546719d471143e16d976ca73ca956", - "https://esm.sh/v135/execa@8.0.1/denonext/execa.mjs": "cfcca6be54deae22c8d7c4d8be8df397a9506a54d9af9171519b9eea8daea9a5", - "https://esm.sh/v135/fs-minipass@2.1.0/denonext/fs-minipass.mjs": "4b5b69251541833f5a1035be0e98d46bd6d02843fd7d40720577baf6caca21ce", - "https://esm.sh/v135/get-stream@8.0.1/denonext/get-stream.mjs": "b8ab640bf2638c1ae704a217b79e0a56e7a1f97bb48bbe40d723d5ea87eb0ecb", - "https://esm.sh/v135/graphql-request@6.1.0/denonext/graphql-request.mjs": "c97af0ff1802c36ae6fdf544153140ef4d950bf164f0e5e839e71aa599ea1555", - "https://esm.sh/v135/graphql-tag@2.12.6/denonext/graphql-tag.mjs": "ebaceefc216cba74424ddc55fde9e677f6e5a3e9d556a250faa1b53483574f03", - "https://esm.sh/v135/graphql@16.8.1/denonext/graphql.mjs": "585b84022623b931e27a7a8134cd24ec50b33ea12fd18b43254527628a0fddac", - "https://esm.sh/v135/human-signals@5.0.0/denonext/human-signals.mjs": "ab3130133ac5943273c909d7887e3c16b8374f66d72c38caeea2c44d659af023", - "https://esm.sh/v135/is-stream@3.0.0/denonext/is-stream.mjs": "5c8b65f2fa051c4b18e88bbae11dac8bba9caf57752577d69bcea86d1f05c5b7", - "https://esm.sh/v135/isexe@2.0.0/denonext/isexe.mjs": "4675d9d53a332f096efd344cb1418dbda8e6f2effc8a5c81edd43cdd56636be7", - "https://esm.sh/v135/lodash.flatten@4.4.0/denonext/lodash.flatten.mjs": "8e86ab607deea15cc3c1acfb5eae278ecbc5b80f24167b4e8f4c56df3278cd55", - "https://esm.sh/v135/merge-stream@2.0.0/denonext/merge-stream.mjs": "2c2af22401c294158d6bff659d157e3d2c028c218cc1bd2246534a45a4c03c61", - "https://esm.sh/v135/mimic-fn@4.0.0/denonext/mimic-fn.mjs": "10bcf0f2f20cbbba0c289ef7bf4d2422639bbc1c36c247be876afd6fe2d67138", - "https://esm.sh/v135/minipass@3.3.6/denonext/minipass.mjs": "195894c7a7f1fb71de48b4a41af182cd3ad0e357cadc0ad9d8b5340cda895cc0", - "https://esm.sh/v135/minipass@5.0.0/denonext/minipass.mjs": "de0e049728f8c387b58c86439eb9d69a16b6a88756a6bc694e2fecbd7fd00401", - "https://esm.sh/v135/minizlib@2.1.2/denonext/minizlib.mjs": "67abb7d83dacd0de153cce5d03ee3bfd68988c992306ff843370b68f038b43e0", - "https://esm.sh/v135/mkdirp@1.0.4/denonext/mkdirp.mjs": "41bc43ec9478e772660e2b0edf998f27f0158388c94003b7292d8093e699eb7b", - "https://esm.sh/v135/nanoid@4.0.2/denonext/nanoid.mjs": "4f26e89bc0867e6a838069435b3d75af305017d87ce5b51c9d6edc680954b52f", - "https://esm.sh/v135/node-color-log@10.0.2/denonext/node-color-log.mjs": "2504391bd0ce1dd4c2bf0ed0b839b8a3ad84c028d9dd17cc58dccd2e14dacfde", - "https://esm.sh/v135/node_fetch.js": "b11355358cf61343a3c30bd5942df60a3586d13e2c979b515164bfe851662798", - "https://esm.sh/v135/npm-run-path@5.1.0/denonext/npm-run-path.mjs": "4772cda227b5c18f4293db7edf53998879c75d48e776533009ce1a8daa464bf5", - "https://esm.sh/v135/onetime@6.0.0/denonext/onetime.mjs": "5326fe5207b076a7ebc96740b4c3dcec7a2522a1aa5985e3b4157c1b9cb1e2dd", - "https://esm.sh/v135/original-fs@1.2.0/denonext/original-fs.mjs": "2b1098818e54d2c6748ff5b0dd9ea5f6a61b4b6d0f63fb625f21773d11cfc667", - "https://esm.sh/v135/path-key@3.1.1/denonext/path-key.mjs": "add83c631278b7df9b33ae84e41142db88bb291295bcc27eb4e77a1cbdfa71d0", - "https://esm.sh/v135/path-key@4.0.0/denonext/path-key.mjs": "2c2e3922bd0e6e414fa2752ff800bdc6b9208035ce797fa22e49b859f8259417", - "https://esm.sh/v135/shebang-command@2.0.0/denonext/shebang-command.mjs": "245674cc2dffa2d06fcef0540b81040b626227485e5f41d76e77d386b30b18e0", - "https://esm.sh/v135/shebang-regex@3.0.0/denonext/shebang-regex.mjs": "03983ba59dd2cba9402935e21b46d05f5249364cba9f5757aef23c6c2fea65b9", - "https://esm.sh/v135/signal-exit@4.1.0/denonext/signal-exit.mjs": "c450b9024df3b59ded71e7b52aada1ac4b3856aad93e9d64bbc6ea3cdd181824", - "https://esm.sh/v135/stringify-tree@1.1.1/denonext/stringify-tree.mjs": "6cacda15ffe7dc2e1343636549956877e1bd830be5bd56587f40f94ca7becda4", - "https://esm.sh/v135/strip-final-newline@3.0.0/denonext/strip-final-newline.mjs": "139c0958b1fb9387d8ae5b95941682245a3f3d9ae531f5de9638c2e9109831e0", - "https://esm.sh/v135/tar@6.2.0/denonext/tar.mjs": "e13b56d41286f4935cb29acae60a040148af6e2649326a70e04c5ca6fe5ef04d", - "https://esm.sh/v135/tslib@2.6.2/denonext/tslib.mjs": "29782bcd3139f77ec063dc5a9385c0fff4a8d0a23b6765c73d9edeb169a04bf1", - "https://esm.sh/v135/which@2.0.2/denonext/which.mjs": "360f7d0aa13233975c86f120e2b1aa9695252b16e287ccdc651d3123473a3482", - "https://esm.sh/v135/yallist@4.0.0/denonext/yallist.mjs": "61f180d807dda50bac17028eda05d5722a3fecef6e98a9064e2353ea6864fd82", - "https://esm.sh/v135/yaml@2.3.1/denonext/yaml.mjs": "71f677b4bfc69271af9d98db5194e354f9a1863955e208e26d32a9ef78bd89f5", - "https://esm.sh/yaml@v2.3.1": "0b42df3dec58b0999df5639390c02346de67b8dae76717a156189855fb616858", - "https://nix.fluentci.io/v0.5.3/deps.ts": "469c1f084eda8d2ee78135b0bf4f9490b80b36d8d0bdb88594167133a918da8e", - "https://nix.fluentci.io/v0.5.3/src/dagger/steps.ts": "b766f4fa9624a032e7af884a5ca47bc666a529c4a472d38b74b55ca0d63cf81d", - "https://sdk.fluentci.io/v0.3.0/deps.ts": "3a145e76b4345a9a7888f09b1b48cb54523ebfa43247a1abebc40a9e82d555f4", - "https://sdk.fluentci.io/v0.3.0/mod.ts": "261ba81a4728f5def4e327a5cd80664ea8449515a2f4eea5f3f416acae39a1fa", - "https://sdk.fluentci.io/v0.3.0/src/client.ts": "7f1df4b1fee62dd6f946fa9d15d47a37b938ffb4ac91faf3d39b44b83d4f5921", - "https://sdk.fluentci.io/v0.3.0/src/connect.ts": "4aff111c403cf78672384a10214a9885e08319dde579ec458f98a7bb04874101", - "https://sdk.fluentci.io/v0.3.0/src/context.ts": "2939ff58d0a79d7377d5553e725c9a2110a0013035a5a57abe9a9a5da975c4ce", - "https://sdk.fluentci.io/v0.3.0/src/utils.ts": "5dcd6d83553930502069d067ff42bc44698e22c23426fdb78630c4b39769d308" - } + "packages": { + "specifiers": { + "jsr:@std/assert@^0.217.0": "jsr:@std/assert@0.217.0", + "jsr:@std/assert@^0.218.2": "jsr:@std/assert@0.218.2", + "jsr:@std/flags@0.218.2": "jsr:@std/flags@0.218.2", + "jsr:@std/fmt@0.218.2": "jsr:@std/fmt@0.218.2", + "jsr:@std/fmt@^0.217.0": "jsr:@std/fmt@0.217.0", + "jsr:@std/fmt@^0.218.2": "jsr:@std/fmt@0.218.2", + "jsr:@std/path@0.218.2": "jsr:@std/path@0.218.2", + "jsr:@std/testing@0.217.0": "jsr:@std/testing@0.217.0", + "jsr:@std/testing@0.218.2": "jsr:@std/testing@0.218.2", + "jsr:@tsirysndr/env-js@0.1.2": "jsr:@tsirysndr/env-js@0.1.2", + "jsr:@tsirysndr/fluent-az-pipelines@0.3": "jsr:@tsirysndr/fluent-az-pipelines@0.3.0", + "jsr:@tsirysndr/fluent-circleci@0.3": "jsr:@tsirysndr/fluent-circleci@0.3.0", + "jsr:@tsirysndr/fluent-codepipeline@0.3": "jsr:@tsirysndr/fluent-codepipeline@0.3.0", + "jsr:@tsirysndr/fluent-gh-actions@0.3": "jsr:@tsirysndr/fluent-gh-actions@0.3.0", + "jsr:@tsirysndr/fluent-gitlab-ci@0.5": "jsr:@tsirysndr/fluent-gitlab-ci@0.5.0", + "npm:graphql-request@6.1.0": "npm:graphql-request@6.1.0_graphql@16.8.1", + "npm:graphql@16.8.1": "npm:graphql@16.8.1", + "npm:lodash@4.17.21": "npm:lodash@4.17.21", + "npm:node-color-log@11.0.2": "npm:node-color-log@11.0.2", + "npm:stringify-tree@1.1.1": "npm:stringify-tree@1.1.1", + "npm:yaml@2.3.1": "npm:yaml@2.3.1", + "npm:zod@3.22.1": "npm:zod@3.22.1" + }, + "jsr": { + "@std/assert@0.217.0": { + "integrity": "c98e279362ca6982d5285c3b89517b757c1e3477ee9f14eb2fdf80a45aaa9642", + "dependencies": [ + "jsr:@std/fmt@^0.217.0" + ] + }, + "@std/assert@0.218.2": { + "integrity": "7f0a5a1a8cf86607cd6c2c030584096e1ffad27fc9271429a8cb48cfbdee5eaf", + "dependencies": [ + "jsr:@std/fmt@^0.218.2" + ] + }, + "@std/flags@0.218.2": { + "integrity": "0d4e8ac15e7dfede26153c63a6d55d0aad56ae88beb2ede38c14c775dfc5b25e", + "dependencies": [ + "jsr:@std/assert@^0.218.2" + ] + }, + "@std/fmt@0.217.0": { + "integrity": "cb99f82500b8da20202fedfa8bb94dd0222e81f0494ed9087de20ee3d8a39a8d" + }, + "@std/fmt@0.218.2": { + "integrity": "99526449d2505aa758b6cbef81e7dd471d8b28ec0dcb1491d122b284c548788a" + }, + "@std/path@0.218.2": { + "integrity": "b568fd923d9e53ad76d17c513e7310bda8e755a3e825e6289a0ce536404e2662", + "dependencies": [ + "jsr:@std/assert@^0.218.2" + ] + }, + "@std/testing@0.217.0": { + "integrity": "97508b254ca1888d512215288bfb3f192a4e6e84336ba56b189c7862258a058b", + "dependencies": [ + "jsr:@std/assert@^0.217.0" + ] + }, + "@std/testing@0.218.2": { + "integrity": "49410b23584c924533786e6c117d71486c1daa65f4911fd6cfc95e4edba9de7f", + "dependencies": [ + "jsr:@std/assert@^0.218.2" + ] + }, + "@tsirysndr/env-js@0.1.2": { + "integrity": "16a8cf4e60c8b43f4d62dd762006de40d56e5b144a56c0954a11f99ee12c5d3a" + }, + "@tsirysndr/fluent-az-pipelines@0.3.0": { + "integrity": "a2a23089a186b0f04e45daa7a9df98527c54b845842c1ebe3b7f2cf03e5aec0d", + "dependencies": [ + "jsr:@std/testing@0.217.0", + "npm:yaml@2.3.1", + "npm:zod@3.22.1" + ] + }, + "@tsirysndr/fluent-circleci@0.3.0": { + "integrity": "f2ab207d83b7b2a728a6708a51c3ad93cf2d89b08a13460793e3b6c7af8f5dd9", + "dependencies": [ + "jsr:@std/testing@0.217.0", + "npm:yaml@2.3.1", + "npm:zod@3.22.1" + ] + }, + "@tsirysndr/fluent-codepipeline@0.3.0": { + "integrity": "3050df3fed469d6791831a0a83529de77732d14c27f4a1446788de2c740c73df", + "dependencies": [ + "jsr:@std/testing@0.217.0", + "npm:yaml@2.3.1", + "npm:zod@3.22.1" + ] + }, + "@tsirysndr/fluent-gh-actions@0.3.0": { + "integrity": "2eaff18fbe9b25042fbb321d3bec61a34a15f736ec95bd2da214dcd1c3b8d5cd", + "dependencies": [ + "jsr:@std/testing@0.217.0", + "npm:yaml@2.3.1", + "npm:zod@3.22.1" + ] + }, + "@tsirysndr/fluent-gitlab-ci@0.5.0": { + "integrity": "57e7d231375902358d2bd5b63766f8ffb7030157a9e3764d5e0b0fb7533dd3f9", + "dependencies": [ + "jsr:@std/testing@0.217.0", + "npm:yaml@2.3.1", + "npm:zod@3.22.1" + ] + } + }, + "npm": { + "@graphql-typed-document-node/core@3.2.0_graphql@16.8.1": { + "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", + "dependencies": { + "graphql": "graphql@16.8.1" + } + }, + "@types/lodash.flatten@4.4.9": { + "integrity": "sha512-JCW9xofpn9oJfFSccpBRF8IrB5guqmcKZIa7J9DnZqLd9wgGYbewaYnjbNw3Fb+St8BHVsnGmmS0A3j99LII3Q==", + "dependencies": { + "@types/lodash": "@types/lodash@4.14.202" + } + }, + "@types/lodash@4.14.202": { + "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", + "dependencies": {} + }, + "cross-fetch@3.1.8": { + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", + "dependencies": { + "node-fetch": "node-fetch@2.7.0" + } + }, + "graphql-request@6.1.0_graphql@16.8.1": { + "integrity": "sha512-p+XPfS4q7aIpKVcgmnZKhMNqhltk20hfXtkaIkTfjjmiKMJ5xrt5c743cL03y/K7y1rg3WrIC49xGiEQ4mxdNw==", + "dependencies": { + "@graphql-typed-document-node/core": "@graphql-typed-document-node/core@3.2.0_graphql@16.8.1", + "cross-fetch": "cross-fetch@3.1.8", + "graphql": "graphql@16.8.1" + } + }, + "graphql@16.8.1": { + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", + "dependencies": {} + }, + "lodash.flatten@4.4.0": { + "integrity": "sha512-C5N2Z3DgnnKr0LOpv/hKCgKdb7ZZwafIrsesve6lmzvZIRZRGaZ/l6Q8+2W7NaT+ZwO3fFlSCzCzrDCFdJfZ4g==", + "dependencies": {} + }, + "lodash@4.17.21": { + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dependencies": {} + }, + "node-color-log@11.0.2": { + "integrity": "sha512-+gD5pQpVpEkEA3He9STku4VL1EO9SaOW3HElumCd3xWorulnfr2053NCSVwPCXrkwI5ihPYucQxSCSOuS1q+Eg==", + "dependencies": {} + }, + "node-fetch@2.7.0": { + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "dependencies": { + "whatwg-url": "whatwg-url@5.0.0" + } + }, + "stringify-tree@1.1.1": { + "integrity": "sha512-lVfVX+HJ9Gx2NUv0vJTRhqCPYlgzbdR25MF34Md1Bjq6jvJocOLgfHhusYtBSKi/bwpkgLGjtF/dVZlBbA6oZw==", + "dependencies": { + "@types/lodash.flatten": "@types/lodash.flatten@4.4.9", + "lodash.flatten": "lodash.flatten@4.4.0" + } + }, + "tr46@0.0.3": { + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dependencies": {} + }, + "webidl-conversions@3.0.1": { + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dependencies": {} + }, + "whatwg-url@5.0.0": { + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dependencies": { + "tr46": "tr46@0.0.3", + "webidl-conversions": "webidl-conversions@3.0.1" + } + }, + "yaml@2.3.1": { + "integrity": "sha512-2eHWfjaoXgTBC2jNM1LRef62VQa0umtvRiDSk6HSzW7RvS5YtkabJrwYLLEKWBc8a5U2PTSCs+dJjUTJdlHsWQ==", + "dependencies": {} + }, + "zod@3.22.1": { + "integrity": "sha512-+qUhAMl414+Elh+fRNtpU+byrwjDFOS1N7NioLY+tSlcADTx4TkCUua/hxJvxwDXcV4397/nZ420jy4n4+3WUg==", + "dependencies": {} + } + } + }, + "remote": {} } diff --git a/example/.fluentci/deps.ts b/example/.fluentci/deps.ts index 3c08da8..747351a 100644 --- a/example/.fluentci/deps.ts +++ b/example/.fluentci/deps.ts @@ -1,23 +1,23 @@ -export { assertEquals } from "https://deno.land/std@0.191.0/testing/asserts.ts"; +export { assertEquals } from "jsr:@std/testing@0.218.2/asserts"; -export { connect, uploadContext } from "https://sdk.fluentci.io/v0.3.0/mod.ts"; -export { brightGreen } from "https://deno.land/std@0.191.0/fmt/colors.ts"; -export { withDevbox } from "https://nix.fluentci.io/v0.5.3/src/dagger/steps.ts"; -export { stringifyTree } from "https://esm.sh/stringify-tree@1.1.1"; -import gql from "https://esm.sh/graphql-tag@2.12.6"; +export type { DirectoryID, SecretID } from "./sdk/client.gen.ts"; +export { File, Directory, Secret, dag } from "./sdk/client.gen.ts"; +export { brightGreen } from "jsr:@std/fmt@0.218.2/colors"; +export { stringifyTree } from "npm:stringify-tree@1.1.1"; +import { gql } from "npm:graphql-request@6.1.0"; export { gql }; -export { - dirname, - join, - resolve, -} from "https://deno.land/std@0.203.0/path/mod.ts"; -export { parse } from "https://deno.land/std@0.205.0/flags/mod.ts"; -export { snakeCase, camelCase } from "https://cdn.skypack.dev/lodash"; +export { dirname, join, resolve } from "jsr:@std/path@0.218.2"; +export { parse } from "jsr:@std/flags@0.218.2"; -export { - ClientError, - GraphQLClient, -} from "https://esm.sh/v128/graphql-request@6.1.0"; +import * as _ from "npm:lodash@4.17.21"; +const snakeCase = _.default.snakeCase; +const camelCase = _.default.camelCase; +export { snakeCase, camelCase }; + +import * as env from "jsr:@tsirysndr/env-js@0.1.2"; +export { env }; + +export { ClientError, GraphQLClient } from "npm:graphql-request@6.1.0"; export { DaggerSDKError, UnknownDaggerError, @@ -31,15 +31,10 @@ export { EngineSessionConnectionTimeoutError, NotAwaitedRequestError, ERROR_CODES, -} from "https://esm.sh/@dagger.io/dagger@0.9.3"; - -export type { - CallbackFct, - ConnectOpts, -} from "https://sdk.fluentci.io/v0.3.0/mod.ts"; +} from "./sdk/common/errors/index.ts"; -export * as FluentGitlabCI from "https://deno.land/x/fluent_gitlab_ci@v0.4.2/mod.ts"; -export * as FluentGithubActions from "https://deno.land/x/fluent_github_actions@v0.2.1/mod.ts"; -export * as FluentCircleCI from "https://deno.land/x/fluent_circleci@v0.2.5/mod.ts"; -export * as FluentAzurePipelines from "https://deno.land/x/fluent_azure_pipelines@v0.2.0/mod.ts"; -export * as FluentAWSCodePipeline from "https://deno.land/x/fluent_aws_codepipeline@v0.2.3/mod.ts"; +export * as FluentGitlabCI from "jsr:@tsirysndr/fluent-gitlab-ci@0.5"; +export * as FluentGithubActions from "jsr:@tsirysndr/fluent-gh-actions@0.3"; +export * as FluentCircleCI from "jsr:@tsirysndr/fluent-circleci@0.3"; +export * as FluentAzurePipelines from "jsr:@tsirysndr/fluent-az-pipelines@0.3"; +export * as FluentAWSCodePipeline from "jsr:@tsirysndr/fluent-codepipeline@0.3"; diff --git a/example/.fluentci/sdk/builder.ts b/example/.fluentci/sdk/builder.ts index f06951a..10182d6 100644 --- a/example/.fluentci/sdk/builder.ts +++ b/example/.fluentci/sdk/builder.ts @@ -1,5 +1,6 @@ import { createGQLClient } from "./client.ts"; import { Context } from "./context.ts"; +import { env } from "../deps.ts"; /** * @hidden @@ -10,9 +11,9 @@ export function initDefaultContext(): Context { let ctx = new Context(); // Prefer DAGGER_SESSION_PORT if set - const daggerSessionPort = Deno.env.get("DAGGER_SESSION_PORT"); + const daggerSessionPort = env.get("DAGGER_SESSION_PORT"); if (daggerSessionPort) { - const sessionToken = Deno.env.get("DAGGER_SESSION_TOKEN"); + const sessionToken = env.get("DAGGER_SESSION_TOKEN"); if (!sessionToken) { throw new Error( "DAGGER_SESSION_TOKEN must be set when using DAGGER_SESSION_PORT" diff --git a/example/.fluentci/sdk/client.gen.ts b/example/.fluentci/sdk/client.gen.ts index ae06cef..5e20f82 100644 --- a/example/.fluentci/sdk/client.gen.ts +++ b/example/.fluentci/sdk/client.gen.ts @@ -127,7 +127,7 @@ export type ContainerBuildOpts = { * * They will be mounted at /run/secrets/[secret-name] in the build container * - * They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl http://example.com?token=$(cat /run/secrets/my-secret) + * They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl [http://example.com?token=$(cat /run/secrets/my-secret)](http://example.com?token=$(cat /run/secrets/my-secret)) */ secrets?: Secret[]; }; @@ -306,6 +306,22 @@ export type ContainerWithFileOpts = { owner?: string; }; +export type ContainerWithFilesOpts = { + /** + * Permission given to the copied files (e.g., 0600). + */ + permissions?: number; + + /** + * A user:group to set for the files. + * + * The user and group can either be an ID (1000:1000) or a name (foo:bar). + * + * If the group is omitted, it defaults to the same as the user. + */ + owner?: string; +}; + export type ContainerWithMountedCacheOpts = { /** * Identifier of the directory to use as the cache volume's root. @@ -439,13 +455,13 @@ export type CurrentModuleID = string & { __CurrentModuleID: never }; export type DirectoryAsModuleOpts = { /** - * An optional subpath of the directory which contains the module's source code. + * An optional subpath of the directory which contains the module's configuration file. * * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory. * * If not set, the module source code is loaded from the root of the directory. */ - sourceSubpath?: string; + sourceRootPath?: string; }; export type DirectoryDockerBuildOpts = { @@ -515,6 +531,13 @@ export type DirectoryWithFileOpts = { permissions?: number; }; +export type DirectoryWithFilesOpts = { + /** + * Permission given to the copied files (e.g., 0600). + */ + permissions?: number; +}; + export type DirectoryWithNewDirectoryOpts = { /** * Permission granted to the created directory (e.g., 0777). @@ -852,11 +875,6 @@ export type ClientModuleDependencyOpts = { }; export type ClientModuleSourceOpts = { - /** - * An explicitly set root directory for the module source. This is required to load local sources as modules; other source types implicitly encode the root directory and do not require this. - */ - rootDirectory?: Directory; - /** * If true, enforce that the source is a stable version for source kinds that support versioning. */ @@ -875,6 +893,10 @@ export type ClientPipelineOpts = { labels?: PipelineLabel[]; }; +export type ClientSecretOpts = { + accessor?: string; +}; + /** * The `SecretID` scalar type represents an identifier for an object of type Secret. */ @@ -1184,7 +1206,7 @@ export class Container extends BaseClient { * * They will be mounted at /run/secrets/[secret-name] in the build container * - * They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl http://example.com?token=$(cat /run/secrets/my-secret) + * They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl [http://example.com?token=$(cat /run/secrets/my-secret)](http://example.com?token=$(cat /run/secrets/my-secret)) */ build = (context: Directory, opts?: ContainerBuildOpts): Container => { return new Container({ @@ -1993,6 +2015,34 @@ export class Container extends BaseClient { }); }; + /** + * Retrieves this container plus the contents of the given files copied to the given path. + * @param path Location where copied files should be placed (e.g., "/src"). + * @param sources Identifiers of the files to copy. + * @param opts.permissions Permission given to the copied files (e.g., 0600). + * @param opts.owner A user:group to set for the files. + * + * The user and group can either be an ID (1000:1000) or a name (foo:bar). + * + * If the group is omitted, it defaults to the same as the user. + */ + withFiles = ( + path: string, + sources: File[], + opts?: ContainerWithFilesOpts + ): Container => { + return new Container({ + queryTree: [ + ...this._queryTree, + { + operation: "withFiles", + args: { path, sources, ...opts }, + }, + ], + ctx: this._ctx, + }); + }; + /** * Indicate that subsequent operations should be featured more prominently in the UI. */ @@ -2719,7 +2769,7 @@ export class Directory extends BaseClient { /** * Load the directory as a Dagger module - * @param opts.sourceSubpath An optional subpath of the directory which contains the module's source code. + * @param opts.sourceRootPath An optional subpath of the directory which contains the module's configuration file. * * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory. * @@ -2956,6 +3006,29 @@ export class Directory extends BaseClient { }); }; + /** + * Retrieves this directory plus the contents of the given files copied to the given path. + * @param path Location where copied files should be placed (e.g., "/src"). + * @param sources Identifiers of the files to copy. + * @param opts.permissions Permission given to the copied files (e.g., 0600). + */ + withFiles = ( + path: string, + sources: File[], + opts?: DirectoryWithFilesOpts + ): Directory => { + return new Directory({ + queryTree: [ + ...this._queryTree, + { + operation: "withFiles", + args: { path, sources, ...opts }, + }, + ], + ctx: this._ctx, + }); + }; + /** * Retrieves this directory plus a new directory created at the given path. * @param path Location of the directory created (e.g., "/logs"). @@ -4167,7 +4240,7 @@ export class GitModuleSource extends BaseClient { private readonly _cloneURL?: string = undefined; private readonly _commit?: string = undefined; private readonly _htmlURL?: string = undefined; - private readonly _sourceSubpath?: string = undefined; + private readonly _rootSubpath?: string = undefined; private readonly _version?: string = undefined; /** @@ -4179,7 +4252,7 @@ export class GitModuleSource extends BaseClient { _cloneURL?: string, _commit?: string, _htmlURL?: string, - _sourceSubpath?: string, + _rootSubpath?: string, _version?: string ) { super(parent); @@ -4188,7 +4261,7 @@ export class GitModuleSource extends BaseClient { this._cloneURL = _cloneURL; this._commit = _commit; this._htmlURL = _htmlURL; - this._sourceSubpath = _sourceSubpath; + this._rootSubpath = _rootSubpath; this._version = _version; } @@ -4255,6 +4328,21 @@ export class GitModuleSource extends BaseClient { return response; }; + /** + * The directory containing everything needed to load load and use the module. + */ + contextDirectory = (): Directory => { + return new Directory({ + queryTree: [ + ...this._queryTree, + { + operation: "contextDirectory", + }, + ], + ctx: this._ctx, + }); + }; + /** * The URL to the source's git repo in a web browser */ @@ -4277,18 +4365,18 @@ export class GitModuleSource extends BaseClient { }; /** - * The path to the module source code dir specified by this source relative to the source's root directory. + * The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory). */ - sourceSubpath = async (): Promise => { - if (this._sourceSubpath) { - return this._sourceSubpath; + rootSubpath = async (): Promise => { + if (this._rootSubpath) { + return this._rootSubpath; } const response: Awaited = await computeQuery( [ ...this._queryTree, { - operation: "sourceSubpath", + operation: "rootSubpath", }, ], await this._ctx.connection() @@ -5074,7 +5162,7 @@ export class ListTypeDef extends BaseClient { */ export class LocalModuleSource extends BaseClient { private readonly _id?: LocalModuleSourceID = undefined; - private readonly _sourceSubpath?: string = undefined; + private readonly _rootSubpath?: string = undefined; /** * Constructor is used for internal usage only, do not create object from it. @@ -5082,12 +5170,12 @@ export class LocalModuleSource extends BaseClient { constructor( parent?: { queryTree?: QueryTree[]; ctx: Context }, _id?: LocalModuleSourceID, - _sourceSubpath?: string + _rootSubpath?: string ) { super(parent); this._id = _id; - this._sourceSubpath = _sourceSubpath; + this._rootSubpath = _rootSubpath; } /** @@ -5112,18 +5200,33 @@ export class LocalModuleSource extends BaseClient { }; /** - * The path to the module source code dir specified by this source. + * The directory containing everything needed to load load and use the module. */ - sourceSubpath = async (): Promise => { - if (this._sourceSubpath) { - return this._sourceSubpath; + contextDirectory = (): Directory => { + return new Directory({ + queryTree: [ + ...this._queryTree, + { + operation: "contextDirectory", + }, + ], + ctx: this._ctx, + }); + }; + + /** + * The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory). + */ + rootSubpath = async (): Promise => { + if (this._rootSubpath) { + return this._rootSubpath; } const response: Awaited = await computeQuery( [ ...this._queryTree, { - operation: "sourceSubpath", + operation: "rootSubpath", }, ], await this._ctx.connection() @@ -5282,14 +5385,29 @@ export class Module_ extends BaseClient { }; /** - * The module's root directory containing the config file for it and its source (possibly as a subdir). It includes any generated code or updated config files created after initial load, but not any files/directories that were unchanged after sdk codegen was run. + * The generated files and directories made on top of the module source's context directory. + */ + generatedContextDiff = (): Directory => { + return new Directory({ + queryTree: [ + ...this._queryTree, + { + operation: "generatedContextDiff", + }, + ], + ctx: this._ctx, + }); + }; + + /** + * The module source's context plus any configuration and source files created by codegen. */ - generatedSourceRootDirectory = (): Directory => { + generatedContextDirectory = (): Directory => { return new Directory({ queryTree: [ ...this._queryTree, { - operation: "generatedSourceRootDirectory", + operation: "generatedContextDirectory", }, ], ctx: this._ctx, @@ -5482,23 +5600,6 @@ export class Module_ extends BaseClient { }); }; - /** - * Update the module configuration to use the given dependencies. - * @param dependencies The dependency modules to install. - */ - withDependencies = (dependencies: ModuleDependency[]): Module_ => { - return new Module_({ - queryTree: [ - ...this._queryTree, - { - operation: "withDependencies", - args: { dependencies }, - }, - ], - ctx: this._ctx, - }); - }; - /** * Retrieves the module with the given description * @param description The description to set @@ -5532,23 +5633,6 @@ export class Module_ extends BaseClient { }); }; - /** - * Update the module configuration to use the given name. - * @param name The name to use. - */ - withName = (name: string): Module_ => { - return new Module_({ - queryTree: [ - ...this._queryTree, - { - operation: "withName", - args: { name }, - }, - ], - ctx: this._ctx, - }); - }; - /** * This module plus the given Object type and associated functions. */ @@ -5565,23 +5649,6 @@ export class Module_ extends BaseClient { }); }; - /** - * Update the module configuration to use the given SDK. - * @param sdk The SDK to use. - */ - withSDK = (sdk: string): Module_ => { - return new Module_({ - queryTree: [ - ...this._queryTree, - { - operation: "withSDK", - args: { sdk }, - }, - ], - ctx: this._ctx, - }); - }; - /** * Retrieves the module with basic configuration loaded if present. * @param source The module source to initialize from. @@ -5694,9 +5761,13 @@ export class ModuleDependency extends BaseClient { export class ModuleSource extends BaseClient { private readonly _id?: ModuleSourceID = undefined; private readonly _asString?: string = undefined; + private readonly _configExists?: boolean = undefined; private readonly _kind?: ModuleSourceKind = undefined; private readonly _moduleName?: string = undefined; - private readonly _subpath?: string = undefined; + private readonly _moduleOriginalName?: string = undefined; + private readonly _resolveContextPathFromCaller?: string = undefined; + private readonly _sourceRootSubpath?: string = undefined; + private readonly _sourceSubpath?: string = undefined; /** * Constructor is used for internal usage only, do not create object from it. @@ -5705,17 +5776,25 @@ export class ModuleSource extends BaseClient { parent?: { queryTree?: QueryTree[]; ctx: Context }, _id?: ModuleSourceID, _asString?: string, + _configExists?: boolean, _kind?: ModuleSourceKind, _moduleName?: string, - _subpath?: string + _moduleOriginalName?: string, + _resolveContextPathFromCaller?: string, + _sourceRootSubpath?: string, + _sourceSubpath?: string ) { super(parent); this._id = _id; this._asString = _asString; + this._configExists = _configExists; this._kind = _kind; this._moduleName = _moduleName; - this._subpath = _subpath; + this._moduleOriginalName = _moduleOriginalName; + this._resolveContextPathFromCaller = _resolveContextPathFromCaller; + this._sourceRootSubpath = _sourceRootSubpath; + this._sourceSubpath = _sourceSubpath; } /** @@ -5806,7 +5885,81 @@ export class ModuleSource extends BaseClient { }; /** - * The directory containing the actual module's source code, as determined from the root directory and subpath. + * Returns whether the module source has a configuration file. + */ + configExists = async (): Promise => { + if (this._configExists) { + return this._configExists; + } + + const response: Awaited = await computeQuery( + [ + ...this._queryTree, + { + operation: "configExists", + }, + ], + await this._ctx.connection() + ); + + return response; + }; + + /** + * The directory containing everything needed to load load and use the module. + */ + contextDirectory = (): Directory => { + return new Directory({ + queryTree: [ + ...this._queryTree, + { + operation: "contextDirectory", + }, + ], + ctx: this._ctx, + }); + }; + + /** + * The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls. + */ + dependencies = async (): Promise => { + type dependencies = { + id: ModuleDependencyID; + }; + + const response: Awaited = await computeQuery( + [ + ...this._queryTree, + { + operation: "dependencies", + }, + { + operation: "id", + }, + ], + await this._ctx.connection() + ); + + return response.map( + (r) => + new ModuleDependency( + { + queryTree: [ + { + operation: "loadModuleDependencyFromID", + args: { id: r.id }, + }, + ], + ctx: this._ctx, + }, + r.id + ) + ); + }; + + /** + * The directory containing the module configuration and source code (source code may be in a subdir). * @param path The path from the source directory to select. */ directory = (path: string): Directory => { @@ -5844,7 +5997,7 @@ export class ModuleSource extends BaseClient { }; /** - * If set, the name of the module this source references + * If set, the name of the module this source references, including any overrides at runtime by callers. */ moduleName = async (): Promise => { if (this._moduleName) { @@ -5864,6 +6017,48 @@ export class ModuleSource extends BaseClient { return response; }; + /** + * The original name of the module this source references, as defined in the module configuration. + */ + moduleOriginalName = async (): Promise => { + if (this._moduleOriginalName) { + return this._moduleOriginalName; + } + + const response: Awaited = await computeQuery( + [ + ...this._queryTree, + { + operation: "moduleOriginalName", + }, + ], + await this._ctx.connection() + ); + + return response; + }; + + /** + * The path to the module source's context directory on the caller's filesystem. Only valid for local sources. + */ + resolveContextPathFromCaller = async (): Promise => { + if (this._resolveContextPathFromCaller) { + return this._resolveContextPathFromCaller; + } + + const response: Awaited = await computeQuery( + [ + ...this._queryTree, + { + operation: "resolveContextPathFromCaller", + }, + ], + await this._ctx.connection() + ); + + return response; + }; + /** * Resolve the provided module source arg as a dependency relative to this module source. * @param dep The dependency module source to resolve. @@ -5882,14 +6077,14 @@ export class ModuleSource extends BaseClient { }; /** - * The root directory of the module source that contains its configuration and source code (which may be in a subdirectory of this root). + * Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources. */ - rootDirectory = (): Directory => { - return new Directory({ + resolveFromCaller = (): ModuleSource => { + return new ModuleSource({ queryTree: [ ...this._queryTree, { - operation: "rootDirectory", + operation: "resolveFromCaller", }, ], ctx: this._ctx, @@ -5897,18 +6092,39 @@ export class ModuleSource extends BaseClient { }; /** - * The path to the module subdirectory containing the actual module's source code. + * The path relative to context of the root of the module source, which contains dagger.json. It also contains the module implementation source code, but that may or may not being a subdir of this root. + */ + sourceRootSubpath = async (): Promise => { + if (this._sourceRootSubpath) { + return this._sourceRootSubpath; + } + + const response: Awaited = await computeQuery( + [ + ...this._queryTree, + { + operation: "sourceRootSubpath", + }, + ], + await this._ctx.connection() + ); + + return response; + }; + + /** + * The path relative to context of the module implementation source code. */ - subpath = async (): Promise => { - if (this._subpath) { - return this._subpath; + sourceSubpath = async (): Promise => { + if (this._sourceSubpath) { + return this._sourceSubpath; } const response: Awaited = await computeQuery( [ ...this._queryTree, { - operation: "subpath", + operation: "sourceSubpath", }, ], await this._ctx.connection() @@ -5917,6 +6133,91 @@ export class ModuleSource extends BaseClient { return response; }; + /** + * Update the module source with a new context directory. Only valid for local sources. + * @param dir The directory to set as the context directory. + */ + withContextDirectory = (dir: Directory): ModuleSource => { + return new ModuleSource({ + queryTree: [ + ...this._queryTree, + { + operation: "withContextDirectory", + args: { dir }, + }, + ], + ctx: this._ctx, + }); + }; + + /** + * Append the provided dependencies to the module source's dependency list. + * @param dependencies The dependencies to append. + */ + withDependencies = (dependencies: ModuleDependency[]): ModuleSource => { + return new ModuleSource({ + queryTree: [ + ...this._queryTree, + { + operation: "withDependencies", + args: { dependencies }, + }, + ], + ctx: this._ctx, + }); + }; + + /** + * Update the module source with a new name. + * @param name The name to set. + */ + withName = (name: string): ModuleSource => { + return new ModuleSource({ + queryTree: [ + ...this._queryTree, + { + operation: "withName", + args: { name }, + }, + ], + ctx: this._ctx, + }); + }; + + /** + * Update the module source with a new SDK. + * @param sdk The SDK to set. + */ + withSDK = (sdk: string): ModuleSource => { + return new ModuleSource({ + queryTree: [ + ...this._queryTree, + { + operation: "withSDK", + args: { sdk }, + }, + ], + ctx: this._ctx, + }); + }; + + /** + * Update the module source with a new source subpath. + * @param path The path to set as the source subpath. + */ + withSourceSubpath = (path: string): ModuleSource => { + return new ModuleSource({ + queryTree: [ + ...this._queryTree, + { + operation: "withSourceSubpath", + args: { path }, + }, + ], + ctx: this._ctx, + }); + }; + /** * Call the provided function with current ModuleSource. * @@ -6312,6 +6613,23 @@ export class Client extends BaseClient { }); }; + /** + * Retrieves a container builtin to the engine. + * @param digest Digest of the image manifest + */ + builtinContainer = (digest: string): Container => { + return new Container({ + queryTree: [ + ...this._queryTree, + { + operation: "builtinContainer", + args: { digest }, + }, + ], + ctx: this._ctx, + }); + }; + /** * Constructs a cache volume for a given cache key. * @param key A string identifier to target this cache volume (e.g., "modules-cache"). @@ -7119,7 +7437,6 @@ export class Client extends BaseClient { /** * Create a new module source instance from a source ref string. * @param refString The string ref representation of the module source - * @param opts.rootDirectory An explicitly set root directory for the module source. This is required to load local sources as modules; other source types implicitly encode the root directory and do not require this. * @param opts.stable If true, enforce that the source is a stable version for source kinds that support versioning. */ moduleSource = ( @@ -7160,13 +7477,13 @@ export class Client extends BaseClient { /** * Reference a secret by name. */ - secret = (name: string): Secret => { + secret = (name: string, opts?: ClientSecretOpts): Secret => { return new Secret({ queryTree: [ ...this._queryTree, { operation: "secret", - args: { name }, + args: { name, ...opts }, }, ], ctx: this._ctx, diff --git a/example/.fluentci/sdk/common/errors/DaggerSDKError.ts b/example/.fluentci/sdk/common/errors/DaggerSDKError.ts new file mode 100644 index 0000000..f2f009d --- /dev/null +++ b/example/.fluentci/sdk/common/errors/DaggerSDKError.ts @@ -0,0 +1,46 @@ +import { log } from "../utils.ts"; +import { ErrorCodes, ErrorNames } from "./errors-codes.ts"; + +export interface DaggerSDKErrorOptions { + cause?: Error; +} + +/** + * The base error. Every other error inherits this error. + */ +export abstract class DaggerSDKError extends Error { + /** + * The name of the dagger error. + */ + abstract readonly name: ErrorNames; + + /** + * The dagger specific error code. + * Use this to identify dagger errors programmatically. + */ + abstract readonly code: ErrorCodes; + + /** + * The original error, which caused the DaggerSDKError. + */ + cause?: Error; + + protected constructor(message: string, options?: DaggerSDKErrorOptions) { + super(message); + this.cause = options?.cause; + } + + /** + * @hidden + */ + get [Symbol.toStringTag]() { + return this.name; + } + + /** + * Pretty prints the error + */ + printStackTrace() { + log(this.stack); + } +} diff --git a/example/.fluentci/sdk/common/errors/DockerImageRefValidationError.ts b/example/.fluentci/sdk/common/errors/DockerImageRefValidationError.ts new file mode 100644 index 0000000..6f45b46 --- /dev/null +++ b/example/.fluentci/sdk/common/errors/DockerImageRefValidationError.ts @@ -0,0 +1,28 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts" +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts" + +interface DockerImageRefValidationErrorOptions extends DaggerSDKErrorOptions { + ref: string +} + +/** + * This error is thrown if the passed image reference does not pass validation and is not compliant with the + * DockerImage constructor. + */ +export class DockerImageRefValidationError extends DaggerSDKError { + name = ERROR_NAMES.DockerImageRefValidationError + code = ERROR_CODES.DockerImageRefValidationError + + /** + * The docker image reference, which caused the error. + */ + ref: string + + /** + * @hidden + */ + constructor(message: string, options: DockerImageRefValidationErrorOptions) { + super(message, options) + this.ref = options?.ref + } +} diff --git a/example/.fluentci/sdk/common/errors/EngineSessionConnectParamsParseError.ts b/example/.fluentci/sdk/common/errors/EngineSessionConnectParamsParseError.ts new file mode 100644 index 0000000..8acd47a --- /dev/null +++ b/example/.fluentci/sdk/common/errors/EngineSessionConnectParamsParseError.ts @@ -0,0 +1,31 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +interface EngineSessionConnectParamsParseErrorOptions + extends DaggerSDKErrorOptions { + parsedLine: string; +} + +/** + * This error is thrown if the EngineSession does not manage to parse the required connection parameters from the session binary + */ +export class EngineSessionConnectParamsParseError extends DaggerSDKError { + name = ERROR_NAMES.EngineSessionConnectParamsParseError; + code = ERROR_CODES.EngineSessionConnectParamsParseError; + + /** + * the line, which caused the error during parsing, if the error was caused because of parsing. + */ + parsedLine: string; + + /** + * @hidden + */ + constructor( + message: string, + options: EngineSessionConnectParamsParseErrorOptions + ) { + super(message, options); + this.parsedLine = options.parsedLine; + } +} diff --git a/example/.fluentci/sdk/common/errors/EngineSessionConnectionTimeoutError.ts b/example/.fluentci/sdk/common/errors/EngineSessionConnectionTimeoutError.ts new file mode 100644 index 0000000..e2550ac --- /dev/null +++ b/example/.fluentci/sdk/common/errors/EngineSessionConnectionTimeoutError.ts @@ -0,0 +1,31 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +interface EngineSessionConnectionTimeoutErrorOptions + extends DaggerSDKErrorOptions { + timeOutDuration: number; +} + +/** + * This error is thrown if the EngineSession does not manage to parse the required port successfully because the sessions connection timed out. + */ +export class EngineSessionConnectionTimeoutError extends DaggerSDKError { + name = ERROR_NAMES.EngineSessionConnectionTimeoutError; + code = ERROR_CODES.EngineSessionConnectionTimeoutError; + + /** + * The duration until the timeout occurred in ms. + */ + timeOutDuration: number; + + /** + * @hidden + */ + constructor( + message: string, + options: EngineSessionConnectionTimeoutErrorOptions + ) { + super(message, options); + this.timeOutDuration = options.timeOutDuration; + } +} diff --git a/example/.fluentci/sdk/common/errors/EngineSessionErrorOptions.ts b/example/.fluentci/sdk/common/errors/EngineSessionErrorOptions.ts new file mode 100644 index 0000000..ba0ec90 --- /dev/null +++ b/example/.fluentci/sdk/common/errors/EngineSessionErrorOptions.ts @@ -0,0 +1,20 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +type EngineSessionErrorOptions = DaggerSDKErrorOptions; + +/** + * This error is thrown if the EngineSession does not manage to parse the required port successfully because a EOF is read before any valid port. + * This usually happens if no connection can be established. + */ +export class EngineSessionError extends DaggerSDKError { + name = ERROR_NAMES.EngineSessionError; + code = ERROR_CODES.EngineSessionError; + + /** + * @hidden + */ + constructor(message: string, options?: EngineSessionErrorOptions) { + super(message, options); + } +} diff --git a/example/.fluentci/sdk/common/errors/ExecError.ts b/example/.fluentci/sdk/common/errors/ExecError.ts new file mode 100644 index 0000000..ede655b --- /dev/null +++ b/example/.fluentci/sdk/common/errors/ExecError.ts @@ -0,0 +1,54 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +interface ExecErrorOptions extends DaggerSDKErrorOptions { + cmd: string[]; + exitCode: number; + stdout: string; + stderr: string; +} + +/** + * API error from an exec operation in a pipeline. + */ +export class ExecError extends DaggerSDKError { + name = ERROR_NAMES.ExecError; + code = ERROR_CODES.ExecError; + + /** + * The command that caused the error. + */ + cmd: string[]; + + /** + * The exit code of the command. + */ + exitCode: number; + + /** + * The stdout of the command. + */ + stdout: string; + + /** + * The stderr of the command. + */ + stderr: string; + + /** + * @hidden + */ + constructor(message: string, options: ExecErrorOptions) { + super(message, options); + this.cmd = options.cmd; + this.exitCode = options.exitCode; + this.stdout = options.stdout; + this.stderr = options.stderr; + } + + toString(): string { + return `${super.toString()}\nStdout:\n${this.stdout}\nStderr:\n${ + this.stderr + }`; + } +} diff --git a/example/.fluentci/sdk/common/errors/GraphQLRequestError.ts b/example/.fluentci/sdk/common/errors/GraphQLRequestError.ts new file mode 100644 index 0000000..59584f8 --- /dev/null +++ b/example/.fluentci/sdk/common/errors/GraphQLRequestError.ts @@ -0,0 +1,36 @@ +import { GraphQLRequestContext, GraphQLResponse } from "./types.ts"; + +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +interface GraphQLRequestErrorOptions extends DaggerSDKErrorOptions { + response: GraphQLResponse; + request: GraphQLRequestContext; +} + +/** + * This error originates from the dagger engine. It means that some error was thrown and sent back via GraphQL. + */ +export class GraphQLRequestError extends DaggerSDKError { + name = ERROR_NAMES.GraphQLRequestError; + code = ERROR_CODES.GraphQLRequestError; + + /** + * The query and variables, which caused the error. + */ + requestContext: GraphQLRequestContext; + + /** + * the GraphQL response containing the error. + */ + response: GraphQLResponse; + + /** + * @hidden + */ + constructor(message: string, options: GraphQLRequestErrorOptions) { + super(message, options); + this.requestContext = options.request; + this.response = options.response; + } +} diff --git a/example/.fluentci/sdk/common/errors/InitEngineSessionBinaryError.ts b/example/.fluentci/sdk/common/errors/InitEngineSessionBinaryError.ts new file mode 100644 index 0000000..879c1ce --- /dev/null +++ b/example/.fluentci/sdk/common/errors/InitEngineSessionBinaryError.ts @@ -0,0 +1,17 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +/** + * This error is thrown if the dagger binary cannot be copied from the dagger docker image and copied to the local host. + */ +export class InitEngineSessionBinaryError extends DaggerSDKError { + name = ERROR_NAMES.InitEngineSessionBinaryError; + code = ERROR_CODES.InitEngineSessionBinaryError; + + /** + * @hidden + */ + constructor(message: string, options?: DaggerSDKErrorOptions) { + super(message, options); + } +} diff --git a/example/.fluentci/sdk/common/errors/NotAwaitedRequestError.ts b/example/.fluentci/sdk/common/errors/NotAwaitedRequestError.ts new file mode 100644 index 0000000..291b924 --- /dev/null +++ b/example/.fluentci/sdk/common/errors/NotAwaitedRequestError.ts @@ -0,0 +1,17 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +/** + * This error is thrown when the compute function isn't awaited. + */ +export class NotAwaitedRequestError extends DaggerSDKError { + name = ERROR_NAMES.NotAwaitedRequestError; + code = ERROR_CODES.NotAwaitedRequestError; + + /** + * @hidden + */ + constructor(message: string, options?: DaggerSDKErrorOptions) { + super(message, options); + } +} diff --git a/example/.fluentci/sdk/common/errors/TooManyNestedObjectsError.ts b/example/.fluentci/sdk/common/errors/TooManyNestedObjectsError.ts new file mode 100644 index 0000000..7b8b907 --- /dev/null +++ b/example/.fluentci/sdk/common/errors/TooManyNestedObjectsError.ts @@ -0,0 +1,27 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +interface TooManyNestedObjectsErrorOptions extends DaggerSDKErrorOptions { + response: unknown; +} + +/** + * Dagger only expects one response value from the engine. If the engine returns more than one value this error is thrown. + */ +export class TooManyNestedObjectsError extends DaggerSDKError { + name = ERROR_NAMES.TooManyNestedObjectsError; + code = ERROR_CODES.TooManyNestedObjectsError; + + /** + * the response containing more than one value. + */ + response: unknown; + + /** + * @hidden + */ + constructor(message: string, options: TooManyNestedObjectsErrorOptions) { + super(message, options); + this.response = options.response; + } +} diff --git a/example/.fluentci/sdk/common/errors/UnknownDaggerError.ts b/example/.fluentci/sdk/common/errors/UnknownDaggerError.ts new file mode 100644 index 0000000..fe29169 --- /dev/null +++ b/example/.fluentci/sdk/common/errors/UnknownDaggerError.ts @@ -0,0 +1,17 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +/** + * This error is thrown if the dagger SDK does not identify the error and just wraps the cause. + */ +export class UnknownDaggerError extends DaggerSDKError { + name = ERROR_NAMES.UnknownDaggerError; + code = ERROR_CODES.UnknownDaggerError; + + /** + * @hidden + */ + constructor(message: string, options: DaggerSDKErrorOptions) { + super(message, options); + } +} diff --git a/example/.fluentci/sdk/common/errors/errors-codes.ts b/example/.fluentci/sdk/common/errors/errors-codes.ts new file mode 100644 index 0000000..a6e4d48 --- /dev/null +++ b/example/.fluentci/sdk/common/errors/errors-codes.ts @@ -0,0 +1,63 @@ +export const ERROR_CODES = { + /** + * {@link GraphQLRequestError} + */ + GraphQLRequestError: "D100", + + /** + * {@link UnknownDaggerError} + */ + UnknownDaggerError: "D101", + + /** + * {@link TooManyNestedObjectsError} + */ + TooManyNestedObjectsError: "D102", + + /** + * {@link EngineSessionConnectParamsParseError} + */ + EngineSessionConnectParamsParseError: "D103", + + /** + * {@link EngineSessionConnectionTimeoutError} + */ + EngineSessionConnectionTimeoutError: "D104", + + /** + * {@link EngineSessionError} + */ + EngineSessionError: "D105", + + /** + * {@link InitEngineSessionBinaryError} + */ + InitEngineSessionBinaryError: "D106", + + /** + * {@link DockerImageRefValidationError} + */ + DockerImageRefValidationError: "D107", + + /** + * {@link NotAwaitedRequestError} + */ + NotAwaitedRequestError: "D108", + + /** + * (@link ExecError} + */ + ExecError: "D109", +} as const + +type ErrorCodesType = typeof ERROR_CODES +export type ErrorNames = keyof ErrorCodesType +export type ErrorCodes = ErrorCodesType[ErrorNames] + +type ErrorNamesMap = { readonly [Key in ErrorNames]: Key } +export const ERROR_NAMES: ErrorNamesMap = ( + Object.keys(ERROR_CODES) as Array +).reduce( + (obj, item) => ({ ...obj, [item]: item }), + {} as ErrorNamesMap +) diff --git a/example/.fluentci/sdk/common/errors/index.ts b/example/.fluentci/sdk/common/errors/index.ts new file mode 100644 index 0000000..61faf70 --- /dev/null +++ b/example/.fluentci/sdk/common/errors/index.ts @@ -0,0 +1,12 @@ +export { DaggerSDKError } from "./DaggerSDKError.ts"; +export { UnknownDaggerError } from "./UnknownDaggerError.ts"; +export { DockerImageRefValidationError } from "./DockerImageRefValidationError.ts"; +export { EngineSessionConnectParamsParseError } from "./EngineSessionConnectParamsParseError.ts"; +export { ExecError } from "./ExecError.ts"; +export { GraphQLRequestError } from "./GraphQLRequestError.ts"; +export { InitEngineSessionBinaryError } from "./InitEngineSessionBinaryError.ts"; +export { TooManyNestedObjectsError } from "./TooManyNestedObjectsError.ts"; +export { EngineSessionError } from "./EngineSessionErrorOptions.ts"; +export { EngineSessionConnectionTimeoutError } from "./EngineSessionConnectionTimeoutError.ts"; +export { NotAwaitedRequestError } from "./NotAwaitedRequestError.ts"; +export { ERROR_CODES } from "./errors-codes.ts"; diff --git a/example/.fluentci/sdk/common/errors/types.ts b/example/.fluentci/sdk/common/errors/types.ts new file mode 100644 index 0000000..f5b1582 --- /dev/null +++ b/example/.fluentci/sdk/common/errors/types.ts @@ -0,0 +1,16 @@ +import { GraphQLError } from "npm:graphql@16.8.1"; + +export interface GraphQLResponse { + data?: T; + errors?: GraphQLError[]; + extensions?: unknown; + status: number; + [key: string]: unknown; +} + +export type Variables = Record; + +export interface GraphQLRequestContext { + query: string | string[]; + variables?: V; +} diff --git a/example/.fluentci/sdk/common/utils.ts b/example/.fluentci/sdk/common/utils.ts new file mode 100644 index 0000000..5853601 --- /dev/null +++ b/example/.fluentci/sdk/common/utils.ts @@ -0,0 +1,4 @@ +import logger from "npm:node-color-log@11.0.2"; + +export const log = (stack?: string) => + logger.bgColor("red").color("black").log(stack); diff --git a/example/.fluentci/src/dagger/index.ts b/example/.fluentci/src/dagger/index.ts index a778f42..41deca6 100644 --- a/example/.fluentci/src/dagger/index.ts +++ b/example/.fluentci/src/dagger/index.ts @@ -1,4 +1,3 @@ -import pipeline from "./pipeline.ts"; import { clippy, build, test, llvmCov, jobDescriptions } from "./jobs.ts"; -export { pipeline, clippy, build, test, llvmCov, jobDescriptions }; +export { clippy, build, test, llvmCov, jobDescriptions }; diff --git a/example/.fluentci/src/dagger/jobs.ts b/example/.fluentci/src/dagger/jobs.ts index b162b5c..98bdc10 100644 --- a/example/.fluentci/src/dagger/jobs.ts +++ b/example/.fluentci/src/dagger/jobs.ts @@ -1,5 +1,9 @@ -import { Directory, DirectoryID, File, Client } from "../../sdk/client.gen.ts"; -import { connect } from "../../sdk/connect.ts"; +/** + * @module rust + * @description This module provides a set of functions to build, test, and run clippy on a Rust project ๐Ÿฆ€ + */ + +import { dag, Directory, DirectoryID, File } from "../../sdk/client.gen.ts"; export enum Job { clippy = "clippy", @@ -11,7 +15,6 @@ export enum Job { export const exclude = ["target", ".git", ".devbox", ".fluentci"]; export const getDirectory = async ( - client: Client, src: string | Directory | undefined = "." ) => { if (src instanceof Directory) { @@ -19,21 +22,23 @@ export const getDirectory = async ( } if (typeof src === "string") { try { - const directory = client.loadDirectoryFromID(src as DirectoryID); + const directory = dag.loadDirectoryFromID(src as DirectoryID); await directory.id(); return directory; } catch (_) { - return client.host - ? client.host().directory(src) - : client.currentModule().source().directory(src); + return dag.host + ? dag.host().directory(src) + : dag.currentModule().source().directory(src); } } - return client.host - ? client.host().directory(src) - : client.currentModule().source().directory(src); + return dag.host + ? dag.host().directory(src) + : dag.currentModule().source().directory(src); }; /** + * Run clippy + * * @function * @description Run clippy * @param {string | Directory | undefined} src @@ -42,40 +47,38 @@ export const getDirectory = async ( export async function clippy( src: string | Directory | undefined = "." ): Promise { - let id = ""; - await connect(async (client: Client) => { - const context = await getDirectory(client, src); - const ctr = client - .pipeline(Job.clippy) - .container() - .from("rust:1.73-bookworm") - .withExec(["apt-get", "update"]) - .withExec(["apt-get", "install", "-y", "build-essential", "pkg-config"]) - .withExec(["rustup", "component", "add", "clippy"]) - .withExec(["cargo", "install", "clippy-sarif", "--version", "0.3.0"]) - .withExec(["cargo", "install", "sarif-fmt", "--version", "0.3.0"]) - .withDirectory("/app", context, { exclude }) - .withWorkdir("/app") - .withMountedCache("/app/target", client.cacheVolume("target")) - .withMountedCache("/root/cargo/registry", client.cacheVolume("registry")) - .withExec([ - "sh", - "-c", - "cargo clippy \ + const context = await getDirectory(src); + const ctr = dag + .pipeline(Job.clippy) + .container() + .from("rust:1.73-bookworm") + .withExec(["apt-get", "update"]) + .withExec(["apt-get", "install", "-y", "build-essential", "pkg-config"]) + .withExec(["rustup", "component", "add", "clippy"]) + .withExec(["cargo", "install", "clippy-sarif", "--version", "0.3.0"]) + .withExec(["cargo", "install", "sarif-fmt", "--version", "0.3.0"]) + .withDirectory("/app", context, { exclude }) + .withWorkdir("/app") + .withMountedCache("/app/target", dag.cacheVolume("target")) + .withMountedCache("/root/cargo/registry", dag.cacheVolume("registry")) + .withExec([ + "sh", + "-c", + "cargo clippy \ --all-features \ --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt", - ]) - .withExec(["ls", "-la", "/app"]); - - const results = await ctr.file("/app/rust-clippy-results.sarif"); - results.export("./rust-clippy-results.sarif"); - await ctr.stdout(); - id = await results.id(); - }); - return id; + ]) + .withExec(["ls", "-la", "/app"]); + + const results = await ctr.file("/app/rust-clippy-results.sarif"); + results.export("./rust-clippy-results.sarif"); + await ctr.stdout(); + return results.id(); } /** + * Generate llvm coverage report + * * @function * @description Generate llvm coverage report * @param {string | Directory | undefined} src @@ -84,59 +87,53 @@ export async function clippy( export async function llvmCov( src: string | Directory | undefined = "." ): Promise { - let id = ""; - await connect(async (client: Client) => { - const context = await getDirectory(client, src); - const ctr = client - .pipeline(Job.llvmCov) - .container() - .from("rust:1.73-bookworm") - .withExec(["apt-get", "update"]) - .withExec([ - "apt-get", - "install", - "-y", - "build-essential", - "wget", - "pkg-config", - ]) - .withExec(["rustup", "component", "add", "llvm-tools"]) - .withExec([ - "wget", - "https://github.com/taiki-e/cargo-llvm-cov/releases/download/v0.5.36/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz", - ]) - .withExec([ - "tar", - "xvf", - "cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz", - ]) - .withExec(["mv", "cargo-llvm-cov", "/usr/local/bin"]) - .withDirectory("/app", context, { exclude }) - .withWorkdir("/app") - .withMountedCache("/app/target", client.cacheVolume("target")) - .withMountedCache("/root/cargo/registry", client.cacheVolume("registry")) - .withExec([ - "sh", - "-c", - "cargo llvm-cov \ + const context = await getDirectory(src); + const ctr = dag + .pipeline(Job.llvmCov) + .container() + .from("rust:1.73-bookworm") + .withExec(["apt-get", "update"]) + .withExec([ + "apt-get", + "install", + "-y", + "build-essential", + "wget", + "pkg-config", + ]) + .withExec(["rustup", "component", "add", "llvm-tools"]) + .withExec([ + "wget", + "https://github.com/taiki-e/cargo-llvm-cov/releases/download/v0.5.36/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz", + ]) + .withExec(["tar", "xvf", "cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz"]) + .withExec(["mv", "cargo-llvm-cov", "/usr/local/bin"]) + .withDirectory("/app", context, { exclude }) + .withWorkdir("/app") + .withMountedCache("/app/target", dag.cacheVolume("target")) + .withMountedCache("/root/cargo/registry", dag.cacheVolume("registry")) + .withExec([ + "sh", + "-c", + "cargo llvm-cov \ --all-features \ --lib \ --workspace \ --lcov \ --output-path \ lcov.info", - ]) - .withExec(["ls", "-la", "/app"]); - - const lcov = ctr.file("/app/lcov.info"); - await lcov.export("./lcov.info"); - await ctr.stdout(); - id = await lcov.id(); - }); - return id; + ]) + .withExec(["ls", "-la", "/app"]); + + const lcov = ctr.file("/app/lcov.info"); + await lcov.export("./lcov.info"); + await ctr.stdout(); + return lcov.id(); } /** + * Run tests + * * @function * @description Run tests * @param {string | Directory | undefined} src @@ -147,26 +144,23 @@ export async function test( src: string | Directory | undefined = ".", options: string[] = [] ): Promise { - await connect(async (client: Client) => { - const context = await getDirectory(client, src); - const ctr = client - .pipeline(Job.test) - .container() - .from("rust:latest") - .withDirectory("/app", context, { exclude }) - .withWorkdir("/app") - .withMountedCache("/app/target", client.cacheVolume("target")) - .withMountedCache("/root/cargo/registry", client.cacheVolume("registry")) - .withExec(["cargo", "test", ...options]); - - const result = await ctr.stdout(); - - console.log(result); - }); - return "Done"; + const context = await getDirectory(src); + const ctr = dag + .pipeline(Job.test) + .container() + .from("rust:latest") + .withDirectory("/app", context, { exclude }) + .withWorkdir("/app") + .withMountedCache("/app/target", dag.cacheVolume("target")) + .withMountedCache("/root/cargo/registry", dag.cacheVolume("registry")) + .withExec(["cargo", "test", ...options]); + + return ctr.stdout(); } /** + * Build the project + * * @function * @description Build the project * @param {string | Directory | undefined} src @@ -181,39 +175,35 @@ export async function build( target = "x86_64-unknown-linux-gnu", options: string[] = [] ): Promise { - let id = ""; - await connect(async (client: Client) => { - const context = await getDirectory(client, src); - const ctr = client - .pipeline(Job.build) - .container() - .from("rust:latest") - .withDirectory("/app", context, { exclude }) - .withWorkdir("/app") - .withMountedCache("/app/target", client.cacheVolume("target")) - .withMountedCache("/root/cargo/registry", client.cacheVolume("registry")) - .withExec( - packageName - ? [ - "cargo", - "build", - "--release", - "-p", - packageName, - "--target", - target, - ...options, - ] - : ["cargo", "build", "--release", "--target", target, ...options] - ) - .withExec(["cp", "-r", `/app/target/${target}`, "/"]); - - const result = await ctr.stdout(); - - console.log(result); - id = await ctr.directory(`/${target}`).id(); - }); - return id; + const context = await getDirectory(src); + const ctr = dag + .pipeline(Job.build) + .container() + .from("rust:latest") + .withDirectory("/app", context, { exclude }) + .withWorkdir("/app") + .withMountedCache("/app/target", dag.cacheVolume("target")) + .withMountedCache("/root/cargo/registry", dag.cacheVolume("registry")) + .withExec( + packageName + ? [ + "cargo", + "build", + "--release", + "-p", + packageName, + "--target", + target, + ...options, + ] + : ["cargo", "build", "--release", "--target", target, ...options] + ) + .withExec(["cp", "-r", `/app/target/${target}`, "/"]); + + const result = await ctr.stdout(); + + console.log(result); + return ctr.directory(`/${target}`).id(); } export type JobExec = diff --git a/example/.fluentci/src/dagger/pipeline.ts b/example/.fluentci/src/dagger/pipeline.ts index b50591f..853472a 100644 --- a/example/.fluentci/src/dagger/pipeline.ts +++ b/example/.fluentci/src/dagger/pipeline.ts @@ -1,6 +1,6 @@ import * as jobs from "./jobs.ts"; -const { build, test, exclude } = jobs; +const { build, test } = jobs; export default async function pipeline(src = ".", args: string[] = []) { if (args.length > 0) { diff --git a/sdk/builder.ts b/sdk/builder.ts index f06951a..10182d6 100644 --- a/sdk/builder.ts +++ b/sdk/builder.ts @@ -1,5 +1,6 @@ import { createGQLClient } from "./client.ts"; import { Context } from "./context.ts"; +import { env } from "../deps.ts"; /** * @hidden @@ -10,9 +11,9 @@ export function initDefaultContext(): Context { let ctx = new Context(); // Prefer DAGGER_SESSION_PORT if set - const daggerSessionPort = Deno.env.get("DAGGER_SESSION_PORT"); + const daggerSessionPort = env.get("DAGGER_SESSION_PORT"); if (daggerSessionPort) { - const sessionToken = Deno.env.get("DAGGER_SESSION_TOKEN"); + const sessionToken = env.get("DAGGER_SESSION_TOKEN"); if (!sessionToken) { throw new Error( "DAGGER_SESSION_TOKEN must be set when using DAGGER_SESSION_PORT" diff --git a/sdk/client.gen.ts b/sdk/client.gen.ts index ae06cef..5e20f82 100644 --- a/sdk/client.gen.ts +++ b/sdk/client.gen.ts @@ -127,7 +127,7 @@ export type ContainerBuildOpts = { * * They will be mounted at /run/secrets/[secret-name] in the build container * - * They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl http://example.com?token=$(cat /run/secrets/my-secret) + * They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl [http://example.com?token=$(cat /run/secrets/my-secret)](http://example.com?token=$(cat /run/secrets/my-secret)) */ secrets?: Secret[]; }; @@ -306,6 +306,22 @@ export type ContainerWithFileOpts = { owner?: string; }; +export type ContainerWithFilesOpts = { + /** + * Permission given to the copied files (e.g., 0600). + */ + permissions?: number; + + /** + * A user:group to set for the files. + * + * The user and group can either be an ID (1000:1000) or a name (foo:bar). + * + * If the group is omitted, it defaults to the same as the user. + */ + owner?: string; +}; + export type ContainerWithMountedCacheOpts = { /** * Identifier of the directory to use as the cache volume's root. @@ -439,13 +455,13 @@ export type CurrentModuleID = string & { __CurrentModuleID: never }; export type DirectoryAsModuleOpts = { /** - * An optional subpath of the directory which contains the module's source code. + * An optional subpath of the directory which contains the module's configuration file. * * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory. * * If not set, the module source code is loaded from the root of the directory. */ - sourceSubpath?: string; + sourceRootPath?: string; }; export type DirectoryDockerBuildOpts = { @@ -515,6 +531,13 @@ export type DirectoryWithFileOpts = { permissions?: number; }; +export type DirectoryWithFilesOpts = { + /** + * Permission given to the copied files (e.g., 0600). + */ + permissions?: number; +}; + export type DirectoryWithNewDirectoryOpts = { /** * Permission granted to the created directory (e.g., 0777). @@ -852,11 +875,6 @@ export type ClientModuleDependencyOpts = { }; export type ClientModuleSourceOpts = { - /** - * An explicitly set root directory for the module source. This is required to load local sources as modules; other source types implicitly encode the root directory and do not require this. - */ - rootDirectory?: Directory; - /** * If true, enforce that the source is a stable version for source kinds that support versioning. */ @@ -875,6 +893,10 @@ export type ClientPipelineOpts = { labels?: PipelineLabel[]; }; +export type ClientSecretOpts = { + accessor?: string; +}; + /** * The `SecretID` scalar type represents an identifier for an object of type Secret. */ @@ -1184,7 +1206,7 @@ export class Container extends BaseClient { * * They will be mounted at /run/secrets/[secret-name] in the build container * - * They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl http://example.com?token=$(cat /run/secrets/my-secret) + * They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl [http://example.com?token=$(cat /run/secrets/my-secret)](http://example.com?token=$(cat /run/secrets/my-secret)) */ build = (context: Directory, opts?: ContainerBuildOpts): Container => { return new Container({ @@ -1993,6 +2015,34 @@ export class Container extends BaseClient { }); }; + /** + * Retrieves this container plus the contents of the given files copied to the given path. + * @param path Location where copied files should be placed (e.g., "/src"). + * @param sources Identifiers of the files to copy. + * @param opts.permissions Permission given to the copied files (e.g., 0600). + * @param opts.owner A user:group to set for the files. + * + * The user and group can either be an ID (1000:1000) or a name (foo:bar). + * + * If the group is omitted, it defaults to the same as the user. + */ + withFiles = ( + path: string, + sources: File[], + opts?: ContainerWithFilesOpts + ): Container => { + return new Container({ + queryTree: [ + ...this._queryTree, + { + operation: "withFiles", + args: { path, sources, ...opts }, + }, + ], + ctx: this._ctx, + }); + }; + /** * Indicate that subsequent operations should be featured more prominently in the UI. */ @@ -2719,7 +2769,7 @@ export class Directory extends BaseClient { /** * Load the directory as a Dagger module - * @param opts.sourceSubpath An optional subpath of the directory which contains the module's source code. + * @param opts.sourceRootPath An optional subpath of the directory which contains the module's configuration file. * * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory. * @@ -2956,6 +3006,29 @@ export class Directory extends BaseClient { }); }; + /** + * Retrieves this directory plus the contents of the given files copied to the given path. + * @param path Location where copied files should be placed (e.g., "/src"). + * @param sources Identifiers of the files to copy. + * @param opts.permissions Permission given to the copied files (e.g., 0600). + */ + withFiles = ( + path: string, + sources: File[], + opts?: DirectoryWithFilesOpts + ): Directory => { + return new Directory({ + queryTree: [ + ...this._queryTree, + { + operation: "withFiles", + args: { path, sources, ...opts }, + }, + ], + ctx: this._ctx, + }); + }; + /** * Retrieves this directory plus a new directory created at the given path. * @param path Location of the directory created (e.g., "/logs"). @@ -4167,7 +4240,7 @@ export class GitModuleSource extends BaseClient { private readonly _cloneURL?: string = undefined; private readonly _commit?: string = undefined; private readonly _htmlURL?: string = undefined; - private readonly _sourceSubpath?: string = undefined; + private readonly _rootSubpath?: string = undefined; private readonly _version?: string = undefined; /** @@ -4179,7 +4252,7 @@ export class GitModuleSource extends BaseClient { _cloneURL?: string, _commit?: string, _htmlURL?: string, - _sourceSubpath?: string, + _rootSubpath?: string, _version?: string ) { super(parent); @@ -4188,7 +4261,7 @@ export class GitModuleSource extends BaseClient { this._cloneURL = _cloneURL; this._commit = _commit; this._htmlURL = _htmlURL; - this._sourceSubpath = _sourceSubpath; + this._rootSubpath = _rootSubpath; this._version = _version; } @@ -4255,6 +4328,21 @@ export class GitModuleSource extends BaseClient { return response; }; + /** + * The directory containing everything needed to load load and use the module. + */ + contextDirectory = (): Directory => { + return new Directory({ + queryTree: [ + ...this._queryTree, + { + operation: "contextDirectory", + }, + ], + ctx: this._ctx, + }); + }; + /** * The URL to the source's git repo in a web browser */ @@ -4277,18 +4365,18 @@ export class GitModuleSource extends BaseClient { }; /** - * The path to the module source code dir specified by this source relative to the source's root directory. + * The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory). */ - sourceSubpath = async (): Promise => { - if (this._sourceSubpath) { - return this._sourceSubpath; + rootSubpath = async (): Promise => { + if (this._rootSubpath) { + return this._rootSubpath; } const response: Awaited = await computeQuery( [ ...this._queryTree, { - operation: "sourceSubpath", + operation: "rootSubpath", }, ], await this._ctx.connection() @@ -5074,7 +5162,7 @@ export class ListTypeDef extends BaseClient { */ export class LocalModuleSource extends BaseClient { private readonly _id?: LocalModuleSourceID = undefined; - private readonly _sourceSubpath?: string = undefined; + private readonly _rootSubpath?: string = undefined; /** * Constructor is used for internal usage only, do not create object from it. @@ -5082,12 +5170,12 @@ export class LocalModuleSource extends BaseClient { constructor( parent?: { queryTree?: QueryTree[]; ctx: Context }, _id?: LocalModuleSourceID, - _sourceSubpath?: string + _rootSubpath?: string ) { super(parent); this._id = _id; - this._sourceSubpath = _sourceSubpath; + this._rootSubpath = _rootSubpath; } /** @@ -5112,18 +5200,33 @@ export class LocalModuleSource extends BaseClient { }; /** - * The path to the module source code dir specified by this source. + * The directory containing everything needed to load load and use the module. */ - sourceSubpath = async (): Promise => { - if (this._sourceSubpath) { - return this._sourceSubpath; + contextDirectory = (): Directory => { + return new Directory({ + queryTree: [ + ...this._queryTree, + { + operation: "contextDirectory", + }, + ], + ctx: this._ctx, + }); + }; + + /** + * The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory). + */ + rootSubpath = async (): Promise => { + if (this._rootSubpath) { + return this._rootSubpath; } const response: Awaited = await computeQuery( [ ...this._queryTree, { - operation: "sourceSubpath", + operation: "rootSubpath", }, ], await this._ctx.connection() @@ -5282,14 +5385,29 @@ export class Module_ extends BaseClient { }; /** - * The module's root directory containing the config file for it and its source (possibly as a subdir). It includes any generated code or updated config files created after initial load, but not any files/directories that were unchanged after sdk codegen was run. + * The generated files and directories made on top of the module source's context directory. + */ + generatedContextDiff = (): Directory => { + return new Directory({ + queryTree: [ + ...this._queryTree, + { + operation: "generatedContextDiff", + }, + ], + ctx: this._ctx, + }); + }; + + /** + * The module source's context plus any configuration and source files created by codegen. */ - generatedSourceRootDirectory = (): Directory => { + generatedContextDirectory = (): Directory => { return new Directory({ queryTree: [ ...this._queryTree, { - operation: "generatedSourceRootDirectory", + operation: "generatedContextDirectory", }, ], ctx: this._ctx, @@ -5482,23 +5600,6 @@ export class Module_ extends BaseClient { }); }; - /** - * Update the module configuration to use the given dependencies. - * @param dependencies The dependency modules to install. - */ - withDependencies = (dependencies: ModuleDependency[]): Module_ => { - return new Module_({ - queryTree: [ - ...this._queryTree, - { - operation: "withDependencies", - args: { dependencies }, - }, - ], - ctx: this._ctx, - }); - }; - /** * Retrieves the module with the given description * @param description The description to set @@ -5532,23 +5633,6 @@ export class Module_ extends BaseClient { }); }; - /** - * Update the module configuration to use the given name. - * @param name The name to use. - */ - withName = (name: string): Module_ => { - return new Module_({ - queryTree: [ - ...this._queryTree, - { - operation: "withName", - args: { name }, - }, - ], - ctx: this._ctx, - }); - }; - /** * This module plus the given Object type and associated functions. */ @@ -5565,23 +5649,6 @@ export class Module_ extends BaseClient { }); }; - /** - * Update the module configuration to use the given SDK. - * @param sdk The SDK to use. - */ - withSDK = (sdk: string): Module_ => { - return new Module_({ - queryTree: [ - ...this._queryTree, - { - operation: "withSDK", - args: { sdk }, - }, - ], - ctx: this._ctx, - }); - }; - /** * Retrieves the module with basic configuration loaded if present. * @param source The module source to initialize from. @@ -5694,9 +5761,13 @@ export class ModuleDependency extends BaseClient { export class ModuleSource extends BaseClient { private readonly _id?: ModuleSourceID = undefined; private readonly _asString?: string = undefined; + private readonly _configExists?: boolean = undefined; private readonly _kind?: ModuleSourceKind = undefined; private readonly _moduleName?: string = undefined; - private readonly _subpath?: string = undefined; + private readonly _moduleOriginalName?: string = undefined; + private readonly _resolveContextPathFromCaller?: string = undefined; + private readonly _sourceRootSubpath?: string = undefined; + private readonly _sourceSubpath?: string = undefined; /** * Constructor is used for internal usage only, do not create object from it. @@ -5705,17 +5776,25 @@ export class ModuleSource extends BaseClient { parent?: { queryTree?: QueryTree[]; ctx: Context }, _id?: ModuleSourceID, _asString?: string, + _configExists?: boolean, _kind?: ModuleSourceKind, _moduleName?: string, - _subpath?: string + _moduleOriginalName?: string, + _resolveContextPathFromCaller?: string, + _sourceRootSubpath?: string, + _sourceSubpath?: string ) { super(parent); this._id = _id; this._asString = _asString; + this._configExists = _configExists; this._kind = _kind; this._moduleName = _moduleName; - this._subpath = _subpath; + this._moduleOriginalName = _moduleOriginalName; + this._resolveContextPathFromCaller = _resolveContextPathFromCaller; + this._sourceRootSubpath = _sourceRootSubpath; + this._sourceSubpath = _sourceSubpath; } /** @@ -5806,7 +5885,81 @@ export class ModuleSource extends BaseClient { }; /** - * The directory containing the actual module's source code, as determined from the root directory and subpath. + * Returns whether the module source has a configuration file. + */ + configExists = async (): Promise => { + if (this._configExists) { + return this._configExists; + } + + const response: Awaited = await computeQuery( + [ + ...this._queryTree, + { + operation: "configExists", + }, + ], + await this._ctx.connection() + ); + + return response; + }; + + /** + * The directory containing everything needed to load load and use the module. + */ + contextDirectory = (): Directory => { + return new Directory({ + queryTree: [ + ...this._queryTree, + { + operation: "contextDirectory", + }, + ], + ctx: this._ctx, + }); + }; + + /** + * The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls. + */ + dependencies = async (): Promise => { + type dependencies = { + id: ModuleDependencyID; + }; + + const response: Awaited = await computeQuery( + [ + ...this._queryTree, + { + operation: "dependencies", + }, + { + operation: "id", + }, + ], + await this._ctx.connection() + ); + + return response.map( + (r) => + new ModuleDependency( + { + queryTree: [ + { + operation: "loadModuleDependencyFromID", + args: { id: r.id }, + }, + ], + ctx: this._ctx, + }, + r.id + ) + ); + }; + + /** + * The directory containing the module configuration and source code (source code may be in a subdir). * @param path The path from the source directory to select. */ directory = (path: string): Directory => { @@ -5844,7 +5997,7 @@ export class ModuleSource extends BaseClient { }; /** - * If set, the name of the module this source references + * If set, the name of the module this source references, including any overrides at runtime by callers. */ moduleName = async (): Promise => { if (this._moduleName) { @@ -5864,6 +6017,48 @@ export class ModuleSource extends BaseClient { return response; }; + /** + * The original name of the module this source references, as defined in the module configuration. + */ + moduleOriginalName = async (): Promise => { + if (this._moduleOriginalName) { + return this._moduleOriginalName; + } + + const response: Awaited = await computeQuery( + [ + ...this._queryTree, + { + operation: "moduleOriginalName", + }, + ], + await this._ctx.connection() + ); + + return response; + }; + + /** + * The path to the module source's context directory on the caller's filesystem. Only valid for local sources. + */ + resolveContextPathFromCaller = async (): Promise => { + if (this._resolveContextPathFromCaller) { + return this._resolveContextPathFromCaller; + } + + const response: Awaited = await computeQuery( + [ + ...this._queryTree, + { + operation: "resolveContextPathFromCaller", + }, + ], + await this._ctx.connection() + ); + + return response; + }; + /** * Resolve the provided module source arg as a dependency relative to this module source. * @param dep The dependency module source to resolve. @@ -5882,14 +6077,14 @@ export class ModuleSource extends BaseClient { }; /** - * The root directory of the module source that contains its configuration and source code (which may be in a subdirectory of this root). + * Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources. */ - rootDirectory = (): Directory => { - return new Directory({ + resolveFromCaller = (): ModuleSource => { + return new ModuleSource({ queryTree: [ ...this._queryTree, { - operation: "rootDirectory", + operation: "resolveFromCaller", }, ], ctx: this._ctx, @@ -5897,18 +6092,39 @@ export class ModuleSource extends BaseClient { }; /** - * The path to the module subdirectory containing the actual module's source code. + * The path relative to context of the root of the module source, which contains dagger.json. It also contains the module implementation source code, but that may or may not being a subdir of this root. + */ + sourceRootSubpath = async (): Promise => { + if (this._sourceRootSubpath) { + return this._sourceRootSubpath; + } + + const response: Awaited = await computeQuery( + [ + ...this._queryTree, + { + operation: "sourceRootSubpath", + }, + ], + await this._ctx.connection() + ); + + return response; + }; + + /** + * The path relative to context of the module implementation source code. */ - subpath = async (): Promise => { - if (this._subpath) { - return this._subpath; + sourceSubpath = async (): Promise => { + if (this._sourceSubpath) { + return this._sourceSubpath; } const response: Awaited = await computeQuery( [ ...this._queryTree, { - operation: "subpath", + operation: "sourceSubpath", }, ], await this._ctx.connection() @@ -5917,6 +6133,91 @@ export class ModuleSource extends BaseClient { return response; }; + /** + * Update the module source with a new context directory. Only valid for local sources. + * @param dir The directory to set as the context directory. + */ + withContextDirectory = (dir: Directory): ModuleSource => { + return new ModuleSource({ + queryTree: [ + ...this._queryTree, + { + operation: "withContextDirectory", + args: { dir }, + }, + ], + ctx: this._ctx, + }); + }; + + /** + * Append the provided dependencies to the module source's dependency list. + * @param dependencies The dependencies to append. + */ + withDependencies = (dependencies: ModuleDependency[]): ModuleSource => { + return new ModuleSource({ + queryTree: [ + ...this._queryTree, + { + operation: "withDependencies", + args: { dependencies }, + }, + ], + ctx: this._ctx, + }); + }; + + /** + * Update the module source with a new name. + * @param name The name to set. + */ + withName = (name: string): ModuleSource => { + return new ModuleSource({ + queryTree: [ + ...this._queryTree, + { + operation: "withName", + args: { name }, + }, + ], + ctx: this._ctx, + }); + }; + + /** + * Update the module source with a new SDK. + * @param sdk The SDK to set. + */ + withSDK = (sdk: string): ModuleSource => { + return new ModuleSource({ + queryTree: [ + ...this._queryTree, + { + operation: "withSDK", + args: { sdk }, + }, + ], + ctx: this._ctx, + }); + }; + + /** + * Update the module source with a new source subpath. + * @param path The path to set as the source subpath. + */ + withSourceSubpath = (path: string): ModuleSource => { + return new ModuleSource({ + queryTree: [ + ...this._queryTree, + { + operation: "withSourceSubpath", + args: { path }, + }, + ], + ctx: this._ctx, + }); + }; + /** * Call the provided function with current ModuleSource. * @@ -6312,6 +6613,23 @@ export class Client extends BaseClient { }); }; + /** + * Retrieves a container builtin to the engine. + * @param digest Digest of the image manifest + */ + builtinContainer = (digest: string): Container => { + return new Container({ + queryTree: [ + ...this._queryTree, + { + operation: "builtinContainer", + args: { digest }, + }, + ], + ctx: this._ctx, + }); + }; + /** * Constructs a cache volume for a given cache key. * @param key A string identifier to target this cache volume (e.g., "modules-cache"). @@ -7119,7 +7437,6 @@ export class Client extends BaseClient { /** * Create a new module source instance from a source ref string. * @param refString The string ref representation of the module source - * @param opts.rootDirectory An explicitly set root directory for the module source. This is required to load local sources as modules; other source types implicitly encode the root directory and do not require this. * @param opts.stable If true, enforce that the source is a stable version for source kinds that support versioning. */ moduleSource = ( @@ -7160,13 +7477,13 @@ export class Client extends BaseClient { /** * Reference a secret by name. */ - secret = (name: string): Secret => { + secret = (name: string, opts?: ClientSecretOpts): Secret => { return new Secret({ queryTree: [ ...this._queryTree, { operation: "secret", - args: { name }, + args: { name, ...opts }, }, ], ctx: this._ctx, diff --git a/sdk/common/errors/DaggerSDKError.ts b/sdk/common/errors/DaggerSDKError.ts new file mode 100644 index 0000000..f2f009d --- /dev/null +++ b/sdk/common/errors/DaggerSDKError.ts @@ -0,0 +1,46 @@ +import { log } from "../utils.ts"; +import { ErrorCodes, ErrorNames } from "./errors-codes.ts"; + +export interface DaggerSDKErrorOptions { + cause?: Error; +} + +/** + * The base error. Every other error inherits this error. + */ +export abstract class DaggerSDKError extends Error { + /** + * The name of the dagger error. + */ + abstract readonly name: ErrorNames; + + /** + * The dagger specific error code. + * Use this to identify dagger errors programmatically. + */ + abstract readonly code: ErrorCodes; + + /** + * The original error, which caused the DaggerSDKError. + */ + cause?: Error; + + protected constructor(message: string, options?: DaggerSDKErrorOptions) { + super(message); + this.cause = options?.cause; + } + + /** + * @hidden + */ + get [Symbol.toStringTag]() { + return this.name; + } + + /** + * Pretty prints the error + */ + printStackTrace() { + log(this.stack); + } +} diff --git a/sdk/common/errors/DockerImageRefValidationError.ts b/sdk/common/errors/DockerImageRefValidationError.ts new file mode 100644 index 0000000..6f45b46 --- /dev/null +++ b/sdk/common/errors/DockerImageRefValidationError.ts @@ -0,0 +1,28 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts" +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts" + +interface DockerImageRefValidationErrorOptions extends DaggerSDKErrorOptions { + ref: string +} + +/** + * This error is thrown if the passed image reference does not pass validation and is not compliant with the + * DockerImage constructor. + */ +export class DockerImageRefValidationError extends DaggerSDKError { + name = ERROR_NAMES.DockerImageRefValidationError + code = ERROR_CODES.DockerImageRefValidationError + + /** + * The docker image reference, which caused the error. + */ + ref: string + + /** + * @hidden + */ + constructor(message: string, options: DockerImageRefValidationErrorOptions) { + super(message, options) + this.ref = options?.ref + } +} diff --git a/sdk/common/errors/EngineSessionConnectParamsParseError.ts b/sdk/common/errors/EngineSessionConnectParamsParseError.ts new file mode 100644 index 0000000..8acd47a --- /dev/null +++ b/sdk/common/errors/EngineSessionConnectParamsParseError.ts @@ -0,0 +1,31 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +interface EngineSessionConnectParamsParseErrorOptions + extends DaggerSDKErrorOptions { + parsedLine: string; +} + +/** + * This error is thrown if the EngineSession does not manage to parse the required connection parameters from the session binary + */ +export class EngineSessionConnectParamsParseError extends DaggerSDKError { + name = ERROR_NAMES.EngineSessionConnectParamsParseError; + code = ERROR_CODES.EngineSessionConnectParamsParseError; + + /** + * the line, which caused the error during parsing, if the error was caused because of parsing. + */ + parsedLine: string; + + /** + * @hidden + */ + constructor( + message: string, + options: EngineSessionConnectParamsParseErrorOptions + ) { + super(message, options); + this.parsedLine = options.parsedLine; + } +} diff --git a/sdk/common/errors/EngineSessionConnectionTimeoutError.ts b/sdk/common/errors/EngineSessionConnectionTimeoutError.ts new file mode 100644 index 0000000..e2550ac --- /dev/null +++ b/sdk/common/errors/EngineSessionConnectionTimeoutError.ts @@ -0,0 +1,31 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +interface EngineSessionConnectionTimeoutErrorOptions + extends DaggerSDKErrorOptions { + timeOutDuration: number; +} + +/** + * This error is thrown if the EngineSession does not manage to parse the required port successfully because the sessions connection timed out. + */ +export class EngineSessionConnectionTimeoutError extends DaggerSDKError { + name = ERROR_NAMES.EngineSessionConnectionTimeoutError; + code = ERROR_CODES.EngineSessionConnectionTimeoutError; + + /** + * The duration until the timeout occurred in ms. + */ + timeOutDuration: number; + + /** + * @hidden + */ + constructor( + message: string, + options: EngineSessionConnectionTimeoutErrorOptions + ) { + super(message, options); + this.timeOutDuration = options.timeOutDuration; + } +} diff --git a/sdk/common/errors/EngineSessionErrorOptions.ts b/sdk/common/errors/EngineSessionErrorOptions.ts new file mode 100644 index 0000000..ba0ec90 --- /dev/null +++ b/sdk/common/errors/EngineSessionErrorOptions.ts @@ -0,0 +1,20 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +type EngineSessionErrorOptions = DaggerSDKErrorOptions; + +/** + * This error is thrown if the EngineSession does not manage to parse the required port successfully because a EOF is read before any valid port. + * This usually happens if no connection can be established. + */ +export class EngineSessionError extends DaggerSDKError { + name = ERROR_NAMES.EngineSessionError; + code = ERROR_CODES.EngineSessionError; + + /** + * @hidden + */ + constructor(message: string, options?: EngineSessionErrorOptions) { + super(message, options); + } +} diff --git a/sdk/common/errors/ExecError.ts b/sdk/common/errors/ExecError.ts new file mode 100644 index 0000000..ede655b --- /dev/null +++ b/sdk/common/errors/ExecError.ts @@ -0,0 +1,54 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +interface ExecErrorOptions extends DaggerSDKErrorOptions { + cmd: string[]; + exitCode: number; + stdout: string; + stderr: string; +} + +/** + * API error from an exec operation in a pipeline. + */ +export class ExecError extends DaggerSDKError { + name = ERROR_NAMES.ExecError; + code = ERROR_CODES.ExecError; + + /** + * The command that caused the error. + */ + cmd: string[]; + + /** + * The exit code of the command. + */ + exitCode: number; + + /** + * The stdout of the command. + */ + stdout: string; + + /** + * The stderr of the command. + */ + stderr: string; + + /** + * @hidden + */ + constructor(message: string, options: ExecErrorOptions) { + super(message, options); + this.cmd = options.cmd; + this.exitCode = options.exitCode; + this.stdout = options.stdout; + this.stderr = options.stderr; + } + + toString(): string { + return `${super.toString()}\nStdout:\n${this.stdout}\nStderr:\n${ + this.stderr + }`; + } +} diff --git a/sdk/common/errors/GraphQLRequestError.ts b/sdk/common/errors/GraphQLRequestError.ts new file mode 100644 index 0000000..59584f8 --- /dev/null +++ b/sdk/common/errors/GraphQLRequestError.ts @@ -0,0 +1,36 @@ +import { GraphQLRequestContext, GraphQLResponse } from "./types.ts"; + +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +interface GraphQLRequestErrorOptions extends DaggerSDKErrorOptions { + response: GraphQLResponse; + request: GraphQLRequestContext; +} + +/** + * This error originates from the dagger engine. It means that some error was thrown and sent back via GraphQL. + */ +export class GraphQLRequestError extends DaggerSDKError { + name = ERROR_NAMES.GraphQLRequestError; + code = ERROR_CODES.GraphQLRequestError; + + /** + * The query and variables, which caused the error. + */ + requestContext: GraphQLRequestContext; + + /** + * the GraphQL response containing the error. + */ + response: GraphQLResponse; + + /** + * @hidden + */ + constructor(message: string, options: GraphQLRequestErrorOptions) { + super(message, options); + this.requestContext = options.request; + this.response = options.response; + } +} diff --git a/sdk/common/errors/InitEngineSessionBinaryError.ts b/sdk/common/errors/InitEngineSessionBinaryError.ts new file mode 100644 index 0000000..879c1ce --- /dev/null +++ b/sdk/common/errors/InitEngineSessionBinaryError.ts @@ -0,0 +1,17 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +/** + * This error is thrown if the dagger binary cannot be copied from the dagger docker image and copied to the local host. + */ +export class InitEngineSessionBinaryError extends DaggerSDKError { + name = ERROR_NAMES.InitEngineSessionBinaryError; + code = ERROR_CODES.InitEngineSessionBinaryError; + + /** + * @hidden + */ + constructor(message: string, options?: DaggerSDKErrorOptions) { + super(message, options); + } +} diff --git a/sdk/common/errors/NotAwaitedRequestError.ts b/sdk/common/errors/NotAwaitedRequestError.ts new file mode 100644 index 0000000..291b924 --- /dev/null +++ b/sdk/common/errors/NotAwaitedRequestError.ts @@ -0,0 +1,17 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +/** + * This error is thrown when the compute function isn't awaited. + */ +export class NotAwaitedRequestError extends DaggerSDKError { + name = ERROR_NAMES.NotAwaitedRequestError; + code = ERROR_CODES.NotAwaitedRequestError; + + /** + * @hidden + */ + constructor(message: string, options?: DaggerSDKErrorOptions) { + super(message, options); + } +} diff --git a/sdk/common/errors/TooManyNestedObjectsError.ts b/sdk/common/errors/TooManyNestedObjectsError.ts new file mode 100644 index 0000000..7b8b907 --- /dev/null +++ b/sdk/common/errors/TooManyNestedObjectsError.ts @@ -0,0 +1,27 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +interface TooManyNestedObjectsErrorOptions extends DaggerSDKErrorOptions { + response: unknown; +} + +/** + * Dagger only expects one response value from the engine. If the engine returns more than one value this error is thrown. + */ +export class TooManyNestedObjectsError extends DaggerSDKError { + name = ERROR_NAMES.TooManyNestedObjectsError; + code = ERROR_CODES.TooManyNestedObjectsError; + + /** + * the response containing more than one value. + */ + response: unknown; + + /** + * @hidden + */ + constructor(message: string, options: TooManyNestedObjectsErrorOptions) { + super(message, options); + this.response = options.response; + } +} diff --git a/sdk/common/errors/UnknownDaggerError.ts b/sdk/common/errors/UnknownDaggerError.ts new file mode 100644 index 0000000..fe29169 --- /dev/null +++ b/sdk/common/errors/UnknownDaggerError.ts @@ -0,0 +1,17 @@ +import { DaggerSDKError, DaggerSDKErrorOptions } from "./DaggerSDKError.ts"; +import { ERROR_CODES, ERROR_NAMES } from "./errors-codes.ts"; + +/** + * This error is thrown if the dagger SDK does not identify the error and just wraps the cause. + */ +export class UnknownDaggerError extends DaggerSDKError { + name = ERROR_NAMES.UnknownDaggerError; + code = ERROR_CODES.UnknownDaggerError; + + /** + * @hidden + */ + constructor(message: string, options: DaggerSDKErrorOptions) { + super(message, options); + } +} diff --git a/sdk/common/errors/errors-codes.ts b/sdk/common/errors/errors-codes.ts new file mode 100644 index 0000000..a6e4d48 --- /dev/null +++ b/sdk/common/errors/errors-codes.ts @@ -0,0 +1,63 @@ +export const ERROR_CODES = { + /** + * {@link GraphQLRequestError} + */ + GraphQLRequestError: "D100", + + /** + * {@link UnknownDaggerError} + */ + UnknownDaggerError: "D101", + + /** + * {@link TooManyNestedObjectsError} + */ + TooManyNestedObjectsError: "D102", + + /** + * {@link EngineSessionConnectParamsParseError} + */ + EngineSessionConnectParamsParseError: "D103", + + /** + * {@link EngineSessionConnectionTimeoutError} + */ + EngineSessionConnectionTimeoutError: "D104", + + /** + * {@link EngineSessionError} + */ + EngineSessionError: "D105", + + /** + * {@link InitEngineSessionBinaryError} + */ + InitEngineSessionBinaryError: "D106", + + /** + * {@link DockerImageRefValidationError} + */ + DockerImageRefValidationError: "D107", + + /** + * {@link NotAwaitedRequestError} + */ + NotAwaitedRequestError: "D108", + + /** + * (@link ExecError} + */ + ExecError: "D109", +} as const + +type ErrorCodesType = typeof ERROR_CODES +export type ErrorNames = keyof ErrorCodesType +export type ErrorCodes = ErrorCodesType[ErrorNames] + +type ErrorNamesMap = { readonly [Key in ErrorNames]: Key } +export const ERROR_NAMES: ErrorNamesMap = ( + Object.keys(ERROR_CODES) as Array +).reduce( + (obj, item) => ({ ...obj, [item]: item }), + {} as ErrorNamesMap +) diff --git a/sdk/common/errors/index.ts b/sdk/common/errors/index.ts new file mode 100644 index 0000000..61faf70 --- /dev/null +++ b/sdk/common/errors/index.ts @@ -0,0 +1,12 @@ +export { DaggerSDKError } from "./DaggerSDKError.ts"; +export { UnknownDaggerError } from "./UnknownDaggerError.ts"; +export { DockerImageRefValidationError } from "./DockerImageRefValidationError.ts"; +export { EngineSessionConnectParamsParseError } from "./EngineSessionConnectParamsParseError.ts"; +export { ExecError } from "./ExecError.ts"; +export { GraphQLRequestError } from "./GraphQLRequestError.ts"; +export { InitEngineSessionBinaryError } from "./InitEngineSessionBinaryError.ts"; +export { TooManyNestedObjectsError } from "./TooManyNestedObjectsError.ts"; +export { EngineSessionError } from "./EngineSessionErrorOptions.ts"; +export { EngineSessionConnectionTimeoutError } from "./EngineSessionConnectionTimeoutError.ts"; +export { NotAwaitedRequestError } from "./NotAwaitedRequestError.ts"; +export { ERROR_CODES } from "./errors-codes.ts"; diff --git a/sdk/common/errors/types.ts b/sdk/common/errors/types.ts new file mode 100644 index 0000000..f5b1582 --- /dev/null +++ b/sdk/common/errors/types.ts @@ -0,0 +1,16 @@ +import { GraphQLError } from "npm:graphql@16.8.1"; + +export interface GraphQLResponse { + data?: T; + errors?: GraphQLError[]; + extensions?: unknown; + status: number; + [key: string]: unknown; +} + +export type Variables = Record; + +export interface GraphQLRequestContext { + query: string | string[]; + variables?: V; +} diff --git a/sdk/common/utils.ts b/sdk/common/utils.ts new file mode 100644 index 0000000..5853601 --- /dev/null +++ b/sdk/common/utils.ts @@ -0,0 +1,4 @@ +import logger from "npm:node-color-log@11.0.2"; + +export const log = (stack?: string) => + logger.bgColor("red").color("black").log(stack); diff --git a/src/dagger/index.ts b/src/dagger/index.ts index a778f42..41deca6 100644 --- a/src/dagger/index.ts +++ b/src/dagger/index.ts @@ -1,4 +1,3 @@ -import pipeline from "./pipeline.ts"; import { clippy, build, test, llvmCov, jobDescriptions } from "./jobs.ts"; -export { pipeline, clippy, build, test, llvmCov, jobDescriptions }; +export { clippy, build, test, llvmCov, jobDescriptions }; diff --git a/src/dagger/jobs.ts b/src/dagger/jobs.ts index e51e1c0..98bdc10 100644 --- a/src/dagger/jobs.ts +++ b/src/dagger/jobs.ts @@ -3,8 +3,7 @@ * @description This module provides a set of functions to build, test, and run clippy on a Rust project ๐Ÿฆ€ */ -import { Directory, DirectoryID, File, Client } from "../../sdk/client.gen.ts"; -import { connect } from "../../sdk/connect.ts"; +import { dag, Directory, DirectoryID, File } from "../../sdk/client.gen.ts"; export enum Job { clippy = "clippy", @@ -16,7 +15,6 @@ export enum Job { export const exclude = ["target", ".git", ".devbox", ".fluentci"]; export const getDirectory = async ( - client: Client, src: string | Directory | undefined = "." ) => { if (src instanceof Directory) { @@ -24,21 +22,23 @@ export const getDirectory = async ( } if (typeof src === "string") { try { - const directory = client.loadDirectoryFromID(src as DirectoryID); + const directory = dag.loadDirectoryFromID(src as DirectoryID); await directory.id(); return directory; } catch (_) { - return client.host - ? client.host().directory(src) - : client.currentModule().source().directory(src); + return dag.host + ? dag.host().directory(src) + : dag.currentModule().source().directory(src); } } - return client.host - ? client.host().directory(src) - : client.currentModule().source().directory(src); + return dag.host + ? dag.host().directory(src) + : dag.currentModule().source().directory(src); }; /** + * Run clippy + * * @function * @description Run clippy * @param {string | Directory | undefined} src @@ -47,40 +47,38 @@ export const getDirectory = async ( export async function clippy( src: string | Directory | undefined = "." ): Promise { - let id = ""; - await connect(async (client: Client) => { - const context = await getDirectory(client, src); - const ctr = client - .pipeline(Job.clippy) - .container() - .from("rust:1.73-bookworm") - .withExec(["apt-get", "update"]) - .withExec(["apt-get", "install", "-y", "build-essential", "pkg-config"]) - .withExec(["rustup", "component", "add", "clippy"]) - .withExec(["cargo", "install", "clippy-sarif", "--version", "0.3.0"]) - .withExec(["cargo", "install", "sarif-fmt", "--version", "0.3.0"]) - .withDirectory("/app", context, { exclude }) - .withWorkdir("/app") - .withMountedCache("/app/target", client.cacheVolume("target")) - .withMountedCache("/root/cargo/registry", client.cacheVolume("registry")) - .withExec([ - "sh", - "-c", - "cargo clippy \ + const context = await getDirectory(src); + const ctr = dag + .pipeline(Job.clippy) + .container() + .from("rust:1.73-bookworm") + .withExec(["apt-get", "update"]) + .withExec(["apt-get", "install", "-y", "build-essential", "pkg-config"]) + .withExec(["rustup", "component", "add", "clippy"]) + .withExec(["cargo", "install", "clippy-sarif", "--version", "0.3.0"]) + .withExec(["cargo", "install", "sarif-fmt", "--version", "0.3.0"]) + .withDirectory("/app", context, { exclude }) + .withWorkdir("/app") + .withMountedCache("/app/target", dag.cacheVolume("target")) + .withMountedCache("/root/cargo/registry", dag.cacheVolume("registry")) + .withExec([ + "sh", + "-c", + "cargo clippy \ --all-features \ --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt", - ]) - .withExec(["ls", "-la", "/app"]); - - const results = await ctr.file("/app/rust-clippy-results.sarif"); - results.export("./rust-clippy-results.sarif"); - await ctr.stdout(); - id = await results.id(); - }); - return id; + ]) + .withExec(["ls", "-la", "/app"]); + + const results = await ctr.file("/app/rust-clippy-results.sarif"); + results.export("./rust-clippy-results.sarif"); + await ctr.stdout(); + return results.id(); } /** + * Generate llvm coverage report + * * @function * @description Generate llvm coverage report * @param {string | Directory | undefined} src @@ -89,59 +87,53 @@ export async function clippy( export async function llvmCov( src: string | Directory | undefined = "." ): Promise { - let id = ""; - await connect(async (client: Client) => { - const context = await getDirectory(client, src); - const ctr = client - .pipeline(Job.llvmCov) - .container() - .from("rust:1.73-bookworm") - .withExec(["apt-get", "update"]) - .withExec([ - "apt-get", - "install", - "-y", - "build-essential", - "wget", - "pkg-config", - ]) - .withExec(["rustup", "component", "add", "llvm-tools"]) - .withExec([ - "wget", - "https://github.com/taiki-e/cargo-llvm-cov/releases/download/v0.5.36/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz", - ]) - .withExec([ - "tar", - "xvf", - "cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz", - ]) - .withExec(["mv", "cargo-llvm-cov", "/usr/local/bin"]) - .withDirectory("/app", context, { exclude }) - .withWorkdir("/app") - .withMountedCache("/app/target", client.cacheVolume("target")) - .withMountedCache("/root/cargo/registry", client.cacheVolume("registry")) - .withExec([ - "sh", - "-c", - "cargo llvm-cov \ + const context = await getDirectory(src); + const ctr = dag + .pipeline(Job.llvmCov) + .container() + .from("rust:1.73-bookworm") + .withExec(["apt-get", "update"]) + .withExec([ + "apt-get", + "install", + "-y", + "build-essential", + "wget", + "pkg-config", + ]) + .withExec(["rustup", "component", "add", "llvm-tools"]) + .withExec([ + "wget", + "https://github.com/taiki-e/cargo-llvm-cov/releases/download/v0.5.36/cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz", + ]) + .withExec(["tar", "xvf", "cargo-llvm-cov-x86_64-unknown-linux-gnu.tar.gz"]) + .withExec(["mv", "cargo-llvm-cov", "/usr/local/bin"]) + .withDirectory("/app", context, { exclude }) + .withWorkdir("/app") + .withMountedCache("/app/target", dag.cacheVolume("target")) + .withMountedCache("/root/cargo/registry", dag.cacheVolume("registry")) + .withExec([ + "sh", + "-c", + "cargo llvm-cov \ --all-features \ --lib \ --workspace \ --lcov \ --output-path \ lcov.info", - ]) - .withExec(["ls", "-la", "/app"]); - - const lcov = ctr.file("/app/lcov.info"); - await lcov.export("./lcov.info"); - await ctr.stdout(); - id = await lcov.id(); - }); - return id; + ]) + .withExec(["ls", "-la", "/app"]); + + const lcov = ctr.file("/app/lcov.info"); + await lcov.export("./lcov.info"); + await ctr.stdout(); + return lcov.id(); } /** + * Run tests + * * @function * @description Run tests * @param {string | Directory | undefined} src @@ -152,26 +144,23 @@ export async function test( src: string | Directory | undefined = ".", options: string[] = [] ): Promise { - await connect(async (client: Client) => { - const context = await getDirectory(client, src); - const ctr = client - .pipeline(Job.test) - .container() - .from("rust:latest") - .withDirectory("/app", context, { exclude }) - .withWorkdir("/app") - .withMountedCache("/app/target", client.cacheVolume("target")) - .withMountedCache("/root/cargo/registry", client.cacheVolume("registry")) - .withExec(["cargo", "test", ...options]); - - const result = await ctr.stdout(); - - console.log(result); - }); - return "Done"; + const context = await getDirectory(src); + const ctr = dag + .pipeline(Job.test) + .container() + .from("rust:latest") + .withDirectory("/app", context, { exclude }) + .withWorkdir("/app") + .withMountedCache("/app/target", dag.cacheVolume("target")) + .withMountedCache("/root/cargo/registry", dag.cacheVolume("registry")) + .withExec(["cargo", "test", ...options]); + + return ctr.stdout(); } /** + * Build the project + * * @function * @description Build the project * @param {string | Directory | undefined} src @@ -186,39 +175,35 @@ export async function build( target = "x86_64-unknown-linux-gnu", options: string[] = [] ): Promise { - let id = ""; - await connect(async (client: Client) => { - const context = await getDirectory(client, src); - const ctr = client - .pipeline(Job.build) - .container() - .from("rust:latest") - .withDirectory("/app", context, { exclude }) - .withWorkdir("/app") - .withMountedCache("/app/target", client.cacheVolume("target")) - .withMountedCache("/root/cargo/registry", client.cacheVolume("registry")) - .withExec( - packageName - ? [ - "cargo", - "build", - "--release", - "-p", - packageName, - "--target", - target, - ...options, - ] - : ["cargo", "build", "--release", "--target", target, ...options] - ) - .withExec(["cp", "-r", `/app/target/${target}`, "/"]); - - const result = await ctr.stdout(); - - console.log(result); - id = await ctr.directory(`/${target}`).id(); - }); - return id; + const context = await getDirectory(src); + const ctr = dag + .pipeline(Job.build) + .container() + .from("rust:latest") + .withDirectory("/app", context, { exclude }) + .withWorkdir("/app") + .withMountedCache("/app/target", dag.cacheVolume("target")) + .withMountedCache("/root/cargo/registry", dag.cacheVolume("registry")) + .withExec( + packageName + ? [ + "cargo", + "build", + "--release", + "-p", + packageName, + "--target", + target, + ...options, + ] + : ["cargo", "build", "--release", "--target", target, ...options] + ) + .withExec(["cp", "-r", `/app/target/${target}`, "/"]); + + const result = await ctr.stdout(); + + console.log(result); + return ctr.directory(`/${target}`).id(); } export type JobExec =