Skip to content

Commit 4e1a19a

Browse files
authored
Merge pull request #79 from pqx/tooling-upgrade
rollup & webpack & babel upgrade
2 parents 38bd914 + b9d2942 commit 4e1a19a

23 files changed

+5131
-2894
lines changed

.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

.gitignore

Lines changed: 53 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,79 @@
1+
### https://raw.github.com/github/gitignore/ea28c14da0faf75047165c10223635ba95566ad7/Node.gitignore
2+
13
# Logs
24
logs
35
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
49

510
# Runtime data
611
pids
712
*.pid
813
*.seed
14+
*.pid.lock
915

1016
# Directory for instrumented libs generated by jscoverage/JSCover
1117
lib-cov
1218

1319
# Coverage directory used by tools like istanbul
1420
coverage
1521

22+
# nyc test coverage
23+
.nyc_output
24+
1625
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
1726
.grunt
1827

28+
# Bower dependency directory (https://bower.io/)
29+
bower_components
30+
1931
# node-waf configuration
2032
.lock-wscript
2133

22-
# Compiled binary addons (http://nodejs.org/api/addons.html)
34+
# Compiled binary addons (https://nodejs.org/api/addons.html)
2335
build/Release
2436

25-
# Dependency directory
26-
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
27-
node_modules
37+
# Dependency directories
38+
node_modules/
39+
jspm_packages/
40+
41+
# TypeScript v1 declaration files
42+
typings/
43+
44+
# Optional npm cache directory
45+
.npm
46+
47+
# Optional eslint cache
48+
.eslintcache
49+
50+
# Optional REPL history
51+
.node_repl_history
52+
53+
# Output of 'npm pack'
54+
*.tgz
55+
56+
# Yarn Integrity file
57+
.yarn-integrity
58+
59+
# dotenv environment variables file
60+
.env
61+
62+
# parcel-bundler cache (https://parceljs.org/)
63+
.cache
64+
65+
# next.js build output
66+
.next
67+
68+
# nuxt.js build output
69+
.nuxt
70+
71+
# vuepress build output
72+
.vuepress/dist
73+
74+
# Serverless directories
75+
.serverless
2876

77+
dist/
2978
example/bundle*
30-
.publish
3179

32-
dist

.npmignore

Lines changed: 0 additions & 6 deletions
This file was deleted.

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package.json

Makefile

Lines changed: 0 additions & 7 deletions
This file was deleted.

__tests__/tree.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import Tree from '../lib/tree';
2+
3+
describe('tree', () => {
4+
const tree = new Tree({
5+
module: 'root',
6+
collapsed: false,
7+
children: [
8+
{
9+
module: 'a',
10+
collapsed: false,
11+
children: [
12+
{
13+
module: 'c',
14+
collapsed: false
15+
}
16+
]
17+
},
18+
{
19+
module: 'b',
20+
collapsed: false
21+
}
22+
]
23+
});
24+
25+
it('updateNodesPosition()', () => {
26+
tree.updateNodesPosition();
27+
expect(tree.getIndex(1).top).toEqual(1);
28+
expect(tree.getIndex(1).left).toEqual(1);
29+
expect(tree.getIndex(2).top).toEqual(2);
30+
expect(tree.getIndex(2).left).toEqual(2);
31+
expect(tree.getIndex(3).top).toEqual(3);
32+
expect(tree.getIndex(3).left).toEqual(3);
33+
expect(tree.getIndex(4).top).toEqual(4);
34+
expect(tree.getIndex(4).left).toEqual(2);
35+
});
36+
37+
it('move()', () => {
38+
tree.move();
39+
});
40+
41+
it('getNodeByTop()', () => {
42+
expect(tree.getNodeByTop(1).id).toEqual(1);
43+
expect(tree.getNodeByTop(2).id).toEqual(2);
44+
expect(tree.getNodeByTop(3).id).toEqual(3);
45+
expect(tree.getNodeByTop(4).id).toEqual(4);
46+
});
47+
});

babel.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
presets: [['@babel/env', { loose: true }], '@babel/preset-react'],
3+
plugins: [['@babel/proposal-class-properties', { loose: true }]]
4+
};

example/app.less renamed to example/app.css

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
*, *:before, *:after {
1+
*,
2+
*:before,
3+
*:after {
24
-webkit-box-sizing: border-box;
35
-moz-box-sizing: border-box;
46
box-sizing: border-box;
@@ -12,9 +14,9 @@ body {
1214

1315
.inspector {
1416
margin-left: 400px;
17+
}
1518

16-
pre {
17-
font-family: Menlo;
18-
font-size: 13px;
19-
}
19+
.inspector pre {
20+
font-family: Menlo;
21+
font-size: 13px;
2022
}

example/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import '../lib/react-ui-tree.less';
2-
import './theme.less';
3-
import './app.less';
1+
import '../lib/react-ui-tree.css';
2+
import './theme.css';
3+
import './app.css';
44
import cx from 'classnames';
55
import React, { Component } from 'react';
66
import ReactDOM from 'react-dom';

example/index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
<a href="https://github.com/pqx/react-ui-tree"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>
88

99
<div id="app"></div>
10-
<script src="https://unpkg.com/react@16.4.0/umd/react.development.js"></script>
11-
<script src="https://unpkg.com/react-dom@16.4.0/umd/react-dom.development.js"></script>
1210
<script src="bundle.js"></script>
1311
</body>
1412
</html>

0 commit comments

Comments
 (0)