Framework Maker for JavaScript Applications
Gasket helps developers make frameworks to power their apps. There are several presets and plugins available with which to make frameworks and construct apps. The various commands, lifecycles, and structures are all enabled by different plugins you can choose to use.
If you are new to Gasket, you might want to first give it a spin following the Quick Start Guide. From there, reference the guides to start developing your apps and making your frameworks.
The tables of contents below are generated by the docs command enabled by @gasket/plugin-docs, which is recommended to view app docs. Links will load the docs for the plugin or package that implements the feature.
Guides
Help and explanations docs
Name | Description |
---|---|
Quick Start Guide | Get up and running on Gasket |
Upgrades Guide | Steps necessary to upgrade major versions |
Lifecycle Flowchart | A flowchart detailing how lifecycles are interrelated. |
Configuration Guide | Configuring Gasket apps |
Plugins Guide | How to use and author plugins |
Presets Guide | How to use and author presets |
Package Management Guide | Managing dependencies in Gasket apps |
Common "Gotchas" | Tips and tricks to be aware of |
Progressive Web Apps Guide | Making Progressive Web Apps (PWA) with Gasket |
Express Setup Guide | Adding middleware and routes for Express |
Next.js Routing Guide | Basic and advance routing for Next.js |
Next.js Deployment Guide | Steps to deploy a Next.js Gasket app |
Next.js Redux Guide | Using Redux with Next.js Gasket apps |
Webpack Configuration Guide | Configuring Webpack in Gasket apps |
Commands
Available commands
Name | Description |
---|---|
analyze | Generate analysis report of webpack bundles |
build | Prepare the app to be started |
create | Create a new Gasket app |
docs | Generate docs for the app |
help | Get usage details for Gasket commands |
local | Build and start the app in development mode |
start | Run the prepared app |
Lifecycles
Available lifecycles
Name | Description |
---|---|
appEnvConfig | Adjust app level config after merged for the env |
appRequestConfig | Adjust app level config for each request |
build | Prepare the app to be started |
composeServiceWorker | Update the service worker script |
configure | Allows plugins to adjust config before command is run |
create | App level plugins |
createServers | Setup the create-servers options |
docsGenerate | Generate graphs for display in documation |
docsSetup | Set up what docs are captured and how to transform them |
docsView | View the collated documentation |
errorMiddleware | Add Express style middleware for handling errors with Fastify |
errorMiddleware | Add Express style middleware for handling errors |
express | Modify the Express instance to for adding endpoints |
fastify | Modify the Fastify instance to for adding endpoints |
getCommands | Allows plugins to add CLI commands |
init | Signals the start of any Gasket command before it is run |
initReduxState | Initializes state of the Redux store |
initReduxStore | Plugin access to Redux store instance |
initWebpack | Create a webpack config |
intlLocale | Set the language for which locale files to load |
logTransports | Setup Winston log transports |
manifest | Modify the the web manifest for a request |
metadata | Allows plugins to adjust their metadata |
metrics | Collect metrics for an app |
middleware | Add Express style middleware for Fastify |
middleware | Add Express style middleware |
next | Update the Next.js app instance before preparing for Express |
next | Update the Next.js app instance before preparing for Fastify |
nextConfig | Setup the Next.js config |
nextExpress | Access the prepared Next.js app and Express instance |
nextFastify | Access the prepared Next.js app and Fastify instance |
nextPreHandling | Perform tasks just before Next.js request handling |
postCreate | App level plugins |
preboot | Any setup before the app starts |
prompt | Gasket config for an app |
servers | Access to the server instances |
serviceWorkerCacheKey | Get cache keys for request based service workers |
start | Run the prepared app |
terminus | Setup the terminus options |
webpack (deprecated) | Modify webpack config with partials or by mutating |
webpackChain (deprecated) | Setup webpack config by chaining |
webpackConfig | Transform the webpack config, with the help of webpack-merge |
workbox | Setup Workbox config and options |
Structures
Available structure
Name | Description |
---|---|
.docs/ | Output of the docs command |
config/ | App configuration using environment files |
lifecycles/ | JavaScript files to hook lifecycles with matching name |
pages/ | NextJS routing |
plugins/ | One-off plugins for apps |
public/ | NextJS static files |
public/locales/ | Locale JSON files with translation strings |
test/ | Test files |
test/ | Test files |
app.config.js | App configuration with environment overrides |
cypress.json | Cypress configuration |
gasket.config.js | Gasket config for an app |
jest.config.js | Jest configuration |
redux/store.js | Setup to make Redux store |
Presets
Available presets
Name | Version | Description |
---|---|---|
@gasket/preset-api | 6.39.3 | Create Express-based API with Gasket |
@gasket/preset-nextjs | 6.40.0 | Basic NextJS Framework |
@gasket/preset-pwa | 6.39.3 | Turn Gasket apps into Progressive Web Apps |
Plugins
Available plugins
Name | Version | Description |
---|---|---|
@gasket/plugin-analyze | 6.39.3 | Gasket Analyzer Plugin |
@gasket/plugin-command | 6.39.3 | Plugin to enable other plugins to inject new gasket commands |
@gasket/plugin-config | 6.39.3 | Supports application-specific (non-Gasket) configuration |
@gasket/plugin-cypress | 6.39.0 | Integrates Cypress based testing into your Gasket application |
@gasket/plugin-docs | 6.39.3 | Centralize doc files from plugins and modules |
@gasket/plugin-docs-graphs | 6.39.0 | Generate mermaid graphs of an applications gasket lifecycles |
@gasket/plugin-docsify | 6.39.3 | View collated docs with Docsify |
@gasket/plugin-docusaurus | 6.39.3 | Gasket plugin for docusaurus |
@gasket/plugin-elastic-apm | 6.39.3 | Adds Elastic APM instrumentation to your application |
@gasket/plugin-express | 6.39.3 | Adds express support to your application |
@gasket/plugin-fastify | 6.39.3 | Adds fastify support to your application |
@gasket/plugin-git | 6.40.0 | Adds git support to your application |
@gasket/plugin-happyfeet | 6.39.1 | A gasket plugin to enable happyfeet healthchecks |
@gasket/plugin-https | 6.39.3 | Create http/s servers with graceful termination |
@gasket/plugin-intl | 6.39.3 | NodeJS script to build localization files. |
@gasket/plugin-jest | 6.39.0 | Integrated jest into your application. |
@gasket/plugin-lifecycle | 6.39.3 | Allows a gasket/ directory to be used for lifecycle hooks in applications. |
@gasket/plugin-lint | 6.39.0 | Adds GoDaddy standard linting to your application |
@gasket/plugin-log | 6.39.3 | Gasket log plugin |
@gasket/plugin-manifest | 6.39.3 | The web app manifest for progressive Gasket applications |
@gasket/plugin-metadata | 6.39.3 | Adds metadata to gasket lifecycles |
@gasket/plugin-metrics | 6.39.3 | Collect metrics for gasket commands |
@gasket/plugin-mocha | 6.39.0 | Integrates mocha based testing in to your Gasket application |
@gasket/plugin-morgan | 6.39.3 | Adds morgan request logger to your app |
@gasket/plugin-nextjs | 6.40.0 | Adds Next support to your application |
@gasket/plugin-redux | 6.39.3 | Gasket Redux Setup |
@gasket/plugin-service-worker | 6.39.3 | Gasket Service Worker Plugin |
@gasket/plugin-start | 6.39.3 | Adds commands for building and starting Gasket apps |
@gasket/plugin-swagger | 6.39.3 | Generate and serve swagger docs |
@gasket/plugin-webpack | 6.39.3 | Adds webpack support to your application |
@gasket/plugin-workbox | 6.39.3 | Gasket Workbox Plugin |
Modules
Supporting modules
Name | Version | Description |
---|---|---|
@gasket/assets | 6.39.0 | Gasket assets |
@gasket/cli | 6.40.0 | CLI for rapid application development with gasket |
@gasket/data | 6.39.0 | Helper package for accessing embedded Gasket Data in the browser |
@gasket/engine | 6.39.3 | Plugin engine for gasket |
@gasket/fetch | 6.39.0 | Gasket Fetch API |
@gasket/helper-intl | 6.39.0 | Internal helpers used by loaders to resolve locale file paths |
@gasket/log | 6.39.0 | Gasket client and server logger |
@gasket/nextjs | 6.40.0 | Gasket integrations for Next.js apps |
@gasket/react-intl | 6.39.0 | React component library to enable localization for gasket apps. |
@gasket/redux | 6.39.0 | Gasket Redux Configuration |
@gasket/resolve | 6.39.3 | Essential module resolution & configuration management for gasket plugins & presets. |
@gasket/typescript-tests | 6.40.0 | Not a published package; hosts unit tests to verify TypeScript support |
@gasket/utils | 6.39.3 | Reusable utilities for Gasket internals |
create-gasket-app | 6.40.0 | starter pack for creating a gasket app |
Configurations
Available configuration options in the gasket.config.js
Name | Description | Type | Default |
---|---|---|---|
bundleAnalyzerConfig | Tune both browser and server Webpack analysis reports | object | |
docs | Docs config object | object | |
docs.outputDir | Output directory for generated docs | string | .docs |
docsify | Docsify config object | object | |
docsify.config | Docsify configuration properties, excluding functions | object | |
docsify.port | Port to serve the docs from | number | 3000 |
docsify.scripts | Optional additional script files, which can include docsify plugins | string[] | |
docsify.stylesheets | Optional additional stylesheet URLs to load | string[] | |
docsify.theme | Name of the theme | string | styles/gasket.css |
docusaurus | Docusaurus plugin config | object | |
docusaurus.docsDir | Sub-directory for the generated markdown from the docs plugin | string | docs |
docusaurus.host | Hostname to serve the docs from | string | localhost |
docusaurus.port | Port number to serve docs site | number | 3000 |
docusaurus.rootDir | Root Docusaurus directory | string | .docs |
express | Express plugin configuration | object | |
express.compression | Automatic compression | boolean | true |
express.excludedRoutesRegex | Routes to be excluded based on a regex | ||
fastify | Fastify configuration object | object | |
fastify.compression | Automatic compression | boolean | true |
fastify.excludedRoutesRegex | Routes to be excluded based on a regex | RegExp | |
http | HTTP port or config object | number | object |
http2 | HTTP2 config object | object | |
https | HTTPS config object | object | |
intl | Intl config object | object | |
intl.basePath | Base URL where locale files are served | string | |
intl.defaultLocale | Locale to fallback to when loading files | string | en |
intl.defaultPath | Path to endpoint with JSON files | string | /locales |
intl.locales | Ordered list of accepted locales | string[] | |
intl.localesDir | Path to on-disk directory where locale files exists | string | ./public/locales |
intl.localesMap | Mapping of locales to share files | object | |
intl.localesPath | URL endpoint where static JSON files are available | string | |
intl.manifestFilename | Change the name of the manifest file | string | locales-manifest.json |
intl.modules | Enable locale files collation from node modules | boolean | object |
intl.nextRouting | Enable Next.js Routing when used with @gasket/plugin-nextjs | boolean | true |
intl.serveStatic | Enables ability to serve static locale files | boolean | string |
log | Setup and customize logger | object | |
log.prefix | Used to set the prefix in the winston format | string | |
manifest | Manifest plugin config | object | |
morgan | Morgan plugin configuration | object | |
morgan.format | Log format to print | string | tiny |
morgan.options | Morgan options | object | |
nextConfig | Everything that can be configured in next.config.js can be added here. |
object | |
redux | Redux plugin config object | object | |
redux.initState | Initial state to include in the store | object | |
redux.makeStore | Relative path to a custom makeStore configuration | string | store.js |
serviceWorker | Service worker plugin config object | object | |
serviceWorker.cache | Adjust the content cache settings using the lru-cache options | object | |
serviceWorker.cacheKeys | Optional cache key functions that accept the request object as argument and return a string | function[] | |
serviceWorker.content | The JavaScript content to be served | string | |
serviceWorker.minify | Minification options to be used on the composed JavaScript | object | |
serviceWorker.scope | From where to intercept requests | string | / |
serviceWorker.staticOutput | If true , a static sw.js will be output to the ./public dir |
string | boolean |
serviceWorker.url | Name of the service worker file | string | /sw.js |
serviceWorker.webpackRegister | By default, a service worker registration script will be injected to the webpack entry modules | string | string[] |
swagger | Swagger config object | object | |
swagger.apiDocsRoute | Route to Swagger UI | string | /api-docs |
swagger.definitionFile | Target swagger spec file, either json or yaml | string | swagger.json |
swagger.jsdoc | If set, the definitionFile will be generated based on JSDocs in the configured files | object | |
swagger.ui | Optional custom UI options | object | |
terminus | Terminus config object | object | |
terminus.healthcheck | Custom Terminus healthcheck endpoint names | string[] | /healthcheck,/healthcheck.html |
winston | Setup and customize winston logger | object | |
workbox | Workbox config object | object | |
workbox.basePath | Change the default path to /_workbox endpoint by adding a path prefix here |
string | |
workbox.config | Any initial workbox config options which will be merged with those from any workbox lifecycle hooks |
object | |
workbox.outputDir | The path to the directory in which the Workbox libraries should be copied | string | ./build/workbox |
License
Gasket is MIT licensed.