feat(prompt): enable auto-resize for function-based choices #2070
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: Release kit.zip | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - beta | |
| - alpha | |
| - next | |
| tags: | |
| - "*" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Inject slug/short variables | |
| uses: rlespinasse/github-slug-action@v4 | |
| - name: Set env vars | |
| shell: bash | |
| run: | | |
| echo "wd_path=$PWD" >> $GITHUB_ENV | |
| echo "kit_path=$PWD/.kit" >> $GITHUB_ENV | |
| echo "KIT=$PWD/.kit" >> $GITHUB_ENV | |
| echo "release_channel=${{ env.GITHUB_REF_SLUG_URL }}" >> $GITHUB_ENV | |
| - name: Checkout kit | |
| uses: actions/checkout@master | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.17.1 | |
| cache: "pnpm" | |
| - name: Check node $PATH version | |
| shell: bash | |
| run: | | |
| node --version | |
| pnpm --version | |
| - name: pnpm i | |
| shell: bash | |
| run: | | |
| cd "${{ env.wd_path }}" | |
| pnpm i | |
| - name: pnpm build-kit | |
| shell: bash | |
| env: | |
| KIT: ${{ env.kit_path }} | |
| run: | | |
| pnpm build-kit | |
| - name: pnpm ava (Windows) | |
| shell: bash | |
| env: | |
| KIT: ${{ env.kit_path }} | |
| run: | | |
| pnpm ava:ci | |
| - name: pnpm test (unit/integration, no benchmark) | |
| shell: bash | |
| env: | |
| KIT: ${{ env.kit_path }} | |
| run: | | |
| pnpm test | |
| test-windows-worker-bench: | |
| runs-on: windows-latest | |
| needs: [test-windows] | |
| steps: | |
| - name: Inject slug/short variables | |
| uses: rlespinasse/github-slug-action@v4 | |
| - name: Set env vars | |
| shell: bash | |
| run: | | |
| echo "wd_path=$PWD" >> $GITHUB_ENV | |
| echo "kit_path=$PWD/.kit" >> $GITHUB_ENV | |
| echo "KIT=$PWD/.kit" >> $GITHUB_ENV | |
| - name: Checkout kit | |
| uses: actions/checkout@master | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.17.1 | |
| cache: "pnpm" | |
| - name: pnpm i | |
| shell: bash | |
| run: | | |
| pnpm i | |
| - name: Run worker benchmark (non-gating) | |
| shell: bash | |
| env: | |
| KIT: ${{ env.kit_path }} | |
| KIT_BENCH: 'true' | |
| run: | | |
| # Run only the worker benchmark test | |
| pnpm exec ava --config ./test/ava.config.mjs src/workers/cache-grouped-scripts-worker.test.ts -m "benchmark - worker CACHE_MAIN_SCRIPTS" | |
| test-windows-typescript: | |
| runs-on: windows-latest | |
| needs: [test-windows] | |
| steps: | |
| - name: Inject slug/short variables | |
| uses: rlespinasse/github-slug-action@v4 | |
| - name: Set env vars | |
| shell: bash | |
| run: | | |
| echo "wd_path=$PWD" >> $GITHUB_ENV | |
| echo "kit_path=$PWD/.kit" >> $GITHUB_ENV | |
| echo "KIT=$PWD/.kit" >> $GITHUB_ENV | |
| - name: Checkout kit | |
| uses: actions/checkout@master | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.17.1 | |
| cache: "pnpm" | |
| - name: pnpm i | |
| shell: bash | |
| run: | | |
| pnpm i | |
| - name: pnpm build-kit | |
| shell: bash | |
| env: | |
| KIT: ${{ env.kit_path }} | |
| run: | | |
| pnpm build-kit | |
| - name: Run Windows TypeScript tests (isolated) | |
| shell: bash | |
| env: | |
| KIT: ${{ env.kit_path }} | |
| KIT_WINDOWS_TS: 'true' | |
| run: | | |
| pnpm exec ava --config ./test/ava.config.mjs \ | |
| --match "TypeScript support" \ | |
| --match "TypeScript import from lib" \ | |
| test-sdk/main.test.js \ | |
| || { echo "::warning::Windows TypeScript isolated tests failed"; exit 0; } | |
| test-mac-and-ubuntu: | |
| strategy: | |
| matrix: | |
| os: [macos-latest, ubuntu-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Inject slug/short variables | |
| uses: rlespinasse/github-slug-action@v4 | |
| - name: Set env vars | |
| run: | | |
| echo "wd_path=$PWD" >> $GITHUB_ENV | |
| echo "kit_path=$PWD/.kit" >> $GITHUB_ENV | |
| echo "KIT=$PWD/.kit" >> $GITHUB_ENV | |
| echo "release_channel=${{ env.GITHUB_REF_SLUG_URL }}" >> $GITHUB_ENV | |
| - name: Get Time | |
| id: time | |
| uses: nanzm/[email protected] | |
| with: | |
| timeZone: 8 | |
| format: "YYYY-MM-DD-HH-mm-ss" | |
| - name: Checkout kit | |
| uses: actions/checkout@master | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.17.1 | |
| cache: "pnpm" | |
| - name: Build Kit | |
| run: | | |
| pnpm i | |
| export KIT_NODE_PATH=$(pnpm node -e ) | |
| KIT=./.kit pnpm node ./build/build-ci.js | |
| env: | |
| KIT: ${{ env.kit_path }} | |
| - name: Add node and kit to PATH | |
| run: | | |
| echo "${{ env.kit_path }}/bin" >> $GITHUB_PATH | |
| echo "---" | |
| echo "$GITHUB_PATH" | |
| echo "$PATH" | |
| - name: Check node $PATH version | |
| run: | | |
| node --version | |
| npm --version | |
| - name: Log ./.kit | |
| run: | | |
| ls ./.kit/*/* | |
| - name: pnpm i | |
| run: | | |
| cd "${{ env.wd_path }}" | |
| pnpm i | |
| - name: Verify Types | |
| run: | | |
| mkdir -p ~/dev | |
| cd ~/dev | |
| git clone https://github.com/johnlindquist/kit-examples-ts.git | |
| cd kit-examples-ts | |
| pnpm i ${{ env.kit_path }} | |
| pnpm i typescript | |
| # Create temporary tsconfig for type checking | |
| echo '{ | |
| "compilerOptions": { | |
| "skipLibCheck": true, | |
| "types": ["@johnlindquist/kit"], | |
| "typeRoots": ["./node_modules/@johnlindquist"], | |
| "module": "nodenext", | |
| "target": "esnext", | |
| "moduleResolution": "nodenext", | |
| "esModuleInterop": true | |
| } | |
| }' > tsconfig.temp.json | |
| echo "Running type check on all .ts files..." | |
| # Run tsc and store output | |
| TYPECHECK_OUTPUT=$(find ./scripts -name '*.ts' -exec pnpm exec tsc --project tsconfig.temp.json {} \; 2>&1) | |
| if [ $? -ne 0 ]; then | |
| echo "❌ Type checking failed:" | |
| echo "$TYPECHECK_OUTPUT" | |
| exit 1 | |
| else | |
| echo "✅ Type checking passed for all files" | |
| echo "Files checked:" | |
| find ./scripts -name '*.ts' | wc -l | |
| fi | |
| - name: pnpm ava | |
| run: | | |
| pnpm ava:ci | |
| - name: pnpm test | |
| uses: nick-invision/retry@v3 | |
| with: | |
| max_attempts: 1 | |
| timeout_minutes: 30 | |
| command: | | |
| pnpm test | |
| env: | |
| KIT: ${{ env.kit_path }} | |
| release: | |
| runs-on: macos-latest | |
| needs: [test-windows, test-mac-and-ubuntu] | |
| steps: | |
| - name: Inject slug/short variables | |
| uses: rlespinasse/github-slug-action@v4 | |
| - name: Set env vars | |
| run: | | |
| echo "wd_path=$PWD" >> $GITHUB_ENV | |
| echo "kit_path=$PWD/.kit" >> $GITHUB_ENV | |
| echo "KIT=$PWD/.kit" >> $GITHUB_ENV | |
| echo "release_channel=${{ env.GITHUB_REF_SLUG_URL }}" >> $GITHUB_ENV | |
| - name: Get Time | |
| id: time | |
| uses: nanzm/[email protected] | |
| with: | |
| timeZone: 8 | |
| format: "YYYY-MM-DD-HH-mm-ss" | |
| - name: Checkout kit | |
| uses: actions/checkout@master | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22.17.1 | |
| cache: "pnpm" | |
| - name: Build Kit | |
| run: | | |
| pnpm install | |
| KIT=./.kit pnpm node ./build/build-ci.js | |
| - name: Add node and kit to PATH | |
| run: | | |
| echo "${{ env.kit_path }}/bin" >> $GITHUB_PATH | |
| echo "---" | |
| echo "$GITHUB_PATH" | |
| echo "$PATH" | |
| - name: Check node $PATH version | |
| run: | | |
| node --version | |
| pnpm --version | |
| - name: Semantic Release | |
| run: | | |
| cd "${{ env.wd_path }}" | |
| npx semantic-release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Archive Release | |
| uses: thedoctor0/zip-release@master | |
| with: | |
| filename: "kit.zip" | |
| path: ".kit" | |
| - name: Create Draft Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ steps.time.outputs.time }} | |
| name: ${{ env.release_channel }} | |
| draft: true | |
| prerelease: false | |
| - name: Create and Upload Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ./kit.zip | |
| tag_name: ${{ steps.time.outputs.time }} | |
| name: ${{ env.release_channel }} | |
| draft: true | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: eregon/publish-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| release_id: ${{ steps.create_release.outputs.id }} |