Skip to main content

Gasket

Framework Maker for JavaScript Applications


License Contributors PRs Welcome Code of Conduct tweet

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

NameDescription
Quick Start GuideGet up and running on Gasket
Upgrades GuideSteps necessary to upgrade major versions
Gasket Actions GuideHow to use access data and invoke lifecycles
Lifecycle FlowchartA flowchart detailing how lifecycles are interrelated.
Express Setup GuideAdding middleware and routes for Express
Next.js Routing GuideBasic and advance routing for Next.js
Next.js Deployment GuideSteps to deploy a Next.js Gasket app
Webpack Configuration GuideConfiguring Webpack in Gasket apps

Commands

Available commands

NameDescription
docsGenerate docs for the app

Actions

Available actions

NameDescription
getApmTransactionGet the APM transaction data
getExpressAppGet the Express app instance
getFastifyAppGet the Fastify app instance
getGasketDataGet the Gasket data
getHappyFeetGet the Happy Feet instance
getIntlLocaleGet the current locale
getIntlManagerGet the IntlManager instance
getLoggerGet the logger instance
getMetadataGet the metadata for the plugins & modules
getNextConfigGet the Next.js config
getNextRouteGet the Next.js route
getPublicGasketDataGet the public Gasket data
getSWRegisterScriptGet the service worker registration script
getWebpackConfigGet the webpack config
startServerStart the server

Lifecycles

Available lifecycles

NameDescription
apmTransactionModify the APM transaction
commandsAdd custom commands to the CLI
composeServiceWorkerUpdate the service worker script
createLoggerCustom logger creation
createServersSetup the create-servers options
devProxySetup the devProxy options
docsGenerateGenerate graphs for display in documation
docsSetupSet up what docs are captured and how to transform them
docsViewView the collated documentation
errorMiddlewareAdd Express style middleware for handling errors with Fastify
errorMiddlewareAdd Express style middleware for handling errors
expressModify the Express instance to for adding endpoints
fastifyModify the Fastify instance to for adding endpoints
gasketDataAdjust app level data after merged for the env
initReduxStateInitializes state of the Redux store
initReduxStorePlugin access to Redux store instance
initWebpackCreate a webpack config
intlLocaleSet the language for which locale files to load
manifestModify the the web manifest for a request
metadataAllows plugins to adjust their metadata
middlewareAdd Express style middleware for Fastify
middlewareAdd Express style middleware
nextUpdate the Next.js app instance before preparing for Express
nextUpdate the Next.js app instance before preparing for Fastify
nextConfigSetup the Next.js config
nextExpressAccess the prepared Next.js app and Express instance
nextFastifyAccess the prepared Next.js app and Fastify instance
nextPreHandlingPerform tasks just before Next.js request handling
publicGasketDataAdjust response level data for each request
serverConfigSetup the server configuration
serversAccess to the server instances
serviceWorkerCacheKeyGet cache keys for request based service workers
terminusSetup the terminus options
webpackConfigTransform the Webpack config
winstonTransportsSetup Winston log transports
workboxSetup Workbox config and options

Structures

Available structure

NameDescription
.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.jsonCypress configuration
gasket-data.jsApp configuration with environment overrides
jest.config.jsJest configuration
redux/store.jsSetup to make Redux store

Presets

Available presets

NameVersionDescription
@gasket/preset-api7.0.1Create Express-based API with Gasket
@gasket/preset-nextjs7.0.1Basic NextJS Framework

Plugins

Available plugins

NameVersionDescription
@gasket/plugin-analyze7.0.1Gasket Analyzer Plugin
@gasket/plugin-command7.0.1Plugin to enable other plugins to inject new gasket commands
@gasket/plugin-cypress7.0.1Integrates Cypress based testing into your Gasket application
@gasket/plugin-data7.0.1Supports application-specific settings and configurations
@gasket/plugin-docs7.0.1Centralize doc files from plugins and modules
@gasket/plugin-docs-graphs7.0.1Generate mermaid graphs of an applications gasket lifecycles
@gasket/plugin-docusaurus7.0.1Gasket plugin for docusaurus
@gasket/plugin-elastic-apm7.0.1Adds Elastic APM instrumentation to your application
@gasket/plugin-express7.0.1Adds express support to your application
@gasket/plugin-fastify7.0.1Adds fastify support to your application
@gasket/plugin-git7.0.1Adds git support to your application
@gasket/plugin-happyfeet7.0.1A gasket plugin to enable happyfeet healthchecks
@gasket/plugin-https7.0.1Create http/s servers with graceful termination
@gasket/plugin-intl7.0.1NodeJS script to build localization files.
@gasket/plugin-jest7.0.1Integrated jest into your application.
@gasket/plugin-lint7.0.1Adds GoDaddy standard linting to your application
@gasket/plugin-logger7.0.1Gasket plugin for logging
@gasket/plugin-manifest7.0.1The web app manifest for progressive Gasket applications
@gasket/plugin-metadata7.0.1Adds metadata to gasket lifecycles
@gasket/plugin-middleware7.0.1Handles common server engine setups for routing and executing lifecycles.
@gasket/plugin-mocha7.0.1Integrates mocha based testing in to your Gasket application
@gasket/plugin-morgan7.0.1Adds morgan request logger to your app
@gasket/plugin-nextjs7.0.1Adds Next support to your application
@gasket/plugin-redux7.0.1Gasket Redux Setup
@gasket/plugin-service-worker7.0.1Gasket Service Worker Plugin
@gasket/plugin-swagger7.0.1Generate and serve swagger docs
@gasket/plugin-typescript7.0.1Gasket plugin for TypeScript support
@gasket/plugin-webpack7.0.1Adds webpack support to your application
@gasket/plugin-winston7.0.1Gasket logger based on Winston
@gasket/plugin-workbox7.0.1Gasket Workbox Plugin

Modules

Supporting modules

NameVersionDescription
@gasket/assets7.0.1Gasket assets
@gasket/core7.0.1Entry point to setting up Gasket instances
@gasket/data7.0.1Helper package for accessing embedded Gasket Data in the browser
@gasket/intl7.0.1Internationalization managers for translation files and locale handling.
@gasket/nextjs7.0.1Gasket integrations for Next.js apps
@gasket/react-intl7.0.1React component library to enable localization for gasket apps.
@gasket/redux7.0.1Gasket Redux Configuration
@gasket/utils7.0.1Reusable utilities for Gasket internals

Configurations

Available configuration options in the gasket.js

NameDescriptionTypeDefault
bundleAnalyzerConfigTune both browser and server Webpack analysis reportsobject
docsDocs config objectobject
docs.outputDirOutput directory for generated docsstring.docs
docusaurusDocusaurus plugin configobject
docusaurus.docsDirSub-directory for the generated markdown from the docs pluginstringdocs
docusaurus.hostHostname to serve the docs fromstringlocalhost
docusaurus.portPort number to serve docs sitenumber3000
docusaurus.rootDirRoot Docusaurus directorystring.docs
elasticAPMConfiguration to provide additional setup helpersobject
elasticAPM.sensitiveCookiesList of sensitive cookies to filterstring[][]
expressExpress plugin configurationobject
express.compressionAutomatic compressionbooleantrue
express.excludedRoutesRegex (deprecated)Routes to be included for Gasket middleware, based on a regexRegExp
express.middlewareInclusionRegexRoutes to be included for Gasket middleware, based on a regexRegExp
fastifyFastify configuration objectobject
fastify.compressionAutomatic compressionbooleantrue
fastify.excludedRoutesRegexRoutes to be excluded based on a regexRegExp
httpHTTP port or config objectnumberobject
http2HTTP2 config objectobject
httpsHTTPS config objectobject
intlIntl config objectobject
intl.defaultLocaleLocale to fallback to when loading filesstringen
intl.defaultLocaleFilePathLookup path to locale filesstringlocales
intl.localesOrdered list of accepted localesstring[]
intl.localesDirPath to on-disk directory where locale files existsstring./locales
intl.localesMapMapping of locales to share filesobject
intl.managerFilenameChange the name of the IntlManager filestringintl.js
intl.modulesEnable locale files collation from node modulesbooleanobject
intl.nextRoutingEnable Next.js Routing when used with @gasket/plugin-nextjsbooleantrue
manifestManifest plugin configobject
morganMorgan plugin configurationobject
morgan.formatLog format to printstringtiny
morgan.optionsMorgan optionsobject
nextConfigEverything that can be configured in next.config.js can be added here.object
reduxRedux plugin config objectobject
redux.initStateInitial state to include in the storeobject
redux.makeStoreRelative path to a custom makeStore configurationstringstore.js
serviceWorkerService worker plugin config objectobject
serviceWorker.cacheAdjust the content cache settings using the lru-cache optionsobject
serviceWorker.cacheKeysOptional cache key functions that accept the request object as argument and return a stringfunction[]
serviceWorker.contentThe JavaScript content to be servedstring
serviceWorker.minifyMinification options to be used on the composed JavaScriptobject
serviceWorker.scopeFrom where to intercept requestsstring/
serviceWorker.staticOutputIf true, a static sw.js will be output to the ./public dirstringboolean
serviceWorker.urlName of the service worker filestring/sw.js
serviceWorker.webpackRegisterBy default, a service worker registration script will be injected to the webpack entry modulesstringstring[]
swaggerSwagger config objectobject
swagger.apiDocsRouteRoute to Swagger UIstring/api-docs
swagger.definitionFileTarget swagger spec file, either json or yamlstringswagger.json
swagger.jsdocIf set, the definitionFile will be generated based on JSDocs in the configured filesobject
swagger.uiOptional custom UI optionsobject
terminusTerminus config objectobject
terminus.healthcheckCustom Terminus healthcheck endpoint namesstring[]/healthcheck,/healthcheck.html
winstonSetup and customize winston loggerobject
workboxWorkbox config objectobject
workbox.basePathChange the default path to /_workbox endpoint by adding a path prefix herestring
workbox.configAny initial workbox config options which will be merged with those from any workbox lifecycle hooksobject
workbox.outputDirThe path to the directory in which the Workbox libraries should be copiedstring./build/workbox

License

Gasket is MIT licensed.