]> cat aescling's git repositories - mastodon.git/commitdiff
Do not use npm (#6656)
authorAkihiko Odaki <akihiko.odaki.4i@stu.hosei.ac.jp>
Tue, 6 Mar 2018 20:36:46 +0000 (05:36 +0900)
committerEugen Rochko <eugen@zeonfederated.com>
Tue, 6 Mar 2018 20:36:46 +0000 (21:36 +0100)
Both of yarn and npm are used in Mastodon, but the combined usage requires
a redundant dependency and may lead to data inconsistency.

Considering that yarn has autoclean feature which npm does not have,
this change replaces all npm usage with yarn.

This change requires documentation update. Most notably, the following
command must be executed before assets precompilation if any system
dependency of node-sass has changed:

yarn install --force --pure-lockfile

Dockerfile
docker-compose.yml
package.json

index c22756d0c75b4e45c4db87676649602ce7c43487..377380a84ddb0dde3ae2da3460a96fafffb86934 100644 (file)
@@ -38,7 +38,6 @@ RUN apk -U upgrade \
     libidn \
     libpq \
     nodejs \
-    nodejs-npm \
     protobuf \
     su-exec \
     tini \
index 55b419e98485a20154a1058589bbdf164266a0f0..4d9a6c40d190c615a1e08762ec9b8e30b8075c03 100644 (file)
@@ -55,7 +55,7 @@ services:
     image: gargron/mastodon
     restart: always
     env_file: .env.production
-    command: npm run start
+    command: yarn start
     networks:
       - external_network
       - internal_network
index abc13e1eab55e94232ca85efd89008a6d02d7e48..5b9ea7d37d0472b5c48f7cee8e264517fbd879ef 100644 (file)
     "build:production": "cross-env RAILS_ENV=production ./bin/webpack",
     "manage:translations": "node ./config/webpack/translationRunner.js",
     "start": "node ./streaming/index.js",
-    "test": "npm run test:lint && npm run test:jest",
+    "test": "yarn run test:lint && yarn run test:jest",
     "test:lint": "eslint -c .eslintrc.yml --ext=js app/javascript/ config/webpack/ streaming/",
-    "test:jest": "cross-env NODE_ENV=test jest --coverage",
-    "postinstall": "npm rebuild node-sass"
+    "test:jest": "cross-env NODE_ENV=test jest --coverage"
   },
   "repository": {
     "type": "git",