Skip to content

Commit e2b8bef

Browse files
committed
build: 使用 lerna 进行重构
1 parent 6687435 commit e2b8bef

File tree

191 files changed

+18840
-194
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+18840
-194
lines changed

.gitignore

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
.DS_Store
2-
*.zip
3-
*.tgz
42
node_modules
53
yarn.lock
64
package-lock.json
7-
.vuepress/dist
8-
dist
9-
vue3
105

116
# local env files
127
.env.local
@@ -16,6 +11,7 @@ vue3
1611
npm-debug.log*
1712
yarn-debug.log*
1813
yarn-error.log*
14+
lerna-debug.log*
1915

2016
# Editor directories and files
2117
.idea
@@ -24,4 +20,4 @@ yarn-error.log*
2420
*.ntvs*
2521
*.njsproj
2622
*.sln
27-
*.sw?
23+
*.sw?

README.md

Lines changed: 28 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11

22
<div align="center">
33
<img src="https://raw.githubusercontent.com/LuckDraw/lucky-canvas/master/logo.png" width="128" alt="logo" />
4-
<h1>vue-luck-draw 抽奖插件</h1>
5-
<p>一个基于 vue 的 ( 大转盘 / 九宫格 ) 抽奖插件</p>
4+
<h1>lucky-canvas 抽奖插件</h1>
5+
<p>一个基于 JavaScript 的 ( 大转盘 / 九宫格 ) 抽奖插件</p>
66
<p class="hidden">
7-
<a href="https://github.com/LuckDraw/vue-luck-draw#readme">简体中文</a>
7+
<a href="https://github.com/luckdraw/lucky-canvas#readme">简体中文</a>
88
·
9-
<a href="https://github.com/LuckDraw/vue-luck-draw/tree/master/en">English</a>
9+
<a href="https://github.com/luckdraw/lucky-canvas/tree/master/en">English</a>
1010
</p>
1111
<p>
12-
<a href="https://github.com/LuckDraw/vue-luck-draw/stargazers" target="_black">
13-
<img src="https://img.shields.io/github/stars/LuckDraw/vue-luck-draw?color=%23ffca28&logo=github&style=flat-square" alt="stars" />
12+
<a href="https://github.com/LuckDraw/lucky-canvas/stargazers" target="_black">
13+
<img src="https://img.shields.io/github/stars/luckdraw/lucky-canvas?color=%23ffca28&logo=github&style=flat-square" alt="stars" />
1414
</a>
15-
<a href="https://github.com/LuckDraw/vue-luck-draw/network/members" target="_black">
16-
<img src="https://img.shields.io/github/forks/LuckDraw/vue-luck-draw?color=%23ffca28&logo=github&style=flat-square" alt="forks" />
15+
<a href="https://github.com/luckdraw/lucky-canvas/network/members" target="_black">
16+
<img src="https://img.shields.io/github/forks/luckdraw/lucky-canvas?color=%23ffca28&logo=github&style=flat-square" alt="forks" />
1717
</a>
18-
<a href="https://www.npmjs.com/package/vue-luck-draw" target="_black">
19-
<img src="https://img.shields.io/npm/v/vue-luck-draw?color=%23ffca28&logo=npm&style=flat-square" alt="version" />
18+
<a href="https://www.npmjs.com/package/lucky-canvas" target="_black">
19+
<img src="https://img.shields.io/npm/v/lucky-canvas?color=%23ffca28&logo=npm&style=flat-square" alt="version" />
2020
</a>
21-
<a href="https://www.npmjs.com/package/vue-luck-draw" target="_black">
22-
<img src="https://img.shields.io/npm/dm/vue-luck-draw?color=%23ffca28&logo=npm&style=flat-square" alt="downloads" />
21+
<a href="https://www.npmjs.com/package/lucky-canvas" target="_black">
22+
<img src="https://img.shields.io/npm/dm/lucky-canvas?color=%23ffca28&logo=npm&style=flat-square" alt="downloads" />
2323
</a>
24-
<a href="https://www.jsdelivr.com/package/npm/vue-luck-draw" target="_black">
25-
<img src="https://data.jsdelivr.com/v1/package/npm/vue-luck-draw/badge" alt="jsdelivr" />
24+
<a href="https://www.jsdelivr.com/package/npm/lucky-canvas" target="_black">
25+
<img src="https://data.jsdelivr.com/v1/package/npm/lucky-canvas/badge" alt="downloads" />
2626
</a>
2727
</p>
2828
<p>
2929
<a href="https://github.com/buuing" target="_black">
3030
<img src="https://img.shields.io/badge/Author-%20buuing%20-7289da.svg?&logo=github&style=flat-square" alt="author" />
3131
</a>
32-
<a href="https://github.com/LuckDraw/vue-luck-draw/blob/master/LICENSE" target="_black">
33-
<img src="https://img.shields.io/github/license/LuckDraw/vue-luck-draw?color=%232DCE89&logo=github&style=flat-square" alt="license" />
32+
<a href="https://github.com/luckdraw/lucky-canvas/blob/master/LICENSE" target="_black">
33+
<img src="https://img.shields.io/github/license/luckdraw/lucky-canvas?color=%232dce89&logo=github&style=flat-square" alt="license" />
3434
</a>
3535
</p>
3636
</div>
@@ -39,119 +39,38 @@
3939

4040
## 官方文档 & Demo演示
4141

42-
> **中文**[https://100px.net/usage/vue.html](https://100px.net/usage/vue.html)
42+
> **中文**[https://100px.net/usage/js.html](https://100px.net/usage/js.html)
4343
4444
> **English****If anyone can help translate the document, please contact me** `ldq404@qq.com`
4545
4646
<br />
4747

48-
- **在 js / jq 中使用 [lucky-canvas](https://github.com/luckdraw/lucky-canvas)**
48+
- **在 js / jq 中使用 [lucky-canvas](https://100px.net/usage/js.html)**
4949

50-
- **在 vue 中使用 [vue-luck-draw](https://github.com/luckdraw/vue-luck-draw)**
50+
- **在 vue 中使用 [vue-luck-draw](https://100px.net/usage/vue.html)**
5151

52-
- **在 react 中使用 [react-luck-draw](https://github.com/luckdraw/react-luck-draw)**
52+
- **在 react 中使用 [react-luck-draw](https://100px.net/usage/react.html)**
5353

54-
- **在 uni-app 中使用 [uni-luck-draw](https://github.com/luckdraw/uni-luck-draw)**
54+
- **在 uni-app 中使用 [uni-luck-draw](https://100px.net/usage/uni-app.html)**
5555

56-
- **在 taro 中使用 [taro-luck-draw](https://github.com/luckdraw/taro-luck-draw)**
56+
- **在 taro 中使用 [taro-luck-draw](https://100px.net/usage/taro.html)**
5757

58-
- **在 微信小程序 中使用 [mini-luck-draw](https://github.com/luckdraw/mini-luck-draw)**
58+
- **在 微信小程序 中使用 [mini-luck-draw](https://100px.net/usage/wx.html)**
5959

6060
<br />
6161

62-
## 在 vue2.x / vue3.x 中使用
63-
64-
### 方式 1:通过 import 引入
65-
66-
1. 首先安装插件
67-
68-
```shell
69-
# npm 安装:
70-
npm install vue-luck-draw
71-
72-
# yarn 安装:
73-
yarn add vue-luck-draw
74-
```
75-
76-
2. 然后找到 `main.js` 引入插件并 `use`
77-
78-
```js
79-
// vue2.x
80-
import LuckDraw from 'vue-luck-draw'
81-
Vue.use(LuckDraw)
82-
83-
// vue3.x
84-
import LuckDraw from 'vue-luck-draw/vue3'
85-
createApp(App).use(LuckDraw).mount('#app')
86-
```
87-
88-
3. 最后在组件内使用 **`<LuckyWheel />`大转盘抽奖****`<LuckyGrid />`九宫格抽奖**
89-
90-
```vue
91-
<template>
92-
<div>
93-
<!-- 大转盘抽奖 -->
94-
<LuckyWheel
95-
width="200px"
96-
height="200px"
97-
...你的配置
98-
/>
99-
<!-- 九宫格抽奖 -->
100-
<LuckyGrid
101-
width="200px"
102-
height="200px"
103-
...你的配置
104-
/>
105-
</div>
106-
</template>
107-
```
62+
### 贡献者
10863

10964
<br />
11065

111-
### 方式 2:通过 script 标签引入
112-
113-
> 为了避免 CDN 链接出现异常或波动,我非常建议你**缓存到本地或服务器(✿◡‿◡)**
114-
115-
- **vue2.x:** [https://cdn.jsdelivr.net/npm/vue-luck-draw@3.4/dist/vue-luck-draw.umd.min.js](https://cdn.jsdelivr.net/npm/vue-luck-draw@3.4/dist/vue-luck-draw.umd.min.js)
116-
117-
- **vue3.x:** [https://cdn.jsdelivr.net/npm/vue-luck-draw@3.4/vue3/vue-luck-draw.umd.min.js](https://cdn.jsdelivr.net/npm/vue-luck-draw@3.4/vue3/vue-luck-draw.umd.min.js)
118-
119-
120-
```html
121-
<div id="app">
122-
<!-- 大转盘抽奖 -->
123-
<lucky-wheel
124-
width="200px"
125-
height="200px"
126-
...你的配置
127-
/>
128-
<!-- 九宫格抽奖 -->
129-
<lucky-grid
130-
width="200px"
131-
height="200px"
132-
...你的配置
133-
/>
134-
</div>
135-
<script src="./vue.min.js"></script>
136-
<script src="./vue-luck-draw.umd.min.js"></script>
137-
<script>
138-
new Vue({
139-
el: '#app',
140-
data () {
141-
return {}
142-
}
143-
})
144-
</script>
145-
```
146-
147-
<br />
148-
149-
### **如果您觉得这个项目还不错, 可以在 [Github](https://github.com/LuckDraw/vue-luck-draw) 上面帮我点个`star` ☜(゚ヮ゚☜)**
150-
66+
### **如果您觉得这个项目还不错, 可以在 [Github](https://github.com/LuckDraw/lucky-canvas) 上面帮我点个`star` ☜(゚ヮ゚☜)**
15167

15268
<br />
15369

15470
## 友情链接
15571

15672
- [🎁 h5-Dooring 一款功能强大,高可扩展的H5可视化编辑器](https://github.com/MrXujiang/h5-Dooring)
15773

74+
75+
<!-- lerna过滤器配置 -->
76+
<!-- https://github.com/lerna/lerna/tree/main/core/filter-options#readme -->

lerna.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"packages": [
3+
"packages/*"
4+
],
5+
"version": "0.0.4",
6+
"npmClient": "yarn",
7+
"useWorkspaces": true
8+
}

logo.png

18.5 KB
Loading

package.json

Lines changed: 19 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,23 @@
11
{
2-
"name": "vue-luck-draw",
3-
"version": "3.4.5",
4-
"description": "一个支持 vue2 / vue3 的(大转盘抽奖 / 九宫格抽奖)luckydraw 插件",
5-
"main": "index.js",
6-
"keywords": [
7-
"vue3抽奖",
8-
"大转盘抽奖",
9-
"九宫格抽奖",
10-
"抽奖插件",
11-
"web抽奖",
12-
"移动端抽奖",
13-
"canvas抽奖"
14-
],
15-
"author": "ldq <17778888138@189.cn>",
16-
"license": "BSD-3-Clause",
17-
"files": [
18-
"package.json",
19-
"dist",
20-
"vue3",
21-
"index.js",
22-
"package"
23-
],
24-
"scripts": {
25-
"start": "yarn start:vue3",
26-
"build": "yarn build:vue2 && yarn build:vue3",
27-
"build:vue2": "yarn changeVue2 && yarn && yarn vue2build",
28-
"build:vue3": "yarn changeVue3 && yarn && yarn vue3build",
29-
"vue2build": "cross-env NODE_ENV=production webpack --config=build/webpack.configvue2.js",
30-
"vue3build": "cross-env NODE_ENV=production webpack --config=build/webpack.configvue3.js",
31-
"start:vue2": "yarn changeVue2 && yarn && yarn vue2serve",
32-
"start:vue3": "yarn changeVue3 && yarn && yarn vue3serve",
33-
"vue2serve": "cross-env NODE_ENV=development webpack serve --config=build/webpack.configvue2.js",
34-
"vue3serve": "cross-env NODE_ENV=development webpack serve --config=build/webpack.configvue3.js",
35-
"changeVue2": "node update-packge-json.js vue2",
36-
"changeVue3": "node update-packge-json.js vue3"
2+
"name": "lucky-canvas",
3+
"devDependencies": {
4+
"lerna": "^4.0.0"
375
},
38-
"homepage": "https://100px.net",
39-
"dependencies": {
40-
"lucky-canvas": "^1.5.3"
6+
"scripts": {
7+
"install": "lerna bootstrap",
8+
"dev": "lerna exec --scope=lucky-canvas -- npm run dev",
9+
"dev:vue": "",
10+
"dev:react": "lerna exec dev --scope=lucky-canvas --scope=react-luck-draw -- npm run dev",
11+
"dev:uni": "",
12+
"dev:taro": "",
13+
"dev:mini": "",
14+
"build": "lerna run build --sort --stream",
15+
"update-version": "lerna version --conventional-commits --no-push --no-changelog --no-git-tag-version",
16+
"publish-to-npm": "lerna publish from-package",
17+
"publish-beta": "lerna publish --no-git-tag-version --dist-tag beta"
4118
},
42-
"devDependencies": {
43-
"@vue/compiler-sfc": "^3.0.7",
44-
"clean-webpack-plugin": "^3.0.0",
45-
"copy-webpack-plugin": "^8.0.0",
46-
"cross-env": "^7.0.3",
47-
"file-loader": "^6.2.0",
48-
"html-webpack-plugin": "^5.3.1",
49-
"mini-css-extract-plugin": "^1.3.9",
50-
"vue": "^3.0.7",
51-
"vue-loader": "^16.1.2",
52-
"webpack": "^5.27.1",
53-
"webpack-cli": "^4.5.0",
54-
"webpack-dev-server": "^3.11.2"
55-
}
19+
"private": true,
20+
"workspaces": [
21+
"packages/*"
22+
]
5623
}

packages/lucky-canvas/.babelrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"presets": [
3+
[
4+
"@babel/preset-env", {
5+
"modules": false
6+
}
7+
]
8+
]
9+
}

packages/lucky-canvas/.eslintrc.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"node": true
6+
},
7+
"parser": "@typescript-eslint/parser",
8+
// "plugins": ['prettier'],
9+
"extends": "eslint:recommended",
10+
"globals": {
11+
"Atomics": "readonly",
12+
"SharedArrayBuffer": "readonly",
13+
"ENV": true
14+
},
15+
"parserOptions": {
16+
"ecmaVersion": 2018,
17+
"sourceType": "module"
18+
},
19+
"rules": {
20+
"linebreak-style": 'off'
21+
}
22+
}

packages/lucky-canvas/.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.DS_Store
2+
node_modules
3+
yarn.lock
4+
package-lock.json
5+
6+
# local env files
7+
.env.local
8+
.env.*.local
9+
10+
# Log files
11+
npm-debug.log*
12+
yarn-debug.log*
13+
yarn-error.log*
14+
15+
# Editor directories and files
16+
.idea
17+
.vscode
18+
*.suo
19+
*.ntvs*
20+
*.njsproj
21+
*.sln
22+
*.sw?

0 commit comments

Comments
 (0)