Skip to content

Commit

Permalink
fix: scrub hello-world templates
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed May 1, 2024
1 parent 4fe9c6f commit 89a5121
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Here's a high level overview of ESM/CJS interoperability:

## Creating an ESM plugin

To generate a new ESM plugin from the [hello-world-esm template](https://github.com/oclif/hello-world-esm) run the `oclif generate` command and select `ESM` when it prompts you to select a module type:
To generate a new ESM plugin, run the `oclif generate` command and select `ESM` when it prompts you to select a module type:

```
$ npx oclif generate my-esm-plugin
Expand Down
4 changes: 2 additions & 2 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Examples

Here are some examples to get an idea of how to use oclif in various setups.

* [Hello World Example (CommonJS)](https://github.com/oclif/hello-world)
* [Hello World Example (ESM)](https://github.com/oclif/hello-world-esm)
* [CommonJS plugin](https://github.com/oclif/test-plugin-cjs-1)
* [ESM plugin](https://github.com/oclif/plugin-test-esm-1)
* [Using esbuild](https://github.com/oclif/plugin-test-esbuild)
* [Hook-only plugin](https://github.com/oclif/plugin-not-found)
4 changes: 2 additions & 2 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Run a single command to scaffold out a fully functional CLI and get started quic

### Testing Helpers

We've put a lot of work into making commands easily testable and easy to mock out stdout/stderr. The generator will automatically create [scaffolded tests](https://github.com/oclif/hello-world/blob/main/test/commands/hello/world.test.ts).
We've put a lot of work into making commands easily testable and easy to mock out stdout/stderr. The generator will automatically create scaffolded tests.

### Auto-documentation

By default you can pass `--help` to the CLI to get help such as flag options and argument information. This information is also automatically placed in the README whenever the npm package of the CLI is published. See the [hello-world CLI example](https://github.com/oclif/hello-world)
By default you can pass `--help` to the CLI to get help such as flag options and argument information. This information is also automatically placed in the README whenever the npm package of the CLI is published. See the [plugin-plugins](https://github.com/oclif/plugin-plugins) as an example.

### Plugins

Expand Down
25 changes: 14 additions & 11 deletions docs/generator_commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Generate a new CLI

```
USAGE
$ oclif generate NAME [-y] [--author <value>] [--bin <value>] [--description <value>] [--license <value>]
[--module-type CommonJS|ESM] [--name <value>] [--owner <value>] [--package-manager npm|yarn] [--repository <value>]
[-d <value>]
$ oclif generate NAME [--author <value>] [--bin <value>] [--description <value>] [--license <value>]
[--module-type CommonJS|ESM] [--name <value>] [--owner <value>] [--package-manager npm|yarn|pnpm] [--repository
<value>] [-d <value>] [-y]
ARGUMENTS
NAME Directory name of new project.
Expand All @@ -32,15 +32,18 @@ FLAGS
--owner=<value> Supply answer for prompt: Who is the GitHub owner of repository
(https://github.com/OWNER/repo)
--package-manager=<option> Supply answer for prompt: Select a package manager
<options: npm|yarn>
<options: npm|yarn|pnpm>
--repository=<value> Supply answer for prompt: What is the GitHub name of repository
(https://github.com/owner/REPO)
DESCRIPTION
Generate a new CLI
This will clone the template repo and update package properties. For CommonJS, the 'oclif/hello-world' template will
be used and for ESM, the 'oclif/hello-world-esm' template will be used.
This will generate a fully functional oclif CLI that you can build on. It will prompt you for all the necessary
information to get started. If you want to skip the prompts, you can pass the --yes flag to accept the defaults for
all prompts. You can also pass individual flags to set specific values for prompts.
Head to oclif.io/docs/introduction to learn more about building CLIs with oclif.
EXAMPLES
Generate a new CLI with prompts for all properties
Expand All @@ -60,15 +63,15 @@ EXAMPLES
$ oclif generate my-cli --module-type CommonJS --author "John Doe" --yes
```

_See code: [src/commands/generate.ts](https://github.com/oclif/oclif/blob/v4.6.0/src/commands/generate.ts)_
_See code: [src/commands/generate.ts](https://github.com/oclif/oclif/blob/4.10.1/src/commands/generate.ts)_

## `oclif generate command NAME`

Add a command to an existing CLI or plugin.

```
USAGE
$ oclif generate command NAME [-y] [--commands-dir <value>] [--force]
$ oclif generate command NAME [--commands-dir <value>] [--force]
ARGUMENTS
NAME name of command
Expand All @@ -81,15 +84,15 @@ DESCRIPTION
Add a command to an existing CLI or plugin.
```

_See code: [src/commands/generate/command.ts](https://github.com/oclif/oclif/blob/v4.6.0/src/commands/generate/command.ts)_
_See code: [src/commands/generate/command.ts](https://github.com/oclif/oclif/blob/4.10.1/src/commands/generate/command.ts)_

## `oclif generate hook NAME`

Add a hook to an existing CLI or plugin.

```
USAGE
$ oclif generate hook NAME [-y] [--event <value>] [--force]
$ oclif generate hook NAME [--event <value>] [--force]
ARGUMENTS
NAME Name of hook (snake_case).
Expand All @@ -102,4 +105,4 @@ DESCRIPTION
Add a hook to an existing CLI or plugin.
```

_See code: [src/commands/generate/hook.ts](https://github.com/oclif/oclif/blob/v4.6.0/src/commands/generate/hook.ts)_
_See code: [src/commands/generate/hook.ts](https://github.com/oclif/oclif/blob/4.10.1/src/commands/generate/hook.ts)_
2 changes: 1 addition & 1 deletion docs/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Introduction

oclif is a framework for building CLIs in Node. It can be used like a [simple flag parser](https://github.com/oclif/core#usage) but is capable of much more. It's designed to be extensible so that you can easily add plugins such as the [update warning plugin](https://github.com/oclif/plugin-warn-if-update-available) or build your own for users to install at runtime.

The oclif generator creates a CLI project in [TypeScript](https://github.com/oclif/hello-world) to get you started quickly. It requires very few runtime dependencies and has minimal overhead.
The oclif generator creates a CLI project in TypeScript to get you started quickly. It requires very few runtime dependencies and has minimal overhead.

Everything is customizable in oclif. Even the flag parser and help generation is optional and can be replaced. It's a platform to build upon that provides smart defaults without locking you in to any specific tools or behavior.

Expand Down
2 changes: 1 addition & 1 deletion docs/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ marker?.addDetails({from: flags.from, person: args.person})
marker?.stop()
```

And a more thorough example using the `hello` command from the [hello-world](https://github.com/oclif/hello-world) template:
And a more thorough example:

```typescript
// ./src/commands/hello/index.ts
Expand Down
9 changes: 2 additions & 7 deletions docs/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@
title: Templates
---

There are two templates that `oclif generate` can use:
When you run `oclif generate`, it will ask if you'd like to use either CommonJS or ESM for your CLI. Both options produce the same CLI (same tsconfig, bin scripts, example commands, etc).

* [hello-world (CommonJS)](https://github.com/oclif/hello-world)
* [hello-world-esm (ESM)](https://github.com/oclif/hello-world-esm)

Both templates come with the same boiler plate (tsconfig, bin scripts, example commands and tests, etc.). The only difference is that the `hello-world` template uses CommonJS whereas the `hello-world-esm` template uses ESM.

We'll give you a brief rundown of everything that's included in the templates:
We'll give you a brief rundown of everything that's included in your newly generated CLI:

## Bin Scripts

Expand Down

0 comments on commit 89a5121

Please sign in to comment.