Skip to content
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 5 commits into from
Mar 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/dependabot.yml
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
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

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.

1 change: 1 addition & 0 deletions .github/workflows/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @wesleytodd @rxmarbles
32 changes: 32 additions & 0 deletions .github/workflows/ci.yaml
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

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
test/tmp
node_modules
package-lock.json
84 changes: 2 additions & 82 deletions README.md
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
Loading