Skip to content

Commit 7832f09

Browse files
authored
pnpm (#47)
* Switched to pnpm * Added docusaurus build * Drop node version * More cleanup * Cleanup workflow * Maybe? * Last attempt * New folder nesting to allow for other examples
1 parent 0f55936 commit 7832f09

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+22156
-33359
lines changed

.github/workflows/docs-md.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,27 @@ jobs:
1717
- name: Set up Node.js
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: "24"
20+
node-version: "22"
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 9
25+
- name: Get pnpm store directory
26+
shell: bash
27+
run: |
28+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
29+
- name: Setup pnpm cache
30+
uses: actions/cache@v4
31+
with:
32+
path: ${{ env.STORE_PATH }}
33+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
34+
restore-keys: |
35+
${{ runner.os }}-pnpm-store-
2136
- name: Install dependencies
22-
run: npm ci
37+
run: pnpm install --frozen-lockfile
2338
- name: Lint
2439
working-directory: ./packages/docs-md
25-
run: npm run lint
26-
- name: Type check
27-
working-directory: ./packages/docs-md
28-
run: npm run type-check
29-
- name: Test
30-
working-directory: ./packages/docs-md
31-
run: npm run test
40+
run: pnpm run lint
3241
- name: Build
3342
working-directory: ./packages/docs-md
34-
run: npm run build
43+
run: pnpm run build
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Docusaurus Petstore Example
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
merge_group:
9+
10+
jobs:
11+
build-and-test:
12+
name: Docusaurus Petstore Example Build and Test
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: "22"
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 9
25+
- name: Install dependencies
26+
run: pnpm install --frozen-lockfile
27+
- name: Build Docs MD
28+
working-directory: ./packages/docs-md
29+
run: pnpm run build
30+
- name: Build Docusaurus
31+
working-directory: ./examples/docusaurus/petstore
32+
run: pnpm run build

.npmrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Enable workspace hoisting for better dependency management
2+
enable-pre-post-scripts=true
3+
4+
# Auto install peer dependencies
5+
auto-install-peers=true
6+
7+
# Use strict peer dependencies (recommended for monorepos)
8+
strict-peer-dependencies=false
9+
10+
# Store path optimization
11+
store-dir=~/.pnpm-store
12+
13+
# Use link workspace packages to save disk space
14+
link-workspace-packages=true
15+
16+
# Shamefully hoist (helps with some compatibility issues)
17+
shamefully-hoist=false

.vscode/launch.json

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,24 @@
2929
{
3030
"type": "node",
3131
"request": "launch",
32-
"name": "Apiture",
32+
"name": "Petstore (Nextra)",
3333
"skipFiles": [
3434
"<node_internals>/**"
3535
],
3636
"program": "${workspaceFolder}/packages/docs-md/src/cli/cli.ts",
3737
"runtimeArgs": ["--experimental-strip-types"],
38-
"cwd": "${workspaceFolder}/../apiture-docs-demo-docusaurus"
38+
"cwd": "${workspaceFolder}/examples/nextra/petstore"
3939
},
4040
{
4141
"type": "node",
4242
"request": "launch",
43-
"name": "Speakeasy (Nextra)",
43+
"name": "Petstore (Docusaurus)",
4444
"skipFiles": [
4545
"<node_internals>/**"
4646
],
4747
"program": "${workspaceFolder}/packages/docs-md/src/cli/cli.ts",
4848
"runtimeArgs": ["--experimental-strip-types"],
49-
"cwd": "${workspaceFolder}/../speakeasy-docs-demo-nextra"
50-
},
51-
{
52-
"type": "node",
53-
"request": "launch",
54-
"name": "Speakeasy (Docusaurus)",
55-
"skipFiles": [
56-
"<node_internals>/**"
57-
],
58-
"program": "${workspaceFolder}/packages/docs-md/src/cli/cli.ts",
59-
"runtimeArgs": ["--experimental-strip-types"],
60-
"cwd": "${workspaceFolder}/../speakeasy-docs-demo-docusaurus"
49+
"cwd": "${workspaceFolder}/examples/docusaurus/petstore"
6150
},
6251
]
6352
}

Makefile

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
type-check:
2-
npm run type-check --workspaces
2+
pnpm run type-check --recursive
33

44
lint:
5-
npm run lint --workspaces
5+
pnpm run lint --recursive
66

77
test: type-check lint
8-
npm test --workspaces
8+
pnpm test --recursive
99

1010
format:
11-
npm run format --workspaces
11+
pnpm run format --recursive
1212

1313
install:
14-
npm install
15-
npm install --workspaces
14+
pnpm install
1615

1716
build: install
18-
npm run build --workspaces
17+
pnpm run build --recursive
1918

2019
start:
21-
npx concurrently \
22-
"npm run dev --workspace=server" \
23-
"npm run dev --workspace=client/web" \
24-
"npm run dev --workspace=demos" \
25-
"npm run dev --workspace=asset-proxy"
20+
pnpm dlx concurrently \
21+
"pnpm run dev --filter=server" \
22+
"pnpm run dev --filter=client/web" \
23+
"pnpm run dev --filter=demos" \
24+
"pnpm run dev --filter=asset-proxy"
2625

2726
add-demo:
28-
npm run add-demo --workspace="@speakeasy-api/codewords-demos"
27+
pnpm run add-demo --filter="@speakeasy-api/codewords-demos"
2928

3029
.PHONY: interactive
3130

3231
interactive:
33-
npm run interactive --workspace=server -- --spec=$(spec) --lang=$(lang) --token=$(token) --command=$(command)
32+
pnpm run interactive --filter=server -- --spec=$(spec) --lang=$(lang) --token=$(token) --command=$(command)
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)