Skip to content

Commit 0b03aec

Browse files
committedSep 2, 2024
feat(choice-scaffolder): expect choice plugins to follow the shape of a full plugin
BREAKING CHANGE: choice plugins are expected to define a `scaffold` function rather than the previously expected `scaffolder` function
1 parent 1522c88 commit 0b03aec

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed
 

‎.remarkrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// https://github.com/remarkjs/remark/tree/master/packages/remark-stringify#options
22
exports.settings = {
3-
listItemIndent: 1,
3+
listItemIndent: 'one',
44
emphasis: '_',
55
strong: '_',
66
bullet: '*',

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const {scaffoldChoice} = require('@form8ion/javascript-core');
8484
```javascript
8585
(async () => {
8686
await scaffoldChoice(
87-
{foo: {scaffolder: options => options}},
87+
{foo: {scaffold: options => options}},
8888
'foo',
8989
{bar: 'baz'}
9090
);

‎example.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ stubbedFs();
1414

1515
(async () => {
1616
await scaffoldChoice(
17-
{foo: {scaffolder: options => options}},
17+
{foo: {scaffold: options => options}},
1818
'foo',
1919
{bar: 'baz'}
2020
);

‎src/choice-scaffolder-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ suite('type choice scaffolder', () => {
1010
const options = any.simpleObject();
1111
const results = any.simpleObject();
1212
const chosenScaffolder = sinon.stub();
13-
const choices = {...any.simpleObject(), [choice]: {scaffolder: chosenScaffolder}};
13+
const choices = {...any.simpleObject(), [choice]: {scaffold: chosenScaffolder}};
1414
chosenScaffolder.withArgs(options).resolves(results);
1515

1616
assert.equal(await scaffoldTypeChoice(choices, choice, options), results);

‎src/choice-scaffolder.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default function (choices, choice, options) {
22
const type = choices[choice];
33

4-
if (type) return type.scaffolder(options);
4+
if (type) return type.scaffold(options);
55

66
return {scripts: {}, dependencies: [], devDependencies: [], vcsIgnore: {files: [], directories: []}};
77
}

0 commit comments

Comments
 (0)
Please sign in to comment.