Skip to content

Commit 195bbb0

Browse files
authored
ci: Update to pnpm for faster CI/CD and local development workflow
ci: Update to pnpm for faster CI/CD and local development workflow
2 parents fcf9959 + d1ff13c commit 195bbb0

File tree

332 files changed

+16351
-7218
lines changed

Some content is hidden

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

332 files changed

+16351
-7218
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: build
22
on: [push]
3+
4+
permissions:
5+
contents: write # Create releases and tags
6+
pull-requests: write # Comment on PRs with release info
7+
packages: write # Publish to GitHub Packages
8+
39
jobs:
410
build-linting:
511
uses: ./.github/workflows/linting.yml
@@ -16,28 +22,14 @@ jobs:
1622
persist-credentials: false # https://stackoverflow.com/questions/74744498/github-pushing-to-protected-branches-with-fine-grained-token
1723

1824
- name: Setup node
19-
uses: actions/setup-node@v2
20-
env:
21-
NPM_TOKEN: '' # https://github.com/JS-DevTools/npm-publish/issues/15
25+
uses: actions/setup-node@v6
2226
with:
23-
cache-dependency-path: package.json # we don't have a package-lock.json so we'll use this instead...
24-
node-version: '18'
25-
26-
- name: Run `npm install --no-package-lock --no-fund` on cli-output-helpers
27-
run: npm install --no-package-lock --no-fund
28-
working-directory: tools/cli-output-helpers
27+
node-version: '21'
2928

30-
- name: Build cli-output-helpers
31-
run: npm run build
32-
working-directory: tools/cli-output-helpers
33-
34-
- name: Run `npm install --no-package-lock --no-fund` on nevermore-template-helpers
35-
run: npm install --no-package-lock --no-fund
36-
working-directory: tools/nevermore-template-helpers
37-
38-
- name: Build nevermore-template-helpers
39-
run: npm run build
40-
working-directory: tools/nevermore-template-helpers
29+
- name: Setup pnpm
30+
uses: pnpm/action-setup@v4
31+
with:
32+
cache: true
4133

4234
- name: Setup npm for GitHub Packages
4335
run: |
@@ -49,23 +41,18 @@ jobs:
4941
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5042
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5143

52-
- name: Run `npm install --no-package-lock` on nevermore-cli
53-
run: npm install --no-package-lock
54-
working-directory: tools/nevermore-cli
55-
56-
- name: Build nevermore-cli
57-
run: npm run build
58-
working-directory: tools/nevermore-cli
44+
- name: Install dependencies
45+
run: pnpm install --frozen-lockfile
5946

60-
- name: Run npm install
61-
run: npm install --no-save --no-fund
47+
- name: Build all tools
48+
run: pnpm -r --filter './tools/**' run build
6249

6350
- name: Git reset .npmrc
6451
run: git checkout .npmrc
6552

6653
- name: Create Release
6754
env:
68-
GITHUB_TOKEN: ${{ secrets.NEVERMORE_CI_PAT }}
55+
GITHUB_TOKEN: ${{ github.ref == 'refs/heads/main' && secrets.NEVERMORE_CI_PAT || secrets.GITHUB_TOKEN }}
6956
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
7057
run: npx auto shipit
7158

.github/workflows/docs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ jobs:
99
name: Build and deploy docs
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v6
13-
- uses: actions/setup-node@v2
12+
- name: Setup node
13+
uses: actions/setup-node@v6
1414
with:
15-
node-version: '18'
15+
node-version: '21'
16+
1617
- run: npm i -g moonwave@latest
1718
- name: Publish
1819
run: |

.github/workflows/linting.yml

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ jobs:
1212
with:
1313
version: 'v0.3.0'
1414
token: ${{ secrets.GITHUB_TOKEN }}
15+
cache: true
16+
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
with:
20+
cache: true
1521

1622
- name: Setup npm for GitHub Packages
1723
run: |
@@ -23,37 +29,16 @@ jobs:
2329
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2430
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
2531

26-
- name: Run `npm install --no-package-lock` on cli-output-helpers
27-
run: npm install --no-package-lock --no-fund
28-
working-directory: tools/cli-output-helpers
29-
30-
- name: Build cli-output-helpers
31-
run: npm run build
32-
working-directory: tools/cli-output-helpers
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
3334

34-
- name: Run `npm install --no-package-lockd` on nevermore-template-helpers
35-
run: npm install --no-package-lock --no-fund
36-
working-directory: tools/nevermore-template-helpers
37-
38-
- name: Build nevermore-template-helpers
39-
run: npm run build
40-
working-directory: tools/nevermore-template-helpers
41-
42-
- name: Run `npm install --no-package-lock` on nevermore-cli
43-
run: npm install --no-package-lock --no-fund
44-
working-directory: tools/nevermore-cli
45-
46-
- name: Build nevermore-cli
47-
run: npm run build
48-
working-directory: tools/nevermore-cli
35+
- name: Build all tools
36+
run: pnpm -r --filter './tools/**' --filter '!./tools/nevermore-vscode' run build
4937

5038
- name: Install nevermore-cli locally
51-
run: npm install -g .
39+
run: npm install --ignore-scripts -g .
5240
working-directory: tools/nevermore-cli
5341

54-
- name: Link and install packages
55-
run: npm run build:link
56-
5742
- name: Generate Sourcemap
5843
run: npm run build:sourcemap
5944

@@ -71,6 +56,7 @@ jobs:
7156
with:
7257
version: 'v0.3.0'
7358
token: ${{ secrets.GITHUB_TOKEN }}
59+
cache: true
7460

7561
- name: stylua check
7662
run: npm run lint:stylua
@@ -86,6 +72,7 @@ jobs:
8672
with:
8773
version: 'v0.3.0'
8874
token: ${{ secrets.GITHUB_TOKEN }}
75+
cache: true
8976

9077
- name: selene check
9178
run: npm run lint:selene
@@ -101,6 +88,7 @@ jobs:
10188
with:
10289
version: 'v0.3.0'
10390
token: ${{ secrets.GITHUB_TOKEN }}
91+
cache: true
10492

10593
- name: Run moonwave-extractor
10694
run: npm run lint:moonwave

.github/workflows/tests.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,14 @@ jobs:
1010
fetch-depth: 0
1111

1212
- name: Setup node
13-
uses: actions/setup-node@v2
13+
uses: actions/setup-node@v6
1414
with:
15-
cache-dependency-path: package.json
16-
node-version: '18'
15+
node-version: '21'
1716

18-
- name: Install GitHub CLI
19-
run: |
20-
sudo apt update
21-
sudo apt install gh -y
17+
- name: Setup pnpm
18+
uses: pnpm/action-setup@v4
19+
with:
20+
cache: true
2221

2322
- name: Setup npm for GitHub Packages
2423
run: |
@@ -30,10 +29,11 @@ jobs:
3029
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3130
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3231

33-
- name: Install package dependencies
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Compute changed packages
3436
run: |
35-
echo "Installing package dependencies..."
36-
npx lerna exec -- npm install --no-audit --no-fund
3737
PACKAGES=$(npx lerna ls --since origin/main --json | jq -r '.[] | select(.name != "@quenty/nevermore-cli") | .location' | tr '\n' ' ')
3838
echo "PACKAGES=$PACKAGES" >> $GITHUB_ENV
3939
@@ -44,17 +44,18 @@ jobs:
4444
cd tests/bin
4545
4646
echo "Installing changed packages..."
47-
npm i ${{ env.PACKAGES }}
47+
pnpm i ${{ env.PACKAGES }}
4848
49-
echo "Installing Jest"
50-
npm i https://github.com/quentystudios/jest-lua.git
49+
echo "Installing Jest..."
50+
pnpm add https://github.com/quentystudios/jest-lua.git
5151
5252
- name: Setup Aftman
5353
uses: ok-nick/setup-aftman@v0.4.2
5454
with:
5555
path: tests/bin
5656
version: 'v0.3.0'
5757
token: ${{ secrets.GITHUB_TOKEN }}
58+
cache: true
5859

5960
- name: Generate test place file
6061
run: rojo build default.project.json -o testBuild.rbxl

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ dist
1212
.DS_Store
1313
globalTypes.d.lua
1414
*.vsix
15+
tests/bin
1516

1617
# Normally it's a good idea to commit this. However, in this mono-repo scenario with linking
17-
# it adds a ton of noise and no real gain. Also we have seen no gains from reproducing
18-
# builds so we don't have a strict need for this right now.
19-
package-lock.json
20-
tests/bin
18+
# it adds a ton of noise and no real gain. Instead, we rely upon pnpm-lock.yaml which is less messy.
19+
package-lock.json

.npmrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
package-lock = false

default.project.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
{
22
"name": "Nevermore",
3-
"globIgnorePaths": [ "**/.package-lock.json" ],
3+
"globIgnorePaths": [
4+
"**/.package-lock.json",
5+
"**/.pnpm",
6+
"**/.pnpm-workspace-state-v1.json",
7+
"**/.modules.yaml",
8+
"**/.ignored",
9+
"**/.ignored_*"
10+
],
411
"tree": {
512
"$path": "src"
613
}

docs/build.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,20 @@ Contributing to Nevermore is a little bit more difficult than consuming it. That
1919
## Tools and technologies we use
2020
There are certain open source technologies that Nevermore uses to keep the build pipeline clean and working well. These are as follows.
2121

22-
1. [NPM](https://nodejs.org/en/download) - Package manager
23-
2. [Git](https://git-scm.com/downloads) - Source control
24-
3. [Rojo](https://rojo.space/docs/v7/getting-started/installation/) - Build system (syncs into Studio)
25-
4. [Selene](https://kampfkarren.github.io/selene/roblox.html) - Linter
26-
5. [Aftman](https://github.com/LPGhatguy/aftman) - Toolchain manager
27-
6. [Lerna](https://github.com/lerna/lerna) - Helps manage multiple repositories
28-
7. [TestEz](https://roblox.github.io/testez/) - Unit testing system
29-
8. [Hoarcekat](https://github.com/Kampfkarren/hoarcekat) - Story book (testing)
22+
1. [Node](https://nodejs.org/en/download) - Toolchain runner
23+
2. [pnpm](https://pnpm.io/) - Package manager
24+
3. [Git](https://git-scm.com/downloads) - Source control
25+
4. [Rojo](https://rojo.space/docs/v7/getting-started/installation/) - Build system (syncs into Studio)
26+
5. [Selene](https://kampfkarren.github.io/selene/roblox.html) - Linter
27+
6. [Aftman](https://github.com/LPGhatguy/aftman) - Toolchain manager
28+
7. [Lerna](https://github.com/lerna/lerna) - Helps manage multiple repositories
29+
8. [TestEz](https://roblox.github.io/testez/) - Unit testing system
30+
9. [Hoarcekat](https://github.com/Kampfkarren/hoarcekat) - Story book (testing)
31+
10. [Luau-lsp](https://github.com/Quenty/luau-lsp) - Language server protocol for rich IDE in VSCode
32+
11. [VSCode](https://code.visualstudio.com/) - VSCode (other IDEs also work just fine)
3033

3134
:::info
32-
We use a custom version of Rojo to allow symlinks between components.
35+
We use a custom version of Rojo to allow symlinks between components, and a custom version of Luau-lsp
3336
:::
3437

3538
Additionally in the cloud we use
@@ -63,12 +66,24 @@ In general you want to install the following by hand.
6366

6467
After than you will want to clone Nevermore to a folder.
6568

66-
```
69+
```bash
6770
git clone https://github.com/Quenty/NevermoreEngine.git
6871
```
6972

73+
Then, setup the toolchain by running the following commands:
74+
75+
```bash
76+
npm install -g pnpm
77+
aftman install
78+
```
79+
80+
Finally, install all the packages in the repo
81+
82+
```bash
83+
pnpm install
84+
```
85+
86+
You can then serve a test place
7087

7188
## Why does building need a custom version of Rojo?
7289
Nevermore does not need a custom version of Rojo to be consumed, but it does need one to be built. This custom version of Rojo understands symlinks and turn them into ObjectValues. These symlinks link the packages together and means that a change to a transient dependency, or direct dependency will immediately be shown in the upstream package.
73-
74-
As an added bonus, this custom version of Rojo also supports live-syncing mesh parts.

games/integration/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
"directory": "games/integration/"
1717
},
1818
"license": "MIT",
19+
"scripts": {
20+
"preinstall": "npx only-allow pnpm"
21+
},
1922
"contributors": [
2023
"Quenty"
2124
],

lerna.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
{
2-
"packages": [
3-
"src/*",
4-
"tools/*"
5-
],
2+
"npmClient": "pnpm",
3+
"packages": ["src/*", "tools/*"],
64
"command": {
7-
"publish": {
8-
"verifyAccess": false
9-
},
5+
"publish": {},
106
"version": {
117
"conventionalCommits": true,
128
"createRelease": "github",

0 commit comments

Comments
 (0)