From 38896f24a9ff56cd220c440caf4d61de8fcd2211 Mon Sep 17 00:00:00 2001 From: Ryan Fox-Tyler <60440289+ryanfoxtyler@users.noreply.github.com> Date: Fri, 3 Jan 2025 11:15:29 -0500 Subject: [PATCH 01/11] chore: init trunk --- .github/ISSUE_TEMPLATE/bug_report.md | 20 +- .github/ISSUE_TEMPLATE/feature_request.md | 21 +- .github/actionlint.yml | 6 + .github/pull_request_template.md | 18 +- .github/workflows/ci-cli-lint.yml | 7 +- .github/workflows/ci-go-lint.yml | 8 +- .github/workflows/ci-go-test.yml | 10 +- .github/workflows/ci-release-info-build.yaml | 7 +- .github/workflows/ci-release-info-lint.yaml | 7 +- .github/workflows/ci-sdk-as-build.yml | 4 +- .github/workflows/ci-sdk-as-lint.yml | 4 +- .github/workflows/ci-sdk-go-build.yml | 8 +- .github/workflows/codeql.yml | 11 +- .github/workflows/release-cli.yaml | 40 +- .github/workflows/release-info.yaml | 6 +- .github/workflows/release-runtime.yaml | 2 +- .github/workflows/release-schema.yaml | 4 +- .github/workflows/release-sdk-as.yaml | 9 +- .github/workflows/release-sdk-go.yaml | 4 +- .markdownlint.json | 5 - .trunk/.gitignore | 9 + .trunk/configs/.hadolint.yaml | 4 + .trunk/configs/.markdownlint.json | 8 + .trunk/configs/.prettierrc | 6 + .trunk/configs/.shellcheckrc | 7 + .trunk/configs/.yamllint.yaml | 7 + cspell.json => .trunk/configs/cspell.json | 0 .trunk/trunk.yaml | 44 ++ .vscode/extensions.json | 4 +- .vscode/settings.json | 15 +- CHANGELOG.md | 386 ++++++++++++------ CODE_OF_CONDUCT.md | 135 +++--- CONTRIBUTING.md | 44 +- README.md | 88 ++-- SECURITY.md | 7 +- cli/install.sh | 386 +++++++++--------- lib/README.md | 10 +- runtime/.goreleaser.yaml | 8 +- runtime/README.md | 4 +- runtime/explorer/content/ModusIcon.tsx | 18 +- runtime/explorer/content/index.html | 2 +- runtime/explorer/content/main.tsx | 54 ++- runtime/explorer/content/postcss.config.js | 2 +- runtime/explorer/content/tailwind.config.js | 2 +- runtime/explorer/content/vite.config.ts | 8 +- .../graphql/schemagen/schemagen_go_test.go | 2 +- .../testdata/assembly/arraybuffers.ts | 26 +- .../testdata/assembly/arrays.ts | 89 ++-- .../testdata/assembly/classes.ts | 156 +++---- .../assemblyscript/testdata/assembly/dates.ts | 20 +- .../assemblyscript/testdata/assembly/env.ts | 10 +- .../testdata/assembly/hostfns.ts | 18 +- .../assemblyscript/testdata/assembly/index.ts | 20 +- .../assemblyscript/testdata/assembly/maps.ts | 189 ++++----- .../testdata/assembly/primitives.ts | 104 ++--- .../testdata/assembly/strings.ts | 22 +- .../testdata/assembly/typedarrays.ts | 184 ++++----- runtime/languages/golang/testdata/README.md | 4 +- runtime/languages/golang/testdata/build.sh | 10 +- sdk/README.md | 8 +- sdk/assemblyscript/CHANGELOG.md | 139 +++++-- sdk/assemblyscript/README.md | 57 +-- sdk/assemblyscript/scripts/install-all.sh | 10 +- sdk/assemblyscript/scripts/prepare-release.sh | 42 +- sdk/assemblyscript/scripts/upgrade-deps.sh | 12 +- sdk/go/examples/anthropic-functions/build.sh | 10 +- sdk/go/examples/auth/build.sh | 10 +- sdk/go/examples/classification/build.sh | 10 +- sdk/go/examples/collections/build.sh | 10 +- sdk/go/examples/dgraph/build.sh | 10 +- sdk/go/examples/embedding/build.sh | 10 +- sdk/go/examples/graphql/build.sh | 10 +- sdk/go/examples/http/build.sh | 10 +- sdk/go/examples/neo4j/build.sh | 10 +- sdk/go/examples/postgresql/build.sh | 10 +- sdk/go/examples/simple/build.sh | 10 +- sdk/go/examples/textgeneration/build.sh | 10 +- sdk/go/examples/time/build.sh | 10 +- sdk/go/examples/vectors/build.sh | 10 +- sdk/go/scripts/prepare-release.sh | 22 +- sdk/go/scripts/tidy-all.sh | 12 +- 81 files changed, 1527 insertions(+), 1228 deletions(-) create mode 100644 .github/actionlint.yml delete mode 100644 .markdownlint.json create mode 100644 .trunk/.gitignore create mode 100644 .trunk/configs/.hadolint.yaml create mode 100644 .trunk/configs/.markdownlint.json create mode 100644 .trunk/configs/.prettierrc create mode 100644 .trunk/configs/.shellcheckrc create mode 100644 .trunk/configs/.yamllint.yaml rename cspell.json => .trunk/configs/cspell.json (100%) create mode 100644 .trunk/trunk.yaml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 5598bb691..1f676e3ba 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,28 +1,23 @@ --- name: Bug report about: Create a report to help us improve -title: '' +title: "" labels: bug -assignees: '' - +assignees: "" --- -**Describe the bug** -A clear and concise description of what the bug is. +**Describe the bug** A clear and concise description of what the bug is. -**To Reproduce** -Steps to reproduce the behavior: +**To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error -**Expected behavior** -A clear and concise description of what you expected to happen. +**Expected behavior** A clear and concise description of what you expected to happen. -**Screenshots** -If applicable, add screenshots to help explain your problem. +**Screenshots** If applicable, add screenshots to help explain your problem. **Environment** @@ -30,5 +25,4 @@ If applicable, add screenshots to help explain your problem. - Language [e.g. AssemblyScript, Go] - Version [e.g. v0.xx] -**Additional context** -Add any other context about the problem here. +**Additional context** Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d6..3a3c1418e 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -1,20 +1,17 @@ --- name: Feature request about: Suggest an idea for this project -title: '' -labels: '' -assignees: '' - +title: "" +labels: "" +assignees: "" --- -**Is your feature request related to a problem? Please describe.** -A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] +**Is your feature request related to a problem? Please describe.** A clear and concise description +of what the problem is. Ex. I'm always frustrated when [...] -**Describe the solution you'd like** -A clear and concise description of what you want to happen. +**Describe the solution you'd like** A clear and concise description of what you want to happen. -**Describe alternatives you've considered** -A clear and concise description of any alternative solutions or features you've considered. +**Describe alternatives you've considered** A clear and concise description of any alternative +solutions or features you've considered. -**Additional context** -Add any other context or screenshots about the feature request here. +**Additional context** Add any other context or screenshots about the feature request here. diff --git a/.github/actionlint.yml b/.github/actionlint.yml new file mode 100644 index 000000000..dd2f86bfb --- /dev/null +++ b/.github/actionlint.yml @@ -0,0 +1,6 @@ +self-hosted-runner: + # Labels of self-hosted runner in array of string + labels: + - warp-ubuntu-latest-x64-2x + - warp-ubuntu-latest-x64-4x + - warp-ubuntu-latest-x64-8x diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 67da69e11..6256c56dd 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -5,16 +5,22 @@ Please explain the changes you made here. **Checklist** - [ ] Code compiles correctly and linting passes locally -- [ ] For all _code_ changes, an entry added to the `CHANGELOG.md` file describing and linking to this PR +- [ ] For all _code_ changes, an entry added to the `CHANGELOG.md` file describing and linking to + this PR - [ ] Tests added for new functionality, or regression tests for bug fixes added as applicable -- [ ] For public APIs, new features, etc., PR on [docs repo](https://github.com/hypermodeinc/docs) staged and linked here +- [ ] For public APIs, new features, etc., PR on [docs repo](https://github.com/hypermodeinc/docs) + staged and linked here **Instructions** -- The PR title should follow the [Conventional Commits](https://www.conventionalcommits.org/) syntax, leading with `fix:`, `feat:`, `chore:`, `ci:`, etc. -- The description should briefly explain what the PR is about. In the case of a bugfix, describe or link to the bug. +- The PR title should follow the [Conventional Commits](https://www.conventionalcommits.org/) + syntax, leading with `fix:`, `feat:`, `chore:`, `ci:`, etc. +- The description should briefly explain what the PR is about. In the case of a bugfix, describe or + link to the bug. - In the checklist section, check the boxes in that are applicable, using `[x]` syntax. - - If not applicable, remove the entire line. Only leave the box unchecked if you intend to come back and check the box later. -- Delete the `Instructions` line and everything below it, to indicate you have read and are following these instructions. π + - If not applicable, remove the entire line. Only leave the box unchecked if you intend to come + back and check the box later. +- Delete the `Instructions` line and everything below it, to indicate you have read and are + following these instructions. π Thank you for your contribution to the Modus project! diff --git a/.github/workflows/ci-cli-lint.yml b/.github/workflows/ci-cli-lint.yml index 263b04b56..65ee4bce7 100644 --- a/.github/workflows/ci-cli-lint.yml +++ b/.github/workflows/ci-cli-lint.yml @@ -1,4 +1,5 @@ name: ci-cli-lint + on: pull_request: types: @@ -7,7 +8,11 @@ on: - reopened - ready_for_review paths: - - "cli/**" + - cli/** + +permissions: + contents: read + jobs: lint: runs-on: ubuntu-latest diff --git a/.github/workflows/ci-go-lint.yml b/.github/workflows/ci-go-lint.yml index 4661bae90..068cb9358 100644 --- a/.github/workflows/ci-go-lint.yml +++ b/.github/workflows/ci-go-lint.yml @@ -9,8 +9,8 @@ on: - reopened - ready_for_review paths: - - '**/*.go' - - '**/go.mod' + - "**/*.go" + - "**/go.mod" permissions: contents: read @@ -27,7 +27,9 @@ jobs: uses: actions/checkout@v4 - name: Search for go.mod files id: get-dirs - run: echo "dirs=$(find . -name 'go.mod' -exec dirname {} \; | sed 's|^\./||' | jq -Rsc 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT} + run: + echo "dirs=$(find . -name 'go.mod' -exec dirname {} \; | sed 's|^\./||' | jq -Rsc + 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT} go-lint: needs: get-dirs diff --git a/.github/workflows/ci-go-test.yml b/.github/workflows/ci-go-test.yml index 720159918..b61ea06a9 100644 --- a/.github/workflows/ci-go-test.yml +++ b/.github/workflows/ci-go-test.yml @@ -9,9 +9,9 @@ on: - reopened - ready_for_review paths: - - '**/*.go' - - '**/go.mod' - - '**/testdata/**' + - "**/*.go" + - "**/go.mod" + - "**/testdata/**" permissions: contents: read @@ -29,7 +29,9 @@ jobs: uses: actions/checkout@v4 - name: Search for go.mod files id: get-dirs - run: echo "dirs=$(find . -name 'go.mod' -exec dirname {} \; | sed 's|^\./||' | jq -Rsc 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT} + run: + echo "dirs=$(find . -name 'go.mod' -exec dirname {} \; | sed 's|^\./||' | jq -Rsc + 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT} go-test: needs: get-dirs diff --git a/.github/workflows/ci-release-info-build.yaml b/.github/workflows/ci-release-info-build.yaml index 64a7b3e86..a4ea5928c 100644 --- a/.github/workflows/ci-release-info-build.yaml +++ b/.github/workflows/ci-release-info-build.yaml @@ -1,4 +1,5 @@ name: ci-release-info-build + on: pull_request: types: @@ -7,7 +8,11 @@ on: - reopened - ready_for_review paths: - - 'tools/release-info/**' + - tools/release-info/** + +permissions: + contents: read + jobs: build: if: github.event_name == 'pull_request' diff --git a/.github/workflows/ci-release-info-lint.yaml b/.github/workflows/ci-release-info-lint.yaml index 61e225253..dea4d3fbf 100644 --- a/.github/workflows/ci-release-info-lint.yaml +++ b/.github/workflows/ci-release-info-lint.yaml @@ -1,4 +1,5 @@ name: ci-release-info-lint + on: pull_request: types: @@ -7,7 +8,11 @@ on: - reopened - ready_for_review paths: - - 'tools/release-info/**' + - tools/release-info/** + +permissions: + contents: read + jobs: lint: if: github.event_name == 'pull_request' diff --git a/.github/workflows/ci-sdk-as-build.yml b/.github/workflows/ci-sdk-as-build.yml index 84698dfda..5f3f8bdec 100644 --- a/.github/workflows/ci-sdk-as-build.yml +++ b/.github/workflows/ci-sdk-as-build.yml @@ -25,7 +25,9 @@ jobs: uses: actions/checkout@v4 - name: Find Examples id: get-dirs - run: echo "dirs=$(ls -d sdk/assemblyscript/examples/* | jq -Rsc 'split("\n")[:-1]' )" >> ${GITHUB_OUTPUT} + run: + echo "dirs=$(ls -d sdk/assemblyscript/examples/* | jq -Rsc 'split("\n")[:-1]' )" >> + ${GITHUB_OUTPUT} sdk-as-build-examples: needs: get-dirs diff --git a/.github/workflows/ci-sdk-as-lint.yml b/.github/workflows/ci-sdk-as-lint.yml index 360b69e4b..103c08444 100644 --- a/.github/workflows/ci-sdk-as-lint.yml +++ b/.github/workflows/ci-sdk-as-lint.yml @@ -25,7 +25,9 @@ jobs: uses: actions/checkout@v4 - name: Find Examples id: get-dirs - run: echo "dirs=$(ls -d sdk/assemblyscript/examples/* | jq -Rsc 'split("\n")[:-1]' )" >> ${GITHUB_OUTPUT} + run: + echo "dirs=$(ls -d sdk/assemblyscript/examples/* | jq -Rsc 'split("\n")[:-1]' )" >> + ${GITHUB_OUTPUT} sdk-as-lint-src: if: github.event_name == 'pull_request' diff --git a/.github/workflows/ci-sdk-go-build.yml b/.github/workflows/ci-sdk-go-build.yml index e03c24a89..6976e2bde 100644 --- a/.github/workflows/ci-sdk-go-build.yml +++ b/.github/workflows/ci-sdk-go-build.yml @@ -26,10 +26,14 @@ jobs: uses: actions/checkout@v4 - name: Find tools id: get-tools-dirs - run: echo "dirs=$(find ./sdk/go/tools -mindepth 1 -maxdepth 1 -type d | sed 's|^\./||' | jq -Rsc 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT} + run: + echo "dirs=$(find ./sdk/go/tools -mindepth 1 -maxdepth 1 -type d | sed 's|^\./||' | jq + -Rsc 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT} - name: Find examples id: get-examples-dirs - run: echo "dirs=$(find ./sdk/go/examples -mindepth 1 -maxdepth 1 -type d | sed 's|^\./||' | jq -Rsc 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT} + run: + echo "dirs=$(find ./sdk/go/examples -mindepth 1 -maxdepth 1 -type d | sed 's|^\./||' | jq + -Rsc 'split("\n")[:-1]')" >> ${GITHUB_OUTPUT} sdk-go-build-tools: needs: get-dirs diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index cffa154a0..4768adcc8 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -9,15 +9,18 @@ # the `language` matrix defined below to confirm you have the correct set of # supported CodeQL languages. # -name: "CodeQL Advanced" +name: CodeQL Advanced on: push: - branches: ["main"] + branches: [main] pull_request: - branches: ["main"] + branches: [main] schedule: - - cron: "41 3 * * 3" + - cron: 41 3 * * 3 + +permissions: + contents: read jobs: analyze: diff --git a/.github/workflows/release-cli.yaml b/.github/workflows/release-cli.yaml index 566852dcf..d0c257b6e 100644 --- a/.github/workflows/release-cli.yaml +++ b/.github/workflows/release-cli.yaml @@ -1,4 +1,4 @@ -name: "Release CLI" +name: Release CLI on: push: @@ -15,9 +15,9 @@ jobs: # note: must use GitHub-hosted runner for publishing to NPM with --provenance flag runs-on: ubuntu-latest steps: - - name: "Validate version" + - name: Validate version if: ${{ !startsWith(github.ref_name, 'cli/v') }} - run: 'echo "Modus CLI version must start with `cli/v` && exit 1' + run: echo "Modus CLI version must start with `cli/v` && exit 1 - uses: actions/checkout@v4 with: ref: "${{ github.ref_name }}" @@ -30,7 +30,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: ">=22" - registry-url: "https://registry.npmjs.org" + registry-url: https://registry.npmjs.org - name: Prepare Release working-directory: cli run: npm version ${{ steps.parse_cli_version.outputs.cli_version }} --no-git-tag-version @@ -42,7 +42,9 @@ jobs: run: npm run build - name: Publish NPM Package working-directory: cli - run: npm publish --provenance --access public --tag ${{ steps.parse_cli_version.outputs.npm_tag }} + run: + npm publish --provenance --access public --tag ${{ steps.parse_cli_version.outputs.npm_tag + }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Create Release @@ -60,17 +62,17 @@ jobs: name: Release Install Script runs-on: warp-ubuntu-latest-x64-2x steps: - - uses: actions/checkout@v4 - with: - ref: "${{ github.ref_name }}" - - name: Push to R2 Bucket - uses: cloudflare/wrangler-action@v3 - with: - accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - apiToken: ${{ secrets.CLOUDFLARE_TOKEN }} - wranglerVersion: "3.83.0" - workingDirectory: cli - preCommands: | - cat install.sh - command: | - r2 object put install/modus.sh -f install.sh --content-type text/x-sh + - uses: actions/checkout@v4 + with: + ref: "${{ github.ref_name }}" + - name: Push to R2 Bucket + uses: cloudflare/wrangler-action@v3 + with: + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + apiToken: ${{ secrets.CLOUDFLARE_TOKEN }} + wranglerVersion: 3.83.0 + workingDirectory: cli + preCommands: | + cat install.sh + command: | + r2 object put install/modus.sh -f install.sh --content-type text/x-sh diff --git a/.github/workflows/release-info.yaml b/.github/workflows/release-info.yaml index 9d878719a..edc86ea71 100644 --- a/.github/workflows/release-info.yaml +++ b/.github/workflows/release-info.yaml @@ -15,7 +15,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: ">=22" - registry-url: "https://registry.npmjs.org" + registry-url: https://registry.npmjs.org - name: Install Dependencies working-directory: tools/release-info run: npm ci @@ -30,8 +30,8 @@ jobs: with: accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} apiToken: ${{ secrets.CLOUDFLARE_TOKEN }} - wranglerVersion: "3.83.0" - workingDirectory: "tools/release-info" + wranglerVersion: 3.83.0 + workingDirectory: tools/release-info preCommands: | cat modus-latest.json cat modus-preview.json diff --git a/.github/workflows/release-runtime.yaml b/.github/workflows/release-runtime.yaml index 2a6d7d9a2..40579f714 100644 --- a/.github/workflows/release-runtime.yaml +++ b/.github/workflows/release-runtime.yaml @@ -38,7 +38,7 @@ jobs: - uses: goreleaser/goreleaser-action@v6 with: distribution: goreleaser-pro - version: "~> v2" + version: ~> v2 args: release --clean -f ./runtime/.goreleaser.yaml env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/release-schema.yaml b/.github/workflows/release-schema.yaml index f860472ea..9861b4dce 100644 --- a/.github/workflows/release-schema.yaml +++ b/.github/workflows/release-schema.yaml @@ -19,8 +19,8 @@ jobs: with: accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} apiToken: ${{ secrets.CLOUDFLARE_TOKEN }} - wranglerVersion: "3.83.0" - workingDirectory: "lib/manifest" + wranglerVersion: 3.83.0 + workingDirectory: lib/manifest preCommands: | cat modus_schema.json command: | diff --git a/.github/workflows/release-sdk-as.yaml b/.github/workflows/release-sdk-as.yaml index 4e942241a..32b384dae 100644 --- a/.github/workflows/release-sdk-as.yaml +++ b/.github/workflows/release-sdk-as.yaml @@ -17,7 +17,8 @@ jobs: steps: - name: Validate version if: ${{ !startsWith(github.ref_name, 'sdk/assemblyscript/v') }} - run: echo "Modus AssemblyScript SDK version must start with `sdk/assemblyscript/v`" && exit 1 + run: + echo "Modus AssemblyScript SDK version must start with `sdk/assemblyscript/v`" && exit 1 - uses: actions/checkout@v4 with: ref: "${{ github.ref_name }}" @@ -30,7 +31,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: ">=22" - registry-url: "https://registry.npmjs.org" + registry-url: https://registry.npmjs.org - name: Prepare Release working-directory: sdk/assemblyscript run: ./scripts/prepare-release.sh ${{ steps.parse_sdk_version.outputs.sdk_version }} @@ -39,7 +40,9 @@ jobs: run: npm ci - name: Publish NPM Package working-directory: sdk/assemblyscript/src - run: npm publish --provenance --access public --tag ${{ steps.parse_sdk_version.outputs.npm_tag }} + run: + npm publish --provenance --access public --tag ${{ steps.parse_sdk_version.outputs.npm_tag + }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Create Release diff --git a/.github/workflows/release-sdk-go.yaml b/.github/workflows/release-sdk-go.yaml index c04170f7f..091fd7c30 100644 --- a/.github/workflows/release-sdk-go.yaml +++ b/.github/workflows/release-sdk-go.yaml @@ -26,8 +26,8 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - cache-dependency-path: "./sdk/go/go.sum" - go-version-file: "./sdk/go/go.mod" + cache-dependency-path: ./sdk/go/go.sum + go-version-file: ./sdk/go/go.mod - name: Prepare Release working-directory: sdk/go run: ./scripts/prepare-release.sh ${{ steps.parse_sdk_version.outputs.sdk_version }} diff --git a/.markdownlint.json b/.markdownlint.json deleted file mode 100644 index f2d969fe0..000000000 --- a/.markdownlint.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "default": true, - "MD013": false, - "MD034": false -} diff --git a/.trunk/.gitignore b/.trunk/.gitignore new file mode 100644 index 000000000..15966d087 --- /dev/null +++ b/.trunk/.gitignore @@ -0,0 +1,9 @@ +*out +*logs +*actions +*notifications +*tools +plugins +user_trunk.yaml +user.yaml +tmp diff --git a/.trunk/configs/.hadolint.yaml b/.trunk/configs/.hadolint.yaml new file mode 100644 index 000000000..98bf0cd2e --- /dev/null +++ b/.trunk/configs/.hadolint.yaml @@ -0,0 +1,4 @@ +# Following source doesn't work in most setups +ignored: + - SC1090 + - SC1091 diff --git a/.trunk/configs/.markdownlint.json b/.trunk/configs/.markdownlint.json new file mode 100644 index 000000000..449148d13 --- /dev/null +++ b/.trunk/configs/.markdownlint.json @@ -0,0 +1,8 @@ +{ + "line-length": { "line_length": 150, "tables": false }, + "no-inline-html": false, + "no-bare-urls": false, + "no-space-in-emphasis": false, + "no-emphasis-as-heading": false, + "first-line-heading": false +} diff --git a/.trunk/configs/.prettierrc b/.trunk/configs/.prettierrc new file mode 100644 index 000000000..7497b18d2 --- /dev/null +++ b/.trunk/configs/.prettierrc @@ -0,0 +1,6 @@ +{ + "plugins": ["assemblyscript-prettier"], + "semi": false, + "proseWrap": "always", + "printWidth": 100 +} diff --git a/.trunk/configs/.shellcheckrc b/.trunk/configs/.shellcheckrc new file mode 100644 index 000000000..8c7b1ada8 --- /dev/null +++ b/.trunk/configs/.shellcheckrc @@ -0,0 +1,7 @@ +enable=all +source-path=SCRIPTDIR +disable=SC2154 + +# If you're having issues with shellcheck following source, disable the errors via: +# disable=SC1090 +# disable=SC1091 diff --git a/.trunk/configs/.yamllint.yaml b/.trunk/configs/.yamllint.yaml new file mode 100644 index 000000000..184e251f8 --- /dev/null +++ b/.trunk/configs/.yamllint.yaml @@ -0,0 +1,7 @@ +rules: + quoted-strings: + required: only-when-needed + extra-allowed: ["{|}"] + key-duplicates: {} + octal-values: + forbid-implicit-octal: true diff --git a/cspell.json b/.trunk/configs/cspell.json similarity index 100% rename from cspell.json rename to .trunk/configs/cspell.json diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml new file mode 100644 index 000000000..8bd179c03 --- /dev/null +++ b/.trunk/trunk.yaml @@ -0,0 +1,44 @@ +# This file controls the behavior of Trunk: https://docs.trunk.io/cli +# To learn more about the format of this file, see https://docs.trunk.io/reference/trunk-yaml +version: 0.1 +cli: + version: 1.22.8 + +# Trunk provides extensibility via plugins. (https://docs.trunk.io/plugins) +plugins: + sources: + - id: trunk + ref: v1.6.6 + uri: https://github.com/trunk-io/plugins + +# Many linters and tools depend on runtimes - configure them here. (https://docs.trunk.io/runtimes) +runtimes: + enabled: + - go@1.23.4 + - node@18.20.5 + - python@3.10.8 + +# This is the section where you manage your linters. (https://docs.trunk.io/check/configuration) +lint: + enabled: + - actionlint@1.7.5 + - checkov@3.2.346 + - git-diff-check + - gofmt@1.20.4 + - golangci-lint@1.62.2 + - hadolint@2.12.1-beta + - markdownlint@0.43.0 + - osv-scanner@1.9.2 + - prettier@3.4.2: + packages: + - assemblyscript-prettier@3.0.1 + - shellcheck@0.10.0 + - shfmt@3.6.0 + - trufflehog@3.88.0 + - yamllint@1.35.1 +actions: + enabled: + - trunk-announce + - trunk-check-pre-push + - trunk-fmt-pre-commit + - trunk-upgrade-available diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 99c20c6bb..8327e8bd7 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,8 +1,6 @@ { "recommendations": [ - "dbaeumer.vscode-eslint", - "DavidAnson.vscode-markdownlint", - "esbenp.prettier-vscode", + "trunk.io", "golang.go", "GraphQL.vscode-graphql", "ms-vscode.makefile-tools", diff --git a/.vscode/settings.json b/.vscode/settings.json index 27b021ddc..1daa81da5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,6 +1,8 @@ { "cSpell.flagWords": ["teh", "hte"], "editor.formatOnSave": true, + "editor.defaultFormatter": "trunk.io", + "trunk.autoInit": false, "files.insertFinalNewline": true, "files.trimFinalNewlines": true, "files.associations": { @@ -9,20 +11,7 @@ "*hypermode.json": "jsonc", "*modus.json": "jsonc" }, - "go.lintTool": "golangci-lint", "go.testEnvVars": { "MODUS_DEBUG": "true" - }, - "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[json]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[jsonc]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" } } diff --git a/CHANGELOG.md b/CHANGELOG.md index f722418af..0de2ca7be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,24 +6,30 @@ ## 2024-12-23 - Runtime 0.16.0 -- fix: unused imports should not be included in metadata [#657](https://github.com/hypermodeinc/modus/pull/657) +- fix: unused imports should not be included in metadata + [#657](https://github.com/hypermodeinc/modus/pull/657) - fix: update runtime wasm tests [#661](https://github.com/hypermodeinc/modus/pull/661) - fix: support TinyGo 0.35.0 [#662](https://github.com/hypermodeinc/modus/pull/662) -- feat: add APIs for local time and time zones [#663](https://github.com/hypermodeinc/modus/pull/663) +- feat: add APIs for local time and time zones + [#663](https://github.com/hypermodeinc/modus/pull/663) ## 2024-12-23 - Go SDK 0.16.0 - chore: lint example test [#656](https://github.com/hypermodeinc/modus/pull/656) -- fix: unused imports should not be included in metadata [#657](https://github.com/hypermodeinc/modus/pull/657) +- fix: unused imports should not be included in metadata + [#657](https://github.com/hypermodeinc/modus/pull/657) - fix: improve Go version handling [#660](https://github.com/hypermodeinc/modus/pull/660) - fix: update runtime wasm tests [#661](https://github.com/hypermodeinc/modus/pull/661) - fix: support TinyGo 0.35.0 [#662](https://github.com/hypermodeinc/modus/pull/662) -- feat: add APIs for local time and time zones [#663](https://github.com/hypermodeinc/modus/pull/663) +- feat: add APIs for local time and time zones + [#663](https://github.com/hypermodeinc/modus/pull/663) ## 2024-12-23 - AssemblyScript SDK 0.16.0 -- test: add tests for AssemblyScript SDK Transform [#659](https://github.com/hypermodeinc/modus/pull/659) -- feat: add APIs for local time and time zones [#663](https://github.com/hypermodeinc/modus/pull/663) +- test: add tests for AssemblyScript SDK Transform + [#659](https://github.com/hypermodeinc/modus/pull/659) +- feat: add APIs for local time and time zones + [#663](https://github.com/hypermodeinc/modus/pull/663) ## 2024-12-23 - CLI 0.16.0 @@ -31,48 +37,60 @@ ## 2024-12-13 - Runtime 0.15.0 -- fix: doc comments from object fields should be present in generated GraphQL schema [#630](https://github.com/hypermodeinc/modus/pull/630) +- fix: doc comments from object fields should be present in generated GraphQL schema + [#630](https://github.com/hypermodeinc/modus/pull/630) - feat: add neo4j support in modus [#636](https://github.com/hypermodeinc/modus/pull/636) - perf: improve locking code [#637](https://github.com/hypermodeinc/modus/pull/637) -- fix: make jwk conversion warn to remove sentry overflow [#641](https://github.com/hypermodeinc/modus/pull/641) +- fix: make jwk conversion warn to remove sentry overflow + [#641](https://github.com/hypermodeinc/modus/pull/641) - chore: update dockerfile [#642](https://github.com/hypermodeinc/modus/pull/642) ## 2024-12-13 - Go SDK 0.15.0 -- fix: vector package should return generic type in computations [#628](https://github.com/hypermodeinc/modus/pull/628) +- fix: vector package should return generic type in computations + [#628](https://github.com/hypermodeinc/modus/pull/628) - chore: Remove unused go package reference [#632](https://github.com/hypermodeinc/modus/pull/632) - feat: add neo4j support in modus [#636](https://github.com/hypermodeinc/modus/pull/636) - fix: support point types [#650](https://github.com/hypermodeinc/modus/pull/650) ## 2024-12-13 - AssemblyScript SDK 0.15.0 -- fix: vector package should return generic type in computations [#628](https://github.com/hypermodeinc/modus/pull/628) -- chore: Delete extraneous copy of Anthropic model interface [#631](https://github.com/hypermodeinc/modus/pull/631) +- fix: vector package should return generic type in computations + [#628](https://github.com/hypermodeinc/modus/pull/628) +- chore: Delete extraneous copy of Anthropic model interface + [#631](https://github.com/hypermodeinc/modus/pull/631) - feat: add neo4j support in modus [#636](https://github.com/hypermodeinc/modus/pull/636) - feat: Add `DynamicMap` type [#638](https://github.com/hypermodeinc/modus/pull/638) -- fix: Dgraph AssemblyScript example query issues [#643](https://github.com/hypermodeinc/modus/pull/643) -- fix: neo4j as type unmarshalling & support point types [#650](https://github.com/hypermodeinc/modus/pull/650) +- fix: Dgraph AssemblyScript example query issues + [#643](https://github.com/hypermodeinc/modus/pull/643) +- fix: neo4j as type unmarshalling & support point types + [#650](https://github.com/hypermodeinc/modus/pull/650) ## 2024-12-11 - CLI 0.15.0 -- feat: Support `MODUS_HOME` environment variable [#639](https://github.com/hypermodeinc/modus/pull/639) +- feat: Support `MODUS_HOME` environment variable + [#639](https://github.com/hypermodeinc/modus/pull/639) ## 2024-11-27 - CLI 0.14.0 -- fix: Lookup of 'latest' SDK when no Modus SDK is referenced [#625](https://github.com/hypermodeinc/modus/pull/625) +- fix: Lookup of 'latest' SDK when no Modus SDK is referenced + [#625](https://github.com/hypermodeinc/modus/pull/625) ## 2024-11-27 - Runtime 0.14.1 -- feat: updates to API explorer [#617](https://github.com/hypermodeinc/modus/pull/617) [#626](https://github.com/hypermodeinc/modus/pull/626) +- feat: updates to API explorer [#617](https://github.com/hypermodeinc/modus/pull/617) + [#626](https://github.com/hypermodeinc/modus/pull/626) - various dependency updates ## 2024-11-27 - AssemblyScript SDK 0.14.2 -- chore: Export base Message class in OpenAI chat SDK [#616](https://github.com/hypermodeinc/modus/pull/616) +- chore: Export base Message class in OpenAI chat SDK + [#616](https://github.com/hypermodeinc/modus/pull/616) ## 2024-11-27 - Go SDK 0.14.3 -- chore: Export base Message class in OpenAI chat SDK [#616](https://github.com/hypermodeinc/modus/pull/616) +- chore: Export base Message class in OpenAI chat SDK + [#616](https://github.com/hypermodeinc/modus/pull/616) - fix: Filter imports to modus host functions [#623](https://github.com/hypermodeinc/modus/pull/623) ## 2024-11-25 - Go SDK 0.14.2 @@ -82,16 +100,21 @@ ## 2024-11-25 - CLI 0.13.10 - fix: modus new rename branch to main if not [#613](https://github.com/hypermodeinc/modus/pull/613) -- fix: use git commit with double quotes for Windows [#612](https://github.com/hypermodeinc/modus/pull/612) +- fix: use git commit with double quotes for Windows + [#612](https://github.com/hypermodeinc/modus/pull/612) ## 2024-11-23 - Runtime 0.14.0 -- feat: Apply in-code documentation to generated GraphQL [#519](https://github.com/hypermodeinc/modus/pull/519) -- feat: Reduce logger output during development [#576](https://github.com/hypermodeinc/modus/pull/576) -- chore: Trigger internal release pipeline at the end of the release-runtime workflow [#577](https://github.com/hypermodeinc/modus/pull/577) +- feat: Apply in-code documentation to generated GraphQL + [#519](https://github.com/hypermodeinc/modus/pull/519) +- feat: Reduce logger output during development + [#576](https://github.com/hypermodeinc/modus/pull/576) +- chore: Trigger internal release pipeline at the end of the release-runtime workflow + [#577](https://github.com/hypermodeinc/modus/pull/577) - feat: Add API explorer to runtime [#578](https://github.com/hypermodeinc/modus/pull/578) - feat: Add API explorer component to runtime [#584](https://github.com/hypermodeinc/modus/pull/584) -- fix: logic for jwks endpoint unmarshalling was incorrect [#594](https://github.com/hypermodeinc/modus/pull/594) +- fix: logic for jwks endpoint unmarshalling was incorrect + [#594](https://github.com/hypermodeinc/modus/pull/594) - chore: Refactoring schema generation [#605](https://github.com/hypermodeinc/modus/pull/605) ## 2024-11-23 - AssemblyScript SDK 0.14.1 @@ -112,52 +135,72 @@ ## 2024-11-20 - CLI 0.13.9 -- feat: use user provided name for package.json and go.mod [#595](https://github.com/hypermodeinc/modus/pull/595) -- feat: Add scarf to track installs and modus new [#596](https://github.com/hypermodeinc/modus/pull/596) +- feat: use user provided name for package.json and go.mod + [#595](https://github.com/hypermodeinc/modus/pull/595) +- feat: Add scarf to track installs and modus new + [#596](https://github.com/hypermodeinc/modus/pull/596) ## 2024-11-18 - AssemblyScript SDK 0.13.5 -- Update json-as to `0.9.26` to fix stack overflow error [#586](https://github.com/hypermodeinc/modus/pull/586) +- Update json-as to `0.9.26` to fix stack overflow error + [#586](https://github.com/hypermodeinc/modus/pull/586) - Updated various other dependencies ## 2024-11-08 - CLI 0.13.8 -- fix: Make `modus --version` just print modus CLI's version [#563](https://github.com/hypermodeinc/modus/pull/563) -- fix: implement retry and caching for CLI downloads [#571](https://github.com/hypermodeinc/modus/pull/571) [#574](https://github.com/hypermodeinc/modus/pull/574) +- fix: Make `modus --version` just print modus CLI's version + [#563](https://github.com/hypermodeinc/modus/pull/563) +- fix: implement retry and caching for CLI downloads + [#571](https://github.com/hypermodeinc/modus/pull/571) + [#574](https://github.com/hypermodeinc/modus/pull/574) ## 2024-11-08 - Runtime 0.13.2 -- fix: Introspection query should succeed when only mutations exist [#558](https://github.com/hypermodeinc/modus/pull/558) -- ci: Add `secrets: inherit` when calling release-info workflow [#555](https://github.com/hypermodeinc/modus/pull/555) +- fix: Introspection query should succeed when only mutations exist + [#558](https://github.com/hypermodeinc/modus/pull/558) +- ci: Add `secrets: inherit` when calling release-info workflow + [#555](https://github.com/hypermodeinc/modus/pull/555) - chore: Refactor metadata dependencies [#564](https://github.com/hypermodeinc/modus/pull/564) -- chore: Use Go workspace to simplify project dependencies [#565](https://github.com/hypermodeinc/modus/pull/565) -- fix: "WASM Host not found in context" error on shutdown [#566](https://github.com/hypermodeinc/modus/pull/566) -- fix: `__typename` should succeed on root fields [#573](https://github.com/hypermodeinc/modus/pull/573) +- chore: Use Go workspace to simplify project dependencies + [#565](https://github.com/hypermodeinc/modus/pull/565) +- fix: "WASM Host not found in context" error on shutdown + [#566](https://github.com/hypermodeinc/modus/pull/566) +- fix: `__typename` should succeed on root fields + [#573](https://github.com/hypermodeinc/modus/pull/573) ## 2024-11-06 - AssemblyScript SDK 0.13.4 -- fix: Don't empty previous contents of build dir [#568](https://github.com/hypermodeinc/modus/pull/568) +- fix: Don't empty previous contents of build dir + [#568](https://github.com/hypermodeinc/modus/pull/568) ## 2024-11-04 - CLI 0.13.7 -- Automatically generate and push releases info to R2 bucket on every release [#526](https://github.com/hypermodeinc/modus/pull/526) -- Consistent help + print enum options + validate SDK prereq [#542](https://github.com/hypermodeinc/modus/pull/542) +- Automatically generate and push releases info to R2 bucket on every release + [#526](https://github.com/hypermodeinc/modus/pull/526) +- Consistent help + print enum options + validate SDK prereq + [#542](https://github.com/hypermodeinc/modus/pull/542) - Consistent padding in the help section - `modus new`: Enum options need to print possible options - Validate SDK prereq immediately after choosing SDK - `modus sdk remove`: Use select prompt to allow selection -- For CLI to track non-prereleases, pull from releases json to remove rate limiting issues from github releases [#543](https://github.com/hypermodeinc/modus/pull/543) -- Modify isOnline in CLI to query releases.json [#544](https://github.com/hypermodeinc/modus/pull/544) -- remove all github api call references, add prerelease support to CLI [#545](https://github.com/hypermodeinc/modus/pull/545) +- For CLI to track non-prereleases, pull from releases json to remove rate limiting issues from + github releases [#543](https://github.com/hypermodeinc/modus/pull/543) +- Modify isOnline in CLI to query releases.json + [#544](https://github.com/hypermodeinc/modus/pull/544) +- remove all github api call references, add prerelease support to CLI + [#545](https://github.com/hypermodeinc/modus/pull/545) - Add CLI build CI [#547](https://github.com/hypermodeinc/modus/pull/547) - Add CLI Lint CI [#550](https://github.com/hypermodeinc/modus/pull/550) - Update installer script [#551](https://github.com/hypermodeinc/modus/pull/551) ## 2024-10-30 - CLI 0.13.6 -- `modus new`: Initialize git repo on interactive flow [#538](https://github.com/hypermodeinc/modus/pull/538) -- `modus new`: Skip confirmation if all required params are provided [#539](https://github.com/hypermodeinc/modus/pull/539) -- `modus new`: Fix issues with Go/TinyGo version detection [#540](https://github.com/hypermodeinc/modus/pull/540) +- `modus new`: Initialize git repo on interactive flow + [#538](https://github.com/hypermodeinc/modus/pull/538) +- `modus new`: Skip confirmation if all required params are provided + [#539](https://github.com/hypermodeinc/modus/pull/539) +- `modus new`: Fix issues with Go/TinyGo version detection + [#540](https://github.com/hypermodeinc/modus/pull/540) ## 2024-10-30 - AssemblyScript SDK 0.13.3 @@ -169,7 +212,8 @@ ## 2024-10-30 - Runtime 0.13.1 -- Add env file callback support for auth key reloading [#520](https://github.com/hypermodeinc/modus/pull/520) +- Add env file callback support for auth key reloading + [#520](https://github.com/hypermodeinc/modus/pull/520) - Fix timestamp parsing bug [#527](https://github.com/hypermodeinc/modus/pull/527) ## 2024-10-30 - Go/AS SDKs 0.13.1 @@ -182,7 +226,8 @@ ## 2024-10-29 - CLI 0.13.4 -- `modus build` should install SDK if not already installed [#524](https://github.com/hypermodeinc/modus/pull/524) +- `modus build` should install SDK if not already installed + [#524](https://github.com/hypermodeinc/modus/pull/524) ## 2024-10-29 - CLI 0.13.3 @@ -202,66 +247,90 @@ _NOTE: This is the first fully open-source release, using the name "Modus" for t "Hypermode" still refers to the company and the commercial hosting platform - but not the framework. In previous releases, the name "Hypermode" was used for all three._ -- Add Modus CLI [#389](https://github.com/hypermodeinc/modus/pull/389) [#483](https://github.com/hypermodeinc/modus/pull/483) [#484](https://github.com/hypermodeinc/modus/pull/484) [#485](https://github.com/hypermodeinc/modus/pull/485) -- Support user defined jwt auth and sdk functions [#405](https://github.com/hypermodeinc/modus/pull/405) +- Add Modus CLI [#389](https://github.com/hypermodeinc/modus/pull/389) + [#483](https://github.com/hypermodeinc/modus/pull/483) + [#484](https://github.com/hypermodeinc/modus/pull/484) + [#485](https://github.com/hypermodeinc/modus/pull/485) +- Support user defined jwt auth and sdk functions + [#405](https://github.com/hypermodeinc/modus/pull/405) - Migrate from Hypermode to Modus [#412](https://github.com/hypermodeinc/modus/pull/412) - Import WasmExtractor code [#415](https://github.com/hypermodeinc/modus/pull/415) - Import Manifest code [#416](https://github.com/hypermodeinc/modus/pull/416) - Update the runtime's manifest usage [#417](https://github.com/hypermodeinc/modus/pull/417) - Add Modus Go SDK [#418](https://github.com/hypermodeinc/modus/pull/418) - Add Local Model Invocation Support [#421](https://github.com/hypermodeinc/modus/pull/421) -- Remove HTTP Timeout, Add Context Timeout on Collections [#422](https://github.com/hypermodeinc/modus/pull/422) +- Remove HTTP Timeout, Add Context Timeout on Collections + [#422](https://github.com/hypermodeinc/modus/pull/422) - Add Modus AssemblyScript SDK [#423](https://github.com/hypermodeinc/modus/pull/423) - Add models to Modus AssemblyScript SDK [#428](https://github.com/hypermodeinc/modus/pull/428) - Add Vectors SDK support [#431](https://github.com/hypermodeinc/modus/pull/431) - Update Readme files [#432](https://github.com/hypermodeinc/modus/pull/432) -- Fix vulnerability in AssemblyScript SDK install script [#435](https://github.com/hypermodeinc/modus/pull/435) -- Fix potential array out of bounds in the runtime [#437](https://github.com/hypermodeinc/modus/pull/437) +- Fix vulnerability in AssemblyScript SDK install script + [#435](https://github.com/hypermodeinc/modus/pull/435) +- Fix potential array out of bounds in the runtime + [#437](https://github.com/hypermodeinc/modus/pull/437) - Set minimum Go version to 1.23.0 [#438](https://github.com/hypermodeinc/modus/pull/438) - Change default for environment setting [#439](https://github.com/hypermodeinc/modus/pull/439) -- Remove compatibility code for previous versions [#441](https://github.com/hypermodeinc/modus/pull/441) +- Remove compatibility code for previous versions + [#441](https://github.com/hypermodeinc/modus/pull/441) - Target Node 22 [#446](https://github.com/hypermodeinc/modus/pull/446) - Fix object/map field stitching [#447](https://github.com/hypermodeinc/modus/pull/447) -- Use cli component instead of direct node execution modus-sdk-as [#448](https://github.com/hypermodeinc/modus/pull/448) +- Use cli component instead of direct node execution modus-sdk-as + [#448](https://github.com/hypermodeinc/modus/pull/448) - Cleanup Go Modules [#450](https://github.com/hypermodeinc/modus/pull/450) - Modularize / Rename host functions [#452](https://github.com/hypermodeinc/modus/pull/452) -- Add release pipeline for the runtime [#453](https://github.com/hypermodeinc/modus/pull/453) [#454](https://github.com/hypermodeinc/modus/pull/454) +- Add release pipeline for the runtime [#453](https://github.com/hypermodeinc/modus/pull/453) + [#454](https://github.com/hypermodeinc/modus/pull/454) - Remove `go generate` and fix docker build [#455](https://github.com/hypermodeinc/modus/pull/455) - Remove AWS Secrets Manager client [#456](https://github.com/hypermodeinc/modus/pull/456) - Make app path required [#457](https://github.com/hypermodeinc/modus/pull/457) - Improve `.env` file handling [#458](https://github.com/hypermodeinc/modus/pull/458) - Update command-line args and env variables [#459](https://github.com/hypermodeinc/modus/pull/459) - Update Sentry telemetry collection rules [#460](https://github.com/hypermodeinc/modus/pull/460) -- Fix entry alignment issue with AssemblyScript maps [#461](https://github.com/hypermodeinc/modus/pull/461) +- Fix entry alignment issue with AssemblyScript maps + [#461](https://github.com/hypermodeinc/modus/pull/461) - Update to use new Modus manifest [#462](https://github.com/hypermodeinc/modus/pull/462) -- Enable GraphQL endpoints to be defined in the manifest [#464](https://github.com/hypermodeinc/modus/pull/464) -- Publish SDKs and templates via release workflows [#465](https://github.com/hypermodeinc/modus/pull/465) -- Fix AssemblyScript build failure when no Git repo is present [#475](https://github.com/hypermodeinc/modus/pull/475) +- Enable GraphQL endpoints to be defined in the manifest + [#464](https://github.com/hypermodeinc/modus/pull/464) +- Publish SDKs and templates via release workflows + [#465](https://github.com/hypermodeinc/modus/pull/465) +- Fix AssemblyScript build failure when no Git repo is present + [#475](https://github.com/hypermodeinc/modus/pull/475) - Disable AWS Bedrock support temporarily [#479](https://github.com/hypermodeinc/modus/pull/479) - Update SDK releases [#480](https://github.com/hypermodeinc/modus/pull/480) - Add metadata shared library [#482](https://github.com/hypermodeinc/modus/pull/482) - Add `.gitignore` files to default templates [#486](https://github.com/hypermodeinc/modus/pull/486) -- Fix CLI warnings about Go/TinyGo installation [#487](https://github.com/hypermodeinc/modus/pull/487) +- Fix CLI warnings about Go/TinyGo installation + [#487](https://github.com/hypermodeinc/modus/pull/487) - Remove deprecated model fields [#488](https://github.com/hypermodeinc/modus/pull/488) - Improve dev first use log messages [#489](https://github.com/hypermodeinc/modus/pull/489) - Highlight endpoints when running in dev [#490](https://github.com/hypermodeinc/modus/pull/490) - Fix data race in logging adapter [#491](https://github.com/hypermodeinc/modus/pull/491) - Add Anthropic model interface to the Go SDK [#493](https://github.com/hypermodeinc/modus/pull/493) - Simplify and polish `modus new` experience [#494](https://github.com/hypermodeinc/modus/pull/494) -- Move hyp settings for local model invocation to env variables [#495](https://github.com/hypermodeinc/modus/pull/495) [#504](https://github.com/hypermodeinc/modus/pull/504) -- Change GraphQL SDK examples to use a generic public GraphQL API [#501](https://github.com/hypermodeinc/modus/pull/501) -- Improve file watching and fix Windows issues [#505](https://github.com/hypermodeinc/modus/pull/505) -- Improve help messages, add `modus info` and show SDK version in `modus new` [#506](https://github.com/hypermodeinc/modus/pull/506) -- Fix runtime shutdown issues with `modus dev` [#508](https://github.com/hypermodeinc/modus/pull/508) -- Monitored manifest and env files for changes [#509](https://github.com/hypermodeinc/modus/pull/509) +- Move hyp settings for local model invocation to env variables + [#495](https://github.com/hypermodeinc/modus/pull/495) + [#504](https://github.com/hypermodeinc/modus/pull/504) +- Change GraphQL SDK examples to use a generic public GraphQL API + [#501](https://github.com/hypermodeinc/modus/pull/501) +- Improve file watching and fix Windows issues + [#505](https://github.com/hypermodeinc/modus/pull/505) +- Improve help messages, add `modus info` and show SDK version in `modus new` + [#506](https://github.com/hypermodeinc/modus/pull/506) +- Fix runtime shutdown issues with `modus dev` + [#508](https://github.com/hypermodeinc/modus/pull/508) +- Monitored manifest and env files for changes + [#509](https://github.com/hypermodeinc/modus/pull/509) - Log bad GraphQL requests in dev [#510](https://github.com/hypermodeinc/modus/pull/510) - Add JWKS endpoint key support to auth [#511](https://github.com/hypermodeinc/modus/pull/511) -- Use conventions to support GraphQL mutations and adjust query names [#513](https://github.com/hypermodeinc/modus/pull/513) +- Use conventions to support GraphQL mutations and adjust query names + [#513](https://github.com/hypermodeinc/modus/pull/513) ## 2024-10-02 - Version 0.12.7 - Use reader-writer lock on AWS secrets cache [#400](https://github.com/hypermodeinc/modus/pull/400) -- Improve bucket layout for FunctionExecutionDurationMilliseconds metric and add function_name label [#401](https://github.com/hypermodeinc/modus/pull/401) +- Improve bucket layout for FunctionExecutionDurationMilliseconds metric and add function_name label + [#401](https://github.com/hypermodeinc/modus/pull/401) - Improve JSON performance [#402](https://github.com/hypermodeinc/modus/pull/402) - Misc performance improvements [#403](https://github.com/hypermodeinc/modus/pull/403) - Fix error on void response [#404](https://github.com/hypermodeinc/modus/pull/404) @@ -269,11 +338,13 @@ In previous releases, the name "Hypermode" was used for all three._ ## 2024-09-26 - Version 0.12.6 -- Revert #393 and #396, then apply correct fix for field alignment issue [#397](https://github.com/hypermodeinc/modus/pull/397) +- Revert #393 and #396, then apply correct fix for field alignment issue + [#397](https://github.com/hypermodeinc/modus/pull/397) ## 2024-09-26 - Version 0.12.5 -- Fix AssemblyScript error unpinning objects from memory [#396](https://github.com/hypermodeinc/modus/pull/396) +- Fix AssemblyScript error unpinning objects from memory + [#396](https://github.com/hypermodeinc/modus/pull/396) ## 2024-09-26 - Version 0.12.4 @@ -282,17 +353,21 @@ In previous releases, the name "Hypermode" was used for all three._ ## 2024-09-26 - Version 0.12.3 -- Arrays in collections host functions should be non-nil [#384](https://github.com/hypermodeinc/modus/pull/384) +- Arrays in collections host functions should be non-nil + [#384](https://github.com/hypermodeinc/modus/pull/384) - Update error handling for function calls [#385](https://github.com/hypermodeinc/modus/pull/385) -- Fix array-like types passed via interface wrappers [#386](https://github.com/hypermodeinc/modus/pull/386) -- Cast slice values to handle json.Number and others [#387](https://github.com/hypermodeinc/modus/pull/387) +- Fix array-like types passed via interface wrappers + [#386](https://github.com/hypermodeinc/modus/pull/386) +- Cast slice values to handle json.Number and others + [#387](https://github.com/hypermodeinc/modus/pull/387) - Trap JSON unsupported value errors [#388](https://github.com/hypermodeinc/modus/pull/388) - Adjust Sentry transactions [#390](https://github.com/hypermodeinc/modus/pull/390) ## 2024-09-24 - Version 0.12.2 - Fix missing GraphQL type schema [#376](https://github.com/hypermodeinc/modus/pull/376) -- Add FunctionExecutionDurationMillisecondsSummary metric [#377](https://github.com/hypermodeinc/modus/pull/377) +- Add FunctionExecutionDurationMillisecondsSummary metric + [#377](https://github.com/hypermodeinc/modus/pull/377) - Fix field alignment issue [#378](https://github.com/hypermodeinc/modus/pull/378) - Improve execution plan creation [#379](https://github.com/hypermodeinc/modus/pull/379) - Fix plan creation / registration bug [#380](https://github.com/hypermodeinc/modus/pull/380) @@ -300,17 +375,23 @@ In previous releases, the name "Hypermode" was used for all three._ ## 2024-09-18 - Version 0.12.1 - Fix panic from Go maps with primitive types [#370](https://github.com/hypermodeinc/modus/pull/370) -- Fix error when using a map as an input parameter [#373](https://github.com/hypermodeinc/modus/pull/373) +- Fix error when using a map as an input parameter + [#373](https://github.com/hypermodeinc/modus/pull/373) - Fix errors related to nil slices [#374](https://github.com/hypermodeinc/modus/pull/374) ## 2024-09-16 - Version 0.12.0 -- Add language support for Hypermode Go SDK [#317](https://github.com/hypermodeinc/modus/pull/317) [#351](https://github.com/hypermodeinc/modus/pull/351) [#352](https://github.com/hypermodeinc/modus/pull/352) -- Major refactoring to support multiple guest languages [#347](https://github.com/hypermodeinc/modus/pull/347) +- Add language support for Hypermode Go SDK [#317](https://github.com/hypermodeinc/modus/pull/317) + [#351](https://github.com/hypermodeinc/modus/pull/351) + [#352](https://github.com/hypermodeinc/modus/pull/352) +- Major refactoring to support multiple guest languages + [#347](https://github.com/hypermodeinc/modus/pull/347) - Rename `hmruntime` to `hypruntime` [#348](https://github.com/hypermodeinc/modus/pull/348) - Make empty dgraph responses nil [#355](https://github.com/hypermodeinc/modus/pull/355) -- Support objects as parameters to functions via GraphQL input types [#359](https://github.com/hypermodeinc/modus/pull/359) -- Fix GraphQL schema generation for Go functions [#360](https://github.com/hypermodeinc/modus/pull/360) +- Support objects as parameters to functions via GraphQL input types + [#359](https://github.com/hypermodeinc/modus/pull/359) +- Fix GraphQL schema generation for Go functions + [#360](https://github.com/hypermodeinc/modus/pull/360) - Add getLabel to collection host functions [#361](https://github.com/hypermodeinc/modus/pull/361) - Fix import registration issue [#364](https://github.com/hypermodeinc/modus/pull/364) - Fix conversion of empty arrays and slices [#365](https://github.com/hypermodeinc/modus/pull/365) @@ -318,8 +399,10 @@ In previous releases, the name "Hypermode" was used for all three._ ## 2024-08-27 - Version 0.11.2 -- Refactor dgraph host functions to use single execute host function [#342](https://github.com/hypermodeinc/modus/pull/342) -- Add vector retrieval and search by vector to collections [#343](https://github.com/hypermodeinc/modus/pull/343) +- Refactor dgraph host functions to use single execute host function + [#342](https://github.com/hypermodeinc/modus/pull/342) +- Add vector retrieval and search by vector to collections + [#343](https://github.com/hypermodeinc/modus/pull/343) ## 2024-08-16 - Version 0.11.1 @@ -328,75 +411,105 @@ In previous releases, the name "Hypermode" was used for all three._ ## 2024-08-12 - Version 0.11.0 -- Perf improvements to internal storage of hnsw data in Collections [#299](https://github.com/hypermodeinc/modus/pull/299) -- Fix type resolution issues [#304](https://github.com/hypermodeinc/modus/pull/304) [#306](https://github.com/hypermodeinc/modus/pull/306) -- Implement nearest neighbor classification in Collections [#305](https://github.com/hypermodeinc/modus/pull/305) +- Perf improvements to internal storage of hnsw data in Collections + [#299](https://github.com/hypermodeinc/modus/pull/299) +- Fix type resolution issues [#304](https://github.com/hypermodeinc/modus/pull/304) + [#306](https://github.com/hypermodeinc/modus/pull/306) +- Implement nearest neighbor classification in Collections + [#305](https://github.com/hypermodeinc/modus/pull/305) - Fix certain errors reporting incorrectly [#307](https://github.com/hypermodeinc/modus/pull/307) -- Improve encoding and decoding of arrays and maps [#308](https://github.com/hypermodeinc/modus/pull/308) +- Improve encoding and decoding of arrays and maps + [#308](https://github.com/hypermodeinc/modus/pull/308) - Listen on both IPv4 and IPv6 for localhost [#309](https://github.com/hypermodeinc/modus/pull/309) -- Warn instead of error on some db connection failures [#310](https://github.com/hypermodeinc/modus/pull/310) -- Modularize language-specific features [#314](https://github.com/hypermodeinc/modus/pull/314) [#325](https://github.com/hypermodeinc/modus/pull/325) +- Warn instead of error on some db connection failures + [#310](https://github.com/hypermodeinc/modus/pull/310) +- Modularize language-specific features [#314](https://github.com/hypermodeinc/modus/pull/314) + [#325](https://github.com/hypermodeinc/modus/pull/325) - Fix error reporting with host functions [#318](https://github.com/hypermodeinc/modus/pull/318) -- Log cancellations and host function activity [#320](https://github.com/hypermodeinc/modus/pull/320) -- Add namespaces to collections to isolate storage [#321](https://github.com/hypermodeinc/modus/pull/321) -- Use more direct approach for registering host functions [#322](https://github.com/hypermodeinc/modus/pull/322) [#326](https://github.com/hypermodeinc/modus/pull/326) [#327](https://github.com/hypermodeinc/modus/pull/327) -- Add getNamespaces host function for collections [#324](https://github.com/hypermodeinc/modus/pull/324) +- Log cancellations and host function activity + [#320](https://github.com/hypermodeinc/modus/pull/320) +- Add namespaces to collections to isolate storage + [#321](https://github.com/hypermodeinc/modus/pull/321) +- Use more direct approach for registering host functions + [#322](https://github.com/hypermodeinc/modus/pull/322) + [#326](https://github.com/hypermodeinc/modus/pull/326) + [#327](https://github.com/hypermodeinc/modus/pull/327) +- Add getNamespaces host function for collections + [#324](https://github.com/hypermodeinc/modus/pull/324) - Add cross namespace search to collections [#330](https://github.com/hypermodeinc/modus/pull/330) ## 2024-07-23 - Version 0.10.1 - Add HNSW indexing for collection [#285](https://github.com/hypermodeinc/modus/pull/285) -- Use default parameter value in metadata if it exists [#286](https://github.com/hypermodeinc/modus/pull/286) -- Fix memory corruption issue with multiple input parameters [#288](https://github.com/hypermodeinc/modus/pull/288) +- Use default parameter value in metadata if it exists + [#286](https://github.com/hypermodeinc/modus/pull/286) +- Fix memory corruption issue with multiple input parameters + [#288](https://github.com/hypermodeinc/modus/pull/288) ## 2024-07-15 - Version 0.10.0 - Update manifest library and usage [#275](https://github.com/hypermodeinc/modus/pull/275) - Support pointers when marshalling objects [#277](https://github.com/hypermodeinc/modus/pull/277) - Add support for PostgreSQL host functions [#278](https://github.com/hypermodeinc/modus/pull/278) -- Fix dbpool reading after failed initialization [#281](https://github.com/hypermodeinc/modus/pull/281) +- Fix dbpool reading after failed initialization + [#281](https://github.com/hypermodeinc/modus/pull/281) - Update for metadata changes [#282](https://github.com/hypermodeinc/modus/pull/282) - Store function info with inference history [#283](https://github.com/hypermodeinc/modus/pull/283) -- Fix issues with GraphQL block quotes [wundergraph/graphql-go-tools/843](https://github.com/wundergraph/graphql-go-tools/pull/843) +- Fix issues with GraphQL block quotes + [wundergraph/graphql-go-tools/843](https://github.com/wundergraph/graphql-go-tools/pull/843) ## 2024-07-09 - Version 0.9.5 -- Use anonymous wasm modules for better performance [#264](https://github.com/hypermodeinc/modus/pull/264) -- Assume normalized vectors when calculating cosine similarity [#265](https://github.com/hypermodeinc/modus/pull/265) +- Use anonymous wasm modules for better performance + [#264](https://github.com/hypermodeinc/modus/pull/264) +- Assume normalized vectors when calculating cosine similarity + [#265](https://github.com/hypermodeinc/modus/pull/265) - Support optional parameters [#269](https://github.com/hypermodeinc/modus/pull/269) - Handle null parameters [#270](https://github.com/hypermodeinc/modus/pull/2270) ## 2024-06-26 - Version 0.9.4 -- Increase batch size for auto-embedding collection texts [#259](https://github.com/hypermodeinc/modus/pull/259) -- Fix error with multiline input in GraphQL query [#260](https://github.com/hypermodeinc/modus/pull/260) +- Increase batch size for auto-embedding collection texts + [#259](https://github.com/hypermodeinc/modus/pull/259) +- Fix error with multiline input in GraphQL query + [#260](https://github.com/hypermodeinc/modus/pull/260) ## 2024-06-25 - Version 0.9.3 -- Don't panic when the metadata DB is not configured [#256](https://github.com/hypermodeinc/modus/pull/256) -- Don't panic when collections are renamed or deleted [#257](https://github.com/hypermodeinc/modus/pull/257) +- Don't panic when the metadata DB is not configured + [#256](https://github.com/hypermodeinc/modus/pull/256) +- Don't panic when collections are renamed or deleted + [#257](https://github.com/hypermodeinc/modus/pull/257) ## 2024-06-24 - Version 0.9.2 -- Add auto-embedding for collection based on text checkpoint [#250](https://github.com/hypermodeinc/modus/pull/250) +- Add auto-embedding for collection based on text checkpoint + [#250](https://github.com/hypermodeinc/modus/pull/250) - Remove extraneous types in graphql schemas [#251](https://github.com/hypermodeinc/modus/pull/251) - Allow arrays as inputs to host functions [#252](https://github.com/hypermodeinc/modus/pull/252) -- Add batch upsert & batch recompute for collection & on auto-embedding [#253](https://github.com/hypermodeinc/modus/pull/253) +- Add batch upsert & batch recompute for collection & on auto-embedding + [#253](https://github.com/hypermodeinc/modus/pull/253) ## 2024-06-22 - Version 0.9.1 -- Filter collection embedding functions from GraphQL schema [#245](https://github.com/hypermodeinc/modus/pull/245) -- Remove collection index from memory when manifest changes [#246](https://github.com/hypermodeinc/modus/pull/246) -- Fix missing execution id and plugin from logs from previous functions version [#247](https://github.com/hypermodeinc/modus/pull/247) -- Fix content type header when calling Hypermode-hosted models [#248](https://github.com/hypermodeinc/modus/pull/248) +- Filter collection embedding functions from GraphQL schema + [#245](https://github.com/hypermodeinc/modus/pull/245) +- Remove collection index from memory when manifest changes + [#246](https://github.com/hypermodeinc/modus/pull/246) +- Fix missing execution id and plugin from logs from previous functions version + [#247](https://github.com/hypermodeinc/modus/pull/247) +- Fix content type header when calling Hypermode-hosted models + [#248](https://github.com/hypermodeinc/modus/pull/248) ## 2024-06-21 - Version 0.9.0 - Add nullable check in ReadString [#228](https://github.com/hypermodeinc/modus/pull/228) -- Lowercase model name before invoking for hypermode hosted models [#221](https://github.com/hypermodeinc/modus/pull/221) +- Lowercase model name before invoking for hypermode hosted models + [#221](https://github.com/hypermodeinc/modus/pull/221) - Improve HTTP error messages [#222](https://github.com/hypermodeinc/modus/pull/222) - Add host function for direct logging [#224](https://github.com/hypermodeinc/modus/pull/224) -- Refactoring, and add helpers for calling functions [#226](https://github.com/hypermodeinc/modus/pull/226) +- Refactoring, and add helpers for calling functions + [#226](https://github.com/hypermodeinc/modus/pull/226) - Add support for new model interface [#229](https://github.com/hypermodeinc/modus/pull/229) - Add sequential vector search [#240](https://github.com/hypermodeinc/modus/pull/240) - Update Hypermode-hosted model endpoint URL [#242](https://github.com/hypermodeinc/modus/pull/242) @@ -404,63 +517,84 @@ In previous releases, the name "Hypermode" was used for all three._ ## 2024-06-03 - Version 0.8.2 -- Send backend ID with Sentry events [#211](https://github.com/hypermodeinc/modus/pull/211) [#213](https://github.com/hypermodeinc/modus/pull/213) +- Send backend ID with Sentry events [#211](https://github.com/hypermodeinc/modus/pull/211) + [#213](https://github.com/hypermodeinc/modus/pull/213) - Add some logging for secrets [#212](https://github.com/hypermodeinc/modus/pull/212) - Update logging to include Runtime version [#215](https://github.com/hypermodeinc/modus/pull/215) ## 2024-05-30 - Version 0.8.1 -- Fix compatibility with v1 `authHeader` secret [#208](https://github.com/hypermodeinc/modus/pull/208) -- Fix double-escaped JSON in OpenAI inference history [#209](https://github.com/hypermodeinc/modus/pull/209) +- Fix compatibility with v1 `authHeader` secret + [#208](https://github.com/hypermodeinc/modus/pull/208) +- Fix double-escaped JSON in OpenAI inference history + [#209](https://github.com/hypermodeinc/modus/pull/209) ## 2024-05-29 - Version 0.8.0 - Add Model Inference History to runtime [#186](https://github.com/hypermodeinc/modus/pull/186) -- Pass auth headers correctly when invoking a GraphQL API [#196](https://github.com/hypermodeinc/modus/pull/196) -- Use shared manifest module to read `hypermode.json` [#199](https://github.com/hypermodeinc/modus/pull/199) -- Pass HTTP auth secrets using v2 manifest format [#203](https://github.com/hypermodeinc/modus/pull/203) [#205](https://github.com/hypermodeinc/modus/pull/205) +- Pass auth headers correctly when invoking a GraphQL API + [#196](https://github.com/hypermodeinc/modus/pull/196) +- Use shared manifest module to read `hypermode.json` + [#199](https://github.com/hypermodeinc/modus/pull/199) +- Pass HTTP auth secrets using v2 manifest format + [#203](https://github.com/hypermodeinc/modus/pull/203) + [#205](https://github.com/hypermodeinc/modus/pull/205) ## 2024-05-13 - Version 0.7.0 -- Sentry is no longer used when `HYPERMODE_DEBUG` is enabled [#187](https://github.com/hypermodeinc/modus/pull/187) -- Only listen on `localhost` when `HYPERMODE_DEBUG` is enabled, to prevent firewall prompt [#188](https://github.com/hypermodeinc/modus/pull/188) -- Improve support for marshaling classes [#189](https://github.com/hypermodeinc/modus/pull/189) [#191](https://github.com/hypermodeinc/modus/pull/191) +- Sentry is no longer used when `HYPERMODE_DEBUG` is enabled + [#187](https://github.com/hypermodeinc/modus/pull/187) +- Only listen on `localhost` when `HYPERMODE_DEBUG` is enabled, to prevent firewall prompt + [#188](https://github.com/hypermodeinc/modus/pull/188) +- Improve support for marshaling classes [#189](https://github.com/hypermodeinc/modus/pull/189) + [#191](https://github.com/hypermodeinc/modus/pull/191) - Add support for binary data fields [#190](https://github.com/hypermodeinc/modus/pull/190) - Add host function for HTTP fetch [#191](https://github.com/hypermodeinc/modus/pull/191) ## 2024-05-08 - Version 0.6.6 -- Remove `Access-Control-Allow-Credentials`. Add `Access-Control-Request-Headers` [#180](https://github.com/hypermodeinc/modus/pull/180) +- Remove `Access-Control-Allow-Credentials`. Add `Access-Control-Request-Headers` + [#180](https://github.com/hypermodeinc/modus/pull/180) - Restrict incoming http requests methods [#182](https://github.com/hypermodeinc/modus/pull/182) ## 2024-05-07 - Version 0.6.5 -- Add `Access-Control-Allow-Credentials` in CORS preflight [#177](https://github.com/hypermodeinc/modus/pull/177) +- Add `Access-Control-Allow-Credentials` in CORS preflight + [#177](https://github.com/hypermodeinc/modus/pull/177) ## 2024-05-03 - Version 0.6.4 - Add CORS support to all endpoints [#171](https://github.com/hypermodeinc/modus/pull/171) -- Replace hyphens with underscores in environment variables [#172](https://github.com/hypermodeinc/modus/pull/172) -- Allow comments and trailing commas in `hypermode.json` [#173](https://github.com/hypermodeinc/modus/pull/173) +- Replace hyphens with underscores in environment variables + [#172](https://github.com/hypermodeinc/modus/pull/172) +- Allow comments and trailing commas in `hypermode.json` + [#173](https://github.com/hypermodeinc/modus/pull/173) ## 2024-05-02 - Version 0.6.3 - Update metrics collection to remove labels [#163](https://github.com/hypermodeinc/modus/pull/163) -- Add environment and version to health endpoint [#164](https://github.com/hypermodeinc/modus/pull/164) -- Capture function execution duration in metrics [#165](https://github.com/hypermodeinc/modus/pull/165) +- Add environment and version to health endpoint + [#164](https://github.com/hypermodeinc/modus/pull/164) +- Capture function execution duration in metrics + [#165](https://github.com/hypermodeinc/modus/pull/165) ## 2024-04-29 - Version 0.6.2 -- Traces and non-user errors are now sent to Sentry [#158](https://github.com/hypermodeinc/modus/issues/158) +- Traces and non-user errors are now sent to Sentry + [#158](https://github.com/hypermodeinc/modus/issues/158) - Fix OpenAI text generation [#161](https://github.com/hypermodeinc/modus/issues/161) ## 2024-04-26 - Version 0.6.1 -- Fix GraphQL error when resulting data contains a nested null field [#150](https://github.com/hypermodeinc/modus/issues/150) -- Fix GraphQL error when resolving `__typename` fields; also add `HYPERMODE_TRACE` debugging flag [#151](https://github.com/hypermodeinc/modus/issues/151) -- Collect metrics and expose metrics and health endpoints [#152](https://github.com/hypermodeinc/modus/issues/152) +- Fix GraphQL error when resulting data contains a nested null field + [#150](https://github.com/hypermodeinc/modus/issues/150) +- Fix GraphQL error when resolving `__typename` fields; also add `HYPERMODE_TRACE` debugging flag + [#151](https://github.com/hypermodeinc/modus/issues/151) +- Collect metrics and expose metrics and health endpoints + [#152](https://github.com/hypermodeinc/modus/issues/152) - Add graceful shutdown for HTTP server [#153](https://github.com/hypermodeinc/modus/issues/153) - - Note: It works correctly for system-generated and user-generated (`ctrl-C`) terminations, but [not when debugging in VS Code](https://github.com/golang/vscode-go/issues/120). + - Note: It works correctly for system-generated and user-generated (`ctrl-C`) terminations, but + [not when debugging in VS Code](https://github.com/golang/vscode-go/issues/120). - Add version awareness [#155](https://github.com/hypermodeinc/modus/issues/155) ## 2024-04-25 - Version 0.6.0 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 1f59696b4..614af544e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -2,124 +2,109 @@ ## 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, religion, or sexual identity -and orientation. +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, 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. +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: +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 +- 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 +- 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 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. +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. +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 -hello@hypermode.com. -All complaints will be reviewed and investigated promptly and fairly. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community +leaders responsible for enforcement at hello@hypermode.com. 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. +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: +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. +**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. +**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. +**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. +**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. +**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. +**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. +**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. +**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.0, available at +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. -Community Impact Guidelines were inspired by [Mozilla's code of conduct -enforcement ladder](https://github.com/mozilla/diversity). +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). [homepage]: https://www.contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ca8428534..f3a3cb858 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,32 +1,46 @@ # Contributing to Modus -We're really glad you're here and would love for you to contribute to Modus! There are a variety of ways to make Modus better, including bug fixes, features, docs, and blog posts (among others). Every bit helps π +We're really glad you're here and would love for you to contribute to Modus! There are a variety of +ways to make Modus better, including bug fixes, features, docs, and blog posts (among others). Every +bit helps π -Please help us keep the community safe while working on the project by upholding our [Code of Conduct](/CODE_OF_CONDUCT.md) at all times. +Please help us keep the community safe while working on the project by upholding our +[Code of Conduct](/CODE_OF_CONDUCT.md) at all times. -Before jumping to a pull request, ensure you've looked at [PRs](https://github.com/hypermodeinc/modus/pulls) and [issues](https://github.com/hypermodeinc/modus/issues) (open and closed) for existing work related to your idea. +Before jumping to a pull request, ensure you've looked at +[PRs](https://github.com/hypermodeinc/modus/pulls) and +[issues](https://github.com/hypermodeinc/modus/issues) (open and closed) for existing work related +to your idea. -If in doubt or contemplating a larger change, join the [Hypermode Discord](https://discord.hypermode.com) and start a discussion in the [#modus](https://discord.com/channels/1267579648657850441/1292948253796466730) channel. +If in doubt or contemplating a larger change, join the +[Hypermode Discord](https://discord.hypermode.com) and start a discussion in the +[#modus](https://discord.com/channels/1267579648657850441/1292948253796466730) channel. ## Codebase -The primary development language of Modus is Go. The **runtime** and supporting packages are all written in Go. +The primary development language of Modus is Go. The **runtime** and supporting packages are all +written in Go. -**Modus SDKs** enable users to build apps in multiple languages, currently including Go and AssemblyScript. +**Modus SDKs** enable users to build apps in multiple languages, currently including Go and +AssemblyScript. The **Modus CLI** drives the local development experience and is written in TypeScript. ### Development environment -The fastest path to setting up a development environment for Modus is through VS Code. The repo includes a set of configs to set VS Code up automatically. +The fastest path to setting up a development environment for Modus is through VS Code. The repo +includes a set of configs to set VS Code up automatically. ### Clone the Modus repository -To contribute code, start by forking the Modus repository. In the top-right of the [repo](https://github.com/hypermodeinc/modus), click **Fork**. Follow the instructions to create a fork of the repo in your GitHub workspace. +To contribute code, start by forking the Modus repository. In the top-right of the +[repo](https://github.com/hypermodeinc/modus), click **Fork**. Follow the instructions to create a +fork of the repo in your GitHub workspace. ### Building and running tests -Wherever possible, we use the built-in capabilities of each language. For example, unit tests for Go components can be run with: +Wherever possible, we use the built-in capabilities of each language. For example, unit tests for Go +components can be run with: ```bash go test ./... @@ -34,9 +48,11 @@ go test ./... ### Opening a pull request -When you're ready, open a pull request against the `main` branch in the Modus repo. Include a clear, detailed description of the changes you've made. Be sure to add and update tests and docs as needed. +When you're ready, open a pull request against the `main` branch in the Modus repo. Include a clear, +detailed description of the changes you've made. Be sure to add and update tests and docs as needed. -We do our best to respond to PRs within a few days. If you've not heard back, feel free to ping on Discord. +We do our best to respond to PRs within a few days. If you've not heard back, feel free to ping on +Discord. ## Other ways to help @@ -44,11 +60,13 @@ Pull requests are awesome, but there are many ways to help. ### Documentation improvements -Modus docs are maintained in a [separate repository](https://github.com/hypermodeinc/docs). Relevant updates and issues should be opened in that repo. +Modus docs are maintained in a [separate repository](https://github.com/hypermodeinc/docs). Relevant +updates and issues should be opened in that repo. ### Blogging and presenting your work -Share what you're building with Modus in your preferred medium. We'd love to help amplify your work and/or provide feedback, so get in touch if you'd like some help! +Share what you're building with Modus in your preferred medium. We'd love to help amplify your work +and/or provide feedback, so get in touch if you'd like some help! ### Join the community diff --git a/README.md b/README.md index 0d947006f..4f1be572d 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,26 @@
- Get Started Β· - Docs Β· + Get Started + Β· + Docs + Β· Discord
-**Modus is an open-source, serverless framework for building APIs powered by WebAssembly.** It simplifies integrating AI models, data, and business logic with sandboxed execution. And, it's really fast. +**Modus is an open-source, serverless framework for building APIs powered by WebAssembly.** It +simplifies integrating AI models, data, and business logic with sandboxed execution. And, it's +really fast. We built Modus to put code back at the heart of development. @@ -24,7 +28,7 @@ You write a function. ```ts export function sayHello(name: string): string { - return `Hello, ${name}!`; + return `Hello, ${name}!` } ``` @@ -52,7 +56,8 @@ In a few milliseconds, Modus: - securely queries data and AI models as needed, without exposing credentials to your code - responds via the API result and releases the execution environment -**Now you have a production ready scalable endpoint for your AI-enabled app. AI-ready when youβre ready. Launch and iterate.** +**Now you have a production ready scalable endpoint for your AI-enabled app. AI-ready when youβre +ready. Launch and iterate.** ## Quickstart @@ -84,19 +89,24 @@ modus dev ## What's it good for? -We designed Modus primarily as a general-purpose framework, it just happens to treat models as a first-class component. With Modus you can use models, as appropriate, without additional complexity. +We designed Modus primarily as a general-purpose framework, it just happens to treat models as a +first-class component. With Modus you can use models, as appropriate, without additional complexity. -Modus is optimized for applications that require sub-second response times. Weβve made trade-offs to prioritize speed and simplicity. +Modus is optimized for applications that require sub-second response times. Weβve made trade-offs to +prioritize speed and simplicity. ## Programming Languages -Since Modus is based on WebAssembly, you can write Modus apps in various programming languages. -Each language offers the full capabilities of the Modus framework. +Since Modus is based on WebAssembly, you can write Modus apps in various programming languages. Each +language offers the full capabilities of the Modus framework. Currently, the supported languages you may choose from are: -- [AssemblyScript](https://www.assemblyscript.org/) - A TypeScript-like language designed for WebAssembly. - - If you are primarily used to writing front-end web apps, you'll feel at home with AssemblyScript. +- [AssemblyScript](https://www.assemblyscript.org/) - A TypeScript-like language designed for + WebAssembly. + + - If you are primarily used to writing front-end web apps, you'll feel at home with + AssemblyScript. - [Go](https://go.dev/) - A general-purpose programming language originally designed by Google. - If you are primarily used to writing back-end apps, you'll likely prefer to use Go. @@ -105,31 +115,45 @@ Additional programming languages may be supported in the future. ## Hosting -We have designed Hypermode to be the best place to run your Modus app. -Hypermode hosting plans include features you might expect, such as support, telemetry, and high availability. -They also include specialty features such as model hosting that are purposefully designed to work in tandem with Modus apps. +We have designed Hypermode to be the best place to run your Modus app. Hypermode hosting plans +include features you might expect, such as support, telemetry, and high availability. They also +include specialty features such as model hosting that are purposefully designed to work in tandem +with Modus apps. -As Modus is a free, open-source framework, youβre welcome to run your Modus apps on your own hardware or on any -hosting platform that meets your needs. +As Modus is a free, open-source framework, youβre welcome to run your Modus apps on your own +hardware or on any hosting platform that meets your needs. ## Open Source -Modus is developed by [Hypermode](https://hypermode.com/) as an open-source project, integral but independent from Hypermode. +Modus is developed by [Hypermode](https://hypermode.com/) as an open-source project, integral but +independent from Hypermode. -We welcome external contributions. See the [CONTRIBUTING.md](./CONTRIBUTING.md) file if you would like to get involved. +We welcome external contributions. See the [CONTRIBUTING.md](./CONTRIBUTING.md) file if you would +like to get involved. ## Acknowledgements -It's taken a lot of hard work to bring Modus to life, but we couldn't have done it alone. Modus is built upon _many_ open source components and projects. We'd especially like to express our gratitude to the authors and teams of our core dependencies: - -- Takeshi Yoneda, author of [Wazero](https://wazero.io/), and other contributors to the Wazero project - and to [Tetrate](https://tetrate.io/) for continuing its support of Wazero. Modus uses Wazero to execute WebAssembly modules. -- Jens Neuse, Stefan Avram, and the rest of the team at [Wundergraph](https://wundergraph.com/). Modus uses Wundergraph's [GraphQL Go Tools](https://github.com/wundergraph/graphql-go-tools) library to process incoming GraphQL API requests. -- Max Graey, Daniel Wirtz, and other contributors to the [AssemblyScript](https://www.assemblyscript.org/) project. Modus chose AssemblyScript as one of its core languages because it is ideal for web developers getting started with Web Assembly. -- The [Go language](https://go.dev/) team, and also the maintainers of [TinyGo](https://tinygo.org/). The Modus Runtime is written in Go, and the Modus Go SDK uses TinyGo. +It's taken a lot of hard work to bring Modus to life, but we couldn't have done it alone. Modus is +built upon _many_ open source components and projects. We'd especially like to express our gratitude +to the authors and teams of our core dependencies: + +- Takeshi Yoneda, author of [Wazero](https://wazero.io/), and other contributors to the Wazero + project - and to [Tetrate](https://tetrate.io/) for continuing its support of Wazero. Modus uses + Wazero to execute WebAssembly modules. +- Jens Neuse, Stefan Avram, and the rest of the team at [Wundergraph](https://wundergraph.com/). + Modus uses Wundergraph's [GraphQL Go Tools](https://github.com/wundergraph/graphql-go-tools) + library to process incoming GraphQL API requests. +- Max Graey, Daniel Wirtz, and other contributors to the + [AssemblyScript](https://www.assemblyscript.org/) project. Modus chose AssemblyScript as one of + its core languages because it is ideal for web developers getting started with Web Assembly. +- The [Go language](https://go.dev/) team, and also the maintainers of + [TinyGo](https://tinygo.org/). The Modus Runtime is written in Go, and the Modus Go SDK uses + TinyGo. ## License -Modus and its components are Copyright 2024 Hypermode Inc., and licensed under the terms of the Apache License, Version 2.0. -See the [LICENSE](./LICENSE) file for a complete copy of the license. +Modus and its components are Copyright 2024 Hypermode Inc., and licensed under the terms of the +Apache License, Version 2.0. See the [LICENSE](./LICENSE) file for a complete copy of the license. -If you have any questions about Modus licensing, or need an alternate license or other arrangement, please contact us at hello@hypermode.com. +If you have any questions about Modus licensing, or need an alternate license or other arrangement, +please contact us at hello@hypermode.com. diff --git a/SECURITY.md b/SECURITY.md index e698ff6db..65d28b643 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -1,7 +1,10 @@ # Reporting Security Concerns -We take the security of Modus very seriously. If you believe you have found a security vulnerability in Modus, we encourage you to let us know right away. +We take the security of Modus very seriously. If you believe you have found a security vulnerability +in Modus, we encourage you to let us know right away. -We will investigate all legitimate reports and do our best to quickly fix the problem. Please report any issues or vulnerabilities via Github Security Advisories instead of posting a public issue in GitHub. You can also send security communications to security@hypermode.com. +We will investigate all legitimate reports and do our best to quickly fix the problem. Please report +any issues or vulnerabilities via Github Security Advisories instead of posting a public issue in +GitHub. You can also send security communications to security@hypermode.com. Please include the version identifier and details on how the vulnerability can be exploited. diff --git a/cli/install.sh b/cli/install.sh index 73674489a..3d3edb990 100755 --- a/cli/install.sh +++ b/cli/install.sh @@ -12,7 +12,7 @@ # Config PACKAGE_ORG="@hypermode" PACKAGE_NAME="modus-cli" -INSTALL_DIR="${MODUS_CLI:-"${MODUS_HOME:-"$HOME/.modus"}/cli"}" +INSTALL_DIR="${MODUS_CLI:-"${MODUS_HOME:-"${HOME}/.modus"}/cli"}" VERSION="latest" INSTALLER_VERSION="0.1.2" @@ -26,247 +26,247 @@ OS="$(uname -s)" # ANSI escape codes if [[ -t 1 ]]; then - CLEAR_LINE="\e[1A\e[2K\e[2K" - BOLD="\e[1m" - BLUE="\e[34;1m" - YELLOW="\e[33m" - RED="\e[31m" - DIM="\e[2m" - RESET="\e[0m" + CLEAR_LINE="\e[1A\e[2K\e[2K" + BOLD="\e[1m" + BLUE="\e[34;1m" + YELLOW="\e[33m" + RED="\e[31m" + DIM="\e[2m" + RESET="\e[0m" else - CLEAR_LINE="" - BOLD="" - BLUE="" - YELLOW="" - RED="" - DIM="" - RESET="" + CLEAR_LINE="" + BOLD="" + BLUE="" + YELLOW="" + RED="" + DIM="" + RESET="" fi get_latest_version() { - local url="https://releases.hypermode.com/modus-latest.json" - curl -sL "$url" | grep '"cli"' | sed -E 's/.*"cli": "v([^"]+)".*/\1/' + local url="https://releases.hypermode.com/modus-latest.json" + curl -sL "${url}" | grep '"cli"' | sed -E 's/.*"cli": "v([^"]+)".*/\1/' } ARCHIVE_URL="" download_from_npm() { - local tmpdir="$1" - local url="$2" - local filename="${PACKAGE_NAME}-${VERSION}.tgz" - local download_file="$tmpdir/$filename" + local tmpdir="$1" + local url="$2" + local filename="${PACKAGE_NAME}-${VERSION}.tgz" + local download_file="${tmpdir}/${filename}" - mkdir -p "$tmpdir" + mkdir -p "${tmpdir}" - curl --progress-bar --show-error --location --fail "$url" --output "$download_file" - if [ "$?" != 0 ]; then - return 1 - fi + curl --progress-bar --show-error --location --fail "${url}" --output "${download_file}" + if [[ $? != 0 ]]; then + return 1 + fi - printf "$CLEAR_LINE" >&2 - echo "$download_file" + printf "${CLEAR_LINE}" >&2 + echo "${download_file}" } echo_fexists() { - [ -f "$1" ] && echo "$1" + [[ -f $1 ]] && echo "$1" } detect_profile() { - local shellname="$1" - local uname="$2" - - if [ -f "$PROFILE" ]; then - echo "$PROFILE" - return - fi - - case "$shellname" in - bash) - case $uname in - Darwin) - echo_fexists "$HOME/.bash_profile" || echo_fexists "$HOME/.bashrc" - ;; - *) - echo_fexists "$HOME/.bashrc" || echo_fexists "$HOME/.bash_profile" - ;; - esac - ;; - zsh) - echo "$HOME/.zshrc" - ;; - fish) - echo "$HOME/.config/fish/config.fish" - ;; - *) - local profiles - case $uname in - Darwin) - profiles=(.profile .bash_profile .bashrc .zshrc .config/fish/config.fish) - ;; - *) - profiles=(.profile .bashrc .bash_profile .zshrc .config/fish/config.fish) - ;; - esac - - for profile in "${profiles[@]}"; do - echo_fexists "$HOME/$profile" && break - done - ;; - esac + local shellname="$1" + local uname="$2" + + if [[ -f ${PROFILE} ]]; then + echo "${PROFILE}" + return + fi + + case "${shellname}" in + bash) + case ${uname} in + Darwin) + echo_fexists "${HOME}/.bash_profile" || echo_fexists "${HOME}/.bashrc" + ;; + *) + echo_fexists "${HOME}/.bashrc" || echo_fexists "${HOME}/.bash_profile" + ;; + esac + ;; + zsh) + echo "${HOME}/.zshrc" + ;; + fish) + echo "${HOME}/.config/fish/config.fish" + ;; + *) + local profiles + case ${uname} in + Darwin) + profiles=(.profile .bash_profile .bashrc .zshrc .config/fish/config.fish) + ;; + *) + profiles=(.profile .bashrc .bash_profile .zshrc .config/fish/config.fish) + ;; + esac + + for profile in "${profiles[@]}"; do + echo_fexists "${HOME}/${profile}" && break + done + ;; + esac } build_path_str() { - local profile="$1" install_dir="$2" - if [[ $profile == *.fish ]]; then - echo -e "set -gx MODUS_CLI \"$install_dir\"\nstring match -r \".modus\" \"\$PATH\" > /dev/null; or set -gx PATH \"\$MODUS_CLI/bin\" \$PATH" - else - install_dir="${install_dir/#$HOME/\$HOME}" - echo -e "\n# Modus CLI\nexport MODUS_CLI=\"$install_dir\"\nexport PATH=\"\$MODUS_CLI/bin:\$PATH\"" - fi + local profile="$1" install_dir="$2" + if [[ ${profile} == *.fish ]]; then + echo -e "set -gx MODUS_CLI \"${install_dir}\"\nstring match -r \".modus\" \"\$PATH\" > /dev/null; or set -gx PATH \"\$MODUS_CLI/bin\" \$PATH" + else + install_dir="${install_dir/#${HOME}/\$HOME}" + echo -e "\n# Modus CLI\nexport MODUS_CLI=\"${install_dir}\"\nexport PATH=\"\$MODUS_CLI/bin:\$PATH\"" + fi } cli_dir_valid() { - if [ -n "${MODUS_CLI-}" ] && [ -e "$MODUS_CLI" ] && ! [ -d "$MODUS_CLI" ]; then - printf "\$MODUS_CLI is set but is not a directory ($MODUS_CLI).\n" >&2 - printf "Please check your profile scripts and environment.\n" >&2 - exit 1 - fi - return 0 + if [[ -n ${MODUS_CLI-} ]] && [[ -e ${MODUS_CLI} ]] && ! [[ -d ${MODUS_CLI} ]]; then + printf "\$MODUS_CLI is set but is not a directory (${MODUS_CLI}).\n" >&2 + printf "Please check your profile scripts and environment.\n" >&2 + exit 1 + fi + return 0 } update_profile() { - local install_dir="$1" - if [[ ":$PATH:" == *":$install_dir:"* ]]; then - printf "[3/4] ${DIM}The Modus CLI is already in \$PATH${RESET}\n" >&2 - return 0 - fi - - local profile="$(detect_profile $(basename "$SHELL") $(uname -s))" - if [ -z "$profile" ]; then - printf "No user shell profile found.\n" >&2 - return 1 - fi - - export SHOW_RESET_PROFILE=1 - export PROFILE="~/$(basename "$profile")" - - if grep -q 'MODUS_CLI' "$profile"; then - printf "[3/4] ${DIM}The Modus CLI has already been configured in ${PROFILE}${RESET}\n" >&2 - return 0 - fi - - local path_str="$(build_path_str "$profile" "$install_dir")" - echo "$path_str" >>"$profile" - - printf "[3/4] ${DIM}Added the Modus CLI to the PATH in ${PROFILE}${RESET}\n" >&2 + local install_dir="$1" + if [[ ":${PATH}:" == *":${install_dir}:"* ]]; then + printf "[3/4] ${DIM}The Modus CLI is already in \$PATH${RESET}\n" >&2 + return 0 + fi + + local profile="$(detect_profile $(basename "${SHELL}") $(uname -s))" + if [[ -z ${profile} ]]; then + printf "No user shell profile found.\n" >&2 + return 1 + fi + + export SHOW_RESET_PROFILE=1 + export PROFILE="~/$(basename "${profile}")" + + if grep -q 'MODUS_CLI' "${profile}"; then + printf "[3/4] ${DIM}The Modus CLI has already been configured in ${PROFILE}${RESET}\n" >&2 + return 0 + fi + + local path_str="$(build_path_str "${profile}" "${install_dir}")" + echo "${path_str}" >>"${profile}" + + printf "[3/4] ${DIM}Added the Modus CLI to the PATH in ${PROFILE}${RESET}\n" >&2 } install_version() { - if ! cli_dir_valid; then - exit 1 - fi - - case "$VERSION" in - latest) - VERSION="$(get_latest_version)" - ;; - *) ;; - esac - - install_release - if [ "$?" == 0 ]; then - update_profile "$INSTALL_DIR" && printf "[4/4] ${DIM}Installed Modus CLI${RESET}\n" >&2 - fi + if ! cli_dir_valid; then + exit 1 + fi + + case "${VERSION}" in + latest) + VERSION="$(get_latest_version)" + ;; + *) ;; + esac + + install_release + if [[ $? == 0 ]]; then + update_profile "${INSTALL_DIR}" && printf "[4/4] ${DIM}Installed Modus CLI${RESET}\n" >&2 + fi } install_release() { - printf "[1/4] ${DIM}Downloading Modus CLI from NPM${RESET}\n" + printf "[1/4] ${DIM}Downloading Modus CLI from NPM${RESET}\n" - local url="https://registry.npmjs.org/${PACKAGE_ORG:+$PACKAGE_ORG/}${PACKAGE_NAME}/-/${PACKAGE_NAME}-${VERSION}.tgz" + local url="https://registry.npmjs.org/${PACKAGE_ORG:+${PACKAGE_ORG}/}${PACKAGE_NAME}/-/${PACKAGE_NAME}-${VERSION}.tgz" - download_archive="$( - download_release "$url" - exit "$?" - )" - exit_status="$?" - if [ "$exit_status" != 0 ]; then - printf "Could not download Modus version '$VERSION' from\n$url\n" >&2 - exit 1 - fi + download_archive="$( + download_release "${url}" + exit "$?" + )" + exit_status="$?" + if [[ ${exit_status} != 0 ]]; then + printf "Could not download Modus version '${VERSION}' from\n${url}\n" >&2 + exit 1 + fi - printf "$CLEAR_LINE" >&2 - printf "[1/4] ${DIM}Downloaded latest Modus CLI v${VERSION}${RESET}\n" >&2 + printf "${CLEAR_LINE}" >&2 + printf "[1/4] ${DIM}Downloaded latest Modus CLI v${VERSION}${RESET}\n" >&2 - install_from_file "$download_archive" + install_from_file "${download_archive}" } download_release() { - local url="$1" - local download_dir="$(mktemp -d)" - download_from_npm "$download_dir" "$url" + local url="$1" + local download_dir="$(mktemp -d)" + download_from_npm "${download_dir}" "${url}" } install_from_file() { - local archive="$1" - local extract_to="$(dirname "$archive")" + local archive="$1" + local extract_to="$(dirname "${archive}")" - printf "[2/4] ${DIM}Unpacking archive${RESET}\n" >&2 + printf "[2/4] ${DIM}Unpacking archive${RESET}\n" >&2 - tar -xf "$archive" -C "$extract_to" + tar -xf "${archive}" -C "${extract_to}" - rm -rf "$INSTALL_DIR" - mkdir -p "$INSTALL_DIR" - rm -f "$archive" - mv "$extract_to/package/"* "$INSTALL_DIR" - rm -rf "$extract_to" + rm -rf "${INSTALL_DIR}" + mkdir -p "${INSTALL_DIR}" + rm -f "${archive}" + mv "${extract_to}/package/"* "${INSTALL_DIR}" + rm -rf "${extract_to}" - ln -s "$INSTALL_DIR/bin/modus.js" "$INSTALL_DIR/bin/modus" + ln -s "${INSTALL_DIR}/bin/modus.js" "${INSTALL_DIR}/bin/modus" - printf "$CLEAR_LINE" >&2 - printf "[2/4] ${DIM}Installing dependencies${RESET}\n" >&2 - (cd "$INSTALL_DIR" && "$NPM_PATH" install --omit=dev --silent && find . -type d -empty -delete) + printf "${CLEAR_LINE}" >&2 + printf "[2/4] ${DIM}Installing dependencies${RESET}\n" >&2 + (cd "${INSTALL_DIR}" && "${NPM_PATH}" install --omit=dev --silent && find . -type d -empty -delete) - printf "$CLEAR_LINE" >&2 - printf "[2/4] ${DIM}Unpacked archive${RESET}\n" >&2 + printf "${CLEAR_LINE}" >&2 + printf "[2/4] ${DIM}Unpacked archive${RESET}\n" >&2 } check_platform() { - case $ARCH in - arm64) ARCH="arm64" ;; - x86_64) ARCH="x64" ;; - *) ;; - esac - - case "$ARCH/$OS" in - x64/Linux | arm64/Linux | x64/Darwin | arm64/Darwin) return 0 ;; - *) - printf "Unsupported os $OS $ARCH\n" >&2 - exit 1 - ;; - esac + case ${ARCH} in + arm64) ARCH="arm64" ;; + x86_64) ARCH="x64" ;; + *) ;; + esac + + case "${ARCH}/${OS}" in + x64/Linux | arm64/Linux | x64/Darwin | arm64/Darwin) return 0 ;; + *) + printf "Unsupported os ${OS} ${ARCH}\n" >&2 + exit 1 + ;; + esac } check_node() { - if [ -z "$NODE_PATH" ]; then - printf "${RED}Node.js is not installed.${RESET}\n" >&2 - printf "${RED}Please install Node.js $NODE_WANTED or later and try again.${RESET}\n" >&2 - exit 1 - fi - - # check node version - local node_version="$("$NODE_PATH" --version)" - local node_major="${node_version%%.*}" - node_major="${node_major#v}" - if [ "$node_major" -lt "$NODE_MIN" ]; then - printf "${RED}Node.js $NODE_MIN or later is required. You have $node_version.${RESET}\n" >&2 - printf "${RED}Please update and try again${RESET}\n" >&2 - exit 1 - fi - - # make sure npm can be found too - if [ -z "$NPM_PATH" ]; then - printf "${RED}npm is not installed. Please install npm and try again.${RESET}\n" >&2 - exit 1 - fi + if [[ -z ${NODE_PATH} ]]; then + printf "${RED}Node.js is not installed.${RESET}\n" >&2 + printf "${RED}Please install Node.js ${NODE_WANTED} or later and try again.${RESET}\n" >&2 + exit 1 + fi + + # check node version + local node_version="$("${NODE_PATH}" --version)" + local node_major="${node_version%%.*}" + node_major="${node_major#v}" + if [[ ${node_major} -lt ${NODE_MIN} ]]; then + printf "${RED}Node.js ${NODE_MIN} or later is required. You have ${node_version}.${RESET}\n" >&2 + printf "${RED}Please update and try again${RESET}\n" >&2 + exit 1 + fi + + # make sure npm can be found too + if [[ -z ${NPM_PATH} ]]; then + printf "${RED}npm is not installed. Please install npm and try again.${RESET}\n" >&2 + exit 1 + fi } # This is the entry point @@ -278,12 +278,12 @@ install_version printf "\nThe Modus CLI has been installed! π\n" >&2 -if [ -n "${SHOW_RESET_PROFILE-}" ]; then - printf "\n${YELLOW}Please restart your terminal or run:${RESET}\n" >&2 - printf " ${DIM}source ${PROFILE}${RESET}\n" >&2 - printf "\nThen, run ${DIM}modus${RESET} to get started${RESET}\n" >&2 +if [[ -n ${SHOW_RESET_PROFILE-} ]]; then + printf "\n${YELLOW}Please restart your terminal or run:${RESET}\n" >&2 + printf " ${DIM}source ${PROFILE}${RESET}\n" >&2 + printf "\nThen, run ${DIM}modus${RESET} to get started${RESET}\n" >&2 else - printf "\nRun ${DIM}modus${RESET} to get started${RESET}\n" >&2 + printf "\nRun ${DIM}modus${RESET} to get started${RESET}\n" >&2 fi printf "\n" >&2 diff --git a/lib/README.md b/lib/README.md index 11688b898..e2df2fbbe 100644 --- a/lib/README.md +++ b/lib/README.md @@ -2,10 +2,11 @@ This directory contains shared libraries that are used by various Modus components, or externally. -Each subdirectory contains a separate Go module that is versioned independently from the rest of the repository, -using a module path and tag scheme that matches the folder path. +Each subdirectory contains a separate Go module that is versioned independently from the rest of the +repository, using a module path and tag scheme that matches the folder path. -For example, updates to the `manifest` subdirectory are tagged as `lib/manifest/vX.Y.Z`, and are installed with +For example, updates to the `manifest` subdirectory are tagged as `lib/manifest/vX.Y.Z`, and are +installed with ```sh go get -u github.com/hypermodeinc/modus/lib/manifest @@ -14,4 +15,5 @@ go get -u github.com/hypermodeinc/modus/lib/manifest ## Usage outside Modus The shared libraries can be used for any purpose, subject to the Modus [LICENSE](../LICENSE). -Primarily they are used by the Modus runtime, and hosting infrastructure such as [Hypermode](https://hypermode.com). +Primarily they are used by the Modus runtime, and hosting infrastructure such as +[Hypermode](https://hypermode.com). diff --git a/runtime/.goreleaser.yaml b/runtime/.goreleaser.yaml index 66306b129..4bf6f7ea8 100644 --- a/runtime/.goreleaser.yaml +++ b/runtime/.goreleaser.yaml @@ -5,7 +5,7 @@ monorepo: tag_prefix: runtime/ dir: runtime git: - tag_sort: "-version:creatordate" + tag_sort: -version:creatordate prerelease_suffix: "-" before: hooks: @@ -46,8 +46,8 @@ builds: archives: - files: - - "../README.md" - - "../LICENSE" + - ../README.md + - ../LICENSE name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}" format: tar.gz # use zip for windows archives @@ -55,7 +55,7 @@ archives: - goos: windows format: zip checksum: - name_template: "checksums.txt" + name_template: checksums.txt release: prerelease: auto changelog: diff --git a/runtime/README.md b/runtime/README.md index 34abacc06..8119dfa12 100644 --- a/runtime/README.md +++ b/runtime/README.md @@ -1,7 +1,7 @@ # Modus Runtime -This directory contains the source code for the Modus runtime, -which is responsible for loading and executing your Modus app. +This directory contains the source code for the Modus runtime, which is responsible for loading and +executing your Modus app. Unless you are contributing to the Modus project, you will not need to download this code directly. Instead, a compiled platform-specific binary of the Modus runtime will be downloaded and installed diff --git a/runtime/explorer/content/ModusIcon.tsx b/runtime/explorer/content/ModusIcon.tsx index edce09181..5e2326494 100644 --- a/runtime/explorer/content/ModusIcon.tsx +++ b/runtime/explorer/content/ModusIcon.tsx @@ -1,12 +1,7 @@ -import React from "react"; +import React from "react" const ModusLogo = ({ className }: { className?: string }) => ( -