Skip to content

Commit

Permalink
chore: switch to pnpm (#240)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocavue authored Aug 22, 2024
1 parent e2f0a97 commit 0e3b5ef
Show file tree
Hide file tree
Showing 9 changed files with 3,123 additions and 2,021 deletions.
31 changes: 31 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Setup
description: Shared setup for all actions

inputs:
node-version:
description: The version of node.js
required: false
default: '18'

runs:
using: composite
steps:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
run-install: false

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: pnpm
registry-url: 'https://npm.pkg.github.com'

- name: Install dependencies
run: pnpm install
shell: bash

- name: Build
run: pnpm build
shell: bash
29 changes: 7 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,28 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'
- uses: actions/checkout@v4

- name: Install
run: yarn install --frozen-lockfile
- uses: ./.github/actions/setup

- name: Test
run: yarn test
run: pnpm run test

- name: Typecheck
run: yarn typecheck
run: pnpm run typecheck

- name: Lint
run: yarn lint

- name: Build
run: yarn build
run: pnpm run lint

demo:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16
cache: 'yarn'

- name: Install
run: yarn install --frozen-lockfile
- uses: ./.github/actions/setup

- name: Build
run: yarn build_demo
run: pnpm run build_demo

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.2
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ README.md

node_modules/
dist/
pnpm-lock.yaml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ invariants on such tables, and a number of commands to work with
tables.

The top-level directory contains a `demo.js` and `index.html`, which
can be built with `yarn build_demo` to show a simple demo of how the
can be built with `pnpm run build_demo` to show a simple demo of how the
module can be used.

## [Live Demo](https://prosemirror-tables.netlify.app/)
Expand Down
1 change: 0 additions & 1 deletion demo/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ let state = EditorState.create({
].concat(
exampleSetup({
schema,
// @ts-expect-error: prosemirror-example-setup exports wrong types here.
menuContent: menu,
}),
),
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "prosemirror-tables",
"version": "1.4.0",
"packageManager": "pnpm@9.7.0",
"description": "ProseMirror's rowspan/colspan tables component",
"type": "module",
"main": "dist/index.cjs",
Expand Down Expand Up @@ -44,20 +45,21 @@
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"builddocs": "^1.0.7",
"eslint": "^8.42.0",
"eslint": "^8.57.0",
"eslint-plugin-jest": "^26.9.0",
"happy-dom": "^11.0.2",
"ist": "^1.1.7",
"prettier": "^2.8.8",
"prosemirror-commands": "^1.5.2",
"prosemirror-example-setup": "^1.2.2",
"prosemirror-gapcursor": "^1.3.2",
"prosemirror-menu": "^1.2.2",
"prosemirror-schema-basic": "^1.2.2",
"prosemirror-test-builder": "^1.1.1",
"tsup": "^7.2.0",
"typescript": "^4.9.5",
"vite": "^4.4.9",
"vitest": "^0.34.4"
"vite": "^5.4.2",
"vitest": "^2.0.5"
},
"scripts": {
"dev": "vite demo",
Expand All @@ -68,6 +70,7 @@
"watch": "tsup --watch",
"build_readme": "builddocs --name tables --format markdown --main src/README.md src/*.js > README.md",
"format": "prettier --write .",
"lint": "eslint ./src/ ./test/ && prettier --check ."
"lint": "eslint ./src/ ./test/ && prettier --check .",
"fix": "eslint --fix ./src/ ./test/ && prettier --write ."
}
}
Loading

0 comments on commit 0e3b5ef

Please sign in to comment.