From c2ae160d2326ab2854224cb98811d8fb47e95231 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 27 Oct 2021 23:42:09 +0900 Subject: [PATCH 1/7] refactor --- src/client/components/google.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/client/components/google.vue b/src/client/components/google.vue index 6d8ae0b5bf..be724f038d 100644 --- a/src/client/components/google.vue +++ b/src/client/components/google.vue @@ -10,7 +10,12 @@ import { defineComponent } from 'vue'; import * as os from '@client/os'; export default defineComponent({ - props: ['q'], + props: { + q: { + type: String, + required: true, + } + }, data() { return { query: null, @@ -21,10 +26,7 @@ export default defineComponent({ }, methods: { search() { - const engine = this.$store.state.webSearchEngine || - 'https://www.google.com/search?q={{query}}'; - const url = engine.replace('{{query}}', this.query) - window.open(url, '_blank'); + window.open(`https://www.google.com/search?q=${this.query}`, '_blank'); } } }); From 21ece52a9fa38594745bda54d5d9bc4cd6262a78 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 28 Oct 2021 00:57:49 +0900 Subject: [PATCH 2/7] fix test --- src/client/ui/_common_/sidebar.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/ui/_common_/sidebar.vue b/src/client/ui/_common_/sidebar.vue index ece80e60d9..cd78b6ae46 100644 --- a/src/client/ui/_common_/sidebar.vue +++ b/src/client/ui/_common_/sidebar.vue @@ -35,7 +35,7 @@ {{ $ts.settings }} - From d35b02fa236ce825e7d96a8d85d710dccc62bdb8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 28 Oct 2021 01:16:13 +0900 Subject: [PATCH 3/7] Improve CI --- .github/workflows/lint.yml | 21 ++++++++++ .github/workflows/{nodejs.yml => test.yml} | 46 +++++++++++++++++----- package.json | 3 +- 3 files changed, 60 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/lint.yml rename .github/workflows/{nodejs.yml => test.yml} (55%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..0b3bbc186f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,21 @@ +name: Lint + +on: + push: + branches: + - master + - develop + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions/setup-node@v1 + with: + node-version: 12.x + - run: yarn install + - run: yarn lint diff --git a/.github/workflows/nodejs.yml b/.github/workflows/test.yml similarity index 55% rename from .github/workflows/nodejs.yml rename to .github/workflows/test.yml index a91572ad78..045d209802 100644 --- a/.github/workflows/nodejs.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,5 @@ -name: Node.js CI +name: Test + on: push: branches: @@ -7,12 +8,12 @@ on: pull_request: jobs: - build_and_test: + mocha: runs-on: ubuntu-latest strategy: matrix: - node-version: [14.x, 16.x] + node-version: [16.x] services: postgres: @@ -44,16 +45,43 @@ jobs: - name: Build run: yarn build - name: Test - run: yarn test + run: yarn mocha - lint: + e2e: runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + services: + postgres: + image: postgres:12.2-alpine + ports: + - 54312:5432 + env: + POSTGRES_DB: test-misskey + POSTGRES_HOST_AUTH_METHOD: trust + redis: + image: redis:4.0-alpine + ports: + - 56312:6379 + steps: - uses: actions/checkout@v2 with: submodules: true - - uses: actions/setup-node@v1 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 with: - node-version: 12.x - - run: yarn install - - run: yarn lint + node-version: ${{ matrix.node-version }} + - name: Install dependencies + run: yarn install + - name: Check yarn.lock + run: git diff --exit-code yarn.lock + - name: Copy Configure + run: cp test/test.yml .config + - name: Build + run: yarn build + - name: Test + run: yarn e2e diff --git a/package.json b/package.json index f0bdd0049d..1da71f4d86 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,8 @@ "cy:open": "cypress open", "cy:run": "cypress run", "e2e": "start-server-and-test start:test http://localhost cy:run", - "test": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha", + "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha", + "test": "npm run mocha", "format": "gulp format" }, "resolutions": { From d964c5f27f0aa37f0d5703b1bda928da699111c6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 28 Oct 2021 01:24:55 +0900 Subject: [PATCH 4/7] remove circleci configuration --- .circleci/config.yml | 49 ------------------------- .circleci/misskey/default.yml | 12 ------ {.circleci => .github}/misskey/test.yml | 0 test/test.yml | 6 +-- 4 files changed, 3 insertions(+), 64 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .circleci/misskey/default.yml rename {.circleci => .github}/misskey/test.yml (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a29b31a045..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,49 +0,0 @@ -version: 2.1 - -executors: - docker: - working_directory: /tmp/workspace - docker: - - image: docker:latest - -jobs: - docker: - parameters: - with_deploy: - type: boolean - default: false - executor: docker - steps: - - checkout - - setup_remote_docker: - version: 19.03.13 - - run: - name: Build - command: | - docker build -t misskey/misskey . - - when: - condition: <> - steps: - - run: - name: Deploy - command: | - if [ "$DOCKERHUB_USERNAME$DOCKERHUB_PASSWORD" ] - then - apk update && apk add jq - docker tag misskey/misskey misskey/misskey:$(cat package.json | jq -r .version) - docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD - docker push -a misskey/misskey - else - echo -e '\033[0;33mAborted deploying to Docker Hub\033[0;39m' - fi - -workflows: - version: 2 - docker: - jobs: - - docker: - name: auto-build - with_deploy: true - filters: - branches: - only: master diff --git a/.circleci/misskey/default.yml b/.circleci/misskey/default.yml deleted file mode 100644 index ae18a841bd..0000000000 --- a/.circleci/misskey/default.yml +++ /dev/null @@ -1,12 +0,0 @@ -url: 'http://misskey.local' -port: 8080 -db: - host: localhost - port: 5432 - db: test-misskey - user: postgres - pass: '' -redis: - host: localhost - port: 6379 -id: aid diff --git a/.circleci/misskey/test.yml b/.github/misskey/test.yml similarity index 100% rename from .circleci/misskey/test.yml rename to .github/misskey/test.yml diff --git a/test/test.yml b/test/test.yml index 2d3094653e..ae18a841bd 100644 --- a/test/test.yml +++ b/test/test.yml @@ -1,12 +1,12 @@ url: 'http://misskey.local' -port: 61812 +port: 8080 db: host: localhost - port: 54312 + port: 5432 db: test-misskey user: postgres pass: '' redis: host: localhost - port: 56312 + port: 6379 id: aid From 877bd52ed7820bef49aecfcbe6cad40afd07d43d Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 28 Oct 2021 01:34:31 +0900 Subject: [PATCH 5/7] Update test.yml --- test/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test.yml b/test/test.yml index ae18a841bd..2d3094653e 100644 --- a/test/test.yml +++ b/test/test.yml @@ -1,12 +1,12 @@ url: 'http://misskey.local' -port: 8080 +port: 61812 db: host: localhost - port: 5432 + port: 54312 db: test-misskey user: postgres pass: '' redis: host: localhost - port: 6379 + port: 56312 id: aid From 46010187c385dac0e9c433dbb478bbaf0a83a56e Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 28 Oct 2021 16:06:06 +0900 Subject: [PATCH 6/7] fix e2e test --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1da71f4d86..94cdb1a6cf 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "lint": "tslint 'src/**/*.ts'", "cy:open": "cypress open", "cy:run": "cypress run", - "e2e": "start-server-and-test start:test http://localhost cy:run", + "e2e": "start-server-and-test start:test http://localhost:61812 cy:run", "mocha": "cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha", "test": "npm run mocha", "format": "gulp format" From ddd931a0a379aedb68a0b7031ed9ca11dd69d372 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 28 Oct 2021 17:12:57 +0900 Subject: [PATCH 7/7] fix e2e test --- cypress.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress.json b/cypress.json index f2c02689e4..e858e480b0 100644 --- a/cypress.json +++ b/cypress.json @@ -1,3 +1,3 @@ { - "baseUrl": "http://localhost" + "baseUrl": "http://localhost:61812" }