chore: use npm

This commit is contained in:
Julien Fontanet
2022-11-28 16:13:47 +01:00
parent 14a0caa4c6
commit 0ab7692ef9
43 changed files with 49158 additions and 22029 deletions

View File

@@ -21,12 +21,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'
cache: 'npm'
- name: Install project dependencies
run: yarn
run: npm ci
- name: Build the project
run: yarn build
run: npm run build
- name: Lint tests
run: yarn test-lint
run: npm run test-lint
- name: Integration tests
run: sudo yarn test-integration
run: sudo npm run test-integration

View File

@@ -61,10 +61,10 @@
"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",
"pretest": "yarn run build",
"prebuild": "npm run clean",
"predev": "npm run clean",
"prepublishOnly": "npm run build",
"pretest": "npm run build",
"postversion": "npm publish",
"test": "node--test ./dist/"
},

View File

@@ -2,8 +2,8 @@
- Clone
- Copy `.env.dist` to `.env` and set vars
- `yarn`
- `yarn dev`
- `npm ci`
- `npm run dev`
## Conventions

View File

@@ -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": {

View File

@@ -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"

View File

@@ -101,7 +101,7 @@ configure(transportConsole())
Optional dependency:
```
> yarn add nodemailer pretty-format
> npm add nodemailer pretty-format
```
Configuration:
@@ -127,7 +127,7 @@ configure(
Optional dependency:
```
> yarn add split-host syslog-client
> npm add split-host syslog-client
```
Configuration:

View File

@@ -119,7 +119,7 @@ configure(transportConsole())
Optional dependency:
```
> yarn add nodemailer pretty-format
> npm add nodemailer pretty-format
```
Configuration:
@@ -145,7 +145,7 @@ configure(
Optional dependency:
```
> yarn add split-host syslog-client
> npm add split-host syslog-client
```
Configuration:

View File

@@ -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",

View File

@@ -56,8 +56,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": {

View File

@@ -93,12 +93,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.
@@ -129,12 +123,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:
```sh
cd xen-orchestra
yarn
yarn build
npm ci
npm run build
```
Now you have to create a config file for `xo-server`:
@@ -152,7 +146,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:
```console
$ yarn start
$ npm run start
WebServer listening on localhost:80
[INFO] Default user: "admin@admin.net" with password "admin"
```
@@ -162,7 +156,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:
```sh
yarn start
npm run start
```
That's it! Use your browser to visit the xo-server IP address, and it works! :)
@@ -176,8 +170,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.
@@ -187,7 +181,7 @@ Then restart Xen Orchestra if it was running.
- You can use [forever](https://github.com/nodejitsu/forever) to have the process always running:
```sh
yarn global add forever
npm i -g forever
# Run the below as the user owning XO
forever start dist/cli.mjs
@@ -196,8 +190,8 @@ forever start dist/cli.mjs
- Or you can use [forever-service](https://github.com/zapty/forever-service) to install XO as a system service, so it starts automatically at boot. Run the following as root:
```sh
yarn global add forever
yarn global add forever-service
npm i -g forever
npm i -g forever-service
# Be sure to edit the path below to where your install is located!
cd /home/username/xen-orchestra/packages/xo-server/
@@ -238,8 +232,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
@@ -284,7 +278,7 @@ service redis start
If you are using OpenBSD, you need to install these packages:
```sh
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:
@@ -307,10 +301,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 :
```sh
PYTHON=/usr/local/bin/python2 yarn
PYTHON=/usr/local/bin/python2 npm
```
Enable redis on boot with:

49047
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -88,7 +88,7 @@
"scripts": {
"build": "turbo run build --scope xo-server --scope xo-server-'*' --scope xo-web",
"build:xo-lite": "turbo run build --scope @xen-orchestra/lite",
"ci": "yarn && yarn build && yarn test-lint && yarn test-integration",
"ci": "npm ci && npm run build && npm run test-lint && npm run test-integration",
"clean": "scripts/run-script.js --parallel clean",
"dev": "scripts/run-script.js --parallel --concurrency 0 --verbose dev",
"dev-test": "jest --bail --watch \"^(?!.*\\.integ\\.spec\\.js$)\"",
@@ -104,6 +104,5 @@
"workspaces": [
"@*/*",
"packages/*"
],
"packageManager": "yarn@1.22.19"
]
}

View File

@@ -53,8 +53,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",
"postversion": "npm publish"
}
}

View File

@@ -64,8 +64,8 @@
"dev": "cross-env NODE_ENV=development babel --watch --source-maps --out-dir=dist/ src/",
"plot": "gnuplot -p memory-test.gnu",
"prebuild": "rimraf dist/",
"predev": "yarn run prebuild",
"prepublishOnly": "yarn run build",
"predev": "npm run prebuild",
"prepublishOnly": "npm run build",
"postversion": "npm publish",
"test": "tap"
}

View File

@@ -37,8 +37,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",
"postversion": "npm publish"
}
}

View File

@@ -47,7 +47,7 @@
"scripts": {
"build": "tsc",
"dev": "tsc -w",
"prepublishOnly": "yarn run build",
"prepublishOnly": "npm run build",
"start": "node dist/index.js",
"postversion": "npm publish"
}

View File

@@ -44,8 +44,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",
"postversion": "npm publish"
}
}

View File

@@ -37,8 +37,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",
"postversion": "npm publish",
"test": "node--test"
}

View File

@@ -40,8 +40,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"
},
"dependencies": {
"@xen-orchestra/audit-core": "^0.2.3",

View File

@@ -35,7 +35,7 @@
"scripts": {
"build": "NODE_ENV=production babel --source-maps --out-dir=dist/ src/",
"dev": "NODE_DEV=development babel --watch --source-maps --out-dir=dist/ src/",
"prepublishOnly": "yarn run build"
"prepublishOnly": "npm run build"
},
"private": true
}

View File

@@ -42,8 +42,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
}

View File

@@ -49,8 +49,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
}

View File

@@ -42,9 +42,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 prebuild",
"prepublishOnly": "yarn run build"
"prebuild": "npm run clean",
"predev": "npm run prebuild",
"prepublishOnly": "npm run build"
},
"private": true
}

View File

@@ -49,9 +49,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 prebuild",
"prepublishOnly": "yarn run build"
"prebuild": "npm run clean",
"predev": "npm run prebuild",
"prepublishOnly": "npm run build"
},
"private": true
}

View File

@@ -39,7 +39,7 @@
"scripts": {
"build": "NODE_ENV=production babel --source-maps --out-dir=dist/ src/",
"dev": "NODE_DEV=development babel --watch --source-maps --out-dir=dist/ src/",
"prepublishOnly": "yarn run build"
"prepublishOnly": "npm run build"
},
"private": true
}

View File

@@ -44,8 +44,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
}

View File

@@ -33,9 +33,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 prebuild",
"prepublishOnly": "yarn run build"
"prebuild": "npm run clean",
"predev": "npm run prebuild",
"prepublishOnly": "npm run build"
},
"private": true,
"author": {

View File

@@ -13,8 +13,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"
},
"version": "1.0.8",
"engines": {

View File

@@ -118,14 +118,13 @@ describe('issue', () => {
```
> npm ci
> yarn start
> npm run start
```
You get all the test suites passed (`PASS`) or failed (`FAIL`).
```
> yarn test
yarn run v1.9.4
> npm run test
$ jest
PASS src/user/user.spec.js
PASS src/job/job.spec.js
@@ -139,11 +138,11 @@ describe('issue', () => {
Done in 7.92s.
```
- You can run only tests related to changed files, and review the failed output by using: `> yarn start --watch`
- You can run only tests related to changed files, and review the failed output by using: `> npm run start -- --watch`
- ⚠ Warning: snapshots ⚠
After each run of the tests, check that snapshots are not inadvertently modified.
- ⚠ Jest known issue ⚠
If a test timeout is triggered the next async tests can fail, it's due to an inadvertently modified snapshots.
As a workaround, you can clean your git working tree and re-run jest using a large timeout: `> yarn start --testTimeout=100000`
As a workaround, you can clean your git working tree and re-run jest using a large timeout: `> npm run start -- --testTimeout=100000`

View File

@@ -126,14 +126,13 @@ describe('issue', () => {
```
> npm ci
> yarn start
> npm run start
```
You get all the test suites passed (`PASS`) or failed (`FAIL`).
```
> yarn test
yarn run v1.9.4
> npm run test
$ jest
PASS src/user/user.spec.js
PASS src/job/job.spec.js
@@ -147,14 +146,14 @@ describe('issue', () => {
Done in 7.92s.
```
- You can run only tests related to changed files, and review the failed output by using: `> yarn start --watch`
- You can run only tests related to changed files, and review the failed output by using: `> npm run start -- --watch`
- ⚠ Warning: snapshots ⚠
After each run of the tests, check that snapshots are not inadvertently modified.
- ⚠ Jest known issue ⚠
If a test timeout is triggered the next async tests can fail, it's due to an inadvertently modified snapshots.
As a workaround, you can clean your git working tree and re-run jest using a large timeout: `> yarn start --testTimeout=100000`
As a workaround, you can clean your git working tree and re-run jest using a large timeout: `> npm run start -- --testTimeout=100000`
## Contributions

View File

@@ -43,8 +43,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
}

View File

@@ -13,8 +13,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"
},
"version": "0.1.2",
"engines": {

View File

@@ -43,9 +43,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 prebuild",
"prepublishOnly": "yarn run build"
"prebuild": "npm run clean",
"predev": "npm run prebuild",
"prepublishOnly": "npm run build"
},
"private": true
}

View File

@@ -43,9 +43,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 prebuild",
"prepublishOnly": "yarn run build"
"prebuild": "npm run clean",
"predev": "npm run prebuild",
"prepublishOnly": "npm run build"
},
"private": true
}

View File

@@ -43,9 +43,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 prebuild",
"prepublishOnly": "yarn run build"
"prebuild": "npm run clean",
"predev": "npm run prebuild",
"prepublishOnly": "npm run build"
},
"private": true
}

View File

@@ -50,9 +50,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 prebuild",
"prepublishOnly": "yarn run build"
"prebuild": "npm run clean",
"predev": "npm run prebuild",
"prepublishOnly": "npm run build"
},
"private": true
}

View File

@@ -42,8 +42,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
}

View File

@@ -25,14 +25,14 @@ Manual install procedure is [available here](https://xen-orchestra.com/docs/from
Production build:
```sh
yarn run build
```console
$ npm run build
```
Development build:
```sh
yarn run dev
```console
$ npm run dev
```
## How to report a bug?

View File

@@ -154,11 +154,11 @@
},
"scripts": {
"_build": "index-modules --index-file index.mjs src/api src/xapi/mixins src/xo-mixins && babel --delete-dir-on-start --keep-file-extension --source-maps --out-dir=dist/ src/",
"build": "cross-env NODE_ENV=production yarn run _build",
"dev": "cross-env NODE_ENV=development yarn run _build --watch",
"prepublishOnly": "yarn run build",
"build": "cross-env NODE_ENV=production npm run _build",
"dev": "cross-env NODE_ENV=development npm run _build --watch",
"prepublishOnly": "npm run build",
"start": "node dist/cli.mjs",
"pretest": "yarn run build",
"pretest": "npm run build",
"test": "tap 'dist/**/*.spec.mjs'"
},
"author": {

View File

@@ -45,9 +45,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": {

View File

@@ -143,9 +143,9 @@
"build": "GIT_HEAD=$(git rev-parse HEAD) NODE_ENV=production gulp build",
"clean": "gulp clean",
"dev": "GIT_HEAD=$(git rev-parse HEAD) NODE_ENV=development gulp build",
"prebuild": "yarn run clean && index-modules --auto src",
"predev": "yarn run prebuild",
"prepublishOnly": "yarn run build"
"prebuild": "npm run clean && index-modules --auto src",
"predev": "npm run prebuild",
"prepublishOnly": "npm run build"
},
"browserify": {
"transform": [

View File

@@ -24,7 +24,6 @@ esac
if [ $# -ge 2 ]
then
npm --save=false --workspaces=false version "$2"
git checkout HEAD :/yarn.lock
fi
# if version is not passed, simply update other packages

21908
yarn.lock

File diff suppressed because it is too large Load Diff