Skip to content

Commit 0800684

Browse files
author
Charlike Mike Reagent
committed
fix: tweak cli, better index interop
Signed-off-by: Charlike Mike Reagent <mameto2011@gmail.com>
1 parent dff094f commit 0800684

File tree

7 files changed

+479
-182
lines changed

7 files changed

+479
-182
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,4 @@ typings/
8989
.env
9090

9191
# next.js build output
92-
.next
92+
.next

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
'use strict';
2+
3+
module.exports = {
4+
extends: 'tunnckocore',
5+
rules: {
6+
'jest/expect-expect': 'off',
7+
'no-param-reassign': 'off',
8+
},
9+
};

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@ Some of these projects are used here or were inspiration for this one, others ar
323323
existance!
324324

325325
- [asia](https://www.npmjs.com/package/asia): Blazingly fast, magical and minimalist testing framework, for Today and… [more](https://github.com/olstenlarck/asia#readme) | [homepage](https://github.com/olstenlarck/asia#readme 'Blazingly fast, magical and minimalist testing framework, for Today and Tomorrow')
326-
- [charlike](https://www.npmjs.com/package/charlike): Small, fast, simple and streaming project scaffolder for myself, but[more](https://github.com/tunnckoCore/charlike) | [homepage](https://github.com/tunnckoCore/charlike 'Small, fast, simple and streaming project scaffolder for myself, but not only. Supports hundreds of template engines through the @JSTransformers API or if you want custom `render` function passed through options')
326+
- [charlike](https://www.npmjs.com/package/charlike): Small, fast and streaming project scaffolder with support for hundreds[more](https://github.com/tunnckoCoreLabs/charlike) | [homepage](https://github.com/tunnckoCoreLabs/charlike 'Small, fast and streaming project scaffolder with support for hundreds of template engines and sane defaults')
327327
- [gitcommit](https://www.npmjs.com/package/gitcommit): Lightweight and joyful `git commit` replacement. Conventional Commits compliant. | [homepage](https://github.com/tunnckoCore/gitcommit 'Lightweight and joyful `git commit` replacement. Conventional Commits compliant.')
328-
- [new-release](https://www.npmjs.com/package/new-release): A stable alternative to [semantic-release][]. Only handles NPM publishing and… [more](https://github.com/tunnckoCore/new-release#readme) | [homepage](https://github.com/tunnckoCore/new-release#readme 'A stable alternative to [semantic-release][]. Only handles NPM publishing and nothing more. For creating GitHub releases use the Semantic Release GitHub App')
328+
- [new-release](https://www.npmjs.com/package/new-release): MIRROR] Publish project to NPM following Conventional Commits specification and… [more](https://github.com/tunnckoCoreLabs/new-release) | [homepage](https://github.com/tunnckoCoreLabs/new-release '[MIRROR] Publish project to NPM following Conventional Commits specification and SemVer. Uses git-commits-since for detecting git commits since last SemVer tag and detect-next-version for what next version bump should be.')
329329
- [xaxa](https://www.npmjs.com/package/xaxa): Zero-config linting, powered by few amazing unicorns, AirBnB & Prettier. | [homepage](https://github.com/olstenlarck/xaxa 'Zero-config linting, powered by few amazing unicorns, AirBnB & Prettier.')
330330

331331
**[back to top](#thetop)**
@@ -369,6 +369,8 @@ here](https://github.com/jfmengels/all-contributors-cli#usage).
369369
| [<img src="https://avatars3.githubusercontent.com/u/5038030?v=4" width="120px;"/><br /><sub><b>Charlike Mike Reagent</b></sub>](https://tunnckocore.com)<br />[💻](https://github.com/tunnckoCore/docks/commits?author=tunnckoCore "Code") [📖](https://github.com/tunnckoCore/docks/commits?author=tunnckoCore "Documentation") [💬](#question-tunnckoCore "Answering Questions") [👀](#review-tunnckoCore "Reviewed Pull Requests") [🔍](#fundingFinding-tunnckoCore "Funding Finding") |
370370
| :---: |
371371

372+
<!-- ALL-CONTRIBUTORS-LIST:END -->
373+
372374
Consider showing your [support](#support-the-project) to them. :sparkling_heart:
373375

374376
## License
@@ -378,7 +380,7 @@ Released under the [Apache-2.0 License][license-url].
378380

379381
---
380382

381-
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on November 01, 2018._
383+
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on January 31, 2019._
382384

383385
<!-- Heading badges -->
384386

@@ -419,5 +421,5 @@ _This file was generated by [verb-generate-readme](https://github.com/verbose/ve
419421
[shareb]: https://badgen.net/badge/twitter/share/1da1f2?icon=twitter
420422
[open-issue-url]: https://github.com/tunnckoCore/docks/issues/new
421423
[author-link]: https://tunnckocore.com
422-
[new-release]: https://github.com/tunnckoCore/new-release
424+
[new-release]: https://github.com/tunnckoCoreLabs/new-release
423425
[semantic-release]: https://github.com/semantic-release/semantic-release

cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const proc = require('process');
99
const mri = require('mri');
1010
const mkdirp = require('mkdirp');
1111
const fastGlob = require('fast-glob');
12-
const docks = require('./index').default;
12+
const docks = require('./index');
1313

1414
const argv = mri(proc.argv.slice(2));
1515
const app = docks();

index.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
'use strict';
22

33
const path = require('path');
4-
54
const esmLoader = require('esm');
65
const pkg = require('./package.json');
76

87
const esmRequire = esmLoader(module);
98

10-
module.exports = esmRequire(path.join(__dirname, pkg.module));
9+
function interop(x) {
10+
if (Object.keys(x).length === 1 && x.default) {
11+
return x.default;
12+
}
13+
return x;
14+
}
15+
16+
const mod = esmRequire(path.join(__dirname, pkg.module));
17+
18+
module.exports = interop(mod);

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "Apache-2.0",
55
"licenseStart": "2018",
66
"scripts": {
7-
"docks": "node src/cli.js --outfile .verb.md",
7+
"docks": "node ./cli.js --outfile .verb.md",
88
"docs": "yarn docks && verb",
99
"lint": "eslint src test --cache --fix --quiet --format codeframe",
1010
"test": "nyc --require esm asia -R codeframe",
@@ -26,13 +26,14 @@
2626
"devDependencies": {
2727
"all-contributors-cli": "^5.4.0",
2828
"asia": "^0.19.7",
29-
"eslint": "^5.8.0",
30-
"eslint-config-esmc": "^1.0.12",
29+
"eslint": "^5.12.1",
30+
"eslint-config-tunnckocore": "^3.0.0",
3131
"gitcommit": "^1.0.9",
3232
"husky": "^1.1.2",
3333
"lint-staged": "^8.0.4",
3434
"new-release": "^5.0.0",
35-
"nyc": "^13.0.0"
35+
"nyc": "^13.0.0",
36+
"prettier": "^1.16.3"
3637
},
3738
"files": [
3839
"src",
@@ -51,9 +52,6 @@
5152
"access": "public",
5253
"tag": "latest"
5354
},
54-
"eslintConfig": {
55-
"extends": "esmc"
56-
},
5755
"renovate": {
5856
"extends": "tunnckocore"
5957
},

0 commit comments

Comments
 (0)