Skip to content

Commit 7189ed5

Browse files
committed
feat: first attempt using pnpm
1 parent 21f5d2c commit 7189ed5

13 files changed

Lines changed: 17219 additions & 15622 deletions

File tree

.github/workflows/dhis2-deploy-netlify.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ jobs:
2424
if: "!github.event.push.repository.fork && github.actor != 'dependabot[bot]'"
2525
steps:
2626
- uses: actions/checkout@v2
27+
- uses: pnpm/action-setup@v4
2728
- uses: actions/setup-node@v3
2829
with:
2930
node-version: 20.x
30-
cache: 'yarn'
31+
cache: 'pnpm'
32+
- run: pnpm install --frozen-lockfile
3133

32-
- run: yarn install --frozen-lockfile
33-
34-
- run: yarn build:docs
34+
- run: pnpm build:docs
3535

3636
- uses: nwtgck/actions-netlify@v1.1
3737
with:

.github/workflows/dhis2-verify-commits.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
- uses: actions/setup-node@v3
1313
with:
1414
node-version: 20.x
15-
cache: 'yarn'
16-
- run: yarn install --frozen-lockfile
15+
cache: 'pnpm'
16+
- run: pnpm install --frozen-lockfile
1717
- id: commitlint
1818
run: echo ::set-output name=config_path::$(node -e "process.stdout.write(require('@dhis2/cli-style').config.commitlint)")
1919
- uses: JulienKode/pull-request-name-linter-action@v0.5.0
@@ -26,11 +26,12 @@ jobs:
2626
- uses: actions/checkout@v2
2727
with:
2828
fetch-depth: 0
29+
- uses: pnpm/action-setup@v4
2930
- uses: actions/setup-node@v3
3031
with:
3132
node-version: 20.x
32-
cache: 'yarn'
33-
- run: yarn install --frozen-lockfile
33+
cache: 'pnpm'
34+
- run: pnpm install --frozen-lockfile
3435
- id: commitlint
3536
run: echo ::set-output name=config_path::$(node -e "process.stdout.write(require('@dhis2/cli-style').config.commitlint)")
3637
- uses: wagoid/commitlint-github-action@v5

.github/workflows/dhis2-verify-node.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,34 @@ jobs:
2222
runs-on: ubuntu-latest
2323
steps:
2424
- uses: actions/checkout@v2
25+
- uses: pnpm/action-setup@v4
2526
- uses: actions/setup-node@v3
2627
with:
2728
node-version: 20.x
28-
cache: 'yarn'
29+
cache: 'pnpm'
2930

30-
- run: yarn install --frozen-lockfile
31+
- run: pnpm install --frozen-lockfile
3132

3233
- name: Lint
33-
run: yarn d2-style check
34+
run: pnpm d2-style check
3435

3536
test:
3637
runs-on: ubuntu-latest
3738
steps:
3839
- uses: actions/checkout@v2
40+
- uses: pnpm/action-setup@v4
3941
- uses: actions/setup-node@v3
4042
with:
4143
node-version: 20.x
42-
cache: 'yarn'
44+
cache: 'pnpm'
4345

44-
- run: yarn install --frozen-lockfile
46+
- run: pnpm install --frozen-lockfile
4547

4648
- name: Smoke
4749
run: ./packages/main/bin/d2 debug system
4850

4951
- name: Test
50-
run: yarn test
52+
run: pnpm test
5153

5254
publish:
5355
runs-on: ubuntu-latest
@@ -57,12 +59,13 @@ jobs:
5759
- uses: actions/checkout@v2
5860
with:
5961
token: ${{env.GH_TOKEN}}
62+
- uses: pnpm/action-setup@v4
6063
- uses: actions/setup-node@v3
6164
with:
6265
node-version: 20.x
63-
cache: 'yarn'
66+
cache: 'pnpm'
6467

65-
- run: yarn install --frozen-lockfile
68+
- run: pnpm install --frozen-lockfile
6669

6770
- name: Publish to NPM
6871
run: ./packages/main/bin/d2 utils release --publish npm

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
{
22
"version": "5.1.1-alpha.1",
33
"private": true,
4-
"workspaces": [
5-
"packages/*"
6-
],
74
"repository": "https://github.com/dhis2/cli",
85
"author": "Austin McGee <austin@dhis2.org>",
96
"contributors": [
107
"Viktor Varland <viktor@dhis2.org>"
118
],
129
"license": "BSD-3-Clause",
1310
"devDependencies": {
14-
"@dhis2/cli-style": "^9.0.1",
11+
"@dhis2/cli-style": "^9.3.1",
1512
"@dhis2/cli-utils-docsite": "^3.2.0",
16-
"tape": "^4.13.2",
13+
"tape": "^4.17.0",
1714
"tape-await": "^0.1.2"
1815
},
1916
"scripts": {
2017
"build:docs": "mkdir -p dist && cp docs/index.html dist/",
2118
"start": "d2-utils-docsite serve ./docs -o ./dist",
22-
"test": "tape packages/**/tests/*.js"
19+
"test": "tape packages/**/tests/*.js",
20+
"format": "d2-style apply"
2321
},
2422
"d2": {
2523
"docsite": {
@@ -29,5 +27,6 @@
2927
},
3028
"resolutions": {
3129
"@ls-lint/ls-lint": "2.0.1"
32-
}
30+
},
31+
"packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184"
3332
}

packages/cluster/src/common.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ module.exports.listClusters = async argv => {
235235
const cache = argv.getCache()
236236

237237
const exists = await cache.exists(clusterDir)
238-
if (!exists) return []
238+
if (!exists) {
239+
return []
240+
}
239241

240242
const stat = await cache.stat(clusterDir)
241243
const promises = Object.keys(stat.children)

packages/init/bin/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('creating sds ...')

packages/init/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "@dhis2/create",
3+
"version": "1.0.1",
4+
"description": "",
5+
"main": "index.js",
6+
"bin": {
7+
"create-d2": "bin/index.js"
8+
},
9+
"scripts": {
10+
"test": "echo \"Error: no test specified\" && exit 1"
11+
},
12+
"keywords": [],
13+
"author": "",
14+
"license": "ISC",
15+
"packageManager": "pnpm@10.12.4"
16+
}

packages/utils/src/cmds/release.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const handler = async ({ publish }) => {
7777
),
7878
packages
7979
.map(pkgJsonPath =>
80-
path.join(path.dirname(pkgJsonPath), 'yarn.lock')
80+
path.join(path.dirname(pkgJsonPath), 'pnpm-lock.yaml')
8181
)
8282
.filter(existsSync)
8383
.map(pkgJsonPath =>

packages/utils/src/cmds/schema/diff/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ async function getSchemas(urlLike, { baseUrl, auth, force }) {
6363
function sortSchemaObject(a, b) {
6464
const aHash = objectHash(a)
6565
const bHash = objectHash(b)
66-
if (aHash < bHash) return -1
67-
if (aHash > bHash) return 1
66+
if (aHash < bHash) {
67+
return -1
68+
}
69+
if (aHash > bHash) {
70+
return 1
71+
}
6872
return 0
6973
}
7074

packages/utils/src/cmds/schema/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ function authFromConf(conf = {}, serverConfig = {}) {
6161
username: serverConfig.username || conf.username,
6262
password: serverConfig.password || conf.password,
6363
}
64-
if (auth.username && auth.password) return auth
64+
if (auth.username && auth.password) {
65+
return auth
66+
}
6567
return true
6668
}
6769

0 commit comments

Comments
 (0)