Framework Maker for JavaScript Applications
Version 7
If you are looking for Version 6 docs, see the LTS branch.
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 |
Gasket Actions Guide | How to use access data and invoke lifecycles |
Lifecycle Flowchart | A flowchart detailing how lifecycles are interrelated. |
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 |
Webpack Configuration Guide | Configuring Webpack in Gasket apps |
Commands
Available commands
Name | Description |
---|---|
docs | Generate docs for the app |
Actions
Available actions
Name | Description |
---|---|
getApmTransaction | Get the APM transaction data |
getExpressApp | Get the Express app instance |
getFastifyApp | Get the Fastify app instance |
getGasketData | Get the Gasket data |
getHappyFeet | Get the Happy Feet instance |
getIntlLocale | Get the current locale |
getIntlManager | Get the IntlManager instance |
getLogger | Get the logger instance |
getMetadata | Get the metadata for the plugins & modules |
getNextConfig | Get the Next.js config |
getNextRoute | Get the Next.js route |
getPublicGasketData | Get the public Gasket data |
getSWRegisterScript | Get the service worker registration script |
getWebpackConfig | Get the webpack config |
startProxyServer | Start the proxy server |
startServer | Start the server |
Lifecycles
Available lifecycles
Name | Description |
---|---|
apmTransaction | Modify the APM transaction |
composeServiceWorker | Update the service worker script |
createLogger | Custom logger creation |
createServers | Setup the create-servers options |
devProxy | Setup the devProxy 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 |
gasketData | Adjust app level data after merged for the env |
httpsProxy | Setup the httpsProxy options |
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 |
manifest | Modify the the web manifest for a request |
metadata | Allows plugins to adjust their metadata |
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 |
publicGasketData | Adjust response level data for each request |
serverConfig | Setup the server configuration |
servers | Access to the server instances |
serviceWorkerCacheKey | Get cache keys for request based service workers |
terminus | Setup the terminus options |
webpackConfig | Transform the Webpack config |
winstonTransports | Setup Winston log transports |
workbox | Setup Workbox config and options |
Structures
Available structure
Name | Description |
---|---|
.docs/docs/ | Output of the docs command |
locales/ | Locale JSON files with translation strings |
pages/ | NextJS routing |
public/ | NextJS static files |
test/ | Test files |
test/ | Test files |
cypress.json | Cypress configuration |
gasket-data.js | App configuration with environment overrides |
jest.config.js | Jest configuration |
redux/store.js | Setup to make Redux store |
Presets
Available presets
Name | Version | Description |
---|---|---|
@gasket/preset-api | 7.0.14 | Create Express-based API with Gasket |
@gasket/preset-nextjs | 7.0.14 | Basic NextJS Framework |
Plugins
Available plugins
Name | Version | Description |
---|---|---|
@gasket/plugin-analyze | 7.0.9 | Gasket Analyzer Plugin |
@gasket/plugin-cypress | 7.0.9 | Integrates Cypress based testing into your Gasket application |
@gasket/plugin-data | 7.0.9 | Supports application-specific settings and configurations |
@gasket/plugin-docs | 7.0.9 | Centralize doc files from plugins and modules |
@gasket/plugin-docs-graphs | 7.0.1 | Generate mermaid graphs of an applications gasket lifecycles |
@gasket/plugin-docusaurus | 7.0.9 | Gasket plugin for docusaurus |
@gasket/plugin-dynamic-plugins | 0.0.0 | |
@gasket/plugin-elastic-apm | 7.0.9 | Adds Elastic APM instrumentation to your application |
@gasket/plugin-express | 7.0.14 | Adds express support to your application |
@gasket/plugin-fastify | 7.0.13 | Adds fastify support to your application |
@gasket/plugin-git | 7.0.9 | Adds git support to your application |
@gasket/plugin-happyfeet | 7.0.4 | A gasket plugin to enable happyfeet healthchecks |
@gasket/plugin-https | 7.0.9 | Create http/s servers with graceful termination |
@gasket/plugin-https-proxy | 7.0.0-canary.0 | Adds support for running an https proxy |
@gasket/plugin-intl | 7.0.14 | NodeJS script to build localization files. |
@gasket/plugin-jest | 7.0.10 | Integrated jest into your application. |
@gasket/plugin-lint | 7.0.3 | Adds GoDaddy standard linting to your application |
@gasket/plugin-logger | 7.0.9 | Gasket plugin for logging |
@gasket/plugin-manifest | 7.0.9 | The web app manifest for progressive Gasket applications |
@gasket/plugin-metadata | 7.0.9 | Adds metadata to gasket lifecycles |
@gasket/plugin-middleware | 7.0.1 | Handles common server engine setups for routing and executing lifecycles. |
@gasket/plugin-mocha | 7.0.4 | Integrates mocha based testing in to your Gasket application |
@gasket/plugin-morgan | 7.0.9 | Adds morgan request logger to your app |
@gasket/plugin-nextjs | 7.0.9 | Adds Next support to your application |
@gasket/plugin-redux | 7.0.14 | Gasket Redux Setup |
@gasket/plugin-service-worker | 7.0.9 | Gasket Service Worker Plugin |
@gasket/plugin-swagger | 7.0.9 | Generate and serve swagger docs |
@gasket/plugin-typescript | 7.0.1 | Gasket plugin for TypeScript support |
@gasket/plugin-webpack | 7.0.9 | Adds webpack support to your application |
@gasket/plugin-winston | 7.0.9 | Gasket logger based on Winston |
@gasket/plugin-workbox | 7.0.9 | Gasket Workbox Plugin |
Modules
Supporting modules
Name | Version | Description |
---|---|---|
@gasket/assets | 7.0.1 | Gasket assets |
@gasket/core | 7.0.9 | Entry point to setting up Gasket instances |
@gasket/data | 7.0.1 | Helper package for accessing embedded Gasket Data in the browser |
@gasket/intl | 7.0.1 | Internationalization managers for translation files and locale handling. |
@gasket/nextjs | 7.0.1 | Gasket integrations for Next.js apps |
@gasket/react-intl | 7.0.1 | React component library to enable localization for gasket apps. |
@gasket/redux | 7.0.14 | Gasket Redux Configuration |
@gasket/request | 7.0.0-canary.0 | Utilities for working with request objects in Gasket |
@gasket/utils | 7.0.9 | Reusable utilities for Gasket internals |
Configurations
Available configuration options in the gasket.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 |
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 |
dynamicPlugins | Specify which plugins to load dynamically into gasket | array | |
elasticAPM | Configuration to provide additional setup helpers | object | |
elasticAPM.sensitiveCookies | List of sensitive cookies to filter | string[] | [] |
express | Express plugin configuration | object | |
express.compression | Automatic compression | boolean | true |
express.excludedRoutesRegex (deprecated) | Routes to be included for Gasket middleware, based on a regex | RegExp | |
express.middlewareInclusionRegex | Routes to be included for Gasket middleware, based on a regex | RegExp | |
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 | |
httpsProxy | http-proxy config object | object | |
intl | Intl config object | object | |
intl.defaultLocale | Locale to fallback to when loading files | string | en |
intl.defaultLocaleFilePath | Lookup path to locale files | string | locales |
intl.locales | Ordered list of accepted locales | string[] | |
intl.localesDir | Path to on-disk directory where locale files exists | string | ./locales |
intl.localesMap | Mapping of locales to share files | object | |
intl.managerFilename | Change the name of the IntlManager file | string | intl.js |
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 |
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.