examplesarus v0.0.4
@steggy example repository
This is a minimal example repository, intended as a proof of concept that lives outside the primary monorepo.
What's included?
The package.json includes:
@nestjs
: underlying framework@steggy/boilerplate
: configuration and application lifecycle management@steggy/tty
: methods for interacting via the terminal@steggy/config-builder
: a terminal based "settings page" for your app. more below@steggy/sampler-app
: a larger canned example script to show off tty functionalitytypescript
: required for building code (comes with tsconfig)eslint
+prettier
: code standards based off the main repo
Setup
Installing Node
@steggy
targets node16+, with node18 being preferred.
If you do not have it installed, follow these steps:
1) Install NVM (node version manager) 2) Run command:
nvm install 18
nvm use 18
nvm alias default 18
npm install --global yarn
Repository Setup
# Pull down code
git clone git@github.com:mp3three/examplesaurus.git
cd ./examplesaurus
# install dependencies
yarn
# pull in latest @steggy updates
yarn upgrade --latest --pattern "@steggy"
Sampler App
The sampler app is included as a dev dependency, and is intended to demonstrate TTY and injectable configuration functionality.
Using the npx
prefix:
# Launch app
npx sampler-app
# Configure app
npx sampler-app --scan-config > ./config.json; npx config-builder --definition_file ./config.json
Local Development
Start dev server
The yarn start
command has been set up to run through ts-node
, and the vscode code-workspace has been set up to play nice with the debugger.
# basic running the code
yarn start
# pass command line switches
yarn start --help
Configuration
Code that utilizes the @steggy
bootstrap process can be utilized with the config builder, and will always support the --scan-config
switch.
To configure your app in a development environment:
yarn configure
Configuring app after publishing.
Requires script to be globally installed, alongside @steggy/config-builder
# using "examplesarus" as app name for what to scan
# this allows config builder to know what to display
examplesarus --scan-config > ./config.json
# work with all valid configuration files
config-builder --definition_file ./config.json
# work with a specific config file
config-builder --definition_file ./config.json --config_file ./app-configuration.yaml
# launch app using a specific configuration file
examplesarus --config ./app-configuration.yaml
Production builds & publishing
This repository is set up to publish the local src
folder as a command line script.
The script name is the same as the repository name by default, but can be modified by changing the bin
entry in package.json.
# Build code
yarn build
# >> manually bump package.json version
# --
# Publish to NPM
yarn publish
The build script will perform a Typescript transpile, and perform some other prep work on the built code to ensure it is runnable as a script.
Bug reports & issues
Issues with @steggy
libraries should be opened against the primary monorepo