Skip to content

Commit

Permalink
refactor: commit delete files
Browse files Browse the repository at this point in the history
  • Loading branch information
likun7981 committed Jun 6, 2022
1 parent aeb81ca commit accdabb
Show file tree
Hide file tree
Showing 59 changed files with 5,359 additions and 3,803 deletions.
20 changes: 17 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,23 @@
{
"extends": "standard-with-typescript",
"extends": [
"eslint:recommended",
"plugin:node/recommended",
"plugin:@typescript-eslint/recommended"
],
"plugins": ["import"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": ["./tsconfig.json"]
"sourceType": "module",
"ecmaVersion": 2021
},
"globals": {
"module": true
},
"rules": {
"@typescript-eslint/no-misused-promises": false
"node/no-missing-import": [0],
"no-process-exit": 0,
"node/no-unsupported-features/es-syntax": 0,
"node/no-unpublished-import": 0,
"@typescript-eslint/no-empty-function": 0
}
}
21 changes: 16 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
node_modules
/destDir**
/lib/
destDir**
lib/
destDir*
/.hlink
/hlink
sourceDir1
.hlink

/docs/.vitepress/dist
.DS_Store

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

dist
dist-ssr
*.local
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx commitlint --edit "$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"

npx lint-staged
19 changes: 2 additions & 17 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
{
"cSpell.words": [
"Extname",
"hlink"
],
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/.classpath": true,
"**/.project": true,
"**/.settings": true,
"**/.factorypath": true,
"**/node_modules": false
}
"cSpell.words": ["Extname", "hlink"],
"eslint.workingDirectories": ["packages/hlink", "packages/hlink-app"]
}
20 changes: 1 addition & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
#### v0.2.4
> 20201223
- __修复__: 保存相同源地址创建记录时报错的问题

#### v0.2.2
> 20201209
- __新增__:删除采用ui交互方式,不用担心创建的硬链目录记不住, 如果你是通过 `hlink` 创建的硬链,创建记录会被记录,可以使用 `hlink -d` 进行ui交互删除
![deleteUI](./media/deleteUi.png)
- __新增__:默认连接的文件后缀包含有了"mp4", "flv", "f4v", "webm", "m4v", "mov", "cpk", "dirac", "3gp", "3g2", "rm", "rmvb", "wmv", "avi", "asf", "mpg", "mpeg", "mpe", "vob", "mkv","ram", "qt", "fli", "flc", "mod", "iso"
- __修复__: 文件后缀大小写问题
- __修复__:创建的硬链被改名时,无法检测到,导致重复创建的问题

#### v0.2.1
> 20201212
- __修复__: 隐藏文件夹跳过处理


#### 20201216
- __优化__: 优化交互式删除二级目录选择步骤
[releases](https://github.com/likun7981/hlink/releases)
27 changes: 27 additions & 0 deletions commitlint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
rules: {
'type-case': [2, 'always', 'lower-case'],
'type-empty': [2, 'never'],
'type-enum': [
2,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
],
],
'subject-empty': [2, 'never'],
'header-max-length': [2, 'always', 88],
'body-leading-blank': [1, 'always'],
'body-max-line-length': [2, 'always', 88],
},
}
47 changes: 12 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "hlink",
"name": "hlink-monorepo",
"version": "1.0.0",
"description": "hlink",
"license": "MIT",
Expand All @@ -16,40 +16,11 @@
"node": ">=14.16"
},
"scripts": {
"test": "xo && ava",
"dev": "npm run clean && tsc && npm run env && tsc -w",
"clean": "rm -rf lib",
"cp": "cp src/hlink.config.tpl lib/hlink.config.tpl",
"build": "npm run clean && tsc && npm run cp",
"prepublishOnly": "npm run build",
"env": "rm /usr/local/bin/hlink && ln -s $PWD/lib/cli-dev.js /usr/local/bin/hlink && chmod +x ./lib/cli-dev.js",
"np": "np --no-cleanup --no-tests --no-yarn",
"np:beta": "np --tag=beta --any-branch --no-cleanup --no-tests --no-yarn",
"np:next": "np --tag=next --any-branch --no-cleanup --no-tests --no-yarn",
"build": "pnpm -r --filter=./packages/* run build",
"docs:dev": "vitepress dev docs",
"docs:build": "vitepress build docs"
},
"files": [
"lib"
],
"keywords": [
"cli",
"cli-app",
"unicorn",
"fun"
],
"dependencies": {
"@inquirer/confirm": "0.0.19-alpha.0",
"@types/update-notifier": "^5.1.0",
"ansi-escapes": "^5.0.0",
"chalk": "^5",
"chokidar": "^3.5.3",
"execa": "^6",
"fs-extra": "^10",
"meow": "^10.1.2",
"progress": "^2.0.3",
"update-notifier": "^5.1.0",
"wrap-ansi": "^8.0.1"
"docs:build": "vitepress build docs",
"prepare": "husky install",
"lint": "eslint --fix packages/**/*.{ts,tsx}"
},
"devDependencies": {
"@types/fs-extra": "^9.0.13",
Expand All @@ -59,15 +30,21 @@
"@typescript-eslint/eslint-plugin": "^5",
"@typescript-eslint/parser": "^5",
"ava": "^4",
"commitlint": "^17.0.2",
"eslint": "^8",
"eslint-config-standard-with-typescript": "^21.0.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.3.1",
"husky": "^8.0.0",
"np": "^7.6.1",
"prettier": "^2.6.2",
"typescript": "^4.6.4",
"vitepress": "^0.22.4",
"vue": "^3.2.36",
"xo": "^0.24.0"
},
"lint-staged": {
"*": "prettier -wu",
"packages/**/*.{ts,tsx}": "eslint --fix"
}
}
24 changes: 24 additions & 0 deletions packages/hlink-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
13 changes: 13 additions & 0 deletions packages/hlink-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/src/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
21 changes: 21 additions & 0 deletions packages/hlink-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "hlink-app",
"private": true,
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"preview": "vite preview",
"preinstall": "npx only-allow pnpm"
},
"dependencies": {
"react": "^18.0.0",
"react-dom": "^18.0.0"
},
"devDependencies": {
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^1.3.0",
"vite": "^2.9.9"
}
}
42 changes: 42 additions & 0 deletions packages/hlink-app/src/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.App {
text-align: center;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

button {
font-size: calc(10px + 2vmin);
}
45 changes: 45 additions & 0 deletions packages/hlink-app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { useState } from 'react'
import logo from './logo.svg'
import './App.css'

function App() {
const [count, setCount] = useState(0)

return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>Hello Vite + React!</p>
<p>
<button type="button" onClick={() => setCount((count) => count + 1)}>
count is: {count}
</button>
</p>
<p>
Edit <code>App.tsx</code> and save to test HMR updates.
</p>
<p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
{' | '}
<a
className="App-link"
href="https://vitejs.dev/guide/features.html"
target="_blank"
rel="noopener noreferrer"
>
Vite Docs
</a>
</p>
</header>
</div>
)
}

export default App
15 changes: 15 additions & 0 deletions packages/hlink-app/src/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions packages/hlink-app/src/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
7 changes: 7 additions & 0 deletions packages/hlink-app/src/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit accdabb

Please sign in to comment.