Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: unifiedjs/unified-args
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8e9db336bb0110b4d46d3673d7d138c2e56de687
Choose a base ref
...
head repository: unifiedjs/unified-args
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f5f698cad50cc4284702094342cf0f8180dfb23b
Choose a head ref

Commits on Jul 19, 2017

  1. Fix prettifying of markdown

    wooorm committed Jul 19, 2017
    Copy the full SHA
    381f1b3 View commit details

Commits on Nov 17, 2017

  1. Replace custom JSON parsing with JSON5

    This drops support for automatic camel-casing of properties, and also
    removes support for dash-cased identifiers.
    
    Closes GH-16.
    wooorm committed Nov 17, 2017
    Copy the full SHA
    0693817 View commit details
  2. Update dev-dependencies

    wooorm committed Nov 17, 2017
    Copy the full SHA
    ea05603 View commit details
  3. Update unified-engine

    wooorm committed Nov 17, 2017
    Copy the full SHA
    dca5942 View commit details
  4. Update Node in Travis

    wooorm committed Nov 17, 2017
    Copy the full SHA
    fa72b1c View commit details
  5. Add skip_cleanup to Travis

    wooorm committed Nov 17, 2017
    Copy the full SHA
    26d66ec View commit details
  6. 5.0.0

    wooorm committed Nov 17, 2017
    Copy the full SHA
    834b649 View commit details
  7. Copy the full SHA
    1aca62b View commit details

Commits on Dec 8, 2017

  1. Fix link

    wooorm committed Dec 8, 2017
    Copy the full SHA
    b0ad11b View commit details

Commits on Jan 18, 2018

  1. Copy the full SHA
    b752e4e View commit details
  2. 5.1.0

    wooorm committed Jan 18, 2018
    Copy the full SHA
    29c338d View commit details

Commits on May 10, 2018

  1. Copy the full SHA
    4873cea View commit details
  2. Update Node in Travis

    wooorm committed May 10, 2018
    Copy the full SHA
    364bbcc View commit details
  3. Add .npmrc

    wooorm committed May 10, 2018
    Copy the full SHA
    fb6f785 View commit details
  4. Add yarn.lock to .gitignore

    wooorm committed May 10, 2018
    Copy the full SHA
    ce3bbce View commit details
  5. Update camelcase, chokidar, and json5

    Closes GH-19.
    wooorm committed May 10, 2018
    Copy the full SHA
    a7d8020 View commit details
  6. Update dev-dependencies

    wooorm committed May 10, 2018
    Copy the full SHA
    b1ae985 View commit details
  7. Refactor code-style

    wooorm committed May 10, 2018
    Copy the full SHA
    4852b1a View commit details
  8. Use stdout(4) instead of stderr(4) for -v, -h

    Closes GH-18.
    wooorm committed May 10, 2018
    Copy the full SHA
    9a86af8 View commit details
  9. Update unified-engine

    wooorm committed May 10, 2018
    Copy the full SHA
    cfde7a0 View commit details
  10. 6.0.0

    wooorm committed May 10, 2018
    Copy the full SHA
    d2faaef View commit details

Commits on Jun 13, 2019

  1. Update dev-dependencies

    wooorm committed Jun 13, 2019
    Copy the full SHA
    072a421 View commit details
  2. Update json5

    wooorm committed Jun 13, 2019
    Copy the full SHA
    2875873 View commit details
  3. Update chokidar

    wooorm committed Jun 13, 2019
    Copy the full SHA
    ec31cc0 View commit details
  4. Move LICENSE > license

    wooorm committed Jun 13, 2019
    Copy the full SHA
    8c83000 View commit details
  5. Move URLs to HTTPS

    wooorm committed Jun 13, 2019
    Copy the full SHA
    9b20b7e View commit details
  6. Fix tests on Windows

    wooorm committed Jun 13, 2019
    Copy the full SHA
    d22b55a View commit details
  7. Update Node in Travis

    wooorm committed Jun 13, 2019
    Copy the full SHA
    93250eb View commit details
  8. Add Windows to Travis

    wooorm committed Jun 13, 2019
    Copy the full SHA
    7f911be View commit details
  9. Refactor comments

    wooorm committed Jun 13, 2019
    Copy the full SHA
    f65e28e View commit details
  10. Refactor prose

    wooorm committed Jun 13, 2019
    Copy the full SHA
    3ef82d6 View commit details

Commits on Jun 14, 2019

  1. Fix tests on Windows

    Closes GH-21.
    wooorm authored Jun 14, 2019
    Copy the full SHA
    972ef63 View commit details

Commits on Jun 25, 2019

  1. Update dev-dependencies

    wooorm committed Jun 25, 2019
    Copy the full SHA
    bf6d6eb View commit details
  2. Update unified-engine

    wooorm committed Jun 25, 2019
    Copy the full SHA
    03081cc View commit details
  3. Fix support for --file-path

    Closes GH-22.
    wooorm committed Jun 25, 2019
    Copy the full SHA
    daef413 View commit details
  4. 7.0.0

    wooorm committed Jun 25, 2019
    Copy the full SHA
    f5f698c View commit details
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -3,3 +3,4 @@
.nyc_output/
coverage/
node_modules/
yarn.lock
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coverage/
21 changes: 10 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
language: node_js
os:
- windows
- linux
node_js:
- '4.0'
- '8.0'
after_script: bash <(curl -s https://codecov.io/bash)
deploy:
- provider: npm
email: tituswormer@gmail.com
api_key:
secure: DGeVrpsbWkf6p1gSyRVKTwNlAM/nflJKDOoWSDkH02yWo0klnZso+tZwZLgZKQslJTtWT5pEljkHazACXUiGyFTKaKJZgfEATurJfobDUFS0pwIQGMJiZKsi0LmzkFixMJb1w78UMr1nhIoGsXccHnH3SmZgAJsUUpQzKmbXa8wElOb3I9f80crzH0mo0+wyiKJdIqUho1meUKquZ54sptYlXAdcv/T0NkFqjcnIzLxP3+qAr6F+34wDGIEifQsx/AYNSoMzqLLmtaz02jnYUO48dEBnQb7BQsNZ34lQN+nitPEsEs9Tgl/a8EebkNI2VtuiLdbABaEse7xKFa/rEFXxsCE3m+FakEhY5POKxpx+k/JJPBf6ma9EY+TGqMdTnUAjKxZhKJO/TISrPlKe5m65kX4Yqc6H9IDJC0QJGwXjxbmNjoUODa0dM6XM1XoDlWtMxTw7EMXtvSYuhN5N+IxIt0tnqxKmzz+qvzhHt3Q+wd+Zd1VsogES/zlpqV0aysXfb8V2/NSvimYK2PDgLGRHLboC2WqNva6GdMZ7kRJ89MiCG84JvnsfliFydcsKg5Qgg4Lg7mXYQqJo/okrmIP87NfrTk+GtwrGzP3l+RfIKcvv7ScQqVRdkSbDZW9j/czQTdFvZdXV/Wr574bEIyqwK5PFRqhPQ3+ZI2wqPkU=
on:
tags: true
node: '4.0'
- lts/dubnium
- node
script:
- if [ "$TRAVIS_OS_NAME" != "windows" ]; then npm test; fi
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then npm run test-api; fi
after_script:
- bash <(curl -s https://codecov.io/bash)
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
'use strict';
module.exports = require('./lib/index.js');
'use strict'
module.exports = require('./lib')
192 changes: 97 additions & 95 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,156 +1,158 @@
'use strict';
'use strict'

var stream = require('stream');
var engine = require('unified-engine');
var chalk = require('chalk');
var chokidar = require('chokidar');
var options = require('./options');
var stream = require('stream')
var engine = require('unified-engine')
var chalk = require('chalk')
var chokidar = require('chokidar')
var options = require('./options')

module.exports = start;
module.exports = start

/* No-op. */
var noop = Function.prototype;
var noop = Function.prototype

/* Fake TTY stream. */
var ttyStream = new stream.Readable();
ttyStream.isTTY = true;
// Fake TTY stream.
var ttyStream = new stream.Readable()
ttyStream.isTTY = true

/* Exit, lazily, with the correct exit status code. */
var exitStatus = 0;
// Exit, lazily, with the correct exit status code.
var exitStatus = 0

process.on('exit', onexit);
process.on('exit', onexit)

/* Handle uncaught errors, such as from unexpected async
* behaviour. */
process.on('uncaughtException', fail);
// Handle uncaught errors, such as from unexpected async behaviour.
process.on('uncaughtException', fail)

/* Start the CLI. */
function start(configuration) {
var config;
var output;
var watcher;
// Start the CLI.
function start(cliConfig) {
var config
var output
var watcher

try {
config = options(process.argv.slice(2), configuration);
} catch (err) {
return fail(err, true);
config = options(process.argv.slice(2), cliConfig)
} catch (error) {
return fail(error, true)
}

if (config.help) {
process.stderr.write([
'Usage: ' + configuration.name + ' [options] [path | glob ...]',
'',
' ' + configuration.description,
'',
'Options:',
'',
config.helpMessage
].join('\n') + '\n', noop);

return;
process.stdout.write(
[
'Usage: ' + cliConfig.name + ' [options] [path | glob ...]',
'',
' ' + cliConfig.description,
'',
'Options:',
'',
config.helpMessage,
''
].join('\n'),
noop
)

return
}

if (config.version) {
process.stderr.write(configuration.version + '\n', noop);
process.stdout.write(cliConfig.version + '\n', noop)

return;
return
}

/* Modify `config` for watching. */
// Modify `config` for watching.
if (config.watch) {
output = config.output;
output = config.output

/* Do not read from stdin(4). */
config.streamIn = ttyStream;
// Do not read from stdin(4).
config.streamIn = ttyStream

/* Do not write to stdout(4). */
config.out = false;
// Do not write to stdout(4).
config.out = false

process.stderr.write(
chalk.bold('Watching...') + ' (press CTRL+C to exit)\n',
noop
);
)

/* Prevent infinite loop if set to regeneration. */
// Prevent infinite loop if set to regeneration.
if (output === true) {
config.output = false;
config.output = false

process.stderr.write(
chalk.yellow('Note') + ': Ignoring `--output` until exit.\n',
noop
);
)
}
}

// Initial run.
engine(config, done)

// Handle complete run.
function done(err, code, context) {
if (err) {
clean()
fail(err)
} else {
exitStatus = code

if (config.watch && !watcher) {
subscribe(context)
}
}
}

// Clean the watcher.
function clean() {
if (watcher) {
watcher.close()
watcher = null
}
}

/* Subscribe a chokidar watcher to all processed files. */
// Subscribe a chokidar watcher to all processed files.
function subscribe(context) {
watcher = chokidar
.watch(context.fileSet.origins, {
cwd: config.cwd,
ignoreInitial: true
})
.watch(context.fileSet.origins, {cwd: config.cwd, ignoreInitial: true})
.on('error', done)
.on('change', onchange);
.on('change', onchange)

process.on('SIGINT', onsigint);
process.on('SIGINT', onsigint)

function onchange(filePath) {
config.files = [filePath];
config.files = [filePath]

engine(config, done);
engine(config, done)
}

function onsigint() {
/* Hide the `^C` in terminal. */
process.stderr.write('\n', noop);
// Hide the `^C` in terminal.
process.stderr.write('\n', noop)

clean();
clean()

/* Do another process if `output` specified regeneration. */
// Do another process if `output` specified regeneration.
if (output === true) {
config.output = output;
config.watch = false;
engine(config, done);
}
}
}

/* Initial run */
engine(config, done);

/* Handle complete run. */
function done(err, code, context) {
if (err) {
clean();
fail(err);
} else {
exitStatus = code;

if (config.watch && !watcher) {
subscribe(context);
config.output = output
config.watch = false
engine(config, done)
}
}
}

/* Clean the watcher. */
function clean() {
if (watcher) {
watcher.close();
watcher = null;
}
}
}

/* Print an error, optionally with stack. */
// Print an error, optionally with stack.
function fail(err, pretty) {
var message = (pretty ? String(err).trim() : err.stack) || err;
var message =
(pretty ? String(err).trim() : err.stack) ||
/* istanbul ignore next - Old versions of Node */ err

exitStatus = 1;
exitStatus = 1

process.stderr.write(message.trim() + '\n', noop);
process.stderr.write(message.trim() + '\n', noop)
}

function onexit() {
/* eslint-disable unicorn/no-process-exit */
process.exit(exitStatus);
process.exit(exitStatus)
/* eslint-enable unicorn/no-process-exit */
}
Loading