Skip to content

Commit 478ccaf

Browse files
committed
Merge branch '1.x'
2 parents 27b7b7d + 83d346c commit 478ccaf

File tree

17 files changed

+755
-643
lines changed

17 files changed

+755
-643
lines changed

.github/workflows/test.yml

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,36 @@ on:
77
pull_request:
88

99
jobs:
10+
setup:
11+
name: Setup
12+
runs-on: ubuntu-latest
13+
outputs:
14+
nodes: ${{ steps.nodes.outputs.nodes }}
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-node@v3
18+
- name: Setup Node Version Matrix
19+
id: nodes
20+
run: |
21+
NODES=$(npx -y @pkgjs/nv ls supported | jq '. | .version' | paste -sd "," -)
22+
echo "nodes=[${NODES}]" >> $GITHUB_OUTPUT
23+
1024
test:
11-
uses: pkgjs/action/.github/workflows/node-test.yaml@v0
25+
# uses: pkgjs/action/.github/workflows/node-test.yaml@v0
26+
runs-on: ubuntu-latest
27+
needs: setup
28+
strategy:
29+
matrix:
30+
node-version: ${{ fromJson(needs.setup.outputs.nodes) }}
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Setup git user
34+
run: |
35+
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
36+
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
37+
- name: Use Node.js ${{ matrix.node-version }}
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: ${{ matrix.node-version }}
41+
- name: npm install and test
42+
run: npm it

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
2-
test/fixtures/tmp
2+
test/tmp
3+
coverage

.wallaby.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
'use strict';
2+
3+
module.exports = () => {
4+
return {
5+
files: ['package.json', 'index.js', 'lib/**/*.js', 'bin/*', 'test/fixtures/**/*', 'test/fixtures/**/.*' ],
6+
tests: ['test/*.js'],
7+
env: {
8+
type: 'node',
9+
runner: 'node'
10+
},
11+
testFramework: 'mocha'
12+
};
13+
};

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4+
5+
## [1.0.0-6](https://github.com/wesleytodd/create-package-json/compare/v1.0.0-5...v1.0.0-6) (2021-02-24)
6+
7+
8+
### Features
9+
10+
* added scope option and use npm name suggestion package ([ee41b3a](https://github.com/wesleytodd/create-package-json/commit/ee41b3a6e6fc38367d9559fb7f7e16d69b8fbbf7))
11+
12+
## [1.0.0-5](https://github.com/wesleytodd/create-package-json/compare/v1.0.0-4...v1.0.0-5) (2021-02-24)
13+
14+
15+
### Bug Fixes
16+
17+
* remove package.json extras added by read-package-json ([90a2b5b](https://github.com/wesleytodd/create-package-json/commit/90a2b5bd4c28d1ae41e550d233f7e2ddd29946a7))
18+
19+
## [1.0.0-4](https://github.com/wesleytodd/create-package-json/compare/v1.0.0-3...v1.0.0-4) (2021-02-24)
20+
21+
22+
### Bug Fixes
23+
24+
* [email protected] ([2996c9b](https://github.com/wesleytodd/create-package-json/commit/2996c9b48a3f348c222d2ec5c2c0a4e9c90d54e7))
25+
26+
## [1.0.0-3](https://github.com/wesleytodd/create-package-json/compare/v1.0.0-2...v1.0.0-3) (2021-02-24)
27+
28+
29+
### ⚠ BREAKING CHANGES
30+
31+
* refactor writePackageJson to not require path
32+
33+
### Bug Fixes
34+
35+
* default git user if we cannot find a default in the package.json ([3cbe85a](https://github.com/wesleytodd/create-package-json/commit/3cbe85a7a2bc29f4baeaba313433a0795c8394c5))
36+
* improved default settings with opta ([075d666](https://github.com/wesleytodd/create-package-json/commit/075d666cbe90ef09a8f7689d5aba967c95f705fd))
37+
* refactor repository to handle objects ([ba40f0c](https://github.com/wesleytodd/create-package-json/commit/ba40f0c716d7bd3e32b9219bdc6f859d6dc711c6))
38+
* refactor writePackageJson to not require path ([7939e24](https://github.com/wesleytodd/create-package-json/commit/7939e243e2cd7b5e9fa7b6334f7087ca8f624218))
39+
* **test:** replace Object.fromEntries with the godlike reduce() ([c520eb8](https://github.com/wesleytodd/create-package-json/commit/c520eb8975d3ef8845a4df8f7faecc8b9d394095))
40+
41+
## [1.0.0-2](https://github.com/wesleytodd/create-package-json/compare/v1.0.0-1...v1.0.0-2) (2020-10-21)
42+
43+
44+
### Features
45+
46+
* logging and scripts wip; [email protected] & [email protected] ([f4ccbb4](https://github.com/wesleytodd/create-package-json/commit/f4ccbb42af19a3ed9e295766a77d428d189eb35a))

README.md

Lines changed: 49 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -17,53 +17,42 @@ tool, or inside your other package scaffolding tools.
1717
```
1818
$ npm init package-json
1919
$ npx create-package-json
20-
21-
# or
22-
23-
$ npm install -g create-package-json
24-
$ create-package-json
2520
```
2621

2722
### CLI Usage
2823

2924
```
3025
$ create-package-json --help
3126
32-
create-package-json
27+
Generate a package.json
3328
34-
Create a package.json
29+
Commands:
30+
create-package-json Generate a package.json [default]
3531
3632
Options:
37-
--help Show help [boolean]
38-
--version Show version number [boolean]
39-
--no-prompt Prompts, --no-prompt to use defaults and input only
40-
[boolean]
41-
--directory, -d Working directory [string]
42-
--silent, -S Suppress all output [boolean]
43-
--advanced Show advanced prompts [boolean]
44-
--existing-package [string]
45-
--scope [string]
46-
--scripts [string]
47-
--name [string]
48-
--package-version [string]
49-
--description [string]
50-
--author [string]
51-
--repository [string]
52-
--keywords [string]
53-
--license [string]
54-
--type [string]
55-
--main [string]
56-
--private [boolean]
57-
--dependencies [string]
58-
--dev-dependencies [string]
59-
--peer-dependencies [string]
60-
--test [string]
61-
--prepare [string]
62-
--post-publish [string]
63-
--pre-version [string]
64-
--spacer [string]
65-
--ignore-existing [boolean]
66-
--save-exact [boolean]
33+
--help Show help [boolean]
34+
--version Show version number [boolean]
35+
-d, --cwd Directory to run in [default: process.cwd()]
36+
--silent [boolean]
37+
--verbose [boolean]
38+
--ignore-existing Ignore existing files (& overwrite them)
39+
--name [string]
40+
--scope Set a scope to be used when suggesting a package name
41+
[string]
42+
-V, --package-version [string]
43+
--description [string]
44+
--author [string]
45+
--repository [string]
46+
--keywords [string]
47+
--license [string]
48+
--type [string]
49+
--main [string]
50+
--private [boolean]
51+
--dependencies [string]
52+
--dev-dependencies [string]
53+
--peer-dependencies [string]
54+
--spacer [string] [default: 2 spaces]
55+
--save-exact [boolean]
6756
```
6857

6958
Dependencies should be a comma separated list like `--dependencies="express,react"`, and it can also
@@ -89,3 +78,26 @@ const createPackageJson = require('create-package-json')
8978
console.log(pkg) // The json after writing and installing
9079
})()
9180
```
81+
82+
## Implementation TODO
83+
84+
> See [`package.json` docs](https://docs.npmjs.com/files/package.json)
85+
86+
- [ ] `exports`
87+
- [ ] `bin`
88+
- [ ] `funding`
89+
- [ ] `files`
90+
- [ ] `browser`
91+
- [ ] `directories`
92+
- [ ] `config`
93+
- [ ] `dependencies`
94+
- [ ] `devDependencies`
95+
- [ ] `bundledDependencies`
96+
- [ ] `optionalDependencies`
97+
- [ ] `engines`
98+
- [ ] `os`
99+
- [ ] `cpu`
100+
- [ ] `publishConfig`
101+
- [ ] `homepage`
102+
- [ ] `bugs`
103+
- [ ] `contributors`

bin/create-package-json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env node
22
'use strict'
3-
require('../').cli(process.argv.slice(2))
3+
require('../').cli()(process.argv.slice(2))

0 commit comments

Comments
 (0)