@form8ion/project 22.0.0-beta.12 → 22.0.0-beta.13
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 +12 -1
- package/lib/index.js.map +1 -1
- package/package.json +6 -6
- package/src/ci-provider/schema.js +4 -0
- package/src/ci-provider/schema.test.js +43 -0
- package/src/editorconfig/index.js +1 -0
- package/src/editorconfig/tester.js +5 -0
- package/src/editorconfig/tester.test.js +25 -0
- package/src/lift.js +5 -0
- package/src/lift.test.js +23 -11
- package/src/options-validator.js +3 -1
- package/src/options-validator.test.js +3 -1
package/lib/index.js
CHANGED
|
@@ -271,12 +271,15 @@ var vcsHostPluginsSchema = joi.object().pattern(/^/, optionsSchemas.form8ionPlug
|
|
|
271
271
|
|
|
272
272
|
var dependencyUpdaterPluginsSchema = joi.object().pattern(joi.string(), optionsSchemas.form8ionPlugin).default({});
|
|
273
273
|
|
|
274
|
+
var ciProviderPluginsSchema = joi.object().pattern(joi.string(), optionsSchemas.form8ionPlugin).default({});
|
|
275
|
+
|
|
274
276
|
function validate(options) {
|
|
275
277
|
return validateOptions(joi.object({
|
|
276
278
|
plugins: joi.object({
|
|
277
279
|
dependencyUpdaters: dependencyUpdaterPluginsSchema,
|
|
278
280
|
languages: languagePluginsSchema,
|
|
279
|
-
vcsHosts: vcsHostPluginsSchema
|
|
281
|
+
vcsHosts: vcsHostPluginsSchema,
|
|
282
|
+
ciProviders: ciProviderPluginsSchema
|
|
280
283
|
})
|
|
281
284
|
}), options) || {};
|
|
282
285
|
}
|
|
@@ -291,6 +294,10 @@ function scaffoldEditorConfig ({projectRoot}) {
|
|
|
291
294
|
return promises$1.copyFile(determinePathToTemplateFile('editorconfig.ini'), `${projectRoot}/.editorconfig`);
|
|
292
295
|
}
|
|
293
296
|
|
|
297
|
+
function editorconfigInUse({projectRoot}) {
|
|
298
|
+
return fileExists(`${projectRoot}/.editorconfig`);
|
|
299
|
+
}
|
|
300
|
+
|
|
294
301
|
function scaffoldContributing ({visibility}) {
|
|
295
302
|
if ('Public' === visibility) {
|
|
296
303
|
return {
|
|
@@ -310,6 +317,10 @@ function scaffoldContributing ({visibility}) {
|
|
|
310
317
|
}
|
|
311
318
|
|
|
312
319
|
async function lift({projectRoot, results, enhancers, vcs, dependencies}) {
|
|
320
|
+
if (!await editorconfigInUse({projectRoot})) {
|
|
321
|
+
await scaffoldEditorConfig({projectRoot});
|
|
322
|
+
}
|
|
323
|
+
|
|
313
324
|
const enhancerResults = await applyEnhancers({
|
|
314
325
|
results,
|
|
315
326
|
enhancers: {...enhancers, gitPlugin, licensePlugin},
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,CAAC,EAAE;AAC9D,EAAE,MAAM,CAAC,CAACA,eAAa,CAAC,QAAQ,GAAG,sBAAsB,CAAC,GAAG,MAAM,MAAM,CAAC;AAC1E,IAAI,EAAE,EAAE,wBAAwB;AAChC,IAAI,SAAS,EAAE,CAAC;AAChB,MAAM,IAAI,EAAEA,eAAa,CAAC,QAAQ;AAClC,MAAM,IAAI,EAAE,SAAS;AACrB,MAAM,OAAO,EAAE,IAAI;AACnB,MAAM,OAAO,EAAE;AACf,KAAK;AACL,GAAG,CAAC;;AAEJ,EAAE,OAAO,sBAAsB;AAC/B;;ACdO,MAAM,0BAA0B,GAAG,kBAAkB;;AAE7C,SAAS,wBAAwB,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE;AACtE,EAAE,OAAO,MAAM,CAAC;AAChB,IAAI,EAAE,EAAE,0BAA0B;AAClC,IAAI,SAAS,EAAE,CAAC;AAChB,MAAM,IAAI,EAAEA,eAAa,CAAC,gBAAgB;AAC1C,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.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/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/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 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 (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","import {fileExists} from '@form8ion/core';\n\nexport default function editorconfigInUse({projectRoot}) {\n return fileExists(`${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 {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 && 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","scaffoldEditorconfig","liftReadme","scaffoldReadme"],"mappings":";;;;;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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;;ACrEY,MAAC,eAAe,GAAG,CAAC,GAAG;;;;"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@form8ion/project",
|
|
3
3
|
"description": "opinionated scaffolder for new projects",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "22.0.0-beta.
|
|
5
|
+
"version": "22.0.0-beta.13",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": "^22.21.0 || >=24.12"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"access": "public",
|
|
56
56
|
"provenance": true
|
|
57
57
|
},
|
|
58
|
-
"packageManager": "npm@11.
|
|
58
|
+
"packageManager": "npm@11.12.1+sha512.cdca14b85d647b3192028d02aadbe82d75f79a446aceea9874be98e6d768f20ebd3555770a48d0e9906106007877bbc690f715e9372f2e2dc644a3c3157fb14c",
|
|
59
59
|
"config": {
|
|
60
60
|
"commitizen": {
|
|
61
61
|
"path": "./node_modules/cz-conventional-changelog"
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@cucumber/cucumber": "12.7.0",
|
|
82
|
-
"@form8ion/commitlint-config": "2.0.
|
|
82
|
+
"@form8ion/commitlint-config": "2.0.11",
|
|
83
83
|
"@form8ion/eslint-config": "7.0.14",
|
|
84
84
|
"@form8ion/eslint-config-cucumber": "1.4.1",
|
|
85
85
|
"@form8ion/eslint-config-vitest": "1.1.0",
|
|
@@ -105,12 +105,12 @@
|
|
|
105
105
|
"remark-toc": "9.0.0",
|
|
106
106
|
"remark-usage": "11.0.1",
|
|
107
107
|
"rimraf": "6.1.3",
|
|
108
|
-
"rollup": "4.
|
|
108
|
+
"rollup": "4.60.1",
|
|
109
109
|
"rollup-plugin-auto-external": "2.0.0",
|
|
110
|
-
"sinon": "21.0
|
|
110
|
+
"sinon": "21.1.0",
|
|
111
111
|
"testdouble": "3.20.2",
|
|
112
112
|
"unist-util-find": "3.0.0",
|
|
113
|
-
"vitest": "4.
|
|
113
|
+
"vitest": "4.1.4",
|
|
114
114
|
"vitest-when": "0.10.0"
|
|
115
115
|
}
|
|
116
116
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {validateOptions} from '@form8ion/core';
|
|
2
|
+
|
|
3
|
+
import {describe, expect, it} from 'vitest';
|
|
4
|
+
import any from '@travi/any';
|
|
5
|
+
|
|
6
|
+
import ciProviderPluginsSchema from './schema.js';
|
|
7
|
+
|
|
8
|
+
describe('ci-provider plugins schema', () => {
|
|
9
|
+
const key = any.word();
|
|
10
|
+
|
|
11
|
+
it('should return the validated options', () => {
|
|
12
|
+
const options = any.objectWithKeys(
|
|
13
|
+
any.listOf(any.string),
|
|
14
|
+
{factory: () => ({scaffold: foo => foo})}
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
expect(validateOptions(ciProviderPluginsSchema, options)).toEqual(options);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should require options to be provided as an object', () => {
|
|
21
|
+
expect(() => validateOptions(ciProviderPluginsSchema, {[key]: []}))
|
|
22
|
+
.toThrowError(`"${key}" must be of type object`);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('should require a `scaffold` property to be included', () => {
|
|
26
|
+
expect(() => validateOptions(ciProviderPluginsSchema, {[key]: {}}))
|
|
27
|
+
.toThrowError(`"${key}.scaffold" is required`);
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('should require `scaffold` to be a function', () => {
|
|
31
|
+
expect(() => validateOptions(ciProviderPluginsSchema, {[key]: {scaffold: any.word()}}))
|
|
32
|
+
.toThrowError(`"${key}.scaffold" must be of type function`);
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('should require the scaffolder to accept a single argument', () => {
|
|
36
|
+
expect(() => validateOptions(ciProviderPluginsSchema, {[key]: {scaffold: () => undefined}}))
|
|
37
|
+
.toThrowError(`"${key}.scaffold" must have an arity greater or equal to 1`);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should default to an empty map when no updaters are provided', () => {
|
|
41
|
+
expect(validateOptions(ciProviderPluginsSchema)).toEqual({});
|
|
42
|
+
});
|
|
43
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {fileExists} from '@form8ion/core';
|
|
2
|
+
|
|
3
|
+
import {describe, it, vi, expect} from 'vitest';
|
|
4
|
+
import {when} from 'vitest-when';
|
|
5
|
+
import any from '@travi/any';
|
|
6
|
+
|
|
7
|
+
import editorconfigInUse from './tester.js';
|
|
8
|
+
|
|
9
|
+
vi.mock('@form8ion/core');
|
|
10
|
+
|
|
11
|
+
describe('editorconfig tester', () => {
|
|
12
|
+
const projectRoot = any.string();
|
|
13
|
+
|
|
14
|
+
it('should return `true` if an `.editorconfig` file exists', async () => {
|
|
15
|
+
when(fileExists).calledWith(`${projectRoot}/.editorconfig`).thenResolve(true);
|
|
16
|
+
|
|
17
|
+
expect(await editorconfigInUse({projectRoot})).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
it('should return `false` if an `.editorconfig` file does not exist', async () => {
|
|
21
|
+
when(fileExists).calledWith(`${projectRoot}/.editorconfig`).thenResolve(false);
|
|
22
|
+
|
|
23
|
+
expect(await editorconfigInUse({projectRoot})).toBe(false);
|
|
24
|
+
});
|
|
25
|
+
});
|
package/src/lift.js
CHANGED
|
@@ -2,9 +2,14 @@ import {applyEnhancers} from '@form8ion/core';
|
|
|
2
2
|
import {lift as liftReadme} from '@form8ion/readme';
|
|
3
3
|
import * as gitPlugin from '@form8ion/git';
|
|
4
4
|
|
|
5
|
+
import {scaffold as scaffoldEditorconfig, test as editorconfigInUse} from './editorconfig/index.js';
|
|
5
6
|
import * as licensePlugin from './license/index.js';
|
|
6
7
|
|
|
7
8
|
export default async function lift({projectRoot, results, enhancers, vcs, dependencies}) {
|
|
9
|
+
if (!await editorconfigInUse({projectRoot})) {
|
|
10
|
+
await scaffoldEditorconfig({projectRoot});
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
const enhancerResults = await applyEnhancers({
|
|
9
14
|
results,
|
|
10
15
|
enhancers: {...enhancers, gitPlugin, licensePlugin},
|
package/src/lift.test.js
CHANGED
|
@@ -2,29 +2,28 @@ import * as core from '@form8ion/core';
|
|
|
2
2
|
import * as readme from '@form8ion/readme';
|
|
3
3
|
import * as gitPlugin from '@form8ion/git';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {beforeEach, describe, expect, it, vi} from 'vitest';
|
|
6
6
|
import any from '@travi/any';
|
|
7
7
|
import {when} from 'vitest-when';
|
|
8
8
|
|
|
9
|
+
import {scaffold as scaffoldEditorconfig, test as editorconfigInUse} from './editorconfig/index.js';
|
|
9
10
|
import * as licensePlugin from './license/index.js';
|
|
10
11
|
import lift from './lift.js';
|
|
11
12
|
|
|
12
13
|
vi.mock('deepmerge');
|
|
13
14
|
vi.mock('@form8ion/core');
|
|
14
15
|
vi.mock('@form8ion/readme');
|
|
16
|
+
vi.mock('./editorconfig/index.js');
|
|
15
17
|
|
|
16
18
|
describe('lift', () => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
const projectRoot = any.string();
|
|
20
|
+
const results = any.simpleObject();
|
|
21
|
+
const enhancers = any.simpleObject();
|
|
22
|
+
const vcs = any.simpleObject();
|
|
23
|
+
const dependencies = any.simpleObject();
|
|
24
|
+
const enhancerResults = any.simpleObject();
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
const projectRoot = any.string();
|
|
23
|
-
const enhancers = any.simpleObject();
|
|
24
|
-
const dependencies = any.simpleObject();
|
|
25
|
-
const vcs = any.simpleObject();
|
|
26
|
-
const results = any.simpleObject();
|
|
27
|
-
const enhancerResults = any.simpleObject();
|
|
26
|
+
beforeEach(() => {
|
|
28
27
|
when(core.applyEnhancers)
|
|
29
28
|
.calledWith({
|
|
30
29
|
results,
|
|
@@ -33,8 +32,21 @@ describe('lift', () => {
|
|
|
33
32
|
dependencies
|
|
34
33
|
})
|
|
35
34
|
.thenResolve(enhancerResults);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should lift the README based on the provided results', async () => {
|
|
38
|
+
when(editorconfigInUse).calledWith({projectRoot}).thenResolve(true);
|
|
36
39
|
|
|
37
40
|
expect(await lift({projectRoot, results, enhancers, vcs, dependencies})).toEqual(enhancerResults);
|
|
38
41
|
expect(readme.lift).toHaveBeenCalledWith({projectRoot, results: enhancerResults});
|
|
42
|
+
expect(scaffoldEditorconfig).not.toHaveBeenCalled();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should scaffold editorconfig when it isnt already in use', async () => {
|
|
46
|
+
when(editorconfigInUse).calledWith({projectRoot}).thenResolve(false);
|
|
47
|
+
|
|
48
|
+
await lift({projectRoot, results, enhancers, vcs, dependencies});
|
|
49
|
+
|
|
50
|
+
expect(scaffoldEditorconfig).toHaveBeenCalledWith({projectRoot});
|
|
39
51
|
});
|
|
40
52
|
});
|
package/src/options-validator.js
CHANGED
|
@@ -4,13 +4,15 @@ import joi from 'joi';
|
|
|
4
4
|
import languagePluginsSchema from './language/schema.js';
|
|
5
5
|
import vcsHostPluginsSchema from './vcs/host/schema.js';
|
|
6
6
|
import dependencyUpdaterPluginsSchema from './dependency-updater/schema.js';
|
|
7
|
+
import ciProviderPluginsSchema from './ci-provider/schema.js';
|
|
7
8
|
|
|
8
9
|
export function validate(options) {
|
|
9
10
|
return validateOptions(joi.object({
|
|
10
11
|
plugins: joi.object({
|
|
11
12
|
dependencyUpdaters: dependencyUpdaterPluginsSchema,
|
|
12
13
|
languages: languagePluginsSchema,
|
|
13
|
-
vcsHosts: vcsHostPluginsSchema
|
|
14
|
+
vcsHosts: vcsHostPluginsSchema,
|
|
15
|
+
ciProviders: ciProviderPluginsSchema
|
|
14
16
|
})
|
|
15
17
|
}), options) || {};
|
|
16
18
|
}
|
|
@@ -5,6 +5,7 @@ import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
|
|
|
5
5
|
import any from '@travi/any';
|
|
6
6
|
import {when} from 'vitest-when';
|
|
7
7
|
|
|
8
|
+
import ciProviderPluginsSchema from './ci-provider/schema.js';
|
|
8
9
|
import languagePluginsSchema from './language/schema.js';
|
|
9
10
|
import vcsHostPluginsSchema from './vcs/host/schema.js';
|
|
10
11
|
import dependencyUpdaterPluginsSchema from './dependency-updater/schema.js';
|
|
@@ -35,7 +36,8 @@ describe('options validator', () => {
|
|
|
35
36
|
.calledWith({
|
|
36
37
|
dependencyUpdaters: dependencyUpdaterPluginsSchema,
|
|
37
38
|
languages: languagePluginsSchema,
|
|
38
|
-
vcsHosts: vcsHostPluginsSchema
|
|
39
|
+
vcsHosts: vcsHostPluginsSchema,
|
|
40
|
+
ciProviders: ciProviderPluginsSchema
|
|
39
41
|
})
|
|
40
42
|
.thenReturn(pluginsSchema);
|
|
41
43
|
when(joi.object).calledWith({plugins: pluginsSchema}).thenReturn(fullSchema);
|