Просмотр исходного кода

organize npm scripts for linting and testing

Yuki Takei 4 лет назад
Родитель
Сommit
e3647e6236

+ 3 - 0
.github/workflows/ci-slackbot-proxy.yml

@@ -49,6 +49,9 @@ jobs:
         echo -n "node " && node -v
         echo -n "npm " && npm -v
         yarn list --depth=0
+    - name: yarn lint
+      run: |
+        yarn lerna run lint --scope @growi/slack --scope @growi/slackbot-proxy
     - name: yarn test
       run: |
         yarn lerna run test --scope @growi/slack --scope @growi/slackbot-proxy

+ 8 - 8
.github/workflows/ci.yml

@@ -49,12 +49,12 @@ jobs:
         echo -n "node " && node -v
         echo -n "npm " && npm -v
         yarn list --depth=0
-    - name: lerna run test:lint for plugins
+    - name: lerna run lint for plugins
       run: |
-        yarn lerna run test:lint --scope @growi/plugin-pukiwiki-like-linker
-    - name: lerna run test:lint for app
+        yarn lerna run lint --scope @growi/plugin-pukiwiki-like-linker
+    - name: lerna run lint for app
       run: |
-        yarn lerna run test:lint --scope @growi/app
+        yarn lerna run lint --scope @growi/app
 
     - name: Slack Notification
       uses: weseek/ghaction-slack-notification@master
@@ -117,16 +117,16 @@ jobs:
         echo -n "node " && node -v
         echo -n "npm " && npm -v
         yarn list --depth=0
-    - name: yarn test:test
+    - name: yarn test
       working-directory: ./packages/app
       run: |
-        yarn test:test
+        yarn test
       env:
         MONGO_URI: mongodb://localhost:${{ job.services.mongodb.ports['27017'] }}/growi_test
-    - name: yarn test:test with MongoDB 3.6
+    - name: yarn test with MongoDB 3.6
       working-directory: ./packages/app
       run: |
-        yarn test:test
+        yarn test
       env:
         MONGO_URI: mongodb://localhost:${{ job.services.mongodb36.ports['27017'] }}/growi_test
 

+ 6 - 6
packages/app/package.json

@@ -23,12 +23,12 @@
     "//// for CI": "",
     "dev:ci": "yarn dev:client:nowatch && yarn dev:server --ci",
     "predev:ci": "run-p resources:*",
-    "test:lint:typecheck": "npx tsc",
-    "test:lint:eslint": "eslint --quiet \"**/*.{js,jsx,ts,tsx}\"",
-    "test:lint:styles": "stylelint src/**/*.scss",
-    "test:lint:swagger2openapi": "node node_modules/.bin/oas-validate tmp/swagger.json",
-    "test:lint": "run-p test:lint:*",
-    "test:test": "cross-env NODE_ENV=test jest --passWithNoTests -- ",
+    "lint:typecheck": "npx tsc",
+    "lint:eslint": "eslint --quiet \"**/*.{js,jsx,ts,tsx}\"",
+    "lint:styles": "stylelint src/**/*.scss",
+    "lint:swagger2openapi": "node node_modules/.bin/oas-validate tmp/swagger.json",
+    "lint": "run-p test:lint:*",
+    "test": "cross-env NODE_ENV=test jest --passWithNoTests -- ",
     "pretest:lint:eslint": "yarn resources:plugin",
     "pretest:lint:swagger2openapi": "yarn openapi:v3",
     "//// misc": "",

+ 1 - 1
packages/plugin-pukiwiki-like-linker/package.json

@@ -16,7 +16,7 @@
     "tsc": "tsc -p tsconfig.build.json",
     "tsc:w": "yarn tsc -w",
     "lint:js": "eslint **/*.{js,jsx}",
-    "test:lint": "run-p lint:*",
+    "lint": "run-p lint:*",
     "test": ""
   },
   "repository": {

+ 3 - 4
packages/slack/package.json

@@ -8,10 +8,9 @@
     "build": "yarn tsc && tsc-alias -p tsconfig.build.json",
     "tsc": "tsc -p tsconfig.build.json",
     "tsc:w": "yarn tsc -w",
-    "test": "yarn test:lint && yarn test:unit",
-    "test:unit": "cross-env NODE_ENV=test jest --passWithNoTests",
-    "test:lint": "eslint src --ext .ts",
-    "test:lint:fix": "eslint src --ext .ts --fix"
+    "test": "cross-env NODE_ENV=test jest --passWithNoTests",
+    "lint": "eslint src --ext .ts",
+    "lint:fix": "eslint src --ext .ts --fix"
   },
   "dependencies": {
     "axios": "^0.21.1",

+ 3 - 4
packages/slackbot-proxy/package.json

@@ -16,10 +16,9 @@
     "start:prod": "cross-env NODE_ENV=production node -r dotenv-flow/config dist/index.js",
     "postbuild": "yarn cp:public && yarn cp:views && yarn cp:bootstrap",
     "predev": "yarn cp:bootstrap:dev",
-    "test": "yarn test:lint && yarn test:unit",
-    "test:unit": "cross-env NODE_ENV=test jest --passWithNoTests",
-    "test:lint": "eslint src --ext .ts",
-    "test:lint:fix": "eslint src --ext .ts --fix",
+    "test": "cross-env NODE_ENV=test jest --passWithNoTests",
+    "lint": "eslint src --ext .ts",
+    "lint:fix": "eslint src --ext .ts --fix",
     "version": "node -p \"require('./package.json').version\""
   },
   "// comments for dependencies": {},