Skip to content

Commit aa6a66f

Browse files
committed
new version
0 parents  commit aa6a66f

23 files changed

+5394
-0
lines changed

.env.local

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PLASMO_PUBLIC_GTAG_ID=G-BCMP5DXSLX

.fleet/run.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"configurations": [
3+
4+
]
5+
}

.github/workflows/submit.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: "Release version"
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'Release version'
7+
required: true
8+
push:
9+
tags:
10+
- 'v*.*'
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Set LD_VERSION
17+
if: ${{ github.event_name == 'push'}}
18+
run: echo "LD_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
19+
- name: Set LD_VERSION
20+
if: ${{ github.event_name == 'workflow_dispatch'}}
21+
run: echo "LD_VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV
22+
23+
- uses: actions/checkout@v3
24+
- name: Cache pnpm modules
25+
uses: actions/cache@v3
26+
with:
27+
path: ~/.pnpm-store
28+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
29+
restore-keys: |
30+
${{ runner.os }}-
31+
- uses: pnpm/action-setup@v2.2.2
32+
with:
33+
version: 7.11.0
34+
run_install: true
35+
- name: Use Node.js 16.x
36+
uses: actions/setup-node@v3.4.1
37+
with:
38+
node-version: 16.x
39+
cache: "pnpm"
40+
- name: Build and zip extension artifact
41+
run: |
42+
pnpm build -- --zip
43+
pnpm build --target=firefox-mv2 --zip
44+
45+
- name: Create Release
46+
id: create_release
47+
uses: actions/create-release@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
tag_name: v${{ env.LD_VERSION }}
52+
release_name: v${{ env.LD_VERSION }}
53+
draft: true
54+
prerelease: false
55+
56+
- name: Upload Chrome Release Asset
57+
id: upload-chrome-release-asset
58+
uses: actions/upload-release-asset@v1
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
with:
62+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
63+
asset_path: ./build/chrome-mv3-prod.zip
64+
asset_name: leetcode-editor-extension-chrome-${{ env.LD_VERSION }}.zip
65+
asset_content_type: application/zip
66+
67+
- name: Upload Firefox Release Asset
68+
id: upload-firefox-release-asset
69+
uses: actions/upload-release-asset@v1
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
with:
73+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
74+
asset_path: ./build/firefox-mv2-prod.zip
75+
asset_name: leetcode-editor-extension-firefox-${{ env.LD_VERSION }}.zip
76+
asset_content_type: application/zip
77+
78+
# - name: Browser Platform Publish
79+
# uses: PlasmoHQ/bpp@v2
80+
# with:
81+
# keys: ${{ secrets.SUBMIT_KEYS }}
82+
# artifact: build/chrome-mv3-prod.zip

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
3+
4+
# dependencies
5+
/node_modules
6+
/.pnp
7+
.pnp.js
8+
9+
# testing
10+
/coverage
11+
12+
#cache
13+
.turbo
14+
15+
# misc
16+
.DS_Store
17+
*.pem
18+
19+
# debug
20+
npm-debug.log*
21+
yarn-debug.log*
22+
yarn-error.log*
23+
.pnpm-debug.log*
24+
25+
# local env files
26+
.env*
27+
28+
out/
29+
build/
30+
dist/
31+
32+
# plasmo - https://www.plasmo.com
33+
.plasmo
34+
35+
# bpp - http://bpp.browser.market/
36+
keys.json
37+
38+
# typescript
39+
.tsbuildinfo

.lessrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"javascriptEnabled": true
3+
}

.prettierrc.cjs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* @type {import('prettier').Options}
3+
*/
4+
module.exports = {
5+
printWidth: 80,
6+
tabWidth: 2,
7+
useTabs: false,
8+
semi: false,
9+
singleQuote: false,
10+
trailingComma: "none",
11+
bracketSpacing: true,
12+
bracketSameLine: true,
13+
plugins: [require.resolve("@plasmohq/prettier-plugin-sort-imports")],
14+
importOrder: ["^@plasmohq/(.*)$", "^~(.*)$", "^[./]"],
15+
importOrderSeparation: true,
16+
importOrderSortSpecifiers: true
17+
}

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Leetcode Editoe Extension
2+
3+
- [English Document](#Installation)
4+
- [中文文档](README_ZH.md)
5+
6+
The Chrmoe plug-in for [Leetcode Editor](https://github.com/shuzijun/leetcode-editor) provides jumping from Leetcode web pages to the IDE editor.
7+
8+
## Installation
9+
10+
1. Install from the Chrome Store
11+
2. Download the file to install
12+
13+
## How to use
14+
15+
1. The [Jetbrains Toolbox App](https://www.jetbrains.com/toolbox-app/) must be installed, and jumping to the IDE from the browser needs to rely on the protocol provided by this application.
16+
2. Install the [Leetcode Editor](https://github.com/shuzijun/leetcode-editor) plugin.
17+
3. Install this plugin and configure it on the selection page.
18+
4. Open the leetcode web page and click the icon to open the editor.
19+
![page](doc/page.png)
20+
21+
## develop
22+
23+
This plugin uses [plasmo](https://github.com/PlasmoHQ/plasmo), please refer to plasmo for related development methods

README_ZH.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Leetcode Editoe Extension
2+
3+
- [English Document](README.md)
4+
- [中文文档](#安装方式)
5+
6+
[Leetcode Editor](https://github.com/shuzijun/leetcode-editor)的Chrmoe插件,提供从力扣网页上跳转到IDE编辑器。
7+
8+
## 安装方式
9+
10+
1. 从Chrome商店安装
11+
2. 下载文件进行安装
12+
13+
## 使用方式
14+
15+
1. 必须安装[Jetbrains Toolbox App](https://www.jetbrains.com/toolbox-app/),从浏览器跳转IDE需要依赖这个应用提供的协议。
16+
2. 安装[Leetcode Editor](https://github.com/shuzijun/leetcode-editor)插件。
17+
3. 安装本插件,并在选择页面进行配置。
18+
4. 打开leetcode网页,点击图标打开编辑器。
19+
![page](doc/page.png)
20+
21+
## 开发
22+
23+
本插件使用[plasmo](https://github.com/PlasmoHQ/plasmo),相关开发方式参考plasmo

assets/icon.png

29.8 KB
Loading

assets/icon.svg

Lines changed: 21 additions & 0 deletions
Loading

doc/page.png

274 KB
Loading

index.d.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
declare namespace NodeJS {
2+
interface ProcessEnv {
3+
PLASMO_PUBLIC_GTAG_ID?: string
4+
}
5+
}
6+
7+
interface Window {
8+
dataLayer: Array
9+
gtag: (a: string, b: any, c?: any) => void
10+
}

locales/en/messages.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"popup": {
3+
"message": "The Leecode Editor Extension works with leecode.com, leetcode.cn, or codetop.cc. Make sure you're on your page.",
4+
"description": "Popup message."
5+
},
6+
"options_desc": {
7+
"message": "This plugin can quickly open the leetcode topic on the web page in the IDE.",
8+
"description": "message."
9+
},
10+
"options_editor_tip": {
11+
"message": "Select the version of the plugin, the IDE needs to install the IDE through the <a href='https://www.jetbrains.com/toolbox-app/'>toolbox</a>, and install the plugin <a href='https://github.com/shuzijun/leetcode-editor'>Leetcode Editor</a>.",
12+
"description": "message."
13+
},
14+
"options_product_tip": {
15+
"message": "Select the corresponding product.",
16+
"description": "message."
17+
},
18+
"options_project_tip": {
19+
"message": "Fill in the ProjectName of the IDE.",
20+
"description": "message."
21+
},
22+
"open_ide": {
23+
"message": "Open IDE",
24+
"description": "message."
25+
}
26+
}

locales/zh/messages.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"popup": {
3+
"message": "Leecode Editor Extension适用于leecode.com、leetcode.cn或codetop.cc。请确保你在页面上.",
4+
"description": "Popup message."
5+
},
6+
"options_desc": {
7+
"message": "本插件可以快速把网页上的leetcode题目在IDE中打开.",
8+
"description": "message."
9+
},
10+
"options_editor_tip": {
11+
"message": "<div>选择插件的版本,IDE需要通过<a href='https://www.jetbrains.com/toolbox-app/'>toolbox</a>安装IDE,并且安装插件<a href='https://github.com/shuzijun/leetcode-editor'>Leetcode Editor</a></div>",
12+
"description": "message."
13+
},
14+
"options_product_tip": {
15+
"message": "选择对应的产品.",
16+
"description": "message."
17+
},
18+
"options_project_tip": {
19+
"message": "填写IDE的ProjectName.",
20+
"description": "message."
21+
},
22+
"open_ide": {
23+
"message": "打开IDE",
24+
"description": "message."
25+
}
26+
}

package.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "leetcode-editor-extension",
3+
"displayName": "Leetcode editor extension",
4+
"version": "0.0.1",
5+
"description": "A basic Plasmo extension.",
6+
"author": "shuzijun",
7+
"scripts": {
8+
"dev": "plasmo dev",
9+
"build": "plasmo build"
10+
},
11+
"dependencies": {
12+
"@jetbrains/logos": "^2.2.7",
13+
"@plasmohq/storage": "^0.12.2",
14+
"antd": "^4.23.5",
15+
"react": "18.2.0",
16+
"react-dom": "18.2.0"
17+
},
18+
"devDependencies": {
19+
"@plasmohq/prettier-plugin-sort-imports": "3.5.4",
20+
"@testing-library/dom": "8.19.0",
21+
"@types/chrome": "0.0.197",
22+
"@types/node": "18.8.3",
23+
"@types/react": "18.0.21",
24+
"@types/react-dom": "18.0.6",
25+
"plasmo": "0.56.1",
26+
"prettier": "2.7.1",
27+
"typescript": "4.8.4"
28+
},
29+
"manifest": {
30+
"default_locale": "en",
31+
"host_permissions": [
32+
"https://leetcode.cn/*",
33+
"https://leetcode.com/*",
34+
"https://codetop.cc/*"
35+
],
36+
"permissions": []
37+
}
38+
}

0 commit comments

Comments
 (0)