Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tweaks): remove build step, add @std/esm, etc stuff
TAG: latest
- Loading branch information
tunnckoCore
committed
Oct 20, 2017
1 parent
fbe5f8e
commit bfb8933
Showing
20 changed files
with
493 additions
and
1,692 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
extends: standard-tunnckocore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,3 @@ | ||
{ | ||
"extends": [ | ||
"standard-tunnckocore" | ||
], | ||
"rules": { | ||
"react/react-in-jsx-scope": "off" | ||
} | ||
"extends": "standard-tunnckocore" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
tasks: | ||
format: prettier-eslint --write ./{test,src}/**/*.{mjs,js} --config ./.prettierrc | ||
|
||
lint: eslint ./{test,src}/**/*.{mjs,js} --config ./.eslintrc --format codeframe --fix | ||
|
||
test: | ||
- yarn start format | ||
- yarn start lint | ||
- node -r @std/esm test | ||
|
||
precommit: | ||
- git status --porcelain | ||
- yarn start test | ||
- git add --all | ||
|
||
commit: | ||
- ./node_modules/.bin/simple-commit-message | ||
|
||
release: | ||
- semantic-release pre | ||
- npm publish | ||
- semantic-release post |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
registry=http://registry.npmjs.org/ | ||
save-exact=true | ||
save=true | ||
username=tunnckocore | ||
username=olstenlarck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
{ | ||
"tabWidth": 2, | ||
"printWidth": 80, | ||
"semi": false, | ||
"useTabs": false, | ||
"singleQuote": true, | ||
"trailingComma": "es5", | ||
"bracketSpacing": true, | ||
"jsxBracketSameLine": true, | ||
"parser": "babylon" | ||
} | ||
tabWidth: 2 | ||
printWidth: 80 | ||
semi: true | ||
useTabs: false | ||
singleQuote: true | ||
trailingComma: "all" | ||
bracketSpacing: true | ||
jsxBracketSameLine: true | ||
parser: "flow" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,8 @@ | ||
#!/usr/bin/env node | ||
|
||
/** | ||
* @author Charlike Mike Reagent <open.source.charlike@gmail.com> | ||
* @copyright 2017 tunnckoCore and other contributors | ||
* @license MIT | ||
* @copyright 2017-present, Charlike Mike Reagent <olsten.larck@gmail.com> | ||
* @license Apache-2.0 | ||
*/ | ||
|
||
import parser from 'mri' | ||
import { hela, exec, shell } from './index.js' | ||
|
||
const options = { cwd: process.cwd(), hela, helaExec: exec, helaShell: shell } | ||
|
||
options.parse = (opts) => parser(process.argv.slice(2), opts) | ||
options.argv = options.parse() | ||
options.taskName = options.argv._[0] | ||
|
||
if (!options.argv._.length) { | ||
console.log('Usage: hela <taskName>') | ||
process.exit(1) | ||
} | ||
|
||
const onerror = (er) => { | ||
// Don't show stack/message | ||
// if it is `nyc check-coverage` command, | ||
// because it is already show that threshold is not meet | ||
const isNyc = er.message.indexOf('nyc') > 0 | ||
const isCov = er.message.indexOf('check-coverage') > 0 | ||
if (!isNyc && !isCov) { | ||
console.error('ERR!', er.stack || er.message) | ||
throw er | ||
} | ||
} | ||
|
||
hela(options) | ||
.then((tasks) => tasks[options.taskName]()) | ||
.then(() => process.exit(0)) | ||
.catch(onerror) | ||
.catch(() => process.exit(1)) | ||
module.exports = require('./esm-require.js')('./cli.mjs') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/** | ||
* @copyright 2017-present, Charlike Mike Reagent <olsten.larck@gmail.com> | ||
* @license Apache-2.0 | ||
*/ | ||
|
||
import parser from 'mri' | ||
import { hela, exec, shell } from './index.mjs' | ||
|
||
const options = { | ||
cwd: process.cwd(), | ||
hela, | ||
helaExec: exec, | ||
helaShell: shell, | ||
} | ||
|
||
options.parse = (opts) => parser(process.argv.slice(2), opts) | ||
options.argv = options.parse() | ||
options.taskName = options.argv._[0] | ||
|
||
if (!options.argv._.length) { | ||
console.log('Usage: hela <taskName>') | ||
process.exit(1) | ||
} | ||
|
||
const onerror = (er) => { | ||
// Don't show stack/message | ||
// if it is `nyc check-coverage` command, | ||
// because it is already show that threshold is not meet | ||
const isNyc = er.message.indexOf('nyc') > 0 | ||
const isCov = er.message.indexOf('check-coverage') > 0 | ||
if (!isNyc && !isCov) { | ||
console.error('ERR!', er.stack || er.message) | ||
throw er | ||
} | ||
} | ||
|
||
hela(options) | ||
.then((tasks) => tasks[options.taskName]()) | ||
.then(() => process.exit(0)) | ||
.catch(onerror) | ||
.catch(() => process.exit(1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* @copyright 2017-present, Charlike Mike Reagent <olsten.larck@gmail.com> | ||
* @license Apache-2.0 | ||
*/ | ||
|
||
function isObject (val) { | ||
return val && typeof val === 'object' && !Array.isArray(val) | ||
} | ||
|
||
function esmInteropRequire (id, opts) { | ||
const ex = require('@std/esm')(module, opts)(id) | ||
return isObject(ex) && 'default' in ex ? ex.default : ex | ||
} | ||
|
||
module.exports = esmInteropRequire |
Oops, something went wrong.