From b1d8e4d04178c3a2c231b5b3d9c2fc42e64f440a Mon Sep 17 00:00:00 2001 From: Drew Volz Date: Mon, 27 May 2024 00:09:14 -0700 Subject: [PATCH] script renames and formatting changes (#751) * rename start:watch and build:watch scripts * rename test:stolaf-college and test:carleton-college scripts * add scripts to the prettier config and format watch.js * formatting changes to node.js.yml --- .github/workflows/node.js.yml | 50 +++++++++++++++++------------------ package.json | 10 +++---- scripts/watch.js | 10 +++---- 3 files changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index dad44bcb..9f9c97f8 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -5,9 +5,9 @@ name: Node.js CI on: push: - branches: [ "master" ] + branches: ['master'] pull_request: - branches: [ "master" ] + branches: ['master'] jobs: build: @@ -15,7 +15,7 @@ jobs: strategy: matrix: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - node-version: [ 22.x ] + node-version: [22.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} @@ -33,22 +33,22 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ node-version: [22.x] steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm ci - - run: npm run build - - run: npm test + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run build + - run: npm test smoke-test-stolaf: runs-on: ubuntu-latest strategy: matrix: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - node-version: [ 22.x ] + node-version: [22.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} @@ -58,14 +58,14 @@ jobs: cache: 'npm' - run: npm ci - run: npm run build - - run: npm run test-stolaf-college + - run: npm run test:stolaf-college smoke-test-carleton: runs-on: ubuntu-latest strategy: matrix: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - node-version: [ 22.x ] + node-version: [22.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} @@ -75,7 +75,7 @@ jobs: cache: 'npm' - run: npm ci - run: npm run build - - run: npm run test-carleton-college + - run: npm run test:carleton-college lint: runs-on: ubuntu-latest @@ -84,21 +84,21 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ node-version: [22.x] steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node-version }} - cache: 'npm' - - run: npm ci - - run: npm run lint + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - run: npm ci + - run: npm run lint format: runs-on: ubuntu-latest strategy: matrix: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - node-version: [ 22.x ] + node-version: [22.x] steps: - uses: actions/checkout@v4 - name: Use Node.js ${{ matrix.node-version }} diff --git a/package.json b/package.json index 95e9372c..b95a2b8f 100644 --- a/package.json +++ b/package.json @@ -23,16 +23,16 @@ }, "scripts": { "build": "rm -rf ./dist ./.tsbuildinfo && tsc", - "build-watch": "tsc --watch", + "build:watch": "tsc --watch", "p": "npm run pretty -- --no-write --check", - "pretty": "prettier --write source", + "pretty": "prettier --write source scripts", "lint": "eslint --cache --max-warnings=0 .", "start": "node dist/source/ccc-server/index.js", - "start-watch": "node --watch dist/source/ccc-server/index.js", + "start:watch": "node --watch dist/source/ccc-server/index.js", "stolaf-college": "env INSTITUTION=stolaf-college npm start", "carleton-college": "env INSTITUTION=carleton-college npm start", - "test-stolaf-college": "./scripts/smoke-test.sh stolaf-college", - "test-carleton-college": "./scripts/smoke-test.sh carleton-college", + "test:stolaf-college": "./scripts/smoke-test.sh stolaf-college", + "test:carleton-college": "./scripts/smoke-test.sh carleton-college", "test": "ava", "watch": "node ./scripts/watch.js" }, diff --git a/scripts/watch.js b/scripts/watch.js index 1189dee7..c1770443 100644 --- a/scripts/watch.js +++ b/scripts/watch.js @@ -1,12 +1,12 @@ import {spawn} from 'child_process' -const buildWatch = spawn('npm', ['run', 'build-watch'], {stdio: 'inherit'}) -const startWatch = spawn('npm', ['run', 'start-watch'], {stdio: 'inherit'}) +const buildWatch = spawn('npm', ['run', 'build:watch'], {stdio: 'inherit'}) +const startWatch = spawn('npm', ['run', 'start:watch'], {stdio: 'inherit'}) const shutdown = () => { - buildWatch.kill() - startWatch.kill() - process.exit() + buildWatch.kill() + startWatch.kill() + process.exit() } process.on('SIGINT', shutdown)