Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
33 changes: 3 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,30 @@ jobs:
runs-on: ubuntu-latest

steps:
# TODO(published-sdk): use a single checkout at repo root (drop path: cli).
- name: Checkout CLI
- name: Checkout
uses: actions/checkout@v4
with:
path: cli

# TODO(published-sdk): remove — sdk-ts is built and fetched from npm, not sibling checkout.
- name: Checkout sdk-ts
uses: actions/checkout@v4
with:
repository: Decodo/sdk-ts
path: sdk-ts
ref: main

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
# TODO(published-sdk): drop package_json_file when checkout is at repo root.
package_json_file: cli/package.json

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
# TODO(published-sdk): revert to pnpm-lock.yaml (no cli/ prefix).
cache-dependency-path: cli/pnpm-lock.yaml

# TODO(published-sdk): remove — published @decodo/sdk-ts ships prebuilt artifacts.
- name: Build sdk-ts
# codegen needs inputs/decodo.ir.json (gitignored); compile committed src/generated instead.
run: pnpm install --frozen-lockfile && pnpm run build:esm && pnpm run build:cjs
working-directory: sdk-ts
cache-dependency-path: pnpm-lock.yaml

# TODO(published-sdk): drop working-directory: cli on all steps below.
- name: Install CLI dependencies
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: cli

- name: Lint
run: pnpm lint
working-directory: cli

- name: Typecheck
run: pnpm typecheck
working-directory: cli

- name: Build
run: pnpm build
working-directory: cli

- name: Test
run: pnpm test
working-directory: cli
23 changes: 1 addition & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,22 @@

Official command-line interface for the Decodo APIs.

## Development setup (temporary)

Until `@decodo/sdk-ts` is published to npm, the CLI depends on a **sibling checkout** of [Decodo/sdk-ts](https://github.com/Decodo/sdk-ts). CI does the same thing.
## Development setup

### Prerequisites

- Node.js 18+ (24 recommended)
- [pnpm](https://pnpm.io/) 10.x (`corepack enable` if needed)

### Repo layout

Clone both repos next to each other:

```text
your-workspace/
cli/ # this repo
sdk-ts/ # https://github.com/Decodo/sdk-ts
```

### Install and build

```bash
cd cli
pnpm install
pnpm build
```

`pnpm build` and `pnpm test` build `../sdk-ts` automatically via `prebuild` / `pretest`. If you only change the SDK, rebuild it once:

```bash
pnpm run build:sdk-ts
```

### Run locally

From `cli/`:

```bash
node build/esm/index.js --help
node build/esm/index.js targets
Expand Down
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,21 @@
"build"
],
"scripts": {
"build": "pnpm run build:esm && pnpm run build:cjs",
"build": "tsc -p tsconfig.build.json",
"build:esm": "tsc -p tsconfig.build.json",
"build:cjs": "tsc -p tsconfig.build.cjs.json && node scripts/rename-cjs.mjs",
"typecheck": "tsc --noEmit",
"lint": "ultracite check",
"fix": "ultracite fix",
"test": "vitest run",
"test:watch": "vitest",
"build:sdk-ts": "pnpm --dir ../sdk-ts run build:esm && pnpm --dir ../sdk-ts run build:cjs",
"prebuild": "pnpm run build:sdk-ts",
"pretest": "pnpm run build:sdk-ts && pnpm build"
"pretest": "pnpm build"
},
"engines": {
"node": ">=18.0.0"
},
"packageManager": "pnpm@10.33.3",
"dependencies": {
"@decodo/sdk-ts": "file:../sdk-ts",
"@decodo/sdk-ts": "^2.1.1",
"commander": "^14.0.0",
"env-paths": "^3.0.0"
},
Expand Down
92 changes: 5 additions & 87 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 0 additions & 30 deletions scripts/rename-cjs.mjs

This file was deleted.

Loading
Loading