Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor into a pnpm workspace #89

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions .github/workflows/ci.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,17 @@ jobs:

steps:
- uses: actions/checkout@v3

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: latest

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build-all
cache: 'pnpm'

- run: pnpm install
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This awkwardly already runs build-all.

- run: pnpm build-all
7 changes: 7 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use-lockfile-v6=true
resolution-mode=highest
auto-install-peers=true
strict-peer-dependencies=false
save-workspace-protocol=false
prefer-workspace-packages=true
include-workspace-root=true
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ npm install typechat
You can also build TypeChat from source:

```
npm run build
git clone https://github.com/microsoft/TypeChat
cd TypeChat
pnpm install
Copy link

@axecopfire axecopfire Oct 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not everyone knows pnpm, I'd recommend adding pnpm install instructions (it could seem like a typo). https://pnpm.io/cli/install

pnpm build
```

To see TypeChat in action, we recommend exploring the [TypeChat example projects](./examples). You can try them on your local machine or in a GitHub Codespace.
Expand Down
6 changes: 3 additions & 3 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ We recommend reading each example in the following order.

You can experiment with these TypeChat examples on your local machine with just Node.js.

Ensure [Node.js (18.16.0 LTS or newer)](https://nodejs.org/en) or newer is installed.
Ensure [Node.js (18.16.0 LTS or newer)](https://nodejs.org/en) or newer is installed along with [pnpm](https://pnpm.io/).

```
git clone https://github.com/microsoft/TypeChat
cd TypeChat
npm install
pnpm install
```

### Option 2: GitHub Codespaces
Expand Down Expand Up @@ -57,7 +57,7 @@ For more information, see the [GitHub Codespaces Overview](https://docs.github.c
Build TypeChat and the examples by running the following command in the repository root:

```
npm run build-all
pnpm build-all
```

## Step 3: Configure environment variables
Expand Down
3 changes: 2 additions & 1 deletion examples/calendar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"author": "",
"license": "MIT",
"dependencies": {
"dotenv": "^16.3.1"
"dotenv": "^16.3.1",
"typechat": "^0.0.10"
},
"devDependencies": {
"@types/node": "^20.3.1",
Expand Down
3 changes: 2 additions & 1 deletion examples/coffeeShop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"author": "",
"license": "MIT",
"dependencies": {
"dotenv": "^16.3.1"
"dotenv": "^16.3.1",
"typechat": "^0.0.10"
},
"devDependencies": {
"@types/node": "^20.3.1",
Expand Down
3 changes: 2 additions & 1 deletion examples/math/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"author": "",
"license": "MIT",
"dependencies": {
"dotenv": "^16.3.1"
"dotenv": "^16.3.1",
"typechat": "^0.0.10"
},
"devDependencies": {
"@types/node": "^20.3.1",
Expand Down
3 changes: 2 additions & 1 deletion examples/music/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"chalk": "^2.3.1",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"open": "^7.0.4"
"open": "^7.0.4",
"typechat": "^0.0.10"
},
"devDependencies": {
"@types/express": "^4.17.17",
Expand Down
3 changes: 2 additions & 1 deletion examples/restaurant/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"author": "",
"license": "MIT",
"dependencies": {
"dotenv": "^16.3.1"
"dotenv": "^16.3.1",
"typechat": "^0.0.10"
},
"devDependencies": {
"@types/node": "^20.3.1",
Expand Down
3 changes: 2 additions & 1 deletion examples/sentiment/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"author": "",
"license": "MIT",
"dependencies": {
"dotenv": "^16.3.1"
"dotenv": "^16.3.1",
"typechat": "^0.0.10"
},
"devDependencies": {
"@types/node": "^20.3.1",
Expand Down
Loading