Skip to content

Commit 21ad18a

Browse files
aliasghar98saeedjamshaidAyeshas09claude
authored
fix: resolve sdk publishing for ruby and python (#279)
What was changed? Add a fix for urls parsing in package configurations for Ruby and Python. Replace npm with pnpm as the package manager. Update the minimum supported Node.js version to v22. --------- Co-authored-by: saeedjamshaid <saeed.jamshaid@outlook.com> Co-authored-by: Ayesha <88117894+Ayeshas09@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
1 parent c9c8e84 commit 21ad18a

14 files changed

Lines changed: 10446 additions & 19123 deletions

.ai/instructions.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,31 @@ APIMatic CLI (`@apimatic/cli`) — the official CLI for APIMatic, built on oclif
1010

1111
```bash
1212
# Build
13-
npm run build # tsc -b → outputs to lib/
13+
pnpm build # tsc -b → outputs to lib/
1414

1515
# Lint
16-
npm run lint # ESLint on src/**/*.{js,ts}
17-
npm run lint:fix # ESLint with --fix --quiet
16+
pnpm lint # ESLint on src/**/*.{js,ts}
17+
pnpm lint:fix # ESLint with --fix --quiet
1818

1919
# Format
20-
npm run format # Prettier write on src/**/*.{js,ts}
20+
pnpm format # Prettier write on src/**/*.{js,ts}
2121

2222
# Test (all)
23-
npm test # tsx + mocha, runs test/**/*.test.ts
23+
pnpm test # tsx + mocha, runs test/**/*.test.ts
2424

2525
# Test (single file)
26-
npx tsx node_modules/mocha/bin/_mocha "test/actions/portal/serve.test.ts" --timeout 99999
26+
pnpm exec tsx node_modules/mocha/bin/_mocha "test/actions/portal/serve.test.ts" --timeout 99999
2727

2828
# Run CLI locally
2929
node bin/run.js <command>
3030
```
3131

32+
## Adding / upgrading dependencies
33+
34+
`pnpm-workspace.yaml` sets `minimumReleaseAge: 10080` (7 days) as a supply-chain defense. Brand-new package versions are blocked from install until they've been on the registry for at least a week. `@apimatic/*` is exempt via `minimumReleaseAgeExclude`.
35+
36+
If you hit `ERR_PNPM_PACKAGE_RECENTLY_PUBLISHED` adding a fresh release, either wait it out or run a one-off install with `pnpm install --ignore-minimum-release-age` (CI uses `--frozen-lockfile`, which bypasses the check entirely, so this only blocks manual `pnpm add` / `pnpm update`).
37+
3238
## Architecture — 5-Layer Stack
3339

3440
```

.github/workflows/check_build.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Run and check build for current commit
66
on:
77
# Triggers the workflow on pull request events but only for the alpha and dev branches
88
pull_request:
9-
branches: [ alpha, dev ]
9+
branches: [ alpha, dev, beta ]
1010
# Allows you to run this workflow manually from the Actions tab
1111
workflow_dispatch:
1212

@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
node: [ '18', '20', '22', '24' ]
19+
node: [ '22', '24' ]
2020
name: Node ${{ matrix.node }} sample
2121
steps:
2222
- name: checkout cli
@@ -29,12 +29,24 @@ jobs:
2929
path: cli
3030

3131
- name: setup node
32-
uses: actions/setup-node@v2
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: ${{ matrix.node }}
35+
36+
- name: enable corepack
37+
run: corepack enable
38+
39+
- name: configure pnpm cache
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: ${{ matrix.node }}
43+
cache: 'pnpm'
44+
cache-dependency-path: cli/pnpm-lock.yaml
3345

3446
- name: Install dependencies
3547
working-directory: cli
36-
run: npm install
48+
run: pnpm install --frozen-lockfile
3749

3850
- name: Check Build
3951
working-directory: 'cli'
40-
run: npm run build
52+
run: pnpm build

.github/workflows/release.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
node: [ '20' ]
12+
node: [ '22' ]
1313
name: Release with Node version ${{ matrix.node }}
1414
steps:
1515
- name: Checkout CLI
@@ -26,16 +26,27 @@ jobs:
2626
with:
2727
node-version: ${{ matrix.node }}
2828

29+
- name: enable corepack
30+
run: corepack enable
31+
32+
- name: configure pnpm cache
33+
uses: actions/setup-node@v4
34+
with:
35+
node-version: ${{ matrix.node }}
36+
cache: 'pnpm'
37+
cache-dependency-path: cli/pnpm-lock.yaml
38+
2939
- name: Install dependencies
3040
working-directory: cli
31-
run: npm install
41+
run: pnpm install --frozen-lockfile
42+
3243
- name: Check Build
3344
working-directory: 'cli'
34-
run: npm run build
45+
run: pnpm build
3546

3647
- name: Release
3748
working-directory: cli
3849
env:
3950
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4051
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41-
run: npm exec semantic-release
52+
run: pnpm exec semantic-release

.husky/commit-msg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx --no-install commitlint --edit $1
4+
pnpm exec commitlint --edit $1

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx lint-staged
4+
pnpm exec lint-staged

.npmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
@apimatic:registry=https://registry.npmjs.org/
1+
@apimatic:registry=https://registry.npmjs.org/

0 commit comments

Comments
 (0)