Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Commit

Permalink
Nest scaffold proposal (#19)
Browse files Browse the repository at this point in the history
* Use nest cli to generate a scaffold

* Move package-json modification to separate file

* Allow verbose logging with npm output

* Rename and move test files and config

* Remove unnecessary scaffold enhancement

* Add subfolders in s4hana_pipeline

* Adjust package to use cli-action if not verbose

* Put correct build and package command for nest scaffold

* Update dependencies + use local nestCLI if available

* Fix test

* Fix typo

* Supply projectDir via arg or flag

* Update readme

* Avoid passing stderr by using cli-ux.error

* Fix arg based projectDir + QoL improvements

* Encourage users to set port to process.env.PORT

* Modify port after scaffold is added

* Rename and optimize parsePackageJson function

* Don't ask if frontend scripts should be added

* Improve output consistency

* Use listr where applicable

* Fix --force handling and related tests

* Update README

* Add @sap-cloud-sdk/cli as dev dependency when running init

* Improve UX according to feedback

* Incorporate PR feedback

* Improve naming and error messages

* Fix formatting

* Move functions to utils files for cleaner init command

* Fix test

* Rename variable
  • Loading branch information
Florian Richter authored Dec 5, 2019
1 parent 8ade605 commit fc0b77b
Show file tree
Hide file tree
Showing 24 changed files with 4,372 additions and 1,225 deletions.
25 changes: 18 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@ $ npm install -g @sap-cloud-sdk/cli@latest

<!-- usage -->
```sh-session
$ npm install -g @sap-cloud-sdk/cli
$ sap-cloud-sdk COMMAND
running command...
$ sap-cloud-sdk (-v|--version|version)
@sap-cloud-sdk/cli/0.0.6 darwin-x64 node-v12.9.0
@sap-cloud-sdk/cli/0.0.6 darwin-x64 node-v11.12.0
$ sap-cloud-sdk --help [COMMAND]
USAGE
$ sap-cloud-sdk COMMAND
...
```
<!-- usagestop -->

The CLI can initialize an express-based project or (the more common case) add everything you need to develop for SAP Cloud Platform to an existing project no matter what backend framework you use.
The CLI can initialize an nest-based project or (the more common case) add everything you need to develop for SAP Cloud Platform to an existing project no matter what backend framework you use.
If there are any incompatibilities, please let us know in the [issues](https://github.com/SAP/cloud-sdk-cli/issues/new/choose)!

To get started run
Expand All @@ -54,7 +55,7 @@ $ sap-cloud-sdk init
in the project folder.

It will guide you through the initialization, create the necessary files and add necessary dependencies.
If you run it in an empty folder, it will ask if you want to initialize a project using [express-generator](https://expressjs.com/en/starter/generator.html).
If you run it in an empty folder, it will ask if you want to initialize a project using [@nest/cli](https://github.com/nestjs/nest-cli).

To deploy to and run on Cloud Foundry, you need to
1. Make sure that your app listens to port 8080
Expand All @@ -74,7 +75,7 @@ Start by running [`sap-cloud-sdk add-approuter`](#sap-cloud-sdk-add-approuter) a
* [`sap-cloud-sdk autocomplete [SHELL]`](#sap-cloud-sdk-autocomplete-shell)
* [`sap-cloud-sdk help [COMMAND]`](#sap-cloud-sdk-help-command)
* [`sap-cloud-sdk help-page`](#sap-cloud-sdk-help-page)
* [`sap-cloud-sdk init`](#sap-cloud-sdk-init)
* [`sap-cloud-sdk init [PROJECTDIR]`](#sap-cloud-sdk-init-projectdir)
* [`sap-cloud-sdk package`](#sap-cloud-sdk-package)

## `sap-cloud-sdk add-approuter`
Expand All @@ -87,6 +88,7 @@ USAGE
OPTIONS
-h, --help show CLI help
--force Do not fail if a file already exist and overwrite it.
ALIASES
$ sap-cloud-sdk add-app-router
Expand All @@ -107,6 +109,7 @@ USAGE
OPTIONS
-h, --help show CLI help
--force Do not fail if a file already exist and overwrite it.
EXAMPLE
$ sap-cloud-sdk add-cx-server
Expand Down Expand Up @@ -168,17 +171,23 @@ OPTIONS

_See code: [src/commands/help-page.ts](https://github.com/SAP/cloud-sdk-cli/blob/v0.0.6/src/commands/help-page.ts)_

## `sap-cloud-sdk init`
## `sap-cloud-sdk init [PROJECTDIR]`

Initializes your project for the SAP Cloud SDK, SAP Cloud Platform Cloud Foundry and CI/CD using the SAP Cloud SDK toolkit

```
USAGE
$ sap-cloud-sdk init
$ sap-cloud-sdk init [PROJECTDIR]
ARGUMENTS
PROJECTDIR Path to the folder in which the project should be created.
OPTIONS
-h, --help Show help for the new command.
--projectDir=projectDir [default: .] Path to the folder in which the project should be created.
-v, --verbose Show more detailed output.
--force Do not fail if a file or npm script already exist and overwrite it.
--frontendScripts Add frontend-related npm scripts which are executed by our CI/CD toolkit.
--projectDir=projectDir Path to the folder in which the project should be created.
EXAMPLES
$ sap-cloud-sdk init
Expand All @@ -204,6 +213,8 @@ OPTIONS
-o, --output=output [default: deployment] Output and deployment folder
-v, --verbose Show more detailed output.
--skipInstall Skip `npm i --production` during packaging
EXAMPLES
Expand Down
Loading

0 comments on commit fc0b77b

Please sign in to comment.