Skip to content

Commit

Permalink
feat: init project
Browse files Browse the repository at this point in the history
  • Loading branch information
WindRunnerMax committed Dec 18, 2023
1 parent be689ee commit c35ed26
Show file tree
Hide file tree
Showing 43 changed files with 9,194 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports = {
parserOptions: {
sourceType: "module",
},
extends: ["eslint:recommended", "plugin:prettier/recommended"],
overrides: [
{
files: ["*.ts"],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
extends: ["plugin:@typescript-eslint/recommended"],
},
{
files: ["*.tsx"],
parser: "@typescript-eslint/parser",
plugins: ["react", "react-hooks", "@typescript-eslint/eslint-plugin"],
extends: ["plugin:@typescript-eslint/recommended", "plugin:react-hooks/recommended"],
},
],
env: {
browser: true,
node: true,
commonjs: true,
es2021: true,
},
ignorePatterns: ["node_modules", "build", "dist", "coverage", "public"],
rules: {
// 分号
"semi": "error",
// 对象键值引号样式保持一致
"quote-props": ["error", "consistent-as-needed"],
// 箭头函数允许单参数不带括号
"arrow-parens": ["error", "as-needed"],
// no var
"no-var": "error",
// const
"prefer-const": "error",
// 允许console
"no-console": "off",
// 关闭每个函数都要显式声明返回值
// "@typescript-eslint/explicit-module-boundary-types": "off",
},
};
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# log
*.log

# dependencies
node_modules
.pnp
.pnp.js

# testing
coverage

# production
build
dist

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npm.taobao.org/
17 changes: 17 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
"printWidth": 100, // 指定代码长度,超出换行
"tabWidth": 2, // tab 键的宽度
"useTabs": false, // 不使用tab
"semi": true, // 结尾加上分号
"singleQuote": false, // 使用单引号
"quoteProps": "preserve", // 不要求对象字面量属性是否使用引号包裹
"jsxSingleQuote": false, // jsx 语法中使用单引号
"trailingComma": "es5", // 确保对象的最后一个属性后有逗号
"bracketSpacing": true, // 大括号有空格 { name: 'rose' }
"arrowParens": "avoid", // 箭头函数,单个参数不强制添加括号
"requirePragma": false, // 是否严格按照文件顶部的特殊注释格式化代码
"insertPragma": false, // 是否在格式化的文件顶部插入Pragma标记,以表明该文件被prettier格式化过了
"proseWrap": "preserve", // 按照文件原样折行
"htmlWhitespaceSensitivity": "ignore", // html文件的空格敏感度,控制空格是否影响布局
"endOfLine": "lf" // 结尾是 \n \r \n\r auto
}
26 changes: 26 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
extends: ["stylelint-config-standard", "stylelint-config-sass-guidelines"],
ignoreFiles: [
"**/node_modules/**/*.*",
"**/dist/**/*.*",
"**/build/**/*.*",
"**/coverage/**/*.*",
"**/public/**/*.*",
],
rules: {
"no-descending-specificity": null,
"color-function-notation": null,
"alpha-value-notation": null,
"no-empty-source": null,
"max-nesting-depth": 6,
"selector-max-compound-selectors": 6,
"selector-class-pattern": "^[a-z][a-zA-Z0-9_-]+$",
"selector-id-pattern": "^[a-z][a-zA-Z0-9_-]+$",
"selector-pseudo-class-no-unknown": [
true,
{
"ignorePseudoClasses": ["global"],
},
],
},
};
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"cSpell.words": [
"arcoblue",
"pako",
"pnpm",
"TSON",
"webrtc"
]
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Czy

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
41 changes: 41 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "cv-sketching",
"version": "1.0.0",
"scripts": {
"dev:webrtc": "pnpm --filter file-transfer-webrtc run dev",
"build:webrtc": "pnpm --filter file-transfer-webrtc run build",
"deploy:webrtc": "pnpm --filter file-transfer-webrtc run deploy",
"dev:websocket": "pnpm --filter file-transfer-websocket run dev",
"build:websocket": "pnpm --filter file-transfer-websocket run build",
"deploy:websocket": "pnpm --filter file-transfer-websocket run deploy"
},
"repository": {
"type": "git",
"url": "git+https://github.com/WindrunnerMax/FileTransfer.git"
},
"keywords": [],
"author": "",
"license": "MIT",
"bugs": {
"url": "https://github.com/WindrunnerMax/FileTransfer/issues"
},
"homepage": "https://github.com/WindrunnerMax/FileTransfer",
"dependencies": {},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "6.12.0",
"@typescript-eslint/parser": "6.12.0",
"eslint": "7.32.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.25.3",
"eslint-plugin-prettier": "3.3.1",
"eslint-plugin-react": "7.27.0",
"eslint-plugin-react-hooks": "4.3.0",
"sass": "1.52.3",
"postcss": "8.3.3",
"prettier": "1.13.0",
"stylelint": "14.8.5",
"stylelint-config-sass-guidelines": "9.0.1",
"stylelint-config-standard": "25.0.0",
"typescript": "5.3.2"
}
}
6 changes: 6 additions & 0 deletions packages/core/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
["@babel/preset-env", { targets: { node: "current" } }],
"@babel/preset-typescript",
],
};
14 changes: 14 additions & 0 deletions packages/core/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
moduleFileExtensions: ["js", "ts"],
moduleDirectories: ["node_modules", "src", "test"],
moduleNameMapper: {
"src/(.*)$": "<rootDir>/src/$1",
},
transform: {
"\\.ts$": "ts-jest",
"\\.js$": "babel-jest",
},
transformIgnorePatterns: ["<rootDir>/node_modules/"],
collectCoverage: false,
testMatch: ["<rootDir>/test/**/*.test.ts"],
};
33 changes: 33 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "sketching-core",
"version": "0.0.1",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"sideEffects": false,
"files": [
"dist"
],
"scripts": {
"build": "tsc -p tsconfig.build.json",
"release": "./publish.sh",
"test": "jest"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"sketching-delta": "workspace: *",
"sketching-utils": "workspace: *"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@types/jest": "^29.4.0",
"babel-jest": "^29.4.1",
"csstype": "^3.1.2",
"jest": "^29.4.1",
"ts-jest": "^29.0.5"
}
}
3 changes: 3 additions & 0 deletions packages/core/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
npm version patch --no-git-tag-version
npm run build
npm publish --registry=https://registry.npmjs.org/
1 change: 1 addition & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const PKG = "sketching-core";
5 changes: 5 additions & 0 deletions packages/core/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe("index", () => {
it("base", () => {
expect(true).toEqual(true);
});
});
10 changes: 10 additions & 0 deletions packages/core/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"useTsconfigDeclarationDir": true,
"compilerOptions": {
"baseUrl": ".",
"outDir": "dist",
"declarationDir": "dist",
},
"include": ["src/**/*"]
}
9 changes: 9 additions & 0 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends":"../tsconfig.json",
"compilerOptions": {
"outDir": "./dist"
},
"include": [
"src/**/*"
]
}
3 changes: 3 additions & 0 deletions packages/delta/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [["@babel/preset-env", { targets: { node: "current" } }], "@babel/preset-typescript"],
};
14 changes: 14 additions & 0 deletions packages/delta/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
moduleFileExtensions: ["js", "ts"],
moduleDirectories: ["node_modules", "src", "test"],
moduleNameMapper: {
"src/(.*)$": "<rootDir>/src/$1",
},
transform: {
"\\.ts$": "ts-jest",
"\\.js$": "babel-jest",
},
transformIgnorePatterns: ["<rootDir>/node_modules/"],
collectCoverage: false,
testMatch: ["<rootDir>/test/**/*.test.ts"],
};
32 changes: 32 additions & 0 deletions packages/delta/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"name": "sketching-delta",
"version": "0.0.1",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"sideEffects": false,
"files": [
"dist"
],
"scripts": {
"build": "tsc -p tsconfig.build.json",
"release": "./publish.sh",
"test": "jest"
},
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"sketching-utils": "workspace: *"
},
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/preset-env": "^7.20.2",
"@babel/preset-typescript": "^7.18.6",
"@types/jest": "^29.4.0",
"babel-jest": "^29.4.1",
"jest": "^29.4.1",
"ts-jest": "^29.0.5",
"typescript-transform-paths": "^3.4.6"
}
}
3 changes: 3 additions & 0 deletions packages/delta/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
npm version patch --no-git-tag-version
npm run build
npm publish --registry=https://registry.npmjs.org/
1 change: 1 addition & 0 deletions packages/delta/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const PKG = "cv-delta";
5 changes: 5 additions & 0 deletions packages/delta/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe("index", () => {
it("base", () => {
expect(true).toEqual(true);
});
});
9 changes: 9 additions & 0 deletions packages/delta/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"useTsconfigDeclarationDir": true,
"compilerOptions": {
"outDir": "dist",
"declarationDir": "dist",
},
"include": ["src/**/*"]
}
9 changes: 9 additions & 0 deletions packages/delta/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends":"../tsconfig.json",
"compilerOptions": {
"outDir": "./dist"
},
"include": [
"src/**/*"
]
}
24 changes: 24 additions & 0 deletions packages/plugins/.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?
Loading

0 comments on commit c35ed26

Please sign in to comment.