Update README.md #10
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: CI | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| branches: [ main, develop ] | |
| jobs: | |
| lint-and-build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [18, 20] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Lint code | |
| run: npm run lint | |
| continue-on-error: true | |
| - name: Build package | |
| run: npm run build | |
| - name: Check package contents | |
| run: | | |
| echo "Checking built files..." | |
| ls -la dist/ | |
| echo "Checking generators..." | |
| ls -la dist/generators/init/ | |
| echo "Checking template files..." | |
| find src/generators/init/files-* -name "*.template*" -type f | |
| - name: Validate package.json | |
| run: | | |
| echo "Validating package.json structure..." | |
| node -e " | |
| const pkg = require('./package.json'); | |
| const required = ['name', 'version', 'main', 'generators']; | |
| const missing = required.filter(field => !pkg[field]); | |
| if (missing.length > 0) { | |
| console.error('Missing required fields:', missing); | |
| process.exit(1); | |
| } | |
| console.log('✅ package.json validation passed'); | |
| " | |
| - name: Check generators.json | |
| run: | | |
| echo "Validating generators.json..." | |
| node -e " | |
| const generators = require('./generators.json'); | |
| if (!generators.generators || !generators.generators.init) { | |
| console.error('❌ generators.json is missing init generator'); | |
| process.exit(1); | |
| } | |
| console.log('✅ generators.json validation passed'); | |
| " |