Clarify CLI setup choices and bump patch (#909) #118
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: CLI Template Package Manager Parity | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - ".github/workflows/cli-template-package-managers.yml" | |
| - "packages/openui-cli/scripts/compare-template-installs.mjs" | |
| - "packages/openui-cli/src/commands/create-app.ts" | |
| - "packages/openui-cli/src/lib/detect-package-manager.ts" | |
| - "packages/openui-cli/src/templates/**" | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - ".github/workflows/cli-template-package-managers.yml" | |
| - "packages/openui-cli/scripts/compare-template-installs.mjs" | |
| - "packages/openui-cli/src/commands/create-app.ts" | |
| - "packages/openui-cli/src/lib/detect-package-manager.ts" | |
| - "packages/openui-cli/src/templates/**" | |
| permissions: | |
| contents: read | |
| jobs: | |
| package-manager-parity: | |
| name: ${{ matrix.template }} (npm + pnpm) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| template: | |
| - openui-cloud | |
| - openui-self-hosted | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: pnpm/action-setup@v6 | |
| with: | |
| version: 10.33.0 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20 | |
| - name: Prepare isolated template copies | |
| shell: bash | |
| run: | | |
| node --input-type=module -e " | |
| import fs from 'node:fs'; | |
| import path from 'node:path'; | |
| const source = path.resolve('packages/openui-cli/src/templates/${{ matrix.template }}'); | |
| const npmTarget = path.join(process.env.RUNNER_TEMP, 'npm-template'); | |
| const pnpmTarget = path.join(process.env.RUNNER_TEMP, 'pnpm-template'); | |
| fs.cpSync(source, npmTarget, { recursive: true }); | |
| fs.cpSync(source, pnpmTarget, { recursive: true }); | |
| fs.rmSync(path.join(pnpmTarget, 'package-lock.json')); | |
| " | |
| - name: Install with npm | |
| working-directory: ${{ runner.temp }}/npm-template | |
| run: npm ci --prefer-offline --no-audit --no-fund --progress=false | |
| - name: Install with pnpm | |
| working-directory: ${{ runner.temp }}/pnpm-template | |
| run: pnpm install | |
| - name: Compare resolved direct dependencies | |
| run: >- | |
| node packages/openui-cli/scripts/compare-template-installs.mjs | |
| "${{ runner.temp }}/npm-template" | |
| "${{ runner.temp }}/pnpm-template" |