chore: 初始化项目基础配置
- 添加 .prettierrc 配置文件,设置代码格式化规则 - 创建各 packages 目录下的 README.md 文档 - 配置 tsconfig.json TypeScript 编译选项 - 设置 rollup.config.js 打包配置 - 添加 .gitignore 忽略文件配置 - 安装 prettier 依赖
This commit is contained in:
15
.gitignore
vendored
Normal file
15
.gitignore
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
|
||||||
|
|
||||||
|
# Editor directories and files
|
||||||
|
.idea
|
||||||
7
.prettierrc
Normal file
7
.prettierrc
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
"semi": false,
|
||||||
|
"singleQuote": true,
|
||||||
|
"printWidth": 80,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"arrowParens": "avoid"
|
||||||
|
}
|
||||||
9
README.md
Normal file
9
README.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
# .prettierrc
|
||||||
|
|
||||||
|
{
|
||||||
|
"semi": false,// 结尾无分号
|
||||||
|
"singleQuote": true,// 单引号
|
||||||
|
"printWidth": 80,// 每行长度为80
|
||||||
|
"trailingComma": "none",// 不添加尾随逗号
|
||||||
|
"arrowParens": "avoid"// 省略箭头函数的括号
|
||||||
|
}
|
||||||
32
package-lock.json
generated
Normal file
32
package-lock.json
generated
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"name": "vue-core-mini",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"lockfileVersion": 3,
|
||||||
|
"requires": true,
|
||||||
|
"packages": {
|
||||||
|
"": {
|
||||||
|
"name": "vue-core-mini",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"license": "ISC",
|
||||||
|
"devDependencies": {
|
||||||
|
"prettier": "^3.8.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/prettier": {
|
||||||
|
"version": "3.8.1",
|
||||||
|
"resolved": "https://registry.npmmirror.com/prettier/-/prettier-3.8.1.tgz",
|
||||||
|
"integrity": "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"bin": {
|
||||||
|
"prettier": "bin/prettier.cjs"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/prettier/prettier?sponsor=1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
package.json
Normal file
15
package.json
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"name": "vue-core-mini",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"keywords": [],
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"description": "",
|
||||||
|
"devDependencies": {
|
||||||
|
"prettier": "^3.8.1"
|
||||||
|
}
|
||||||
|
}
|
||||||
2
packages/compiler-core/README.md
Normal file
2
packages/compiler-core/README.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# compiler-core
|
||||||
|
编辑器核心
|
||||||
0
packages/compiler-core/src/index.ts
Normal file
0
packages/compiler-core/src/index.ts
Normal file
2
packages/compiler-dom/README.md
Normal file
2
packages/compiler-dom/README.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# compiler-dom
|
||||||
|
浏览器部分编辑器模块
|
||||||
0
packages/compiler-dom/src/index.ts
Normal file
0
packages/compiler-dom/src/index.ts
Normal file
2
packages/reactivity/README.md
Normal file
2
packages/reactivity/README.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# reactivity
|
||||||
|
响应性
|
||||||
1
packages/reactivity/src/index.ts
Normal file
1
packages/reactivity/src/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
let msg = '测试'
|
||||||
2
packages/runtime-core/README.md
Normal file
2
packages/runtime-core/README.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# runtime-core
|
||||||
|
运行时核心
|
||||||
0
packages/runtime-core/src/index.ts
Normal file
0
packages/runtime-core/src/index.ts
Normal file
3
packages/runtime-dom/README.md
Normal file
3
packages/runtime-dom/README.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# runtime-dom
|
||||||
|
|
||||||
|
浏览器部分运行时模块
|
||||||
0
packages/runtime-dom/src/index.ts
Normal file
0
packages/runtime-dom/src/index.ts
Normal file
2
packages/shared/README.md
Normal file
2
packages/shared/README.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# shared
|
||||||
|
公共方法
|
||||||
0
packages/shared/src/index.ts
Normal file
0
packages/shared/src/index.ts
Normal file
2
packages/vue/README.md
Normal file
2
packages/vue/README.md
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# vue
|
||||||
|
打包, 测试实例, 项目入口, 导出
|
||||||
0
packages/vue/src/index.ts
Normal file
0
packages/vue/src/index.ts
Normal file
1
rollup.config.js
Normal file
1
rollup.config.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export default [{}]
|
||||||
43
tsconfig.json
Normal file
43
tsconfig.json
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
// https://www.typescriptlang.org/tsconfig,也可以使用 tsc -init 生成默认的 tsconfig.json 文件进行属性查找
|
||||||
|
{
|
||||||
|
// 编辑器配置
|
||||||
|
"compilerOptions": {
|
||||||
|
// 根目录
|
||||||
|
"rootDir": ".",
|
||||||
|
// 严格模式标志
|
||||||
|
"strict": true,
|
||||||
|
// 指定类型脚本如何从给定的模块说明符查找文件。
|
||||||
|
"moduleResolution": "node",
|
||||||
|
// https://www.typescriptlang.org/tsconfig#esModuleInterop
|
||||||
|
"esModuleInterop": true,
|
||||||
|
// JS 语言版本
|
||||||
|
"target": "es5",
|
||||||
|
// 允许未读取局部变量
|
||||||
|
"noUnusedLocals": false,
|
||||||
|
// 允许未读取的参数
|
||||||
|
"noUnusedParameters": false,
|
||||||
|
// 允许解析 json
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
// 支持语法迭代:https://www.typescriptlang.org/tsconfig#downlevelIteration
|
||||||
|
"downlevelIteration": true,
|
||||||
|
// 允许使用隐式的 any 类型(这样有助于我们简化 ts 的复杂度,从而更加专注于逻辑本身)
|
||||||
|
"noImplicitAny": false,
|
||||||
|
// 模块化
|
||||||
|
"module": "esnext",
|
||||||
|
// 转换为 JavaScript 时从 TypeScript 文件中删除所有注释。
|
||||||
|
"removeComments": false,
|
||||||
|
// 禁用 sourceMap
|
||||||
|
"sourceMap": false,
|
||||||
|
// https://www.typescriptlang.org/tsconfig#lib
|
||||||
|
"lib": ["esnext", "dom"],
|
||||||
|
// 设置快捷导入
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"@vue/*": ["packages/*/src"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 入口
|
||||||
|
"include": [
|
||||||
|
"packages/*/src"
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user