From 5601412aa1023a5279dc5504d1c6ad739a0adad1 Mon Sep 17 00:00:00 2001 From: Corbin Crutchley Date: Mon, 16 Dec 2024 15:26:02 -0800 Subject: [PATCH 1/5] chore: add CI for main and PRs --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/pr.yml | 27 +++++++++++++++++++++++++++ README.md | 15 +++++++++++---- logo.png => media/logo.png | Bin 4 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/pr.yml rename logo.png => media/logo.png (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..097b523 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: ci + +on: + push: + branches: [v4, alpha, beta] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: write + id-token: write + +jobs: + test-and-publish: + name: Test + if: github.repository == 'Vibrant-Colors/node-vibrant' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Tools + uses: tanstack/config/.github/setup@main + - name: Run Tests + run: pnpm run test diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..3828996 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,27 @@ +name: pr + +on: + pull_request: + paths-ignore: + - 'media/**' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Setup Tools + uses: tanstack/config/.github/setup@main + - name: Run Checks + run: pnpm run test diff --git a/README.md b/README.md index b10e777..6cfb6a4 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,16 @@ # node-vibrant - - -[![Slack badge](https://badgen.net/badge/slack/node-vibrant?icon=slack)](https://join.slack.com/t/node-vibrant/shared_invite/enQtNTI2Mzg2NDk5MzUxLTdkN2EwMWNkYjY0MjNiMmI2YzFjZWM3Njc3ZDJmOWVkMzBkNzYzMDBhZTBiMGI0MjAyMmJhNDc0YTNlNjA5ZGY) -[![Build Status](https://badgen.net/travis/akfish/node-vibrant/develop?label=build)](https://travis-ci.org/akfish/node-vibrant) + + + + + + Join the discussion on Github +Best of JS + + + + Extract prominent colors from an image. diff --git a/logo.png b/media/logo.png similarity index 100% rename from logo.png rename to media/logo.png From 21c20f16c16d5b3a71770bced3a0ae3a4d938f90 Mon Sep 17 00:00:00 2001 From: Corbin Crutchley Date: Mon, 16 Dec 2024 15:28:28 -0800 Subject: [PATCH 2/5] chore: add Node version --- .nvmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..d4b7699 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20.18.1 From 123cb2688f99b4d7e8ca116e007826a4f78a85ef Mon Sep 17 00:00:00 2001 From: Corbin Crutchley Date: Mon, 16 Dec 2024 15:38:03 -0800 Subject: [PATCH 3/5] chore: add Nx configuration --- nx.json | 15 +++++++++++++++ package.json | 6 +----- 2 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 nx.json diff --git a/nx.json b/nx.json new file mode 100644 index 0000000..fce8544 --- /dev/null +++ b/nx.json @@ -0,0 +1,15 @@ +{ + "$schema": "./node_modules/nx/schemas/nx-schema.json", + "defaultBase": "v4", + "targetDefaults": { + "test:lib": { + "cache": true, + "dependsOn": ["^build"] + }, + "build": { + "cache": true, + "dependsOn": ["^build"], + "outputs": ["{projectRoot}/dist"] + } + } +} diff --git a/package.json b/package.json index b20c26d..9ad74b2 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,6 @@ "private": true, "packageManager": "pnpm@9.14.4", "scripts": { - "clean": "run-p -c clean:*", - "clean:tsc": "lerna exec -- rimraf dist", "compile:tsc": "tsc", "build": "lerna run build", "lint": "run-p -c lint:*", @@ -14,11 +12,9 @@ "format:packages": "eslint ./packages --fix", "format:fixtures": "eslint ./fixtures --fix", "test": "run-p -c test:*", - "test:sherif": "sherif -i react -i react-dom", + "test:sherif": "sherif", "test:lib": "lerna run test", "test:knip": "knip", - "sample:inspect": "pnpm --dir=fixtures/sample run start", - "sample:update": "pnpm --dir=fixtures/sample run update", "prepare": "husky install && playwright install chromium" }, "devDependencies": { From 2df69353a419ad6b69ee97d920edc89ab5582efd Mon Sep 17 00:00:00 2001 From: Corbin Crutchley Date: Mon, 16 Dec 2024 15:39:10 -0800 Subject: [PATCH 4/5] chore: add nx to gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 2522a95..7971bfc 100644 --- a/.gitignore +++ b/.gitignore @@ -88,3 +88,6 @@ dist/ .vscode/ .build + +.nx/cache +.nx/workspace-data From da518fbc2df3b5e5086ac467c65abfa167bf61a0 Mon Sep 17 00:00:00 2001 From: Corbin Crutchley Date: Mon, 16 Dec 2024 15:41:09 -0800 Subject: [PATCH 5/5] chore: add test:lib prefix --- package.json | 2 +- packages/node-vibrant/package.json | 2 +- packages/vibrant-core/package.json | 4 ++-- packages/vibrant-image-browser/package.json | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 9ad74b2..5b91d2b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "format:fixtures": "eslint ./fixtures --fix", "test": "run-p -c test:*", "test:sherif": "sherif", - "test:lib": "lerna run test", + "test:lib": "lerna run test:lib", "test:knip": "knip", "prepare": "husky install && playwright install chromium" }, diff --git a/packages/node-vibrant/package.json b/packages/node-vibrant/package.json index 999ba5e..528ab3c 100644 --- a/packages/node-vibrant/package.json +++ b/packages/node-vibrant/package.json @@ -76,7 +76,7 @@ }, "scripts": { "build": "vite build", - "test": "vitest run", + "test:lib": "vitest run", "test:watch": "vitest watch" }, "bugs": { diff --git a/packages/vibrant-core/package.json b/packages/vibrant-core/package.json index 875cb54..3167e48 100644 --- a/packages/vibrant-core/package.json +++ b/packages/vibrant-core/package.json @@ -3,8 +3,8 @@ "version": "4.0.0-alpha.2", "description": "Core vibrant classes", "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", + "test:lib": "vitest run", + "test:lib:watch": "vitest watch", "build": "vite build" }, "type": "module", diff --git a/packages/vibrant-image-browser/package.json b/packages/vibrant-image-browser/package.json index 211e655..1519a13 100644 --- a/packages/vibrant-image-browser/package.json +++ b/packages/vibrant-image-browser/package.json @@ -4,8 +4,8 @@ "description": "Browser vibrant ImageClass implementation", "scripts": { "build": "vite build", - "test": "vitest run", - "test:watch": "vitest watch" + "test:lib": "vitest run", + "test:lib:watch": "vitest watch" }, "type": "module", "types": "dist/esm/index.d.ts",