Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
with:
go-version-file: go.mod

- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.2.20'

- name: Verify formatting
shell: bash
run: |
Expand All @@ -39,3 +44,9 @@ jobs:

- name: Build CLI
run: go build ./cmd/metorial

- name: Install npm workspace dependencies
run: bun install --frozen-lockfile

- name: Build npm packages
run: bun run build:npm
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_PAGES_PROJECT: 'metorial-cli'
GITHUB_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
SCOOP_BUCKET_GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
Expand All @@ -35,11 +36,20 @@ jobs:
with:
go-version-file: go.mod

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org

- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: '1.2.20'

- name: Install npm workspace dependencies
run: bun install --frozen-lockfile

- name: Resolve GoReleaser skip flags
shell: bash
run: |
Expand Down Expand Up @@ -75,6 +85,15 @@ jobs:
version: '~> v2'
args: release --clean ${{ env.GORELEASER_SKIP_ARGS }}

- name: Set npm package versions
run: bun run set-npm-version -- "${GITHUB_REF_NAME#v}"

- name: Build npm packages
run: bun run build:npm

- name: Publish npm packages
run: bun run publish:npm

- name: Build hosted installer site
run: bun ./scripts/build-public.ts

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ go.work.sum
dist
public
.metorial
node_modules
npm/*/dist
npm/node_modules
metorial

Expand Down
282 changes: 282 additions & 0 deletions bun.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions internal/commands/resources/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ func TestRootHelpSeparatesResourceCommands(t *testing.T) {
if !strings.Contains(output, "Commands:\n") {
t.Fatalf("help output missing Commands section:\n%s", output)
}
if !strings.Contains(output, "Resource Commands:\n") {
t.Fatalf("help output missing Resource Commands section:\n%s", output)
if !strings.Contains(output, "Resource Admin Commands:\n") {
t.Fatalf("help output missing Resource Admin Commands section:\n%s", output)
}
if strings.Contains(output, "Commands:\n providers") {
t.Fatalf("providers unexpectedly listed in general Commands section:\n%s", output)
Expand Down
4 changes: 2 additions & 2 deletions internal/commandutil/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func HelpTemplate() string {
{{helpHeading "Integrations:"}}
{{renderIntegrationSection .Commands}}{{end}}{{if hasCommandCategory .Commands "resource"}}

{{helpHeading "Resource Commands:"}}
{{helpHeading "Resource Admin Commands:"}}
{{renderCommandSection .Commands "resource"}}{{end}}{{end}}{{if commandAnnotation . "metorial:arguments"}}

{{helpHeading "Arguments:"}}
Expand Down Expand Up @@ -116,7 +116,7 @@ func UsageTemplate() string {
{{helpHeading "Integrations:"}}
{{renderIntegrationSection .Commands}}{{end}}{{if hasCommandCategory .Commands "resource"}}

{{helpHeading "Resource Commands:"}}
{{helpHeading "Resource Admin Commands:"}}
{{renderCommandSection .Commands "resource"}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}

{{helpHeading "Flags:"}}
Expand Down
21 changes: 21 additions & 0 deletions npm/cli-core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "@metorial/cli-core",
"version": "0.0.0-dev",
"description": "Runtime helpers for downloading and invoking the Metorial CLI",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsup --config tsup.config.ts"
},
"dependencies": {
"extract-zip": "^2.0.1",
"tar": "^7.4.3"
}
}
Loading
Loading