# create-pkg ... ```bash $ npm init pkg ... $ npx create-pkg ``` ```js const pkg = require('create-pkg') // OR import { pkgDefaults, addPrompt } from 'create-pkg' ``` #### Attendees: * Wes Todd (@wesleytodd) * Ruy Adorno (@ruyadorno) * Darcy Clarke (@darcyclarke) #### Questions: 1. ***What do we want the scaffold output to include?*** * `package.json` * `name` * `description` * `homepage` * `author` * `license` * `funding` * `version` * `type` * `main` * `scripts` * `"prepublish": "..."`* (contentious) * `"test": "..."`* (contentious) * `exports` * `index.js` * `LICENSE` file * `CONTRIBUTORS.md` file * `CODE_OF_CONDUCT.md` file * `README.md` file * `FUNDING.yml` file* (contentious) * `.npmrc`* (contentious) * `.gitignore`* (contentious) * Contents: `/node_modules` * `.github/ISSUE_TEMPLATES/*`* (contentious) 1. ***What API surface do we want to expose to both end users and folks who want to compose the base generator with their own custom opinions?*** * Interfaces: CLI w/ Interactive/Prompts & a JS API * ... --- #### Goals: 1. Provide a tool that promotes sane package defaults (defined by PMWG) 1. Provide tools to extend defaults per community/team --- #### Next Steps: * Create an issue for this idea & project against the PMWG * Have `@pkgjs/create-support` be the first consumer ```js // examples... create-support.js const { writeJSONFile, yargs, runWizard } = require('create-pkg') yargs([ { 'message': 'How much time do you have to maintain this package?', 'value': 'SLA' } ]) runWizard().then(_ => writeJSONFile('supports.json', 'SLA', _.SLA)) ``` ``` const runPkg = require('create-pkg') const { runSupportGenerator } = require('@pkgjs/support') const pkg = await runPkg() await runSupportGenerator({ pkg, pkgPath: path.join(process.cwd(), 'package.json') }) ``` #### Notes: * Let's not make things complex* (?) * Want to provide an almost "blessed" tool/command * The important part is to maintain the set of standards/sane defaults * Github gitignore: https://github.com/github/gitignore/blob/master/Node.gitignore * Collection user input: https://github.com/wesleytodd/opta #### Prior Art: * Yeoman * Plop * `npm init x` (ie. `$ npx create-x`)