Commit 1ef50d88 authored by Éloïs's avatar Éloïs
Browse files

[build] migrate from yarn to npm

parent 3513c24a
......@@ -20,9 +20,9 @@ workflow:
- test/**/*
- .gitlab-ci.yml
- index.ts
- npm-shrinkwrap.json
- package.json
- server.ts
- yarn.lock
.env: &env
image: registry.duniter.org/docker/duniter-ci:v0.0.4
......@@ -60,8 +60,8 @@ workflow:
# stage: pages
# cache: {}
# script:
# - yarn
# - yarn doc
# - npm i
# - npm doc
# - mkdir -p public
# - cp .gitlab/pages/pages-index.html public/index.html
# - sed -i "s/{BRANCH}/$CI_COMMIT_REF_NAME/g" public/index.html
......@@ -89,8 +89,8 @@ tests:
- when: on_success
stage: tests
script:
- yarn
- yarn test
- npm i
- npm test
# Push coverage to GitLab pages
- tar cvzf coverage.tar.gz coverage/
# Code coverage display in GitLab
......@@ -135,7 +135,7 @@ sync_g1:
<<: *integration_rules
stage: integration
script:
- yarn
- npm i
- bash .gitlab/test/check_g1_sync.sh
sync_gtest:
......@@ -143,7 +143,7 @@ sync_gtest:
<<: *integration_rules
stage: integration
script:
- yarn
- npm i
- bash .gitlab/test/check_gt_sync.sh
.build_releases: &build_releases
......
......@@ -31,7 +31,7 @@ Please note we have a specific workflow, please follow it in all your interactio
2. Ensure that you respect the [commit naming conventions].
3. Ensure that all automated tests pass with the `yarn test` command.
3. Ensure that all automated tests pass with the `npm test` command.
4. Update the documentation with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters.
......
......@@ -139,9 +139,9 @@ The general discussion is used to comment on the merge request as a whole, for e
When you finished developing, you must compile, run linter and run all tests:
yarn
yarn format:check
yarn test
npm install
npm format:check
npm test
Then commit everything.
......
......@@ -33,8 +33,6 @@ Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -- -y
Yarn: [installation instructions][yarn]
## Build the project
### Clone de repository
......@@ -55,13 +53,13 @@ If, for example, version 10 is expected, install and select it with the followin
Command to compile :
yarn
npm install
**WARNING**: playing automated tests takes a lot of resources on your machine and those for several minutes, don't do anything else at the same time!
Command to play automated tests:
yarn test
npm test
If all the tests are successful, the command ends like this:
......@@ -98,4 +96,3 @@ You can then adapt it according to your preferences for use :)
[Rust]: https://www.rust-lang.org/
[Typescript]: https://www.typescriptlang.org/
[yarn]: https://classic.yarnpkg.com/en/docs/install/
......@@ -14,16 +14,6 @@ To produce an arm release file, there is currently the following requirement:
- zip (don't laugh, it is not included by default in raspbian) : sudo apt-get install zip
- do not run anything else on that pi during the build, as it almost takes the 1 Gb and you may just run out of memory if you have other things running.
## Installing yarn
Install yarn:
```
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
```
## Installing Node
You need to install node with the exact version that is currently used. You can find the exact version for all archs by running:
......
......@@ -71,10 +71,6 @@ Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -- -y
#### Yarn
Yarn: [installation instructions][yarn]
## Build the project
Go to the root of the folder where you extracted the source code (or possibly cloned from git).
......@@ -93,7 +89,7 @@ If, for example, version 10 is expected, install and select it with the followin
Command to compile :
NEON_BUILD_RELEASE=true yarn add duniter-ui
NEON_BUILD_RELEASE=true npm add duniter-ui
### Set autocompletion
......
......@@ -10,9 +10,8 @@
### Requirements
You'll need nvm, yarn, and rust:
You'll need nvm and rust:
- [yarn install instructions](https://classic.yarnpkg.com/en/docs/install)
- [nvm install instructions](https://github.com/nvm-sh/nvm#installing-and-updating)
- [rust install instructions](https://www.rust-lang.org/learn/get-started)
......@@ -30,10 +29,10 @@ WARNING: It takes a long time and consumes high cpu !
Run the following command at the root of the repository:
yarn
npm install
### Test
Run the following command at the root of the repository:
yarn test
npm test
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,8 +2,9 @@
"name": "duniter",
"version": "1.7.21",
"engines": {
"node": ">= 10.*",
"npm": ">=3.10"
"node": ">= 10.19",
"npm": ">= 6.13",
"yarn": "YARN NO LONGER USED - use npm instead."
},
"engineStrict": true,
"private": false,
......@@ -22,7 +23,7 @@
"test": "test"
},
"scripts": {
"prepublish": "tsc",
"prepare": "tsc",
"prepack": "find -name \"*.ts\" | grep -v \".d.ts\" | xargs rm",
"tsc": "tsc",
"tscw": "tsc -w",
......@@ -127,7 +128,7 @@
"lint-staged": ">=10",
"mocha": "3.4.2",
"mocha-eslint": "0.1.7",
"nyc": "^11.0.3",
"nyc": "13.3.0",
"should": "*",
"source-map-support": "^0.4.15",
"supertest": "*",
......
......@@ -71,8 +71,9 @@ cp -R "$DOWNLOADS/node-${NVER}-linux-${ARCH}" node
# Build Duniter with GUI
echo "Build Duniter with GUI..."
export NEON_BUILD_RELEASE="true"
yarn add "duniter-ui@${DUNITER_UI_VER}" || exit 1
yarn --production || exit 1
npm add "duniter-ui@${DUNITER_UI_VER}" || exit 1
npm i || exit 1
npm prune --production || exit 1
SRC=`pwd`
echo $SRC
......
......@@ -181,8 +181,9 @@ rm -Rf .gitignore .git || exit 1 # Remove git files
# Build Duniter with GUI
echo ">> VM: building modules..."
export NEON_BUILD_RELEASE="true"
yarn add "duniter-ui@${DUNITER_UI_VER}" || exit 1
yarn --production || exit 1
npm add "duniter-ui@${DUNITER_UI_VER}" || exit 1
npm i || exit 1
npm prune --production || exit 1
# Patch leveldown
cp "${ROOT}/release/resources/leveldown-fix.json" "${RELEASES}/duniter/node_modules/leveldown/package.json" || exit 1
......
......@@ -25,8 +25,8 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN export PATH="$HOME/.cargo/bin:$PATH" && \
export RUSTFLAGS="-C target-feature=-crt-static" && \
export NEON_BUILD_RELEASE="true" && \
yarn add duniter-ui@${DUNITER_UI_VER} && \
yarn --production && \
npm add duniter-ui@${DUNITER_UI_VER} && \
npm i && npm prune --production && \
mv release/docker/duniter.sh docker.sh && \
rm -rf coverage release test && \
rm -rf target && \
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment