chore: 初始化项目基础配置

- 添加 .prettierrc 配置文件,设置代码格式化规则
- 创建各 packages 目录下的 README.md 文档
- 配置 tsconfig.json TypeScript 编译选项
- 设置 rollup.config.js 打包配置
- 添加 .gitignore 忽略文件配置
- 安装 prettier 依赖
This commit is contained in:
dj
2026-02-02 18:07:30 +08:00
commit a5bd4d728b
21 changed files with 138 additions and 0 deletions

15
.gitignore vendored Normal file
View 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
View File

@@ -0,0 +1,7 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 80,
"trailingComma": "none",
"arrowParens": "avoid"
}

9
README.md Normal file
View File

@@ -0,0 +1,9 @@
# .prettierrc
{
"semi": false,// 结尾无分号
"singleQuote": true,// 单引号
"printWidth": 80,// 每行长度为80
"trailingComma": "none",// 不添加尾随逗号
"arrowParens": "avoid"// 省略箭头函数的括号
}

32
package-lock.json generated Normal file
View 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
View 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"
}
}

View File

@@ -0,0 +1,2 @@
# compiler-core
编辑器核心

View File

View File

@@ -0,0 +1,2 @@
# compiler-dom
浏览器部分编辑器模块

View File

View File

@@ -0,0 +1,2 @@
# reactivity
响应性

View File

@@ -0,0 +1 @@
let msg = '测试'

View File

@@ -0,0 +1,2 @@
# runtime-core
运行时核心

View File

View File

@@ -0,0 +1,3 @@
# runtime-dom
浏览器部分运行时模块

View File

View File

@@ -0,0 +1,2 @@
# shared
公共方法

View File

2
packages/vue/README.md Normal file
View File

@@ -0,0 +1,2 @@
# vue
打包, 测试实例, 项目入口, 导出

View File

1
rollup.config.js Normal file
View File

@@ -0,0 +1 @@
export default [{}]

43
tsconfig.json Normal file
View 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"
]
}