Skip to content

Commit

Permalink
chore: update frontend folder
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Aug 23, 2023
1 parent 40814a8 commit f5817c5
Show file tree
Hide file tree
Showing 129 changed files with 104 additions and 1,648 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/extension-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
branches: [main]
paths:
- "extension/**"
- "frontend/extension/**"

jobs:
eslint-checks:
Expand All @@ -23,12 +23,12 @@ jobs:
with:
node-version: "18"
cache: pnpm
cache-dependency-path: "extension/pnpm-lock.yaml"
cache-dependency-path: "frontend/extension/pnpm-lock.yaml"
- run: pnpm install
working-directory: extension
working-directory: frontend/extension
- name: Run eslint check
run: pnpm lint
working-directory: extension
working-directory: frontend/extension

extension-build:
runs-on: ubuntu-latest
Expand All @@ -41,9 +41,9 @@ jobs:
with:
node-version: "18"
cache: pnpm
cache-dependency-path: "extension/pnpm-lock.yaml"
cache-dependency-path: "frontend/extension/pnpm-lock.yaml"
- run: pnpm install
working-directory: extension
working-directory: frontend/extension
- name: Run extension build
run: pnpm build
working-directory: extension
working-directory: frontend/extension
14 changes: 7 additions & 7 deletions .github/workflows/frontend-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:
branches: [main]
paths:
- "web/**"
- "frontend/web/**"

jobs:
eslint-checks:
Expand All @@ -23,12 +23,12 @@ jobs:
with:
node-version: "18"
cache: pnpm
cache-dependency-path: "web/pnpm-lock.yaml"
cache-dependency-path: "frontend/web/pnpm-lock.yaml"
- run: pnpm install
working-directory: web
working-directory: frontend/web
- name: Run eslint check
run: pnpm lint
working-directory: web
working-directory: frontend/web

frontend-build:
runs-on: ubuntu-latest
Expand All @@ -41,9 +41,9 @@ jobs:
with:
node-version: "18"
cache: pnpm
cache-dependency-path: "web/pnpm-lock.yaml"
cache-dependency-path: "frontend/web/pnpm-lock.yaml"
- run: pnpm install
working-directory: web
working-directory: frontend/web
- name: Run frontend build
run: pnpm build
working-directory: web
working-directory: frontend/web
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
FROM node:18.12.1-alpine3.16 AS frontend
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

COPY ./web/ .
COPY ./frontend/web/ .

RUN pnpm build

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ module.exports = {
semi: true,
singleQuote: false,
plugins: [require.resolve("@trivago/prettier-plugin-sort-imports")],
importOrder: ["<BUILTIN_MODULES>", "<THIRD_PARTY_MODULES>", "^@/((?!less).+)", "^[./]", "^(.+).css"],
importOrder: ["<BUILTIN_MODULES>", "<THIRD_PARTY_MODULES>", "^@/((?!css).+)", "^[./]", "^[../]", "^(.+).css"],
};
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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";

const storage = new Storage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useStorage } from "@plasmohq/storage/hook";
import axios from "axios";
import { useEffect, useState } from "react";
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";

const generateTempName = (length = 6) => {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useStorage } from "@plasmohq/storage/hook";
import axios from "axios";
import { useEffect } from "react";
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";

const PullShortcutsButton = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 classNames from "classnames";
import { useEffect, useState } from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -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 classNames from "classnames";
import ShortcutView from "./ShortcutView";
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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 { useStorage } from "@plasmohq/storage/hook";
import { useEffect, useState } from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Shortcut } from "../../types/proto/api/v2/shortcut_service_pb";
import { Button, Divider, IconButton } from "@mui/joy";
import { useStorage } from "@plasmohq/storage/hook";
import { Toaster } from "react-hot-toast";
Expand All @@ -6,7 +7,6 @@ import Icon from "@/components/Icon";
import Logo from "@/components/Logo";
import PullShortcutsButton from "@/components/PullShortcutsButton";
import ShortcutsContainer from "@/components/ShortcutsContainer";
import { Shortcut } from "@/types/proto/api/v2/shortcut_service_pb";
import "./style.css";

const IndexPopup = () => {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import axios from "axios";
import copy from "copy-to-clipboard";
import { useEffect, useState } from "react";
import { toast } from "react-hot-toast";
import { ListUserAccessTokensResponse, UserAccessToken } from "../../../../types/proto/api/v2/user_service_pb";
import useUserStore from "../../stores/v1/user";
import { ListUserAccessTokensResponse, UserAccessToken } from "../../types/proto/api/v2/user_service_pb";
import { showCommonDialog } from "../Alert";
import CreateAccessTokenDialog from "../CreateAccessTokenDialog";
import Icon from "../Icon";
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion web/src/i18n.ts → frontend/web/src/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en from "./locales/en.json";
import en from "../../locales/en.json";

i18n.use(initReactI18next).init({
resources: {
Expand Down
File renamed without changes.
38 changes: 38 additions & 0 deletions frontend/web/src/locales/en.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
38 changes: 38 additions & 0 deletions frontend/web/src/locales/zh.json
Original file line number Diff line number Diff line change
@@ -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": "对任何人可见"
}
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 1 addition & 4 deletions proto/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@ plugins:
out: gen
opt:
- paths=source_relative
# Build the TypeScript definitions for the web and extension.
- plugin: buf.build/bufbuild/es:v1.3.0
out: ../web/src/types/proto
- plugin: buf.build/bufbuild/es:v1.3.0
out: ../extension/src/types/proto
out: ../frontend/types/proto
- plugin: buf.build/community/pseudomuto-doc:v1.5.1
out: gen
opt:
Expand Down
2 changes: 1 addition & 1 deletion scripts/.air.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ tmp_dir = ".air"
bin = "./.air/slash --mode dev"
cmd = "go build -o ./.air/slash ./cmd/slash/main.go"
delay = 1000
exclude_dir = [".air", "web", "extension", "build"]
exclude_dir = [".air", "web", "extension", "frontend", "build"]
exclude_file = []
exclude_regex = []
exclude_unchanged = false
Expand Down
25 changes: 0 additions & 25 deletions web/src/types/proto/api/v2/common_pb.d.ts

This file was deleted.

19 changes: 0 additions & 19 deletions web/src/types/proto/api/v2/common_pb.js

This file was deleted.

Loading

0 comments on commit f5817c5

Please sign in to comment.