@form8ion/project 22.0.0-beta.14 → 22.0.0-beta.16
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/lib/index.js +44 -6
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ci-provider/index.js +1 -0
- package/src/ci-provider/scaffolder.js +27 -0
- package/src/ci-provider/scaffolder.test.js +68 -0
- package/src/scaffolder.js +4 -2
- package/src/scaffolder.test.js +10 -1
package/lib/index.js
CHANGED
|
@@ -269,6 +269,47 @@ async function scaffoldDependencyUpdater(plugins, options, {prompt}) {
|
|
|
269
269
|
return undefined;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
+
const CI_PROVIDER_PROMPT_ID = 'CI_PROVIDER';
|
|
273
|
+
|
|
274
|
+
const {CI_PROVIDER: CI_PROVIDER$1} = questionNames.CI_PROVIDER;
|
|
275
|
+
|
|
276
|
+
function promptForCiProvider(providers, {prompt}) {
|
|
277
|
+
return prompt({
|
|
278
|
+
id: CI_PROVIDER_PROMPT_ID,
|
|
279
|
+
questions: [{
|
|
280
|
+
name: CI_PROVIDER$1,
|
|
281
|
+
type: 'list',
|
|
282
|
+
message: 'Which CI service do you want use with this project?',
|
|
283
|
+
choices: [...Object.keys(providers), 'Other']
|
|
284
|
+
}]
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const {CI_PROVIDER} = questionNames.CI_PROVIDER;
|
|
289
|
+
|
|
290
|
+
async function scaffoldCiProvider(plugins, options, {prompt}) {
|
|
291
|
+
if (!Object.keys(plugins).length) return undefined;
|
|
292
|
+
|
|
293
|
+
const {projectRoot} = options;
|
|
294
|
+
|
|
295
|
+
const qualifiedPlugins = Object.fromEntries(
|
|
296
|
+
(await Promise.all(
|
|
297
|
+
Object.entries(plugins).map(async ([name, plugin]) => [
|
|
298
|
+
name,
|
|
299
|
+
plugin,
|
|
300
|
+
plugin.qualify ? await plugin.qualify({projectRoot}) : true
|
|
301
|
+
])
|
|
302
|
+
)).filter(([, , qualified]) => qualified).map(([name, plugin]) => [name, plugin])
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
const chosen = (await promptForCiProvider(qualifiedPlugins, {prompt}))[CI_PROVIDER];
|
|
306
|
+
const plugin = qualifiedPlugins[chosen];
|
|
307
|
+
|
|
308
|
+
if (plugin) return plugin.scaffold(options);
|
|
309
|
+
|
|
310
|
+
return {};
|
|
311
|
+
}
|
|
312
|
+
|
|
272
313
|
const BASE_DETAILS_PROMPT_ID = 'BASE_DETAILS';
|
|
273
314
|
|
|
274
315
|
function promptForBaseDetails(projectRoot, {prompt}) {
|
|
@@ -348,7 +389,7 @@ async function lift({projectRoot, results, enhancers, vcs, dependencies}) {
|
|
|
348
389
|
|
|
349
390
|
async function scaffold(options, {prompt, logger}) {
|
|
350
391
|
const projectRoot = process.cwd();
|
|
351
|
-
const {plugins: {dependencyUpdaters, languages, vcsHosts = {}}} = validate(options);
|
|
392
|
+
const {plugins: {dependencyUpdaters, ciProviders, languages, vcsHosts = {}}} = validate(options);
|
|
352
393
|
|
|
353
394
|
const {
|
|
354
395
|
[questionNames$1.PROJECT_NAME]: projectName,
|
|
@@ -370,7 +411,8 @@ async function scaffold(options, {prompt, logger}) {
|
|
|
370
411
|
|
|
371
412
|
const [dependencyUpdaterResults] = vcsResults.vcs
|
|
372
413
|
? await Promise.all([
|
|
373
|
-
scaffoldDependencyUpdater(dependencyUpdaters, {projectRoot}, {prompt})
|
|
414
|
+
scaffoldDependencyUpdater(dependencyUpdaters, {projectRoot}, {prompt}),
|
|
415
|
+
scaffoldCiProvider(ciProviders, {projectRoot}, {prompt})
|
|
374
416
|
])
|
|
375
417
|
: [];
|
|
376
418
|
|
|
@@ -406,10 +448,6 @@ async function scaffold(options, {prompt, logger}) {
|
|
|
406
448
|
return mergedResults;
|
|
407
449
|
}
|
|
408
450
|
|
|
409
|
-
const CI_PROVIDER_PROMPT_ID = 'CI_PROVIDER';
|
|
410
|
-
|
|
411
|
-
const {CI_PROVIDER} = questionNames.CI_PROVIDER;
|
|
412
|
-
|
|
413
451
|
const ids = {
|
|
414
452
|
BASE_DETAILS: BASE_DETAILS_PROMPT_ID,
|
|
415
453
|
GIT_REPOSITORY: GIT_REPOSITORY_PROMPT_ID,
|
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/ci-provider/schema.js","../src/options-validator.js","../src/template-path.js","../src/editorconfig/scaffolder.js","../src/editorconfig/tester.js","../src/contributing/scaffolder.js","../src/lift.js","../src/scaffolder.js","../src/ci-provider/prompt.js","../src/prompts/index.js"],"sourcesContent":["import {questionNames as coreQuestionNames} from '@form8ion/core';\n\nexport const questionNames = {\n BASE_DETAILS: coreQuestionNames,\n GIT_REPOSITORY: {\n GIT_REPO: 'gitRepo'\n },\n REPOSITORY_HOST: {\n REPO_HOST: 'repoHost',\n REPO_OWNER: 'repoOwner'\n },\n PROJECT_LANGUAGE: {\n PROJECT_LANGUAGE: 'projectLanguage'\n },\n DEPENDENCY_UPDATER: {\n DEPENDENCY_UPDATER: 'dependencyUpdater'\n },\n CI_PROVIDER: {\n CI_PROVIDER: 'ciProvider'\n }\n};\n","import {questionNames} from '../prompts/question-names.js';\n\nexport const PROJECT_LANGUAGE_PROMPT_ID = 'PROJECT_LANGUAGE';\n\nconst {PROJECT_LANGUAGE} = questionNames.PROJECT_LANGUAGE;\n\nexport default function promptForProjectLanguage(languages, {prompt}) {\n return prompt({\n id: PROJECT_LANGUAGE_PROMPT_ID,\n questions: [{\n name: 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';\nimport promptForLanguageDetails from './prompt.js';\n\nconst {PROJECT_LANGUAGE} = questionNames.PROJECT_LANGUAGE;\n\nexport default async function scaffoldLanguage(languagePlugins, options, {prompt}) {\n const {[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 {questionNames} from '../prompts/question-names.js';\n\nexport const GIT_REPOSITORY_PROMPT_ID = 'GIT_REPOSITORY';\n\nconst {GIT_REPO} = questionNames.GIT_REPOSITORY;\n\nexport default async function promptForRepoCreation({prompt}) {\n const {[GIT_REPO]: gitRepoShouldBeCreated} = await prompt({\n id: GIT_REPOSITORY_PROMPT_ID,\n questions: [{\n name: 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 {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';\n\nexport const REPOSITORY_HOST_PROMPT_ID = 'REPOSITORY_HOST';\n\nconst {REPO_HOST} = questionNames.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: 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[REPO_HOST]];\n\n return {...answers, ...host};\n}\n","import {questionNames} from '../../prompts/question-names.js';\nimport promptForVcsHostDetails from './prompt.js';\n\nconst {REPO_HOST} = questionNames.REPOSITORY_HOST;\n\nexport default async function scaffoldVcsHost(hosts, options, {prompt}) {\n const {[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 licenseDefined({projectRoot}) {\n return fileExists(`${projectRoot}/LICENSE`);\n}\n","function repositoryIsHostedOnGithub(vcs) {\n return vcs && 'github' === vcs.host;\n}\n\nexport default function liftLicense({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';\n\nexport const DEPENDENCY_UPDATER_PROMPT_ID = 'DEPENDENCY_UPDATER';\n\nconst {DEPENDENCY_UPDATER} = questionNames.DEPENDENCY_UPDATER;\n\nexport async function promptForDependencyUpdaterChoice(updaters, {prompt}) {\n return prompt({\n id: DEPENDENCY_UPDATER_PROMPT_ID,\n questions: [{\n name: 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} from '../prompts/question-names.js';\nimport {promptForDependencyUpdaterChoice} from './prompt.js';\n\nconst {DEPENDENCY_UPDATER} = questionNames.DEPENDENCY_UPDATER;\n\nexport default async function scaffoldDependencyUpdater(plugins, options, {prompt}) {\n if (!Object.keys(plugins).length) return undefined;\n\n const plugin = plugins[\n (await promptForDependencyUpdaterChoice(plugins, {prompt}))[DEPENDENCY_UPDATER]\n ];\n\n if (plugin) return plugin.scaffold(options);\n\n return undefined;\n}\n","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","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';\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';\nimport ciProviderPluginsSchema from './ci-provider/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 ciProviders: ciProviderPluginsSchema\n })\n }), options) || {};\n}\n","import {resolve} from 'path';\nimport filedirname from 'filedirname';\n\nexport default function determinePathToTemplate(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 scaffoldEditorConfig({projectRoot}) {\n return fs.copyFile(determinePathToTemplateFile('editorconfig.ini'), `${projectRoot}/.editorconfig`);\n}\n","import {fileExists} from '@form8ion/core';\n\nexport default function editorconfigInUse({projectRoot}) {\n return fileExists(`${projectRoot}/.editorconfig`);\n}\n","export default function scaffoldContribution({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 {scaffold as scaffoldEditorconfig, test as editorconfigInUse} from './editorconfig/index.js';\nimport * as licensePlugin from './license/index.js';\n\nexport default async function lift({projectRoot, results, enhancers, vcs, dependencies}) {\n if (!await editorconfigInUse({projectRoot})) {\n await scaffoldEditorconfig({projectRoot});\n }\n\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\n ? await Promise.all([\n scaffoldDependencyUpdater(dependencyUpdaters, {projectRoot}, {prompt})\n ])\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 {questionNames} from '../prompts/question-names.js';\n\nexport const CI_PROVIDER_PROMPT_ID = 'CI_PROVIDER';\n\nconst {CI_PROVIDER} = questionNames.CI_PROVIDER;\n\nexport default function promptForCiProvider(providers, {prompt}) {\n return prompt({\n id: CI_PROVIDER_PROMPT_ID,\n questions: [{\n name: CI_PROVIDER,\n type: 'list',\n message: 'Which CI service do you want use with this project?',\n choices: [...Object.keys(providers), 'Other']\n }]\n });\n}\n","import {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 {CI_PROVIDER_PROMPT_ID} from '../ci-provider/prompt.js';\nimport {questionNames} 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 CI_PROVIDER: CI_PROVIDER_PROMPT_ID\n};\n\nexport {questionNames};\n\nexport const constants = {ids, questionNames};\n"],"names":["coreQuestionNames","PROJECT_LANGUAGE","promptForLanguageDetails","REPO_HOST","promptForVcsHostDetails","repositoryShouldBeCreated","alreadyVersionedByGit","scaffoldGit","fs","DEPENDENCY_UPDATER","determinePathToTemplateFile","scaffoldEditorconfig","liftReadme","scaffoldContributing","scaffoldReadme"],"mappings":";;;;;;;;;;;;;;;;;AAEO,MAAM,aAAa,GAAG;AAC7B,EAAE,YAAY,EAAEA,eAAiB;AACjC,EAAE,cAAc,EAAE;AAClB,IAAI,QAAQ,EAAE;AACd,GAAG;AACH,EAA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E,GAAG,SAAS,EAAE,GAAG,QAAQ;AAChE,GAAG,CAAC;;AAEJ,EAAE,IAAI,QAAQ,IAAI,QAAQ,CAAC,mBAAmB,EAAE;AAChD,IAAI,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC;;AAElD,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,OAAO,aAAa;AACtB;;ACvEO,MAAM,qBAAqB,GAAG,aAAa;;AAElD,MAAM,CAAC,WAAW,CAAC,GAAG,aAAa,CAAC,WAAW;;ACIxC,MAAM,GAAG,GAAG;AACnB,EAAE,YAAY,EAAE,sBAAsB;AACtC,EAAE,cAAc,EAAE,wBAAwB;AAC1C,EAAE,eAAe,EAAE,yBAAyB;AAC5C,EAAE,gBAAgB,EAAE,0BAA0B;AAC9C,EAAE,kBAAkB,EAAE,4BAA4B;AAClD,EAAE,WAAW,EAAE;AACf,CAAC;;AAIW,MAAC,SAAS,GAAG,CAAC,GAAG,EAAE,aAAa;;;;"}
|
|
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/ci-provider/prompt.js","../src/ci-provider/scaffolder.js","../src/prompts/questions.js","../src/language/schema.js","../src/vcs/host/schema.js","../src/dependency-updater/schema.js","../src/ci-provider/schema.js","../src/options-validator.js","../src/template-path.js","../src/editorconfig/scaffolder.js","../src/editorconfig/tester.js","../src/contributing/scaffolder.js","../src/lift.js","../src/scaffolder.js","../src/prompts/index.js"],"sourcesContent":["import {questionNames as coreQuestionNames} from '@form8ion/core';\n\nexport const questionNames = {\n BASE_DETAILS: coreQuestionNames,\n GIT_REPOSITORY: {\n GIT_REPO: 'gitRepo'\n },\n REPOSITORY_HOST: {\n REPO_HOST: 'repoHost',\n REPO_OWNER: 'repoOwner'\n },\n PROJECT_LANGUAGE: {\n PROJECT_LANGUAGE: 'projectLanguage'\n },\n DEPENDENCY_UPDATER: {\n DEPENDENCY_UPDATER: 'dependencyUpdater'\n },\n CI_PROVIDER: {\n CI_PROVIDER: 'ciProvider'\n }\n};\n","import {questionNames} from '../prompts/question-names.js';\n\nexport const PROJECT_LANGUAGE_PROMPT_ID = 'PROJECT_LANGUAGE';\n\nconst {PROJECT_LANGUAGE} = questionNames.PROJECT_LANGUAGE;\n\nexport default function promptForProjectLanguage(languages, {prompt}) {\n return prompt({\n id: PROJECT_LANGUAGE_PROMPT_ID,\n questions: [{\n name: 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';\nimport promptForLanguageDetails from './prompt.js';\n\nconst {PROJECT_LANGUAGE} = questionNames.PROJECT_LANGUAGE;\n\nexport default async function scaffoldLanguage(languagePlugins, options, {prompt}) {\n const {[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 {questionNames} from '../prompts/question-names.js';\n\nexport const GIT_REPOSITORY_PROMPT_ID = 'GIT_REPOSITORY';\n\nconst {GIT_REPO} = questionNames.GIT_REPOSITORY;\n\nexport default async function promptForRepoCreation({prompt}) {\n const {[GIT_REPO]: gitRepoShouldBeCreated} = await prompt({\n id: GIT_REPOSITORY_PROMPT_ID,\n questions: [{\n name: 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 {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';\n\nexport const REPOSITORY_HOST_PROMPT_ID = 'REPOSITORY_HOST';\n\nconst {REPO_HOST} = questionNames.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: 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[REPO_HOST]];\n\n return {...answers, ...host};\n}\n","import {questionNames} from '../../prompts/question-names.js';\nimport promptForVcsHostDetails from './prompt.js';\n\nconst {REPO_HOST} = questionNames.REPOSITORY_HOST;\n\nexport default async function scaffoldVcsHost(hosts, options, {prompt}) {\n const {[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 licenseDefined({projectRoot}) {\n return fileExists(`${projectRoot}/LICENSE`);\n}\n","function repositoryIsHostedOnGithub(vcs) {\n return vcs && 'github' === vcs.host;\n}\n\nexport default function liftLicense({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';\n\nexport const DEPENDENCY_UPDATER_PROMPT_ID = 'DEPENDENCY_UPDATER';\n\nconst {DEPENDENCY_UPDATER} = questionNames.DEPENDENCY_UPDATER;\n\nexport async function promptForDependencyUpdaterChoice(updaters, {prompt}) {\n return prompt({\n id: DEPENDENCY_UPDATER_PROMPT_ID,\n questions: [{\n name: 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} from '../prompts/question-names.js';\nimport {promptForDependencyUpdaterChoice} from './prompt.js';\n\nconst {DEPENDENCY_UPDATER} = questionNames.DEPENDENCY_UPDATER;\n\nexport default async function scaffoldDependencyUpdater(plugins, options, {prompt}) {\n if (!Object.keys(plugins).length) return undefined;\n\n const plugin = plugins[\n (await promptForDependencyUpdaterChoice(plugins, {prompt}))[DEPENDENCY_UPDATER]\n ];\n\n if (plugin) return plugin.scaffold(options);\n\n return undefined;\n}\n","import {questionNames} from '../prompts/question-names.js';\n\nexport const CI_PROVIDER_PROMPT_ID = 'CI_PROVIDER';\n\nconst {CI_PROVIDER} = questionNames.CI_PROVIDER;\n\nexport default function promptForCiProvider(providers, {prompt}) {\n return prompt({\n id: CI_PROVIDER_PROMPT_ID,\n questions: [{\n name: CI_PROVIDER,\n type: 'list',\n message: 'Which CI service do you want use with this project?',\n choices: [...Object.keys(providers), 'Other']\n }]\n });\n}\n","import {questionNames} from '../prompts/question-names.js';\nimport promptForCiProvider from './prompt.js';\n\nconst {CI_PROVIDER} = questionNames.CI_PROVIDER;\n\nexport default async function scaffoldCiProvider(plugins, options, {prompt}) {\n if (!Object.keys(plugins).length) return undefined;\n\n const {projectRoot} = options;\n\n const qualifiedPlugins = Object.fromEntries(\n (await Promise.all(\n Object.entries(plugins).map(async ([name, plugin]) => [\n name,\n plugin,\n plugin.qualify ? await plugin.qualify({projectRoot}) : true\n ])\n )).filter(([, , qualified]) => qualified).map(([name, plugin]) => [name, plugin])\n );\n\n const chosen = (await promptForCiProvider(qualifiedPlugins, {prompt}))[CI_PROVIDER];\n const plugin = qualifiedPlugins[chosen];\n\n if (plugin) return plugin.scaffold(options);\n\n return {};\n}\n","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","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';\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';\nimport ciProviderPluginsSchema from './ci-provider/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 ciProviders: ciProviderPluginsSchema\n })\n }), options) || {};\n}\n","import {resolve} from 'path';\nimport filedirname from 'filedirname';\n\nexport default function determinePathToTemplate(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 scaffoldEditorConfig({projectRoot}) {\n return fs.copyFile(determinePathToTemplateFile('editorconfig.ini'), `${projectRoot}/.editorconfig`);\n}\n","import {fileExists} from '@form8ion/core';\n\nexport default function editorconfigInUse({projectRoot}) {\n return fileExists(`${projectRoot}/.editorconfig`);\n}\n","export default function scaffoldContribution({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 {scaffold as scaffoldEditorconfig, test as editorconfigInUse} from './editorconfig/index.js';\nimport * as licensePlugin from './license/index.js';\n\nexport default async function lift({projectRoot, results, enhancers, vcs, dependencies}) {\n if (!await editorconfigInUse({projectRoot})) {\n await scaffoldEditorconfig({projectRoot});\n }\n\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 {scaffold as scaffoldCiProvider} from './ci-provider/index.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, ciProviders, 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\n ? await Promise.all([\n scaffoldDependencyUpdater(dependencyUpdaters, {projectRoot}, {prompt}),\n scaffoldCiProvider(ciProviders, {projectRoot}, {prompt})\n ])\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 {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 {CI_PROVIDER_PROMPT_ID} from '../ci-provider/prompt.js';\nimport {questionNames} 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 CI_PROVIDER: CI_PROVIDER_PROMPT_ID\n};\n\nexport {questionNames};\n\nexport const constants = {ids, questionNames};\n"],"names":["coreQuestionNames","PROJECT_LANGUAGE","promptForLanguageDetails","REPO_HOST","promptForVcsHostDetails","repositoryShouldBeCreated","alreadyVersionedByGit","scaffoldGit","fs","DEPENDENCY_UPDATER","CI_PROVIDER","determinePathToTemplateFile","scaffoldEditorconfig","liftReadme","scaffoldContributing","scaffoldReadme"],"mappings":";;;;;;;;;;;;;;;;;AAEO,MAAM,aAAa,GAAG;AAC7B,EAAE,YAAY,EAAEA,eAAiB;AACjC,EAAE,cAAc,EAAE;AAClB,IAAI,QAAQ,EAAE;AACd,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,SAAS,EAAE,UAAU;AACzB,IAAI,UAAU,EAAE;AAChB,GAA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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,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC;;AAElD,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,OAAO,aAAa;AACtB;;ACnEO,MAAM,GAAG,GAAG;AACnB,EAAE,YAAY,EAAE,sBAAsB;AACtC,EAAE,cAAc,EAAE,wBAAwB;AAC1C,EAAE,eAAe,EAAE,yBAAyB;AAC5C,EAAE,gBAAgB,EAAE,0BAA0B;AAC9C,EAAE,kBAAkB,EAAE,4BAA4B;AAClD,EAAE,WAAW,EAAE;AACf,CAAC;;AAIW,MAAC,SAAS,GAAG,CAAC,GAAG,EAAE,aAAa;;;;"}
|
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {default as scaffold} from './scaffolder.js';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {questionNames} from '../prompts/question-names.js';
|
|
2
|
+
import promptForCiProvider from './prompt.js';
|
|
3
|
+
|
|
4
|
+
const {CI_PROVIDER} = questionNames.CI_PROVIDER;
|
|
5
|
+
|
|
6
|
+
export default async function scaffoldCiProvider(plugins, options, {prompt}) {
|
|
7
|
+
if (!Object.keys(plugins).length) return undefined;
|
|
8
|
+
|
|
9
|
+
const {projectRoot} = options;
|
|
10
|
+
|
|
11
|
+
const qualifiedPlugins = Object.fromEntries(
|
|
12
|
+
(await Promise.all(
|
|
13
|
+
Object.entries(plugins).map(async ([name, plugin]) => [
|
|
14
|
+
name,
|
|
15
|
+
plugin,
|
|
16
|
+
plugin.qualify ? await plugin.qualify({projectRoot}) : true
|
|
17
|
+
])
|
|
18
|
+
)).filter(([, , qualified]) => qualified).map(([name, plugin]) => [name, plugin])
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const chosen = (await promptForCiProvider(qualifiedPlugins, {prompt}))[CI_PROVIDER];
|
|
22
|
+
const plugin = qualifiedPlugins[chosen];
|
|
23
|
+
|
|
24
|
+
if (plugin) return plugin.scaffold(options);
|
|
25
|
+
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import {describe, expect, it, vi} from 'vitest';
|
|
2
|
+
import any from '@travi/any';
|
|
3
|
+
import {when} from 'vitest-when';
|
|
4
|
+
|
|
5
|
+
import promptForCiProvider from './prompt.js';
|
|
6
|
+
import scaffoldCiProvider from './scaffolder.js';
|
|
7
|
+
import {questionNames} from '../prompts/index.js';
|
|
8
|
+
|
|
9
|
+
vi.mock('./prompt.js');
|
|
10
|
+
|
|
11
|
+
const {CI_PROVIDER} = questionNames.CI_PROVIDER;
|
|
12
|
+
|
|
13
|
+
describe('ci-provider scaffolder', () => {
|
|
14
|
+
const prompt = () => undefined;
|
|
15
|
+
const projectRoot = any.string();
|
|
16
|
+
const options = {projectRoot};
|
|
17
|
+
|
|
18
|
+
it('should qualify each plugin and prompt only with those that qualify', async () => {
|
|
19
|
+
const qualifiedProviderName = any.word();
|
|
20
|
+
const unqualifiedProviderName = any.word();
|
|
21
|
+
const qualifiedScaffolder = vi.fn();
|
|
22
|
+
const qualifiedPlugin = {qualify: vi.fn(), scaffold: qualifiedScaffolder};
|
|
23
|
+
const unqualifiedPlugin = {qualify: vi.fn(), scaffold: vi.fn()};
|
|
24
|
+
const scaffolderResult = any.simpleObject();
|
|
25
|
+
when(qualifiedPlugin.qualify).calledWith({projectRoot}).thenResolve(true);
|
|
26
|
+
when(unqualifiedPlugin.qualify).calledWith({projectRoot}).thenResolve(false);
|
|
27
|
+
when(promptForCiProvider)
|
|
28
|
+
.calledWith({[qualifiedProviderName]: qualifiedPlugin}, {prompt})
|
|
29
|
+
.thenResolve({[CI_PROVIDER]: qualifiedProviderName});
|
|
30
|
+
when(qualifiedScaffolder).calledWith(options).thenResolve(scaffolderResult);
|
|
31
|
+
|
|
32
|
+
expect(await scaffoldCiProvider(
|
|
33
|
+
{[qualifiedProviderName]: qualifiedPlugin, [unqualifiedProviderName]: unqualifiedPlugin},
|
|
34
|
+
options,
|
|
35
|
+
{prompt}
|
|
36
|
+
)).toEqual(scaffolderResult);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it('should treat a plugin without a qualify method as always qualifying', async () => {
|
|
40
|
+
const providerName = any.word();
|
|
41
|
+
const pluginScaffolder = vi.fn();
|
|
42
|
+
const plugin = {scaffold: pluginScaffolder};
|
|
43
|
+
const scaffolderResult = any.simpleObject();
|
|
44
|
+
when(promptForCiProvider)
|
|
45
|
+
.calledWith({[providerName]: plugin}, {prompt})
|
|
46
|
+
.thenResolve({[CI_PROVIDER]: providerName});
|
|
47
|
+
when(pluginScaffolder).calledWith(options).thenResolve(scaffolderResult);
|
|
48
|
+
|
|
49
|
+
expect(await scaffoldCiProvider({[providerName]: plugin}, options, {prompt})).toEqual(scaffolderResult);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it('should not present a prompt when no plugins are registered', async () => {
|
|
53
|
+
expect(await scaffoldCiProvider({}, options, {prompt})).toBe(undefined);
|
|
54
|
+
expect(promptForCiProvider).not.toHaveBeenCalled();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
it('should return undefined when Other is chosen', async () => {
|
|
58
|
+
const providerName = any.word();
|
|
59
|
+
const plugin = {qualify: vi.fn(), scaffold: vi.fn()};
|
|
60
|
+
when(plugin.qualify).calledWith({projectRoot}).thenResolve(true);
|
|
61
|
+
when(promptForCiProvider)
|
|
62
|
+
.calledWith({[providerName]: plugin}, {prompt})
|
|
63
|
+
.thenResolve({[CI_PROVIDER]: 'Other'});
|
|
64
|
+
|
|
65
|
+
expect(await scaffoldCiProvider({[providerName]: plugin}, options, {prompt})).toEqual({});
|
|
66
|
+
expect(plugin.scaffold).not.toHaveBeenCalled();
|
|
67
|
+
});
|
|
68
|
+
});
|
package/src/scaffolder.js
CHANGED
|
@@ -7,6 +7,7 @@ import {scaffold as scaffoldLanguage} from './language/index.js';
|
|
|
7
7
|
import {scaffold as scaffoldVcs} from './vcs/index.js';
|
|
8
8
|
import {scaffold as scaffoldLicense} from './license/index.js';
|
|
9
9
|
import scaffoldDependencyUpdater from './dependency-updater/scaffolder.js';
|
|
10
|
+
import {scaffold as scaffoldCiProvider} from './ci-provider/index.js';
|
|
10
11
|
import {promptForBaseDetails} from './prompts/questions.js';
|
|
11
12
|
import {validate} from './options-validator.js';
|
|
12
13
|
import {scaffold as scaffoldEditorConfig} from './editorconfig/index.js';
|
|
@@ -15,7 +16,7 @@ import lift from './lift.js';
|
|
|
15
16
|
|
|
16
17
|
export async function scaffold(options, {prompt, logger}) {
|
|
17
18
|
const projectRoot = process.cwd();
|
|
18
|
-
const {plugins: {dependencyUpdaters, languages, vcsHosts = {}}} = validate(options);
|
|
19
|
+
const {plugins: {dependencyUpdaters, ciProviders, languages, vcsHosts = {}}} = validate(options);
|
|
19
20
|
|
|
20
21
|
const {
|
|
21
22
|
[coreQuestionNames.PROJECT_NAME]: projectName,
|
|
@@ -37,7 +38,8 @@ export async function scaffold(options, {prompt, logger}) {
|
|
|
37
38
|
|
|
38
39
|
const [dependencyUpdaterResults] = vcsResults.vcs
|
|
39
40
|
? await Promise.all([
|
|
40
|
-
scaffoldDependencyUpdater(dependencyUpdaters, {projectRoot}, {prompt})
|
|
41
|
+
scaffoldDependencyUpdater(dependencyUpdaters, {projectRoot}, {prompt}),
|
|
42
|
+
scaffoldCiProvider(ciProviders, {projectRoot}, {prompt})
|
|
41
43
|
])
|
|
42
44
|
: [];
|
|
43
45
|
|
package/src/scaffolder.test.js
CHANGED
|
@@ -11,6 +11,7 @@ import {scaffold as scaffoldVcs} from './vcs/index.js';
|
|
|
11
11
|
import * as licenseScaffolder from './license/scaffolder.js';
|
|
12
12
|
import scaffoldLanguage from './language/scaffolder.js';
|
|
13
13
|
import * as dependencyUpdaterScaffolder from './dependency-updater/scaffolder.js';
|
|
14
|
+
import {scaffold as scaffoldCiProvider} from './ci-provider/index.js';
|
|
14
15
|
import * as optionsValidator from './options-validator.js';
|
|
15
16
|
import * as prompts from './prompts/questions.js';
|
|
16
17
|
import {questionNames} from './prompts/question-names.js';
|
|
@@ -27,6 +28,7 @@ vi.mock('./vcs/index.js');
|
|
|
27
28
|
vi.mock('./license/scaffolder');
|
|
28
29
|
vi.mock('./language/scaffolder');
|
|
29
30
|
vi.mock('./dependency-updater/scaffolder');
|
|
31
|
+
vi.mock('./ci-provider/index.js');
|
|
30
32
|
vi.mock('./options-validator');
|
|
31
33
|
vi.mock('./prompts/questions');
|
|
32
34
|
vi.mock('./editorconfig');
|
|
@@ -73,6 +75,7 @@ describe('project scaffolder', () => {
|
|
|
73
75
|
const holder = any.sentence();
|
|
74
76
|
const copyright = {year, holder};
|
|
75
77
|
const dependencyUpdaters = any.simpleObject();
|
|
78
|
+
const ciProviders = any.simpleObject();
|
|
76
79
|
const dependencyUpdaterNextSteps = any.listOf(any.simpleObject);
|
|
77
80
|
const dependencyUpdaterContributionBadges = any.simpleObject();
|
|
78
81
|
const dependencyUpdaterResults = {
|
|
@@ -97,7 +100,7 @@ describe('project scaffolder', () => {
|
|
|
97
100
|
]);
|
|
98
101
|
when(optionsValidator.validate)
|
|
99
102
|
.calledWith(options)
|
|
100
|
-
.thenReturn({plugins: {dependencyUpdaters, languages, vcsHosts}});
|
|
103
|
+
.thenReturn({plugins: {dependencyUpdaters, ciProviders, languages, vcsHosts}});
|
|
101
104
|
when(prompts.promptForBaseDetails)
|
|
102
105
|
.calledWith(projectPath, {prompt})
|
|
103
106
|
.thenResolve({
|
|
@@ -124,6 +127,11 @@ describe('project scaffolder', () => {
|
|
|
124
127
|
|
|
125
128
|
expect(scaffoldReadme).toHaveBeenCalledWith({projectName, projectRoot: projectPath, description});
|
|
126
129
|
expect(scaffoldEditorconfig).toHaveBeenCalledWith({projectRoot: projectPath});
|
|
130
|
+
expect(scaffoldCiProvider).toHaveBeenCalledWith(
|
|
131
|
+
ciProviders,
|
|
132
|
+
{projectRoot: projectPath},
|
|
133
|
+
{prompt}
|
|
134
|
+
);
|
|
127
135
|
expect(lift).toHaveBeenCalledWith({
|
|
128
136
|
projectRoot: projectPath,
|
|
129
137
|
vcs,
|
|
@@ -183,6 +191,7 @@ describe('project scaffolder', () => {
|
|
|
183
191
|
await scaffold(options, {prompt});
|
|
184
192
|
|
|
185
193
|
expect(dependencyUpdaterScaffolder.default).not.toHaveBeenCalled();
|
|
194
|
+
expect(scaffoldCiProvider).not.toHaveBeenCalled();
|
|
186
195
|
});
|
|
187
196
|
|
|
188
197
|
it('should scaffold the details of the chosen language plugin', async () => {
|