Skip to content

Commit

Permalink
use pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
yiminghe committed Nov 22, 2023
1 parent 939143a commit 961375d
Show file tree
Hide file tree
Showing 20 changed files with 11,863 additions and 16,596 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Node.js CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

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

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
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 install --frozen-lockfile
- run: pnpm check
- run: pnpm test
13 changes: 0 additions & 13 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@

# dependencies
/node_modules
/.yarn/*
!/.yarn/patches
!/.yarn/plugins
!/.yarn/releases
!/.yarn/versions
!/.yarn/sdks

# Swap the comments on the following lines if you don't wish to use zero-installs
# Documentation here: https://yarnpkg.com/features/zero-installs
#!/.yarn/cache
/.pnp.*


# testing
Expand All @@ -30,8 +19,6 @@ build
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

tmp/
pkg/
Expand Down
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

550 changes: 0 additions & 550 deletions .yarn/plugins/@yarnpkg/plugin-version.cjs

This file was deleted.

7 changes: 0 additions & 7 deletions .yarnrc.yml

This file was deleted.

11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![NPM version](https://badge.fury.io/js/ot-engine.png)](http://badge.fury.io/js/ot-engine)
[![NPM downloads](http://img.shields.io/npm/dm/ot-engine.svg)](https://npmjs.org/package/ot-engine)
[![Build Status](https://app.travis-ci.com/yiminghe/ot-engine.svg?branch=main)](https://app.travis-ci.com/github/yiminghe/ot-engine)
![Build Status](https://github.com/yiminghe/ot-engine/actions/workflows/ci.yaml/badge.svg)

Operational transformation engine

Expand Down Expand Up @@ -172,17 +172,16 @@ export declare class Doc<S,P,Pr> extends EventTarget<[
## dev

```
yarn
yarn run dev
npm i [email protected] -g
pnpm i
pnpm dev
```

open: http://localhost:3000/

## release workflow

```
yarn version check -i
yarn version apply --all
yarn run pub
npm run pub
git push heroku main:master --force
```
3 changes: 0 additions & 3 deletions examples/rich-text/.yarnrc.yml

This file was deleted.

10 changes: 8 additions & 2 deletions examples/rich-text/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
},
"license": "MIT",
"dependencies": {
"uuid":"8.x",

"qs":"6.x",
"@types/uuid":"8.x",
"@types/qs":"6.x",
"@types/ws":"7.x",
"@types/express":"4.x",
"@teamwork/websocket-json-stream": "^2.0.0",
"@types/node": "^12.0.0",
"@yiminghe/react-scripts": "5.x",
Expand All @@ -36,6 +43,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"packageManager": "[email protected]"
}
}
3 changes: 0 additions & 3 deletions examples/tree/.yarnrc.yml

This file was deleted.

11 changes: 8 additions & 3 deletions examples/tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,16 @@
"name": "tree-example",
"private": true,
"scripts": {
"dev": "run-p client server",
"client": "react-scripts start",
"server": "ts-node server/server.ts"
},
"license": "MIT",
"dependencies": {
"@types/qs":"6.x",
"@types/ws":"7.x",
"@types/express":"4.x",
"npm-run-all": "4.x",
"@rematch/core": "2.x",
"@rematch/immer": "2.x",
"@teamwork/websocket-json-stream": "^2.0.0",
Expand All @@ -23,12 +28,13 @@
"react": "16.x",
"react-dom": "16.x",
"react-redux": "7.x",
"react-sortable-tree": "^2.8.0",
"react-sortable-tree": "~2.8.0",
"reconnecting-websocket": "4.x",
"redux": "4.x",
"uuid": "8.x",
"ws": "^7.2.0"
},

"devDependencies": {
"@types/node": "^12.0.0",
"@yiminghe/react-scripts": "5.x",
Expand All @@ -46,6 +52,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"packageManager": "[email protected]"
}
}
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,25 @@
"type": "git",
"url": "[email protected]:yiminghe/ot-engine.git"
},
"workspaces": [
"packages/*",
"examples/*"
],
"pnpm": {
"overrides": {
"react-dnd": "11.x"
}
},
"scripts": {
"build": "cd examples/rich-text && yarn run build",
"dev": "cd examples/rich-text && yarn run dev",
"start": "cd examples/rich-text && yarn run start",
"pub": "yarn run sync-md && sh scripts/pub.sh",
"build": "cd examples/rich-text && npm run build",
"dev": "cd examples/rich-text && npm run dev",
"start": "cd examples/rich-text && npm run start",
"pub": "npm run sync-md && sh scripts/pub.sh",
"test": "echo 0",
"sync-md": "ts-node scripts/syncMd.ts",
"lint-fix": "yarn run lint --fix",
"lint": "yarn run eslint . --ext .ts",
"check": "yarn run lint && tsc --noEmit",
"lint-fix": "npm run lint --fix",
"lint": "eslint . --ext .ts",
"check": "npm run lint && tsc --noEmit",
"prettier": "prettier --write \"{packages,scripts,examples}/**/*.{js,tsx,ts,jsx}\""
},
"engines": {
"node": "16.x"
"node": "18.x"
},
"dependencies": {
"@babel/cli": "7.x",
Expand All @@ -49,5 +50,5 @@
"ts-node": "^10.7.0",
"typescript": "^4.6.2"
},
"packageManager": "[email protected]"
"packageManager": "[email protected]"
}
6 changes: 2 additions & 4 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"--rootDir",
"src"
],
"yarn": true,
"tsconfig": "tsconfig.build.json"
}
],
Expand All @@ -45,12 +44,11 @@
"typescript": "^4.6.2"
},
"scripts": {
"pub": "yarn run build && cd pkg && npm publish",
"pub": "pnpm build && cd pkg && npm publish",
"build": "pika-pack build"
},
"dependencies": {
"ot-engine-common": "0.0.12",
"ts-event-target": "0.1.x"
},
"packageManager": "[email protected]"
}
}
6 changes: 2 additions & 4 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"--rootDir",
"src"
],
"yarn": true,
"tsconfig": "tsconfig.build.json"
}
],
Expand All @@ -44,9 +43,8 @@
"typescript": "^4.6.2"
},
"scripts": {
"pub": "yarn run build && cd pkg && npm publish",
"pub": "pnpm build && cd pkg && npm publish",
"build": "pika-pack build"
},
"main": "src/index.ts",
"packageManager": "[email protected]"
"main": "src/index.ts"
}
9 changes: 3 additions & 6 deletions packages/engine/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ Operational transformation engine
## demo

```
yarn
pnpm
cd examples/rich-text
yarn server
yarn client
pnpm dev
```

open: http://localhost:3000/
Expand Down Expand Up @@ -179,7 +178,5 @@ export declare class Doc<S,P,Pr> extends EventTarget<[
## release workflow

```
yarn version check -i
yarn version apply --all
yarn run pub
pnpm run pub
```
3 changes: 1 addition & 2 deletions packages/engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
},
"scripts": {
"pub": "npm publish"
},
"packageManager": "[email protected]"
}
}
6 changes: 2 additions & 4 deletions packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"--rootDir",
"src"
],
"yarn": true,
"tsconfig": "tsconfig.build.json"
}
],
Expand Down Expand Up @@ -49,8 +48,7 @@
"typescript": "^4.6.2"
},
"scripts": {
"pub": "yarn run build && cd pkg && npm publish",
"pub": "pnpm build && cd pkg && npm publish",
"build": "pika-pack build"
},
"packageManager": "[email protected]"
}
}
Loading

0 comments on commit 961375d

Please sign in to comment.