fix(cli): variant date flags — variants add could never succeed
#43
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Run codegen against production OpenAPI | |
| run: bun run codegen | |
| - name: Typecheck | |
| run: bun run typecheck | |
| - name: Lint | |
| run: bun run lint | |
| - name: Test | |
| run: bun test | |
| # The published artifact is dist/mna.js running on plain Node, which the | |
| # unit tests never exercise. A dependency whose bundled output only breaks | |
| # at runtime (e.g. a lazy `require` in a UMD build) is invisible without | |
| # this step. | |
| - name: Build and smoke-test the npm bundle on Node | |
| run: | | |
| bun run build | |
| node dist/mna.js --version | |
| # Seed a throwaway HOME with a JSONC config so the install actually | |
| # reaches jsonc-parser's parse/modify/applyEdits. On a pristine HOME | |
| # nothing is detected, no config is read, and a lazy require inside | |
| # those functions would still ship — which is the exact class of bug | |
| # this step exists to catch. | |
| SMOKE_HOME="$(mktemp -d)" | |
| export HOME="$SMOKE_HOME" XDG_CONFIG_HOME="$SMOKE_HOME/.config" | |
| mkdir -p "$SMOKE_HOME/.cursor" | |
| printf '%s\n' \ | |
| '{' \ | |
| ' // a comment jsonc-parser must preserve' \ | |
| ' "mcpServers": {' \ | |
| ' "existing": { "url": "https://example.invalid/mcp" },' \ | |
| ' }' \ | |
| '}' > "$SMOKE_HOME/.cursor/mcp.json" | |
| node dist/mna.js skills list --all --json > /dev/null | |
| node dist/mna.js skills install --client cursor --yes | |
| echo "--- resulting config ---" | |
| cat "$SMOKE_HOME/.cursor/mcp.json" | |
| grep -q 'a comment jsonc-parser must preserve' "$SMOKE_HOME/.cursor/mcp.json" | |
| grep -q 'my-next-adventure' "$SMOKE_HOME/.cursor/mcp.json" | |
| grep -q 'existing' "$SMOKE_HOME/.cursor/mcp.json" | |
| test -f "$SMOKE_HOME/.cursor/skills/mna/SKILL.md" | |
| echo "bundle smoke test OK" |