Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.

Commit 0727a46

Browse files
author
Ken Berkeley
committed
[v2.1.0] refactor: rename lib/ to src/, also provide build version in dist/
1 parent 59d82f8 commit 0727a46

Some content is hidden

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

44 files changed

+237
-69
lines changed

.npmignore

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1+
// https://github.com/vuejs/vue-cli/blob/master/docs/build.md#configuration-files
12
var path = require('path'),
23
webpack = require('webpack'),
34
CleanWebpackPlugin = require('clean-webpack-plugin'),
4-
examplesDist = path.join(__dirname, 'examples/dist');
5+
dist = path.join(__dirname, '../examples/dist');
56

67
module.exports = {
8+
entry: path.join(__dirname, '../examples/src/app.js'),
79
html: {
8-
template: path.join(__dirname, 'examples/src/index.html')
10+
template: path.join(__dirname, '../examples/src/index.html')
911
},
1012
webpack: {
1113
devtool: false,
1214
output: {
13-
path: examplesDist,
15+
path: dist,
1416
publicPath: ''
1517
},
1618
plugins: (function () {
@@ -19,7 +21,11 @@ module.exports = {
1921
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
2022
];
2123
if (process.env.NODE_ENV === 'production') {
22-
plugins.push(new CleanWebpackPlugin([examplesDist]));
24+
plugins.push(
25+
new CleanWebpackPlugin([dist], {
26+
root: path.join(__dirname, '../examples')
27+
})
28+
);
2329
}
2430
return plugins;
2531
})()

build/lib.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// https://github.com/vuejs/vue-cli/blob/master/docs/build.md#configuration-files
2+
var path = require('path');
3+
4+
module.exports = {
5+
entry: path.join(__dirname, '../src/index.js'),
6+
html: false,
7+
filename: {
8+
js: 'min.js',
9+
css: 'min.css'
10+
},
11+
webpack: {
12+
devtool: false,
13+
output: {
14+
library: 'Datatable',
15+
libraryTarget: 'umd',
16+
path: path.join(__dirname, '../dist')
17+
}
18+
}
19+
};

dist/min.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/min.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/en/DIY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
>_ npm start
1010
```
1111

12-
From now on, you can customize `lib/` by the live `examples/`
12+
From now on, you can customize `src/` by the live `examples/`
1313
If there are some features you consider necessary, your [issues](https://github.com/OneWayTech/vue2-datatable/issues/new) / PRs are always welcome!

doc/en/details/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
It would be better for you to understand the structure of this Datatable before the details.
44

5-
The source tree [`lib/`](https://github.com/OneWayTech/vue2-datatable/tree/master/lib) is shown as below:
5+
The source tree [`src/`](https://github.com/OneWayTech/vue2-datatable/tree/master/src) is shown as below:
66

77
```
8-
lib/
8+
src/
99
├─ HeaderSettings/
1010
│   ├─ ColumnGroup.vue
1111
│   └─ index.vue
12-
├─ MainTable
12+
├─ MainTable
1313
│   ├─ _SCROLLBAR_WIDTH.js
1414
│   ├─ _syncScroll.js
1515
│   ├─ HeadSort.vue
@@ -19,7 +19,8 @@ lib/
1919
│   ├─ TableFooter.vue
2020
│   ├─ TableFrame.vue
2121
│   └─ TableHeader.vue
22-
├─ index.vue
22+
├─ Datatable.vue
23+
├─ index.js
2324
├─ LimitSelect.vue
2425
├─ Pagination.vue
2526
└─ props.mixin.js

doc/en/details/datatable-props.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# § `props` of Datatable
22

3-
> Source: [`lib/props.mixin.js`](https://github.com/OneWayTech/vue2-datatable/blob/master/lib/props.mixin.js)
3+
> Source: [`src/props.mixin.js`](https://github.com/OneWayTech/vue2-datatable/blob/master/src/props.mixin.js)
44
55
| prop | Desc | Type | Optional values | Default value | Required |
66
|---|---|---|---|---|---|

doc/en/details/dynamic-comps.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## `thComp`
44

5-
> Source: [`lib/MainTable/TableHeader.vue`](https://github.com/OneWayTech/vue2-datatable/blob/master/lib/MainTable/TableHeader.vue)
5+
> Source: [`src/MainTable/TableHeader.vue`](https://github.com/OneWayTech/vue2-datatable/blob/master/src/MainTable/TableHeader.vue)
66
77
```html
88
<!-- <th> component (thComp) -->
@@ -25,7 +25,7 @@
2525

2626
## `tdComp`
2727

28-
> Source: [`lib/MainTable/TableBody.vue`](https://github.com/OneWayTech/vue2-datatable/blob/master/lib/MainTable/TableBody.vue)
28+
> Source: [`src/MainTable/TableBody.vue`](https://github.com/OneWayTech/vue2-datatable/blob/master/src/MainTable/TableBody.vue)
2929
3030
```html
3131
<!-- <td> component (tdComp) -->
@@ -49,7 +49,7 @@
4949

5050
## `nested component`
5151

52-
> Source: [`lib/MainTable/TableBody.vue`](https://github.com/OneWayTech/vue2-datatable/blob/master/lib/MainTable/TableBody.vue)
52+
> Source: [`src/MainTable/TableBody.vue`](https://github.com/OneWayTech/vue2-datatable/blob/master/src/MainTable/TableBody.vue)
5353
5454
```html
5555
<!-- nested component -->

doc/en/details/props-data.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Normally, it's not necessary to talk about this prop (it's too simple).
77
But this Datatable supports `nested components` feature by performing magic on it.
88

9-
It would be more direct to excerpt `watch:data` from the source code ([`lib/index.vue`](https://github.com/OneWayTech/vue2-datatable/blob/master/lib/index.vue)) to see how it works:
9+
It would be more direct to excerpt `watch:data` from the source code ([`src/Datatable.vue`](https://github.com/OneWayTech/vue2-datatable/blob/master/src/Datatable.vue)) to see how it works:
1010

1111
```js
1212
watch: {

0 commit comments

Comments
 (0)