From d4ceaf733cefdedc63698d94672453c6edd0980c Mon Sep 17 00:00:00 2001 From: Dave Lucia Date: Sun, 5 Feb 2023 13:52:08 -0500 Subject: [PATCH] Add CI --- .eslintrc | 2 +- .github/workflows/ci.yml | 37 ++++++++++++++++++++++++++++++++++ package.json | 43 +++++++++++++++++++++++----------------- 3 files changed, 63 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.eslintrc b/.eslintrc index 59b97f6..111ce4d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -11,4 +11,4 @@ "plugin:react-hooks/recommended", "plugin:prettier/recommended" ] -} \ No newline at end of file +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..69c64a3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CI +on: + push: + branches: + - main + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + - run: yarn install + - run: npm run lint + + typecheck: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + - run: yarn install + - run: npm run typecheck + + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + - run: yarn install + - run: npm run format:check diff --git a/package.json b/package.json index 01388d9..23875b1 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,16 @@ "name": "sanity-plugin-portable-table", "version": "1.0.0", "description": "A table plugin for Sanity that supports PortableText cells", - "author": "Dave Lucia ", + "homepage": "https://github.com/bitfo/sanity-portable-table#readme", + "bugs": { + "url": "https://github.com/bitfo/sanity-portable-table/issues" + }, + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/bitfo/sanity-portable-table.git" + }, "license": "Apache-2.0", - "source": "./src/index.ts", + "author": "Dave Lucia ", "exports": { ".": { "types": "./lib/src/index.d.ts", @@ -17,24 +24,25 @@ }, "main": "./lib/index.js", "module": "./lib/index.esm.js", + "source": "./src/index.ts", "types": "./lib/src/index.d.ts", - "files": ["src", "lib", "v2-incompatible.js", "sanity.json"], - "engines": { - "node": ">=14" - }, + "files": [ + "src", + "lib", + "v2-incompatible.js", + "sanity.json" + ], "scripts": { - "clean": "rimraf lib", - "lint": "eslint .", "prebuild": "npm run clean && plugin-kit verify-package --silent && pkg-utils", "build": "pkg-utils build", - "watch": "pkg-utils watch", + "clean": "rimraf lib", + "format": "prettier -w .", + "format:check": "prettier -c .", "link-watch": "plugin-kit link-watch", + "lint": "eslint .", "prepublishOnly": "npm run build", - "typecheck": "tsc --pretty --noEmit" - }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/bitfo/sanity-portable-table.git" + "typecheck": "tsc --pretty --noEmit", + "watch": "pkg-utils watch" }, "dependencies": { "@portabletext/toolkit": "^2.0.1", @@ -64,8 +72,7 @@ "react": "^18", "sanity": "dev-preview || 3.0.0-rc.2" }, - "bugs": { - "url": "https://github.com/bitfo/sanity-portable-table/issues" - }, - "homepage": "https://github.com/bitfo/sanity-portable-table#readme" + "engines": { + "node": ">=14" + } }