@form8ion/project 22.0.0-beta.1 → 22.0.0-beta.11
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 +35 -24
- package/lib/index.js +119 -94
- package/lib/index.js.map +1 -1
- package/package.json +24 -26
- 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/license/scaffolder.js +2 -3
- package/src/license/scaffolder.test.js +5 -8
- package/src/lift.js +1 -1
- 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 +11 -13
- package/src/scaffolder.test.js +22 -31
- package/src/vcs/git/remotes.js +6 -7
- package/src/vcs/git/remotes.test.js +36 -16
- package/src/vcs/host/prompt.js +12 -9
- package/src/vcs/host/prompt.test.js +27 -23
- package/src/vcs/host/scaffolder.js +2 -2
- package/src/vcs/host/scaffolder.test.js +5 -5
- package/src/vcs/prompt.js +8 -8
- package/src/vcs/prompt.test.js +12 -11
- package/src/vcs/scaffolder.js +9 -11
- package/src/vcs/scaffolder.test.js +10 -9
- package/src/options-schemas.js +0 -3
- package/src/options-schemas.test.js +0 -20
package/README.md
CHANGED
|
@@ -71,43 +71,54 @@ 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
|
+
logger: {
|
|
110
|
+
info: () => undefined,
|
|
111
|
+
success: () => undefined,
|
|
112
|
+
warn: () => undefined,
|
|
113
|
+
error: () => undefined
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
);
|
|
106
117
|
|
|
107
118
|
await lift({
|
|
108
119
|
projectRoot: process.cwd(),
|
|
109
120
|
results: {},
|
|
110
|
-
enhancers:
|
|
121
|
+
enhancers: ungroupObject(plugins),
|
|
111
122
|
vcs: {}
|
|
112
123
|
});
|
|
113
124
|
```
|
package/lib/index.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
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
|
-
import { warn, info } from '@travi/cli-messages';
|
|
7
|
-
import { prompt } from '@form8ion/overridable-prompts';
|
|
8
5
|
import * as gitPlugin from '@form8ion/git';
|
|
9
6
|
import { test, scaffold as scaffold$1 } from '@form8ion/git';
|
|
10
7
|
import { simpleGit } from 'simple-git';
|
|
11
|
-
import
|
|
8
|
+
import parseGitUrl from 'git-url-parse';
|
|
12
9
|
import { promises } from 'fs';
|
|
13
10
|
import wrap from 'word-wrap';
|
|
14
11
|
import mustache from 'mustache';
|
|
@@ -18,6 +15,15 @@ import { promises as promises$1 } from 'node:fs';
|
|
|
18
15
|
import { resolve } from 'path';
|
|
19
16
|
import filedirname from 'filedirname';
|
|
20
17
|
|
|
18
|
+
const BASE_DETAILS_PROMPT_ID = 'BASE_DETAILS';
|
|
19
|
+
|
|
20
|
+
function promptForBaseDetails(projectRoot, {prompt}) {
|
|
21
|
+
return prompt({
|
|
22
|
+
id: BASE_DETAILS_PROMPT_ID,
|
|
23
|
+
questions: questionsForBaseDetails(projectRoot)
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
21
27
|
const questionNames$1 = {
|
|
22
28
|
GIT_REPO: 'gitRepo',
|
|
23
29
|
REPO_HOST: 'repoHost',
|
|
@@ -26,37 +32,88 @@ const questionNames$1 = {
|
|
|
26
32
|
DEPENDENCY_UPDATER: 'dependencyUpdater'
|
|
27
33
|
};
|
|
28
34
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
const GIT_REPOSITORY_PROMPT_ID = 'GIT_REPOSITORY';
|
|
36
|
+
|
|
37
|
+
async function promptForRepoCreation({prompt}) {
|
|
38
|
+
const {[questionNames$1.GIT_REPO]: gitRepoShouldBeCreated} = await prompt({
|
|
39
|
+
id: GIT_REPOSITORY_PROMPT_ID,
|
|
40
|
+
questions: [{
|
|
41
|
+
name: questionNames$1.GIT_REPO,
|
|
42
|
+
type: 'confirm',
|
|
43
|
+
default: true,
|
|
44
|
+
message: 'Should a git repository be initialized?'
|
|
45
|
+
}]
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
return gitRepoShouldBeCreated;
|
|
36
49
|
}
|
|
37
50
|
|
|
38
|
-
|
|
39
|
-
|
|
51
|
+
const PROJECT_LANGUAGE_PROMPT_ID = 'PROJECT_LANGUAGE';
|
|
52
|
+
|
|
53
|
+
function promptForProjectLanguage(languages, {prompt}) {
|
|
54
|
+
return prompt({
|
|
55
|
+
id: PROJECT_LANGUAGE_PROMPT_ID,
|
|
56
|
+
questions: [{
|
|
57
|
+
name: questionNames$1.PROJECT_LANGUAGE,
|
|
58
|
+
type: 'list',
|
|
59
|
+
message: 'What type of project is this?',
|
|
60
|
+
choices: [...Object.keys(languages), 'Other']
|
|
61
|
+
}]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
40
64
|
|
|
41
|
-
|
|
65
|
+
const REPOSITORY_HOST_PROMPT_ID = 'REPOSITORY_HOST';
|
|
66
|
+
|
|
67
|
+
async function promptForVcsHostChoice(hosts, {prompt}) {
|
|
68
|
+
const answers = await prompt({
|
|
69
|
+
id: REPOSITORY_HOST_PROMPT_ID,
|
|
70
|
+
questions: [{
|
|
71
|
+
name: questionNames$1.REPO_HOST,
|
|
72
|
+
type: 'list',
|
|
73
|
+
message: 'Where will the repository be hosted?',
|
|
74
|
+
choices: Object.keys(hosts)
|
|
75
|
+
}]
|
|
76
|
+
});
|
|
77
|
+
const host = hosts[answers[questionNames$1.REPO_HOST]];
|
|
42
78
|
|
|
43
|
-
|
|
79
|
+
return {...answers, ...host};
|
|
80
|
+
}
|
|
44
81
|
|
|
45
|
-
|
|
82
|
+
const DEPENDENCY_UPDATER_PROMPT_ID = 'DEPENDENCY_UPDATER';
|
|
83
|
+
|
|
84
|
+
async function promptForDependencyUpdaterChoice(updaters, {prompt}) {
|
|
85
|
+
return prompt({
|
|
86
|
+
id: DEPENDENCY_UPDATER_PROMPT_ID,
|
|
87
|
+
questions: [{
|
|
88
|
+
name: questionNames$1.DEPENDENCY_UPDATER,
|
|
89
|
+
type: 'list',
|
|
90
|
+
message: 'Which dependency-update service do you want to manage this project?',
|
|
91
|
+
choices: [...Object.keys(updaters), 'Other']
|
|
92
|
+
}]
|
|
93
|
+
});
|
|
46
94
|
}
|
|
47
95
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}],
|
|
56
|
-
decisions
|
|
57
|
-
);
|
|
96
|
+
const ids = {
|
|
97
|
+
BASE_DETAILS: BASE_DETAILS_PROMPT_ID,
|
|
98
|
+
GIT_REPOSITORY: GIT_REPOSITORY_PROMPT_ID,
|
|
99
|
+
REPOSITORY_HOST: REPOSITORY_HOST_PROMPT_ID,
|
|
100
|
+
PROJECT_LANGUAGE: PROJECT_LANGUAGE_PROMPT_ID,
|
|
101
|
+
DEPENDENCY_UPDATER: DEPENDENCY_UPDATER_PROMPT_ID
|
|
102
|
+
};
|
|
58
103
|
|
|
59
|
-
|
|
104
|
+
const questionNames = {
|
|
105
|
+
...questionNames$2,
|
|
106
|
+
...questionNames$1
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
async function scaffoldLanguage (languagePlugins, options, {prompt}) {
|
|
110
|
+
const {[questionNames$1.PROJECT_LANGUAGE]: chosenLanguage} = await promptForProjectLanguage(languagePlugins, {prompt});
|
|
111
|
+
|
|
112
|
+
const plugin = languagePlugins[chosenLanguage];
|
|
113
|
+
|
|
114
|
+
if (plugin) return plugin.scaffold(options);
|
|
115
|
+
|
|
116
|
+
return undefined;
|
|
60
117
|
}
|
|
61
118
|
|
|
62
119
|
async function getExistingRemotes(git) {
|
|
@@ -74,14 +131,14 @@ async function getExistingRemotes(git) {
|
|
|
74
131
|
async function determineExistingVcsDetails({projectRoot}) {
|
|
75
132
|
const git = simpleGit({baseDir: projectRoot});
|
|
76
133
|
const remoteOrigin = await git.remote(['get-url', 'origin']);
|
|
77
|
-
const {
|
|
134
|
+
const {owner, name, host} = parseGitUrl(remoteOrigin.trimEnd());
|
|
78
135
|
|
|
79
|
-
return {vcs: {owner
|
|
136
|
+
return {vcs: {owner, name, host: 'github.com' === host ? 'github' : host}};
|
|
80
137
|
}
|
|
81
138
|
|
|
82
|
-
async function defineRemoteOrigin(projectRoot, sshUrl) {
|
|
139
|
+
async function defineRemoteOrigin(projectRoot, sshUrl, {logger}) {
|
|
83
140
|
if (!sshUrl) {
|
|
84
|
-
warn('URL not available to configure remote `origin`');
|
|
141
|
+
logger.warn('URL not available to configure remote `origin`');
|
|
85
142
|
|
|
86
143
|
return {nextSteps: []};
|
|
87
144
|
}
|
|
@@ -90,7 +147,7 @@ async function defineRemoteOrigin(projectRoot, sshUrl) {
|
|
|
90
147
|
const existingRemotes = await getExistingRemotes(git);
|
|
91
148
|
|
|
92
149
|
if (existingRemotes.includes('origin')) {
|
|
93
|
-
warn('The `origin` remote is already defined for this repository');
|
|
150
|
+
logger.warn('The `origin` remote is already defined for this repository');
|
|
94
151
|
|
|
95
152
|
return {nextSteps: []};
|
|
96
153
|
}
|
|
@@ -107,20 +164,8 @@ async function defineRemoteOrigin(projectRoot, sshUrl) {
|
|
|
107
164
|
return {nextSteps: [{summary: 'Set local `master` branch to track upstream `origin/master`'}]};
|
|
108
165
|
}
|
|
109
166
|
|
|
110
|
-
async function
|
|
111
|
-
const
|
|
112
|
-
name: questionNames$1.REPO_HOST,
|
|
113
|
-
type: 'list',
|
|
114
|
-
message: 'Where will the repository be hosted?',
|
|
115
|
-
choices: Object.keys(hosts)
|
|
116
|
-
}], decisions);
|
|
117
|
-
const host = hosts[answers[questionNames$1.REPO_HOST]];
|
|
118
|
-
|
|
119
|
-
return {...answers, ...host};
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
async function scaffoldVcsHost(hosts, decisions, options) {
|
|
123
|
-
const {[questionNames$1.REPO_HOST]: chosenHost} = await promptForVcsHostDetails(hosts, decisions);
|
|
167
|
+
async function scaffoldVcsHost(hosts, options, {prompt}) {
|
|
168
|
+
const {[questionNames$1.REPO_HOST]: chosenHost} = await promptForVcsHostChoice(hosts, {prompt});
|
|
124
169
|
|
|
125
170
|
const lowercasedHosts = Object.fromEntries(
|
|
126
171
|
Object.entries(hosts).map(([name, details]) => [name.toLowerCase(), details])
|
|
@@ -132,24 +177,23 @@ async function scaffoldVcsHost(hosts, decisions, options) {
|
|
|
132
177
|
return {vcs: {}};
|
|
133
178
|
}
|
|
134
179
|
|
|
135
|
-
async function scaffoldVcs(
|
|
136
|
-
|
|
180
|
+
async function scaffoldVcs(
|
|
181
|
+
{projectRoot, projectName, vcsHosts, visibility, description},
|
|
182
|
+
{prompt, logger}
|
|
183
|
+
) {
|
|
184
|
+
if (await promptForRepoCreation({prompt})) {
|
|
137
185
|
if (await test({projectRoot})) {
|
|
138
|
-
info('Git repository already exists');
|
|
186
|
+
logger.info('Git repository already exists');
|
|
139
187
|
|
|
140
|
-
return
|
|
188
|
+
return determineExistingVcsDetails({projectRoot});
|
|
141
189
|
}
|
|
142
190
|
|
|
143
191
|
const [{vcs: {host, owner, name, sshUrl}}] = await Promise.all([
|
|
144
|
-
scaffoldVcsHost(
|
|
145
|
-
vcsHosts,
|
|
146
|
-
decisions,
|
|
147
|
-
{projectName, projectRoot, description, visibility}
|
|
148
|
-
),
|
|
192
|
+
scaffoldVcsHost(vcsHosts, {projectName, projectRoot, description, visibility}, {prompt}),
|
|
149
193
|
scaffold$1({projectRoot})
|
|
150
194
|
]);
|
|
151
195
|
|
|
152
|
-
const remoteOriginResults = await defineRemoteOrigin(projectRoot, sshUrl);
|
|
196
|
+
const remoteOriginResults = await defineRemoteOrigin(projectRoot, sshUrl, {logger});
|
|
153
197
|
|
|
154
198
|
return {
|
|
155
199
|
vcs: {host, owner, name},
|
|
@@ -160,9 +204,9 @@ async function scaffoldVcs({projectRoot, projectName, decisions, vcsHosts, visib
|
|
|
160
204
|
return {};
|
|
161
205
|
}
|
|
162
206
|
|
|
163
|
-
async function scaffoldLicense
|
|
207
|
+
async function scaffoldLicense({projectRoot, license, copyright}, {logger}) {
|
|
164
208
|
if (license) {
|
|
165
|
-
info('Generating License');
|
|
209
|
+
logger.info('Generating License');
|
|
166
210
|
|
|
167
211
|
const licenseContent = spdxLicenseList[license].licenseText;
|
|
168
212
|
|
|
@@ -209,20 +253,11 @@ var licensePlugin = /*#__PURE__*/Object.freeze({
|
|
|
209
253
|
test: tester
|
|
210
254
|
});
|
|
211
255
|
|
|
212
|
-
async function
|
|
213
|
-
return prompt([{
|
|
214
|
-
name: questionNames$1.DEPENDENCY_UPDATER,
|
|
215
|
-
type: 'list',
|
|
216
|
-
message: 'Which dependency-update service do you want to manage this project?',
|
|
217
|
-
choices: [...Object.keys(updaters), 'Other']
|
|
218
|
-
}], decisions);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
async function scaffoldDependencyUpdater (plugins, decisions, options) {
|
|
256
|
+
async function scaffoldDependencyUpdater (plugins, options, {prompt}) {
|
|
222
257
|
if (!Object.keys(plugins).length) return undefined;
|
|
223
258
|
|
|
224
259
|
const plugin = plugins[
|
|
225
|
-
(await promptForDependencyUpdaterChoice(plugins,
|
|
260
|
+
(await promptForDependencyUpdaterChoice(plugins, {prompt}))[questionNames$1.DEPENDENCY_UPDATER]
|
|
226
261
|
];
|
|
227
262
|
|
|
228
263
|
if (plugin) return plugin.scaffold(options);
|
|
@@ -230,21 +265,14 @@ async function scaffoldDependencyUpdater (plugins, decisions, options) {
|
|
|
230
265
|
return undefined;
|
|
231
266
|
}
|
|
232
267
|
|
|
233
|
-
function promptForBaseDetails(projectRoot, decisions) {
|
|
234
|
-
return prompt(questionsForBaseDetails(decisions, projectRoot), decisions);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
268
|
var languagePluginsSchema = joi.object().pattern(/^/, optionsSchemas.form8ionPlugin).default({});
|
|
238
269
|
|
|
239
270
|
var vcsHostPluginsSchema = joi.object().pattern(/^/, optionsSchemas.form8ionPlugin);
|
|
240
271
|
|
|
241
272
|
var dependencyUpdaterPluginsSchema = joi.object().pattern(joi.string(), optionsSchemas.form8ionPlugin).default({});
|
|
242
273
|
|
|
243
|
-
const decisionsSchema = joi.object();
|
|
244
|
-
|
|
245
274
|
function validate(options) {
|
|
246
275
|
return validateOptions(joi.object({
|
|
247
|
-
decisions: decisionsSchema,
|
|
248
276
|
plugins: joi.object({
|
|
249
277
|
dependencyUpdaters: dependencyUpdaterPluginsSchema,
|
|
250
278
|
languages: languagePluginsSchema,
|
|
@@ -281,7 +309,7 @@ function scaffoldContributing ({visibility}) {
|
|
|
281
309
|
return {};
|
|
282
310
|
}
|
|
283
311
|
|
|
284
|
-
async function lift
|
|
312
|
+
async function lift({projectRoot, results, enhancers, vcs, dependencies}) {
|
|
285
313
|
const enhancerResults = await applyEnhancers({
|
|
286
314
|
results,
|
|
287
315
|
enhancers: {...enhancers, gitPlugin, licensePlugin},
|
|
@@ -294,9 +322,9 @@ async function lift ({projectRoot, results, enhancers, vcs, dependencies}) {
|
|
|
294
322
|
return enhancerResults;
|
|
295
323
|
}
|
|
296
324
|
|
|
297
|
-
async function scaffold(options) {
|
|
325
|
+
async function scaffold(options, {prompt, logger}) {
|
|
298
326
|
const projectRoot = process.cwd();
|
|
299
|
-
const {
|
|
327
|
+
const {plugins: {dependencyUpdaters, languages, vcsHosts = {}}} = validate(options);
|
|
300
328
|
|
|
301
329
|
const {
|
|
302
330
|
[questionNames$2.PROJECT_NAME]: projectName,
|
|
@@ -305,27 +333,27 @@ async function scaffold(options) {
|
|
|
305
333
|
[questionNames$2.DESCRIPTION]: description,
|
|
306
334
|
[questionNames$2.COPYRIGHT_YEAR]: copyrightYear,
|
|
307
335
|
[questionNames$2.COPYRIGHT_HOLDER]: copyHolder
|
|
308
|
-
} = await promptForBaseDetails(projectRoot,
|
|
336
|
+
} = await promptForBaseDetails(projectRoot, {prompt});
|
|
309
337
|
const copyright = {year: copyrightYear, holder: copyHolder};
|
|
310
338
|
|
|
311
339
|
const [vcsResults, contributing, license] = await Promise.all([
|
|
312
|
-
scaffoldVcs({projectRoot, projectName,
|
|
340
|
+
scaffoldVcs({projectRoot, projectName, vcsHosts, visibility, description}, {prompt, logger}),
|
|
313
341
|
scaffoldContributing({visibility}),
|
|
314
|
-
scaffoldLicense({projectRoot, license: chosenLicense, copyright}),
|
|
342
|
+
scaffoldLicense({projectRoot, license: chosenLicense, copyright}, {logger}),
|
|
315
343
|
scaffold$2({projectName, projectRoot, description}),
|
|
316
344
|
scaffoldEditorConfig({projectRoot})
|
|
317
345
|
]);
|
|
318
346
|
|
|
319
347
|
const dependencyUpdaterResults = vcsResults.vcs && await scaffoldDependencyUpdater(
|
|
320
348
|
dependencyUpdaters,
|
|
321
|
-
|
|
322
|
-
{
|
|
349
|
+
{projectRoot},
|
|
350
|
+
{prompt}
|
|
323
351
|
);
|
|
324
352
|
|
|
325
353
|
const language = await scaffoldLanguage(
|
|
326
354
|
languages,
|
|
327
|
-
|
|
328
|
-
{
|
|
355
|
+
{projectRoot, projectName, vcs: vcsResults.vcs, visibility, license: chosenLicense || 'UNLICENSED', description},
|
|
356
|
+
{prompt}
|
|
329
357
|
);
|
|
330
358
|
|
|
331
359
|
const mergedResults = deepmerge.all([
|
|
@@ -344,20 +372,17 @@ async function scaffold(options) {
|
|
|
344
372
|
});
|
|
345
373
|
|
|
346
374
|
if (language && language.verificationCommand) {
|
|
347
|
-
info('Verifying the generated project');
|
|
375
|
+
logger.info('Verifying the generated project');
|
|
348
376
|
|
|
349
377
|
const subprocess = execa(language.verificationCommand, {shell: true});
|
|
350
378
|
subprocess.stdout.pipe(process.stdout);
|
|
351
379
|
await subprocess;
|
|
352
380
|
}
|
|
353
381
|
|
|
354
|
-
|
|
382
|
+
return mergedResults;
|
|
355
383
|
}
|
|
356
384
|
|
|
357
|
-
const
|
|
358
|
-
...questionNames$2,
|
|
359
|
-
...questionNames$1
|
|
360
|
-
};
|
|
385
|
+
const promptConstants = {ids};
|
|
361
386
|
|
|
362
|
-
export { lift, questionNames, scaffold };
|
|
387
|
+
export { lift, promptConstants, questionNames, scaffold };
|
|
363
388
|
//# 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/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 hostedGitInfo from 'hosted-git-info';\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 {user, project, type} = hostedGitInfo.fromUrl(remoteOrigin);\n\n return {vcs: {owner: user, name: project, host: type}};\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\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 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);\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 {vcs: await 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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,gBAAgB;AACzC,IAAI,SAAS;AACb,IAAI,SAAS;AACb,IAAI,CAAC,WAAW,EAAE,WAAW,EAAE,GAAG,EAAE,UAAU,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,IAAI,YAAY,EAAE,WAAW;AACnH,GAAG;;AAEH,EAAE,MAAM,aAAa,GAAG,SAAS,CAAC,GAAG,CAAC;AACtC,IAAI,OAAO;AACX,IAAI,QAAQ;AACZ,IAAI,wBAAwB;AAC5B,IAAI,YAAY;AAChB,IAAI;AACJ,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;;AAEpB,EAAE,MAAM,IAAI,CAAC;AACb,IAAI,WAAW;AACf,IAAI,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;;AAEA,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';\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, {logger}) {\n if (!sshUrl) {\n logger.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 logger.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 {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(\n {projectRoot, projectName, vcsHosts, visibility, description},\n {prompt, logger}\n) {\n if (await repositoryShouldBeCreated({prompt})) {\n if (await alreadyVersionedByGit({projectRoot})) {\n logger.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, {logger});\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';\n\nexport default async function scaffoldLicense({projectRoot, license, copyright}, {logger}) {\n if (license) {\n logger.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 lift({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';\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, logger}) {\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, logger}),\n scaffoldContributing({visibility}),\n scaffoldLicense({projectRoot, license: chosenLicense, copyright}, {logger}),\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 logger.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,C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