Skip to content

Commit

Permalink
Merge branch '1.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleytodd committed Oct 2, 2023
2 parents 27b7b7d + 83d346c commit 478ccaf
Show file tree
Hide file tree
Showing 17 changed files with 755 additions and 643 deletions.
33 changes: 32 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,36 @@ on:
pull_request:

jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
nodes: ${{ steps.nodes.outputs.nodes }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- name: Setup Node Version Matrix
id: nodes
run: |
NODES=$(npx -y @pkgjs/nv ls supported | jq '. | .version' | paste -sd "," -)
echo "nodes=[${NODES}]" >> $GITHUB_OUTPUT
test:
uses: pkgjs/action/.github/workflows/node-test.yaml@v0
# uses: pkgjs/action/.github/workflows/node-test.yaml@v0
runs-on: ubuntu-latest
needs: setup
strategy:
matrix:
node-version: ${{ fromJson(needs.setup.outputs.nodes) }}
steps:
- uses: actions/checkout@v4
- name: Setup git user
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: npm install and test
run: npm it
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
test/fixtures/tmp
test/tmp
coverage
13 changes: 13 additions & 0 deletions .wallaby.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
'use strict';

module.exports = () => {
return {
files: ['package.json', 'index.js', 'lib/**/*.js', 'bin/*', 'test/fixtures/**/*', 'test/fixtures/**/.*' ],
tests: ['test/*.js'],
env: {
type: 'node',
runner: 'node'
},
testFramework: 'mocha'
};
};
46 changes: 46 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Changelog

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.

## [1.0.0-6](https://github.com/wesleytodd/create-package-json/compare/v1.0.0-5...v1.0.0-6) (2021-02-24)


### Features

* added scope option and use npm name suggestion package ([ee41b3a](https://github.com/wesleytodd/create-package-json/commit/ee41b3a6e6fc38367d9559fb7f7e16d69b8fbbf7))

## [1.0.0-5](https://github.com/wesleytodd/create-package-json/compare/v1.0.0-4...v1.0.0-5) (2021-02-24)


### Bug Fixes

* remove package.json extras added by read-package-json ([90a2b5b](https://github.com/wesleytodd/create-package-json/commit/90a2b5bd4c28d1ae41e550d233f7e2ddd29946a7))

## [1.0.0-4](https://github.com/wesleytodd/create-package-json/compare/v1.0.0-3...v1.0.0-4) (2021-02-24)


### Bug Fixes

* [email protected] ([2996c9b](https://github.com/wesleytodd/create-package-json/commit/2996c9b48a3f348c222d2ec5c2c0a4e9c90d54e7))

## [1.0.0-3](https://github.com/wesleytodd/create-package-json/compare/v1.0.0-2...v1.0.0-3) (2021-02-24)


### ⚠ BREAKING CHANGES

* refactor writePackageJson to not require path

### Bug Fixes

* default git user if we cannot find a default in the package.json ([3cbe85a](https://github.com/wesleytodd/create-package-json/commit/3cbe85a7a2bc29f4baeaba313433a0795c8394c5))
* improved default settings with opta ([075d666](https://github.com/wesleytodd/create-package-json/commit/075d666cbe90ef09a8f7689d5aba967c95f705fd))
* refactor repository to handle objects ([ba40f0c](https://github.com/wesleytodd/create-package-json/commit/ba40f0c716d7bd3e32b9219bdc6f859d6dc711c6))
* refactor writePackageJson to not require path ([7939e24](https://github.com/wesleytodd/create-package-json/commit/7939e243e2cd7b5e9fa7b6334f7087ca8f624218))
* **test:** replace Object.fromEntries with the godlike reduce() ([c520eb8](https://github.com/wesleytodd/create-package-json/commit/c520eb8975d3ef8845a4df8f7faecc8b9d394095))

## [1.0.0-2](https://github.com/wesleytodd/create-package-json/compare/v1.0.0-1...v1.0.0-2) (2020-10-21)


### Features

* logging and scripts wip; [email protected] & [email protected] ([f4ccbb4](https://github.com/wesleytodd/create-package-json/commit/f4ccbb42af19a3ed9e295766a77d428d189eb35a))
86 changes: 49 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,53 +17,42 @@ tool, or inside your other package scaffolding tools.
```
$ npm init package-json
$ npx create-package-json
# or
$ npm install -g create-package-json
$ create-package-json
```

### CLI Usage

```
$ create-package-json --help
create-package-json
Generate a package.json
Create a package.json
Commands:
create-package-json Generate a package.json [default]
Options:
--help Show help [boolean]
--version Show version number [boolean]
--no-prompt Prompts, --no-prompt to use defaults and input only
[boolean]
--directory, -d Working directory [string]
--silent, -S Suppress all output [boolean]
--advanced Show advanced prompts [boolean]
--existing-package [string]
--scope [string]
--scripts [string]
--name [string]
--package-version [string]
--description [string]
--author [string]
--repository [string]
--keywords [string]
--license [string]
--type [string]
--main [string]
--private [boolean]
--dependencies [string]
--dev-dependencies [string]
--peer-dependencies [string]
--test [string]
--prepare [string]
--post-publish [string]
--pre-version [string]
--spacer [string]
--ignore-existing [boolean]
--save-exact [boolean]
--help Show help [boolean]
--version Show version number [boolean]
-d, --cwd Directory to run in [default: process.cwd()]
--silent [boolean]
--verbose [boolean]
--ignore-existing Ignore existing files (& overwrite them)
--name [string]
--scope Set a scope to be used when suggesting a package name
[string]
-V, --package-version [string]
--description [string]
--author [string]
--repository [string]
--keywords [string]
--license [string]
--type [string]
--main [string]
--private [boolean]
--dependencies [string]
--dev-dependencies [string]
--peer-dependencies [string]
--spacer [string] [default: 2 spaces]
--save-exact [boolean]
```

Dependencies should be a comma separated list like `--dependencies="express,react"`, and it can also
Expand All @@ -89,3 +78,26 @@ const createPackageJson = require('create-package-json')
console.log(pkg) // The json after writing and installing
})()
```

## Implementation TODO

> See [`package.json` docs](https://docs.npmjs.com/files/package.json)
- [ ] `exports`
- [ ] `bin`
- [ ] `funding`
- [ ] `files`
- [ ] `browser`
- [ ] `directories`
- [ ] `config`
- [ ] `dependencies`
- [ ] `devDependencies`
- [ ] `bundledDependencies`
- [ ] `optionalDependencies`
- [ ] `engines`
- [ ] `os`
- [ ] `cpu`
- [ ] `publishConfig`
- [ ] `homepage`
- [ ] `bugs`
- [ ] `contributors`
2 changes: 1 addition & 1 deletion bin/create-package-json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/usr/bin/env node
'use strict'
require('../').cli(process.argv.slice(2))
require('../').cli()(process.argv.slice(2))
Loading

0 comments on commit 478ccaf

Please sign in to comment.