fork of hey-api/openapi-ts because I need some additional things
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #1691 from hey-api/fix/publish-packages-turbo

refactor: use Turbo to detect changed packages

authored by

Lubos and committed by
GitHub
1df55ede bb504c51

+13 -31
+3 -1
.github/workflows/ci.yml
··· 55 55 56 56 - name: Publish preview packages 57 57 if: github.event_name == 'pull_request' && matrix.node-version == '22.11.0' && matrix.os == 'ubuntu-latest' 58 - run: ./scripts/publish-preview-packages.sh ${{ github.event.pull_request.base.ref }} 58 + run: ./scripts/publish-preview-packages.sh 59 + env: 60 + TURBO_SCM_BASE: ${{ github.event_name == 'pull_request' && github.event.pull_request.base.sha || github.event.before }}
+1 -1
.github/workflows/release.yml
··· 35 35 run: pnpm build 36 36 37 37 - name: Create Release Pull Request 38 - uses: changesets/action@v1 38 + uses: changesets/action@v1.4.9 39 39 with: 40 40 publish: pnpm changeset publish 41 41 version: pnpm changeset version
+1 -1
docs/CHANGELOG.md
··· 1 - # @hey-api/docs 1 + # @docs/openapi-ts 2 2 3 3 ## 0.10.0 4 4
+1 -1
docs/index.md
··· 3 3 4 4 hero: 5 5 name: High-quality tools for interacting with APIs 6 - tagline: Codegen for your TypeScript projects. Trusted more than 700k times each month to generate reliable API clients and SDKs. 6 + tagline: Codegen for your TypeScript projects. Trusted more than 800k times each month to generate reliable API clients and SDKs. 7 7 actions: 8 8 - link: /openapi-ts/get-started 9 9 text: Get Started
+1 -1
docs/openapi-ts/get-started.md
··· 13 13 This package is in initial development. The interface might change before it becomes stable. We encourage you to leave feedback on [GitHub](https://github.com/hey-api/openapi-ts/issues). 14 14 ::: 15 15 16 - [@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts) is an OpenAPI to TypeScript codegen trusted more than 700k times each month to generate reliable API clients and SDKs. The code is [MIT-licensed](/license) and free to use. Discover available features below or view our [roadmap](https://github.com/orgs/hey-api/discussions/1495) to learn what's coming next. 16 + [@hey-api/openapi-ts](https://github.com/hey-api/openapi-ts) is an OpenAPI to TypeScript codegen trusted more than 800k times each month to generate reliable API clients and SDKs. The code is [MIT-licensed](/license) and free to use. Discover available features below or view our [roadmap](https://github.com/orgs/hey-api/discussions/1495) to learn what's coming next. 17 17 18 18 <button class="buttonLink" @click="(event) => embedProject('hey-api-example')(event)"> 19 19 Live demo
+1 -1
docs/package.json
··· 1 1 { 2 - "name": "@hey-api/docs", 2 + "name": "@docs/openapi-ts", 3 3 "version": "0.10.0", 4 4 "description": "Documentation for OpenaAPI TypeScript.", 5 5 "private": true,
+1 -1
package.json
··· 34 34 "test:update": "turbo run test:update", 35 35 "test": "turbo run test", 36 36 "typecheck": "turbo run typecheck --filter=\"!@example/openapi-ts-sample\"", 37 - "vitepress": "turbo run $1 --filter=\"@hey-api/docs\"" 37 + "vitepress": "turbo run $1 --filter=\"@docs/openapi-ts\"" 38 38 }, 39 39 "engines": { 40 40 "node": "^18.18.0 || ^20.9.0 || >=22.11.0"
+4 -24
scripts/publish-preview-packages.sh
··· 1 1 #!/bin/bash 2 2 3 - if [ -z "$1" ]; then 4 - echo "Error: Base branch not specified. Usage: publish-previews.sh <base-branch>" 5 - exit 1 6 - fi 7 - 8 - BASE_BRANCH=$1 9 - 10 - # ensure we have the latest changes from the remote 11 - git fetch origin 12 - 13 - if ! git show-ref --verify --quiet refs/remotes/origin/"$BASE_BRANCH"; then 14 - echo "Error: Base branch '$BASE_BRANCH' not found in the remote repository." 15 - exit 1 16 - fi 3 + result=$(pnpx turbo run build --affected --dry-run=json) 17 4 18 - echo "Detecting changed packages compared to $BASE_BRANCH..." 19 - CHANGED_PACKAGES=$(git diff --name-only origin/"$BASE_BRANCH"...HEAD | grep '^packages/' | cut -d '/' -f 2 | sort -u) 5 + packages=$(echo "$result" | jq -r '.tasks[].directory' | grep '^packages/' | sed 's|^|./|') 20 6 21 - if [ -z "$CHANGED_PACKAGES" ]; then 22 - echo "No changed packages detected." 23 - exit 0 7 + if [ -n "$packages" ]; then 8 + pnpx pkg-pr-new publish --pnpm $packages 24 9 fi 25 - 26 - PACKAGE_PATHS=$(echo "$CHANGED_PACKAGES" | awk '{printf "./packages/%s ", $1}' | sed 's/ $//') 27 - 28 - echo "Publishing changed packages: $PACKAGE_PATHS" 29 - pnpx pkg-pr-new publish --pnpm $PACKAGE_PATHS