Skip to content

Commit 3da7395

Browse files
committed
Replace yarn with pnpm
1 parent e519bb9 commit 3da7395

25 files changed

+13193
-21587
lines changed

Diff for: .drone.star

+35-51
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ config = {
6565
"branches": [
6666
"master",
6767
],
68-
"yarnlint": True,
68+
"pnpmlint": True,
6969
"e2e": {
7070
"oC10": {
7171
"db": "mysql:5.5",
@@ -830,10 +830,10 @@ def beforePipelines(ctx):
830830
licenseCheck(ctx) + \
831831
documentation(ctx) + \
832832
changelog(ctx) + \
833-
yarnCache(ctx) + \
833+
pnpmCache(ctx) + \
834834
cacheOcisPipeline(ctx) + \
835-
pipelinesDependsOn(buildCacheWeb(ctx), yarnCache(ctx)) + \
836-
pipelinesDependsOn(yarnlint(ctx), yarnCache(ctx))
835+
pipelinesDependsOn(buildCacheWeb(ctx), pnpmCache(ctx)) + \
836+
pipelinesDependsOn(pnpmlint(ctx), pnpmCache(ctx))
837837

838838
def stagePipelines(ctx):
839839
unit_test_pipelines = unitTests(ctx)
@@ -844,17 +844,15 @@ def stagePipelines(ctx):
844844
def afterPipelines(ctx):
845845
return build(ctx) + pipelinesDependsOn(notify(), build(ctx))
846846

847-
def yarnCache(ctx):
847+
def pnpmCache(ctx):
848848
return [{
849849
"kind": "pipeline",
850850
"type": "docker",
851-
"name": "cache-yarn",
851+
"name": "cache-pnpm",
852852
"steps": skipIfUnchanged(ctx, "cache") +
853-
installYarn() +
854-
yarnInstallTests() +
855-
rebuildBuildArtifactCache(ctx, "yarn", ".yarn") +
856-
rebuildBuildArtifactCache(ctx, "playwright", ".playwright") +
857-
rebuildBuildArtifactCache(ctx, "tests-yarn", "tests/acceptance/.yarn"),
853+
installPnpm() +
854+
rebuildBuildArtifactCache(ctx, "pnpm", ".pnpm-store") +
855+
rebuildBuildArtifactCache(ctx, "playwright", ".playwright"),
858856
"trigger": {
859857
"ref": [
860858
"refs/heads/master",
@@ -864,14 +862,14 @@ def yarnCache(ctx):
864862
},
865863
}]
866864

867-
def yarnlint(ctx):
865+
def pnpmlint(ctx):
868866
pipelines = []
869867

870-
if "yarnlint" not in config:
868+
if "pnpmlint" not in config:
871869
return pipelines
872870

873-
if type(config["yarnlint"]) == "bool":
874-
if not config["yarnlint"]:
871+
if type(config["pnpmlint"]) == "bool":
872+
if not config["pnpmlint"]:
875873
return pipelines
876874

877875
result = {
@@ -883,9 +881,9 @@ def yarnlint(ctx):
883881
"path": config["app"],
884882
},
885883
"steps": skipIfUnchanged(ctx, "lint") +
886-
restoreBuildArtifactCache(ctx, "yarn", ".yarn") +
884+
restoreBuildArtifactCache(ctx, "pnpm", ".pnpm-store") +
887885
restoreBuildArtifactCache(ctx, "playwright", ".playwright") +
888-
installYarn() +
886+
installPnpm() +
889887
lint(),
890888
"trigger": {
891889
"ref": [
@@ -945,9 +943,9 @@ def build(ctx):
945943
"base": dir["base"],
946944
"path": config["app"],
947945
},
948-
"steps": restoreBuildArtifactCache(ctx, "yarn", ".yarn") +
946+
"steps": restoreBuildArtifactCache(ctx, "pnpm", ".pnpm-store") +
949947
restoreBuildArtifactCache(ctx, "playwright", ".playwright") +
950-
installYarn() +
948+
installPnpm() +
951949
buildRelease(ctx) +
952950
buildDockerImage(),
953951
"trigger": {
@@ -1062,7 +1060,7 @@ def buildCacheWeb(ctx):
10621060
"type": "docker",
10631061
"name": "cache-web",
10641062
"steps": skipIfUnchanged(ctx, "cache") +
1065-
restoreBuildArtifactCache(ctx, "yarn", ".yarn") +
1063+
restoreBuildArtifactCache(ctx, "pnpm", ".pnpm-store") +
10661064
restoreBuildArtifactCache(ctx, "playwright", ".playwright") +
10671065
[{
10681066
"name": "build-web",
@@ -1129,16 +1127,16 @@ def unitTests(ctx):
11291127
},
11301128
] +
11311129
skipIfUnchanged(ctx, "unit-tests") +
1132-
restoreBuildArtifactCache(ctx, "yarn", ".yarn") +
1130+
restoreBuildArtifactCache(ctx, "pnpm", ".pnpm-store") +
11331131
restoreBuildArtifactCache(ctx, "playwright", ".playwright") +
1134-
installYarn() +
1132+
installPnpm() +
11351133
restoreBuildArtifactCache(ctx, "web-dist", "dist") +
11361134
[
11371135
{
11381136
"name": "unit-tests",
11391137
"image": OC_CI_NODEJS,
11401138
"commands": [
1141-
"yarn test:unit --coverage",
1139+
"pnpm test:unit --coverage",
11421140
],
11431141
},
11441142
{
@@ -1215,9 +1213,9 @@ def e2eTests(ctx):
12151213
services = []
12161214
depends_on = []
12171215
steps = skipIfUnchanged(ctx, "e2e-tests") + \
1218-
restoreBuildArtifactCache(ctx, "yarn", ".yarn") + \
1216+
restoreBuildArtifactCache(ctx, "pnpm", ".pnpm-store") + \
12191217
restoreBuildArtifactCache(ctx, "playwright", ".playwright") + \
1220-
installYarn() + \
1218+
installPnpm() + \
12211219
restoreBuildArtifactCache(ctx, "web-dist", "dist") + \
12221220
copyFilesForUpload()
12231221

@@ -1255,7 +1253,7 @@ def e2eTests(ctx):
12551253
"image": OC_CI_NODEJS,
12561254
"environment": environment,
12571255
"commands": [
1258-
"sleep 10 && yarn test:e2e:cucumber tests/e2e/cucumber/**/*[!.%s].feature" % ("oc10" if server == "oCIS" else "ocis"),
1256+
"sleep 10 && pnpm test:e2e:cucumber tests/e2e/cucumber/**/*[!.%s].feature" % ("oc10" if server == "oCIS" else "ocis"),
12591257
],
12601258
}] + \
12611259
uploadTracingResult(ctx) + \
@@ -1375,9 +1373,6 @@ def acceptance(ctx):
13751373
# TODO: don't start services if we skip it -> maybe we need to convert them to steps
13761374
steps += skipIfUnchanged(ctx, "acceptance-tests")
13771375

1378-
steps += restoreBuildArtifactCache(ctx, "tests-yarn", "tests/acceptance/.yarn")
1379-
steps += yarnInstallTests()
1380-
13811376
if (params["oc10IntegrationAppIncluded"]):
13821377
steps += restoreBuildArtifactCache(ctx, "web-dist", "dist")
13831378
else:
@@ -1783,27 +1778,15 @@ def installFederatedServer(version, db, dbSuffix = "-federated"):
17831778

17841779
return [stepDefinition]
17851780

1786-
def installYarn():
1781+
def installPnpm():
17871782
return [{
1788-
"name": "yarn-install",
1783+
"name": "pnpm-install",
17891784
"image": OC_CI_NODEJS,
17901785
"environment": {
17911786
"PLAYWRIGHT_BROWSERS_PATH": ".playwright",
17921787
},
17931788
"commands": [
1794-
"yarn install --immutable",
1795-
],
1796-
}]
1797-
1798-
def yarnInstallTests():
1799-
return [{
1800-
"name": "yarn-install-tests",
1801-
"image": OC_CI_NODEJS,
1802-
"environment": {
1803-
"PLAYWRIGHT_BROWSERS_PATH": ".playwright",
1804-
},
1805-
"commands": [
1806-
"cd tests/acceptance && yarn install --immutable",
1789+
"pnpm install",
18071790
],
18081791
}]
18091792

@@ -1812,7 +1795,7 @@ def lint():
18121795
"name": "lint",
18131796
"image": OC_CI_NODEJS,
18141797
"commands": [
1815-
"yarn run lint",
1798+
"pnpm lint",
18161799
],
18171800
}]
18181801

@@ -2420,11 +2403,12 @@ def runWebuiAcceptanceTests(ctx, suite, alternateSuiteName, filterTags, extraEnv
24202403
for env in extraEnvironment:
24212404
environment[env] = extraEnvironment[env]
24222405

2423-
return [{
2406+
return restoreBuildArtifactCache(ctx, "pnpm", ".pnpm-store") + [{
24242407
"name": "webui-acceptance-tests",
24252408
"image": OC_CI_NODEJS,
24262409
"environment": environment,
24272410
"commands": [
2411+
"pnpm install --filter ./tests/acceptance",
24282412
"cd %s/tests/acceptance && ./run.sh" % dir["web"],
24292413
],
24302414
"volumes": [{
@@ -2781,25 +2765,25 @@ def licenseCheck(ctx):
27812765
},
27822766
"steps": [
27832767
{
2784-
"name": "yarn-install",
2768+
"name": "pnpm-install",
27852769
"image": OC_CI_NODEJS,
27862770
"commands": [
2787-
"yarn install --immutable",
2771+
"pnpm install",
27882772
],
27892773
},
27902774
{
27912775
"name": "node-check-licenses",
27922776
"image": OC_CI_NODEJS,
27932777
"commands": [
2794-
"yarn licenses:check",
2778+
"pnpm licenses:check",
27952779
],
27962780
},
27972781
{
27982782
"name": "node-save-licenses",
27992783
"image": OC_CI_NODEJS,
28002784
"commands": [
2801-
"yarn licenses:csv",
2802-
"yarn licenses:save",
2785+
"pnpm licenses:csv",
2786+
"pnpm licenses:save",
28032787
],
28042788
},
28052789
],

Diff for: .gitignore

-25
Original file line numberDiff line numberDiff line change
@@ -35,31 +35,6 @@ tests/testing-app
3535

3636
/coverage
3737

38-
# yarn2 with Zero-Installs: https://yarnpkg.com/features/zero-installs
39-
#.yarn/*
40-
#!.yarn/cache
41-
#!.yarn/patches
42-
#!.yarn/plugins
43-
#!.yarn/releases
44-
#!.yarn/sdks
45-
#!.yarn/versions
46-
47-
# yarn2 not using Zero-Installs: https://yarnpkg.com/features/zero-installs
48-
.yarn/*
49-
!.yarn/patches
50-
!.yarn/releases
51-
!.yarn/plugins
52-
!.yarn/sdks
53-
!.yarn/versions
54-
.pnp.*
55-
56-
tests/acceptance/.yarn/*
57-
!tests/acceptance/.yarn/patches
58-
!tests/acceptance/.yarn/releases
59-
!tests/acceptance/.yarn/plugins
60-
!tests/acceptance/.yarn/sdks
61-
!tests/acceptance/.yarn/versions
62-
6338
# acceptance test artifacts
6439
logfile.txt
6540
comments.file

Diff for: .vscode/settings.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
"editor.formatOnSave": true,
1515
"eslint.alwaysShowStatus": false,
1616
"eslint.format.enable": true,
17-
"eslint.packageManager": "yarn",
17+
"eslint.packageManager": "pnpm",
1818
"jest.autoRun": {
1919
"watch": false,
2020
"onStartup": true
2121
},
22-
"jest.jestCommandLine": "yarn test:unit",
23-
"npm.packageManager": "yarn",
22+
"jest.jestCommandLine": "pnpm test:unit",
23+
"npm.packageManager": "pnpm",
2424
"typescript.format.enable": false
2525
}

Diff for: .yarn/releases/yarn-3.1.0.cjs

-768
This file was deleted.

Diff for: .yarnrc.yml

-6
This file was deleted.

Diff for: Makefile

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ RELEASE := ${CURDIR}/release
55
OCX_RELEASE := $(CURDIR)/build/dist
66
NODE_MODULES := ${CURDIR}/node_modules
77

8-
node_modules: package.json yarn.lock
9-
yarn install --immutable && touch ${NODE_MODULES}
8+
node_modules: package.json pnpm-lock.yaml
9+
pnpm install && touch ${NODE_MODULES}
1010

1111
.PHONY: clean
1212
clean:
@@ -65,4 +65,4 @@ l10n-read: node_modules
6565

6666
.PHONY: l10n-write
6767
l10n-write: node_modules
68-
make -C packages/web-runtime/l10n translations
68+
make -C packages/web-runtime/l10n translations

Diff for: Makefile.release

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
SHELL := /bin/bash
22

3-
YARN := $(shell command -v yarn 2> /dev/null)
4-
ifndef YARN
5-
$(error yarn is not available on your system, please install npm)
3+
PNPM := $(shell command -v pnpm 2> /dev/null)
4+
ifndef PNPM
5+
$(error pnpm is not available on your system, please install npm)
66
endif
77

88
app_name=web
@@ -33,8 +33,8 @@ build: build-web copy-config
3333

3434
.PHONY: build-web
3535
build-web:
36-
$(YARN) install --immutable
37-
$(YARN) build
36+
$(PNPM) install
37+
$(PNPM) build
3838

3939
.PHONY: copy-config
4040
copy-config:
@@ -60,8 +60,8 @@ package-ocx: ocx-app-config sign ocx-app-bundle
6060

6161
.PHONY: package-licenses
6262
package-licenses:
63-
yarn licenses:csv
64-
yarn licenses:save
63+
pnpm licenses:csv
64+
pnpm licenses:save
6565
cd $(third_party_licenses_dir) && tar -czf $(CURDIR)/release/third-party-licenses.tar.gz -C $(third_party_licenses_dir) *
6666

6767
.PHONY: sign

Diff for: docs/backend-oc10.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ In the local Web checkout, copy the `config/config.json.sample-oc10` file to `co
6262
## Running Web
6363

6464
- if running from source, make sure to [build Web]({{< ref "./building.md" >}}) first
65-
- run by launching a rollup dev server `yarn serve`
65+
- run by launching a rollup dev server `pnpm serve`
6666
- when working on the Web code, rollup will recompile the code automatically
6767

6868
## Running acceptance tests

Diff for: docs/backend-ocis.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ geekdocFilePath: backend-ocis.md
1212
## Setting up Web
1313

1414
- Clone the [repository](https://github.com/owncloud/web/)
15-
- Initally install all dependencies by running `yarn install`
15+
- Initally install all dependencies by running `pnpm install`
1616
- Copy `./config/config.json.sample-ocis` to `./config/config.json` and adjust values if required
1717

1818
## Running Web
1919

20-
- Start bundling web with a watcher by running `yarn build:w`
20+
- Start bundling web with a watcher by running `pnpm build:w`
2121

2222
## Setting up oCIS
2323

Diff for: docs/building.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ geekdocFilePath: building.md
1111

1212
## Building ownCloud Web
1313

14-
- Run `yarn install` to install dependencies
15-
- Run `yarn build` to build Web and all apps included in the `packages` folder
14+
- Run `pnpm install` to install dependencies
15+
- Run `pnpm build` to build Web and all apps included in the `packages` folder
1616

1717
## Updating dependencies
1818

19-
- Run `yarn upgrade` to update dependencies
19+
- Run `pnpm upgrade` to update dependencies
2020

2121
## Building the documentation
2222

Diff for: docs/custom-apps/_index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This page documents how you can set up an example app within your frontend repo
2020
## Setting up the example "skeleton app"
2121

2222
{{< hint info >}}
23-
This guide assumes you have either an oCIS or ownCloud 10 backend running and followed the [getting started guide]({{< ref "../getting-started.md" >}}) for setting up a development environment with the `web` frontend, having it running via either `yarn serve` or `yarn build:w`. You should be able to use the web UI on localhost using the respective port you've assigned (defaults are `:8080` for OC10 and `:9200` for oCIS) and see changes to your .
23+
This guide assumes you have either an oCIS or ownCloud 10 backend running and followed the [getting started guide]({{< ref "../getting-started.md" >}}) for setting up a development environment with the `web` frontend, having it running via either `pnpm serve` or `pnpm build:w`. You should be able to use the web UI on localhost using the respective port you've assigned (defaults are `:8080` for OC10 and `:9200` for oCIS) and see changes to your .
2424
{{< /hint >}}
2525

2626
From the root of the [web repository](https://github.com/owncloud/web), change into the example skeleton app by running
@@ -32,7 +32,7 @@ cd packages/web-app-skeleton/
3232
Then, you can install the necessary dependencies, bundle the code and start a development server by running
3333

3434
```sh
35-
yarn install && yarn serve
35+
pnpm install && pnpm serve
3636
```
3737

3838
In your terminal, you should see a success message and rollup (our bundler of choice) serving the content under `localhost:3000`. However, there's nothing to find under this address.

0 commit comments

Comments
 (0)