diff --git a/.eslintrc.yml b/.eslintrc.yml index 19765825..2f385fec 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -5,6 +5,8 @@ env: extends: - eslint:recommended - plugin:@typescript-eslint/recommended + - plugin:import/recommended + - plugin:import/typescript - prettier parser: '@typescript-eslint/parser' parserOptions: @@ -13,4 +15,17 @@ parserOptions: plugins: - '@typescript-eslint' rules: - '@typescript-eslint/no-empty-interface': ['error', { allowSingleExtends: true }] + '@typescript-eslint/no-empty-interface': + - 'error' + - allowSingleExtends: true + 'import/order': + - 'error' + - alphabetize: + order: 'asc' + caseInsensitive: true + newlines-between: always + 'import/no-unresolved': 'off' +settings: + import/resolver: + typescript: true + node: true diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 914c640a..d1b1a46f 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -3,12 +3,12 @@ name: Publish on: workflow_dispatch: -permissions: - contents: write - jobs: publish-npm: runs-on: ubuntu-latest + permissions: + contents: write + id-token: write outputs: server_updated: ${{ steps.publish.outputs.server_updated }} steps: @@ -48,12 +48,11 @@ jobs: - name: Build packages run: corepack yarn workspaces foreach -Ap --topological-dev run build - - name: Setup Yarn - run: corepack yarn config set -H 'npmAuthToken' "${{ secrets.NPM_TOKEN }}" - - name: Publish and commit id: publish run: corepack yarn zx scripts/publish.mjs + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Upload server tgz uses: actions/upload-artifact@v4 diff --git a/.yarn/versions/50a3988a.yml b/.yarn/versions/50a3988a.yml new file mode 100644 index 00000000..1d844951 --- /dev/null +++ b/.yarn/versions/50a3988a.yml @@ -0,0 +1,3 @@ +releases: + "@aoi-js/frontend": 1.1.0-alpha.1 + "@aoi-js/server": prerelease diff --git a/apps/frontend/.eslintrc.yml b/apps/frontend/.eslintrc.yml index 0ad97ea0..e1ac5c03 100644 --- a/apps/frontend/.eslintrc.yml +++ b/apps/frontend/.eslintrc.yml @@ -8,3 +8,4 @@ parserOptions: rules: '@typescript-eslint/no-unused-vars': 'off' 'vue/multi-word-component-names': 'off' + 'import/default': 'off' diff --git a/apps/frontend/package.json b/apps/frontend/package.json index 6912cccf..ca0cacfc 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -23,7 +23,7 @@ "@babel/types": "^7.21.4", "@intlify/unplugin-vue-i18n": "^0.12.2", "@mdi/font": "7.0.96", - "@sinclair/typebox": "^0.30.4", + "@sinclair/typebox": "^0.32.19", "@types/blueimp-md5": "^2.18.0", "@types/debug": "^4.1.12", "@types/dompurify": "^3.0.2", @@ -41,7 +41,7 @@ "@wooorm/starry-night": "^2.1.1", "blueimp-md5": "^2.19.0", "debug": "^4.3.4", - "dompurify": "^3.0.6", + "dompurify": "^3.0.11", "echarts": "^5.4.3", "eslint-plugin-prettier": "^5.1.0", "eslint-plugin-vue": "^9.19.2", @@ -57,7 +57,7 @@ "pinia": "^2.1.7", "roboto-fontface": "*", "unocss": "^0.58.0", - "vite": "^5.1.4", + "vite": "^5.2.6", "vite-plugin-pages": "^0.32.0", "vite-plugin-vuetify": "^2.0.2", "vscode-oniguruma": "1", diff --git a/apps/frontend/src/App.vue b/apps/frontend/src/App.vue index 7d1ff30c..5043a843 100644 --- a/apps/frontend/src/App.vue +++ b/apps/frontend/src/App.vue @@ -49,12 +49,13 @@ diff --git a/apps/frontend/src/components/aoi/AoiGravatar.vue b/apps/frontend/src/components/aoi/AoiGravatar.vue index 91749e26..5f7c7cf8 100644 --- a/apps/frontend/src/components/aoi/AoiGravatar.vue +++ b/apps/frontend/src/components/aoi/AoiGravatar.vue @@ -9,9 +9,10 @@ diff --git a/apps/frontend/src/components/app/AppList.vue b/apps/frontend/src/components/app/AppList.vue index c1e8b344..59c4f15b 100644 --- a/apps/frontend/src/components/app/AppList.vue +++ b/apps/frontend/src/components/app/AppList.vue @@ -34,14 +34,16 @@ diff --git a/apps/frontend/src/components/plan/types.ts b/apps/frontend/src/components/plan/types.ts index 8e0b4ec3..3ffe1b36 100644 --- a/apps/frontend/src/components/plan/types.ts +++ b/apps/frontend/src/components/plan/types.ts @@ -1,6 +1,7 @@ -import type { MapEntity } from '@/types/server' import type { IPlan, IPlanContest } from '@aoi-js/server' +import type { MapEntity } from '@/types/server' + export interface IPlanDTO extends MapEntity { capability: string } diff --git a/apps/frontend/src/components/problem/DataUpload.vue b/apps/frontend/src/components/problem/DataUpload.vue index 124f3681..16f2a7e4 100644 --- a/apps/frontend/src/components/problem/DataUpload.vue +++ b/apps/frontend/src/components/problem/DataUpload.vue @@ -30,12 +30,15 @@ diff --git a/apps/frontend/src/components/problem/ProblemSubmit.vue b/apps/frontend/src/components/problem/ProblemSubmit.vue index d4e75d83..c53c3929 100644 --- a/apps/frontend/src/components/problem/ProblemSubmit.vue +++ b/apps/frontend/src/components/problem/ProblemSubmit.vue @@ -47,16 +47,17 @@ diff --git a/apps/frontend/src/pages/admin/user.vue b/apps/frontend/src/pages/admin/user.vue index acf8e159..779ab3cd 100644 --- a/apps/frontend/src/pages/admin/user.vue +++ b/apps/frontend/src/pages/admin/user.vue @@ -72,6 +72,10 @@