Skip to main content

Gasket

Framework Maker for JavaScript Applications


License Contributors PRs Welcome Code of Conduct tweet

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
Lifecycle FlowchartA flowchart detailing how lifecycles are interrelated.
Configuration GuideConfiguring Gasket apps
Plugins GuideHow to use and author plugins
Presets GuideHow to use and author presets
Package Management GuideManaging dependencies in Gasket apps
Common "Gotchas"Tips and tricks to be aware of
Progressive Web Apps GuideMaking Progressive Web Apps (PWA) with Gasket
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
Next.js Redux GuideUsing Redux with Next.js Gasket apps
Webpack Configuration GuideConfiguring Webpack in Gasket apps

Commands

Available commands

NameDescription
analyzeGenerate analysis report of webpack bundles
buildPrepare the app to be started
createCreate a new Gasket app
docsGenerate docs for the app
helpGet usage details for Gasket commands
localBuild and start the app in development mode
startRun the prepared app

Lifecycles

Available lifecycles

NameDescription
apmTransactionModify the APM transaction
appEnvConfigAdjust app level config after merged for the env
appRequestConfigAdjust app level config for each request
buildPrepare the app to be started
composeServiceWorkerUpdate the service worker script
configureAllows plugins to adjust config before command is run
createApp level plugins
createServersSetup the create-servers 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
getCommandsAllows plugins to add CLI commands
initSignals the start of any Gasket command before it is run
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
logTransportsSetup Winston log transports
manifestModify the the web manifest for a request
metadataAllows plugins to adjust their metadata
metricsCollect metrics for an app
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
postCreateApp level plugins
prebootAny setup before the app starts
promptGasket config for an app
serversAccess to the server instances
serviceWorkerCacheKeyGet cache keys for request based service workers
startRun the prepared app
terminusSetup the terminus options
webpack (deprecated)Modify webpack config with partials or by mutating
webpackChain (deprecated)Setup webpack config by chaining
webpackConfigTransform the webpack config, with the help of webpack-merge
workboxSetup Workbox config and options

Structures

Available structure

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

Presets

Available presets

NameVersionDescription
@gasket/preset-api6.47.1Create Express-based API with Gasket
@gasket/preset-nextjs6.47.1Basic NextJS Framework
@gasket/preset-pwa6.47.1Turn Gasket apps into Progressive Web Apps

Plugins

Available plugins

NameVersionDescription
@gasket/plugin-analyze6.47.1Gasket Analyzer Plugin
@gasket/plugin-command6.47.1Plugin to enable other plugins to inject new gasket commands
@gasket/plugin-config6.47.1Supports application-specific (non-Gasket) configuration
@gasket/plugin-cypress6.46.8Integrates Cypress based testing into your Gasket application
@gasket/plugin-docs6.47.1Centralize doc files from plugins and modules
@gasket/plugin-docs-graphs6.47.1Generate mermaid graphs of an applications gasket lifecycles
@gasket/plugin-docsify6.47.1View collated docs with Docsify
@gasket/plugin-docusaurus6.47.1Gasket plugin for docusaurus
@gasket/plugin-elastic-apm6.47.1Adds Elastic APM instrumentation to your application
@gasket/plugin-express6.47.1Adds express support to your application
@gasket/plugin-fastify6.47.1Adds fastify support to your application
@gasket/plugin-git6.47.1Adds git support to your application
@gasket/plugin-happyfeet6.47.1A gasket plugin to enable happyfeet healthchecks
@gasket/plugin-https6.47.1Create http/s servers with graceful termination
@gasket/plugin-intl6.47.1NodeJS script to build localization files.
@gasket/plugin-jest6.46.8Integrated jest into your application.
@gasket/plugin-lifecycle6.47.1Allows a gasket/ directory to be used for lifecycle hooks in applications.
@gasket/plugin-lint6.47.1Adds GoDaddy standard linting to your application
@gasket/plugin-log6.47.1Gasket log plugin
@gasket/plugin-manifest6.47.1The web app manifest for progressive Gasket applications
@gasket/plugin-metadata6.47.1Adds metadata to gasket lifecycles
@gasket/plugin-metrics6.47.1Collect metrics for gasket commands
@gasket/plugin-mocha6.47.1Integrates mocha based testing in to your Gasket application
@gasket/plugin-morgan6.47.1Adds morgan request logger to your app
@gasket/plugin-nextjs6.47.1Adds Next support to your application
@gasket/plugin-redux6.47.1Gasket Redux Setup
@gasket/plugin-service-worker6.47.1Gasket Service Worker Plugin
@gasket/plugin-start6.47.1Adds commands for building and starting Gasket apps
@gasket/plugin-swagger6.47.1Generate and serve swagger docs
@gasket/plugin-webpack6.47.1Adds webpack support to your application
@gasket/plugin-workbox6.47.1Gasket Workbox Plugin
plugins/site-docs-plugin.js

Modules

Supporting modules

NameVersionDescription
@gasket/assets6.46.8Gasket assets
@gasket/cli6.47.1CLI for rapid application development with gasket
@gasket/data6.47.1Helper package for accessing embedded Gasket Data in the browser
@gasket/engine6.47.1Plugin engine for gasket
@gasket/fetch6.47.1Gasket Fetch API
@gasket/helper-intl6.47.1Internal helpers used by loaders to resolve locale file paths
@gasket/log6.46.8Gasket client and server logger
@gasket/nextjs6.47.1Gasket integrations for Next.js apps
@gasket/react-intl6.47.1React component library to enable localization for gasket apps.
@gasket/redux6.47.1Gasket Redux Configuration
@gasket/resolve6.47.1Essential module resolution & configuration management for gasket plugins & presets.
@gasket/typescript-tests6.47.1Not a published package; hosts unit tests to verify TypeScript support
@gasket/utils6.47.1Reusable utilities for Gasket internals
create-gasket-app6.47.1starter pack for creating a gasket app

Configurations

Available configuration options in the gasket.config.js

NameDescriptionTypeDefault
bundleAnalyzerConfigTune both browser and server Webpack analysis reportsobject
docsDocs config objectobject
docs.outputDirOutput directory for generated docsstring.docs
docsifyDocsify config objectobject
docsify.configDocsify configuration properties, excluding functionsobject
docsify.portPort to serve the docs fromnumber3000
docsify.scriptsOptional additional script files, which can include docsify pluginsstring[]
docsify.stylesheetsOptional additional stylesheet URLs to loadstring[]
docsify.themeName of the themestringstyles/gasket.css
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
express.routesGlob pattern for route setup codestring
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.basePathBase URL where locale files are servedstring
intl.defaultLocaleLocale to fallback to when loading filesstringen
intl.defaultPathPath to endpoint with JSON filesstring/locales
intl.localesOrdered list of accepted localesstring[]
intl.localesDirPath to on-disk directory where locale files existsstring./public/locales
intl.localesMapMapping of locales to share filesobject
intl.localesPathURL endpoint where static JSON files are availablestring
intl.manifestFilenameChange the name of the manifest filestringlocales-manifest.json
intl.modulesEnable locale files collation from node modulesbooleanobject
intl.nextRoutingEnable Next.js Routing when used with @gasket/plugin-nextjsbooleantrue
intl.serveStaticEnables ability to serve static locale filesbooleanstring
logSetup and customize loggerobject
log.prefixUsed to set the prefix in the winston formatstring
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.