Skip to content

Commit fe579dd

Browse files
authored
Merge pull request #850 from owncloud/move_from_yarn_to_npm
Switch from yarn to pure npm
2 parents 49d9a15 + 880607b commit fe579dd

File tree

7 files changed

+12381
-7109
lines changed

7 files changed

+12381
-7109
lines changed

.drone.star

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ def main(ctx):
2828
"name": "Dependencies",
2929
"image": "owncloudci/nodejs:18",
3030
"commands": [
31-
"yarn install",
31+
"npm install",
3232
],
3333
},
3434
{
3535
"name": "Lint",
3636
"image": "owncloudci/nodejs:18",
3737
"commands": [
38-
"yarn lint",
38+
"npm run lint",
3939
],
4040
},
4141
{
4242
"name": "Build",
4343
"image": "owncloudci/nodejs:18",
4444
"commands": [
45-
"yarn bundle",
45+
"npm run bundle",
4646
"file build/ui-bundle.zip",
4747
"ls -l build/ui-bundle.zip"
4848
],

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"ecmaVersion": "latest"
44
},
55
"extends": "standard",
6+
"plugins": ["n"],
67
"rules": {
78
"curly": "off",
89
"semi": "off",

README.md

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
[link-git]: https://git-scm.com
1010
[link-node]: https://nodejs.org
1111
[link-gulp-cli]: http://gulpjs.com
12-
[link-yarn]: https://yarnpkg.com
1312
[link-git-package]: https://git-scm.com/downloads
1413
[link-nvm]: https://github.com/creationix/nvm
1514
[link-nvm-installation-instructions]: https://github.com/creationix/nvm#installation
@@ -23,10 +22,9 @@ The `docs-ui` repository is a custom version of the [Antora Default UI][link-ant
2322
* [Prerequisites](#prerequisites)
2423
* [Git](#git)
2524
* [Node](#node)
26-
* [Yarn](#yarn)
2725
* [Install Dependencies](#install-dependencies)
2826
* [Add Packages](#add-packages)
29-
* [Prepared Yarn Commands](#prepared-yarn-commands)
27+
* [Prepared npm Commands](#prepared-npm-commands)
3028
* [Preview](#preview)
3129
* [Preview Changes Using the ownCloud Documentation](#preview-changes-using-the-owncloud-documentation)
3230
* [Previewing Changes using a Demo Antora Build](#previewing-changes-using-a-demo-antora-build)
@@ -43,7 +41,6 @@ To preview the UI changes or to create a local version of a `ui-bundle.zip`, you
4341
- [git][link-git] (command: `git`)
4442
- [Node][link-node] (command: `node`)
4543
- [Gulp CLI][link-gulp-cli] (command: `gulp`)
46-
- [Yarn][link-yarn] (command: `yarn`)
4744

4845
### git
4946

@@ -79,83 +76,74 @@ nvm ls-remote | grep "Latest LTS"
7976
v12.22.12 (Latest LTS: Erbium)
8077
v14.21.3 (Latest LTS: Fermium)
8178
v16.20.2 (Latest LTS: Gallium)
82-
v18.18.2 (Latest LTS: Hydrogen)
83-
v20.10.0 (Latest LTS: Iron)
79+
v18.20.4 (Latest LTS: Hydrogen)
80+
v20.18.1 (Latest LTS: Iron)
81+
v22.13.0 (Latest LTS: Jod)
8482
```
8583

8684
Then install a suitable LTS version. You can install as many versions as you like or need, see example below.
8785

8886
```consle
89-
nvm install 16.13.2
87+
nvm install 18.20.4
9088
```
9189

9290
List the installed versions
9391

9492
```consle
9593
nvm ls
96-
v10.23.0
97-
v12.18.2
98-
v14.18.3
99-
v15.5.1
100-
-> v16.13.2
101-
system
102-
default -> 16.13.2 (-> v16.13.2)
94+
-> v18.20.4
95+
default -> 18.20.4 (-> v18.20.4)
96+
10397
...
10498
```
10599

106-
**Important:** For docs, DO NOT use a version _above_ v10.23.0 and _below_ v14.17.0 as it may later conflict with other dependencies especially with the `yarn preview` command where you will get warnings and it may not work as expected.
100+
**Important:** For docs, DO NOT use a version _above_ v10.23.0 and _below_ v14.17.0 as it may later conflict with other dependencies especially with the `npm run preview` command where you will get warnings and it may not work as expected.
107101

108102
**Info:** The backend to push to the web also uses node v16, see the `.drone.star` file. It is recommended to stay with the same release if possible.
109103

110104
Switch to a specific installed version of Node at any time, use the following command:
111105

112106
```consle
113-
nvm use 16.13.2
107+
nvm use 18.20.5
114108
```
115109

116110
**Important:** If you have additional concurrent terminals open, you must close these terminals first and reopen them to use the new setup.
117111

118112
To make a particular Node version default in new terminals, type:
119113

120114
```consle
121-
nvm alias default 16.13.2
115+
nvm alias default 18.20.5
122116
```
123117

124-
Now that you have Node installed, you can proceed with installing the Gulp CLI and Yarn.
125-
126-
### Yarn
127-
128-
Your system must have installed `yarn`. If this is not the case,
129-
[install yarn](https://yarnpkg.com/lang/en/docs/install) following the installation
130-
notes on the referenced site.
118+
Now that you have Node installed, you can proceed with installing the Gulp CLI and npm.
131119

132120
### Install Dependencies
133121

134122
Finally, run the following command to install all dependencies:
135123

136124
```Shell
137-
yarn install
125+
npm install
138126
```
139127

140128
### Add Packages
141129

142130
If a new package needs to be added, type the following:
143131

144132
```Shell
145-
yarn add <package-name>
133+
npm -i <package-name>
146134
```
147135

148-
## Prepared Yarn Commands
136+
## Prepared npm Commands
149137

150-
To see all prepared yarn commands, run the following command `yarn run`. This will output all commands with their settings, though this makes readability not easy. See the [yarn documentation](https://yarnpkg.com/lang/en/docs/cli/run/) for more information.
138+
To see all prepared npm commands, run the following command `npm run`. This will output all commands with their settings, though this makes readability not easy. See the [npm documentation](https://docs.npmjs.com/cli/v11/using-npm/scripts) for more information.
151139

152140
Here is the list of commands and when to use them:
153141

154-
* `yarn bundle`
155-
Generate a new `ui-bundle.zip` file for local use
156-
* `yarn lint`
142+
* `npm run lint`
157143
Lint the UI bundle definition
158-
* `yarn preview`
144+
* `npm run bundle`
145+
Generate a new `ui-bundle.zip` file for local use
146+
* `npm run preview`
159147
Preview the bundle using the gulp. This previews a demo Antora build.
160148

161149
## Preview
@@ -165,7 +153,7 @@ Preview the bundle using the gulp. This previews a demo Antora build.
165153
If you want to preview your changes to the UI using the ownCloud documentation instead of demo content then you need to build a local copy of `ui-bundle.zip` and use it when generating the ownCloud documentation in your local development machine.
166154

167155
* First create a local `ui-bundle.zip` with the command described above.
168-
* Then change into the respective documentation repository and run `yarn antora-dev-bundle`.
156+
* Then change into the respective documentation repository and run `npm run antora-dev-bundle`.
169157
See the [Generating the Documentation](https://github.com/owncloud/docs#generating-the-documentation) description for more details.
170158

171159
### Previewing Changes using a Demo Antora Build
@@ -175,5 +163,5 @@ The following example runs a demo Antora **build** (_not ownCloud_) for the docu
175163
To view your changes as you are working on them, run the following command:
176164

177165
```console
178-
yarn preview
166+
npm run preview
179167
```

0 commit comments

Comments
 (0)