Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Update README and move development instructions on separate doc #10

Merged
merged 3 commits into from
Aug 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 3 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -4,41 +4,12 @@ topcoder-cli
#### Build Status:
[![CircleCI](https://circleci.com/gh/topcoder-platform/topcoder-cli/tree/master.svg?style=svg)](https://circleci.com/gh/topcoder-platform/topcoder-cli/tree/master) ![npm (tag)](https://img.shields.io/npm/v/@topcoder/topcoder-cli/latest.svg?style=plastic) ![GitHub issues](https://img.shields.io/github/issues/topcoder-platform/topcoder-cli.svg?style=plastic)

# Dependencies
- nodejs https://nodejs.org/en/ (v10)
- npm https://www.npmjs.com/ (v6)

# Configuration
Configuration for the application is at `config/default.js`.
The following parameters can be set in config files or in env variables:

| Property | Environment varible | Default value | Description |
| --- | --- | --- | --- |
| LOG_LEVEL | LOG_LEVEL | info | control log level |
| SUBMISSION_API_URL | TEST_SUBMISSION_API_URL | https://api.topcoder.com/v5/submissions | the TC submission API URL |
| TC_AUTHN_URL | TC_AUTHN_URL | https://topcoder.auth0.com/oauth/ro | API that is used to fetch JWT token v2 |
| TC_AUTHZ_URL | TC_AUTHZ_URL | https://api.topcoder.com/v3/authorizations | API that is used to fetch JWT token v3 |
| TC_CLIENT_ID | TC_CLIENT_ID | 6ZwZEUo2ZK4c50aLPpgupeg5v2Ffxp9P | TC client ID |
| TC_CLIENT_V2CONNECTION | CLIENT_V2CONNECTION | TC-User-Database | TC client connection protocol |

# Publish the package to npm
- Create a npm account on https://www.npmjs.com/signup if you don't have one.
- Use the account to sign in via cli: `npm login`
- In the root directory of the project, run `npm publish --access=public` to publish the package to npm registry.

## Notes
- In rare cases the module name would have been used by others. You may need to change the value of the `name` field in `package.json`
to a unique one.
- When you make changes to your code and want to update the package you'll need to update the version of the package.
After that, run `npm publish` again to republish the package.
- If you want to remove the package from npm registry anyway, run `npm unpublish --force` under the root directory of the project.

# Installation

- After you published the package to npm registry you can then install the package via npm-cli:
- Install the package via npm-cli:

``` node
npm install -g <your package name here>
npm i -g @topcoder/topcoder-cli
```

# Usage
@@ -54,24 +25,6 @@ An example `.topcoderrc` file should conform to at least the following structure
"30095545" // at least one item here
],
"username": "TonyJ",
"password": "appirio123"
"password": "******"
}
```

# test

## Prepare
- Install dependencies `npm install`

## Unit test
To run unit tests alone

```bash
npm run test
```

To run unit tests with coverage report

```bash
npm run test:cov
```
49 changes: 49 additions & 0 deletions docs/Development.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
topcoder-cli
===

# Dependencies
- nodejs https://nodejs.org/en/ (v10)
- npm https://www.npmjs.com/ (v6)

# Configuration
Configuration for the application is at `config/default.js`.
The following parameters can be set in config files or in env variables:

| Property | Environment varible | Default value | Description |
| --- | --- | --- | --- |
| LOG_LEVEL | LOG_LEVEL | info | control log level |
| SUBMISSION_API_URL | TEST_SUBMISSION_API_URL | https://api.topcoder.com/v5/submissions | the TC submission API URL |
| TC_AUTHN_URL | TC_AUTHN_URL | https://topcoder.auth0.com/oauth/ro | API that is used to fetch JWT token v2 |
| TC_AUTHZ_URL | TC_AUTHZ_URL | https://api.topcoder.com/v3/authorizations | API that is used to fetch JWT token v3 |
| TC_CLIENT_ID | TC_CLIENT_ID | 6ZwZEUo2ZK4c50aLPpgupeg5v2Ffxp9P | TC client ID |
| TC_CLIENT_V2CONNECTION | CLIENT_V2CONNECTION | TC-User-Database | TC client connection protocol |

# Publish the package to npm
- Create a npm account on https://www.npmjs.com/signup if you don't have one.
- Use the account to sign in via cli: `npm login`
- In the root directory of the project, run `npm publish --access=public` to publish the package to npm registry.

## Notes
- In rare cases the module name would have been used by others. You may need to change the value of the `name` field in `package.json`
to a unique one.
- When you make changes to your code and want to update the package you'll need to update the version of the package.
After that, run `npm publish` again to republish the package.
- If you want to remove the package from npm registry anyway, run `npm unpublish --force` under the root directory of the project.

# test

## Prepare
- Install dependencies `npm install`

## Unit test
To run unit tests alone

```bash
npm run test
```

To run unit tests with coverage report

```bash
npm run test:cov
```
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@topcoder/topcoder-cli",
"version": "1.0.2",
"version": "1.0.3",
"description": "A CLI tool that will be used by Topcoder members to submit their solutions on challenges.",
"main": "index.js",
"scripts": {