-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d5d1ef9
commit 9d1a0b0
Showing
10 changed files
with
261 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"version": "0.0.1", | ||
"name": "@pictode/form", | ||
"sideEffects": [ | ||
"dist/*", | ||
"src/theme/*" | ||
], | ||
"main": "dist/pictode-form.umd.js", | ||
"module": "dist/pictode-form.mjs", | ||
"style": "dist/style.css", | ||
"types": "types/index.d.ts", | ||
"exports": { | ||
".": { | ||
"import": "./dist/pictode-form.mjs", | ||
"require": "./dist/pictode-form.umd.js" | ||
}, | ||
"./dist/style.css": { | ||
"import": "./dist/style.css", | ||
"require": "./dist/style.css" | ||
}, | ||
"./*": "./*" | ||
}, | ||
"scripts": { | ||
"build": "npm run build:type && vite build", | ||
"build:type": "npm run clear:type && vue-tsc --declaration --emitDeclarationOnly --project tsconfig.build.json", | ||
"clear:type": "rimraf ./types" | ||
}, | ||
"dependencies": { | ||
"@element-plus/icons-vue": "^2.1.0", | ||
"@pictode/utils": "workspace:^0.0.1", | ||
"element-plus": "^2.2.28", | ||
"vue": "^3.3.4" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.18.0", | ||
"@types/lodash-es": "^4.17.4", | ||
"@types/node": "^15.12.4", | ||
"@types/sortablejs": "^1.10.7", | ||
"@vitejs/plugin-vue": "^4.2.3", | ||
"@vue/compiler-sfc": "^3.2.37", | ||
"rimraf": "^3.0.2", | ||
"sass": "^1.35.1", | ||
"typescript": "^5.0.2", | ||
"vite": "^4.4.5", | ||
"vue-tsc": "^1.8.5" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { InjectionKey } from 'vue'; | ||
|
||
import { RadioCtx } from '@/types'; | ||
|
||
export const RadioCtxKey: InjectionKey<RadioCtx<unknown>> = Symbol('RadioCtx'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<script setup lang="ts"> | ||
import { ElForm } from 'element-plus'; | ||
</script> | ||
|
||
<template> | ||
<ElForm></ElForm> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export default {}; |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"baseUrl": ".", | ||
"declaration": true, | ||
"declarationDir": "types", | ||
"forceConsistentCasingInFileNames": true, | ||
"paths": {} | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"baseUrl": "../.." | ||
}, | ||
"exclude": ["**/dist/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import path from 'path'; | ||
|
||
import { defineConfig } from 'vite'; | ||
import vue from '@vitejs/plugin-vue'; | ||
|
||
import pkg from './package.json'; | ||
|
||
export default defineConfig({ | ||
plugins: [vue()], | ||
|
||
resolve: { | ||
alias: | ||
process.env.NODE_ENV === 'production' | ||
? [] | ||
: [{ find: /^@pictode\/utils/, replacement: path.join(__dirname, '../utils/src/index.ts') }], | ||
}, | ||
|
||
build: { | ||
cssCodeSplit: false, | ||
sourcemap: true, | ||
minify: false, | ||
target: 'esnext', | ||
|
||
lib: { | ||
entry: 'src/index.ts', | ||
name: 'PictodeForm', | ||
fileName: 'pictode-form', | ||
}, | ||
|
||
rollupOptions: { | ||
// 确保外部化处理那些你不想打包进库的依赖 | ||
external(id: string) { | ||
return ( | ||
/^vue/.test(id) || | ||
/^element-plus/.test(id) || | ||
/^@edoms\//.test(id) || | ||
Object.keys(pkg.dependencies).some((k) => new RegExp(`^${k}`).test(id)) | ||
); | ||
}, | ||
|
||
output: { | ||
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量 | ||
globals: { | ||
vue: 'Vue', | ||
'element-plus': 'ElementPlus', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.