form8ion / project

opinionated scaffolder for new projects
https://npm.im/@form8ion/project
MIT License
5 stars 3 forks source link

project

opinionated scaffolder for new projects

Node CI Workflow Status OpenSSF Scorecard Codecov SLSA Level 2

Table of Contents

Features

Usage

npm node MIT license

Installation

$ npm install @form8ion/project --save-prod

Consumption in a CLI tool

This scaffolder is intended to be used as a CLI tool, but it is left up to the consumer to provide the actual CLI wrapper. My sub-command for commander is an example of such a wrapper.

Example

Import

import {lift, questionNames, scaffold} from '@form8ion/project';

Execute

await scaffold({
  decisions: {
    [questionNames.PROJECT_NAME]: 'my-project',
    [questionNames.LICENSE]: 'MIT',
    [questionNames.VISIBILITY]: 'Public',
    [questionNames.DESCRIPTION]: 'My project',
    [questionNames.GIT_REPO]: false,
    [questionNames.COPYRIGHT_HOLDER]: 'John Smith',
    [questionNames.COPYRIGHT_YEAR]: '2022',
    [questionNames.PROJECT_LANGUAGE]: 'foo'
  },
  plugins: {
    dependencyUpdaters: {
      bar: {scaffold: options => options}
    },
    languages: {
      foo: {scaffold: options => options}
    },
    vcsHosts: {
      baz: {
        scaffold: options => options,
        prompt: () => ({repoOwner: 'form8ion'})
      }
    }
  }
});

await lift({
  projectRoot: process.cwd(),
  results: {},
  enhancers: {foo: {test: () => true, lift: () => ({})}},
  vcs: {}
});

API

This is an opinionated scaffolder, but there are some aspects that are configurable in order to support multiple contexts.

Takes a single options object as an argument, containing:

languages (optional)

provides the languages to choose from and the functions to perform the scaffolding for the chosen language. if no languages are provided, Other will be the only choice presented. Choosing Other will perform no language-specific scaffolding. Official options are provided in the awesome list.

object:

vcsHosts (optional)

provides the vcs hosts to choose from and the functions to perform the scaffolding for the chosen host. if no hosts are provided, Other will be the only choice presented. Choosing Other will perform no host-specific scaffolding. Official options are provided in the awesome list.

object:

dependencyUpdaters (optional)

provides the dependency updaters to choose from and the functions to perform the scaffolding for the chosen updater service. if no updater services are provided, Other will be the only choice presented. Choosing Other will perform no updater-service-specific scaffolding. Official options are provided in the awesome list.

object:

Contributing

Conventional Commits Commitizen friendly PRs Welcome Renovate semantic-release: angular

Dependencies

$ nvm install
$ npm install

Verification

$ npm test

Related Projects

Inspiration