Skip to content

Commit

Permalink
chore: gh build actions (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
azuradara authored Jan 7, 2025
1 parent 308eec2 commit 782216c
Show file tree
Hide file tree
Showing 5 changed files with 96 additions and 3 deletions.
87 changes: 87 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: Build

on:
push:
branches:
- main
paths:
- 'packages/**'

pull_request:
paths:
- 'packages/**'

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm i --frozen-lockfile

- name: Lint
run: pnpm lint

build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 9
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm i --frozen-lockfile

- name: Build
run: pnpm build
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"type": "module",
"private": true,
"packageManager": "pnpm@9.15.2",
"engines": {
"node": ">=20.10.0"
},
"scripts": {
"build": "pnpm -r build",
"lint": "eslint --fix packages/**/*.{ts,js,json}",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-kit/lib/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function setupColorMode(): void {
}
}

function errorHandler(error: Error): never {
function handleError(error: Error): never {
let suggestions: string[] = [];
const message: string = error.message;

Expand All @@ -55,10 +55,10 @@ export async function exec(options: ExecOptions): Promise<void> {

run(undefined, options.moduleUrl)
.then(() => flush())
.catch(errorHandler);
.catch(handleError);
}

process.on('uncaughtException', errorHandler);
process.on('uncaughtException', handleError);

export async function execCreate(cmdlet: string, options: ExecOptions): Promise<void> {
setupEnvVars(options);
Expand Down
1 change: 1 addition & 0 deletions packages/cli/bin/exec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
import process from 'node:process';

process.removeAllListeners('warning');

Expand Down
1 change: 1 addition & 0 deletions packages/create-app/bin/exec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env node
import process from 'node:process';

process.removeAllListeners('warning');

Expand Down

0 comments on commit 782216c

Please sign in to comment.