Package-maintenance: Building `create-pkg`

Created on 4 Sep 2020  路  16Comments  路  Source: nodejs/package-maintenance

EDIT by @boneskull: This issue has been moved to pkgjs/create#9; please comment there

Recently, I was able to transfer the ownership of the create-pkg package over to the @pkgjs org on npmjs.com. The hope here is that this namespace/package can serve as tooling to scaffold new projects with whatever defaults this group wants to define & be unblocked by npm-specific defaults in npm init.

@wesleytodd @ruyadorno & I got together the other day to discuss this a bit more & here's some of the notes from that discussion:

Note: We'd love input & to have a broader discussion about how/what we could build

create-pkg

Goals:

  1. Provide a tool that promotes sane package defaults (defined by PMWG)
  2. Provide tools to extend defaults per community/team

Example Usage:

$ npm init pkg
$ npx create-pkg
const pkg = require('create-pkg')
import pkg from 'create-pkg'

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

    • CONTRIBUTING.md

    • CODE_OF_CONDUCT.md

    • README.md

    • FUNDING.yml* (contentious)

    • .npmrc* (contentious)

    • .gitignore* (contentious)



      • Contents: /node_modules



    • .github/ISSUE_TEMPLATES/** (contentious)

  2. 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

Next Steps:

  • Get some general consensus of the approach we'd like to take building this & the defaults we'd want
  • Update @pkgjs/support to be a consumer of this tool or vice-versa

References & Prior Art:

Most helpful comment

For scripts.test, I like "echo \"Error: no test specified\" && exit 1" :smile:

All 16 comments

In meeting was mentioned that

CONTRIBUTORS.md

should be

CONTRIBUTING.md

I hope this is the correct place to post this: Since npm v7 supports workspaces, it would be helpful to have a variant of this potentially be able to setup workspaces/monorepositories too. Maybe some inspiration can be drawn from https://github.com/lerna/lerna/tree/master/commands/init#readme. I probably cannot attend tomorrow, but since I just heard about this at the npm RFC meeting, I thought I would drop it here.

While I am not sure that would be a top priority for the first iteration, I completely agree that it should be a feature of this tool.

@wesleytodd please remember to also add me to the org 馃槉

Count me in to help on next steps @wesleytodd ! 馃憢

@wesleytodd ditto for me as well

Will be happy to help here

This one is waiting on me, I have I think all of the code on my machine, just need to run through it and push. Sorry for the delay, I will try to get to it this week.

I'm looking for some more context on this. @darcyclarke describes what the package is intended to do, but does not describe what lead the team to want to build this.

For scripts.test, I like "echo \"Error: no test specified\" && exit 1" :smile:

@wesleytodd any chance you could just push what you have, warts and all ?

After pushing I noticed a few things wrong with what I pushed, but here is the start: https://github.com/pkgjs/create

@boneskull move this list into pkgjs/create repo

@wesleytodd your friendly 馃檪馃榿馃槃馃槣 reminder to move create-package-json etc. into pkgjs org

Closing in lieu of pkgjs/create#9

To anyone who wants to help move this forward, please see that issue/repo.

Maybe we should keep this open as a "tracking" issue for package-maintenance-agenda? IDK. It should still probably stay on the agenda... new issue?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dominykas picture dominykas  路  4Comments

thescientist13 picture thescientist13  路  6Comments

jonchurch picture jonchurch  路  6Comments

thescientist13 picture thescientist13  路  5Comments

dominykas picture dominykas  路  6Comments