chore: update frontend folder

This commit is contained in:
Steven 2023-08-23 09:13:42 +08:00
parent 40814a801a
commit f5817c575c
129 changed files with 104 additions and 1648 deletions

View File

@ -8,7 +8,7 @@ on:
pull_request: pull_request:
branches: [main] branches: [main]
paths: paths:
- "extension/**" - "frontend/extension/**"
jobs: jobs:
eslint-checks: eslint-checks:
@ -23,12 +23,12 @@ jobs:
with: with:
node-version: "18" node-version: "18"
cache: pnpm cache: pnpm
cache-dependency-path: "extension/pnpm-lock.yaml" cache-dependency-path: "frontend/extension/pnpm-lock.yaml"
- run: pnpm install - run: pnpm install
working-directory: extension working-directory: frontend/extension
- name: Run eslint check - name: Run eslint check
run: pnpm lint run: pnpm lint
working-directory: extension working-directory: frontend/extension
extension-build: extension-build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -41,9 +41,9 @@ jobs:
with: with:
node-version: "18" node-version: "18"
cache: pnpm cache: pnpm
cache-dependency-path: "extension/pnpm-lock.yaml" cache-dependency-path: "frontend/extension/pnpm-lock.yaml"
- run: pnpm install - run: pnpm install
working-directory: extension working-directory: frontend/extension
- name: Run extension build - name: Run extension build
run: pnpm build run: pnpm build
working-directory: extension working-directory: frontend/extension

View File

@ -8,7 +8,7 @@ on:
pull_request: pull_request:
branches: [main] branches: [main]
paths: paths:
- "web/**" - "frontend/web/**"
jobs: jobs:
eslint-checks: eslint-checks:
@ -23,12 +23,12 @@ jobs:
with: with:
node-version: "18" node-version: "18"
cache: pnpm cache: pnpm
cache-dependency-path: "web/pnpm-lock.yaml" cache-dependency-path: "frontend/web/pnpm-lock.yaml"
- run: pnpm install - run: pnpm install
working-directory: web working-directory: frontend/web
- name: Run eslint check - name: Run eslint check
run: pnpm lint run: pnpm lint
working-directory: web working-directory: frontend/web
frontend-build: frontend-build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -41,9 +41,9 @@ jobs:
with: with:
node-version: "18" node-version: "18"
cache: pnpm cache: pnpm
cache-dependency-path: "web/pnpm-lock.yaml" cache-dependency-path: "frontend/web/pnpm-lock.yaml"
- run: pnpm install - run: pnpm install
working-directory: web working-directory: frontend/web
- name: Run frontend build - name: Run frontend build
run: pnpm build run: pnpm build
working-directory: web working-directory: frontend/web

View File

@ -2,11 +2,11 @@
FROM node:18.12.1-alpine3.16 AS frontend FROM node:18.12.1-alpine3.16 AS frontend
WORKDIR /frontend-build WORKDIR /frontend-build
COPY ./web/package.json ./web/pnpm-lock.yaml ./ COPY ./frontend/web/package.json ./frontend/web/pnpm-lock.yaml ./
RUN corepack enable && pnpm i --frozen-lockfile RUN corepack enable && pnpm i --frozen-lockfile
COPY ./web/ . COPY ./frontend/web/ .
RUN pnpm build RUN pnpm build

View File

@ -4,5 +4,5 @@ module.exports = {
semi: true, semi: true,
singleQuote: false, singleQuote: false,
plugins: [require.resolve("@trivago/prettier-plugin-sort-imports")], plugins: [require.resolve("@trivago/prettier-plugin-sort-imports")],
importOrder: ["<BUILTIN_MODULES>", "<THIRD_PARTY_MODULES>", "^@/((?!less).+)", "^[./]", "^(.+).css"], importOrder: ["<BUILTIN_MODULES>", "<THIRD_PARTY_MODULES>", "^@/((?!css).+)", "^[./]", "^[../]", "^(.+).css"],
}; };

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -1,4 +1,4 @@
import type { Shortcut } from "@/types/proto/api/v2/shortcut_service_pb"; import type { Shortcut } from "../../types/proto/api/v2/shortcut_service_pb";
import { Storage } from "@plasmohq/storage"; import { Storage } from "@plasmohq/storage";
const storage = new Storage(); const storage = new Storage();

View File

@ -3,7 +3,7 @@ import { useStorage } from "@plasmohq/storage/hook";
import axios from "axios"; import axios from "axios";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { CreateShortcutResponse, OpenGraphMetadata, Visibility } from "@/types/proto/api/v2/shortcut_service_pb"; import { CreateShortcutResponse, OpenGraphMetadata, Visibility } from "../../../types/proto/api/v2/shortcut_service_pb";
import Icon from "./Icon"; import Icon from "./Icon";
const generateTempName = (length = 6) => { const generateTempName = (length = 6) => {

View File

@ -3,7 +3,7 @@ import { useStorage } from "@plasmohq/storage/hook";
import axios from "axios"; import axios from "axios";
import { useEffect } from "react"; import { useEffect } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { ListShortcutsResponse } from "@/types/proto/api/v2/shortcut_service_pb"; import { ListShortcutsResponse } from "../../../types/proto/api/v2/shortcut_service_pb";
import Icon from "./Icon"; import Icon from "./Icon";
const PullShortcutsButton = () => { const PullShortcutsButton = () => {

View File

@ -1,4 +1,4 @@
import type { Shortcut } from "@/types/proto/api/v2/shortcut_service_pb"; import type { Shortcut } from "../../../types/proto/api/v2/shortcut_service_pb";
import { useStorage } from "@plasmohq/storage/hook"; import { useStorage } from "@plasmohq/storage/hook";
import classNames from "classnames"; import classNames from "classnames";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";

View File

@ -1,4 +1,4 @@
import type { Shortcut } from "@/types/proto/api/v2/shortcut_service_pb"; import type { Shortcut } from "../../../types/proto/api/v2/shortcut_service_pb";
import { useStorage } from "@plasmohq/storage/hook"; import { useStorage } from "@plasmohq/storage/hook";
import classNames from "classnames"; import classNames from "classnames";
import ShortcutView from "./ShortcutView"; import ShortcutView from "./ShortcutView";

View File

@ -1,4 +1,4 @@
import type { Shortcut } from "./types/proto/api/v2/shortcut_service_pb"; import type { Shortcut } from "../../types/proto/api/v2/shortcut_service_pb";
import { Button, Divider, Input } from "@mui/joy"; import { Button, Divider, Input } from "@mui/joy";
import { useStorage } from "@plasmohq/storage/hook"; import { useStorage } from "@plasmohq/storage/hook";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";

View File

@ -1,3 +1,4 @@
import type { Shortcut } from "../../types/proto/api/v2/shortcut_service_pb";
import { Button, Divider, IconButton } from "@mui/joy"; import { Button, Divider, IconButton } from "@mui/joy";
import { useStorage } from "@plasmohq/storage/hook"; import { useStorage } from "@plasmohq/storage/hook";
import { Toaster } from "react-hot-toast"; import { Toaster } from "react-hot-toast";
@ -6,7 +7,6 @@ import Icon from "@/components/Icon";
import Logo from "@/components/Logo"; import Logo from "@/components/Logo";
import PullShortcutsButton from "@/components/PullShortcutsButton"; import PullShortcutsButton from "@/components/PullShortcutsButton";
import ShortcutsContainer from "@/components/ShortcutsContainer"; import ShortcutsContainer from "@/components/ShortcutsContainer";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service_pb";
import "./style.css"; import "./style.css";
const IndexPopup = () => { const IndexPopup = () => {

View File

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 83 KiB

View File

@ -3,8 +3,8 @@ import axios from "axios";
import copy from "copy-to-clipboard"; import copy from "copy-to-clipboard";
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { toast } from "react-hot-toast"; import { toast } from "react-hot-toast";
import { ListUserAccessTokensResponse, UserAccessToken } from "../../../../types/proto/api/v2/user_service_pb";
import useUserStore from "../../stores/v1/user"; import useUserStore from "../../stores/v1/user";
import { ListUserAccessTokensResponse, UserAccessToken } from "../../types/proto/api/v2/user_service_pb";
import { showCommonDialog } from "../Alert"; import { showCommonDialog } from "../Alert";
import CreateAccessTokenDialog from "../CreateAccessTokenDialog"; import CreateAccessTokenDialog from "../CreateAccessTokenDialog";
import Icon from "../Icon"; import Icon from "../Icon";

View File

@ -1,6 +1,6 @@
import i18n from "i18next"; import i18n from "i18next";
import { initReactI18next } from "react-i18next"; import { initReactI18next } from "react-i18next";
import en from "./locales/en.json"; import en from "../../locales/en.json";
i18n.use(initReactI18next).init({ i18n.use(initReactI18next).init({
resources: { resources: {

View File

@ -0,0 +1,38 @@
{
"common": {
"about": "About",
"loading": "Loading",
"cancel": "Cancel",
"save": "Save",
"create": "Create",
"download": "Download",
"edit": "Edit",
"delete": "Delete"
},
"analytics": {
"self": "Analytics",
"top-sources": "Top sources",
"source": "Source",
"visitors": "Visitors",
"devices": "Devices",
"browser": "Browser",
"browsers": "Browsers",
"operating-system": "Operating System"
},
"shortcut": {
"visibility": {
"private": {
"self": "Private",
"description": "Only you can access"
},
"workspace": {
"self": "Workspace",
"description": "Workspace members can access"
},
"public": {
"self": "Public",
"description": "Visible to everyone on the internet"
}
}
}
}

View File

@ -0,0 +1,38 @@
{
"common": {
"about": "关于",
"loading": "加载中",
"cancel": "取消",
"save": "保存",
"create": "创建",
"download": "下载",
"edit": "编辑",
"delete": "删除"
},
"analytics": {
"self": "分析",
"top-sources": "热门来源",
"source": "来源",
"visitors": "访客数",
"devices": "设备",
"browser": "浏览器",
"browsers": "浏览器",
"operating-system": "操作系统"
},
"shortcut": {
"visibility": {
"private": {
"self": "私有的",
"description": "仅您可以访问"
},
"workspace": {
"self": "工作区",
"description": "工作区成员可以访问"
},
"public": {
"self": "公开的",
"description": "对任何人可见"
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More