Skip to content

Commit

Permalink
feat: init
Browse files Browse the repository at this point in the history
  • Loading branch information
nigiwen committed May 8, 2024
1 parent 689a14f commit d5e1746
Show file tree
Hide file tree
Showing 29 changed files with 5,996 additions and 3,979 deletions.
15 changes: 15 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
# 忽略工作区根目录检查,允许在工作区的任何地方安装依赖项
ignore-workspace-root-check=true

# 在安装依赖项时将它们的依赖关系移动到更高的位置,以减少安装包的嵌套层级
shamefully-hoist=true

# 是否启用严格的对等依赖检查,如果设置为 false,将允许依赖项的版本范围不完全匹配
strict-peer-dependencies=false

# 在安装依赖项时自动安装对等依赖项
auto-install-peers=true

# 启用 shell 模拟器,模拟终端操作以执行命令
shell-emulator=true

# 是否启用包管理器的严格模式,如果设置为 false,将允许一些不符合规范的行为
package-manager-strict=false
1 change: 0 additions & 1 deletion CONTRIBUTING.md

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 Anthony Fu <https://github.com/antfu>
Copyright (c) 2022 Nigi Wen <https://github.com/wen403>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# nigi-element-plus
# nigi-element-formily

[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
Expand All @@ -9,21 +9,21 @@
This is a formily element plus framework

> **Note**:
> Replace `nigi-element-plus`, `This is a formily element plus framework` and `wen403` globally to use this template.
> Replace `nigi-element-formily`, `This is a formily element plus framework` and `wen403` globally to use this template.
## License

[MIT](./LICENSE) License © 2023-PRESENT [nigi wen](https://github.com/wen403)

<!-- Badges -->

[npm-version-src]: https://img.shields.io/npm/v/nigi-element-plus?style=flat&colorA=080f12&colorB=1fa669
[npm-version-href]: https://npmjs.com/package/nigi-element-plus
[npm-downloads-src]: https://img.shields.io/npm/dm/nigi-element-plus?style=flat&colorA=080f12&colorB=1fa669
[npm-downloads-href]: https://npmjs.com/package/nigi-element-plus
[bundle-src]: https://img.shields.io/bundlephobia/minzip/nigi-element-plus?style=flat&colorA=080f12&colorB=1fa669&label=minzip
[bundle-href]: https://bundlephobia.com/result?p=nigi-element-plus
[license-src]: https://img.shields.io/github/license/wen403/nigi-element-plus.svg?style=flat&colorA=080f12&colorB=1fa669
[license-href]: https://github.com/wen403/nigi-element-plus/blob/main/LICENSE
[npm-version-src]: https://img.shields.io/npm/v/nigi-element-formily?style=flat&colorA=080f12&colorB=1fa669
[npm-version-href]: https://npmjs.com/package/nigi-element-formily
[npm-downloads-src]: https://img.shields.io/npm/dm/nigi-element-formily?style=flat&colorA=080f12&colorB=1fa669
[npm-downloads-href]: https://npmjs.com/package/nigi-element-formily
[bundle-src]: https://img.shields.io/bundlephobia/minzip/nigi-element-formily?style=flat&colorA=080f12&colorB=1fa669&label=minzip
[bundle-href]: https://bundlephobia.com/result?p=nigi-element-formily
[license-src]: https://img.shields.io/github/license/wen403/nigi-element-formily.svg?style=flat&colorA=080f12&colorB=1fa669
[license-href]: https://github.com/wen403/nigi-element-formily/blob/main/LICENSE
[jsdocs-src]: https://img.shields.io/badge/jsdocs-reference-080f12?style=flat&colorA=080f12&colorB=1fa669
[jsdocs-href]: https://www.jsdocs.io/package/nigi-element-plus
[jsdocs-href]: https://www.jsdocs.io/package/nigi-element-formily
12 changes: 0 additions & 12 deletions build.config.ts

This file was deleted.

1 change: 0 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
.vitepress/cache/
.vitepress/dist/
public/user-avatars
node_modules
8 changes: 4 additions & 4 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ md.use(await Shiki({

const ogUrl = '//'
const ogImage = `${ogUrl}og.png#1`
const title = 'ElemFormily'
const title = 'Element Formily'
const description = '使用 Element Plus 结合 Formily 的 UI 框架'

const Guides: DefaultTheme.NavItemWithLink[] = [
Expand Down Expand Up @@ -49,11 +49,11 @@ const Nav: DefaultTheme.NavItem[] = [
items: [
{
text: 'Release Notes',
link: 'https://github.com/wen403/nigi-element-plus/releases',
link: 'https://github.com/wen403/nigi-element-formily/releases',
},
{
text: 'Contributing',
link: 'https://github.com/unocss/nigi-element-plus/blob/main/CONTRIBUTING.md',
link: 'https://github.com/unocss/nigi-element-formily/blob/main/CONTRIBUTING.md',
},
],
},
Expand Down Expand Up @@ -158,7 +158,7 @@ export default defineConfig({
text: 'Suggest changes to this page',
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/wen403/nigi-element-plus' },
{ icon: 'github', link: 'https://github.com/wen403/nigi-element-formily' },
],
footer: {
message: '基于 MIT 许可发布',
Expand Down
17 changes: 7 additions & 10 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
---
layout: home
title: "ElemFormily 是 结合 Formily 和 Element Plus 的 UI 框架"
title: "Element Formily 是 结合 Formily 和 Element Plus 的 UI 框架"

hero:
image:
src: /logo.svg
alt: ElemFormily
name: "ElemFormily"
text: 使用 Element Plus 结合 Formily 的 UI 框架
tagline: 写最少的代码,实现最优雅的组件
alt: Element Formily
name: "Element Formily"
text: 快捷简单搭建 Form
tagline: 使用 Json 生成表单
actions:
- theme: brand
text: 快速上手
link: /component/
- theme: alt
text: 什么是Formily?
text: 什么是 Formily?
link: https://formilyjs.org/zh-CN
target: _blank
- theme: alt
text: 什么是Element Plus?
link: https://element-plus.org/zh-CN

features:
- icon: <span class="i-carbon:ibm-toolchain"></span>
Expand All @@ -29,7 +26,7 @@ features:
linkText: 入门
- icon: <span class="i-carbon-meter-alt"></span>
title: 组件众多
details: 内置有Element Plus的表单组件,和一些新组件。
details: 内置 Element Plus 表单组件,和一些新组件。
- icon: <span class="i-carbon-wind-gusts"></span>
title: 非常专业
details: "完备,灵活,优雅。"
Expand Down
13 changes: 0 additions & 13 deletions docs/uno.config.ts

This file was deleted.

65 changes: 16 additions & 49 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,71 +1,36 @@
{
"name": "nigi-element-plus",
"name": "@nigi-element-formily/monorepo",
"type": "module",
"version": "0.0.1",
"packageManager": "[email protected]",
"description": "This is a formily element plus framework",
"author": "Nigi Wen <[email protected]>",
"license": "MIT",
"funding": "https://github.com/sponsors/wen403",
"homepage": "https://github.com/wen403/nigi-element-plus#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/wen403/nigi-element-plus.git"
},
"workspaces": [
"docs"
],
"bugs": "https://github.com/wen403/nigi-element-plus/issues",
"keywords": [
"vue3",
"element-plus",
"formily",
"form"
],
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.mjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"*": [
"./dist/*",
"./dist/index.d.ts"
]
}
},
"files": [
"dist"
],
"private": true,
"packageManager": "[email protected]",
"scripts": {
"build": "pnpm run docs:build",
"dev": "unbuild --stub",
"play": "pnpm -C playground run dev",
"docs": "pnpm -C docs run dev",
"lint": "eslint --cache .",
"lint:fix": "nr lint --fix",
"release": "bumpp -r",
"test": "vitest",
"typecheck": "tsc --noEmit",
"docs": "pnpm -C docs run dev",
"docs:build": "pnpm -C docs run build",
"docs:preview": "pnpm run -C docs preview",
"prepare": "simple-git-hooks"
},
"peerDependencies": {
"vue": "^3.4.25"
},
"devDependencies": {
"@antfu/eslint-config": "^2.14.0",
"@antfu/ni": "^0.21.12",
"@antfu/utils": "^0.7.7",
"@element-plus/icons-vue": "^2.3.1",
"@nigi-element-formily/element-plus": "workspace:*",
"@shikijs/vitepress-twoslash": "^1.3.0",
"@types/node": "^20.12.7",
"@unocss/eslint-config": "^0.59.4",
"@unocss/eslint-plugin": "^0.59.4",
"@unocss/reset": "^0.59.4",
"@vitejs/plugin-vue": "^5.0.4",
"@vueuse/core": "^10.9.0",
"@vueuse/math": "^10.9.0",
"bumpp": "^9.4.0",
"element-plus": "^2.7.2",
"eslint": "^9.0.0",
Expand All @@ -78,14 +43,16 @@
"rimraf": "^5.0.5",
"sass": "^1.75.0",
"simple-git-hooks": "^2.11.1",
"splitpanes": "^3.1.5",
"typescript": "^5.4.5",
"unbuild": "^2.0.0",
"unocss": "^0.59.4",
"unplugin-auto-import": "^0.17.5",
"unplugin-vue-components": "^0.26.0",
"vite": "^5.2.9",
"vitest": "^1.5.0",
"vue": "^3.4.25"
"vue": "^3.4.25",
"vue-tsc": "^2.0.6"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
Expand Down
1 change: 1 addition & 0 deletions packages/element-plus/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './input'
8 changes: 8 additions & 0 deletions packages/element-plus/input/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { withInstall } from 'element-plus/es/utils'

import Input from './src/input.vue'

export const EFInput = withInstall(Input)
export default EFInput

export * from './src/input'
3 changes: 3 additions & 0 deletions packages/element-plus/input/src/input.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type Input from './input.vue'

export type InputInstance = InstanceType<typeof Input>
13 changes: 13 additions & 0 deletions packages/element-plus/input/src/input.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<script setup lang='ts'>
</script>

<template>
<div>
be...
</div>
</template>

<style scoped lang='scss'>
</style>
23 changes: 23 additions & 0 deletions packages/element-plus/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "@nigi-element-formily/element-plus",
"type": "module",
"version": "0.0.0",
"private": true,
"description": "element-plus formily",
"sideEffects": false,
"exports": {
".": {
"import": "./dist/index.js",
"require": "./dist/index.umd.cjs"
}
},
"main": "./dist/index.umd.cjs",
"module": "./dist/index.js",
"files": ["dist"],
"scripts": {
"build": "vite build"
},
"peerDependencies": {
"vue": "^3.4.25"
}
}
29 changes: 29 additions & 0 deletions packages/element-plus/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
base: '/play/',
plugins: [
Vue(),
],
build: {
emptyOutDir: true,
lib: {
entry: resolve(__dirname, './index.ts'),
name: 'index',
fileName: 'index',
},
rollupOptions: {
// 确保外部化处理那些你不想打包进库的依赖
external: ['vue'],
output: {
// 在 UMD 构建模式下为这些外部化的依赖提供一个全局变量
globals: {
vue: 'Vue',
},
},
},
},
})
13 changes: 13 additions & 0 deletions playground/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="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "playground",
"type": "module",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"preview": "vite preview"
}
}
1 change: 1 addition & 0 deletions playground/public/vite.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 d5e1746

Please sign in to comment.