Skip to content

Commit

Permalink
feat(create): Improved getting started experience (#3128)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley authored Oct 14, 2024
1 parent 1b4c50f commit adb4384
Show file tree
Hide file tree
Showing 13 changed files with 637 additions and 246 deletions.
2 changes: 0 additions & 2 deletions docs/docs/guides/getting-started/installation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ Follow the instructions to move into the new directory created for your project,
```bash
cd my-shop

yarn dev
# or
npm run dev
```

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion packages/core/src/cli/populate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,9 @@ export async function importProductsFromCsv(
languageCode,
channelOrToken: channel,
});
return lastValueFrom(importer.parseAndImport(productData, ctx, true));
const createEnvVar: import('@vendure/common/lib/shared-constants').CREATING_VENDURE_APP =
'CREATING_VENDURE_APP';
// Turn off progress bar when running in the context of the @vendure/create script
const reportProgress = process.env[createEnvVar] === 'true' ? false : true;
return lastValueFrom(importer.parseAndImport(productData, ctx, reportProgress));
}
34 changes: 2 additions & 32 deletions packages/create/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,47 +4,17 @@ A CLI tool for rapidly scaffolding a new Vendure server application. Heavily ins

## Usage

Vendure Create requires [Node.js](https://nodejs.org/en/) v8.9.0+ to be installed.

To create a new project, you may choose one of the following methods:

### npx
Vendure Create requires [Node.js](https://nodejs.org/en/) v18+ to be installed.

```sh
npx @vendure/create my-app
```

*[npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher.*

### npm

```sh
npm init @vendure my-app
```

*`npm init <initializer>` is available in npm 6+*

### Yarn

```sh
yarn create @vendure my-app
```

*`yarn create` is available in Yarn 0.25+*


It will create a directory called `my-app` inside the current folder.

## Options

### `--use-npm`

By default, Vendure Create will detect whether a compatible version of Yarn is installed, and if so will display a prompt to select the preferred package manager.
You can override this and force it to use npm with the `--use-npm` flag.

### `--log-level`

You can control how much output is generated during the installation and setup with this flag. Valid options are `silent`, `info` and `verbose`. The default is `silent`
You can control how much output is generated during the installation and setup with this flag. Valid options are `silent`, `info` and `verbose`. The default is `info`

Example:

Expand Down
1 change: 1 addition & 0 deletions packages/create/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"cross-spawn": "^7.0.3",
"fs-extra": "^11.2.0",
"handlebars": "^4.7.8",
"open": "^8.4.2",
"picocolors": "^1.0.0",
"semver": "^7.5.4",
"tcp-port-used": "^1.0.2"
Expand Down
Loading

0 comments on commit adb4384

Please sign in to comment.