Skip to content

Latest commit

 

History

History
99 lines (64 loc) · 2.15 KB

File metadata and controls

99 lines (64 loc) · 2.15 KB

Foundation

🏛️ Base repository for building JavaScript apps or libraries.

To use this template, clone this repository and rename all "Foundation" instances to the name of your library. Set this package to "public" before publishing it.

Uses

Setup

  • nvm install
  • cp .env.template .env.local
  • npm install

Library mode

Features

  • List the main features of the library
  • Explain how it distinguishes from other libraries

Usage

Everything is exported from the main entry-point through an ES6 module:

import { add } from "foundation";

Installation

Install with the Node Package Manager:

npm install foundation

Documentation

Documentation is generated here.

Use the application to test the library

  • npm run dev
  • npm run dev:test (or use dedicated Vitest plugin of your IDE)

Import exported library items from the "#lib" alias:

import { add } from "#lib";

Build and publish the library

  • npm run build:lib
  • Set the private property to false in package.json
  • npm run release:init

Release subsequent versions using either

  • npm run release:alpha
  • npm run release:beta
  • npm run release:patch
  • npm run release:minor
  • npm run release:major

Application mode

Develop on the application

  • npm run dev
  • npm run dev:test (or use dedicated Vitest plugin of your IDE)

Build and run

  • npm run build:app
  • OPTIONAL: export ENV_PATH=path/to/extra/dot_env/file
  • npm start

Options

List all environment variables used by the application:

  • ENV_PATH: Path to an optional environment file.
  • LOG_LEVEL: One of the supported levels or "silent" to disable logging.