Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

untool

Package Overview
Dependencies
Maintainers
3
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

untool - npm Package Compare versions

Comparing version 0.4.0 to 0.6.0

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

<a name="0.6.0"></a>
# [0.6.0](https://github.com/untool/untool/compare/v0.5.1...v0.6.0) (2018-05-16)
**Note:** Version bump only for package untool
<a name="0.4.0"></a>

@@ -8,0 +16,0 @@ # [0.4.0](https://github.com/untool/untool/compare/v0.3.2...v0.4.0) (2018-04-16)

89

index.js

@@ -5,93 +5,10 @@ #!/usr/bin/env node

const { promisify } = require('util');
const { basename, dirname } = require('path');
const { dirname } = require('path');
const findUp = require('find-up');
const inquirer = require('inquirer');
const resolve = promisify(require('enhanced-resolve'));
const Manifest = require('./lib/pkg');
const pm = require('./lib/pm');
const log = (...messages) => result => {
// eslint-disable-next-line no-console
console.log(...messages);
return result;
};
const createManifest = () =>
inquirer
.prompt([
{
type: 'confirm',
name: 'init',
message: `Initialize ${basename(process.cwd())} as new project?`,
default: false,
},
])
.then(({ init }) => init || process.exit(0))
.then(log('! Initializing project...'))
.then(() => pm.init())
.then(() => new Manifest(`${process.cwd()}/package.json`));
const installUntool = manifest =>
inquirer
.prompt([
{
type: 'confirm',
name: 'defaults',
message: `Install untool default preset?`,
default: true,
},
])
.then(
({ defaults }) =>
defaults
? { presets: ['@untool/defaults'], mixins: [] }
: Promise.resolve()
.then(log('! Looking up presets and modules...'))
.then(() =>
Promise.all([
pm.search('keywords:unpreset'),
pm.search('keywords:unmixin', 'keywords:-unpreset'),
]).then(([allPresets, allMixins]) =>
inquirer.prompt([
{
type: 'checkbox',
name: 'presets',
message: 'What presets do you want to install?',
choices: allPresets.map(({ name }) => ({ name })).sort(),
},
{
type: 'checkbox',
name: 'mixins',
message: 'What mixins do you want to install?',
choices: allMixins.map(({ name }) => ({ name })).sort(),
},
])
)
)
)
.then(log('! Installing (this can take a while)...'))
.then(({ presets, mixins }) =>
pm
.install(...presets, ...mixins)
.then(() => manifest.add('untool', 'presets', presets))
.then(() => manifest.add('untool', 'mixins', mixins))
)
.then(() =>
resolve(process.cwd(), '@untool/yargs').catch(() => {
// eslint-disable-next-line no-console
console.error('\n/o\\ @untool/yargs not found. Aborting.\n');
process.exit(1);
})
)
.then(log('\n\\o/ All done!\n'));
findUp('package.json')
.then(pkgFile => (pkgFile ? new Manifest(pkgFile) : createManifest()))
.then(manifest =>
resolve(dirname(manifest.pkgFile), '@untool/yargs').then(
untoolYargs => require(untoolYargs).run(),
() => installUntool(manifest)
)
.then(pkgFile =>
resolve(dirname(pkgFile), '@untool/yargs').then(path => require(path).run())
)

@@ -98,0 +15,0 @@ .catch(error => {

{
"name": "untool",
"version": "0.4.0",
"version": "0.6.0",
"description": "untool cli",

@@ -25,5 +25,4 @@ "preferGlobal": true,

"enhanced-resolve": "^4.0.0",
"find-up": "^2.1.0",
"inquirer": "^5.2.0"
"find-up": "^2.1.0"
}
}

@@ -5,7 +5,7 @@ # `untool`

`untool` is our main, global command line interface. It serves two purposes: it can be used to to control `untool` projects and to bootstrap new ones. It provides a terminal command, `un`, that exposes its entire functionality.
`untool` is our main, global command line interface. It serves a single purposes: it can be used to to control `untool` projects. To do so, it provides the terminal command `un`.
### Installation
`untool` is meant to be installed globally, not in specific projects. If you want to add a local command line interface to your project to be used in `package.json` scripts, please use [`@untool/yargs`](https://github.com/untool/untool/blob/master/packages/yargs/README.md) instead.
`untool` is meant to be installed globally, not inside specific projects. If you want to add a local command line interface to your project to be used in `package.json` scripts, please just use [`@untool/yargs`](https://github.com/untool/untool/blob/master/packages/yargs/README.md) directly.

@@ -18,3 +18,3 @@ ```bash

`untools`'s mode of operation inside an existing project is that it will find a locally installed [`@untool/yargs`](https://github.com/untool/untool/blob/master/packages/yargs/README.md) and execute it. In this case, it will act as a very minimal wrapper around it.
`untools`'s mode of operation is that it will find a locally installed [`@untool/yargs`](https://github.com/untool/untool/blob/master/packages/yargs/README.md) and execute it. It will act as a very minimal wrapper around it.

@@ -34,6 +34,6 @@ ```text

Commands:
un serve Serve untest
un start Build and serve untest
un build Build untest
un develop Serve untest in watch mode
un serve Serve foo
un start Build and serve foo
un build Build foo
un develop Serve foo in watch mode

@@ -45,35 +45,4 @@ Options:

If you call `un` in a folder that does not contain a `package.json` file, however, it will offer to initialize the current folder as a new project and create one.
```text
$ un
? Initialize foo as new project? Yes
! Initializing project...
```
If you accept that offer or if you call `un` in a folder that already contains a `package.json` file, `un` will ask you if you want to install the [`@untool/defaults`](https://github.com/untool/untool/blob/master/packages/defaults/README.md) preset.
```text
$ un
? Install untool default preset? Yes
! Installing (this can take a while)...
\o/ All done!
```
If you do not accept, `un` will search NPM for the keywords `unmixin` and `unpreset` and offer to install the packages it finds. Please make sure you, at the very least, select [`@untool/yargs`](https://github.com/untool/untool/blob/master/packages/yargs/README.md).
```text
$ un
? Install untool default preset? No
! Looking up presets and modules...
? What presets do you want to install? @untool/express, @untool/webpack
? What mixins do you want to install? @untool/react, @untool/yargs
! Installing (this can take a while)...
\o/ All done!
```
### API
`untool` does not provide an API. [`@untool/webpack`](https://github.com/untool/untool/blob/master/packages/webpack/README.md), however, defines `untool` as an alias for [`@untool/core`](https://github.com/untool/untool/blob/master/packages/core/README.md) for your convenience: if you `import 'untool'` in your application, what you get are actually [`@untool/core`](https://github.com/untool/untool/blob/master/packages/core/README.md)'s `exports`.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc