Skip to content

Commit 8b2c6d9

Browse files
rxmarbleswesleytodd
authored andcommitted
chore(monorepo): initial commit to create the create-pkg monorepo
1 parent 7e31a87 commit 8b2c6d9

27 files changed

+211
-124
lines changed

.github/dependabot.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- directory: /
4+
package-ecosystem: github-actions
5+
rebase-strategy: auto
6+
schedule:
7+
interval: daily
8+
- directory: /
9+
package-ecosystem: npm
10+
rebase-strategy: auto
11+
schedule:
12+
interval: daily

.github/workflows/CODEOWNERS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @wesleytodd @rxmarbles

.github/workflows/ci.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
ci:
13+
strategy:
14+
matrix:
15+
node-version:
16+
- '18'
17+
- '20'
18+
- '21'
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout Repo
22+
uses: actions/checkout@v4
23+
- name: Setup Node
24+
uses: actions/setup-node@v4
25+
with:
26+
cache: npm
27+
cache-dependency-path: 'package-lock.json'
28+
- name: Install Deps
29+
run: npm ci
30+
- name: Run Tests
31+
run: npm test
32+

.npmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
package-lock=false
1+
registry=https://registry.npmjs.org

README.md

+2-82
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,3 @@
1-
# Scaffold a Package
1+
# Create PKG
22

3-
[![NPM Version](https://img.shields.io/npm/v/create-pkg.svg)](https://npmjs.org/package/create-pkg)
4-
[![NPM Downloads](https://img.shields.io/npm/dm/create-pkg.svg)](https://npmjs.org/package/create-pkg)
5-
[![test](https://github.com/pkgjs/create/workflows/Test/badge.svg)](https://github.com/pkgjs/create/actions?query=workflow%3ATest)
6-
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard)
7-
8-
## Usage
9-
10-
```
11-
$ npm init pkg
12-
13-
# or
14-
15-
$ npx create-pkg
16-
17-
# or
18-
19-
$ npm install -g create-pkg
20-
$ create-pkg
21-
```
22-
23-
### CLI Usage
24-
25-
```
26-
$ create-pkg --help
27-
create-git
28-
29-
initalize a package
30-
31-
Options:
32-
--help Show help [boolean]
33-
--version Show version number [boolean]
34-
--cwd, -d Directory to run in [default: process.cwd()]
35-
# TODO
36-
```
37-
38-
### Programmatic Usage
39-
40-
```javascript
41-
const createPkg = require('@pkgjs/create-pkg')
42-
43-
await createPkg({
44-
// TODO
45-
})
46-
```
47-
48-
#### Composition with other `create-*` packages
49-
50-
This generator is built on top of `opta`, a helper library for collecting
51-
user input from multiple interfaces: CLI via `yargs`, interactive prompts via `inquirer`
52-
and via a JS interface. To compose with other `opta` based input collection,
53-
you can use `.options` to access the cli/prompt/js configurations.
54-
55-
```javascript
56-
const createPkg = require('create-pkg')
57-
const opta = require('opta')
58-
59-
const opts = opta({
60-
commandDescription: 'Your description',
61-
options: {
62-
// Spread the options from createGPkg
63-
...createPkg.options,
64-
}
65-
})
66-
67-
// Our generator main
68-
module.exports = async function (input) {
69-
// Add our input as overrides on the opta instance
70-
options.overrides(input)
71-
72-
// Prompt the user,
73-
await options.prompt()
74-
75-
// Get the current values from the opta instance
76-
let opts = options.values()
77-
78-
// Call create git
79-
await createPkg(opts)
80-
}
81-
```
82-
83-
For more information check out the [docs for `opta`](https://www.npmjs.com/package/opta).
3+
TODO: Add specificities here

package.json

+15-41
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,21 @@
11
{
2-
"name": "create-pkg",
3-
"version": "0.0.0",
4-
"description": "Scaffold a package",
5-
"author": "Wes Todd <[email protected]>",
6-
"keywords": [
7-
"scaffold",
8-
"package",
9-
"git",
10-
"module",
11-
"package.json",
12-
"readme",
13-
"mocha",
14-
"standard"
15-
],
16-
"license": "ISC",
17-
"main": "index.js",
18-
"repository": {
19-
"type": "git",
20-
"url": "[email protected]:pkgjs/create.git"
21-
},
22-
"bin": {
23-
"create-package": "bin/create-package"
24-
},
2+
"name": "create-pkg-monorepo",
3+
"version": "1.0.0",
4+
"description": "The mono-repo for all create-pkg packages",
255
"scripts": {
26-
"test": "standard && mocha --timeout=60000",
27-
"test:debug": "mocha --inspect --inspect-brk --timeout=0",
28-
"release": "npm t && standard-version && npm publish",
29-
"postpublish": "git push origin && git push origin --tags"
6+
"test": "npm test -ws --if-present"
307
},
31-
"dependencies": {
32-
"cptmpl": "0.0.5",
33-
"create-git": "^1.0.0-2",
34-
"create-package-json": "^1.0.0-2",
35-
"loggerr": "^3.0.0-3",
36-
"opta": "0.0.6",
37-
"semver": "^7.3.2"
8+
"repository": {
9+
"type": "git",
10+
"url": "git+ssh://[email protected]/pkgjs/create-pkg.git"
3811
},
39-
"devDependencies": {
40-
"fs-extra": "^8.0.1",
41-
"fs-test-fixtures": "^0.1.3",
42-
"mocha": "^6.2.2",
43-
"standard": "^14.3.1",
44-
"standard-version": "^9.0.0"
12+
"author": "",
13+
"license": "ISC",
14+
"bugs": {
15+
"url": "https://github.com/pkgjs/create-pkg/issues"
4516
},
46-
"support": true
17+
"homepage": "https://github.com/pkgjs/create-pkg#readme",
18+
"workspaces": [
19+
"packages/*"
20+
]
4721
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/create-pkg-cli/README.md

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Scaffold a Package
2+
3+
[![NPM Version](https://img.shields.io/npm/v/create-pkg.svg)](https://npmjs.org/package/create-pkg)
4+
[![NPM Downloads](https://img.shields.io/npm/dm/create-pkg.svg)](https://npmjs.org/package/create-pkg)
5+
[![test](https://github.com/pkgjs/create/workflows/Test/badge.svg)](https://github.com/pkgjs/create/actions?query=workflow%3ATest)
6+
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard)
7+
8+
## Usage
9+
10+
```
11+
$ npm init pkg
12+
13+
# or
14+
15+
$ npx create-pkg
16+
17+
# or
18+
19+
$ npm install -g create-pkg
20+
$ create-pkg
21+
```
22+
23+
### CLI Usage
24+
25+
```
26+
$ create-pkg --help
27+
create-git
28+
29+
initalize a package
30+
31+
Options:
32+
--help Show help [boolean]
33+
--version Show version number [boolean]
34+
--cwd, -d Directory to run in [default: process.cwd()]
35+
# TODO
36+
```
37+
38+
### Programmatic Usage
39+
40+
```javascript
41+
const createPkg = require('@pkgjs/create-pkg')
42+
43+
await createPkg({
44+
// TODO
45+
})
46+
```
47+
48+
#### Composition with other `create-*` packages
49+
50+
This generator is built on top of `opta`, a helper library for collecting
51+
user input from multiple interfaces: CLI via `yargs`, interactive prompts via `inquirer`
52+
and via a JS interface. To compose with other `opta` based input collection,
53+
you can use `.options` to access the cli/prompt/js configurations.
54+
55+
```javascript
56+
const createPkg = require('create-pkg')
57+
const opta = require('opta')
58+
59+
const opts = opta({
60+
commandDescription: 'Your description',
61+
options: {
62+
// Spread the options from createGPkg
63+
...createPkg.options,
64+
}
65+
})
66+
67+
// Our generator main
68+
module.exports = async function (input) {
69+
// Add our input as overrides on the opta instance
70+
options.overrides(input)
71+
72+
// Prompt the user,
73+
await options.prompt()
74+
75+
// Get the current values from the opta instance
76+
let opts = options.values()
77+
78+
// Call create git
79+
await createPkg(opts)
80+
}
81+
```
82+
83+
For more information check out the [docs for `opta`](https://www.npmjs.com/package/opta).
File renamed without changes.
File renamed without changes.
File renamed without changes.

packages/create-pkg-cli/package.json

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"name": "create-pkg",
3+
"version": "0.0.0",
4+
"description": "Scaffold a package",
5+
"author": "Wes Todd <[email protected]>",
6+
"keywords": [
7+
"scaffold",
8+
"package",
9+
"git",
10+
"module",
11+
"package.json",
12+
"readme",
13+
"mocha",
14+
"standard"
15+
],
16+
"license": "ISC",
17+
"main": "index.js",
18+
"repository": {
19+
"type": "git",
20+
"url": "[email protected]:pkgjs/create.git"
21+
},
22+
"bin": {
23+
"create-package": "bin/create-package"
24+
},
25+
"scripts": {
26+
"test": "standard && mocha --timeout=60000",
27+
"test:debug": "mocha --inspect --inspect-brk --timeout=0",
28+
"release": "npm t && standard-version && npm publish",
29+
"postpublish": "git push origin && git push origin --tags"
30+
},
31+
"dependencies": {
32+
"cptmpl": "0.0.5",
33+
"create-git": "^1.0.0-2",
34+
"create-package-json": "^1.0.0-2",
35+
"loggerr": "^3.0.0-3",
36+
"opta": "0.0.6",
37+
"semver": "^7.3.2"
38+
},
39+
"devDependencies": {
40+
"fs-extra": "^8.0.1",
41+
"fs-test-fixtures": "^0.1.3",
42+
"mocha": "^6.2.2",
43+
"standard": "^14.3.1",
44+
"standard-version": "^9.0.0"
45+
},
46+
"support": true
47+
}
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# tmp
2+
3+
[![NPM Version](https://img.shields.io/npm/v/tmp.svg)](https://npmjs.org/package/tmp)
4+
[![NPM Downloads](https://img.shields.io/npm/dm/tmp.svg)](https://npmjs.org/package/tmp)
5+
[![test](https://github.com/pkgjs/__tmp/workflows/Test/badge.svg)](https://github.com/pkgjs/__tmp/actions?query=workflow%3ATest)
6+
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](https://github.com/standard/standard)
7+
8+
9+
10+
```
11+
$ npm i tmp
12+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use strict'
2+
3+
module.exports = function () {
4+
return 'Hello World'
5+
}

0 commit comments

Comments
 (0)