Skip to content

Commit eea5900

Browse files
feat: add dev tools (#407)
1 parent 8be7ae7 commit eea5900

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1563
-110
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"axios": "^0.26.1",
5050
"codemirror": "^5.65.7",
5151
"codemirror-textmate": "^1.1.0",
52+
"crypto-js": "^4.1.1",
5253
"date-fns": "^2.28.0",
5354
"dom-to-image": "^2.6.0",
5455
"electron-store": "^8.0.1",
@@ -70,8 +71,11 @@
7071
"prettier-plugin-java": "^1.6.1",
7172
"prettier-plugin-sh": "0.8.2",
7273
"prettier-plugin-toml": "^0.3.1",
74+
"query-string": "^8.1.0",
7375
"sanitize-html": "^2.7.0",
7476
"slash": "^3.0.0",
77+
"slugify": "^1.6.6",
78+
"uuid": "^9.0.1",
7579
"vercel-toast": "^1.5.5",
7680
"vue": "^3.2.33",
7781
"vue-router": "^4.0.14",
@@ -82,6 +86,7 @@
8286
"@commitlint/config-conventional": "^15.0.0",
8387
"@tsconfig/node14": "^1.0.1",
8488
"@types/codemirror": "^5.60.5",
89+
"@types/crypto-js": "^4.1.2",
8590
"@types/dom-to-image": "^2.6.4",
8691
"@types/estree": "^0.0.51",
8792
"@types/i18next-fs-backend": "^1.1.2",
@@ -91,6 +96,7 @@
9196
"@types/node": "^17.0.4",
9297
"@types/prettier": "^2.6.0",
9398
"@types/sanitize-html": "^2.6.2",
99+
"@types/uuid": "^9.0.4",
94100
"@types/webpack": "^5.28.0",
95101
"@typescript-eslint/eslint-plugin": "^5.8.0",
96102
"@typescript-eslint/parser": "^5.8.0",

pnpm-lock.yaml

Lines changed: 69 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/menu/main.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const aboutApp = () => {
2929
}
3030

3131
const appMenuCommon: Record<
32-
'preferences' | 'quit' | 'update',
32+
'preferences' | 'quit' | 'update' | 'devtools',
3333
MenuItemConstructorOptions
3434
> = {
3535
preferences: {
@@ -41,6 +41,13 @@ MenuItemConstructorOptions
4141
)
4242
}
4343
},
44+
devtools: {
45+
label: i18n.t('menu:devtools.label') + '...',
46+
accelerator: 'CommandOrControl+.',
47+
click: () => {
48+
BrowserWindow.getFocusedWindow()?.webContents.send('main-menu:devtools')
49+
}
50+
},
4451
update: {
4552
label: i18n.t('menu:app.update.label'),
4653
click: async () => {
@@ -96,6 +103,12 @@ const appMenuMac: MenuItemConstructorOptions[] = [
96103
{
97104
type: 'separator'
98105
},
106+
{
107+
...appMenuCommon.devtools
108+
},
109+
{
110+
type: 'separator'
111+
},
99112
{
100113
label: i18n.t('menu:app.hide'),
101114
role: 'hide'

src/main/services/i18n/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ i18next.use(Backend).init({
1111
fallbackLng: 'en',
1212
lng,
1313
debug: false,
14-
ns: ['common', 'dialog', 'preferences', 'special', 'menu'],
14+
ns: ['common', 'dialog', 'preferences', 'special', 'menu', 'devtools'],
1515
defaultNS: 'common',
1616
initImmediate: false,
1717
preload: readdirSync(join(__dirname, './locales')).filter(fileName => {

src/main/services/i18n/locales/en/common.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
"confirm": "Confirm",
99
"cancel": "Cancel",
1010
"update": ["Go to GitHub", "OK"],
11-
"ok": "OK"
11+
"ok": "OK",
12+
"clear": "Clear",
13+
"copy": "Copy",
14+
"sort": "Sort",
15+
"revers": "Revers",
16+
"generate": "Generate"
1217
},
1318
"newFolder": "New Folder",
1419
"newSnippet": "New Snippet",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"form": {
3+
"inputString": "Input String",
4+
"outputString": "Output String",
5+
"inputUrl": "Input URL",
6+
"outputUrl": "Output URL",
7+
"parsedUrl": "Parsed URL",
8+
"splitQueryString": "Split Query String",
9+
"key": "Key",
10+
"value": "Value",
11+
"component": "Component",
12+
"result": "Result",
13+
"secretKey": "Secret Key",
14+
"algorithm": "Algorithm",
15+
"version": "Version",
16+
"amount": "Amount",
17+
"type": "Type",
18+
"length": "Length",
19+
"options": "Options"
20+
},
21+
"textTools": {
22+
"label": "Text Tools",
23+
"caseConverter": "Case Converter",
24+
"urlParser": "URL Parser",
25+
"slugGenerator": "Slug Generator",
26+
"sortLines": "Sort Lines"
27+
},
28+
"crypto": {
29+
"label": "Cryptography / Security",
30+
"hashGenerator": "Hash Generator",
31+
"hmacGenerator": "HMAC Generator",
32+
"passGenerator": "Password Generator",
33+
"uuidGenerator": "UUID Generator"
34+
},
35+
"encodeDecode": {
36+
"label": "Encoders / Decoders",
37+
"url": "URL Encoder / Decoder",
38+
"base64": "Base64 Encoder / Decoder"
39+
}
40+
}

src/main/services/i18n/locales/en/menu.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,5 +83,8 @@
8383
"label": "History",
8484
"back": "Back",
8585
"forward": "Forward"
86+
},
87+
"devtools": {
88+
"label": "Developer Tools"
8689
}
8790
}

src/main/services/i18n/locales/ru/common.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
"fromSnippetsLab": "Из SnippetsLab",
88
"confirm": "Подтвердить",
99
"cancel": "Отмена",
10-
"ok": "Хорошо"
10+
"ok": "Хорошо",
11+
"clear": "Очистить",
12+
"copy": "Копировать",
13+
"sort": "Сортировать",
14+
"revers": "Реверс",
15+
"generate": "Генерировать"
1116
},
1217
"newFolder": "Новая папка",
1318
"newSnippet": "Новый сниппет",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"form": {
3+
"inputString": "Входная строка",
4+
"outputString": "Выходная строка",
5+
"inputUrl": "Входной URL",
6+
"outputUrl": "Выходной URL",
7+
"parsedUrl": "Разобранный URL",
8+
"splitQueryString": "Разбивка строки запроса",
9+
"key": "Ключ",
10+
"value": "Значение",
11+
"component": "Компонент",
12+
"result": "Результат",
13+
"secretKey": "Секретный ключ",
14+
"algorithm": "Алгоритм",
15+
"version": "Версия",
16+
"amount": "Количество",
17+
"type": "Тип",
18+
"length": "Длина",
19+
"options": "Опции"
20+
},
21+
"textTools": {
22+
"label": "Инструменты для текста",
23+
"caseConverter": "Конвертер регистра",
24+
"urlParser": "Парсер URL",
25+
"slugGenerator": "Slug генератор",
26+
"sortLines": "Сортировка строк"
27+
},
28+
"crypto": {
29+
"label": "Криптография / Безопасность",
30+
"hashGenerator": "Hash генератор",
31+
"hmacGenerator": "HMAC генератор",
32+
"passGenerator": "Генератор паролей",
33+
"uuidGenerator": "UUID генератор"
34+
},
35+
"encodeDecode": {
36+
"label": "Энкодеры / Декодеры",
37+
"url": "URL Энкодер / Декодер",
38+
"base64": "Base64 Энкодер / Декодер"
39+
}
40+
}

src/renderer/App.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ ipc.on('main-menu:preferences', () => {
190190
router.push('/preferences')
191191
})
192192
193+
ipc.on('main-menu:devtools', () => {
194+
router.push('/devtools')
195+
})
196+
193197
ipc.on('main-menu:new-folder', async () => {
194198
await onAddNewFolder()
195199
})

0 commit comments

Comments
 (0)