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: ...@@ -20,9 +20,9 @@ workflow:
- test/**/* - test/**/*
- .gitlab-ci.yml - .gitlab-ci.yml
- index.ts - index.ts
- npm-shrinkwrap.json
- package.json - package.json
- server.ts - server.ts
- yarn.lock
.env: &env .env: &env
image: registry.duniter.org/docker/duniter-ci:v0.0.4 image: registry.duniter.org/docker/duniter-ci:v0.0.4
...@@ -60,8 +60,8 @@ workflow: ...@@ -60,8 +60,8 @@ workflow:
# stage: pages # stage: pages
# cache: {} # cache: {}
# script: # script:
# - yarn # - npm i
# - yarn doc # - npm doc
# - mkdir -p public # - mkdir -p public
# - cp .gitlab/pages/pages-index.html public/index.html # - cp .gitlab/pages/pages-index.html public/index.html
# - sed -i "s/{BRANCH}/$CI_COMMIT_REF_NAME/g" public/index.html # - sed -i "s/{BRANCH}/$CI_COMMIT_REF_NAME/g" public/index.html
...@@ -89,8 +89,8 @@ tests: ...@@ -89,8 +89,8 @@ tests:
- when: on_success - when: on_success
stage: tests stage: tests
script: script:
- yarn - npm i
- yarn test - npm test
# Push coverage to GitLab pages # Push coverage to GitLab pages
- tar cvzf coverage.tar.gz coverage/ - tar cvzf coverage.tar.gz coverage/
# Code coverage display in GitLab # Code coverage display in GitLab
...@@ -135,7 +135,7 @@ sync_g1: ...@@ -135,7 +135,7 @@ sync_g1:
<<: *integration_rules <<: *integration_rules
stage: integration stage: integration
script: script:
- yarn - npm i
- bash .gitlab/test/check_g1_sync.sh - bash .gitlab/test/check_g1_sync.sh
sync_gtest: sync_gtest:
...@@ -143,7 +143,7 @@ sync_gtest: ...@@ -143,7 +143,7 @@ sync_gtest:
<<: *integration_rules <<: *integration_rules
stage: integration stage: integration
script: script:
- yarn - npm i
- bash .gitlab/test/check_gt_sync.sh - bash .gitlab/test/check_gt_sync.sh
.build_releases: &build_releases .build_releases: &build_releases
......
...@@ -31,7 +31,7 @@ Please note we have a specific workflow, please follow it in all your interactio ...@@ -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]. 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 4. Update the documentation with details of changes to the interface, this includes new environment
variables, exposed ports, useful file locations and container parameters. 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 ...@@ -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: When you finished developing, you must compile, run linter and run all tests:
yarn npm install
yarn format:check npm format:check
yarn test npm test
Then commit everything. Then commit everything.
......
...@@ -33,8 +33,6 @@ Rust: ...@@ -33,8 +33,6 @@ Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -- -y curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -- -y
Yarn: [installation instructions][yarn]
## Build the project ## Build the project
### Clone de repository ### Clone de repository
...@@ -55,13 +53,13 @@ If, for example, version 10 is expected, install and select it with the followin ...@@ -55,13 +53,13 @@ If, for example, version 10 is expected, install and select it with the followin
Command to compile : 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! **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: Command to play automated tests:
yarn test npm test
If all the tests are successful, the command ends like this: 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 :) ...@@ -98,4 +96,3 @@ You can then adapt it according to your preferences for use :)
[Rust]: https://www.rust-lang.org/ [Rust]: https://www.rust-lang.org/
[Typescript]: https://www.typescriptlang.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: ...@@ -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 - 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. - 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 ## 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: 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: ...@@ -71,10 +71,6 @@ Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -- -y curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -- -y
#### Yarn
Yarn: [installation instructions][yarn]
## Build the project ## Build the project
Go to the root of the folder where you extracted the source code (or possibly cloned from git). 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 ...@@ -93,7 +89,7 @@ If, for example, version 10 is expected, install and select it with the followin
Command to compile : Command to compile :
NEON_BUILD_RELEASE=true yarn add duniter-ui NEON_BUILD_RELEASE=true npm add duniter-ui
### Set autocompletion ### Set autocompletion
......
...@@ -10,9 +10,8 @@ ...@@ -10,9 +10,8 @@
### Requirements ### 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) - [nvm install instructions](https://github.com/nvm-sh/nvm#installing-and-updating)
- [rust install instructions](https://www.rust-lang.org/learn/get-started) - [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 ! ...@@ -30,10 +29,10 @@ WARNING: It takes a long time and consumes high cpu !
Run the following command at the root of the repository: Run the following command at the root of the repository:
yarn npm install
### Test ### Test
Run the following command at the root of the repository: Run the following command at the root of the repository:
yarn test npm test
This diff is collapsed.
...@@ -2,8 +2,9 @@ ...@@ -2,8 +2,9 @@
"name": "duniter", "name": "duniter",
"version": "1.7.21", "version": "1.7.21",
"engines": { "engines": {
"node": ">= 10.*", "node": ">= 10.19",
"npm": ">=3.10" "npm": ">= 6.13",
"yarn": "YARN NO LONGER USED - use npm instead."
}, },
"engineStrict": true, "engineStrict": true,
"private": false, "private": false,
...@@ -22,7 +23,7 @@ ...@@ -22,7 +23,7 @@
"test": "test" "test": "test"
}, },
"scripts": { "scripts": {
"prepublish": "tsc", "prepare": "tsc",
"prepack": "find -name \"*.ts\" | grep -v \".d.ts\" | xargs rm", "prepack": "find -name \"*.ts\" | grep -v \".d.ts\" | xargs rm",
"tsc": "tsc", "tsc": "tsc",
"tscw": "tsc -w", "tscw": "tsc -w",
...@@ -127,7 +128,7 @@ ...@@ -127,7 +128,7 @@
"lint-staged": ">=10", "lint-staged": ">=10",
"mocha": "3.4.2", "mocha": "3.4.2",
"mocha-eslint": "0.1.7", "mocha-eslint": "0.1.7",
"nyc": "^11.0.3", "nyc": "13.3.0",
"should": "*", "should": "*",
"source-map-support": "^0.4.15", "source-map-support": "^0.4.15",
"supertest": "*", "supertest": "*",
......
...@@ -71,8 +71,9 @@ cp -R "$DOWNLOADS/node-${NVER}-linux-${ARCH}" node ...@@ -71,8 +71,9 @@ cp -R "$DOWNLOADS/node-${NVER}-linux-${ARCH}" node
# Build Duniter with GUI # Build Duniter with GUI
echo "Build Duniter with GUI..." echo "Build Duniter with GUI..."
export NEON_BUILD_RELEASE="true" export NEON_BUILD_RELEASE="true"
yarn add "duniter-ui@${DUNITER_UI_VER}" || exit 1 npm add "duniter-ui@${DUNITER_UI_VER}" || exit 1
yarn --production || exit 1 npm i || exit 1
npm prune --production || exit 1
SRC=`pwd` SRC=`pwd`
echo $SRC echo $SRC
......
...@@ -181,8 +181,9 @@ rm -Rf .gitignore .git || exit 1 # Remove git files ...@@ -181,8 +181,9 @@ rm -Rf .gitignore .git || exit 1 # Remove git files
# Build Duniter with GUI # Build Duniter with GUI
echo ">> VM: building modules..." echo ">> VM: building modules..."
export NEON_BUILD_RELEASE="true" export NEON_BUILD_RELEASE="true"
yarn add "duniter-ui@${DUNITER_UI_VER}" || exit 1 npm add "duniter-ui@${DUNITER_UI_VER}" || exit 1
yarn --production || exit 1 npm i || exit 1
npm prune --production || exit 1
# Patch leveldown # Patch leveldown
cp "${ROOT}/release/resources/leveldown-fix.json" "${RELEASES}/duniter/node_modules/leveldown/package.json" || exit 1 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 ...@@ -25,8 +25,8 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN export PATH="$HOME/.cargo/bin:$PATH" && \ RUN export PATH="$HOME/.cargo/bin:$PATH" && \
export RUSTFLAGS="-C target-feature=-crt-static" && \ export RUSTFLAGS="-C target-feature=-crt-static" && \
export NEON_BUILD_RELEASE="true" && \ export NEON_BUILD_RELEASE="true" && \
yarn add duniter-ui@${DUNITER_UI_VER} && \ npm add duniter-ui@${DUNITER_UI_VER} && \
yarn --production && \ npm i && npm prune --production && \
mv release/docker/duniter.sh docker.sh && \ mv release/docker/duniter.sh docker.sh && \
rm -rf coverage release test && \ rm -rf coverage release test && \
rm -rf target && \ rm -rf target && \
......
This diff is collapsed.
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