Comparing version 0.4.0 to 0.6.0
@@ -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`. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
2
1
0
4163
4
15
45
- Removedinquirer@^5.2.0
- Removedansi-escapes@3.2.0(transitive)
- Removedansi-regex@3.0.1(transitive)
- Removedansi-styles@3.2.1(transitive)
- Removedchalk@2.4.2(transitive)
- Removedchardet@0.4.2(transitive)
- Removedcli-cursor@2.1.0(transitive)
- Removedcli-width@2.2.1(transitive)
- Removedcolor-convert@1.9.3(transitive)
- Removedcolor-name@1.1.3(transitive)
- Removedescape-string-regexp@1.0.5(transitive)
- Removedexternal-editor@2.2.0(transitive)
- Removedfigures@2.0.0(transitive)
- Removedhas-flag@3.0.0(transitive)
- Removediconv-lite@0.4.24(transitive)
- Removedinquirer@5.2.0(transitive)
- Removedis-fullwidth-code-point@2.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedmimic-fn@1.2.0(transitive)
- Removedmute-stream@0.0.7(transitive)
- Removedonetime@2.0.1(transitive)
- Removedos-tmpdir@1.0.2(transitive)
- Removedrestore-cursor@2.0.0(transitive)
- Removedrun-async@2.4.1(transitive)
- Removedrxjs@5.5.12(transitive)
- Removedsafer-buffer@2.1.2(transitive)
- Removedsignal-exit@3.0.7(transitive)
- Removedstring-width@2.1.1(transitive)
- Removedstrip-ansi@4.0.0(transitive)
- Removedsupports-color@5.5.0(transitive)
- Removedsymbol-observable@1.0.1(transitive)
- Removedthrough@2.3.8(transitive)
- Removedtmp@0.0.33(transitive)