Skip to content

Commit c1b3b21

Browse files
committed
Merge branch 'v3' into main
2 parents 53369fd + 7b29db7 commit c1b3b21

32 files changed

+1395
-667
lines changed

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "npm"
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 20
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"

.github/workflows/ci.yml

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
name: NPM Test
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request:
8+
branches:
9+
- '*'
410

511
jobs:
612
build:
713

814
runs-on: ${{ matrix.os }}
915

1016
strategy:
17+
fail-fast: false
1118
matrix:
1219
os: [ubuntu-latest, windows-latest, macos-latest]
13-
node-version: [10.x, 12.x]
20+
node-version: [12.x, 14.x]
1421
generator-version: [2.0.5, latest]
1522

1623
steps:
1724
- uses: actions/checkout@v2
18-
- uses: actions/setup-node@v1.2.0
25+
- uses: actions/setup-node@v2.1.2
1926
with:
2027
node-version: ${{ matrix.node-version }}
2128
- run: npm ci

.github/workflows/gh_pages.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
name: Update api docs
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/setup-node@v1
14+
- uses: actions/setup-node@v2.1.2
1515
- run: npm install -g jsdoc prettier
1616
- uses: actions/checkout@v2
1717
with:
@@ -24,6 +24,7 @@ jobs:
2424
run: |
2525
cd source
2626
npm ci
27+
npm install tui-jsdoc-template --no-package-lock
2728
jsdoc -c jsdoc.json -d ../out
2829
- name: Run prettier
2930
run: |

.github/workflows/integration.yml

+19-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Integration Build
22

3-
on: [push, pull_request]
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'dependabot/**'
7+
pull_request:
8+
branches:
9+
- '*'
410

511
jobs:
612
build:
@@ -10,7 +16,7 @@ jobs:
1016
strategy:
1117
matrix:
1218
os: [ubuntu-latest]
13-
node-version: [12.x]
19+
node-version: [14.x]
1420

1521
steps:
1622
- name: Checkout yeoman-test
@@ -30,30 +36,34 @@ jobs:
3036
with:
3137
path: yeoman-environment
3238

33-
- uses: actions/setup-node@v1
39+
- uses: actions/setup-node@v2.1.2
3440
with:
3541
node-version: ${{ matrix.node-version }}
3642

43+
- run: npm install -g npm@^7.0.0
44+
3745
- name: Run yeoman-test test
3846
run: |
3947
cd $GITHUB_WORKSPACE/yeoman-test
4048
npm ci
41-
npm install yeoman/generator#master
42-
npm install ${{ github.repository }}#$GITHUB_SHA
49+
npm install yeoman/generator#main
50+
npm install ${{ github.repository }}#$GITHUB_REF
4351
npm test
4452
4553
- name: Run yeoman-generator test
54+
if: always()
4655
run: |
4756
cd $GITHUB_WORKSPACE/yeoman-generator
4857
npm ci
49-
npm install yeoman/yeoman-test#master
50-
npm install ${{ github.repository }}#$GITHUB_SHA
58+
npm install yeoman/yeoman-test#main
59+
npm install ${{ github.repository }}#$GITHUB_REF
5160
npm test
5261
5362
- name: Run yeoman-environment test
63+
if: always()
5464
run: |
5565
cd $GITHUB_WORKSPACE/yeoman-environment
5666
npm ci
57-
npm install yeoman/yeoman-test#master
58-
npm install yeoman/generator#master
67+
npm install yeoman/yeoman-test#main
68+
npm install yeoman/generator#main
5969
npm test

.github/workflows/milestone.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
if: startsWith(github.event.milestone.title, 'v') && startsWith(github.event.milestone.description, 'Do release')
1212
steps:
1313
- uses: actions/checkout@v2
14-
- uses: actions/setup-node@v1
14+
- uses: actions/setup-node@v2.1.2
1515
- name: Verify version
1616
run: |
1717
npm install -g semver

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v2
1313

14-
- uses: actions/setup-node@v1
14+
- uses: actions/setup-node@v2.1.2
1515
with:
1616
registry-url: 'https://registry.npmjs.org/'
1717

.github/workflows/stale.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ jobs:
77
stale:
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/stale@v1
10+
- uses: actions/stale@v3
1111
with:
1212
repo-token: ${{ secrets.GITHUB_TOKEN }}
13-
stale-issue-message: 'This issue is stale because it has been open more than 45 days with no activity. Remove stale label or comment or this will be closed in 15 days'
14-
days-before-stale: 45
15-
days-before-close: 15
13+
stale-issue-message: 'This issue is stale because it has been open with no activity. Remove stale label or comment or this will be closed'
14+
days-before-stale: 30
15+
days-before-close: 5
1616
stale-issue-label: 'stale'
17-
exempt-issue-label: 'not stale'
17+
exempt-issue-labels: 'not stale'

.github/workflows/triage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
apply-label:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/github-script@0.3.0
8+
- uses: actions/github-script@v3
99
with:
1010
github-token: ${{secrets.GITHUB_TOKEN}}
1111
script: |

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
node_modules
22
coverage
33
.nyc_output
4+
/.project

lib/adapter.js

+16-20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict';
2-
const _ = require('lodash');
32
const inquirer = require('inquirer');
43
const diff = require('diff');
54
const chalk = require('chalk');
@@ -34,8 +33,8 @@ class TerminalAdapter {
3433
return chalk.bgRed;
3534
}
3635

37-
_colorLines(name, str) {
38-
return str.split('\n').map(line => this[`_colorDiff${name}`](line)).join('\n');
36+
_colorLines(name, string) {
37+
return string.split('\n').map(line => this[`_colorDiff${name}`](line)).join('\n');
3938
}
4039

4140
/**
@@ -49,16 +48,13 @@ class TerminalAdapter {
4948
*
5049
* @param {Object|Object[]} questions
5150
* @param {Object} [answers] Answers to be passed to inquirer
52-
* @param {Function} [callback] callback
51+
* @return {Object} promise answers
5352
*/
5453
prompt(questions, answers, cb) {
55-
if (typeof answers === 'function') {
56-
cb = answers;
57-
answers = undefined;
54+
if (typeof answers === 'function' || typeof cb === 'function') {
55+
throw new TypeError('Callback support have been removed.');
5856
}
59-
const promise = this.promptModule(questions, answers);
60-
promise.then(cb || _.noop);
61-
return promise;
57+
return this.promptModule(questions, answers);
6258
}
6359

6460
/**
@@ -73,29 +69,29 @@ class TerminalAdapter {
7369
changes = actual;
7470
}
7571
changes = changes || diff.diffLines(actual, expected);
76-
let msg = changes.map(str => {
77-
if (str.added) {
78-
return this._colorLines('Added', str.value);
72+
let message = changes.map(string => {
73+
if (string.added) {
74+
return this._colorLines('Added', string.value);
7975
}
8076

81-
if (str.removed) {
82-
return this._colorLines('Removed', str.value);
77+
if (string.removed) {
78+
return this._colorLines('Removed', string.value);
8379
}
8480

85-
return str.value;
81+
return string.value;
8682
}).join('');
8783

8884
// Legend
89-
msg = '\n' +
85+
message = '\n' +
9086
this._colorDiffRemoved('removed') +
9187
' ' +
9288
this._colorDiffAdded('added') +
9389
'\n\n' +
94-
msg +
90+
message +
9591
'\n';
9692

97-
this.console.log(msg);
98-
return msg;
93+
this.console.log(message);
94+
return message;
9995
}
10096
}
10197

0 commit comments

Comments
 (0)