Skip to content

Commit d7936ae

Browse files
authored
Merge pull request #107 from lukebayes/lbj-update
Updated nodejs, npm and module dependencies
2 parents ebe8a51 + 75956eb commit d7936ae

7 files changed

+4709
-3800
lines changed

Makefile

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ PROJECT_ROOT=$(shell git rev-parse --show-toplevel)
99

1010
# Nodejs
1111
# https://nodejs.org/dist/v10.9.0/node-v10.9.0-linux-x64.tar.xz
12-
NODE_VERSION=12.4.0
12+
NODE_VERSION=12.16.2
1313
NODE=lib/nodejs/bin/node
1414
NPM=lib/nodejs/bin/npm
1515

@@ -56,16 +56,16 @@ dist/nomplate.min.gz: dist/nomplate.min.js
5656

5757
dist/express.js:
5858
$(WEBPACK) --mode development --config $(WEBPACK_SERVER_CONFIG) express.js --output dist/express.js
59-
59+
6060
lint:
6161
$(ESLINT) --config $(PROJECT_ROOT)/.eslintrc.json .
6262

63-
module-install:
63+
module-install:
6464
$(NPM) install
6565

6666
integrate: clean lint test build
6767

68-
clean:
68+
clean:
6969
rm -rf dist
7070
rm -rf tmp
7171
rm -f .tmp-view.html

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Nomplate
22
(pronounced, Gnome-plate)
33

4-
Nomplate is a microscopic (< 5kb), insanely fast (<30ms to interaction) client and server side template engine and component system that makes it dead simple to create, compose, _test_ and deploy visual components using Plain Old JavaScript wherever it runs.
4+
Nomplate is a microscopic (< 6kb), insanely fast (<30ms to interaction) client and server side template engine and component system that makes it dead simple to create, compose, _test_ and deploy visual components using Plain Old JavaScript wherever it runs.
55

66
![Gnome Plate](https://raw.githubusercontent.com/lukebayes/nomplate/master/Gnomplate.jpg "Gnome Plate")
77

package-lock.json

+4,677-3,746
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nomplate",
3-
"version": "1.2.25",
3+
"version": "1.3.1",
44
"description": "Nomplate: Node template engine",
55
"main": "index.js",
66
"engines": {
@@ -52,18 +52,18 @@
5252
],
5353
"license": "MIT",
5454
"devDependencies": {
55-
"chai": "^3.5.0",
56-
"eslint": "^5.16.0",
57-
"eslint-plugin-mocha": "^6.1.1",
55+
"chai": "^4.2.0",
56+
"eslint": "^6.8.0",
57+
"eslint-plugin-mocha": "^6.3.0",
5858
"express": "^4.17.1",
59-
"js-beautify": "^1.10.2",
60-
"jsdom": ">=9.8.3",
61-
"jsdom-simulant": ">=1.1.2",
62-
"json-loader": "^0.5.4",
63-
"mocha": "^5.2.0",
64-
"sinon": "^1.17.6",
65-
"terser-webpack-plugin": "^1.4.1",
66-
"webpack": "^4.40.2",
67-
"webpack-cli": "^3.3.9"
59+
"js-beautify": "^1.11.0",
60+
"jsdom": "^16.2.2",
61+
"jsdom-simulant": "^1.1.2",
62+
"json-loader": "^0.5.7",
63+
"mocha": "^7.1.1",
64+
"sinon": "^9.0.2",
65+
"terser-webpack-plugin": "^2.3.5",
66+
"webpack": "^4.42.1",
67+
"webpack-cli": "^3.3.11"
6868
}
6969
}

test/render_element_test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -225,19 +225,19 @@ describe('renderElement', () => {
225225

226226
const nomElement = dom.div((update) => {
227227
updater = update;
228-
dom.input({type: 'checkbox', value: value});
228+
dom.input({type: 'checkbox', checked: value});
229229
});
230230

231231
const domElement = renderElement(nomElement, doc);
232-
assert.equal(domElement.firstChild.outerHTML, '<input type="checkbox" value="true">');
233-
assert(domElement.firstChild.value, 'Expected checkbox property to be applied');
232+
assert.equal(domElement.firstChild.outerHTML, '<input type="checkbox" checked="true">');
233+
assert(domElement.firstChild.checked, 'Expected checkbox property to be applied');
234234

235235
value = false;
236236
updater();
237237
builder.forceUpdate();
238238

239239
assert.equal(domElement.outerHTML, '<div><input type="checkbox"></div>');
240-
assert(!domElement.firstChild.value, 'Expected checkbox property to be updated');
240+
assert(!domElement.firstChild.checked, 'Expected checkbox property to be updated');
241241
});
242242

243243
it('never writes classname or key attributes', () => {

test/test_helper_test.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('Test Helper', () => {
1616
});
1717

1818
it('append setUrl to window', () => {
19-
win.setUrl('/some_path?abcd=1234#efgh');
19+
win.setUrl('some_path?abcd=1234#efgh');
2020
const loc = win.location;
2121
assert.equal(loc.href, 'http://example.com/some_path?abcd=1234#efgh');
2222
assert.equal(loc.protocol, 'http:');
@@ -25,7 +25,7 @@ describe('Test Helper', () => {
2525
assert.equal(loc.origin, 'http://example.com');
2626
assert.equal(loc.port, '');
2727
assert.equal(loc.pathname, '/some_path');
28-
assert.equal(loc.search, '?abcd=1234#efgh');
28+
assert.equal(loc.search, '?abcd=1234');
2929
assert.equal(loc.hash, '#efgh');
3030
});
3131

@@ -37,7 +37,7 @@ describe('Test Helper', () => {
3737
});
3838

3939
it('does not double leading slashes', () => {
40-
win.setUrl('/some_path');
40+
win.setUrl('some_path');
4141
const loc = win.location;
4242
assert.equal(loc.href, 'http://example.com/some_path');
4343
});

test_helper.js

+7-29
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* eslint-disable import/no-extraneous-dependencies */
22
const FakeStorage = require('./test/fake_storage');
3-
const jsdom = require('jsdom').jsdom;
3+
const JSDOM = require('jsdom').JSDOM;
44
const simulant = require('jsdom-simulant');
55
const _renderElement = require('./src/render_element');
66
const _renderString = require('./src/render_string');
@@ -9,7 +9,8 @@ const _renderString = require('./src/render_string');
99
* Create a JSDOM window object for test cases.
1010
*/
1111
function createWindow(optOptions) {
12-
let doc = jsdom('<html><body></body></html>', optOptions);
12+
let jsdom = new JSDOM('<html><body></body></html>', optOptions);
13+
let doc = jsdom.window.document;
1314
/* eslint-disable no-param-reassign */
1415
doc.defaultView.localStorage = new FakeStorage();
1516
/* eslint-enable no-param-reassign */
@@ -19,37 +20,14 @@ function createWindow(optOptions) {
1920
console.error(error);
2021
};
2122
const win = doc.defaultView;
23+
2224
/**
2325
* Set the current URL on the provided window.location object.
24-
*
25-
* NOTE(lbayes): Partial implementation by okovpashko, found on Github issue here:
26-
* https://github.com/facebook/jest/issues/890#issuecomment-298594389
27-
* Original implementation did not handle search or hash values properly.
2826
*/
2927
win.setUrl = (urlOrPart) => {
30-
const url = urlOrPart.indexOf('http') === 0 ? urlOrPart : ['http://example.com', urlOrPart.replace(/^\//, '')].join('/');
31-
const parser = win.document.createElement('a');
32-
parser.href = url;
33-
['href', 'protocol', 'host', 'hostname', 'origin', 'port', 'pathname'].forEach(prop => {
34-
Object.defineProperty(win.location, prop, {
35-
value: parser[prop],
36-
writable: true,
37-
});
38-
});
39-
40-
const parts = url.split('?');
41-
const search = parts.length > 1 ? `?${parts[1]}` : '';
42-
43-
Object.defineProperty(win.location, 'search', {
44-
value: search,
45-
writable: true,
46-
});
47-
48-
const hash = url.split('#');
49-
Object.defineProperty(win.location, 'hash', {
50-
value: hash.length > 1 ? `#${hash[1]}` : '',
51-
writable: true,
52-
});
28+
const url = urlOrPart.indexOf("http") === 0 ?
29+
urlOrPart : `http://example.com/${urlOrPart}`;
30+
jsdom.reconfigure({ url });
5331
};
5432

5533
return win;

0 commit comments

Comments
 (0)