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

Commit d7a5d13

Browse files
chore: bump dependencies
1 parent 9bf7602 commit d7a5d13

File tree

6 files changed

+2154
-2007
lines changed

6 files changed

+2154
-2007
lines changed

example/build.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/usr/bin/env node
22

3-
const metalsmith = require('metalsmith')
4-
const metalsmithDefine = require('..')
3+
const metalsmith = require('metalsmith');
4+
const metalsmithDefine = require('..');
55

66
metalsmith(__dirname)
7-
.use(
8-
metalsmithDefine({
9-
env: process.env,
10-
})
11-
)
12-
.build(error => {
13-
if (error) {
14-
throw error
15-
}
16-
})
7+
.use(
8+
metalsmithDefine({
9+
env: process.env
10+
})
11+
)
12+
.build(error => {
13+
if (error) {
14+
throw error;
15+
}
16+
});

example/build.test.js

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
1-
const fs = require('fs')
2-
const path = require('path')
3-
const { execFile } = require('child_process')
4-
const rimraf = require('rimraf')
5-
const test = require('ava')
1+
const fs = require('fs');
2+
const path = require('path');
3+
const {execFile} = require('child_process');
4+
const rimraf = require('rimraf');
5+
const test = require('ava');
66

7-
const build = path.join(__dirname, 'build')
7+
const build = path.join(__dirname, 'build');
88
// Make sure the build is cleaned before/after each test
9-
test.beforeEach.cb(t => rimraf(build, t.end))
10-
test.afterEach.always.cb(t => rimraf(build, t.end))
9+
test.beforeEach.cb(t => {
10+
rimraf(build, t.end);
11+
});
12+
test.afterEach.always.cb(t => {
13+
rimraf(build, t.end);
14+
});
1115

1216
test.serial.cb('the example should build successfully', t => {
13-
t.plan(3)
14-
execFile(
15-
'node',
16-
[path.join(__dirname, 'build.js')],
17-
{ cwd: path.join(__dirname, '..') },
18-
error => {
19-
t.falsy(error)
20-
fs.lstat(build, (error, stats) => {
21-
t.falsy(error)
22-
t.true(stats.isDirectory())
23-
t.end()
24-
})
25-
}
26-
)
27-
})
17+
t.plan(3);
18+
execFile(
19+
'node',
20+
[path.join(__dirname, 'build.js')],
21+
{cwd: path.join(__dirname, '..')},
22+
error => {
23+
t.falsy(error);
24+
fs.lstat(build, (error, stats) => {
25+
t.falsy(error);
26+
t.true(stats.isDirectory());
27+
t.end();
28+
});
29+
}
30+
);
31+
});

index.js

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
module.exports = (options = {}) => {
2-
const entries =
3-
options &&
4-
options.constructor &&
5-
options.constructor.prototype &&
6-
options.constructor.prototype.entries
7-
? options.constructor.prototype.entries.call(options)
8-
: Object.entries(options)
9-
return (_files, metalsmith, done) => {
10-
const metadata = metalsmith.metadata()
11-
for (const [key, value] of entries) {
12-
metadata[key] = value
13-
}
2+
const entries =
3+
options &&
4+
options.constructor &&
5+
options.constructor.prototype &&
6+
options.constructor.prototype.entries ?
7+
options.constructor.prototype.entries.call(options) :
8+
Object.entries(options);
149

15-
return done()
16-
}
17-
}
10+
return (_files, metalsmith, done) => {
11+
const metadata = metalsmith.metadata();
12+
for (const [key, value] of entries) {
13+
metadata[key] = value;
14+
}
15+
16+
return done();
17+
};
18+
};

package.json

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -22,26 +22,13 @@
2222
"index.js"
2323
],
2424
"scripts": {
25-
"format": "prettier --write \"{,.}**.{js,md,yml}\" && xo --fix",
26-
"test": "prettier --check \"{,.}**.{js,md,yml}\" && xo && ava"
27-
},
28-
"xo": {
29-
"prettier": true
30-
},
31-
"prettier": {
32-
"bracketSpacing": true,
33-
"jsxBracketSameLine": false,
34-
"semi": false,
35-
"singleQuote": true,
36-
"tabWidth": 2,
37-
"trailingComma": "es5",
38-
"useTabs": false
25+
"format": "xo --fix",
26+
"test": "xo && ava"
3927
},
4028
"devDependencies": {
41-
"ava": "2.3.0",
29+
"ava": "3.8.2",
4230
"metalsmith": "2.3.0",
43-
"prettier": "1.18.2",
44-
"rimraf": "3.0.0",
45-
"xo": "0.24.0"
31+
"rimraf": "3.0.2",
32+
"xo": "0.30.0"
4633
}
4734
}

0 commit comments

Comments
 (0)