Skip to content

Commit 3eef1a2

Browse files
authored
Merge pull request #40 from Ayc0/Ayc0/pnpm
switch to pnpm
2 parents 015a92d + 160a56b commit 3eef1a2

File tree

16 files changed

+6509
-8085
lines changed

16 files changed

+6509
-8085
lines changed

.github/workflows/main.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,52 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node-version: [16.x, 18.x, 20.x]
11+
node-version: [22.x, 24.x]
1212

1313
steps:
14-
- uses: actions/checkout@v3
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Install pnpm
18+
uses: pnpm/action-setup@v4
19+
1520
- name: Use Node.js ${{ matrix.node-version }}
16-
uses: actions/setup-node@v3
21+
uses: actions/setup-node@v4
1722
with:
1823
node-version: ${{ matrix.node-version }}
24+
cache: 'pnpm'
25+
1926
- name: Install packages
20-
run: yarn install
27+
run: pnpm install
28+
2129
- name: Build packages
22-
run: yarn build
30+
run: pnpm build
31+
2332
- name: Run tests
24-
run: yarn test
33+
run: pnpm test
2534

2635
lint:
2736
runs-on: ubuntu-latest
2837

2938
strategy:
3039
matrix:
31-
node-version: [20.x]
40+
node-version: [22.x, 24.x]
3241

3342
steps:
34-
- uses: actions/checkout@v3
43+
- name: Checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Install pnpm
47+
uses: pnpm/action-setup@v4
48+
3549
- name: Use Node.js ${{ matrix.node-version }}
36-
uses: actions/setup-node@v3
50+
uses: actions/setup-node@v4
3751
with:
3852
node-version: ${{ matrix.node-version }}
53+
cache: 'pnpm'
54+
3955
- name: Install packages
40-
run: yarn install
56+
run: pnpm install
57+
4158
- name: Check linting
42-
run: yarn lint:check
59+
run: pnpm lint:check

.gitignore

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,3 @@ build/
55
dist/
66
*.log
77
*.lerna_backup
8-
9-
# Yarn 3
10-
.yarn/*
11-
!.yarn/patches
12-
!.yarn/releases
13-
!.yarn/plugins
14-
!.yarn/sdks
15-
!.yarn/versions
16-
.pnp.*

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
.yarn/
21
node_modules/
32
dist/
3+
pnpm-lock.yaml

.vscode/settings.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
{
2-
"search.exclude": {
3-
".yarn/": true
4-
},
5-
"markdown.extension.toc.orderedList": true
6-
}
1+
{ "markdown.extension.toc.orderedList": true }

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 0 additions & 75 deletions
This file was deleted.

.yarn/releases/yarn-3.1.1.cjs

Lines changed: 0 additions & 768 deletions
This file was deleted.

.yarnrc.yml

Lines changed: 0 additions & 7 deletions
This file was deleted.

CONTRIBUTE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Commands
2+
3+
## Initial install
4+
5+
Make sure to have the proper version of Node.js and pnpm (you can use [Volta](https://volta.sh/) for this)
6+
7+
And then, run `pnpm i`
8+
9+
## Build
10+
11+
`pnpm build`: will build all files
12+
13+
## Test
14+
15+
`pnpm test`: will run all unit tests
16+
`pnpm lint:check`: will check that the whole codebase is properly formatted
17+
18+
> [!Note]
19+
> You can use `pnpm lint:fix` to fix the formatting
20+
21+
## Deploy
22+
23+
`pnpm run deploy [--tag next] [--access public|private] --version x.y.z`: will update all package.json with the version `x.y.z`, and apply a git tag to the same version. Then build & test all, and then deploy them to npm under the provided tag (if provided).

build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build('manatea');
77
build('react-manatea');
88

99
function build(package) {
10-
cp.spawnSync('yarn', ['build'], {
10+
cp.spawnSync('pnpm', ['build'], {
1111
cwd: path.join(__dirname, 'packages', package),
1212
stdio: 'inherit',
1313
});

deploy.js

Lines changed: 11 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,18 @@ addTag(version);
2222
push();
2323

2424
function* listAllWorkspaces() {
25-
const output = cp.spawnSync('yarn', ['workspaces', 'list', '--json'], {
25+
const output = cp.spawnSync('pnpm', ['-r', 'exec', 'pwd'], {
2626
encoding: 'utf-8',
2727
}).stdout;
28-
const workspaces = output.trim().split('\n').map(JSON.parse);
28+
const paths = output.trim().split('\n');
2929

30-
for (const workspace of workspaces) {
31-
const packageJsonPath = path.join(
32-
__dirname,
33-
workspace.location,
34-
'package.json',
35-
);
30+
for (const p of paths) {
31+
const packageJsonPath = path.join(p, 'package.json');
3632
const packageJson = JSON.parse(
3733
fs.readFileSync(packageJsonPath, { encoding: 'utf-8' }),
3834
);
3935

40-
yield { packageJsonPath, packageJson, name: workspace.name };
36+
yield { packageJsonPath, packageJson, name: packageJson.name };
4137
}
4238
}
4339

@@ -52,32 +48,22 @@ function updateAllVersions(version) {
5248
}
5349

5450
function deploy(package) {
55-
cp.spawnSync('yarn', ['npm', 'publish', ...argv], {
51+
cp.spawnSync('pnpm', ['publish', '--no-git-checks', ...argv], {
5652
cwd: path.join(__dirname, 'packages', package),
5753
stdio: 'inherit',
5854
});
5955
}
6056

6157
function addTag(version) {
62-
cp.spawnSync('git', ['tag', `v${version}`], {
63-
stdio: 'inherit',
64-
});
58+
cp.spawnSync('git', ['tag', `v${version}`], { stdio: 'inherit' });
6559
}
6660

6761
function commit(version) {
68-
cp.spawnSync('git', ['add', '.'], {
69-
stdio: 'inherit',
70-
});
71-
cp.spawnSync('git', ['commit', '-m', `v${version}`], {
72-
stdio: 'inherit',
73-
});
62+
cp.spawnSync('git', ['add', '.'], { stdio: 'inherit' });
63+
cp.spawnSync('git', ['commit', '-m', `v${version}`], { stdio: 'inherit' });
7464
}
7565

7666
function push() {
77-
cp.spawnSync('git', ['push'], {
78-
stdio: 'inherit',
79-
});
80-
cp.spawnSync('git', ['push', '--tags'], {
81-
stdio: 'inherit',
82-
});
67+
cp.spawnSync('git', ['push'], { stdio: 'inherit' });
68+
cp.spawnSync('git', ['push', '--tags'], { stdio: 'inherit' });
8369
}

0 commit comments

Comments
 (0)