@form8ion/project 21.1.1 → 22.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -24
- package/lib/index.js +103 -84
- package/lib/index.js.map +1 -1
- package/package.json +5 -7
- package/src/dependency-updater/prompt.js +12 -8
- package/src/dependency-updater/prompt.test.js +13 -16
- package/src/dependency-updater/scaffolder.js +2 -2
- package/src/dependency-updater/scaffolder.test.js +7 -11
- package/src/index.js +4 -6
- package/src/language/prompt.js +12 -9
- package/src/language/prompt.test.js +13 -16
- package/src/language/scaffolder.js +2 -2
- package/src/language/scaffolder.test.js +3 -3
- package/src/options-validator.js +0 -2
- package/src/options-validator.test.js +1 -5
- package/src/prompts/index.js +21 -0
- package/src/prompts/questions.js +7 -3
- package/src/prompts/questions.test.js +5 -6
- package/src/scaffolder.js +9 -10
- package/src/scaffolder.test.js +20 -30
- package/src/vcs/host/prompt.js +12 -9
- package/src/vcs/host/prompt.test.js +27 -23
- package/src/vcs/host/scaffolder.js +3 -4
- package/src/vcs/host/scaffolder.test.js +6 -10
- package/src/vcs/prompt.js +8 -8
- package/src/vcs/prompt.test.js +12 -11
- package/src/vcs/scaffolder.js +3 -7
- package/src/vcs/scaffolder.test.js +8 -8
- package/src/options-schemas.js +0 -3
- package/src/options-schemas.test.js +0 -20
- package/src/prompts/terminal-prompt.js +0 -5
- package/src/prompts/terminal-prompt.test.js +0 -20
package/README.md
CHANGED
|
@@ -71,43 +71,48 @@ a wrapper.
|
|
|
71
71
|
#### Import
|
|
72
72
|
|
|
73
73
|
```javascript
|
|
74
|
+
import {ungroupObject} from '@form8ion/core';
|
|
74
75
|
import {lift, questionNames, scaffold} from '@form8ion/project';
|
|
75
76
|
```
|
|
76
77
|
|
|
77
78
|
#### Execute
|
|
78
79
|
|
|
79
80
|
```javascript
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
[questionNames.LICENSE]: 'MIT',
|
|
84
|
-
[questionNames.VISIBILITY]: 'Public',
|
|
85
|
-
[questionNames.DESCRIPTION]: 'My project',
|
|
86
|
-
[questionNames.GIT_REPO]: false,
|
|
87
|
-
[questionNames.COPYRIGHT_HOLDER]: 'John Smith',
|
|
88
|
-
[questionNames.COPYRIGHT_YEAR]: '2022',
|
|
89
|
-
[questionNames.PROJECT_LANGUAGE]: 'foo'
|
|
81
|
+
const plugins = {
|
|
82
|
+
dependencyUpdaters: {
|
|
83
|
+
bar: {scaffold: options => options}
|
|
90
84
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
vcsHosts: {
|
|
99
|
-
baz: {
|
|
100
|
-
scaffold: options => options,
|
|
101
|
-
prompt: () => ({repoOwner: 'form8ion'})
|
|
102
|
-
}
|
|
85
|
+
languages: {
|
|
86
|
+
foo: {scaffold: options => options}
|
|
87
|
+
},
|
|
88
|
+
vcsHosts: {
|
|
89
|
+
baz: {
|
|
90
|
+
scaffold: options => options,
|
|
91
|
+
prompt: () => ({repoOwner: 'form8ion'})
|
|
103
92
|
}
|
|
104
93
|
}
|
|
105
|
-
}
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
await scaffold(
|
|
97
|
+
{plugins},
|
|
98
|
+
{
|
|
99
|
+
prompt: () => ({
|
|
100
|
+
[questionNames.PROJECT_NAME]: 'my-project',
|
|
101
|
+
[questionNames.LICENSE]: 'MIT',
|
|
102
|
+
[questionNames.VISIBILITY]: 'Public',
|
|
103
|
+
[questionNames.DESCRIPTION]: 'My project',
|
|
104
|
+
[questionNames.GIT_REPO]: false,
|
|
105
|
+
[questionNames.COPYRIGHT_HOLDER]: 'John Smith',
|
|
106
|
+
[questionNames.COPYRIGHT_YEAR]: '2022',
|
|
107
|
+
[questionNames.PROJECT_LANGUAGE]: 'foo'
|
|
108
|
+
})
|
|
109
|
+
}
|
|
110
|
+
);
|
|
106
111
|
|
|
107
112
|
await lift({
|
|
108
113
|
projectRoot: process.cwd(),
|
|
109
114
|
results: {},
|
|
110
|
-
enhancers:
|
|
115
|
+
enhancers: ungroupObject(plugins),
|
|
111
116
|
vcs: {}
|
|
112
117
|
});
|
|
113
118
|
```
|
package/lib/index.js
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { questionsForBaseDetails, questionNames as questionNames$2, fileExists, optionsSchemas, validateOptions, applyEnhancers } from '@form8ion/core';
|
|
2
2
|
import deepmerge from 'deepmerge';
|
|
3
3
|
import { execa } from 'execa';
|
|
4
|
-
import { reportResults } from '@form8ion/results-reporter';
|
|
5
4
|
import { lift as lift$1, scaffold as scaffold$2 } from '@form8ion/readme';
|
|
6
5
|
import { warn, info } from '@travi/cli-messages';
|
|
7
|
-
import { prompt } from '@form8ion/overridable-prompts';
|
|
8
6
|
import * as gitPlugin from '@form8ion/git';
|
|
9
7
|
import { test, scaffold as scaffold$1 } from '@form8ion/git';
|
|
10
8
|
import { simpleGit } from 'simple-git';
|
|
@@ -18,6 +16,15 @@ import { promises as promises$1 } from 'node:fs';
|
|
|
18
16
|
import { resolve } from 'path';
|
|
19
17
|
import filedirname from 'filedirname';
|
|
20
18
|
|
|
19
|
+
const BASE_DETAILS_PROMPT_ID = 'BASE_DETAILS';
|
|
20
|
+
|
|
21
|
+
function promptForBaseDetails(projectRoot, {prompt}) {
|
|
22
|
+
return prompt({
|
|
23
|
+
id: BASE_DETAILS_PROMPT_ID,
|
|
24
|
+
questions: questionsForBaseDetails(projectRoot)
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
21
28
|
const questionNames$1 = {
|
|
22
29
|
GIT_REPO: 'gitRepo',
|
|
23
30
|
REPO_HOST: 'repoHost',
|
|
@@ -26,37 +33,88 @@ const questionNames$1 = {
|
|
|
26
33
|
DEPENDENCY_UPDATER: 'dependencyUpdater'
|
|
27
34
|
};
|
|
28
35
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
const GIT_REPOSITORY_PROMPT_ID = 'GIT_REPOSITORY';
|
|
37
|
+
|
|
38
|
+
async function promptForRepoCreation({prompt}) {
|
|
39
|
+
const {[questionNames$1.GIT_REPO]: gitRepoShouldBeCreated} = await prompt({
|
|
40
|
+
id: GIT_REPOSITORY_PROMPT_ID,
|
|
41
|
+
questions: [{
|
|
42
|
+
name: questionNames$1.GIT_REPO,
|
|
43
|
+
type: 'confirm',
|
|
44
|
+
default: true,
|
|
45
|
+
message: 'Should a git repository be initialized?'
|
|
46
|
+
}]
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
return gitRepoShouldBeCreated;
|
|
36
50
|
}
|
|
37
51
|
|
|
38
|
-
|
|
39
|
-
|
|
52
|
+
const PROJECT_LANGUAGE_PROMPT_ID = 'PROJECT_LANGUAGE';
|
|
53
|
+
|
|
54
|
+
function promptForProjectLanguage(languages, {prompt}) {
|
|
55
|
+
return prompt({
|
|
56
|
+
id: PROJECT_LANGUAGE_PROMPT_ID,
|
|
57
|
+
questions: [{
|
|
58
|
+
name: questionNames$1.PROJECT_LANGUAGE,
|
|
59
|
+
type: 'list',
|
|
60
|
+
message: 'What type of project is this?',
|
|
61
|
+
choices: [...Object.keys(languages), 'Other']
|
|
62
|
+
}]
|
|
63
|
+
});
|
|
64
|
+
}
|
|
40
65
|
|
|
41
|
-
|
|
66
|
+
const REPOSITORY_HOST_PROMPT_ID = 'REPOSITORY_HOST';
|
|
67
|
+
|
|
68
|
+
async function promptForVcsHostChoice(hosts, {prompt}) {
|
|
69
|
+
const answers = await prompt({
|
|
70
|
+
id: REPOSITORY_HOST_PROMPT_ID,
|
|
71
|
+
questions: [{
|
|
72
|
+
name: questionNames$1.REPO_HOST,
|
|
73
|
+
type: 'list',
|
|
74
|
+
message: 'Where will the repository be hosted?',
|
|
75
|
+
choices: Object.keys(hosts)
|
|
76
|
+
}]
|
|
77
|
+
});
|
|
78
|
+
const host = hosts[answers[questionNames$1.REPO_HOST]];
|
|
42
79
|
|
|
43
|
-
|
|
80
|
+
return {...answers, ...host};
|
|
81
|
+
}
|
|
44
82
|
|
|
45
|
-
|
|
83
|
+
const DEPENDENCY_UPDATER_PROMPT_ID = 'DEPENDENCY_UPDATER';
|
|
84
|
+
|
|
85
|
+
async function promptForDependencyUpdaterChoice(updaters, {prompt}) {
|
|
86
|
+
return prompt({
|
|
87
|
+
id: DEPENDENCY_UPDATER_PROMPT_ID,
|
|
88
|
+
questions: [{
|
|
89
|
+
name: questionNames$1.DEPENDENCY_UPDATER,
|
|
90
|
+
type: 'list',
|
|
91
|
+
message: 'Which dependency-update service do you want to manage this project?',
|
|
92
|
+
choices: [...Object.keys(updaters), 'Other']
|
|
93
|
+
}]
|
|
94
|
+
});
|
|
46
95
|
}
|
|
47
96
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}],
|
|
56
|
-
decisions
|
|
57
|
-
);
|
|
97
|
+
const ids = {
|
|
98
|
+
BASE_DETAILS: BASE_DETAILS_PROMPT_ID,
|
|
99
|
+
GIT_REPOSITORY: GIT_REPOSITORY_PROMPT_ID,
|
|
100
|
+
REPOSITORY_HOST: REPOSITORY_HOST_PROMPT_ID,
|
|
101
|
+
PROJECT_LANGUAGE: PROJECT_LANGUAGE_PROMPT_ID,
|
|
102
|
+
DEPENDENCY_UPDATER: DEPENDENCY_UPDATER_PROMPT_ID
|
|
103
|
+
};
|
|
58
104
|
|
|
59
|
-
|
|
105
|
+
const questionNames = {
|
|
106
|
+
...questionNames$2,
|
|
107
|
+
...questionNames$1
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
async function scaffoldLanguage (languagePlugins, options, {prompt}) {
|
|
111
|
+
const {[questionNames$1.PROJECT_LANGUAGE]: chosenLanguage} = await promptForProjectLanguage(languagePlugins, {prompt});
|
|
112
|
+
|
|
113
|
+
const plugin = languagePlugins[chosenLanguage];
|
|
114
|
+
|
|
115
|
+
if (plugin) return plugin.scaffold(options);
|
|
116
|
+
|
|
117
|
+
return undefined;
|
|
60
118
|
}
|
|
61
119
|
|
|
62
120
|
async function getExistingRemotes(git) {
|
|
@@ -107,37 +165,21 @@ async function defineRemoteOrigin(projectRoot, sshUrl) {
|
|
|
107
165
|
return {nextSteps: [{summary: 'Set local `master` branch to track upstream `origin/master`'}]};
|
|
108
166
|
}
|
|
109
167
|
|
|
110
|
-
function
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
async function promptForVcsHostDetails (hosts, decisions) {
|
|
115
|
-
const answers = await prompt([{
|
|
116
|
-
name: questionNames$1.REPO_HOST,
|
|
117
|
-
type: 'list',
|
|
118
|
-
message: 'Where will the repository be hosted?',
|
|
119
|
-
choices: Object.keys(hosts)
|
|
120
|
-
}], decisions);
|
|
121
|
-
const host = hosts[answers[questionNames$1.REPO_HOST]];
|
|
122
|
-
|
|
123
|
-
return {...answers, ...host};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
async function scaffoldVcsHost(hosts, decisions, options) {
|
|
127
|
-
const {[questionNames$1.REPO_HOST]: chosenHost} = await promptForVcsHostDetails(hosts, decisions);
|
|
168
|
+
async function scaffoldVcsHost(hosts, options, {prompt}) {
|
|
169
|
+
const {[questionNames$1.REPO_HOST]: chosenHost} = await promptForVcsHostChoice(hosts, {prompt});
|
|
128
170
|
|
|
129
171
|
const lowercasedHosts = Object.fromEntries(
|
|
130
172
|
Object.entries(hosts).map(([name, details]) => [name.toLowerCase(), details])
|
|
131
173
|
);
|
|
132
174
|
const host = lowercasedHosts[chosenHost.toLowerCase()];
|
|
133
175
|
|
|
134
|
-
if (host) return host.scaffold(options
|
|
176
|
+
if (host) return host.scaffold(options);
|
|
135
177
|
|
|
136
178
|
return {vcs: {}};
|
|
137
179
|
}
|
|
138
180
|
|
|
139
|
-
async function scaffoldVcs({projectRoot, projectName,
|
|
140
|
-
if (await promptForRepoCreation(
|
|
181
|
+
async function scaffoldVcs({projectRoot, projectName, vcsHosts, visibility, description}, {prompt}) {
|
|
182
|
+
if (await promptForRepoCreation({prompt})) {
|
|
141
183
|
if (await test({projectRoot})) {
|
|
142
184
|
info('Git repository already exists');
|
|
143
185
|
|
|
@@ -145,11 +187,7 @@ async function scaffoldVcs({projectRoot, projectName, decisions, vcsHosts, visib
|
|
|
145
187
|
}
|
|
146
188
|
|
|
147
189
|
const [{vcs: {host, owner, name, sshUrl}}] = await Promise.all([
|
|
148
|
-
scaffoldVcsHost(
|
|
149
|
-
vcsHosts,
|
|
150
|
-
decisions,
|
|
151
|
-
{projectName, projectRoot, description, visibility}
|
|
152
|
-
),
|
|
190
|
+
scaffoldVcsHost(vcsHosts, {projectName, projectRoot, description, visibility}, {prompt}),
|
|
153
191
|
scaffold$1({projectRoot})
|
|
154
192
|
]);
|
|
155
193
|
|
|
@@ -213,20 +251,11 @@ var licensePlugin = /*#__PURE__*/Object.freeze({
|
|
|
213
251
|
test: tester
|
|
214
252
|
});
|
|
215
253
|
|
|
216
|
-
async function
|
|
217
|
-
return prompt([{
|
|
218
|
-
name: questionNames$1.DEPENDENCY_UPDATER,
|
|
219
|
-
type: 'list',
|
|
220
|
-
message: 'Which dependency-update service do you want to manage this project?',
|
|
221
|
-
choices: [...Object.keys(updaters), 'Other']
|
|
222
|
-
}], decisions);
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
async function scaffoldDependencyUpdater (plugins, decisions, options) {
|
|
254
|
+
async function scaffoldDependencyUpdater (plugins, options, {prompt}) {
|
|
226
255
|
if (!Object.keys(plugins).length) return undefined;
|
|
227
256
|
|
|
228
257
|
const plugin = plugins[
|
|
229
|
-
(await promptForDependencyUpdaterChoice(plugins,
|
|
258
|
+
(await promptForDependencyUpdaterChoice(plugins, {prompt}))[questionNames$1.DEPENDENCY_UPDATER]
|
|
230
259
|
];
|
|
231
260
|
|
|
232
261
|
if (plugin) return plugin.scaffold(options);
|
|
@@ -234,21 +263,14 @@ async function scaffoldDependencyUpdater (plugins, decisions, options) {
|
|
|
234
263
|
return undefined;
|
|
235
264
|
}
|
|
236
265
|
|
|
237
|
-
function promptForBaseDetails(projectRoot, decisions) {
|
|
238
|
-
return prompt(questionsForBaseDetails(decisions, projectRoot), decisions);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
266
|
var languagePluginsSchema = joi.object().pattern(/^/, optionsSchemas.form8ionPlugin).default({});
|
|
242
267
|
|
|
243
268
|
var vcsHostPluginsSchema = joi.object().pattern(/^/, optionsSchemas.form8ionPlugin);
|
|
244
269
|
|
|
245
270
|
var dependencyUpdaterPluginsSchema = joi.object().pattern(joi.string(), optionsSchemas.form8ionPlugin).default({});
|
|
246
271
|
|
|
247
|
-
const decisionsSchema = joi.object();
|
|
248
|
-
|
|
249
272
|
function validate(options) {
|
|
250
273
|
return validateOptions(joi.object({
|
|
251
|
-
decisions: decisionsSchema,
|
|
252
274
|
plugins: joi.object({
|
|
253
275
|
dependencyUpdaters: dependencyUpdaterPluginsSchema,
|
|
254
276
|
languages: languagePluginsSchema,
|
|
@@ -298,9 +320,9 @@ async function lift ({projectRoot, results, enhancers, vcs, dependencies}) {
|
|
|
298
320
|
return enhancerResults;
|
|
299
321
|
}
|
|
300
322
|
|
|
301
|
-
async function scaffold(options) {
|
|
323
|
+
async function scaffold(options, {prompt}) {
|
|
302
324
|
const projectRoot = process.cwd();
|
|
303
|
-
const {
|
|
325
|
+
const {plugins: {dependencyUpdaters, languages, vcsHosts = {}}} = validate(options);
|
|
304
326
|
|
|
305
327
|
const {
|
|
306
328
|
[questionNames$2.PROJECT_NAME]: projectName,
|
|
@@ -309,11 +331,11 @@ async function scaffold(options) {
|
|
|
309
331
|
[questionNames$2.DESCRIPTION]: description,
|
|
310
332
|
[questionNames$2.COPYRIGHT_YEAR]: copyrightYear,
|
|
311
333
|
[questionNames$2.COPYRIGHT_HOLDER]: copyHolder
|
|
312
|
-
} = await promptForBaseDetails(projectRoot,
|
|
334
|
+
} = await promptForBaseDetails(projectRoot, {prompt});
|
|
313
335
|
const copyright = {year: copyrightYear, holder: copyHolder};
|
|
314
336
|
|
|
315
337
|
const [vcsResults, contributing, license] = await Promise.all([
|
|
316
|
-
scaffoldVcs({projectRoot, projectName,
|
|
338
|
+
scaffoldVcs({projectRoot, projectName, vcsHosts, visibility, description}, {prompt}),
|
|
317
339
|
scaffoldContributing({visibility}),
|
|
318
340
|
scaffoldLicense({projectRoot, license: chosenLicense, copyright}),
|
|
319
341
|
scaffold$2({projectName, projectRoot, description}),
|
|
@@ -322,14 +344,14 @@ async function scaffold(options) {
|
|
|
322
344
|
|
|
323
345
|
const dependencyUpdaterResults = vcsResults.vcs && await scaffoldDependencyUpdater(
|
|
324
346
|
dependencyUpdaters,
|
|
325
|
-
|
|
326
|
-
{
|
|
347
|
+
{projectRoot},
|
|
348
|
+
{prompt}
|
|
327
349
|
);
|
|
328
350
|
|
|
329
351
|
const language = await scaffoldLanguage(
|
|
330
352
|
languages,
|
|
331
|
-
|
|
332
|
-
{
|
|
353
|
+
{projectRoot, projectName, vcs: vcsResults.vcs, visibility, license: chosenLicense || 'UNLICENSED', description},
|
|
354
|
+
{prompt}
|
|
333
355
|
);
|
|
334
356
|
|
|
335
357
|
const mergedResults = deepmerge.all([
|
|
@@ -355,13 +377,10 @@ async function scaffold(options) {
|
|
|
355
377
|
await subprocess;
|
|
356
378
|
}
|
|
357
379
|
|
|
358
|
-
|
|
380
|
+
return mergedResults;
|
|
359
381
|
}
|
|
360
382
|
|
|
361
|
-
const
|
|
362
|
-
...questionNames$2,
|
|
363
|
-
...questionNames$1
|
|
364
|
-
};
|
|
383
|
+
const promptConstants = {ids};
|
|
365
384
|
|
|
366
|
-
export { lift, questionNames, scaffold };
|
|
385
|
+
export { lift, promptConstants, questionNames, scaffold };
|
|
367
386
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/prompts/question-names.js","../src/language/prompt.js","../src/language/scaffolder.js","../src/vcs/prompt.js","../src/vcs/git/remotes.js","../src/prompts/terminal-prompt.js","../src/vcs/host/prompt.js","../src/vcs/host/scaffolder.js","../src/vcs/scaffolder.js","../src/license/scaffolder.js","../src/license/tester.js","../src/license/lifter.js","../src/dependency-updater/prompt.js","../src/dependency-updater/scaffolder.js","../src/prompts/questions.js","../src/language/schema.js","../src/vcs/host/schema.js","../src/dependency-updater/schema.js","../src/options-schemas.js","../src/options-validator.js","../src/template-path.js","../src/editorconfig/scaffolder.js","../src/contributing/scaffolder.js","../src/lift.js","../src/scaffolder.js","../src/index.js"],"sourcesContent":["export const questionNames = {\n GIT_REPO: 'gitRepo',\n REPO_HOST: 'repoHost',\n REPO_OWNER: 'repoOwner',\n PROJECT_LANGUAGE: 'projectLanguage',\n DEPENDENCY_UPDATER: 'dependencyUpdater'\n};\n","import {prompt} from '@form8ion/overridable-prompts';\n\nimport {questionNames} from '../prompts/question-names.js';\n\nexport default function (languages, decisions) {\n return prompt([{\n name: questionNames.PROJECT_LANGUAGE,\n type: 'list',\n message: 'What type of project is this?',\n choices: [...Object.keys(languages), 'Other']\n }], decisions);\n}\n","import {questionNames} from '../prompts/question-names.js';\nimport promptForLanguageDetails from './prompt.js';\n\nexport default async function (languagePlugins, decisions, options) {\n const {[questionNames.PROJECT_LANGUAGE]: chosenLanguage} = await promptForLanguageDetails(languagePlugins, decisions);\n\n const plugin = languagePlugins[chosenLanguage];\n\n if (plugin) return plugin.scaffold(options);\n\n return undefined;\n}\n","import {prompt} from '@form8ion/overridable-prompts';\n\nimport {questionNames} from '../prompts/question-names.js';\n\nexport default async function promptForRepoCreation(decisions) {\n const {[questionNames.GIT_REPO]: gitRepoShouldBeCreated} = await prompt(\n [{\n name: questionNames.GIT_REPO,\n type: 'confirm',\n default: true,\n message: 'Should a git repository be initialized?'\n }],\n decisions\n );\n\n return gitRepoShouldBeCreated;\n}\n","import {simpleGit} from 'simple-git';\nimport parseGitUrl from 'git-url-parse';\nimport {warn} from '@travi/cli-messages';\n\nasync function getExistingRemotes(git) {\n try {\n return await git.listRemote();\n } catch (e) {\n if ('fatal: No remote configured to list refs from.\\n' === e.message) {\n return [];\n }\n\n throw e;\n }\n}\n\nexport async function determineExistingVcsDetails({projectRoot}) {\n const git = simpleGit({baseDir: projectRoot});\n const remoteOrigin = await git.remote(['get-url', 'origin']);\n const {owner, name, host} = parseGitUrl(remoteOrigin.trimEnd());\n\n return {vcs: {owner, name, host: 'github.com' === host ? 'github' : host}};\n}\n\nexport async function defineRemoteOrigin(projectRoot, sshUrl) {\n if (!sshUrl) {\n warn('URL not available to configure remote `origin`');\n\n return {nextSteps: []};\n }\n\n const git = simpleGit({baseDir: projectRoot});\n const existingRemotes = await getExistingRemotes(git);\n\n if (existingRemotes.includes('origin')) {\n warn('The `origin` remote is already defined for this repository');\n\n return {nextSteps: []};\n }\n\n // info('Setting the local `master` branch to track `origin/master`');\n //\n // await gitBranch.setUpstream(\n // await gitBranch.lookup(repository, 'master', gitBranch.BRANCH.LOCAL),\n // 'origin/master'\n // );\n\n await git.addRemote('origin', sshUrl);\n\n return {nextSteps: [{summary: 'Set local `master` branch to track upstream `origin/master`'}]};\n}\n","import {prompt} from '@form8ion/overridable-prompts';\n\nexport default function (decisions) {\n return ({questions}) => prompt(questions, decisions);\n}\n","import {prompt} from '@form8ion/overridable-prompts';\n\nimport {questionNames} from '../../prompts/question-names.js';\n\nexport default async function (hosts, decisions) {\n const answers = await prompt([{\n name: questionNames.REPO_HOST,\n type: 'list',\n message: 'Where will the repository be hosted?',\n choices: Object.keys(hosts)\n }], decisions);\n const host = hosts[answers[questionNames.REPO_HOST]];\n\n return {...answers, ...host};\n}\n","import {questionNames} from '../../prompts/question-names.js';\nimport terminalPromptFactory from '../../prompts/terminal-prompt.js';\nimport promptForVcsHostDetails from './prompt.js';\n\nexport default async function scaffoldVcsHost(hosts, decisions, options) {\n const {[questionNames.REPO_HOST]: chosenHost} = await promptForVcsHostDetails(hosts, decisions);\n\n const lowercasedHosts = Object.fromEntries(\n Object.entries(hosts).map(([name, details]) => [name.toLowerCase(), details])\n );\n const host = lowercasedHosts[chosenHost.toLowerCase()];\n\n if (host) return host.scaffold(options, {prompt: terminalPromptFactory(decisions)});\n\n return {vcs: {}};\n}\n","import {info} from '@travi/cli-messages';\nimport {scaffold as scaffoldGit, test as alreadyVersionedByGit} from '@form8ion/git';\n\nimport repositoryShouldBeCreated from './prompt.js';\nimport {determineExistingVcsDetails, defineRemoteOrigin} from './git/index.js';\nimport {scaffold as scaffoldVcsHost} from './host/index.js';\n\nexport default async function scaffoldVcs({projectRoot, projectName, decisions, vcsHosts, visibility, description}) {\n if (await repositoryShouldBeCreated(decisions)) {\n if (await alreadyVersionedByGit({projectRoot})) {\n info('Git repository already exists');\n\n return determineExistingVcsDetails({projectRoot});\n }\n\n const [{vcs: {host, owner, name, sshUrl}}] = await Promise.all([\n scaffoldVcsHost(\n vcsHosts,\n decisions,\n {projectName, projectRoot, description, visibility}\n ),\n scaffoldGit({projectRoot})\n ]);\n\n const remoteOriginResults = await defineRemoteOrigin(projectRoot, sshUrl);\n\n return {\n vcs: {host, owner, name},\n nextSteps: [{summary: 'Commit scaffolded files'}, ...remoteOriginResults.nextSteps]\n };\n }\n\n return {};\n}\n","import {promises as fs} from 'fs';\nimport wrap from 'word-wrap';\nimport mustache from 'mustache';\n// eslint-disable-next-line import/extensions\nimport spdxLicenseList from 'spdx-license-list/full.js';\nimport {info} from '@travi/cli-messages';\n\nexport default async function ({projectRoot, license, copyright}) {\n if (license) {\n info('Generating License');\n\n const licenseContent = spdxLicenseList[license].licenseText;\n\n await fs.writeFile(\n `${projectRoot}/LICENSE`,\n `${wrap(\n mustache.render(licenseContent, {year: copyright.year, 'copyright holders': copyright.holder}, {}, ['<', '>']),\n {width: 80, indent: ''}\n )}\\n`\n );\n }\n\n return {};\n}\n","import {fileExists} from '@form8ion/core';\n\nexport default function ({projectRoot}) {\n return fileExists(`${projectRoot}/LICENSE`);\n}\n","function repositoryIsHostedOnGithub(vcs) {\n return vcs && 'github' === vcs.host;\n}\n\nexport default function ({vcs}) {\n return {\n ...repositoryIsHostedOnGithub(vcs) && {\n badges: {\n consumer: {\n license: {\n link: 'LICENSE',\n img: `https://img.shields.io/github/license/${vcs.owner}/${vcs.name}.svg?logo=opensourceinitiative`,\n text: 'license'\n }\n }\n }\n }\n };\n}\n","import {prompt} from '@form8ion/overridable-prompts';\nimport {questionNames} from '../prompts/question-names.js';\n\nexport async function promptForDependencyUpdaterChoice(updaters, decisions) {\n return prompt([{\n name: questionNames.DEPENDENCY_UPDATER,\n type: 'list',\n message: 'Which dependency-update service do you want to manage this project?',\n choices: [...Object.keys(updaters), 'Other']\n }], decisions);\n}\n","import {questionNames} from '../prompts/question-names.js';\nimport {promptForDependencyUpdaterChoice} from './prompt.js';\n\nexport default async function (plugins, decisions, options) {\n if (!Object.keys(plugins).length) return undefined;\n\n const plugin = plugins[\n (await promptForDependencyUpdaterChoice(plugins, decisions))[questionNames.DEPENDENCY_UPDATER]\n ];\n\n if (plugin) return plugin.scaffold(options);\n\n return undefined;\n}\n","import {questionsForBaseDetails} from '@form8ion/core';\nimport {prompt} from '@form8ion/overridable-prompts';\n\nexport function promptForBaseDetails(projectRoot, decisions) {\n return prompt(questionsForBaseDetails(decisions, projectRoot), decisions);\n}\n","import joi from 'joi';\nimport {optionsSchemas} from '@form8ion/core';\n\nexport default joi.object().pattern(/^/, optionsSchemas.form8ionPlugin).default({});\n","import joi from 'joi';\nimport {optionsSchemas} from '@form8ion/core';\n\nexport default joi.object().pattern(/^/, optionsSchemas.form8ionPlugin);\n","import joi from 'joi';\nimport {optionsSchemas} from '@form8ion/core';\n\nexport default joi.object().pattern(joi.string(), optionsSchemas.form8ionPlugin).default({});\n","import joi from 'joi';\n\nexport const decisionsSchema = joi.object();\n","import {validateOptions} from '@form8ion/core';\nimport joi from 'joi';\n\nimport languagePluginsSchema from './language/schema.js';\nimport vcsHostPluginsSchema from './vcs/host/schema.js';\nimport dependencyUpdaterPluginsSchema from './dependency-updater/schema.js';\nimport {decisionsSchema} from './options-schemas.js';\n\nexport function validate(options) {\n return validateOptions(joi.object({\n decisions: decisionsSchema,\n plugins: joi.object({\n dependencyUpdaters: dependencyUpdaterPluginsSchema,\n languages: languagePluginsSchema,\n vcsHosts: vcsHostPluginsSchema\n })\n }), options) || {};\n}\n","import {resolve} from 'path';\nimport filedirname from 'filedirname';\n\nexport default function (fileName) {\n const [, __dirname] = filedirname();\n\n return resolve(__dirname, '..', 'templates', fileName);\n}\n","import {promises as fs} from 'node:fs';\n\nimport determinePathToTemplateFile from '../template-path.js';\n\nexport default function ({projectRoot}) {\n return fs.copyFile(determinePathToTemplateFile('editorconfig.ini'), `${projectRoot}/.editorconfig`);\n}\n","export default function ({visibility}) {\n if ('Public' === visibility) {\n return {\n badges: {\n contribution: {\n PRs: {\n text: 'PRs Welcome',\n link: 'https://makeapullrequest.com',\n img: 'https://img.shields.io/badge/PRs-welcome-brightgreen.svg'\n }\n }\n }\n };\n }\n\n return {};\n}\n","import {applyEnhancers} from '@form8ion/core';\nimport {lift as liftReadme} from '@form8ion/readme';\nimport * as gitPlugin from '@form8ion/git';\n\nimport * as licensePlugin from './license/index.js';\n\nexport default async function ({projectRoot, results, enhancers, vcs, dependencies}) {\n const enhancerResults = await applyEnhancers({\n results,\n enhancers: {...enhancers, gitPlugin, licensePlugin},\n options: {projectRoot, vcs},\n dependencies\n });\n\n await liftReadme({projectRoot, results: enhancerResults});\n\n return enhancerResults;\n}\n","import deepmerge from 'deepmerge';\nimport {execa} from 'execa';\nimport {questionNames as coreQuestionNames} from '@form8ion/core';\nimport {reportResults} from '@form8ion/results-reporter';\nimport {scaffold as scaffoldReadme} from '@form8ion/readme';\nimport {info} from '@travi/cli-messages';\n\nimport {scaffold as scaffoldLanguage} from './language/index.js';\nimport {scaffold as scaffoldVcs} from './vcs/index.js';\nimport {scaffold as scaffoldLicense} from './license/index.js';\nimport scaffoldDependencyUpdater from './dependency-updater/scaffolder.js';\nimport {promptForBaseDetails} from './prompts/questions.js';\nimport {validate} from './options-validator.js';\nimport {scaffold as scaffoldEditorConfig} from './editorconfig/index.js';\nimport {scaffold as scaffoldContributing} from './contributing/index.js';\nimport lift from './lift.js';\n\nexport async function scaffold(options) {\n const projectRoot = process.cwd();\n const {decisions, plugins: {dependencyUpdaters, languages, vcsHosts = {}}} = validate(options);\n\n const {\n [coreQuestionNames.PROJECT_NAME]: projectName,\n [coreQuestionNames.LICENSE]: chosenLicense,\n [coreQuestionNames.VISIBILITY]: visibility,\n [coreQuestionNames.DESCRIPTION]: description,\n [coreQuestionNames.COPYRIGHT_YEAR]: copyrightYear,\n [coreQuestionNames.COPYRIGHT_HOLDER]: copyHolder\n } = await promptForBaseDetails(projectRoot, decisions);\n const copyright = {year: copyrightYear, holder: copyHolder};\n\n const [vcsResults, contributing, license] = await Promise.all([\n scaffoldVcs({projectRoot, projectName, decisions, vcsHosts, visibility, description}),\n scaffoldContributing({visibility}),\n scaffoldLicense({projectRoot, license: chosenLicense, copyright}),\n scaffoldReadme({projectName, projectRoot, description}),\n scaffoldEditorConfig({projectRoot})\n ]);\n\n const dependencyUpdaterResults = vcsResults.vcs && await scaffoldDependencyUpdater(\n dependencyUpdaters,\n decisions,\n {projectRoot, vcs: vcsResults.vcs}\n );\n\n const language = await scaffoldLanguage(\n languages,\n decisions,\n {projectRoot, projectName, vcs: vcsResults.vcs, visibility, license: chosenLicense || 'UNLICENSED', description}\n );\n\n const mergedResults = deepmerge.all([\n license,\n language,\n dependencyUpdaterResults,\n contributing,\n vcsResults\n ].filter(Boolean));\n\n await lift({\n projectRoot,\n vcs: vcsResults.vcs,\n results: mergedResults,\n enhancers: {...dependencyUpdaters, ...languages, ...vcsHosts}\n });\n\n if (language && language.verificationCommand) {\n info('Verifying the generated project');\n\n const subprocess = execa(language.verificationCommand, {shell: true});\n subprocess.stdout.pipe(process.stdout);\n await subprocess;\n }\n\n reportResults(mergedResults);\n}\n","import {questionNames as coreQuestionNames} from '@form8ion/core';\nimport {questionNames as projectScaffolderQuestionNames} from './prompts/question-names.js';\n\nexport * from './scaffolder.js';\nexport {default as lift} from './lift.js';\nexport const questionNames = {\n ...coreQuestionNames,\n ...projectScaffolderQuestionNames\n};\n"],"names":["questionNames","repositoryShouldBeCreated","alreadyVersionedByGit","scaffoldGit","fs","liftReadme","coreQuestionNames","scaffoldReadme","projectScaffolderQuestionNames"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAO,MAAMA,eAAa,GAAG;AAC7B,EAAE,QAAQ,EAAE,SAAS;AACrB,EAAE,SAAS,EAAE,UAAU;AACvB,EAAE,UAAU,EAAE,WAAW;AACzB,EAAE,gBAAgB,EAAE,iBAAiB;AACrC,EAAE,kBAAkB,EAAE;AACtB,CAAC;;ACFc,iCAAQ,EAAE,SAAS,EAAE,SAAS,EAAE;AAC/C,EAAE,OAAO,MAAM,CAAC,CAAC;AACjB,IAAI,IAAI,EAAEA,eAAa,CAAC,gBAAgB;AACxC,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,+BAA+B;AAC5C,IAAI,OAAO,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,OAAO;AAChD,GAAG,CAAC,EAAE,SAAS,CAAC;AAChB;;ACRe,+BAAc,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE;AACpE,EAAE,MAAM,CAAC,CAACA,eAAa,CAAC,gBAAgB,GAAG,cAAc,CAAC,GAAG,MAAM,wBAAwB,CAAC,eAAe,EAAE,SAAS,CAAC;;AAEvH,EAAE,MAAM,MAAM,GAAG,eAAe,CAAC,cAAc,CAAC;;AAEhD,EAAE,IAAI,MAAM,EAAE,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC;;AAE7C,EAAE,OAAO,SAAS;AAClB;;ACPe,eAAe,qBAAqB,CAA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AAI,GAAG,EAAE,UAAU,CAAC,GAAG;AACvB,IAAI,OAAO,EAAE,aAAa;AAC1B,IAAI,SAAS,EAAE,CAAC,GAAG,kBAAkB,EAAE,GAAG,SAAS,EAAE,GAAG,QAAQ;AAChE,GAAG,CAAC;;AAEJ,EAAE,IAAI,QAAQ,IAAI,QAAQ,CAAC,mBAAmB,EAAE;AAChD,IAAI,IAAI,CAAC,iCAAiC,CAAC;;AAE3C,IAAI,MAAM,UAAU,GAAG,KAAK,CAAC,QAAQ,CAAC,mBAAmB,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AACzE,IAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC;AAC1C,IAAI,MAAM,UAAU;AACpB,EAAE;;AAEF,EAAE,aAAa,CAAC,aAAa,CAAC;AAC9B;;ACtEY,MAAC,aAAa,GAAG;AAC7B,EAAE,GAAGD,eAAiB;AACtB,EAAE,GAAGE;AACL;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/prompts/questions.js","../src/prompts/question-names.js","../src/vcs/prompt.js","../src/language/prompt.js","../src/vcs/host/prompt.js","../src/dependency-updater/prompt.js","../src/prompts/index.js","../src/language/scaffolder.js","../src/vcs/git/remotes.js","../src/vcs/host/scaffolder.js","../src/vcs/scaffolder.js","../src/license/scaffolder.js","../src/license/tester.js","../src/license/lifter.js","../src/dependency-updater/scaffolder.js","../src/language/schema.js","../src/vcs/host/schema.js","../src/dependency-updater/schema.js","../src/options-validator.js","../src/template-path.js","../src/editorconfig/scaffolder.js","../src/contributing/scaffolder.js","../src/lift.js","../src/scaffolder.js","../src/index.js"],"sourcesContent":["import {questionsForBaseDetails} from '@form8ion/core';\n\nexport const BASE_DETAILS_PROMPT_ID = 'BASE_DETAILS';\n\nexport function promptForBaseDetails(projectRoot, {prompt}) {\n return prompt({\n id: BASE_DETAILS_PROMPT_ID,\n questions: questionsForBaseDetails(projectRoot)\n });\n}\n","export const questionNames = {\n GIT_REPO: 'gitRepo',\n REPO_HOST: 'repoHost',\n REPO_OWNER: 'repoOwner',\n PROJECT_LANGUAGE: 'projectLanguage',\n DEPENDENCY_UPDATER: 'dependencyUpdater'\n};\n","import {questionNames} from '../prompts/question-names.js';\n\nexport const GIT_REPOSITORY_PROMPT_ID = 'GIT_REPOSITORY';\n\nexport default async function promptForRepoCreation({prompt}) {\n const {[questionNames.GIT_REPO]: gitRepoShouldBeCreated} = await prompt({\n id: GIT_REPOSITORY_PROMPT_ID,\n questions: [{\n name: questionNames.GIT_REPO,\n type: 'confirm',\n default: true,\n message: 'Should a git repository be initialized?'\n }]\n });\n\n return gitRepoShouldBeCreated;\n}\n","import {questionNames} from '../prompts/question-names.js';\n\nexport const PROJECT_LANGUAGE_PROMPT_ID = 'PROJECT_LANGUAGE';\n\nexport default function promptForProjectLanguage(languages, {prompt}) {\n return prompt({\n id: PROJECT_LANGUAGE_PROMPT_ID,\n questions: [{\n name: questionNames.PROJECT_LANGUAGE,\n type: 'list',\n message: 'What type of project is this?',\n choices: [...Object.keys(languages), 'Other']\n }]\n });\n}\n","import {questionNames} from '../../prompts/question-names.js';\n\nexport const REPOSITORY_HOST_PROMPT_ID = 'REPOSITORY_HOST';\n\nexport default async function promptForVcsHostChoice(hosts, {prompt}) {\n const answers = await prompt({\n id: REPOSITORY_HOST_PROMPT_ID,\n questions: [{\n name: questionNames.REPO_HOST,\n type: 'list',\n message: 'Where will the repository be hosted?',\n choices: Object.keys(hosts)\n }]\n });\n const host = hosts[answers[questionNames.REPO_HOST]];\n\n return {...answers, ...host};\n}\n","import {questionNames} from '../prompts/question-names.js';\n\nexport const DEPENDENCY_UPDATER_PROMPT_ID = 'DEPENDENCY_UPDATER';\n\nexport async function promptForDependencyUpdaterChoice(updaters, {prompt}) {\n return prompt({\n id: DEPENDENCY_UPDATER_PROMPT_ID,\n questions: [{\n name: questionNames.DEPENDENCY_UPDATER,\n type: 'list',\n message: 'Which dependency-update service do you want to manage this project?',\n choices: [...Object.keys(updaters), 'Other']\n }]\n });\n}\n","import {questionNames as coreQuestionNames} from '@form8ion/core';\n\nimport {BASE_DETAILS_PROMPT_ID} from './questions.js';\nimport {GIT_REPOSITORY_PROMPT_ID} from '../vcs/prompt.js';\nimport {PROJECT_LANGUAGE_PROMPT_ID} from '../language/prompt.js';\nimport {REPOSITORY_HOST_PROMPT_ID} from '../vcs/host/prompt.js';\nimport {DEPENDENCY_UPDATER_PROMPT_ID} from '../dependency-updater/prompt.js';\nimport {questionNames as projectScaffolderQuestionNames} from './question-names.js';\n\nexport const ids = {\n BASE_DETAILS: BASE_DETAILS_PROMPT_ID,\n GIT_REPOSITORY: GIT_REPOSITORY_PROMPT_ID,\n REPOSITORY_HOST: REPOSITORY_HOST_PROMPT_ID,\n PROJECT_LANGUAGE: PROJECT_LANGUAGE_PROMPT_ID,\n DEPENDENCY_UPDATER: DEPENDENCY_UPDATER_PROMPT_ID\n};\n\nexport const questionNames = {\n ...coreQuestionNames,\n ...projectScaffolderQuestionNames\n};\n","import {questionNames} from '../prompts/question-names.js';\nimport promptForLanguageDetails from './prompt.js';\n\nexport default async function (languagePlugins, options, {prompt}) {\n const {[questionNames.PROJECT_LANGUAGE]: chosenLanguage} = await promptForLanguageDetails(languagePlugins, {prompt});\n\n const plugin = languagePlugins[chosenLanguage];\n\n if (plugin) return plugin.scaffold(options);\n\n return undefined;\n}\n","import {simpleGit} from 'simple-git';\nimport parseGitUrl from 'git-url-parse';\nimport {warn} from '@travi/cli-messages';\n\nasync function getExistingRemotes(git) {\n try {\n return await git.listRemote();\n } catch (e) {\n if ('fatal: No remote configured to list refs from.\\n' === e.message) {\n return [];\n }\n\n throw e;\n }\n}\n\nexport async function determineExistingVcsDetails({projectRoot}) {\n const git = simpleGit({baseDir: projectRoot});\n const remoteOrigin = await git.remote(['get-url', 'origin']);\n const {owner, name, host} = parseGitUrl(remoteOrigin.trimEnd());\n\n return {vcs: {owner, name, host: 'github.com' === host ? 'github' : host}};\n}\n\nexport async function defineRemoteOrigin(projectRoot, sshUrl) {\n if (!sshUrl) {\n warn('URL not available to configure remote `origin`');\n\n return {nextSteps: []};\n }\n\n const git = simpleGit({baseDir: projectRoot});\n const existingRemotes = await getExistingRemotes(git);\n\n if (existingRemotes.includes('origin')) {\n warn('The `origin` remote is already defined for this repository');\n\n return {nextSteps: []};\n }\n\n // info('Setting the local `master` branch to track `origin/master`');\n //\n // await gitBranch.setUpstream(\n // await gitBranch.lookup(repository, 'master', gitBranch.BRANCH.LOCAL),\n // 'origin/master'\n // );\n\n await git.addRemote('origin', sshUrl);\n\n return {nextSteps: [{summary: 'Set local `master` branch to track upstream `origin/master`'}]};\n}\n","import {questionNames} from '../../prompts/question-names.js';\nimport promptForVcsHostDetails from './prompt.js';\n\nexport default async function scaffoldVcsHost(hosts, options, {prompt}) {\n const {[questionNames.REPO_HOST]: chosenHost} = await promptForVcsHostDetails(hosts, {prompt});\n\n const lowercasedHosts = Object.fromEntries(\n Object.entries(hosts).map(([name, details]) => [name.toLowerCase(), details])\n );\n const host = lowercasedHosts[chosenHost.toLowerCase()];\n\n if (host) return host.scaffold(options);\n\n return {vcs: {}};\n}\n","import {info} from '@travi/cli-messages';\nimport {scaffold as scaffoldGit, test as alreadyVersionedByGit} from '@form8ion/git';\n\nimport repositoryShouldBeCreated from './prompt.js';\nimport {determineExistingVcsDetails, defineRemoteOrigin} from './git/index.js';\nimport {scaffold as scaffoldVcsHost} from './host/index.js';\n\nexport default async function scaffoldVcs({projectRoot, projectName, vcsHosts, visibility, description}, {prompt}) {\n if (await repositoryShouldBeCreated({prompt})) {\n if (await alreadyVersionedByGit({projectRoot})) {\n info('Git repository already exists');\n\n return determineExistingVcsDetails({projectRoot});\n }\n\n const [{vcs: {host, owner, name, sshUrl}}] = await Promise.all([\n scaffoldVcsHost(vcsHosts, {projectName, projectRoot, description, visibility}, {prompt}),\n scaffoldGit({projectRoot})\n ]);\n\n const remoteOriginResults = await defineRemoteOrigin(projectRoot, sshUrl);\n\n return {\n vcs: {host, owner, name},\n nextSteps: [{summary: 'Commit scaffolded files'}, ...remoteOriginResults.nextSteps]\n };\n }\n\n return {};\n}\n","import {promises as fs} from 'fs';\nimport wrap from 'word-wrap';\nimport mustache from 'mustache';\n// eslint-disable-next-line import/extensions\nimport spdxLicenseList from 'spdx-license-list/full.js';\nimport {info} from '@travi/cli-messages';\n\nexport default async function ({projectRoot, license, copyright}) {\n if (license) {\n info('Generating License');\n\n const licenseContent = spdxLicenseList[license].licenseText;\n\n await fs.writeFile(\n `${projectRoot}/LICENSE`,\n `${wrap(\n mustache.render(licenseContent, {year: copyright.year, 'copyright holders': copyright.holder}, {}, ['<', '>']),\n {width: 80, indent: ''}\n )}\\n`\n );\n }\n\n return {};\n}\n","import {fileExists} from '@form8ion/core';\n\nexport default function ({projectRoot}) {\n return fileExists(`${projectRoot}/LICENSE`);\n}\n","function repositoryIsHostedOnGithub(vcs) {\n return vcs && 'github' === vcs.host;\n}\n\nexport default function ({vcs}) {\n return {\n ...repositoryIsHostedOnGithub(vcs) && {\n badges: {\n consumer: {\n license: {\n link: 'LICENSE',\n img: `https://img.shields.io/github/license/${vcs.owner}/${vcs.name}.svg?logo=opensourceinitiative`,\n text: 'license'\n }\n }\n }\n }\n };\n}\n","import {questionNames} from '../prompts/question-names.js';\nimport {promptForDependencyUpdaterChoice} from './prompt.js';\n\nexport default async function (plugins, options, {prompt}) {\n if (!Object.keys(plugins).length) return undefined;\n\n const plugin = plugins[\n (await promptForDependencyUpdaterChoice(plugins, {prompt}))[questionNames.DEPENDENCY_UPDATER]\n ];\n\n if (plugin) return plugin.scaffold(options);\n\n return undefined;\n}\n","import joi from 'joi';\nimport {optionsSchemas} from '@form8ion/core';\n\nexport default joi.object().pattern(/^/, optionsSchemas.form8ionPlugin).default({});\n","import joi from 'joi';\nimport {optionsSchemas} from '@form8ion/core';\n\nexport default joi.object().pattern(/^/, optionsSchemas.form8ionPlugin);\n","import joi from 'joi';\nimport {optionsSchemas} from '@form8ion/core';\n\nexport default joi.object().pattern(joi.string(), optionsSchemas.form8ionPlugin).default({});\n","import {validateOptions} from '@form8ion/core';\nimport joi from 'joi';\n\nimport languagePluginsSchema from './language/schema.js';\nimport vcsHostPluginsSchema from './vcs/host/schema.js';\nimport dependencyUpdaterPluginsSchema from './dependency-updater/schema.js';\n\nexport function validate(options) {\n return validateOptions(joi.object({\n plugins: joi.object({\n dependencyUpdaters: dependencyUpdaterPluginsSchema,\n languages: languagePluginsSchema,\n vcsHosts: vcsHostPluginsSchema\n })\n }), options) || {};\n}\n","import {resolve} from 'path';\nimport filedirname from 'filedirname';\n\nexport default function (fileName) {\n const [, __dirname] = filedirname();\n\n return resolve(__dirname, '..', 'templates', fileName);\n}\n","import {promises as fs} from 'node:fs';\n\nimport determinePathToTemplateFile from '../template-path.js';\n\nexport default function ({projectRoot}) {\n return fs.copyFile(determinePathToTemplateFile('editorconfig.ini'), `${projectRoot}/.editorconfig`);\n}\n","export default function ({visibility}) {\n if ('Public' === visibility) {\n return {\n badges: {\n contribution: {\n PRs: {\n text: 'PRs Welcome',\n link: 'https://makeapullrequest.com',\n img: 'https://img.shields.io/badge/PRs-welcome-brightgreen.svg'\n }\n }\n }\n };\n }\n\n return {};\n}\n","import {applyEnhancers} from '@form8ion/core';\nimport {lift as liftReadme} from '@form8ion/readme';\nimport * as gitPlugin from '@form8ion/git';\n\nimport * as licensePlugin from './license/index.js';\n\nexport default async function ({projectRoot, results, enhancers, vcs, dependencies}) {\n const enhancerResults = await applyEnhancers({\n results,\n enhancers: {...enhancers, gitPlugin, licensePlugin},\n options: {projectRoot, vcs},\n dependencies\n });\n\n await liftReadme({projectRoot, results: enhancerResults});\n\n return enhancerResults;\n}\n","import deepmerge from 'deepmerge';\nimport {execa} from 'execa';\nimport {questionNames as coreQuestionNames} from '@form8ion/core';\nimport {scaffold as scaffoldReadme} from '@form8ion/readme';\nimport {info} from '@travi/cli-messages';\n\nimport {scaffold as scaffoldLanguage} from './language/index.js';\nimport {scaffold as scaffoldVcs} from './vcs/index.js';\nimport {scaffold as scaffoldLicense} from './license/index.js';\nimport scaffoldDependencyUpdater from './dependency-updater/scaffolder.js';\nimport {promptForBaseDetails} from './prompts/questions.js';\nimport {validate} from './options-validator.js';\nimport {scaffold as scaffoldEditorConfig} from './editorconfig/index.js';\nimport {scaffold as scaffoldContributing} from './contributing/index.js';\nimport lift from './lift.js';\n\nexport async function scaffold(options, {prompt}) {\n const projectRoot = process.cwd();\n const {plugins: {dependencyUpdaters, languages, vcsHosts = {}}} = validate(options);\n\n const {\n [coreQuestionNames.PROJECT_NAME]: projectName,\n [coreQuestionNames.LICENSE]: chosenLicense,\n [coreQuestionNames.VISIBILITY]: visibility,\n [coreQuestionNames.DESCRIPTION]: description,\n [coreQuestionNames.COPYRIGHT_YEAR]: copyrightYear,\n [coreQuestionNames.COPYRIGHT_HOLDER]: copyHolder\n } = await promptForBaseDetails(projectRoot, {prompt});\n const copyright = {year: copyrightYear, holder: copyHolder};\n\n const [vcsResults, contributing, license] = await Promise.all([\n scaffoldVcs({projectRoot, projectName, vcsHosts, visibility, description}, {prompt}),\n scaffoldContributing({visibility}),\n scaffoldLicense({projectRoot, license: chosenLicense, copyright}),\n scaffoldReadme({projectName, projectRoot, description}),\n scaffoldEditorConfig({projectRoot})\n ]);\n\n const dependencyUpdaterResults = vcsResults.vcs && await scaffoldDependencyUpdater(\n dependencyUpdaters,\n {projectRoot},\n {prompt}\n );\n\n const language = await scaffoldLanguage(\n languages,\n {projectRoot, projectName, vcs: vcsResults.vcs, visibility, license: chosenLicense || 'UNLICENSED', description},\n {prompt}\n );\n\n const mergedResults = deepmerge.all([\n license,\n language,\n dependencyUpdaterResults,\n contributing,\n vcsResults\n ].filter(Boolean));\n\n await lift({\n projectRoot,\n vcs: vcsResults.vcs,\n results: mergedResults,\n enhancers: {...dependencyUpdaters, ...languages, ...vcsHosts}\n });\n\n if (language && language.verificationCommand) {\n info('Verifying the generated project');\n\n const subprocess = execa(language.verificationCommand, {shell: true});\n subprocess.stdout.pipe(process.stdout);\n await subprocess;\n }\n\n return mergedResults;\n}\n","import {ids} from './prompts/index.js';\n\nexport * from './scaffolder.js';\nexport {default as lift} from './lift.js';\nexport const promptConstants = {ids};\n\nexport {questionNames} from './prompts/index.js';\n"],"names":["questionNames","coreQuestionNames","projectScaffolderQuestionNames","promptForLanguageDetails","promptForVcsHostDetails","repositoryShouldBeCreated","alreadyVersionedByGit","scaffoldGit","fs","liftReadme","scaffoldReadme"],"mappings":";;;;;;;;;;;;;;;;;;AAEO,MAAM,sBAAsB,GAAG,cAAc;;AAE7C,SAAS,oBAAoB,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,EAAE;AAC5D,EAAE,OAAO,MAAM,CAAC;AAChB,IAAI,EAAE,EAAE,sBAAsB;AAC9B,IAAI,SAAS,EAAE,uBAAuB,CAAC,WAAW;AAClD,GAAG,CAAC;AACJ;;ACTO,MAAMA,eAAa,GAAG;AAC7B,EAAE,QAAQ,EAAE,SAAS;AACrB,EAAE,SAAS,EAAE,UAAU;AACvB,EAAE,UAAU,EAAE,WAAW;AACzB,EAAE,gBAAgB,EAAE,iBAAiB;AACrC,EAAE,kBAAkB,EAAE;AACtB,CAAC;;ACJM,MAAM,wBAAwB,GAAG,gBAAgB;;AAEzC,eAAe,qBAAqB,CAAC,CAAC,MAAM,CAAC,EAAE;AAC9D,EAAE,MAAM,CAAC,CAACA,eAAa,CAAC,QAAQ,GAAG,sBAAsB,CAAC,GAAG,MAAM,MAAM,CAAC;AAC1E,IAAI,EAAE,EAAE,wBAAwB;AAChC,IAAI,SAAS,EAAE,CAAC;AAChB,MAAM,IAAI,EAAEA,eAAa,CAAC,QAAQ;AAClC,MAAM,IAAI,EAAE,SAAS;AACrB,MAAM,OAAO,EAAE,IAAI;AACnB,MAAM,OAAO,EAAE;AACf,KAAK;AACL,GAAG,CAAC;;AAEJ,EAAE,OAAO,sBAAsB;AAC/B;;ACdO,MAAM,0BAA0B,GAAG,kBAAkB;;AAE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": "opinionated scaffolder for new projects",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "
|
|
5
|
+
"version": "22.0.0-beta.10",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": "^
|
|
8
|
+
"node": "^20.19.0 || >=22.14.0"
|
|
9
9
|
},
|
|
10
10
|
"author": "Matt Travi <npm@travi.org> (https://matt.travi.org/)",
|
|
11
11
|
"contributors": [
|
|
@@ -64,9 +64,7 @@
|
|
|
64
64
|
"dependencies": {
|
|
65
65
|
"@form8ion/core": "^4.6.0",
|
|
66
66
|
"@form8ion/git": "^2.1.1",
|
|
67
|
-
"@form8ion/overridable-prompts": "^1.1.0",
|
|
68
67
|
"@form8ion/readme": "3.1.0",
|
|
69
|
-
"@form8ion/results-reporter": "^1.1.0",
|
|
70
68
|
"@hapi/hoek": "^11.0.2",
|
|
71
69
|
"@travi/cli-messages": "1.1.3",
|
|
72
70
|
"deepmerge": "^4.2.2",
|
|
@@ -81,7 +79,7 @@
|
|
|
81
79
|
"write-yaml": "1.0.0"
|
|
82
80
|
},
|
|
83
81
|
"devDependencies": {
|
|
84
|
-
"@cucumber/cucumber": "
|
|
82
|
+
"@cucumber/cucumber": "12.5.0",
|
|
85
83
|
"@form8ion/commitlint-config": "2.0.8",
|
|
86
84
|
"@form8ion/eslint-config": "7.0.13",
|
|
87
85
|
"@form8ion/eslint-config-cucumber": "1.4.1",
|
|
@@ -89,13 +87,13 @@
|
|
|
89
87
|
"@form8ion/remark-lint-preset": "6.0.7",
|
|
90
88
|
"@rollup/plugin-node-resolve": "16.0.3",
|
|
91
89
|
"@travi/any": "3.1.3",
|
|
92
|
-
"c8": "
|
|
90
|
+
"c8": "11.0.0",
|
|
93
91
|
"chai": "6.2.2",
|
|
94
92
|
"cross-env": "10.1.0",
|
|
95
93
|
"cz-conventional-changelog": "3.3.0",
|
|
96
94
|
"gherkin-lint": "4.2.4",
|
|
97
95
|
"husky": "9.1.7",
|
|
98
|
-
"lockfile-lint": "
|
|
96
|
+
"lockfile-lint": "5.0.0",
|
|
99
97
|
"ls-engines": "0.9.4",
|
|
100
98
|
"mdast-util-from-markdown": "2.0.3",
|
|
101
99
|
"mdast-util-heading-range": "4.0.0",
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {prompt} from '@form8ion/overridable-prompts';
|
|
2
1
|
import {questionNames} from '../prompts/question-names.js';
|
|
3
2
|
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
export const DEPENDENCY_UPDATER_PROMPT_ID = 'DEPENDENCY_UPDATER';
|
|
4
|
+
|
|
5
|
+
export async function promptForDependencyUpdaterChoice(updaters, {prompt}) {
|
|
6
|
+
return prompt({
|
|
7
|
+
id: DEPENDENCY_UPDATER_PROMPT_ID,
|
|
8
|
+
questions: [{
|
|
9
|
+
name: questionNames.DEPENDENCY_UPDATER,
|
|
10
|
+
type: 'list',
|
|
11
|
+
message: 'Which dependency-update service do you want to manage this project?',
|
|
12
|
+
choices: [...Object.keys(updaters), 'Other']
|
|
13
|
+
}]
|
|
14
|
+
});
|
|
11
15
|
}
|
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import {afterEach, describe, expect, it, vi} from 'vitest';
|
|
1
|
+
import {describe, expect, it, vi} from 'vitest';
|
|
4
2
|
import any from '@travi/any';
|
|
5
3
|
import {when} from 'vitest-when';
|
|
6
4
|
|
|
7
|
-
import {promptForDependencyUpdaterChoice} from './prompt.js';
|
|
5
|
+
import {DEPENDENCY_UPDATER_PROMPT_ID, promptForDependencyUpdaterChoice} from './prompt.js';
|
|
8
6
|
import {questionNames} from '../index.js';
|
|
9
7
|
|
|
10
8
|
vi.mock('@form8ion/overridable-prompts');
|
|
11
9
|
|
|
12
10
|
describe('dependency updater prompt', () => {
|
|
13
|
-
afterEach(() => {
|
|
14
|
-
vi.clearAllMocks();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
11
|
it('should enable choosing the preferred updater', async () => {
|
|
12
|
+
const prompt = vi.fn();
|
|
18
13
|
const answers = any.simpleObject();
|
|
19
14
|
const updaters = any.simpleObject();
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
when(prompt).calledWith({
|
|
16
|
+
id: DEPENDENCY_UPDATER_PROMPT_ID,
|
|
17
|
+
questions: [{
|
|
18
|
+
name: questionNames.DEPENDENCY_UPDATER,
|
|
19
|
+
type: 'list',
|
|
20
|
+
message: 'Which dependency-update service do you want to manage this project?',
|
|
21
|
+
choices: [...Object.keys(updaters), 'Other']
|
|
22
|
+
}]
|
|
23
|
+
}).thenResolve(answers);
|
|
27
24
|
|
|
28
|
-
expect(await promptForDependencyUpdaterChoice(updaters,
|
|
25
|
+
expect(await promptForDependencyUpdaterChoice(updaters, {prompt})).toEqual(answers);
|
|
29
26
|
});
|
|
30
27
|
});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {questionNames} from '../prompts/question-names.js';
|
|
2
2
|
import {promptForDependencyUpdaterChoice} from './prompt.js';
|
|
3
3
|
|
|
4
|
-
export default async function (plugins,
|
|
4
|
+
export default async function (plugins, options, {prompt}) {
|
|
5
5
|
if (!Object.keys(plugins).length) return undefined;
|
|
6
6
|
|
|
7
7
|
const plugin = plugins[
|
|
8
|
-
(await promptForDependencyUpdaterChoice(plugins,
|
|
8
|
+
(await promptForDependencyUpdaterChoice(plugins, {prompt}))[questionNames.DEPENDENCY_UPDATER]
|
|
9
9
|
];
|
|
10
10
|
|
|
11
11
|
if (plugin) return plugin.scaffold(options);
|