-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(monorepo): initial commit to create the create-pkg monorepo #18
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
94635b0
chore(monorepo): initial commit to create the create-pkg monorepo
rxmarbles 5ad5d0b
fix: include lock file only for monorepo root
rxmarbles e2f3f0e
chore: address comments
rxmarbles dd617a2
chore(comments): address comments
rxmarbles 5da89e5
test: fix failing test and add test files, also updated standard to l…
rxmarbles File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: 2 | ||
updates: | ||
- directory: / | ||
package-ecosystem: github-actions | ||
rebase-strategy: auto | ||
schedule: | ||
interval: daily | ||
- directory: / | ||
package-ecosystem: npm | ||
rebase-strategy: auto | ||
schedule: | ||
interval: daily | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @wesleytodd @rxmarbles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
pull_request: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
ci: | ||
strategy: | ||
matrix: | ||
node-version: | ||
- '18' | ||
- '20' | ||
- '21' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
- name: Setup Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
cache: npm | ||
cache-dependency-path: 'package-lock.json' | ||
- name: Install Deps | ||
run: npm ci | ||
- name: Run Tests | ||
run: npm test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
test/tmp | ||
node_modules | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,3 @@ | ||
# Scaffold a Package | ||
# Create PKG | ||
|
||
[![NPM Version](https://img.shields.io/npm/v/create-pkg.svg)](https://npmjs.org/package/create-pkg) | ||
[![NPM Downloads](https://img.shields.io/npm/dm/create-pkg.svg)](https://npmjs.org/package/create-pkg) | ||
[![test](https://github.com/pkgjs/create/workflows/Test/badge.svg)](https://github.com/pkgjs/create/actions?query=workflow%3ATest) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard) | ||
|
||
## Usage | ||
|
||
``` | ||
$ npm init pkg | ||
|
||
# or | ||
|
||
$ npx create-pkg | ||
|
||
# or | ||
|
||
$ npm install -g create-pkg | ||
$ create-pkg | ||
``` | ||
|
||
### CLI Usage | ||
|
||
``` | ||
$ create-pkg --help | ||
create-git | ||
|
||
initalize a package | ||
|
||
Options: | ||
--help Show help [boolean] | ||
--version Show version number [boolean] | ||
--cwd, -d Directory to run in [default: process.cwd()] | ||
# TODO | ||
``` | ||
|
||
### Programmatic Usage | ||
|
||
```javascript | ||
const createPkg = require('@pkgjs/create-pkg') | ||
|
||
await createPkg({ | ||
// TODO | ||
}) | ||
``` | ||
|
||
#### Composition with other `create-*` packages | ||
|
||
This generator is built on top of `opta`, a helper library for collecting | ||
user input from multiple interfaces: CLI via `yargs`, interactive prompts via `inquirer` | ||
and via a JS interface. To compose with other `opta` based input collection, | ||
you can use `.options` to access the cli/prompt/js configurations. | ||
|
||
```javascript | ||
const createPkg = require('create-pkg') | ||
const opta = require('opta') | ||
|
||
const opts = opta({ | ||
commandDescription: 'Your description', | ||
options: { | ||
// Spread the options from createGPkg | ||
...createPkg.options, | ||
} | ||
}) | ||
|
||
// Our generator main | ||
module.exports = async function (input) { | ||
// Add our input as overrides on the opta instance | ||
options.overrides(input) | ||
|
||
// Prompt the user, | ||
await options.prompt() | ||
|
||
// Get the current values from the opta instance | ||
let opts = options.values() | ||
|
||
// Call create git | ||
await createPkg(opts) | ||
} | ||
``` | ||
|
||
For more information check out the [docs for `opta`](https://www.npmjs.com/package/opta). | ||
TODO: Add specificities here |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got some feedback from folks on another repo in here that we have been using renovate because dependabot is such trash. I would rather add something than nothing but also just wanted to call it out since this was new for this repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with either tbh. We can remove this once we get the renovate setup in the repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe @ljharb or @dominykas want to chime in? I feel like it was their feedback but my memory might be off.