open-index/open-npm huggingface dataset:
npm package: @jahidul.activity/webpack-demo
Description: ## Cheat sheet
Author: Ashton Stephens
Latest version: 1.0.0

# MessageAPI Definiton and Code Autogenerator

## Cheat sheet

* `npm run build-dev`   compile typescript to js
* `npm run watch`   watch for changes and compile
* `npm run test`    perform the jest unit tests

---

## Introduction

This folder defines a simple website that will call the message api defined and autogenerated in the `api_definition` subdirectory
of this project.

## Getting Started

### Prerequisites

To get started with this api, you will need to have the following items setup:

1. Software dependencies installed
    1. The current long term support version of node (18.12.0)

**To fully set up your local host to interact with your deployed CDK stack, you'll need to do the following**
1. Build and deploy your cdk stack *(note: that the website that's deployed won't work yet but that's okay)*
1. Get the api endpoint from the cdk deploy output that looks a bit like this

        Outputs:
        CloudFormationStack.MessageServerAPIEndpoint92232D23 = https://####.execute-api.us-west-2.amazonaws.com/dev/

1. Take api `https://####.execute-api.us-west-2.amazonaws.com/dev/` value and paste it in the file `website/dist/config.json` file
under the `"apiEndpoint"` option.

## Development Process

To locally build the application you'll need to run the following commands with the project subdirectory that contains
this readme file.

    npm install # Install dependencies if not done so already
    npm build-dev # rebuild autogenerated code

## Local Testing

To test this code with an observable website locally you'll need a way to run a local server within the `website/dist`
folder. This can be done a number of ways, but I use the `VSCode` extension `LivePreview` which will host a mini-server
within your local env.

To compile changes to the typescript code as you go, run the command `npm run watch` which will poll every
one second to see if any of the sources have changed. If any sources change, it'll regenerate the code.

---

### Adding New API Call Support

Any autogenerated content will be included within the `src/.generated-sources/`, with the openapi content stored under `openapi`.
To pick up any changes to the api you'll need to re-run the api autogeneration within the `api_definition` folder. Once that is
done the autogenerated api will include any new api calls.