Skip to content

Commit de5f0c8

Browse files
committed
fix: Bump tymly-scaffold to 1.7.2. Correct tests to match
1 parent eee82b3 commit de5f0c8

5 files changed

Lines changed: 37 additions & 13 deletions

File tree

lib/actions/util/name.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
const validator = require('../util/validators')
2+
const ask = require('../util/ask')
3+
const labelAndDescription = require('./label-and-description')
4+
const _ = require('lodash')
5+
6+
async function nameLabelDescription (thing) {
7+
const name = await ask({
8+
message: `${thing} name`,
9+
validate: validator.notEmptyNoSpaces()
10+
})
11+
console.log()
12+
13+
const suggestion = _.upperFirst(_.lowerCase(name))
14+
const { label, description } =
15+
await labelAndDescription(suggestion, suggestion)
16+
17+
return {
18+
name,
19+
label,
20+
description
21+
}
22+
} // nameLabelDescription
23+
24+
module.exports = nameLabelDescription

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"tymly": "bin/tymly-cli.js"
2424
},
2525
"dependencies": {
26-
"@wmfs/tymly-scaffold": "1.17.0",
26+
"@wmfs/tymly-scaffold": "1.17.2",
2727
"ansi-colors": "3.2.3",
2828
"commander": "2.19.0",
2929
"enquirer": "2.3.0",

test/fixtures/add-model/expected/multiple-fields/models/pizza.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@
55
"type": "object",
66
"properties": {
77
"code": {
8-
"title": "Code",
9-
"type": "string"
8+
"type": "string",
9+
"title": "Code"
1010
},
1111
"label": {
12-
"title": "Customer-facing label",
13-
"type": "string"
12+
"type": "string",
13+
"title": "Customer-facing label"
1414
},
1515
"popularitySeq": {
16-
"title": "Popularity seq",
17-
"type": "integer"
16+
"type": "integer",
17+
"title": "Popularity seq"
1818
},
1919
"vegetarian": {
20-
"title": "Vegetarian",
21-
"type": "boolean"
20+
"type": "boolean",
21+
"title": "Vegetarian"
2222
}
2323
},
2424
"required": [

test/fixtures/add-model/expected/named-pizza/models/pizza.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"type": "object",
66
"properties": {
77
"name": {
8-
"title": "Name",
9-
"type": "string"
8+
"type": "string",
9+
"title": "Name"
1010
}
1111
},
1212
"required": [

test/fixtures/add-model/expected/no-blanks-in-field-names/models/pizza.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"type": "object",
66
"properties": {
77
"name": {
8-
"title": "Name",
9-
"type": "string"
8+
"type": "string",
9+
"title": "Name"
1010
}
1111
},
1212
"required": [

0 commit comments

Comments
 (0)