Skip to content

Commit

Permalink
chore: use npm
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-f committed Jan 9, 2023
1 parent afeb20e commit 49c3452
Show file tree
Hide file tree
Showing 42 changed files with 46,711 additions and 20,727 deletions.
6 changes: 3 additions & 3 deletions @xen-orchestra/fs/package.json
Expand Up @@ -60,9 +60,9 @@
"build": "cross-env NODE_ENV=production babel --source-maps --out-dir=dist/ src/",
"clean": "rimraf dist/",
"dev": "cross-env NODE_ENV=development babel --watch --source-maps --out-dir=dist/ src/",
"prebuild": "yarn run clean",
"predev": "yarn run clean",
"prepublishOnly": "yarn run build",
"prebuild": "npm run clean",
"predev": "npm run clean",
"prepublishOnly": "npm run build",
"postversion": "npm publish"
},
"author": {
Expand Down
4 changes: 2 additions & 2 deletions @xen-orchestra/lite/README.md
Expand Up @@ -2,8 +2,8 @@

- Clone
- Copy `.env.dist` to `.env` and set vars
- `yarn`
- `yarn dev`
- `npm ci`
- `npm run dev`

## Conventions

Expand Down
2 changes: 1 addition & 1 deletion @xen-orchestra/lite/package.json
Expand Up @@ -7,7 +7,7 @@
"preview": "vite preview --port 4173",
"build-only": "GIT_HEAD=$(git rev-parse HEAD) vite build",
"deploy": "./scripts/deploy.sh",
"test": "yarn run type-check",
"test": "npm run type-check",
"type-check": "vue-tsc --noEmit"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions @xen-orchestra/lite/scripts/deploy.sh
Expand Up @@ -14,8 +14,8 @@ SERVER="www-xo.gpn.vates.fr"

echo "Building XO Lite"

(cd ../.. && yarn)
yarn build-only --base="$BASE"
(cd ../.. && npm ci)
npm run build-only --base="$BASE"

echo "Deploying XO Lite from $DIST"

Expand Down
4 changes: 2 additions & 2 deletions @xen-orchestra/log/.USAGE.md
Expand Up @@ -101,7 +101,7 @@ configure(transportConsole())
Optional dependency:

```
> yarn add nodemailer pretty-format
> npm add nodemailer pretty-format
```

Configuration:
Expand All @@ -127,7 +127,7 @@ configure(
Optional dependency:

```
> yarn add split-host syslog-client
> npm add split-host syslog-client
```

Configuration:
Expand Down
4 changes: 2 additions & 2 deletions @xen-orchestra/log/README.md
Expand Up @@ -119,7 +119,7 @@ configure(transportConsole())
Optional dependency:

```
> yarn add nodemailer pretty-format
> npm add nodemailer pretty-format
```

Configuration:
Expand All @@ -145,7 +145,7 @@ configure(
Optional dependency:

```
> yarn add split-host syslog-client
> npm add split-host syslog-client
```

Configuration:
Expand Down
4 changes: 2 additions & 2 deletions @xen-orchestra/openflow/package.json
Expand Up @@ -19,8 +19,8 @@
"dev": "cross-env NODE_ENV=development babel --watch --source-maps --out-dir=dist/ src/",
"postversion": "npm publish --access public",
"prebuild": "rimraf dist/",
"predev": "yarn run prebuild",
"prepublishOnly": "yarn run build"
"predev": "npm run prebuild",
"prepublishOnly": "npm run build"
},
"devDependencies": {
"@babel/cli": "^7.7.4",
Expand Down
4 changes: 2 additions & 2 deletions @xen-orchestra/upload-ova/package.json
Expand Up @@ -57,8 +57,8 @@
"build": "cross-env NODE_ENV=production babel --source-maps --out-dir=dist/ src/",
"dev": "cross-env NODE_ENV=development babel --watch --source-maps --out-dir=dist/ src/",
"prebuild": "rimraf dist/",
"predev": "yarn run prebuild",
"prepublishOnly": "yarn run build"
"predev": "npm run prebuild",
"prepublishOnly": "npm run build"
},
"private": true,
"author": {
Expand Down
8 changes: 4 additions & 4 deletions docker/Dockerfile
Expand Up @@ -15,10 +15,10 @@ RUN /bin/bash -c "source $NVM_DIR/nvm.sh && nvm install $NODE_VERSION && nvm use
ENV NODE_PATH $NVM_DIR/versions/node/$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/$NODE_VERSION/bin:$PATH

RUN npm install -g yarn

WORKDIR /xen-orchestra

# invalidate build on package change
COPY ./yarn.lock /xen-orchestra/yarn.lock
ENTRYPOINT yarn ci
COPY ./package-lock.json /xen-orchestra/package-lock.json

ENTRYPOINT npm run ci

30 changes: 12 additions & 18 deletions docs/installation.md
Expand Up @@ -94,12 +94,6 @@ v16.14.0

If not, see [this page](https://nodejs.org/en/download/package-manager/) for instructions on how to install Node.

#### Yarn

Yarn is a package manager that offers more guarantees than npm.

See [this page](https://yarnpkg.com/en/docs/install#debian-stable) for instructions on how to install Yarn.

#### Packages

XO needs the following packages to be installed. Redis is used as a database by XO.
Expand Down Expand Up @@ -130,12 +124,12 @@ git clone -b master https://github.com/vatesfr/xen-orchestra

### Installing dependencies

Now that you have the code, you can enter the `xen-orchestra` directory and use `yarn` to install other dependencies. Then finally build it using `yarn build`. Be sure to run `yarn` commands as the same user you will be using to run Xen Orchestra:
Now that you have the code, you can enter the `xen-orchestra` directory and use `npm ci` to install other dependencies. Then finally build it using `npm run build`. Be sure to run `npm` commands as the same user you will be using to run Xen Orchestra:

```
$ cd xen-orchestra
$ yarn
$ yarn build
$ npm ci
$ npm run build
```

Now you have to create a config file for `xo-server`:
Expand All @@ -153,7 +147,7 @@ In this config file, you can change default ports (80 and 443) for xo-server. If
You can try to start xo-server to see if it works. You should have something like this:

```
$ yarn start
$ npm run start
WebServer listening on localhost:80
[INFO] Default user: "admin@admin.net" with password "admin"
```
Expand All @@ -163,7 +157,7 @@ WebServer listening on localhost:80
The only part you need to launch is xo-server, which is quite easy to do. From the `xen-orchestra/packages/xo-server` directory, run the following:

```
$ yarn start
$ npm run start
```

That's it! Use your browser to visit the xo-server IP address, and it works! :)
Expand All @@ -177,8 +171,8 @@ If you would like to update your current version, enter your `xen-orchestra` dir
$ git checkout .
$ git pull --ff-only
$ yarn
$ yarn build
$ npm ci
$ npm run build
```

Then restart Xen Orchestra if it was running.
Expand Down Expand Up @@ -236,8 +230,8 @@ Exceptional individual contributers are awarded with a free XOA Premium subscrip
If you have problems during the building phase, follow these steps in your `xen-orchestra` directory:

1. `rm -rf node_modules`
1. `yarn`
1. `yarn build`
1. `npm ci`
1. `npm run build`

### FreeBSD

Expand Down Expand Up @@ -278,7 +272,7 @@ service redis start
If you are using OpenBSD, you need to install these packages:

```
pkg_add gmake redis python--%2.7 git node autoconf yarn
pkg_add gmake redis python--%2.7 git node autoconf
```

A few of the npm packages look for system binaries as part of their installation, and if missing will try to build it themselves. Installing these will save some time and allow for easier upgrades later:
Expand All @@ -301,10 +295,10 @@ ulimit -n 10240
ln -s /usr/local/bin/node /tmp/node
```

If `yarn` cannot find Python, give it an hand :
If `npm` cannot find Python, give it an hand :

```
PYTHON=/usr/local/bin/python2 yarn
PYTHON=/usr/local/bin/python2 npm
```

Enable redis on boot with:
Expand Down

0 comments on commit 49c3452

Please sign in to comment.