Skip to content

Commit

Permalink
fix: add create-project binary to be able to execute the CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
jdbruijn committed Oct 25, 2023
1 parent 33463c1 commit 680f704
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Interactively create a project.

[![npm version](https://img.shields.io/npm/v/@vidavidorra/create-project?logo=npm&style=flat-square)](https://www.npmjs.com/package/@vidavidorra/create-project)
[![npm downloads](https://img.shields.io/npm/dm/@vidavidorra/create-project?logo=npm&style=flat-square)](https://www.npmjs.com/package/@vidavidorra/create-project)
[![Node.js version support](https://img.shields.io/node/v/@vidavidorracreate-project?logo=node.js&style=flat-square)](https://nodejs.org/en/about/releases/)
[![Node.js version support](https://img.shields.io/node/v/@vidavidorra/create-project?logo=node.js&style=flat-square)](https://nodejs.org/en/about/releases/)
[![Renovate enabled](https://img.shields.io/badge/Renovate-enabled-brightgreen?logo=renovatebot&logoColor&style=flat-square)](https://renovatebot.com)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079?style=flat-square)](https://github.com/semantic-release/semantic-release)
[![Code coverage](https://img.shields.io/codecov/c/github/vidavidorra/create-project?logo=codecov&style=flat-square)](https://codecov.io/gh/vidavidorra/create-project)
Expand All @@ -32,7 +32,13 @@ npm install --global @vidavidorra/create-project
Start the interactive CLI to create a project.

```shell
@vidavidorra/create-project
create-project
```

Or run the interactive CLI directly via `npx`.

```shell
npx @vidavidorra/create-project
```

## Contributing
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"author": "Jeroen de Bruijn",
"type": "module",
"exports": "./dist/index.js",
"bin": {
"create-project": "./dist/cli.js"
},
"files": [
"./dist/**/!(*.test).{js,d.ts,cjs}",
"./.github/",
Expand Down
3 changes: 3 additions & 0 deletions src/content/package.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ test(sets, 'name', options.package, '"package" option');
test(sets, 'version', '0.1.0', '"0.1.0"');
test(sets, 'description', options.description, '"description" option');
test(sets, 'author', options.author, '"author" option');
test('does not include "bin"', (t) => {
t.is(packageJson().bin, undefined);
});
test('does not include "dependencies"', (t) => {
t.is(packageJson().dependencies, undefined);
});
Expand Down
2 changes: 2 additions & 0 deletions src/content/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const schema = z
author: z.string().min(1),
type: z.literal('module'),
exports: z.string().min(1).optional(),
bin: z.record(z.unknown()).optional(),
files: z
.tuple([z.literal('./dist/**/!(*.test).{js,d.ts,cjs}')])
.rest(z.string().min(1))
Expand Down Expand Up @@ -83,6 +84,7 @@ class Package extends File {
...this._package.devDependencies,
...this._package.dependencies,
};
delete this._package.bin;
delete this._package.dependencies;
if (this._options.public) {
delete this._package.private;
Expand Down

0 comments on commit 680f704

Please sign in to comment.