Skip to content

Commit 3311d69

Browse files
billyjanitschnovemberborn
authored andcommitted
Replace --init flag with npx recommendation
* Remove --init flag * Move from ava-init to @ava/init
1 parent 84a884e commit 3311d69

File tree

5 files changed

+28
-87
lines changed

5 files changed

+28
-87
lines changed

docs/recipes/debugging-with-webstorm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Save the configuration.
1919

2020
## Setup using npm
2121

22-
Execute `ava --init` in your project directory to add AVA to your `package.json`.
22+
Execute `npx @ava/init` in your project directory to add AVA to your `package.json`.
2323

2424
Your `package.json` will look something like this:
2525

@@ -46,7 +46,7 @@ Your IDE will then execute `npm run test` and thus call `node_modules/.bin/ava`
4646

4747
In the `Node parameters`, for Node.js 7+ pass `--inspect-brk` or `--debug-brk` for earlier versions.
4848

49-
Don't forget to select a Node.js interpreter.
49+
Don't forget to select a Node.js interpreter.
5050

5151
Save the configuration.
5252

lib/cli.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ exports.run = () => {
3030
ava [<file|directory|glob> ...]
3131
3232
Options
33-
--init Add AVA to your project
3433
--watch, -w Re-run tests when tests and source files change
3534
--match, -m Only run tests with matching title (Can be repeated)
3635
--update-snapshots, -u Update snapshots
@@ -49,15 +48,11 @@ exports.run = () => {
4948
ava test.js test2.js
5049
ava test-*.js
5150
ava test
52-
ava --init
5351
5452
Default patterns when no arguments:
5553
test.js test-*.js test/**/*.js **/__tests__/**/*.js **/*.test.js
5654
`, {
5755
flags: {
58-
init: {
59-
type: 'boolean'
60-
},
6156
watch: {
6257
type: 'boolean',
6358
alias: 'w'
@@ -116,11 +111,6 @@ exports.run = () => {
116111

117112
updateNotifier({pkg: cli.pkg}).notify();
118113

119-
if (cli.flags.init) {
120-
require('ava-init')();
121-
return;
122-
}
123-
124114
if (cli.flags.watch && cli.flags.tap && !conf.tap) {
125115
throw new Error(`${colors.error(figures.cross)} The TAP reporter is not available when using watch mode.`);
126116
}

package-lock.json

Lines changed: 13 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
"array-uniq": "^1.0.2",
7676
"arrify": "^1.0.0",
7777
"auto-bind": "^1.2.0",
78-
"ava-init": "^0.2.1",
7978
"bluebird": "^3.5.1",
8079
"caching-transform": "^1.0.0",
8180
"chalk": "^2.3.1",

readme.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,10 @@ test('arrays are equal', t => {
7272

7373
### Add AVA to your project
7474

75-
Install AVA and run it with `--init` to add AVA to your `package.json`:
75+
To install and set up AVA, run:
7676

7777
```console
78-
$ npm install ava@next --save-dev
79-
$ npx ava --init
80-
```
81-
82-
If you prefer using [Yarn](https://yarnpkg.com/en/):
83-
84-
```console
85-
$ yarn add --dev ava@next
86-
$ yarn run ava --init
78+
$ npx @ava/init --next
8779
```
8880

8981
Your `package.json` will then look like this:
@@ -100,7 +92,17 @@ Your `package.json` will then look like this:
10092
}
10193
```
10294

103-
Running `npx` requires [`[email protected]`](https://github.com/npm/npm/releases/tag/v5.2.0) or greater. Otherwise, you'll have to manually configure the `test` script in your `package.json` to use `ava` (see above).
95+
Initialization will work with npm and Yarn, but running `npx` requires [`[email protected]`](https://github.com/npm/npm/releases/tag/v5.2.0) or greater to be installed. Otherwise, you'll have to manually install `ava` and configure the `test` script in your `package.json` as per above:
96+
97+
```console
98+
$ npm install --save-dev ava@next
99+
```
100+
101+
Or if you prefer using Yarn:
102+
103+
```console
104+
$ yarn add --dev ava@next
105+
```
104106

105107
### Create your test file
106108

0 commit comments

Comments
 (0)