Skip to content

Commit

Permalink
Merge pull request #82 from caorushizi/dev/i18n
Browse files Browse the repository at this point in the history
feat: display language
  • Loading branch information
caorushizi authored Feb 9, 2024
2 parents 9b62b8a + 606aab6 commit ad648b7
Show file tree
Hide file tree
Showing 67 changed files with 6,387 additions and 856 deletions.
9 changes: 9 additions & 0 deletions .cspell/custom-words.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
behaviour
Byelide
commitlint
conventionalcommits
optimizelegibility
pinia
tiptap
vuedraggable
vuejs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules
.idea
.parcel-cache
.vitepress
*.tsno.mjs
5 changes: 5 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
npm run commitlint ${1}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

pnpm exec tsno run ./scripts/pre-commit.ts
91 changes: 91 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
// eslint-disable-next-line no-undef
module.exports = {
extends: ['@commitlint/config-conventional'], // extends can be nested
parserPreset: 'conventional-changelog-conventionalcommits',
prompt: {
settings: {},
messages: {
skip: ':skip',
max: 'upper %d chars',
min: '%d chars at least',
emptyWarning: 'can not be empty',
upperLimitWarning: 'over limit',
lowerLimitWarning: 'below limit'
},
types: [
{ value: 'feat', name: 'feat: ✨ A new feature', emoji: '✨ ' },
{ value: 'fix', name: 'fix: 🐛 A bug fix', emoji: '🐛 ' },
{ value: 'docs', name: 'docs: 📝 Documentation only changes', emoji: '📝 ' },
{
value: 'style',
name: 'style: 💄 Changes that do not affect the meaning of the code',
emoji: '💄 '
},
{
value: 'refactor',
name: 'refactor: 📦️ A code change that neither fixes a bug nor adds a feature',
emoji: '📦️ '
},
{
value: 'perf',
name: 'perf: 🚀 A code change that improves performance',
emoji: '🚀 '
},
{
value: 'test',
name: 'test: 🚨 Adding missing tests or correcting existing tests',
emoji: '🚨 '
},
{
value: 'build',
name: 'build: 🛠 Changes that affect the build system or external dependencies',
emoji: '🛠 '
},
{
value: 'ci',
name: 'ci: 🎡 Changes to our CI configuration files and scripts',
emoji: '🎡 '
},
{
value: 'chore',
name: "chore: 🔨 Other changes that don't modify src or test files",
emoji: '🔨 '
},
{ value: 'revert', name: 'revert: ⏪️ Reverts a previous commit', emoji: ':rewind:' }
],
useEmoji: true,
confirmColorize: true,
emojiAlign: 'center',
questions: {
scope: {
description: 'What is the scope of this change (e.g. component or file name)'
},
subject: {
description: 'Write a short, imperative tense description of the change'
},
body: {
description: 'Provide a longer description of the change'
},
isBreaking: {
description: 'Are there any breaking changes?'
},
breakingBody: {
description:
'A BREAKING CHANGE commit requires a body. Please enter a longer description of the commit itself'
},
breaking: {
description: 'Describe the breaking changes'
},
isIssueAffected: {
description: 'Does this change affect any open issues?'
},
issuesBody: {
description:
'If issues are closed, the commit requires a body. Please enter a longer description of the commit itself'
},
issues: {
description: 'Add issue references (e.g. "fix #123", "re #123".)'
}
}
}
}
23 changes: 23 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"import": [
"@cspell/dict-lorem-ipsum/cspell-ext.json"
],
"caseSensitive": false,
"dictionaries": [
"custom-words"
],
"dictionaryDefinitions": [
{
"name": "custom-words",
"path": "./.cspell/custom-words.txt",
"addWords": true
}
],
"ignorePaths": [
"**/node_modules/**",
"**/dist/**",
"**/lib/**",
"**/docs/**",
"**/stats.html"
]
}
26 changes: 22 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "electron-template",
"main": "index.js",
"scripts": {
"dev": "zx scripts/dev.mjs && pnpm --parallel -F \"./packages/*\" run dev",
"build": "zx scripts/build.mjs",
"dev": "tsno run scripts/dev.ts && pnpm --parallel -F \"./packages/*\" run dev",
"build": "tsno run scripts/build.ts",
"build:mobile": "pnpm -F mobile run build",
"build:plugin": "pnpm -F plugin run build",
"build:main": "pnpm -F main run build",
Expand All @@ -16,7 +16,11 @@
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs",
"types": "pnpm -F main run types"
"types": "pnpm -F main run types",
"prepare": "husky",
"commit": "git-cz",
"commitlint": "commitlint --edit",
"spellcheck": "cspell lint --dot --gitignore --color --cache --show-suggestions \"src/**/*.@(html|js|cjs|mjs|ts|tsx|css|scss|md|vue)\""
},
"keywords": [],
"author": "",
Expand All @@ -26,11 +30,25 @@
"@cliqz/[email protected]": "patches/@[email protected]"
}
},
"config": {
"commitizen": {
"path": "node_modules/cz-git"
}
},
"devDependencies": {
"@commitlint/cli": "^18.6.0",
"@commitlint/config-conventional": "^18.6.0",
"@commitlint/cz-commitlint": "^18.6.0",
"@waline/client": "^2.15.8",
"commitizen": "^4.3.0",
"cross-env": "^7.0.3",
"cspell": "^8.3.2",
"cz-git": "^1.8.0",
"husky": "^9.0.10",
"lint-staged": "^15.2.2",
"tsno": "^2.0.0",
"vitepress": "1.0.0-beta.3",
"vue": "^3.4.15",
"zx": "^7.2.3"
}
}
}
18 changes: 0 additions & 18 deletions packages/main/plugin/.eslintrc.cjs

This file was deleted.

30 changes: 0 additions & 30 deletions packages/main/plugin/package.json

This file was deleted.

73 changes: 0 additions & 73 deletions packages/main/plugin/src/App.tsx

This file was deleted.

Empty file.
19 changes: 0 additions & 19 deletions packages/main/plugin/src/main.tsx

This file was deleted.

11 changes: 0 additions & 11 deletions packages/main/plugin/src/types.ts

This file was deleted.

10 changes: 0 additions & 10 deletions packages/main/scripts/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import * as esbuild from "esbuild";
import chokidar from "chokidar";
import { loadDotEnvRuntime, mainResolve, log, copyResource } from "./utils";
import { external } from "./config";
import { build } from "vite";
import path from "path";

let electronProcess: ChildProcessWithoutNullStreams | null = null;

Expand Down Expand Up @@ -88,14 +86,6 @@ async function start() {
restartElectron();
});

const pluginRoot = path.resolve(__dirname, "../plugin");
const watcher2 = chokidar.watch(pluginRoot);
watcher2.on("change", async () => {
console.log("plugin changed");
await build({ root: pluginRoot });
restartElectron();
});

try {
await mainContext.rebuild();
await preloadContext.rebuild();
Expand Down
Loading

0 comments on commit ad648b7

Please sign in to comment.