Skip to content

Commit

Permalink
feat(npx): update all docs to use npx command #222
Browse files Browse the repository at this point in the history
  • Loading branch information
blackfalcon committed Nov 11, 2021
1 parent 302755b commit 089e609
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 21 deletions.
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,14 @@ Auro's Design System web component generator is a project tool intended to assis
[![License](https://img.shields.io/npm/l/@aurodesignsystem/wc-generator.svg?color=blue&style=for-the-badge)](https://www.apache.org/licenses/LICENSE-2.0)
[![issues](https://img.shields.io/github/issues-raw/AlaskaAirlines/WC-Generator?style=for-the-badge)](https://github.com/AlaskaAirlines/WC-Generator/issues)

It is recommended that the package be installed globally as to ensure quick and easy access to initializing new projects.

```shell
$ npm i @aurodesignsystem/wc-generator -g
```

The Auro custom element generator is configured to ensure that you have the latest version of the generator and all it's dependencies prior to starting a new build project.
It is recommended that the package be executed via a `npx` command.

## Execute

WC-Generator example use:

```
wc-generate --name [wc-name]
$ npx @aurodesignsystem/wc-generator --name [wc-name]
```

### Minimum Node version
Expand All @@ -45,15 +39,15 @@ For the most up to date information on UI development browser support, see [Auro
When generating a new custom element using the Auro WC-Generator, you are not restricted to using the Auro namespace for your new element. The following example will crate the project, `@aurodesignsystem/auro-ticker`

```shell
$ wc-generate --name Auro-Ticker
$ npx @aurodesignsystem/wc-generator --name Auro-Ticker
```

## Custom npm namespace support

By default, the WC-Generator will output a project that the custom element is for the `@aurodesignsystem` npm namespace. The following example illustrates how you can customize this to `@mynamespace/auro-ticker` for example.

```shell
$ wc-generate --name Auro-Ticker --npm @mynamespace
$ npx @aurodesignsystem/wc-generator --name Auro-Ticker --npm @mynamespace
```

## WC-Generator development API
Expand All @@ -67,7 +61,7 @@ $ wc-generate --name Auro-Ticker --npm @mynamespace

## Help and version management

For help with the WC-Generator API and to see what version you have installed, run `$ wc-generate --help`.
For help with the WC-Generator API and to see what version you have installed, run `$ npx @aurodesignsystem/wc-generator --help`.

With each new repo created, the version of the generator will be added to the bottom of the `./README.md` file. As versions of the WC-Generator progress this will help authors to understand where the feature gap is.

Expand Down
4 changes: 2 additions & 2 deletions docs/auroLabsMinors.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ When building a new custom element in auroLabs it is highly recommended that yo
Once the generator is installed, please use the following execution template fo your new project.

```
$ wc-generate --name auro-[element name]
$ npx @aurodesignsystem/wc-generator --name auro-[element name]
```

## Getting started
Expand All @@ -45,7 +45,7 @@ From installing the generator all the way to setting up a Github repo. Follow th
<span slot="trigger" class="trigger">2. Create your new custom element repository locally</span>
<div class="lightText">
<p>Once the generator is installed, run the generator command to create a new custom element repository.</p>
<pre class="pre"> $ wc-generate --name auro-[element name]</pre>
<pre class="pre"> $ npx @aurodesignsystem/wc-generator --name auro-[element name]</pre>
</div>
</auro-accordion>
<auro-accordion id="newWork" chromeless noProfile>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"util"
],
"bin": {
"wc-generate": "./bin/generate.js"
"wc-generator": "./bin/generate.js"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion util/auroMigrate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Generate a new baseline install of an auro component
# Argument expected: name of new repo
function generateRepo {
command wc-generate --test --name "$1" --npm "${2//\/}"
command npx @aurodesignsystem/wc-generator --test --name "$1" --npm "${2//\/}"
}

## Migrade files from legacy repo to new build
Expand Down
6 changes: 3 additions & 3 deletions util/help-outputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ const pjson = require('../package.json');

const generate = `
${chalk.gray('Usage:')}
${chalk.bold('wc-generator [options]')}
${chalk.bold('npx @aurodesignsystem/wc-generator [options]')}
${chalk.gray('Example:')}
${chalk.bold('wc-generator --name auro-dialog')}
${chalk.bold('npx @aurodesignsystem/wc-generator --name auro-dialog')}
${chalk.gray('Description:')}
Generate a new Auro Web Component from template.
Expand All @@ -18,7 +18,7 @@ const generate = `
${chalk.gray('Installed version:')}
v${pjson.version}
${chalk.gray('Upgrade to latest version:')}
${chalk.gray('Install locally if needed (not recommended):')}
$ ${chalk.green('npm i @aurodesignsystem/wc-generator@latest -g')}
${chalk.gray('Options:')}
Expand Down
3 changes: 0 additions & 3 deletions util/migrate-outputs.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ const generate = `
${chalk.gray('Installed version:')}
v${pjson.version}
${chalk.gray('Upgrade to latest version:')}
$ npm i @aurodesignsystem/wc-generator@latest -g
${chalk.gray('More help:')}
For more help with migrating an Auro Web Component,
be sure to see ${chalk.blue('https://auro.alaskaair.com/getting-started/developers/generator/upgrade')}
Expand Down

0 comments on commit 089e609

Please sign in to comment.