├── .nojekyll ├── .nvmrc ├── CNAME ├── site ├── static │ ├── .nojekyll │ └── img │ │ ├── favicon.ico │ │ ├── socialpreview.png │ │ └── authors │ │ ├── kquerna.png │ │ ├── mmason.jpeg │ │ ├── kawikabader.jpg │ │ └── kinetifex.png ├── babel.config.js ├── blog │ └── 2020-12-10-api-preset │ │ ├── cover.jpg │ │ ├── finished.png │ │ ├── packager.png │ │ ├── empty-swagger.png │ │ ├── gasket-config.png │ │ ├── lint-config.png │ │ ├── package-json.png │ │ ├── app-description.png │ │ ├── orders-response.png │ │ ├── swagger-default.png │ │ ├── swagger-orders.png │ │ ├── unit-test-suite.png │ │ ├── updated-swagger.png │ │ └── folder-structure.png ├── src │ ├── components │ │ └── homepage │ │ │ ├── index.js │ │ │ └── header.jsx │ └── pages │ │ └── index.js ├── sidebars.js └── .gitignore ├── packages ├── gasket-core │ ├── .gitignore │ ├── .gitattributes │ ├── tsconfig.json │ ├── docs │ │ └── trace-example.png │ ├── jest.config.js │ ├── lib │ │ └── index.js │ ├── .swcrc │ ├── vitest.config.js │ └── test │ │ └── index.test.js ├── gasket-data │ ├── .gitignore │ ├── tsconfig.json │ ├── lib │ │ ├── index.js │ │ ├── gasket-data.js │ │ └── resolve-gasket-data.js │ ├── .swcrc │ ├── vitest.config.js │ └── test │ │ └── index.test.js ├── gasket-intl │ ├── .gitignore │ ├── test │ │ ├── fixtures │ │ │ ├── locales │ │ │ │ ├── extra │ │ │ │ │ ├── en-US.json │ │ │ │ │ └── fr-FR.json │ │ │ │ ├── en-US.json │ │ │ │ └── fr-FR.json │ │ │ └── mock-manifest.json │ │ └── helpers.js │ ├── tsconfig.json │ ├── .swcrc │ ├── vitest.config.js │ └── lib │ │ ├── constants.js │ │ └── index.js ├── gasket-nextjs │ ├── .gitignore │ ├── .gitattributes │ ├── lib │ │ ├── server │ │ │ ├── index.js │ │ │ └── index.d.ts │ │ ├── layout │ │ │ ├── index.js │ │ │ └── index.d.ts │ │ ├── index.js │ │ ├── request │ │ │ └── index.d.ts │ │ ├── document │ │ │ └── internal.d.ts │ │ ├── use-gasket-data.js │ │ ├── gasket-data-provider.js │ │ └── gasket-data-script.js │ ├── tsconfig.json │ ├── .swcrc │ ├── vitest.config.js │ └── test │ │ ├── package.test.js │ │ ├── helpers.js │ │ └── gasket-data-provider.test.js ├── gasket-request │ ├── .gitignore │ ├── .gitattributes │ ├── tsconfig.json │ ├── .swcrc │ ├── lib │ │ ├── index.js │ │ └── keeper.js │ ├── vitest.config.js │ └── test │ │ └── index.test.js ├── gasket-utils │ ├── .gitignore │ ├── test │ │ └── fixtures │ │ │ ├── bad-file.js │ │ │ ├── config.local.js │ │ │ └── test-script.js │ ├── .gitattributes │ ├── tsconfig.json │ ├── lib │ │ ├── config.d.ts │ │ ├── get-package-latest-version.js │ │ └── index.js │ ├── .swcrc │ ├── README.md │ └── vitest.config.js ├── gasket-plugin-intl │ ├── .gitignore │ ├── .gitattributes │ ├── test │ │ ├── fixtures │ │ │ ├── gasket-root │ │ │ │ └── intl.js │ │ │ ├── locales │ │ │ │ ├── extra │ │ │ │ │ ├── en-US.json │ │ │ │ │ └── fr-FR.json │ │ │ │ ├── fr-FR │ │ │ │ │ └── grouped.json │ │ │ │ ├── en-US │ │ │ │ │ └── grouped.json │ │ │ │ ├── en-US.json │ │ │ │ └── fr-FR.json │ │ │ └── src │ │ │ │ └── locales │ │ │ │ ├── en-US.json │ │ │ │ └── fr-FR.json │ │ └── apm-transaction.test.js │ ├── tsconfig.json │ ├── vitest.config.js │ ├── generator │ │ └── locales │ │ │ ├── en-US.json │ │ │ └── fr-FR.json │ └── lib │ │ ├── utils │ │ └── configure-utils.js │ │ ├── public-gasket-data.js │ │ ├── service-worker-cache-key.js │ │ ├── build.js │ │ └── apm-transaction.js ├── gasket-plugin-vitest │ ├── .gitignore │ ├── lib │ │ └── index.d.ts │ ├── .swcrc │ ├── tsconfig.json │ ├── generator │ │ ├── api │ │ │ └── vitest.config.js │ │ └── react │ │ │ └── vitest.config.js │ └── vitest.config.js ├── gasket-preset-api │ ├── .gitignore │ ├── .gitattributes │ ├── generator │ │ └── server.js │ ├── .swcrc │ ├── lib │ │ ├── index.d.ts │ │ └── index.js │ └── vitest.config.js ├── gasket-preset-nextjs │ ├── .gitignore │ ├── .gitattributes │ ├── .swcrc │ ├── lib │ │ ├── index.d.ts │ │ ├── create.js │ │ ├── index.js │ │ └── preset-prompt.js │ ├── vitest.config.js │ ├── test │ │ └── create.test.js │ └── README.md ├── gasket-react-intl │ ├── .gitignore │ ├── .gitattributes │ ├── test │ │ ├── setup.js │ │ └── fixtures │ │ │ ├── locales │ │ │ ├── extra │ │ │ │ ├── en-US.json │ │ │ │ └── fr-FR.json │ │ │ ├── en-US.json │ │ │ └── fr-FR.json │ │ │ └── mock-manifest.json │ ├── tsconfig.json │ ├── .swcrc │ ├── jest.config.js │ ├── vitest.config.js │ └── lib │ │ ├── use-messages.js │ │ ├── utils.js │ │ ├── index.js │ │ └── use-locale-file.js ├── gasket-plugin-command │ ├── .gitignore │ ├── tsconfig.json │ ├── .swcrc │ ├── vitest.config.js │ └── lib │ │ ├── ready.js │ │ ├── commands.js │ │ ├── cli.js │ │ ├── create.js │ │ └── utils │ │ ├── logo.js │ │ └── create-option.js ├── gasket-plugin-happyfeet │ ├── .gitignore │ ├── .gitattributes │ ├── tsconfig.json │ ├── vitest.config.js │ └── lib │ │ ├── index.d.ts │ │ └── actions.js ├── gasket-plugin-https-proxy │ ├── .gitignore │ ├── tsconfig.json │ ├── .swcrc │ └── lib │ │ └── create.js ├── gasket-plugin-metadata │ ├── .gitignore │ ├── test │ │ └── __mocks__ │ │ │ ├── app-path │ │ │ └── package.json │ │ │ ├── mock │ │ │ └── index.js │ │ │ ├── fake-one │ │ │ └── index.js │ │ │ └── fake-two │ │ │ └── index.js │ ├── tsconfig.json │ ├── .swcrc │ └── lib │ │ ├── create.js │ │ └── webpack-config.js ├── create-gasket-app │ ├── test │ │ ├── fixtures │ │ │ ├── create │ │ │ │ └── .gitkeep │ │ │ ├── generator │ │ │ │ ├── .dot-file-a.md │ │ │ │ ├── other │ │ │ │ │ └── file-b.md.template │ │ │ │ ├── file-a.md │ │ │ │ ├── override │ │ │ │ │ └── file-a.md │ │ │ │ ├── missing │ │ │ │ │ └── file-a.md │ │ │ │ └── file-b.md │ │ │ ├── gasket.config.with-error.js │ │ │ ├── gasket.config.json │ │ │ ├── packages │ │ │ │ ├── ci-basic-plugin │ │ │ │ │ ├── generator │ │ │ │ │ │ ├── styles │ │ │ │ │ │ │ └── app.css │ │ │ │ │ │ ├── .gitattributes.template │ │ │ │ │ │ ├── .gitignore.template │ │ │ │ │ │ └── README.md │ │ │ │ │ └── package.json │ │ │ │ ├── ci-add-plugin │ │ │ │ │ ├── package.json │ │ │ │ │ └── index.js │ │ │ │ ├── ci-extra-plugin │ │ │ │ │ ├── package.json │ │ │ │ │ └── index.js │ │ │ │ └── ci-basic-preset │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ ├── gasket.config.js │ │ │ ├── gasket.config.local.json │ │ │ ├── with-plugins │ │ │ │ └── plugins │ │ │ │ │ └── custom-plugin.js │ │ │ ├── gasket.config.envs.js │ │ │ ├── gasket.config.dcs.js │ │ │ └── gasket.config.with-env.js │ │ ├── __mocks__ │ │ │ ├── @gasket │ │ │ │ ├── preset-some │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ │ ├── preset-bogus-not-found │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ │ ├── preset-bogus │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ │ ├── test-preset │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ │ ├── preset-npm-exports │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ │ ├── preset-all-i-ever-wanted │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ │ ├── preset-default-exports │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ │ ├── preset-double-default-exports │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ │ └── template-test │ │ │ │ │ ├── template │ │ │ │ │ ├── README.md │ │ │ │ │ ├── gasket.js │ │ │ │ │ └── package.json │ │ │ │ │ └── package.json │ │ │ └── gasket-preset-local │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ └── unit │ │ │ └── commands │ │ │ └── test-ci-config.json │ ├── tsconfig.json │ ├── vitest.config.js │ └── lib │ │ ├── utils │ │ ├── index.js │ │ ├── logo.js │ │ └── create-option.js │ │ └── scaffold │ │ ├── actions │ │ ├── install-modules.js │ │ ├── preset-config-hooks.js │ │ ├── link-modules.js │ │ ├── write-pkg.js │ │ └── preset-prompt-hooks.js │ │ └── utils.js ├── gasket-plugin-docs-graphs │ ├── test │ │ └── fixtures │ │ │ └── .gitkeep │ ├── tsconfig.json │ ├── vitest.config.js │ ├── lib │ │ └── index.d.ts │ └── README.md ├── gasket-plugin-docs │ ├── test │ │ └── fixtures │ │ │ └── files │ │ │ ├── file-a.md │ │ │ └── file-b.md │ ├── tsconfig.json │ ├── lib │ │ ├── utils │ │ │ └── constants.js │ │ ├── webpack-config.js │ │ ├── prompt.js │ │ ├── configure.js │ │ └── docs-setup.js │ └── vitest.config.js ├── gasket-plugin-dynamic-plugins │ ├── .gitignore │ ├── test │ │ └── __mocks__ │ │ │ ├── @gasket │ │ │ ├── plugin-one │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ └── plugin-two │ │ │ │ ├── index.js │ │ │ │ └── package.json │ │ │ └── plugin-custom.js │ ├── tsconfig.json │ ├── .swcrc │ ├── vitest.config.js │ └── lib │ │ ├── index.d.ts │ │ └── create.js ├── gasket-plugin-express │ ├── .gitignore │ ├── .gitattributes │ ├── tsconfig.json │ ├── .swcrc │ ├── test │ │ └── fixtures │ │ │ └── mock-api-route.js │ ├── vitest.config.js │ ├── generator │ │ ├── app │ │ │ └── plugins │ │ │ │ └── README.md │ │ ├── jest │ │ │ ├── jest.config.js │ │ │ └── test │ │ │ │ └── index.test.js │ │ └── vitest │ │ │ └── test │ │ │ ├── index.test.js │ │ │ └── index.test.ts │ └── lib │ │ └── actions.js ├── gasket-assets │ └── .gitattributes ├── gasket-redux │ ├── .gitattributes │ ├── jest.config.js │ ├── tsconfig.json │ ├── src │ │ └── index.js │ ├── test │ │ └── index.spec.js │ └── __mocks__ │ │ └── redux-logger.js ├── gasket-plugin-git │ ├── .gitattributes │ ├── tsconfig.json │ ├── generator │ │ ├── .gitattributes.template │ │ └── .gitignore.template │ └── lib │ │ ├── index.d.ts │ │ ├── create.js │ │ └── index.js ├── gasket-plugin-https │ ├── .gitattributes │ ├── tsconfig.json │ ├── vitest.config.js │ └── lib │ │ ├── configure.js │ │ └── create.js ├── gasket-plugin-jest │ ├── .gitattributes │ ├── tsconfig.json │ ├── lib │ │ └── index.d.ts │ ├── jest.config.js │ └── generator │ │ └── jest.config.js ├── gasket-plugin-logger │ ├── .gitattributes │ ├── tsconfig.json │ └── vitest.config.js ├── gasket-plugin-mocha │ ├── .gitattributes │ ├── tsconfig.json │ ├── lib │ │ ├── index.d.ts │ │ ├── node-loader-babel │ │ │ └── index.d.ts │ │ └── node-loader-styles │ │ │ └── index.d.ts │ └── generator │ │ ├── react-app │ │ └── test │ │ │ ├── .babelrc │ │ │ ├── mocha-watch-cleanup-after-each.js │ │ │ └── register-loader.js │ │ └── api-app │ │ └── typescript │ │ └── test │ │ ├── register-loader.js │ │ └── mocha-setup.js ├── gasket-plugin-nextjs │ ├── .gitattributes │ ├── test │ │ └── mock-repo │ │ │ ├── .next │ │ │ ├── BUILD_ID │ │ │ └── build-manifest.json │ │ │ └── pages │ │ │ └── index.js │ ├── tsconfig.json │ ├── generator │ │ ├── next │ │ │ ├── next.config.js │ │ │ ├── typescript │ │ │ │ ├── next.config.js │ │ │ │ └── next-env.d.ts │ │ │ └── server.js │ │ ├── cypress │ │ │ └── test │ │ │ │ └── e2e │ │ │ │ └── index.cy.js │ │ ├── app │ │ │ ├── page-router │ │ │ │ ├── pages │ │ │ │ │ ├── _document.js │ │ │ │ │ └── _document.ts │ │ │ │ └── components │ │ │ │ │ ├── head.jsx │ │ │ │ │ └── head.tsx │ │ │ └── app-router │ │ │ │ └── app │ │ │ │ ├── layout.js │ │ │ │ └── layout.tsx │ │ ├── sitemap │ │ │ └── next-sitemap.config.js │ │ ├── vitest │ │ │ └── app-router │ │ │ │ └── test │ │ │ │ ├── index.test.jsx │ │ │ │ └── index.test.tsx │ │ ├── jest │ │ │ └── app-router │ │ │ │ └── test │ │ │ │ ├── index.spec.js │ │ │ │ └── index.spec.tsx │ │ └── mocha │ │ │ └── app-router │ │ │ └── test │ │ │ └── app │ │ │ ├── page.test.js │ │ │ └── page.test.tsx │ ├── scripts │ │ └── fix-cjs-paths.js │ ├── vitest.config.js │ ├── lib │ │ └── configure.js │ └── docs │ │ └── docker-deployment.md ├── gasket-plugin-redux │ ├── .gitattributes │ ├── tsconfig.json │ ├── jest.config.js │ ├── __mocks__ │ │ └── custom-make-store.js │ ├── generator │ │ └── redux │ │ │ └── store.js │ └── lib │ │ └── webpack-config.js ├── gasket-plugin-analyze │ ├── .gitattributes │ ├── tsconfig.json │ ├── vitest.config.js │ └── lib │ │ ├── default-config.js │ │ └── index.d.ts ├── gasket-plugin-cypress │ ├── .gitattributes │ ├── tsconfig.json │ ├── lib │ │ └── index.d.ts │ ├── jest.config.js │ └── generator │ │ └── cypress.config.js ├── gasket-plugin-elastic-apm │ ├── .gitattributes │ ├── tsconfig.json │ ├── vitest.config.js │ ├── generator │ │ └── setup.js │ └── lib │ │ └── actions.js ├── gasket-plugin-fastify │ ├── .gitattributes │ ├── tsconfig.json │ ├── generator │ │ ├── app │ │ │ └── plugins │ │ │ │ └── README.md │ │ ├── jest │ │ │ ├── jest.config.js │ │ │ └── test │ │ │ │ └── index.test.js │ │ └── vitest │ │ │ └── test │ │ │ ├── index.test.js │ │ │ └── index.test.ts │ ├── vitest.config.js │ └── lib │ │ └── actions.js ├── gasket-plugin-manifest │ ├── .gitattributes │ ├── tsconfig.json │ └── lib │ │ ├── base-config.js │ │ ├── internal.d.ts │ │ └── serve.js ├── gasket-plugin-swagger │ ├── .gitattributes │ ├── tsconfig.json │ ├── vitest.config.js │ └── lib │ │ ├── prompt.js │ │ └── post-create.js ├── gasket-plugin-webpack │ ├── .gitattributes │ ├── tsconfig.json │ └── vitest.config.js ├── gasket-plugin-winston │ ├── .gitattributes │ ├── tsconfig.json │ └── vitest.config.js ├── gasket-plugin-workbox │ ├── .gitattributes │ ├── tsconfig.json │ ├── __mocks__ │ │ └── serve-static.js │ ├── jest.config.js │ ├── lib │ │ ├── build.js │ │ ├── express.js │ │ └── fastify.js │ └── test │ │ └── build.spec.js ├── gasket-plugin-service-worker │ ├── .gitattributes │ ├── __mocks__ │ │ ├── mkdirp.js │ │ ├── uglify-js.js │ │ └── lru-cache.js │ ├── tsconfig.json │ ├── jest.config.js │ └── lib │ │ ├── actions.js │ │ ├── utils │ │ └── sw-register.template.js │ │ ├── express.js │ │ └── fastify.js ├── gasket-template-api-express │ ├── template │ │ ├── .gitignore │ │ ├── .npmrc │ │ ├── vitest.config.js │ │ ├── server.ts │ │ ├── plugins │ │ │ └── README.md │ │ ├── swagger.json │ │ └── test │ │ │ └── index.test.ts │ ├── vitest.config.js │ └── CHANGELOG.md ├── gasket-template-api-fastify │ ├── template │ │ ├── .gitignore │ │ ├── .npmrc │ │ ├── vitest.config.js │ │ ├── server.ts │ │ ├── plugins │ │ │ └── README.md │ │ ├── swagger.json │ │ └── test │ │ │ └── index.test.ts │ ├── vitest.config.js │ └── CHANGELOG.md ├── gasket-fetch │ ├── tsconfig.json │ ├── jest.config.js │ ├── lib │ │ ├── index.d.ts │ │ └── node.js │ └── test │ │ ├── server.spec.js │ │ └── test-server.js ├── gasket-template-nextjs-app │ ├── template │ │ ├── .npmrc │ │ ├── .gitignore │ │ ├── next.config.js │ │ ├── server.ts │ │ ├── locales │ │ │ ├── en-US.json │ │ │ └── fr-FR.json │ │ ├── vitest.config.js │ │ ├── next-env.d.ts │ │ ├── test │ │ │ └── index.test.tsx │ │ ├── app │ │ │ └── layout.tsx │ │ └── intl.ts │ ├── vitest.config.js │ └── CHANGELOG.md ├── gasket-plugin-data │ ├── tsconfig.json │ ├── test │ │ └── .eslintrc │ ├── generator │ │ ├── gasket-data.js │ │ └── gasket-data.ts │ ├── vitest.config.js │ └── lib │ │ ├── init-redux-state.js │ │ └── index.js ├── gasket-plugin-lint │ ├── tsconfig.json │ └── lib │ │ └── index.js ├── gasket-template-nextjs-express │ ├── template │ │ ├── .npmrc │ │ ├── .gitignore │ │ ├── next.config.js │ │ ├── server.ts │ │ ├── locales │ │ │ ├── en-US.json │ │ │ └── fr-FR.json │ │ ├── pages │ │ │ └── _document.ts │ │ ├── vitest.config.js │ │ ├── next-env.d.ts │ │ ├── components │ │ │ └── head.tsx │ │ └── intl.ts │ ├── vitest.config.js │ └── CHANGELOG.md ├── gasket-template-nextjs-pages │ ├── template │ │ ├── .npmrc │ │ ├── .gitignore │ │ ├── next.config.js │ │ ├── server.ts │ │ ├── locales │ │ │ ├── en-US.json │ │ │ └── fr-FR.json │ │ ├── pages │ │ │ └── _document.ts │ │ ├── vitest.config.js │ │ ├── next-env.d.ts │ │ ├── components │ │ │ └── head.tsx │ │ └── intl.ts │ ├── vitest.config.js │ └── CHANGELOG.md ├── gasket-plugin-docusaurus │ ├── tsconfig.json │ ├── vitest.config.js │ ├── lib │ │ ├── webpack-config.js │ │ ├── prompt.js │ │ └── index.d.ts │ └── test │ │ └── fixtures │ │ └── docusaurus.config.js ├── gasket-plugin-middleware │ ├── tsconfig.json │ └── vitest.config.js ├── gasket-plugin-morgan │ ├── tsconfig.json │ ├── vitest.config.js │ └── lib │ │ ├── index.d.ts │ │ └── middleware.js ├── gasket-plugin-typescript │ ├── tsconfig.json │ ├── generator │ │ └── shared │ │ │ └── server.ts │ ├── lib │ │ ├── index.js │ │ ├── index.d.ts │ │ └── prompt.js │ └── test │ │ └── prompt.test.js ├── gasket-typescript-tests │ ├── README.md │ ├── test │ │ ├── __mocks__ │ │ │ ├── docusaurus-core-package.json │ │ │ ├── docusaurus-preset-classic.js │ │ │ └── docusaurus-core.js │ │ ├── plugin-typescript.spec.ts │ │ ├── plugin-docusaurus.spec.ts │ │ └── plugin-analyze.spec.ts │ ├── lifecycles │ │ └── intl-locale.js │ ├── tsconfig.json │ └── vitest.config.js └── gasket-cjs │ ├── vitest.config.js │ ├── tsconfig.json │ └── CHANGELOG.md ├── .gitattributes ├── pnpm-workspace.yaml ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE.md ├── ISSUE_TEMPLATE │ └── documentation.md └── PULL_REQUEST_TEMPLATE.md ├── docs └── images │ └── redux-with-gasket-data.png ├── .npmrc ├── scripts └── generate-docs-index │ ├── README.md │ └── utils │ ├── wait.js │ ├── format-filename.js │ └── create-dir.js ├── ROADMAP.md ├── renovate.json ├── .changeset └── config.json ├── RELEASES.md └── tsconfig.base.json /.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.nvmrc: -------------------------------------------------------------------------------- 1 | 22 2 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | gasket.dev -------------------------------------------------------------------------------- /site/static/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/gasket-core/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/gasket-data/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/gasket-intl/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/gasket-request/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/gasket-utils/.gitignore: -------------------------------------------------------------------------------- 1 | .cache 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/.gitignore: -------------------------------------------------------------------------------- 1 | cjs/ 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-vitest/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/gasket-preset-api/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/gasket-preset-nextjs/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-command/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-happyfeet/.gitignore: -------------------------------------------------------------------------------- 1 | cjs/ 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-https-proxy/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-metadata/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/create/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs-graphs/test/fixtures/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs/test/fixtures/files/file-a.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs/test/fixtures/files/file-b.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/gasket-plugin-dynamic-plugins/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-express/.gitignore: -------------------------------------------------------------------------------- 1 | cjs 2 | 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | *.svg binary 3 | -------------------------------------------------------------------------------- /packages/gasket-utils/test/fixtures/bad-file.js: -------------------------------------------------------------------------------- 1 | terrible 2 | -------------------------------------------------------------------------------- /packages/gasket-assets/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-core/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-redux/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-request/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-utils/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-some/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/gasket-plugin-git/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-https/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-jest/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-logger/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-mocha/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-redux/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-preset-api/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-preset-nextjs/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-analyze/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-cypress/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-elastic-apm/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-express/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-fastify/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-happyfeet/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-manifest/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-metadata/test/__mocks__/app-path/package.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/test/mock-repo/.next/BUILD_ID: -------------------------------------------------------------------------------- 1 | test-build-id 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-swagger/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-webpack/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-winston/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-workbox/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-bogus-not-found/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/generator/.dot-file-a.md: -------------------------------------------------------------------------------- 1 | # Hidden file 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-dynamic-plugins/test/__mocks__/@gasket/plugin-one/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/gasket-plugin-dynamic-plugins/test/__mocks__/@gasket/plugin-two/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/gasket-plugin-service-worker/.gitattributes: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /packages/gasket-template-api-express/template/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | -------------------------------------------------------------------------------- /packages/gasket-template-api-fastify/template/.gitignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/lib/server/index.js: -------------------------------------------------------------------------------- 1 | export { request } from './request.js'; 2 | -------------------------------------------------------------------------------- /pnpm-workspace.yaml: -------------------------------------------------------------------------------- 1 | packages: 2 | - packages/* 3 | - scripts/generate-docs-index 4 | -------------------------------------------------------------------------------- /packages/gasket-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-data/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-fetch/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/test/mock-repo/.next/build-manifest.json: -------------------------------------------------------------------------------- 1 | {"version": 3} 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-service-worker/__mocks__/mkdirp.js: -------------------------------------------------------------------------------- 1 | module.exports = jest.fn(); 2 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/test/setup.js: -------------------------------------------------------------------------------- 1 | import Intl from 'intl'; 2 | global.Intl = Intl; 3 | -------------------------------------------------------------------------------- /packages/gasket-request/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-template-api-express/template/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | -------------------------------------------------------------------------------- /packages/gasket-template-api-fastify/template/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/template/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | -------------------------------------------------------------------------------- /packages/gasket-utils/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/gasket.config.with-error.js: -------------------------------------------------------------------------------- 1 | throw new Error('Boom!'); 2 | -------------------------------------------------------------------------------- /packages/create-gasket-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-data/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-git/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-https/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/test/fixtures/gasket-root/intl.js: -------------------------------------------------------------------------------- 1 | export default { default: {} }; 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-jest/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-lint/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-mocha/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-redux/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/template/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/template/.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/gasket.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "someOther": "config" 3 | } 4 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/generator/other/file-b.md.template: -------------------------------------------------------------------------------- 1 | # File B dot Template 2 | -------------------------------------------------------------------------------- /packages/gasket-intl/test/fixtures/locales/extra/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_extra": "Extra" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/lib/layout/index.js: -------------------------------------------------------------------------------- 1 | export { withGasketData } from './with-gasket-data.js'; 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-analyze/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-command/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-cypress/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docusaurus/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-express/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-fastify/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-happyfeet/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-manifest/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-metadata/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-middleware/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-morgan/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-swagger/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-typescript/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-webpack/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-winston/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-workbox/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/template/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .next 4 | .docs 5 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/template/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .next 4 | .docs 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs-graphs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-elastic-apm/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-https-proxy/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/test/fixtures/locales/extra/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_extra": "Extra" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-service-worker/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/test/fixtures/locales/extra/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_extra": "Extra" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/template/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist 3 | .next 4 | .docs 5 | -------------------------------------------------------------------------------- /packages/gasket-utils/test/fixtures/config.local.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | localsOnly: true 3 | }; 4 | -------------------------------------------------------------------------------- /site/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/static/img/favicon.ico -------------------------------------------------------------------------------- /packages/gasket-intl/test/fixtures/locales/extra/fr-FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_extra": "Supplémentaire" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/test/fixtures/locales/fr-FR/grouped.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_grouped": "groupé" 3 | } 4 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/generator/file-a.md: -------------------------------------------------------------------------------- 1 | # File A 2 | 3 | The app name is {{{ appName }}} 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs/lib/utils/constants.js: -------------------------------------------------------------------------------- 1 | export const DEFAULT_CONFIG = { 2 | outputDir: '.docs' 3 | }; 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/test/fixtures/locales/en-US/grouped.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_grouped": "grouped" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/test/fixtures/locales/extra/fr-FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_extra": "Supplémentaire" 3 | } 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-redux/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | collectCoverageFrom: ['lib/**/*.js'] 3 | }; 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-workbox/__mocks__/serve-static.js: -------------------------------------------------------------------------------- 1 | module.exports = jest.fn().mockReturnValue(() => {}); 2 | -------------------------------------------------------------------------------- /packages/gasket-preset-api/generator/server.js: -------------------------------------------------------------------------------- 1 | import gasket from './gasket.js'; 2 | gasket.actions.startServer(); 3 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/test/fixtures/locales/extra/fr-FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_extra": "Supplémentaire" 3 | } 4 | -------------------------------------------------------------------------------- /site/static/img/socialpreview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/static/img/socialpreview.png -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | ### Default owners ### 2 | 3 | * @godaddy/gasket-admins 4 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/packages/ci-basic-plugin/generator/styles/app.css: -------------------------------------------------------------------------------- 1 | /* Example nested file */ 2 | -------------------------------------------------------------------------------- /packages/gasket-intl/test/helpers.js: -------------------------------------------------------------------------------- 1 | export const pause = (ms = 2) => new Promise(resolve => setTimeout(resolve, ms)); 2 | -------------------------------------------------------------------------------- /packages/gasket-plugin-redux/__mocks__/custom-make-store.js: -------------------------------------------------------------------------------- 1 | module.exports = jest.fn(() => { 2 | return {}; 3 | }); 4 | -------------------------------------------------------------------------------- /packages/gasket-utils/lib/config.d.ts: -------------------------------------------------------------------------------- 1 | import { applyConfigOverrides } from './'; 2 | export { applyConfigOverrides }; 3 | -------------------------------------------------------------------------------- /site/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /site/static/img/authors/kquerna.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/static/img/authors/kquerna.png -------------------------------------------------------------------------------- /site/static/img/authors/mmason.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/static/img/authors/mmason.jpeg -------------------------------------------------------------------------------- /docs/images/redux-with-gasket-data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/docs/images/redux-with-gasket-data.png -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/gasket.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | some: 'config', 3 | plugins: {} 4 | }; 5 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/packages/ci-basic-plugin/generator/.gitattributes.template: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | -------------------------------------------------------------------------------- /site/static/img/authors/kawikabader.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/static/img/authors/kawikabader.jpg -------------------------------------------------------------------------------- /site/static/img/authors/kinetifex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/static/img/authors/kinetifex.png -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/generator/override/file-a.md: -------------------------------------------------------------------------------- 1 | # File A - Override 2 | 3 | This is an alternative file 4 | -------------------------------------------------------------------------------- /packages/gasket-intl/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": [ 4 | "lib" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-git/generator/.gitattributes.template: -------------------------------------------------------------------------------- 1 | package-lock.json binary 2 | yarn.lock binary 3 | pnpm-lock.yaml binary -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/cover.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/cover.jpg -------------------------------------------------------------------------------- /packages/gasket-core/docs/trace-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/packages/gasket-core/docs/trace-example.png -------------------------------------------------------------------------------- /packages/gasket-intl/test/fixtures/locales/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Hello!", 3 | "gasket_learn": "Learn Gasket" 4 | } 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-data/test/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": false, 3 | "rules": { 4 | "max-nested-callbacks": [0] 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/finished.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/finished.png -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/packager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/packager.png -------------------------------------------------------------------------------- /site/src/components/homepage/index.js: -------------------------------------------------------------------------------- 1 | export { HomepageHeader } from './header'; 2 | export { HomepageSections } from './sections'; 3 | -------------------------------------------------------------------------------- /packages/gasket-core/jest.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | testEnvironment: 'node', 3 | setupFilesAfterEnv: ['./test/setup.js'] 4 | }; 5 | -------------------------------------------------------------------------------- /packages/gasket-core/lib/index.js: -------------------------------------------------------------------------------- 1 | import { Gasket, makeGasket } from './gasket.js'; 2 | 3 | export { 4 | Gasket, 5 | makeGasket 6 | }; 7 | -------------------------------------------------------------------------------- /packages/gasket-intl/test/fixtures/locales/fr-FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Bonjour!", 3 | "gasket_learn": "Apprendre Gasket" 4 | } 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/test/fixtures/locales/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Hello!", 3 | "gasket_learn": "Learn Gasket" 4 | } 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-logger/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": [ 4 | "lib" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/test/fixtures/locales/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Hello!", 3 | "gasket_learn": "Learn Gasket" 4 | } 5 | -------------------------------------------------------------------------------- /packages/gasket-redux/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | collectCoverageFrom: ['src/**/*.js'], 3 | testEnvironment: 'jsdom' 4 | }; 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/test/fixtures/src/locales/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Hello!", 3 | "gasket_learn": "Learn Gasket" 4 | } 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/next/next.config.js: -------------------------------------------------------------------------------- 1 | import gasket from './gasket.js'; 2 | export default gasket.actions.getNextConfig(); 3 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/test/fixtures/locales/fr-FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Bonjour!", 3 | "gasket_learn": "Apprendre Gasket" 4 | } 5 | -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/empty-swagger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/empty-swagger.png -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/gasket-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/gasket-config.png -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/lint-config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/lint-config.png -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/package-json.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/package-json.png -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-bogus/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: '@gasket/preset-bogus', 3 | hooks: {} 4 | }; 5 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/test-preset/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: '@gasket/test-preset', 3 | hooks: {} 4 | }; 5 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/gasket-preset-local/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: '@gasket/test-preset', 3 | hooks: {} 4 | }; 5 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/gasket.config.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "anotherService": { 3 | "url": "http://localhost:6235/" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/generator/missing/file-a.md: -------------------------------------------------------------------------------- 1 | # File A - Missing 2 | 3 | The context does not have {{{ jspretty missing }}} 4 | -------------------------------------------------------------------------------- /packages/gasket-data/lib/index.js: -------------------------------------------------------------------------------- 1 | export { gasketData } from './gasket-data.js'; 2 | export { resolveGasketData } from './resolve-gasket-data.js'; 3 | -------------------------------------------------------------------------------- /packages/gasket-plugin-dynamic-plugins/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "include": [ 4 | "lib" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/test/fixtures/locales/fr-FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Bonjour!", 3 | "gasket_learn": "Apprendre Gasket" 4 | } 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/test/fixtures/src/locales/fr-FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Bonjour!", 3 | "gasket_learn": "Apprendre Gasket" 4 | } 5 | -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/app-description.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/app-description.png -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/orders-response.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/orders-response.png -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/swagger-default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/swagger-default.png -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/swagger-orders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/swagger-orders.png -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/unit-test-suite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/unit-test-suite.png -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/updated-swagger.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/updated-swagger.png -------------------------------------------------------------------------------- /packages/gasket-plugin-mocha/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '@gasket/core'; 2 | 3 | declare const plugin: Plugin; 4 | export default plugin; 5 | -------------------------------------------------------------------------------- /packages/gasket-typescript-tests/README.md: -------------------------------------------------------------------------------- 1 | # `@gasket/typescript-tests` 2 | 3 | Not an actual package but hosts tests for validating TypeScripty things. 4 | -------------------------------------------------------------------------------- /packages/gasket-typescript-tests/test/__mocks__/docusaurus-core-package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@docusaurus/core", 3 | "version": "0.0.0-mock" 4 | } 5 | 6 | -------------------------------------------------------------------------------- /site/blog/2020-12-10-api-preset/folder-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/godaddy/gasket/main/site/blog/2020-12-10-api-preset/folder-structure.png -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | // TODO: Make this link work 2 | 👉 Please follow one of these issue templates https://github.com/godaddy/gasket/issues/new/choose 3 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-npm-exports/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: '@gasket/preset-npm-exports', 3 | hooks: {} 4 | }; 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-jest/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '@gasket/core'; 2 | 3 | declare const plugin: Plugin; 4 | 5 | export default plugin; 6 | -------------------------------------------------------------------------------- /packages/gasket-plugin-vitest/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '@gasket/core'; 2 | 3 | declare const plugin: Plugin; 4 | 5 | export default plugin; 6 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/generator/file-b.md: -------------------------------------------------------------------------------- 1 | # File B 2 | 3 | These are the globsSets used: 4 | ```json 5 | {{{ jspretty files.globSets }}} 6 | ``` 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-cypress/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '@gasket/core'; 2 | 3 | declare const plugin: Plugin; 4 | 5 | export default plugin; 6 | -------------------------------------------------------------------------------- /packages/gasket-plugin-git/generator/.gitignore.template: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | {{{gitignore.content}}} 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-metadata/test/__mocks__/mock/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'mock', 3 | version: '1.0.0', 4 | description: 'Mock plugin' 5 | }; 6 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/test/mock-repo/pages/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function Page() { 2 | return { type: 'div', props: {}, children: 'Test' }; 3 | }; 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-workbox/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | collectCoverageFrom: [ 3 | 'lib/**/*.js', 4 | '!lib/**/*template.js' 5 | ] 6 | }; 7 | -------------------------------------------------------------------------------- /packages/gasket-typescript-tests/test/__mocks__/docusaurus-preset-classic.js: -------------------------------------------------------------------------------- 1 | // Mock for @docusaurus/preset-classic in test environment 2 | export default {}; 3 | 4 | -------------------------------------------------------------------------------- /packages/gasket-plugin-metadata/test/__mocks__/fake-one/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'fake-one', 3 | version: '1.0.0', 4 | description: 'Fake One' 5 | }; 6 | -------------------------------------------------------------------------------- /packages/gasket-plugin-metadata/test/__mocks__/fake-two/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'fake-two', 3 | version: '1.0.0', 4 | description: 'Fake Two' 5 | }; 6 | -------------------------------------------------------------------------------- /packages/gasket-plugin-service-worker/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | collectCoverageFrom: [ 3 | 'lib/**/*.js', 4 | '!lib/**/*template.js' 5 | ] 6 | }; 7 | -------------------------------------------------------------------------------- /packages/gasket-utils/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-all-i-ever-wanted/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: '@gasket/preset-all-i-ever-wanted', 3 | hooks: {} 4 | }; 5 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/packages/ci-add-plugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/plugin-ci-add", 3 | "version": "0.0.1", 4 | "main": "index.js" 5 | } 6 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | registry=https://registry.npmjs.org/ 2 | package-manager=pnpm@latest 3 | strict-peer-dependencies=true 4 | link-workspace-packages=true 5 | prefer-workspace-packages=true 6 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/packages/ci-basic-plugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/plugin-ci-basic", 3 | "version": "0.0.1", 4 | "main": "index.js" 5 | } 6 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/packages/ci-extra-plugin/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/plugin-ci-extra", 3 | "version": "0.0.1", 4 | "main": "index.js" 5 | } 6 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/lib/index.js: -------------------------------------------------------------------------------- 1 | export * from './use-gasket-data.js'; 2 | export * from './with-gasket-data-provider.js'; 3 | export * from './with-locale-initial-props.js'; 4 | -------------------------------------------------------------------------------- /packages/gasket-core/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-data/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-intl/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-plugin-dynamic-plugins/test/__mocks__/@gasket/plugin-one/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/plugin-one", 3 | "version": "1.0.0", 4 | "main": "index.js" 5 | } 6 | -------------------------------------------------------------------------------- /packages/gasket-plugin-dynamic-plugins/test/__mocks__/@gasket/plugin-two/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/plugin-two", 3 | "version": "1.0.0", 4 | "main": "index.js" 5 | } 6 | -------------------------------------------------------------------------------- /packages/gasket-redux/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "exclude": [ 4 | "lib" 5 | ], 6 | "include": [ 7 | "src" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-request/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-plugin-data/generator/gasket-data.js: -------------------------------------------------------------------------------- 1 | export default { 2 | examplePrivateSetting: 'privateValue', 3 | public: { 4 | examplePublicSetting: 'publicValue' 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-data/generator/gasket-data.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | examplePrivateSetting: 'privateValue', 3 | public: { 4 | examplePublicSetting: 'publicValue' 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-vitest/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-plugin-vitest/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "types": [ 5 | "@types/node", 6 | ] 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/gasket-preset-api/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-preset-nextjs/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/jest.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | collectCoverageFrom: ['src/**/*.js'], 3 | setupFiles: ['/test/setup.js'], 4 | testEnvironment: 'jsdom' 5 | }; 6 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/template/next.config.js: -------------------------------------------------------------------------------- 1 | import 'tsx'; 2 | 3 | const gasket = (await import('./gasket.ts')).default; 4 | export default gasket.actions.getNextConfig(); 5 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/template/next.config.js: -------------------------------------------------------------------------------- 1 | import 'tsx'; 2 | 3 | const gasket = (await import('./gasket.ts')).default; 4 | export default gasket.actions.getNextConfig(); 5 | -------------------------------------------------------------------------------- /scripts/generate-docs-index/README.md: -------------------------------------------------------------------------------- 1 | # generate-docs 2 | 3 | Simple app which loads all the plugins, presets, and packages in the mono repo 4 | from which to generate the overview readme. 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-command/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-plugin-dynamic-plugins/test/__mocks__/plugin-custom.js: -------------------------------------------------------------------------------- 1 | export default { 2 | name: 'plugin-custom', 3 | hooks: { 4 | configure: (gasket, config) => config 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-express/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-plugin-https-proxy/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-plugin-metadata/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/template/next.config.js: -------------------------------------------------------------------------------- 1 | import 'tsx'; 2 | 3 | const gasket = (await import('./gasket.ts')).default; 4 | export default gasket.actions.getNextConfig(); 5 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-default-exports/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | default: { 3 | name: '@gasket/preset-default-export', 4 | hooks: {} 5 | } 6 | }; 7 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/packages/ci-basic-preset/index.js: -------------------------------------------------------------------------------- 1 | module.exports = require('@gasket/resolve/plugins')({ 2 | dirname: __dirname, 3 | resolve: name => require(name) 4 | }); 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-dynamic-plugins/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2016" 4 | }, 5 | "module": { 6 | "type": "commonjs" 7 | }, 8 | "exclude": [".*\\.ts$"] 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/next/typescript/next.config.js: -------------------------------------------------------------------------------- 1 | import 'tsx'; 2 | 3 | const gasket = (await import('./gasket.ts')).default; 4 | export default gasket.actions.getNextConfig(); 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-express/test/fixtures/mock-api-route.js: -------------------------------------------------------------------------------- 1 | module.exports = app => { 2 | app.use('/some/route', (req, res, next) => { 3 | next(new Error('Not implemented')); 4 | }); 5 | }; 6 | -------------------------------------------------------------------------------- /packages/gasket-plugin-vitest/generator/api/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true 6 | } 7 | }); 8 | 9 | -------------------------------------------------------------------------------- /packages/gasket-template-api-express/template/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true 6 | } 7 | }); 8 | 9 | -------------------------------------------------------------------------------- /packages/gasket-template-api-fastify/template/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true 6 | } 7 | }); 8 | 9 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/with-plugins/plugins/custom-plugin.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | hooks: { 3 | start() { 4 | console.log('Custom plugin start hook!'); 5 | } 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /packages/gasket-plugin-mocha/generator/react-app/test/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | {{#if typescript}} 4 | "@babel/preset-typescript", 5 | {{/if}} 6 | "@babel/preset-react" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /ROADMAP.md: -------------------------------------------------------------------------------- 1 | # Roadmap 2 | 3 | This document describes the broad, long-term direction of Gasket. Items on the 4 | roadmap should be broader than Github issues and describe significant improvements 5 | to Gasket. 6 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | environment: 'node', 6 | globals: true 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | environment: 'node', 6 | globals: true 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/next/server.js: -------------------------------------------------------------------------------- 1 | import gasket from './gasket.js'; 2 | {{#if nextDevProxy}} 3 | gasket.actions.startProxyServer(); 4 | {{else}} 5 | gasket.actions.startServer(); 6 | {{/if}} 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-swagger/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | environment: 'node', 6 | globals: true 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/gasket-plugin-winston/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | environment: 'node', 6 | globals: true 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-some/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/preset-some", 3 | "version": "1.0.0", 4 | "description": "A Gasket preset for some", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/test-preset/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/test-preset", 3 | "version": "1.0.0", 4 | "description": "Test preset for Gasket", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs-graphs/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | environment: 'node', 6 | globals: true 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/gasket-plugin-mocha/generator/api-app/typescript/test/register-loader.js: -------------------------------------------------------------------------------- 1 | import { register } from 'module'; 2 | import { pathToFileURL } from 'url'; 3 | 4 | register('ts-node/esm', pathToFileURL('./test')); 5 | -------------------------------------------------------------------------------- /packages/gasket-preset-api/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import '@gasket/plugin-express'; 2 | import '@gasket/plugin-fastify'; 3 | import '@gasket/plugin-https'; 4 | import '@gasket/plugin-lint'; 5 | import '@gasket/plugin-winston'; 6 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-bogus/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/preset-bogus", 3 | "version": "1.0.0", 4 | "description": "A bogus preset for testing", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/unit/commands/test-ci-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "appDescription": "A basic gasket app", 3 | "packageManager": "npm", 4 | "unitTestSuite": "jest", 5 | "integrationTestSuite": "cypress" 6 | } 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-jest/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | collectCoverageFrom: ['index.js'], 3 | testEnvironmentOptions: { 4 | url: 'http://localhost/' 5 | }, 6 | testMatch: ['**/test/*.test.js'] 7 | }; 8 | -------------------------------------------------------------------------------- /packages/gasket-preset-nextjs/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import '@gasket/plugin-express'; 2 | import '@gasket/plugin-https'; 3 | import '@gasket/plugin-nextjs'; 4 | import '@gasket/plugin-webpack'; 5 | import '@gasket/plugin-winston'; 6 | -------------------------------------------------------------------------------- /packages/gasket-redux/src/index.js: -------------------------------------------------------------------------------- 1 | import configureMakeStore from './configure-make-store'; 2 | import getOrCreateStore from './get-or-create-store'; 3 | 4 | export { 5 | configureMakeStore, 6 | getOrCreateStore 7 | }; 8 | -------------------------------------------------------------------------------- /packages/gasket-plugin-cypress/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | collectCoverageFrom: ['index.js'], 3 | testEnvironmentOptions: { 4 | url: 'http://localhost/' 5 | }, 6 | testMatch: ['**/test/*.test.js'] 7 | }; 8 | -------------------------------------------------------------------------------- /packages/gasket-plugin-mocha/generator/react-app/test/mocha-watch-cleanup-after-each.js: -------------------------------------------------------------------------------- 1 | import { cleanup } from '@testing-library/react'; 2 | 3 | export const mochaHooks = { 4 | afterEach() { 5 | cleanup(); 6 | } 7 | }; 8 | -------------------------------------------------------------------------------- /packages/gasket-template-api-express/template/server.ts: -------------------------------------------------------------------------------- 1 | // Imports use the .js to support a type module application 2 | // See README for more information 3 | import gasket from './gasket.js'; 4 | gasket.actions.startServer(); 5 | -------------------------------------------------------------------------------- /packages/gasket-template-api-fastify/template/server.ts: -------------------------------------------------------------------------------- 1 | // Imports use the .js to support a type module application 2 | // See README for more information 3 | import gasket from './gasket.js'; 4 | gasket.actions.startServer(); 5 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/template/server.ts: -------------------------------------------------------------------------------- 1 | // Imports use the .js to support a type module application 2 | // See README for more information 3 | import gasket from './gasket.js'; 4 | gasket.actions.startServer(); 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/generator/locales/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Welcome to Gasket!", 3 | "gasket_learn": "Learn Gasket", 4 | "gasket_edit_page": "To get started, edit pages/index.js and save to reload." 5 | } 6 | -------------------------------------------------------------------------------- /packages/gasket-request/lib/index.js: -------------------------------------------------------------------------------- 1 | export { GasketRequest, makeGasketRequest } from './request.js'; 2 | export { withGasketRequest, withGasketRequestCache } from './wrappers.js'; 3 | export { WeakPromiseKeeper } from './keeper.js'; 4 | -------------------------------------------------------------------------------- /packages/gasket-request/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/template/server.ts: -------------------------------------------------------------------------------- 1 | // Imports use the .js to support a type module application 2 | // See README for more information 3 | import gasket from './gasket.js'; 4 | gasket.actions.startProxyServer(); 5 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/template/server.ts: -------------------------------------------------------------------------------- 1 | // Imports use the .js to support a type module application 2 | // See README for more information 3 | import gasket from './gasket.js'; 4 | gasket.actions.startProxyServer(); 5 | -------------------------------------------------------------------------------- /packages/gasket-typescript-tests/test/__mocks__/docusaurus-core.js: -------------------------------------------------------------------------------- 1 | // Mock for @docusaurus/core in test environment 2 | export function start() { 3 | throw new Error('Docusaurus is not available in test environment'); 4 | } 5 | 6 | -------------------------------------------------------------------------------- /packages/gasket-utils/README.md: -------------------------------------------------------------------------------- 1 | # @gasket/utils 2 | 3 | Reusable utilities for Gasket internals 4 | 5 | ## Installation 6 | 7 | ```bash 8 | npm i @gasket/utils 9 | ``` 10 | 11 | ## License 12 | 13 | [MIT](./LICENSE.md) 14 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base", 5 | ":preserveSemverRanges" 6 | ], 7 | "labels": [ 8 | "dependencies" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/gasket-preset-local/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "gasket-preset-local", 3 | "version": "1.2.3", 4 | "main": "index.js", 5 | "dependencies": { 6 | "bogus-plugin": "^4.5.6" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/gasket-plugin-analyze/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/gasket-plugin-command/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/gasket-plugin-logger/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/gasket-plugin-webpack/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/template/locales/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Welcome to Gasket!", 3 | "gasket_learn": "Learn Gasket", 4 | "gasket_edit_page": "To get started, edit pages/index.js and save to reload." 5 | } 6 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-default-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/preset-default-exports", 3 | "version": "1.0.0", 4 | "description": "A bogus preset for testing", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-double-default-exports/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | default: { 3 | default: { 4 | name: '@gasket/preset-double-default-export', 5 | hooks: {} 6 | } 7 | } 8 | }; 9 | -------------------------------------------------------------------------------- /packages/gasket-redux/test/index.spec.js: -------------------------------------------------------------------------------- 1 | import { configureMakeStore } from '../src/index'; 2 | 3 | describe('index', () => { 4 | it('exposes components', () => { 5 | expect(configureMakeStore).toBeInstanceOf(Function); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/template/locales/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Welcome to Gasket!", 3 | "gasket_learn": "Learn Gasket", 4 | "gasket_edit_page": "To get started, edit pages/index.js and save to reload." 5 | } 6 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/template/locales/en-US.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Welcome to Gasket!", 3 | "gasket_learn": "Learn Gasket", 4 | "gasket_edit_page": "To get started, edit pages/index.js and save to reload." 5 | } 6 | -------------------------------------------------------------------------------- /packages/gasket-utils/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 7 | } 8 | }); 9 | 10 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-all-i-ever-wanted/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/preset-all-i-ever-wanted", 3 | "version": "1.0.0", 4 | "description": "A bogus preset for testing", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /packages/create-gasket-app/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 7 | } 8 | }); 9 | 10 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/lib/request/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { GasketRequest } from '@gasket/request'; 2 | 3 | export function request( 4 | params?: Record | URLSearchParams | Promise 5 | ): Promise; 6 | -------------------------------------------------------------------------------- /packages/gasket-plugin-dynamic-plugins/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 7 | } 8 | }); 9 | -------------------------------------------------------------------------------- /packages/gasket-plugin-service-worker/__mocks__/uglify-js.js: -------------------------------------------------------------------------------- 1 | const minifyStub = jest.fn(() => ({ 2 | code: '() => {}' 3 | })); 4 | module.exports = jest.fn(() => ({ 5 | minify: minifyStub 6 | })); 7 | 8 | module.exports.minify = minifyStub; 9 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/generator/locales/fr-FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Bienvenue à Gasket!", 3 | "gasket_learn": "Apprendre Gasket", 4 | "gasket_edit_page": "Pour commencer, modifiez pages/index.js et enregistrez pour recharger." 5 | } 6 | -------------------------------------------------------------------------------- /packages/gasket-plugin-mocha/generator/api-app/typescript/test/mocha-setup.js: -------------------------------------------------------------------------------- 1 | import chai from 'chai'; 2 | import { describe, it } from 'mocha'; 3 | 4 | global.expect = chai.expect; 5 | global.describe = describe; 6 | global.it = it; 7 | 8 | export {}; 9 | -------------------------------------------------------------------------------- /packages/gasket-plugin-morgan/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 7 | } 8 | }); 9 | 10 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/template/pages/_document.ts: -------------------------------------------------------------------------------- 1 | import Document from 'next/document'; 2 | import { withGasketData } from '@gasket/nextjs/document'; 3 | import gasket from '@/gasket'; 4 | export default withGasketData(gasket)(Document); 5 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-double-default-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/preset-double-default-exports", 3 | "version": "1.0.0", 4 | "description": "A bogus preset for testing", 5 | "main": "index.js" 6 | } 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/cypress/test/e2e/index.cy.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | 3 | describe('IndexPage', () => { 4 | it('renders page', () => { 5 | cy.visit('/'); 6 | cy.get('h1').contains('Welcome to Gasket!'); 7 | }); 8 | }); 9 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/template/locales/fr-FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Bienvenue à Gasket!", 3 | "gasket_learn": "Apprendre Gasket", 4 | "gasket_edit_page": "Pour commencer, modifiez pages/index.js et enregistrez pour recharger." 5 | } 6 | -------------------------------------------------------------------------------- /packages/gasket-intl/test/fixtures/mock-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "basePath": "", 3 | "localesPath": "/locales", 4 | "defaultLocale": "en-US", 5 | "paths": { 6 | "locales/en-US.json": "10decbe", 7 | "locales/fr-FR.json": "21047f1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/template/locales/fr-FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Bienvenue à Gasket!", 3 | "gasket_learn": "Apprendre Gasket", 4 | "gasket_edit_page": "Pour commencer, modifiez pages/index.js et enregistrez pour recharger." 5 | } 6 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/template/locales/fr-FR.json: -------------------------------------------------------------------------------- 1 | { 2 | "gasket_welcome": "Bienvenue à Gasket!", 3 | "gasket_learn": "Apprendre Gasket", 4 | "gasket_edit_page": "Pour commencer, modifiez pages/index.js et enregistrez pour recharger." 5 | } 6 | -------------------------------------------------------------------------------- /packages/gasket-data/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'jsdom', 7 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'jsdom', 7 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/gasket-plugin-express/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'node', 7 | include: ['test/**/*.test.js'] 8 | } 9 | }); 10 | 11 | -------------------------------------------------------------------------------- /packages/gasket-redux/__mocks__/redux-logger.js: -------------------------------------------------------------------------------- 1 | const mockLoggerMiddleware = () => next => action => next(action); 2 | 3 | module.exports = { 4 | createLogger: function createLogger() { 5 | return mockLoggerMiddleware; 6 | }, 7 | mockLoggerMiddleware 8 | }; 9 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/packages/ci-basic-preset/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/ci-basic-preset", 3 | "version": "1.2.3", 4 | "main": "index.js", 5 | "dependencies": { 6 | "@gasket/plugin-ci-basic": "file:../ci-basic-plugin" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/packages/ci-extra-plugin/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'ci-extra', 3 | hooks: { 4 | async prompt(gasket, context) { 5 | console.log('extra prompt'); 6 | return context; 7 | } 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /packages/gasket-cjs/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'node', 7 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 8 | } 9 | }); 10 | 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-manifest/lib/base-config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Default values for manifest.json 3 | * @type {object} 4 | */ 5 | module.exports = { 6 | start_url: '/?source=pwa', 7 | scope: '/', 8 | display: 'standalone', 9 | path: '/manifest.json' 10 | }; 11 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/test/fixtures/mock-manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "basePath": "", 3 | "localesPath": "/locales", 4 | "defaultLocale": "en-US", 5 | "paths": { 6 | "locales/en-US.json": "10decbe", 7 | "locales/fr-FR.json": "21047f1" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'jsdom', 7 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/lib/server/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { GasketRequest } from '@gasket/core'; 2 | 3 | /** 4 | * @deprecated - use async `request` from @gasket/nextjs/request 5 | */ 6 | export function request(query?: Record | URLSearchParams): GasketRequest; 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-command/lib/ready.js: -------------------------------------------------------------------------------- 1 | import { gasketBin } from './cli.js'; 2 | 3 | /** @type {import('@gasket/core').HookHandler<'ready'>} */ 4 | export default async function ready(gasket) { 5 | if (gasket.config.command) { 6 | gasketBin.parse(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/template/pages/_document.ts: -------------------------------------------------------------------------------- 1 | import Document from 'next/document'; 2 | import { withGasketData } from '@gasket/nextjs/document'; 3 | import gasket from '@/gasket'; // tsconfig path alias 4 | export default withGasketData(gasket)(Document); 5 | -------------------------------------------------------------------------------- /packages/gasket-core/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'], 7 | setupFiles: ['test/setup.js'] 8 | } 9 | }); 10 | 11 | -------------------------------------------------------------------------------- /site/sidebars.js: -------------------------------------------------------------------------------- 1 | const sidebars = { 2 | // By default, Docusaurus generates a sidebar from the docs folder structure 3 | defaultSidebar: [ 4 | { 5 | type: 'autogenerated', 6 | dirName: '.' 7 | } 8 | ], 9 | }; 10 | 11 | export default sidebars; 12 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/app/page-router/pages/_document.js: -------------------------------------------------------------------------------- 1 | import Document from 'next/document'; 2 | import { withGasketData } from '@gasket/nextjs/document'; 3 | import gasket from '../gasket.js'; 4 | export default withGasketData(gasket)(Document.default || Document); 5 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/scripts/fix-cjs-paths.js: -------------------------------------------------------------------------------- 1 | import { readFileSync, writeFileSync } from 'fs'; 2 | 3 | const file = 'cjs/webpack-config.cjs'; 4 | const content = readFileSync(file, 'utf8'); 5 | const updated = content.replace(/\.mjs/g, '.cjs'); 6 | writeFileSync(file, updated); 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-service-worker/__mocks__/lru-cache.js: -------------------------------------------------------------------------------- 1 | const getStub = jest.fn(); 2 | const setStub = jest.fn(); 3 | module.exports = jest.fn(() => ({ 4 | get: getStub, 5 | set: setStub 6 | })); 7 | 8 | module.exports.getStub = getStub; 9 | module.exports.setStub = setStub; 10 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-npm-exports/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/preset-npm-exports", 3 | "version": "1.0.0", 4 | "exports": { 5 | ".": { 6 | "default": "./index.js" 7 | }, 8 | "./package.json": "./package.json" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-dynamic-plugins/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '@gasket/core'; 2 | 3 | declare module '@gasket/core' { 4 | export interface GasketConfig { 5 | dynamicPlugins?: string[]; 6 | } 7 | } 8 | 9 | declare const plugin: Plugin; 10 | export default plugin; 11 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'node', 7 | include: ['test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'] 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/create-gasket-app/lib/utils/index.js: -------------------------------------------------------------------------------- 1 | export { processCommand } from './process-command.js'; 2 | export { processArgs } from './process-args.js'; 3 | export { processOptions } from './process-options.js'; 4 | export { createOption } from './create-option.js'; 5 | export { logo } from './logo.js'; 6 | -------------------------------------------------------------------------------- /packages/gasket-template-api-express/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'node', 7 | include: ['test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'] 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/gasket-template-api-fastify/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'node', 7 | include: ['test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'] 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'node', 7 | include: ['test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'] 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'node', 7 | include: ['test/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'] 8 | } 9 | }); 10 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/next/typescript/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | // NOTE: This file should not be edited 5 | // see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. 6 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | include: ['test/**/*.test.js'], 7 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'], 8 | setupFiles: [] 9 | } 10 | }); 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-redux/generator/redux/store.js: -------------------------------------------------------------------------------- 1 | import { configureMakeStore } from '@gasket/redux'; 2 | {{{reduxReducers.imports}}} 3 | 4 | const reducers = { 5 | {{{reduxReducers.entries}}} 6 | }; 7 | 8 | const makeStore = configureMakeStore({ reducers }); 9 | 10 | export default makeStore; 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-analyze/lib/default-config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | server: { 3 | analyzerMode: 'static', 4 | reportFilename: '../../reports/server-bundles.html' 5 | }, 6 | browser: { 7 | analyzerMode: 'static', 8 | reportFilename: '../reports/browser-bundles.html' 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-elastic-apm/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'node', 7 | coverage: { 8 | provider: 'v8', 9 | reporter: ['text', 'lcov'] 10 | } 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /packages/gasket-plugin-typescript/generator/shared/server.ts: -------------------------------------------------------------------------------- 1 | // Imports use the .js to support a type module application 2 | // See README for more information 3 | import gasket from './gasket.js'; 4 | {{#if nextDevProxy }} 5 | gasket.actions.startProxyServer(); 6 | {{else}} 7 | gasket.actions.startServer(); 8 | {{/if}} 9 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/lib/document/internal.d.ts: -------------------------------------------------------------------------------- 1 | import type Document from 'next/document'; 2 | import type { ReactElement, ReactNode } from 'react'; 3 | 4 | export function isDocumentClass(maybeClass: any): maybeClass is typeof Document; 5 | 6 | export function selectBody(children: ReactElement[]): [ReactElement, number]; 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-mocha/lib/node-loader-babel/index.d.ts: -------------------------------------------------------------------------------- 1 | export function load( 2 | url: string, 3 | context: { format: string }, 4 | defaultLoad: (url: string, context: { format: string }, defaultLoad: any) => Promise<{ source: string | null, format: string }> 5 | ): Promise<{ source: string | null, format: string }>; 6 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs-graphs/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '@gasket/core'; 2 | 3 | declare module '@gasket/core' { 4 | export interface GasketConfig { 5 | docs?: { 6 | graphs?: boolean; 7 | }; 8 | } 9 | } 10 | 11 | declare const plugin: Plugin; 12 | 13 | export default plugin; 14 | 15 | 16 | -------------------------------------------------------------------------------- /packages/gasket-plugin-express/generator/app/plugins/README.md: -------------------------------------------------------------------------------- 1 | # Local Plugins 2 | 3 | ### Routes plugin 4 | 5 | A local plugin is used to define Express routes. The plugin hooks the `express` lifecycle and mutates the Express app. 6 | 7 | The following routes are available: 8 | 9 | ```javascript 10 | GET /default 11 | ``` 12 | -------------------------------------------------------------------------------- /packages/gasket-plugin-fastify/generator/app/plugins/README.md: -------------------------------------------------------------------------------- 1 | # Local Plugins 2 | 3 | ### Routes plugin 4 | 5 | A local plugin is used to define Fastify routes. The plugin hooks the `fastify` lifecycle and mutates the Fastify app. 6 | 7 | The following routes are available: 8 | 9 | ```javascript 10 | GET /default 11 | ``` 12 | -------------------------------------------------------------------------------- /packages/gasket-plugin-vitest/generator/react/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import react from '@vitejs/plugin-react'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | react() 7 | ], 8 | test: { 9 | environment: 'jsdom', 10 | globals: true 11 | } 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /packages/gasket-template-api-express/template/plugins/README.md: -------------------------------------------------------------------------------- 1 | # Local Plugins 2 | 3 | ### Routes plugin 4 | 5 | A local plugin is used to define Express routes. The plugin hooks the `express` lifecycle and mutates the Express app. 6 | 7 | The following routes are available: 8 | 9 | ```javascript 10 | GET /default 11 | ``` 12 | -------------------------------------------------------------------------------- /packages/gasket-template-api-fastify/template/plugins/README.md: -------------------------------------------------------------------------------- 1 | # Local Plugins 2 | 3 | ### Routes plugin 4 | 5 | A local plugin is used to define Fastify routes. The plugin hooks the `fastify` lifecycle and mutates the Fastify app. 6 | 7 | The following routes are available: 8 | 9 | ```javascript 10 | GET /default 11 | ``` 12 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/template/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import react from '@vitejs/plugin-react'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | react() 7 | ], 8 | test: { 9 | environment: 'jsdom', 10 | globals: true 11 | } 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/template/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import react from '@vitejs/plugin-react'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | react() 7 | ], 8 | test: { 9 | environment: 'jsdom', 10 | globals: true 11 | } 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/template/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import react from '@vitejs/plugin-react'; 3 | 4 | export default defineConfig({ 5 | plugins: [ 6 | react() 7 | ], 8 | test: { 9 | environment: 'jsdom', 10 | globals: true 11 | } 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/template/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | 5 | // NOTE: This file should not be edited 6 | // see https://nextjs.org/docs/app/api-reference/config/typescript for more information. 7 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/template/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | 5 | // NOTE: This file should not be edited 6 | // see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. 7 | -------------------------------------------------------------------------------- /.changeset/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://unpkg.com/@changesets/config@3.0.5/schema.json", 3 | "changelog": "@changesets/cli/changelog", 4 | "commit": false, 5 | "fixed": [], 6 | "linked": [], 7 | "access": "public", 8 | "baseBranch": "main", 9 | "updateInternalDependencies": "patch", 10 | "ignore": [] 11 | } 12 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/template-test/template/README.md: -------------------------------------------------------------------------------- 1 | # Test App 2 | 3 | This is a test application generated from a Gasket template. 4 | 5 | ## Getting Started 6 | 7 | ```bash 8 | npm run dev 9 | ``` 10 | 11 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 12 | 13 | -------------------------------------------------------------------------------- /packages/gasket-plugin-command/lib/commands.js: -------------------------------------------------------------------------------- 1 | /** @type {import('@gasket/core').HookHandler<'commands'>} */ 2 | export default function commands(gasket) { 3 | return { 4 | id: 'build', 5 | description: 'Gasket build command', 6 | action: async function () { 7 | await gasket.exec('build'); 8 | } 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-git/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '@gasket/core'; 2 | import type { Gitignore } from './internal'; 3 | 4 | declare module 'create-gasket-app' { 5 | export interface CreateContext { 6 | gitignore?: Gitignore; 7 | } 8 | } 9 | 10 | declare const plugin: Plugin; 11 | 12 | export default plugin; 13 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/template/next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | 5 | // NOTE: This file should not be edited 6 | // see https://nextjs.org/docs/pages/api-reference/config/typescript for more information. 7 | -------------------------------------------------------------------------------- /packages/gasket-plugin-fastify/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | include: ['test/**/*.test.js'], 6 | coverage: { 7 | provider: 'v8', 8 | include: ['lib/**/*.js'], 9 | reporter: ['text', 'lcov'] 10 | } 11 | } 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /packages/gasket-plugin-happyfeet/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | environment: 'node', 6 | globals: true 7 | }, 8 | optimizeDeps: { 9 | include: ['happy-feet'] 10 | }, 11 | ssr: { 12 | noExternal: ['happy-feet'] 13 | } 14 | }); 15 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/sitemap/next-sitemap.config.js: -------------------------------------------------------------------------------- 1 | // next-sitemap docs: https://github.com/iamvishnusankar/next-sitemap 2 | /** @type {import('next-sitemap').IConfig} */ 3 | export default { 4 | siteUrl: process.env.SITE_URL || 'https://example.com', 5 | generateRobotsTxt: true // (optional) 6 | // ...other options 7 | }; 8 | -------------------------------------------------------------------------------- /packages/gasket-plugin-vitest/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | import react from '@vitejs/plugin-react'; 3 | 4 | export default defineConfig({ 5 | plugins: [react()], 6 | test: { 7 | globals: true, 8 | environment: 'jsdom', 9 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 10 | } 11 | }); 12 | 13 | -------------------------------------------------------------------------------- /scripts/generate-docs-index/utils/wait.js: -------------------------------------------------------------------------------- 1 | /** 2 | * wait - Wait for a specified amount of time 3 | * @param {number} ms The time to wait in milliseconds 4 | * @returns {Promise} A promise that resolves after the specified time 5 | */ 6 | export default function wait(ms = 50) { 7 | return new Promise(resolve => setTimeout(resolve, ms)); 8 | } 9 | -------------------------------------------------------------------------------- /site/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | /docs 22 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/preset-bogus-not-found/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/preset-bogus-not-found", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "scripts": { 6 | "test": "echo \"Error: no test specified\" && exit 1" 7 | }, 8 | "author": "", 9 | "license": "ISC", 10 | "description": "" 11 | } 12 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/template-test/template/gasket.js: -------------------------------------------------------------------------------- 1 | import { makeGasket } from '@gasket/core'; 2 | import pluginLogger from '@gasket/plugin-logger'; 3 | import pluginNextjs from '@gasket/plugin-nextjs'; 4 | 5 | export default makeGasket({ 6 | plugins: [ 7 | pluginLogger, 8 | pluginNextjs 9 | ] 10 | }); 11 | 12 | -------------------------------------------------------------------------------- /packages/gasket-preset-api/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 7 | }, 8 | resolve: { 9 | alias: { 10 | '@docusaurus/core': '@docusaurus/core/lib/index.js' 11 | } 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /packages/gasket-intl/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | environment: 'node', 7 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'], 8 | environmentMatchGlobs: [ 9 | ['test/**/*.browser.test.js', 'jsdom'] 10 | ] 11 | } 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docusaurus/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 7 | }, 8 | resolve: { 9 | alias: { 10 | '@docusaurus/core': '@docusaurus/core/lib/index.js' 11 | } 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /packages/gasket-preset-nextjs/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'] 7 | }, 8 | resolve: { 9 | alias: { 10 | '@docusaurus/core': '@docusaurus/core/lib/index.js' 11 | } 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /packages/gasket-data/test/index.test.js: -------------------------------------------------------------------------------- 1 | describe('index', () => { 2 | it('has expected exports', async () => { 3 | const mod = await import('../lib/index.js'); 4 | 5 | const expected = [ 6 | 'gasketData', 7 | 'resolveGasketData' 8 | ]; 9 | 10 | expect(Object.keys(mod)).toEqual(expect.arrayContaining(expected)); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/lib/use-gasket-data.js: -------------------------------------------------------------------------------- 1 | import { useContext } from 'react'; 2 | import { GasketDataContext } from './gasket-data-provider.js'; 3 | 4 | /** 5 | * React that fetches GasketData in elements context and returns it 6 | * @returns {object} GasketData 7 | */ 8 | export const useGasketData = () => { 9 | return useContext(GasketDataContext) || {}; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-mocha/generator/react-app/test/register-loader.js: -------------------------------------------------------------------------------- 1 | import { register } from 'module'; 2 | import { pathToFileURL } from 'url'; 3 | 4 | // Register the Babel loader 5 | register('@gasket/plugin-mocha/node-loader-babel', pathToFileURL('./test')); 6 | 7 | // Register the styles loader 8 | register('@gasket/plugin-mocha/node-loader-styles', pathToFileURL('./test')); 9 | -------------------------------------------------------------------------------- /packages/gasket-plugin-elastic-apm/generator/setup.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-process-env */ 2 | import 'dotenv/config'; 3 | import apm from 'elastic-apm-node'; 4 | 5 | // Elastic APM setup 6 | apm.start({ 7 | serviceName: 'my-service-name', 8 | captureHeaders: false, 9 | secretToken: process.env.ELASTIC_APM_SECRET_TOKEN, 10 | serverUrl: process.env.ELASTIC_APM_SERVER_URL 11 | }); 12 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/lib/utils/configure-utils.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Shortcut to get the gasket.config.intl object 3 | * @param {Partial} gasket - Gasket API 4 | * @returns {import('../index.d.ts').IntlConfig} intl config 5 | */ 6 | function getIntlConfig(gasket) { 7 | return gasket.config.intl; 8 | } 9 | 10 | 11 | export { 12 | getIntlConfig 13 | }; 14 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/packages/ci-add-plugin/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'ci-add', 3 | hooks: { 4 | prompt: async function (gasket, context, { addPlugins }) { 5 | const pluginPath = __dirname.replace('ci-add', 'ci-extra'); 6 | await addPlugins(`@gasket/plugin-ci-extra@file:${pluginPath}`); 7 | 8 | return context; 9 | } 10 | } 11 | }; 12 | -------------------------------------------------------------------------------- /packages/gasket-plugin-typescript/lib/index.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | const { 4 | name, 5 | version, 6 | description 7 | } = require('../package.json'); 8 | const create = require('./create'); 9 | 10 | /** @type {import('@gasket/core').Plugin} */ 11 | module.exports = { 12 | name, 13 | version, 14 | description, 15 | hooks: { 16 | create 17 | } 18 | }; 19 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/app/app-router/app/layout.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import gasket from '../gasket.js'; 3 | import { withGasketData } from '@gasket/nextjs/layout'; 4 | 5 | function RootLayout({ children }) { 6 | return ( 7 | 8 | {children} 9 | 10 | ); 11 | } 12 | 13 | export default withGasketData(gasket)(RootLayout); 14 | -------------------------------------------------------------------------------- /packages/gasket-plugin-data/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | clearMocks: true, 6 | restoreMocks: true, 7 | mockReset: true, 8 | coverage: { 9 | provider: 'v8', 10 | reporter: ['text', 'lcov'], 11 | include: ['lib/**/*.js'], 12 | exclude: ['lib/index.d.ts'] 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/lib/use-messages.js: -------------------------------------------------------------------------------- 1 | import { useContext } from 'react'; 2 | import { GasketIntlContext } from './context.js'; 3 | 4 | /** 5 | * React hook that dispatches locale file load and returns status 6 | * @type {import('./index.d.ts').useMessages} 7 | */ 8 | export default function useMessages() { 9 | const { messages } = useContext(GasketIntlContext); 10 | return messages; 11 | } 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: 📃 Documentation Bug 3 | about: You want to report something that is wrong or missing from the documentation. 4 | labels: "Type: Docs" 5 | --- 6 | 7 | ## 📃 Summary 8 | 11 | 12 | ## Expected documentation 13 | 16 | -------------------------------------------------------------------------------- /packages/gasket-plugin-https-proxy/lib/create.js: -------------------------------------------------------------------------------- 1 | import packageJson from '../package.json' with { type: 'json' }; 2 | const { name, version } = packageJson; 3 | 4 | /** @type {import('@gasket/core').HookHandler<'create'>} */ 5 | export default function create(gasket, { pkg, gasketConfig }) { 6 | gasketConfig.addPlugin('pluginHttpsProxy', name); 7 | pkg.add('dependencies', { 8 | [name]: `^${version}` 9 | }); 10 | } 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-mocha/lib/node-loader-styles/index.d.ts: -------------------------------------------------------------------------------- 1 | export function resolve(specifier: string, context: any, defaultResolve: any): { 2 | url: string; 3 | shortCircuit: boolean; 4 | } | ReturnType; 5 | 6 | export function load(url: string, context: any, defaultLoad: any): { 7 | format: string; 8 | source: string; 9 | shortCircuit: boolean; 10 | } | ReturnType; 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-workbox/lib/build.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | const { copyWorkboxLibraries } = require('workbox-build'); 4 | const { getOutputDir } = require('./utils'); 5 | 6 | /** @type {import('@gasket/core').HookHandler<'build'>} */ 7 | module.exports = async function build(gasket) { 8 | const buildDir = getOutputDir(gasket); 9 | await copyWorkboxLibraries(buildDir); 10 | }; 11 | -------------------------------------------------------------------------------- /packages/gasket-typescript-tests/lifecycles/intl-locale.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable spaced-comment */ 2 | // @ts-check 3 | /// 4 | 5 | /** @type {import('@gasket/core').Hook<'intlLocale'>} */ 6 | const handler = (gasket, currentLocale) => { 7 | // return 3; - does not pass validation 8 | return currentLocale === 'fr-CA' ? 'fr-FR' : currentLocale; 9 | }; 10 | 11 | export default handler; 12 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs/lib/webpack-config.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import packageJson from '../package.json' with { type: 'json' }; 4 | const { name } = packageJson; 5 | 6 | /** @type {import('@gasket/core').HookHandler<'webpackConfig'>} */ 7 | export default function webpackConfigHook(gasket, webpackConfig) { 8 | webpackConfig.resolve.alias[name] = false; 9 | return webpackConfig; 10 | } 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-jest/generator/jest.config.js: -------------------------------------------------------------------------------- 1 | import nextJest from 'next/jest.js'; 2 | const pathToApp = 'pages'; 3 | const createJestConfig = nextJest(pathToApp); 4 | 5 | const customJestConfig = { 6 | testEnvironment: 'jest-environment-jsdom', 7 | collectCoverageFrom: ['**/*.js'], 8 | testEnvironmentOptions: { 9 | url: 'http://localhost/' 10 | } 11 | }; 12 | 13 | export default createJestConfig(customJestConfig); 14 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docusaurus/lib/webpack-config.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import packageJson from '../package.json' with { type: 'json' }; 4 | const { name } = packageJson; 5 | 6 | /** @type {import('@gasket/core').HookHandler<'webpackConfig'>} */ 7 | export default function webpackConfigHook(gasket, webpackConfig) { 8 | webpackConfig.resolve.alias[name] = false; 9 | return webpackConfig; 10 | } 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-manifest/lib/internal.d.ts: -------------------------------------------------------------------------------- 1 | import type { Gasket, MaybeAsync } from '@gasket/core'; 2 | import type { Manifest } from '.'; 3 | import type { IncomingMessage, OutgoingMessage } from 'http'; 4 | 5 | export function gatherManifestData( 6 | gasket: Gasket, 7 | context: { 8 | req?: IncomingMessage & { 9 | originalUrl?: string; 10 | }; 11 | res?: OutgoingMessage; 12 | } 13 | ): MaybeAsync; 14 | -------------------------------------------------------------------------------- /packages/gasket-preset-nextjs/lib/create.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { fileURLToPath } from 'url'; 3 | 4 | /** @type {import('@gasket/core').HookHandler<'create'>} */ 5 | export default function create(gasket, context) { 6 | const { files } = context; 7 | const __dirname = fileURLToPath(import.meta.url); 8 | const generatorDir = path.join(__dirname, '..', '..', 'generator'); 9 | files.add(`${generatorDir}/*`); 10 | } 11 | -------------------------------------------------------------------------------- /packages/gasket-template-api-express/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | ## 7.0.3 4 | 5 | ### Patch Changes 6 | 7 | - db09b09: Improve JSDocs 8 | 9 | ## 7.0.2 10 | 11 | ### Patch Changes 12 | 13 | - c0b2b83: Ensure expected dotfiles are packed 14 | 15 | ## 7.0.1 16 | 17 | ### Patch Changes 18 | 19 | - 92c51a8: Add missing template readmes 20 | 21 | ## 7.0.0 22 | 23 | ### Major Changes 24 | 25 | - 0d8b629: Templates major bump to v3 26 | -------------------------------------------------------------------------------- /packages/gasket-template-api-fastify/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | ## 7.0.3 4 | 5 | ### Patch Changes 6 | 7 | - db09b09: Improve JSDocs 8 | 9 | ## 7.0.2 10 | 11 | ### Patch Changes 12 | 13 | - c0b2b83: Ensure expected dotfiles are packed 14 | 15 | ## 7.0.1 16 | 17 | ### Patch Changes 18 | 19 | - 92c51a8: Add missing template readmes 20 | 21 | ## 7.0.0 22 | 23 | ### Major Changes 24 | 25 | - 0d8b629: Templates major bump to v3 26 | -------------------------------------------------------------------------------- /packages/gasket-plugin-cypress/generator/cypress.config.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import { defineConfig } from 'cypress'; 3 | 4 | export default defineConfig({ 5 | video: false, 6 | e2e: { 7 | // eslint-disable-next-line no-unused-vars 8 | setupNodeEvents(on, config) {}, 9 | baseUrl: 'http://localhost:3000', 10 | supportFile: false, 11 | specPattern: 'test/e2e/**/*.cy.{js,jsx,ts,tsx}' 12 | } 13 | }); 14 | -------------------------------------------------------------------------------- /packages/gasket-core/test/index.test.js: -------------------------------------------------------------------------------- 1 | 2 | const module = await import('../lib/gasket.js'); 3 | 4 | describe('index', () => { 5 | it('has expected exports', () => { 6 | const expected = [ 7 | 'Gasket', 8 | 'makeGasket' 9 | ]; 10 | 11 | expected.forEach(property => { 12 | expect(module).toHaveProperty(property); 13 | }); 14 | expect(Object.keys(module)).toHaveLength(expected.length); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/gasket-plugin-typescript/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '@gasket/core'; 2 | import type { CreateContext, CreatePrompt } from 'create-gasket-app' with { 'resolution-mode': 'import' }; 3 | 4 | 5 | declare const plugin: Plugin; 6 | export default plugin; 7 | 8 | /* Externalize TS prompts for preset */ 9 | export function promptTypescript( 10 | context: CreateContext, 11 | prompt: CreatePrompt 12 | ): Promise 13 | 14 | -------------------------------------------------------------------------------- /packages/gasket-plugin-middleware/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | environment: 'node', 6 | globals: true, 7 | coverage: { 8 | provider: 'v8', 9 | reporter: ['text', 'json', 'html'], 10 | exclude: [ 11 | 'node_modules/', 12 | 'test/', 13 | 'cjs/', 14 | '**/*.d.ts' 15 | ] 16 | } 17 | } 18 | }); 19 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/app/page-router/pages/_document.ts: -------------------------------------------------------------------------------- 1 | import Document from 'next/document'; 2 | import { withGasketData } from '@gasket/nextjs/document'; 3 | {{#if (eq nextServerType 'customServer')}} 4 | import gasket from '@/gasket'; // tsconfig path alias 5 | {{else if nextDevProxy}} 6 | import gasket from '@/gasket'; 7 | {{else}} 8 | import gasket from '../gasket'; 9 | {{/if}} 10 | export default withGasketData(gasket)(Document); 11 | -------------------------------------------------------------------------------- /packages/gasket-cjs/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "rootDir": "./lib", 5 | "outDir": "./dist", 6 | "noEmit": true, 7 | "allowJs": true, 8 | "checkJs": false, 9 | "types": [ 10 | "@types/node" 11 | ] 12 | }, 13 | "include": [ 14 | "lib/**/*.d.ts" 15 | ], 16 | "exclude": [ 17 | "test/**/*", 18 | "node_modules/**/*", 19 | "lib/**/*.js" 20 | ] 21 | } -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/lib/public-gasket-data.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | /** @type {import('@gasket/core').HookHandler<'publicGasketData'>} */ 4 | export default async function publicGasketDataHook(gasket, publicGasketData, { req }) { 5 | const locale = await gasket.actions.getIntlLocale(req); 6 | 7 | publicGasketData.intl ??= {}; 8 | publicGasketData.intl.locale = locale; 9 | 10 | return publicGasketData; 11 | } 12 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/vitest/app-router/test/index.test.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import IndexPage from '../app/page.jsx'; 4 | import { expect } from 'vitest'; 5 | 6 | describe('IndexPage', () => { 7 | it('renders page', () => { 8 | render(); 9 | 10 | expect(screen.getByRole('heading').textContent).toBe('Welcome to Gasket!'); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/lib/utils.js: -------------------------------------------------------------------------------- 1 | import { LocaleFileStatus } from '@gasket/intl'; 2 | 3 | /** @type {import('./index.d.ts').ensureArray} */ 4 | export function ensureArray(value) { 5 | return (Array.isArray(value) ? value : [value]).filter(Boolean); 6 | } 7 | 8 | /** @type {import('./index.d.ts').needsToLoad} */ 9 | export function needsToLoad(status) { 10 | return [LocaleFileStatus.notHandled, LocaleFileStatus.notLoaded].includes(status); 11 | } 12 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/template/test/index.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import IndexPage from '../app/page.tsx'; 4 | import { expect, describe, it } from 'vitest'; 5 | 6 | describe('IndexPage', () => { 7 | it('renders page', () => { 8 | render(); 9 | 10 | expect(screen.getByRole('heading').textContent).toBe('Welcome to Gasket!'); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/gasket-utils/lib/get-package-latest-version.js: -------------------------------------------------------------------------------- 1 | import runShellCommand from './run-shell-command.js'; 2 | 3 | /** 4 | * Get the latest version of a package from npm 5 | * @type {import('./index.js').getPackageLatestVersion} 6 | */ 7 | export default async function getPackageLatestVersion(pkgName, options = {}) { 8 | const cmdResult = await runShellCommand('npm', ['view', pkgName, 'version'], options); 9 | return cmdResult.stdout.trim(); 10 | } 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-git/lib/create.js: -------------------------------------------------------------------------------- 1 | /// 2 | const path = require('path'); 3 | 4 | /** 5 | * Create hook adds template files if gitInit 6 | * @type {import('@gasket/core').HookHandler<'create'>} 7 | */ 8 | module.exports = async function create(gasket, context) { 9 | const { gitInit, files } = context; 10 | 11 | if (gitInit) { 12 | files.add(path.join(__dirname, '..', 'generator', '.*')); 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /packages/gasket-plugin-https/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true, 6 | includeSource: ['lib/**/*.{js,jsx,ts,tsx}'], 7 | coverage: { 8 | provider: 'v8', 9 | enabled: true, 10 | reporter: ['text', 'json', 'html', 'lcovonly'], 11 | include: ['lib/**'], 12 | exclude: ['**/node_modules/**', '**/test/**'] 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /packages/gasket-plugin-metadata/lib/create.js: -------------------------------------------------------------------------------- 1 | import { createRequire } from 'module'; 2 | const require = createRequire(import.meta.url); 3 | const { name, version } = require('../package.json'); 4 | 5 | /** @type {import('@gasket/core').HookHandler<'create'>} */ 6 | export default function create(gasket, { pkg, gasketConfig }) { 7 | gasketConfig.addPlugin('pluginMetadata', name); 8 | pkg.add('devDependencies', { 9 | [name]: `^${version}` 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /packages/gasket-plugin-service-worker/lib/actions.js: -------------------------------------------------------------------------------- 1 | const { loadRegisterScript } = require('./utils/utils'); 2 | 3 | /** @type {import('@gasket/core').ActionHandler<'getSWRegisterScript'>} */ 4 | async function getSWRegisterScript(gasket) { 5 | const { serviceWorker: config } = gasket.config; 6 | const content = await loadRegisterScript(config); 7 | return ``; 8 | } 9 | 10 | module.exports = { 11 | getSWRegisterScript 12 | }; 13 | -------------------------------------------------------------------------------- /packages/create-gasket-app/lib/scaffold/actions/install-modules.js: -------------------------------------------------------------------------------- 1 | import { withSpinner } from '../with-spinner.js'; 2 | 3 | /** 4 | * Installs node_modules using the selected package manager 5 | * @type {import('../../internal.js').installModules} 6 | */ 7 | async function installModules({ context }) { 8 | const { pkgManager } = context; 9 | 10 | await pkgManager.install(); 11 | } 12 | 13 | export default withSpinner('Install node modules', installModules); 14 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/packages/ci-basic-plugin/generator/.gitignore.template: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | node_modules 5 | 6 | # testing 7 | coverage 8 | reports 9 | 10 | # production 11 | build 12 | dist 13 | .next 14 | 15 | # misc 16 | .env 17 | .idea 18 | *.iml 19 | *.log 20 | *.bak 21 | .DS_Store 22 | 23 | # special 24 | app.config.local.js* 25 | gasket.config.local.js* 26 | -------------------------------------------------------------------------------- /packages/gasket-plugin-analyze/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '@gasket/core'; 2 | import type { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'; 3 | 4 | declare module '@gasket/core' { 5 | export interface GasketConfig { 6 | bundleAnalyzerConfig?: { 7 | browser?: BundleAnalyzerPlugin.Options, 8 | server?: BundleAnalyzerPlugin.Options 9 | } 10 | } 11 | } 12 | 13 | declare const plugin: Plugin; 14 | 15 | export default plugin; 16 | -------------------------------------------------------------------------------- /packages/gasket-plugin-command/lib/cli.js: -------------------------------------------------------------------------------- 1 | import { Command } from 'commander'; 2 | import { logo } from './utils/logo.js'; 3 | import packageJson from '../package.json' with { type: 'json' }; 4 | const { version } = packageJson; 5 | const program = new Command(); 6 | 7 | // Create Gasket CLI 8 | export const gasketBin = program 9 | .name('gasket') 10 | .description('CLI for custom Gasket commands') 11 | .version(version) 12 | .addHelpText('beforeAll', logo); 13 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/jest/app-router/test/index.spec.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import IndexPage from '../app/page.jsx'; 4 | import { expect } from '@jest/globals'; 5 | 6 | describe('IndexPage', () => { 7 | it('renders page', () => { 8 | render(); 9 | 10 | expect(screen.getByRole('heading').textContent).toBe('Welcome to Gasket!'); 11 | }); 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/jest/app-router/test/index.spec.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import IndexPage from '../app/page.tsx'; 4 | import { expect } from '@jest/globals'; 5 | 6 | describe('IndexPage', () => { 7 | it('renders page', () => { 8 | render(); 9 | 10 | expect(screen.getByRole('heading').textContent).toBe('Welcome to Gasket!'); 11 | }); 12 | }); 13 | 14 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/vitest/app-router/test/index.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import IndexPage from '../app/page.tsx'; 4 | import { expect, describe, it } from 'vitest'; 5 | 6 | describe('IndexPage', () => { 7 | it('renders page', () => { 8 | render(); 9 | 10 | expect(screen.getByRole('heading').textContent).toBe('Welcome to Gasket!'); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/gasket-plugin-command/lib/create.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import packageJson from '../package.json' with { type: 'json' }; 4 | const { name, version } = packageJson; 5 | 6 | /** @type {import('@gasket/core').HookHandler<'create'>} */ 7 | export default function create(gasket, { pkg, gasketConfig }) { 8 | gasketConfig.addPlugin('pluginCommand', name); 9 | pkg.add('dependencies', { 10 | [name]: `^${version}` 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /packages/gasket-plugin-git/lib/index.js: -------------------------------------------------------------------------------- 1 | const prompt = require('./prompt'); 2 | const create = require('./create'); 3 | const postCreate = require('./post-create'); 4 | const { name, version, description } = require('../package.json'); 5 | 6 | /** @type {import('@gasket/core').Plugin} */ 7 | const plugin = { 8 | name, 9 | version, 10 | description, 11 | hooks: { 12 | prompt, 13 | create, 14 | postCreate 15 | } 16 | }; 17 | 18 | module.exports = plugin; 19 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/template/components/head.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import NextHead from 'next/head.js'; 3 | 4 | const Head = ({ title, description }) => ( 5 | 6 | 7 | {title} 8 | 9 | 10 | 11 | ); 12 | 13 | export default Head; 14 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/template/components/head.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import NextHead from 'next/head.js'; 3 | 4 | const Head = ({ title, description }) => ( 5 | 6 | 7 | {title} 8 | 9 | 10 | 11 | ); 12 | 13 | export default Head; 14 | -------------------------------------------------------------------------------- /packages/gasket-utils/lib/index.js: -------------------------------------------------------------------------------- 1 | import { applyConfigOverrides } from './config.js'; 2 | import runShellCommand from './run-shell-command.js'; 3 | import PackageManager from './package-manager.js'; 4 | import warnIfOutdated from './warn-if-outdated.js'; 5 | import getPackageLatestVersion from './get-package-latest-version.js'; 6 | 7 | export { 8 | applyConfigOverrides, 9 | runShellCommand, 10 | PackageManager, 11 | warnIfOutdated, 12 | getPackageLatestVersion 13 | }; 14 | -------------------------------------------------------------------------------- /packages/gasket-plugin-morgan/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '@gasket/core'; 2 | import type { IncomingMessage, ServerResponse } from 'http'; 3 | import type { Options } from 'morgan'; 4 | 5 | declare module '@gasket/core' { 6 | export interface GasketConfig { 7 | morgan?: { 8 | format?: string; 9 | options?: Options; 10 | }; 11 | } 12 | } 13 | 14 | declare const plugin: Plugin; 15 | 16 | export default plugin; 17 | -------------------------------------------------------------------------------- /packages/gasket-typescript-tests/test/plugin-typescript.spec.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable vitest/expect-expect, jest/expect-expect */ 2 | import { Gasket, Hook } from '@gasket/core'; 3 | import '@gasket/plugin-typescript'; 4 | 5 | describe('@gasket/plugin-typescript', () => { 6 | const { log } = console; 7 | 8 | it('creates the create lifecycle', () => { 9 | const handler: Hook<'create'> = async (gasket: Gasket) => { 10 | log('Creating...'); 11 | }; 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/lib/layout/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { PropsWithChildren, ReactElement } from 'react'; 2 | import type { Gasket, MaybeAsync } from '@gasket/core'; 3 | 4 | type LayoutOptions = { 5 | index: number; 6 | } 7 | 8 | type Layout = (props: PropsWithChildren) => MaybeAsync; 9 | 10 | export function withGasketData( 11 | gasket: Gasket, 12 | options?: LayoutOptions 13 | ): (layout: Layout) => (props: PropsWithChildren) => Promise 14 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs/lib/prompt.js: -------------------------------------------------------------------------------- 1 | /** @type {import('@gasket/core').HookHandler<'prompt'>} */ 2 | export default async function promptHook(gasket, context, { prompt }) { 3 | if ('useDocs' in context) return context; 4 | 5 | const { useDocs } = await prompt([ 6 | { 7 | name: 'useDocs', 8 | message: 'Do you want to use generated documentation?', 9 | type: 'confirm' 10 | } 11 | ]); 12 | 13 | return Object.assign({}, context, { useDocs }); 14 | } 15 | -------------------------------------------------------------------------------- /packages/gasket-plugin-dynamic-plugins/lib/create.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import packageJson from '../package.json' with { type: 'json' }; 4 | const { name, version } = packageJson; 5 | 6 | /** @type {import('@gasket/core').HookHandler<'create'>} */ 7 | export default function create(gasket, { pkg, gasketConfig }) { 8 | gasketConfig.addPlugin('pluginDynamicPlugins', name); 9 | pkg.add('dependencies', { 10 | [name]: `^${version}` 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /packages/gasket-plugin-metadata/lib/webpack-config.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { createRequire } from 'module'; 4 | const require = createRequire(import.meta.url); 5 | 6 | const { name } = require('../package.json'); 7 | 8 | /** @type {import('@gasket/core').HookHandler<'webpackConfig'>} */ 9 | export default function webpackConfigHook(gasket, webpackConfig) { 10 | webpackConfig.resolve.alias[name] = false; 11 | return webpackConfig; 12 | } 13 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/lib/gasket-data-provider.js: -------------------------------------------------------------------------------- 1 | import { createElement, createContext } from 'react'; 2 | 3 | export const GasketDataContext = createContext({}); 4 | 5 | /** 6 | * Provider for the GasketData, adds context to child elements. 7 | * @type {import('./index.d.ts').GasketDataProvider} GasketDataProvider 8 | */ 9 | export const GasketDataProvider = ({ gasketData, children }) => { 10 | return createElement(GasketDataContext.Provider, { value: gasketData }, children); 11 | }; 12 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/app/app-router/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | {{#if nextDevProxy}} 3 | import gasket from '@/gasket'; 4 | {{else}} 5 | import gasket from '../gasket'; 6 | {{/if}} 7 | import { withGasketData } from '@gasket/nextjs/layout'; 8 | 9 | function RootLayout({ children }) { 10 | return ( 11 | 12 | {children} 13 | 14 | ); 15 | } 16 | 17 | export default withGasketData(gasket)(RootLayout); 18 | -------------------------------------------------------------------------------- /packages/gasket-preset-nextjs/test/create.test.js: -------------------------------------------------------------------------------- 1 | 2 | import create from '../lib/create.js'; 3 | 4 | describe('create', () => { 5 | let mockContext; 6 | 7 | beforeEach(() => { 8 | mockContext = { 9 | files: { 10 | add: vi.fn() 11 | } 12 | }; 13 | }); 14 | 15 | it('adds generator files', async () => { 16 | create(null, mockContext); 17 | expect(mockContext.files.add).toHaveBeenCalledWith(expect.stringMatching(/generator\/\*$/)); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/lib/index.js: -------------------------------------------------------------------------------- 1 | import { withMessagesProvider } from './with-messages-provider.js'; 2 | import useMessages from './use-messages.js'; 3 | import useLocaleFile from './use-locale-file.js'; 4 | import LocaleFileRequired from './locale-file-required.js'; 5 | import withLocaleFileRequired from './with-locale-file-required.js'; 6 | 7 | export { 8 | withMessagesProvider, 9 | useMessages, 10 | useLocaleFile, 11 | LocaleFileRequired, 12 | withLocaleFileRequired 13 | }; 14 | -------------------------------------------------------------------------------- /packages/gasket-typescript-tests/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.base.json", 3 | "compilerOptions": { 4 | "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ 5 | "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ 6 | "strict": true /* Enable all strict type-checking options. */ 7 | }, 8 | "include": ["test/**/*.ts" ], 9 | "exclude": [] 10 | } 11 | -------------------------------------------------------------------------------- /packages/gasket-utils/test/fixtures/test-script.js: -------------------------------------------------------------------------------- 1 | const pause = ms => new Promise((resolve) => { 2 | setTimeout(resolve, ms); 3 | }); 4 | 5 | async function main(argv) { 6 | const [, , fail = 'false', timeout = 10] = argv; 7 | console.log(`waiting for ${ timeout }ms...`); 8 | console.log(); 9 | await pause(timeout); 10 | 11 | if (fail === 'true') { 12 | console.error('fail'); 13 | process.exit(1); 14 | } 15 | console.log('success'); 16 | } 17 | 18 | main(process.argv); 19 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/template-test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@gasket/template-test", 3 | "version": "1.0.0", 4 | "description": "Test template for Gasket applications", 5 | "main": "index.js", 6 | "keywords": ["gasket", "template"], 7 | "author": "Gasket Team", 8 | "license": "MIT", 9 | "gasket": { 10 | "metadata": { 11 | "name": "Test Template", 12 | "description": "A test template for Gasket applications" 13 | } 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /packages/gasket-plugin-service-worker/lib/utils/sw-register.template.js: -------------------------------------------------------------------------------- 1 | if ('serviceWorker' in navigator) { 2 | window.addEventListener('load', function () { 3 | navigator.serviceWorker 4 | .register('{URL}', { scope: '{SCOPE}' }) 5 | .then(function (registration) { 6 | console.log('SW registered: ', registration); 7 | }) 8 | .catch(function (registrationError) { 9 | console.warn('SW registration failed: ', registrationError); 10 | }); 11 | }); 12 | } 13 | -------------------------------------------------------------------------------- /packages/create-gasket-app/lib/utils/logo.js: -------------------------------------------------------------------------------- 1 | export const logo = ` 2 | ▄▄▄▄████▀▀█▄ 3 | ▄████▀▀▀▀▀▀█▄▄██ 4 | ███▀ ▄▄▄▄▄ ▀██▌ ▄▄▄ 5 | ▄███ ███▀▀▀▀██ ██ ██ ██ 6 | █▀▀█ ██▌ ▐█▌ ▄▀▀▀█▄ ▄█▀▀▀▄ ██ ▐██▀ ▄█▀▀█▄ ▀██▀▀ 7 | █▄▄█ ██▌ ▀▀██ ▐█▌ ▄▄▄▄██ ▀▀█▄▄▄ █████ ██▄▄██ ██ 8 | ▀███ ███▄▄▄▄██ ██ ▀▄▄▄▀█▄ ▀▄▄▄█▀ ▄██▄ ██▄ ▀█▄▄▄▄ ▀█▄▄ 9 | ███▄ ▀▀▀ ▀▀ ▄██▌ 10 | ▀████▄▄▄▄▄▄█▀▀██ 11 | ▀▀▀▀████▄▄█▀ 12 | `; 13 | -------------------------------------------------------------------------------- /packages/gasket-fetch/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | collectCoverageFrom: [ 3 | 'lib/**/*.js' 4 | ], 5 | coverageDirectory: 'coverage', 6 | coverageReporters: ['text', 'lcov'], 7 | projects: [ 8 | { 9 | displayName: 'server', 10 | testEnvironment: 'node', 11 | testMatch: ['**/test/server.spec.js'] 12 | }, 13 | { 14 | displayName: 'browser', 15 | testEnvironment: 'jsdom', 16 | testMatch: ['**/test/browser.spec.js'] 17 | } 18 | ] 19 | }; 20 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/lib/service-worker-cache-key.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | /** 4 | * Register a cache key function to get the language for a request 5 | * @type {import('@gasket/core').HookHandler<'serviceWorkerCacheKey'>} 6 | */ 7 | export default async function serviceWorkerCacheKey() { 8 | return function getLocale(req, res) { 9 | const { locals: { gasketData: { intl: { locale } = {} } = {} } = {} } = res; 10 | 11 | return locale; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /packages/gasket-plugin-workbox/lib/express.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | const serveStatic = require('serve-static'); 4 | const { getOutputDir } = require('./utils'); 5 | 6 | /** @type {import('@gasket/core').HookHandler<'express'>} */ 7 | module.exports = function express(gasket, app) { 8 | const outputDir = getOutputDir(gasket); 9 | 10 | app.use('/_workbox', serveStatic(outputDir, { 11 | index: false, 12 | maxAge: '1y', 13 | immutable: true 14 | })); 15 | }; 16 | -------------------------------------------------------------------------------- /packages/gasket-preset-api/lib/index.js: -------------------------------------------------------------------------------- 1 | import presetPrompt from './preset-prompt.js'; 2 | import presetConfig from './preset-config.js'; 3 | import create from './create.js'; 4 | import packageJson from '../package.json' with { type: 'json' }; 5 | const { name, version, description } = packageJson; 6 | 7 | /** @type {import('@gasket/core').Preset} */ 8 | export default { 9 | name, 10 | version, 11 | description, 12 | hooks: { 13 | presetPrompt, 14 | presetConfig, 15 | create 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs/lib/configure.js: -------------------------------------------------------------------------------- 1 | import defaultsDeep from 'lodash.defaultsdeep'; 2 | import { DEFAULT_CONFIG } from './utils/constants.js'; 3 | 4 | /** 5 | * Configure lifecycle to set up SW config with defaults 6 | * @type {import('@gasket/core').HookHandler<'configure'>} 7 | */ 8 | export default function configure(gasket, baseConfig) { 9 | const userConfig = baseConfig?.docs || {}; 10 | 11 | const docs = defaultsDeep({}, userConfig, DEFAULT_CONFIG); 12 | return { ...baseConfig, docs }; 13 | } 14 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/lib/configure.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | 4 | /** @type {import('@gasket/core').HookHandler<'configure'>} */ 5 | function configure(gasket, baseConfig) { 6 | const { nextConfig = {} } = baseConfig ?? {}; 7 | 8 | const serviceWorker = { 9 | webpackRegister: (key) => /_app/.test(key), 10 | ...(baseConfig.serviceWorker || {}) 11 | }; 12 | return { ...baseConfig, serviceWorker, nextConfig }; 13 | } 14 | 15 | export default configure; 16 | -------------------------------------------------------------------------------- /packages/gasket-plugin-typescript/lib/prompt.js: -------------------------------------------------------------------------------- 1 | /** @type {import('.').promptTypescript} */ 2 | async function promptTypescript(context, prompt) { 3 | if ('typescript' in context) return; 4 | const { typescript } = await prompt([ 5 | { 6 | name: 'typescript', 7 | message: 'Do you want to use TypeScript?', 8 | type: 'confirm', 9 | default: false 10 | } 11 | ]); 12 | 13 | Object.assign(context, { typescript }); 14 | } 15 | 16 | module.exports = { 17 | promptTypescript 18 | }; 19 | -------------------------------------------------------------------------------- /packages/gasket-preset-nextjs/lib/index.js: -------------------------------------------------------------------------------- 1 | import presetPrompt from './preset-prompt.js'; 2 | import presetConfig from './preset-config.js'; 3 | import create from './create.js'; 4 | import packageJson from '../package.json' with { type: 'json' }; 5 | const { name, version, description } = packageJson; 6 | 7 | /** @type {import('@gasket/core').Preset} */ 8 | export default { 9 | name, 10 | version, 11 | description, 12 | hooks: { 13 | presetPrompt, 14 | presetConfig, 15 | create 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /packages/gasket-fetch/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | /* global RequestInit, RequestInfo */ 2 | import type * as NodeFetch from 'node-fetch'; 3 | import type AbortController from 'abort-controller'; 4 | 5 | export default function fetchWrapper( 6 | /** The resource that you wish to fetch. */ 7 | input: RequestInfo | URL, 8 | /** An object containing any custom settings. */ 9 | init?: RequestInit 10 | ): Promise; 11 | 12 | declare const fetch: typeof NodeFetch & { 13 | AbortController: typeof AbortController; 14 | }; 15 | -------------------------------------------------------------------------------- /scripts/generate-docs-index/utils/format-filename.js: -------------------------------------------------------------------------------- 1 | /** 2 | * formatFilename - Format the filename to be more human readable 3 | * @param {string} filename The filename to format 4 | * @returns {string} The formatted filename 5 | */ 6 | export default function formatFilename(filename) { 7 | filename = `${filename.charAt(0).toUpperCase()}${filename.slice(1)}`; 8 | filename = filename.split('-').map(word => `${word.charAt(0).toUpperCase()}${word.slice(1)}`).join(' '); 9 | return filename.replace('.md', ''); 10 | } 11 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/test/package.test.js: -------------------------------------------------------------------------------- 1 | import packageJson from '../package.json'; 2 | 3 | describe('package.json', function () { 4 | 5 | it('has expected exports', () => { 6 | const expected = [ 7 | '.', 8 | './document', 9 | './layout', 10 | './request', 11 | './server', 12 | './package.json' 13 | ]; 14 | 15 | expect(Object.keys(packageJson.exports)).toEqual(expected); 16 | expect(Object.keys(packageJson.exports)).toHaveLength(expected.length); 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/app/page-router/components/head.jsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import React from 'react'; 3 | import NextHead from 'next/head.js'; 4 | 5 | const Head = ({ title, description }) => ( 6 | 7 | 8 | {title} 9 | 10 | 11 | 12 | ); 13 | 14 | export default Head; 15 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/app/page-router/components/head.tsx: -------------------------------------------------------------------------------- 1 | /* eslint-disable no-unused-vars */ 2 | import React from 'react'; 3 | import NextHead from 'next/head.js'; 4 | 5 | const Head = ({ title, description }) => ( 6 | 7 | 8 | {title} 9 | 10 | 11 | 12 | ); 13 | 14 | export default Head; 15 | -------------------------------------------------------------------------------- /packages/gasket-plugin-workbox/lib/fastify.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | const serveStatic = require('serve-static'); 4 | const { getOutputDir } = require('./utils'); 5 | 6 | /** @type {import('@gasket/core').HookHandler<'fastify'>} */ 7 | module.exports = function fastify(gasket, app) { 8 | const outputDir = getOutputDir(gasket); 9 | 10 | app.register(serveStatic(outputDir, { 11 | index: false, 12 | maxAge: '1y', 13 | immutable: true 14 | }), { prefix: '/_workbox' }); 15 | }; 16 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | ## 7.0.4 4 | 5 | ### Patch Changes 6 | 7 | - db09b09: Improve JSDocs 8 | 9 | ## 7.0.3 10 | 11 | ### Patch Changes 12 | 13 | - 38c31a9: Dependency updates 14 | 15 | ## 7.0.2 16 | 17 | ### Patch Changes 18 | 19 | - c0b2b83: Ensure expected dotfiles are packed 20 | 21 | ## 7.0.1 22 | 23 | ### Patch Changes 24 | 25 | - 92c51a8: Add missing template readmes 26 | 27 | ## 7.0.0 28 | 29 | ### Major Changes 30 | 31 | - 0d8b629: Templates major bump to v3 32 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/test/helpers.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | // eslint-disable-next-line no-console 4 | const consoleError = console.error; 5 | 6 | /** 7 | * Silence noisy act warnings from console.error 8 | * TODO: Remove when fix is determined 9 | * @returns {import('vitest').SpyInstance} mock console.error 10 | */ 11 | export function mockConsoleError() { 12 | return vi.spyOn(console, 'error').mockImplementation((msg) => { 13 | if (msg.includes('ReactDOMTestUtils.act')) return; 14 | consoleError(msg); 15 | }); 16 | } 17 | 18 | -------------------------------------------------------------------------------- /packages/gasket-plugin-command/lib/utils/logo.js: -------------------------------------------------------------------------------- 1 | export const logo = ` 2 | ▄▄▄▄████▀▀█▄ 3 | ▄███▀▀▀▀▀▀▀█▄▄██ 4 | ▄██▀ ▄▄▄▄▄ ▀██▌ ▄▄▄ 5 | ▄██▀ ███▀▀▀▀█ ██ ██ ██ 6 | █▀▀█ ██▌ ▐█▌ ▄▀▀▀█▄ ▄█▀▀▀▄ ██ ▐██▀ ▄█▀▀█▄ ▀██▀▀ 7 | █▄▄█ ██▌ ▀▀██ ▐█▌ ▄▄▄▄██ ▀▀█▄▄▄ █████ ██▄▄██ ██ 8 | ▀██▄ ███▄▄▄▄██ ██ ▀▄▄▄▀█▄ ▀▄▄▄█▀ ▄██▄ ██▄ ▀█▄▄▄▄ ▀█▄▄ 9 | ▀██▄ ▀▀▀ ▀▀ ▄██▌ 10 | ▀███▄▄▄▄▄▄▄█▀▀██ 11 | ▀▀▀▀████▄▄█▀ 12 | `; 13 | 14 | -------------------------------------------------------------------------------- /packages/gasket-request/lib/keeper.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @type {import('@gasket/request').WeakPromiseKeeper} 3 | */ 4 | // @ts-ignore - https://github.com/microsoft/TypeScript/issues/56664 5 | export class WeakPromiseKeeper extends WeakMap { 6 | set(key, promise) { 7 | super.set(key, promise); 8 | 9 | promise 10 | .then((value) => { 11 | super.set(key, value); 12 | return value; 13 | }) 14 | .catch(() => { 15 | super.delete(key); 16 | }); 17 | 18 | return this; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | ## 7.0.4 4 | 5 | ### Patch Changes 6 | 7 | - db09b09: Improve JSDocs 8 | 9 | ## 7.0.3 10 | 11 | ### Patch Changes 12 | 13 | - 38c31a9: Dependency updates 14 | 15 | ## 7.0.2 16 | 17 | ### Patch Changes 18 | 19 | - c0b2b83: Ensure expected dotfiles are packed 20 | 21 | ## 7.0.1 22 | 23 | ### Patch Changes 24 | 25 | - 92c51a8: Add missing template readmes 26 | 27 | ## 7.0.0 28 | 29 | ### Major Changes 30 | 31 | - 0d8b629: Templates major bump to v3 32 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # CHANGELOG 2 | 3 | ## 7.0.4 4 | 5 | ### Patch Changes 6 | 7 | - db09b09: Improve JSDocs 8 | 9 | ## 7.0.3 10 | 11 | ### Patch Changes 12 | 13 | - 38c31a9: Dependency updates 14 | 15 | ## 7.0.2 16 | 17 | ### Patch Changes 18 | 19 | - c0b2b83: Ensure expected dotfiles are packed 20 | 21 | ## 7.0.1 22 | 23 | ### Patch Changes 24 | 25 | - 92c51a8: Add missing template readmes 26 | 27 | ## 7.0.0 28 | 29 | ### Major Changes 30 | 31 | - 0d8b629: Templates major bump to v3 32 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docusaurus/test/fixtures/docusaurus.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | title: 'test-gasket', 3 | url: 'https://your-app-url.com', 4 | baseUrl: '/', 5 | organizationName: 'test-gasket', 6 | projectName: 'test-gasket', 7 | themeConfig: { 8 | navbar: { 9 | title: 'test-gasket' 10 | } 11 | }, 12 | presets: [ 13 | [ 14 | 'classic', 15 | ({ 16 | docs: { 17 | routeBasePath: '/' 18 | }, 19 | blog: false 20 | }) 21 | ] 22 | ] 23 | }; 24 | -------------------------------------------------------------------------------- /packages/gasket-fetch/lib/node.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Polyfilled fetch module for Node.js environments. 3 | * 4 | * This module uses `node-fetch` as the base fetch implementation 5 | * and attaches `AbortController` support from the `abort-controller` package. 6 | * @see https://www.npmjs.com/package/node-fetch 7 | * @see https://www.npmjs.com/package/abort-controller 8 | * @type {import('.').fetch} 9 | */ 10 | const fetch = require('node-fetch'); 11 | 12 | fetch.AbortController = require('abort-controller'); 13 | 14 | module.exports = fetch; 15 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/lib/gasket-data-script.js: -------------------------------------------------------------------------------- 1 | import { createElement } from 'react'; 2 | import htmlescape from 'htmlescape'; 3 | 4 | /** 5 | * Renders a script tag with JSON gasketData 6 | * @type {import('./index.d.ts').GasketDataScript} GasketDataScript 7 | */ 8 | export function GasketDataScript(props) { 9 | const { data } = props; 10 | return createElement('script', { 11 | id: 'GasketData', 12 | type: 'application/json', 13 | dangerouslySetInnerHTML: { 14 | __html: htmlescape(data) 15 | } 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /scripts/generate-docs-index/utils/create-dir.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { stat, mkdir } from 'fs/promises'; 3 | 4 | /** 5 | * createDir - Create a directory if it doesn't exist 6 | * @param {string} targetRoot Path of the new directory 7 | * @param {string} dir Name of the new directory 8 | */ 9 | export default async function createDir(targetRoot, dir) { 10 | const tpath = path.join(targetRoot, dir); 11 | try { 12 | await stat(tpath); 13 | } catch { 14 | await mkdir(tpath, { recursive: true }); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /packages/gasket-data/lib/gasket-data.js: -------------------------------------------------------------------------------- 1 | let _gasketData; 2 | 3 | /** @type {import('./index.d.ts').gasketData} */ 4 | export function gasketData() { 5 | if (typeof document === 'undefined') { 6 | // eslint-disable-next-line no-console 7 | console.error('gasketData() called on server side'); 8 | return; 9 | } 10 | 11 | if (!_gasketData) { 12 | const content = (document.getElementById('GasketData') ?? {}).textContent; 13 | _gasketData = content ? JSON.parse(content) : {}; 14 | } 15 | 16 | return _gasketData; 17 | } 18 | -------------------------------------------------------------------------------- /packages/gasket-fetch/test/server.spec.js: -------------------------------------------------------------------------------- 1 | import { assertExports, assertGet, assertAbort, assertPost } from './utils'; 2 | const fetch = require('../lib/node'); 3 | const { AbortController, Request, Headers, Response } = fetch; 4 | 5 | describe('fetch is available in Node.JS', function () { 6 | it('exposes default classes', assertExports(Request, Headers, Response)); 7 | it('can fetch resources', assertGet(fetch)); 8 | it('fetch can POST to API', assertPost(fetch)); 9 | it('can abort fetch', assertAbort(fetch, AbortController)); 10 | }); 11 | -------------------------------------------------------------------------------- /packages/gasket-plugin-express/lib/actions.js: -------------------------------------------------------------------------------- 1 | import { getAppInstance } from './utils.js'; 2 | 3 | const actions = { 4 | /** 5 | * @deprecated 6 | * @param {import('@gasket/core').Gasket} gasket - Gasket instance 7 | * @returns {import('express').Express} - Express instance 8 | */ 9 | getExpressApp(gasket) { 10 | gasket.logger.warn( 11 | `DEPRECATED \`getExpressApp\` action will not be support in future major release.` 12 | ); 13 | return getAppInstance(gasket); 14 | } 15 | }; 16 | 17 | export default actions; 18 | -------------------------------------------------------------------------------- /packages/gasket-plugin-happyfeet/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import type { Plugin } from '@gasket/core'; 4 | import type { HappyFeet, HappyFeetOptions } from 'happy-feet'; 5 | 6 | declare module '@gasket/core' { 7 | export interface GasketConfig { 8 | happyFeet?: HappyFeetOptions; 9 | } 10 | 11 | export interface GasketActions { 12 | getHappyFeet?: (happyConfig?: HappyFeetOptions) => HappyFeet; 13 | } 14 | } 15 | 16 | declare const plugin: Plugin; 17 | 18 | export default plugin; 19 | -------------------------------------------------------------------------------- /packages/create-gasket-app/lib/scaffold/actions/preset-config-hooks.js: -------------------------------------------------------------------------------- 1 | import { withGasketSpinner } from '../with-spinner.js'; 2 | 3 | /** 4 | * presetConfigHooks - exec `presetConfig` hook 5 | * @type {import('../../internal.js').presetConfigHooks} 6 | */ 7 | async function presetConfigHooks({ gasket, context }) { 8 | const config = await gasket.execWaterfall('presetConfig', context); 9 | Object.assign(context.presetConfig, config); 10 | } 11 | 12 | export default withGasketSpinner('Preset Config', presetConfigHooks, { startSpinner: false }); 13 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/__mocks__/@gasket/template-test/template/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test-app", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start" 9 | }, 10 | "dependencies": { 11 | "next": "^14.0.0", 12 | "react": "^18.0.0", 13 | "react-dom": "^18.0.0" 14 | }, 15 | "devDependencies": { 16 | "@types/node": "^20.0.0", 17 | "@types/react": "^18.0.0", 18 | "typescript": "^5.0.0" 19 | } 20 | } 21 | 22 | -------------------------------------------------------------------------------- /packages/gasket-plugin-fastify/lib/actions.js: -------------------------------------------------------------------------------- 1 | import { getAppInstance } from './utils.js'; 2 | 3 | const actions = { 4 | /** 5 | * @deprecated 6 | * @param {import('@gasket/core').Gasket} gasket - Gasket instance 7 | * @returns {import('fastify').FastifyInstance} - Fastify instance 8 | */ 9 | getFastifyApp(gasket) { 10 | gasket.logger.warn( 11 | `DEPRECATED \`getFastifyApp\` action will not be support in future major release.` 12 | ); 13 | return getAppInstance(gasket); 14 | } 15 | }; 16 | 17 | export default actions; 18 | -------------------------------------------------------------------------------- /packages/gasket-plugin-swagger/lib/prompt.js: -------------------------------------------------------------------------------- 1 | /** @type {import('./index.d.ts').promptSwagger} */ 2 | async function promptSwagger(context, prompt) { 3 | if (!('useSwagger' in context)) { 4 | const { useSwagger } = await prompt([ 5 | { 6 | name: 'useSwagger', 7 | message: 'Do you want to use Swagger?', 8 | type: 'confirm', 9 | default: true 10 | } 11 | ]); 12 | 13 | context.useSwagger = useSwagger; 14 | } 15 | 16 | return context; 17 | } 18 | 19 | export default { 20 | promptSwagger 21 | }; 22 | -------------------------------------------------------------------------------- /packages/gasket-plugin-express/generator/jest/jest.config.js: -------------------------------------------------------------------------------- 1 | {{#if typescript}} 2 | const config = { 3 | preset: 'ts-jest/presets/default-esm', 4 | testEnvironment: 'node', 5 | injectGlobals: true, 6 | moduleDirectories: ['node_modules', ''], 7 | moduleNameMapper: { 8 | '^(\\.{1,2}/.*)\\.js$': '$1' 9 | }, 10 | transform: { 11 | '^.+.ts$': ['ts-jest', { useESM: true }] 12 | } 13 | }; 14 | 15 | export default config; 16 | {{else}} 17 | export default { 18 | testEnvironment: 'node', 19 | injectGlobals: true 20 | }; 21 | {{/if}} 22 | -------------------------------------------------------------------------------- /packages/gasket-plugin-fastify/generator/jest/jest.config.js: -------------------------------------------------------------------------------- 1 | {{#if typescript}} 2 | const config = { 3 | preset: 'ts-jest/presets/default-esm', 4 | testEnvironment: 'node', 5 | injectGlobals: true, 6 | moduleDirectories: ['node_modules', ''], 7 | moduleNameMapper: { 8 | '^(\\.{1,2}/.*)\\.js$': '$1' 9 | }, 10 | transform: { 11 | '^.+.ts$': ['ts-jest', { useESM: true }] 12 | } 13 | }; 14 | 15 | export default config; 16 | {{else}} 17 | export default { 18 | testEnvironment: 'node', 19 | injectGlobals: true 20 | }; 21 | {{/if}} 22 | -------------------------------------------------------------------------------- /site/src/components/homepage/header.jsx: -------------------------------------------------------------------------------- 1 | import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; 2 | import useBaseUrl from '@docusaurus/useBaseUrl'; 3 | 4 | export function HomepageHeader() { 5 | const { siteConfig } = useDocusaurusContext(); 6 | 7 | return ( 8 |
9 |
10 |

Introducing {siteConfig.title}

11 |

Framework Maker for JavaScript Applications

12 | Get Started 13 |
14 |
15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/packages/ci-basic-plugin/generator/README.md: -------------------------------------------------------------------------------- 1 | # {{{appName}}} 2 | 3 | {{{appDescription}}} 4 | 5 | ## Local Setup 6 | 7 | To support https for local development, first update your hosts file 8 | to include: 9 | 10 | ``` 11 | 127.0.0.1 local.gasket.dev 12 | ``` 13 | 14 | Now start up the app. 15 | 16 | ```bash 17 | cd {{{appName}}} 18 | 19 | {{{installCmd}}} 20 | 21 | {{{localCmd}}} 22 | ``` 23 | 24 | The app should now be accessible over https on port 8443 at: 25 | 26 | ``` 27 | https://local.gasket.dev:8443 28 | ``` 29 | -------------------------------------------------------------------------------- /packages/gasket-plugin-typescript/test/prompt.test.js: -------------------------------------------------------------------------------- 1 | const prompt = require('../lib/prompt'); 2 | 3 | describe('prompt', () => { 4 | 5 | it('does not contain a prompt hook', () => { 6 | expect(prompt.prompt).toBeUndefined(); 7 | }); 8 | 9 | describe('exports', () => { 10 | 11 | it('promptTypescript', () => { 12 | expect(prompt.promptTypescript).toBeDefined(); 13 | expect(prompt.promptTypescript).toBeInstanceOf(Function); 14 | expect(prompt.promptTypescript.constructor.name).toBe('AsyncFunction'); 15 | }); 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/gasket-request/test/index.test.js: -------------------------------------------------------------------------------- 1 | 2 | 3 | const module = await import('../lib/index.js'); 4 | 5 | describe('index', () => { 6 | it('has expected exports', () => { 7 | const expected = [ 8 | 'GasketRequest', 9 | 'makeGasketRequest', 10 | 'withGasketRequest', 11 | 'withGasketRequestCache', 12 | 'WeakPromiseKeeper' 13 | ]; 14 | 15 | expected.forEach(property => { 16 | expect(module).toHaveProperty(property); 17 | }); 18 | expect(Object.keys(module)).toHaveLength(expected.length); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/create-gasket-app/lib/scaffold/actions/link-modules.js: -------------------------------------------------------------------------------- 1 | import { withSpinner } from '../with-spinner.js'; 2 | 3 | /** 4 | * Links local packages using the selected package manager 5 | * @type {import('../../internal.js').linkModules} 6 | */ 7 | async function linkModules({ context, spinner }) { 8 | const { pkgLinks, pkgManager } = context; 9 | 10 | if (pkgLinks && pkgLinks.length) { 11 | spinner.start(); 12 | await pkgManager.link(pkgLinks); 13 | } 14 | } 15 | 16 | export default withSpinner('Link node modules', linkModules, { startSpinner: false }); 17 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 5 | 6 | ## Summary 7 | 8 | 11 | 12 | ## Test Plan 13 | 14 | 18 | -------------------------------------------------------------------------------- /packages/create-gasket-app/lib/scaffold/utils.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { createRequire } from 'module'; 3 | const require = createRequire(import.meta.url); 4 | 5 | /** @type {import('../internal.js').readConfig} */ 6 | export function readConfig(context, { config, configFile }) { 7 | if (config) { 8 | const parsedConfig = JSON.parse(config); 9 | Object.assign(context, parsedConfig); 10 | } else if (configFile) { 11 | const parsedConfigFile = require(path.resolve(context.cwd, configFile)); 12 | Object.assign(context, parsedConfigFile); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /packages/gasket-plugin-service-worker/lib/express.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | const { getSWConfig } = require('./utils/utils'); 4 | const configureEndpoint = require('./utils/configure-endpoint'); 5 | /** 6 | * Express lifecycle to add an endpoint to serve service worker script 7 | * @type {import('@gasket/core').HookHandler<'express'>} 8 | */ 9 | module.exports = async function express(gasket, app) { 10 | const { staticOutput, url } = getSWConfig(gasket); 11 | if (staticOutput) return; 12 | app.get(url, await configureEndpoint(gasket)); 13 | }; 14 | -------------------------------------------------------------------------------- /RELEASES.md: -------------------------------------------------------------------------------- 1 | # Releases 2 | 3 | Gasket uses [Semantic Versioning]: "major.minor.patch", where major 4 | version changes indicate incompatible changes, minor versions indicate 5 | added functionality that is backwards compatible, and patch changes 6 | do not change the API. 7 | 8 | To create a release, please open a release PR that bumps the version number of 9 | any impacted modules as dictated by [Semantic Versioning]. In the PR description, 10 | please enumerate the changes included in the release. Allow for two approvals before merging. 11 | 12 | [Semantic Versioning]: http://semver.org 13 | -------------------------------------------------------------------------------- /packages/gasket-nextjs/test/gasket-data-provider.test.js: -------------------------------------------------------------------------------- 1 | 2 | import { createElement } from 'react'; 3 | import { render, screen } from '@testing-library/react'; 4 | import { GasketDataProvider } from '../lib/gasket-data-provider.js'; 5 | 6 | import { mockConsoleError } from './helpers.js'; 7 | mockConsoleError(); 8 | 9 | 10 | describe('GasketDataProvider', function () { 11 | it('should render the component', () => { 12 | render(createElement(GasketDataProvider, { gasketData: { test: 'test' } }, 'hello')); 13 | expect(screen.getByText('hello')).toBeDefined(); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/test/apm-transaction.test.js: -------------------------------------------------------------------------------- 1 | import apmTransaction from '../lib/apm-transaction.js'; 2 | 3 | describe('The apmTransaction hook', () => { 4 | 5 | it('adds a locale label', async () => { 6 | const gasket = { 7 | actions: { 8 | getIntlLocale: vi.fn().mockResolvedValue('es-MX') 9 | } 10 | }; 11 | 12 | const req = {}; 13 | const transaction = { setLabel: vi.fn() }; 14 | 15 | await apmTransaction(gasket, transaction, { req }); 16 | 17 | expect(transaction.setLabel).toHaveBeenCalledWith('locale', 'es-MX'); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/docs/docker-deployment.md: -------------------------------------------------------------------------------- 1 | # Gasket Next.js Docker Deployment 2 | 3 | Assuming you have domains, certs, load balancing, etc setup in your deployment 4 | environment. Here is a sample definition for a container that runs a Gasket 5 | application: 6 | 7 | ```Dockerfile 8 | FROM node:14.15.0-alpine3.11 9 | 10 | COPY --chown=node:node . /home/node/your_app/ 11 | 12 | WORKDIR /home/node/your_app 13 | 14 | USER node:node 15 | 16 | RUN npm ci 17 | RUN npm run build 18 | RUN npm prune --production 19 | 20 | EXPOSE 8080 21 | 22 | ENTRYPOINT ["npm", "start"] 23 | ``` 24 | -------------------------------------------------------------------------------- /packages/gasket-cjs/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # `@gasket/cjs` 2 | 3 | ## 7.1.0 4 | 5 | ### Minor Changes 6 | 7 | - 7d1d8bf: Remove createRequire & new URL of package.json files 8 | 9 | ## 7.0.2 10 | 11 | ### Patch Changes 12 | 13 | - f5e6942: Include EXAMPLES.md when publishing 14 | - d794a98: convert testing framework in esm packages to vitest 15 | - da18ea5: Add code examples 16 | 17 | ## 7.0.1 18 | 19 | ### Patch Changes 20 | 21 | - f5e4ad7: Fix to only adjust .cjs for relative imports 22 | - 5d38a2e: Eslint version 9 23 | 24 | ## 7.0.0 25 | 26 | ### Major Changes 27 | 28 | - 660cf7a: Initial release 29 | -------------------------------------------------------------------------------- /packages/gasket-plugin-service-worker/lib/fastify.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | const { getSWConfig } = require('./utils/utils'); 4 | const configureEndpoint = require('./utils/configure-endpoint'); 5 | 6 | /** 7 | * Fastify lifecycle to add an endpoint to serve service worker script 8 | * @type {import('@gasket/core').HookHandler<'fastify'>} 9 | */ 10 | module.exports = async function fastify(gasket, app) { 11 | const { staticOutput, url } = getSWConfig(gasket); 12 | 13 | if (staticOutput) return; 14 | app.get(url, await configureEndpoint(gasket)); 15 | }; 16 | -------------------------------------------------------------------------------- /packages/gasket-preset-nextjs/lib/preset-prompt.js: -------------------------------------------------------------------------------- 1 | import { 2 | promptNextServerType, 3 | promptNextDevProxy 4 | } from '@gasket/plugin-nextjs/prompts'; 5 | import typescriptPrompts from '@gasket/plugin-typescript/prompts'; 6 | 7 | /** 8 | * presetPrompt hook 9 | * @type {import('@gasket/core').PresetHook<'presetPrompt'>} 10 | */ 11 | export default async function presetPrompt(gasket, context, { prompt }) { 12 | await typescriptPrompts.promptTypescript(context, prompt); 13 | await promptNextServerType(context, prompt); 14 | await promptNextDevProxy(context, prompt); 15 | 16 | return context; 17 | } 18 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/gasket.config.envs.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | someService: { 3 | requestRate: 9000, 4 | url: 'https://some.url/' 5 | }, 6 | other: 'setting', 7 | environments: { 8 | local: { 9 | someService: { url: 'https://local.some-dev.url/' } 10 | }, 11 | dev: { 12 | someService: { url: 'https://some-dev.url/' }, 13 | anotherService: { url: 'https://another-dev.url/' } 14 | }, 15 | test: { 16 | someService: { url: 'https://some-test.url/' }, 17 | anotherService: { url: 'https://another-test.url/' } 18 | } 19 | } 20 | }; 21 | -------------------------------------------------------------------------------- /packages/gasket-intl/lib/constants.js: -------------------------------------------------------------------------------- 1 | /** @type {import('./index.d.ts').LocaleFileStatus} */ 2 | export const LocaleFileStatus = { 3 | notHandled: 'notHandled', 4 | notLoaded: 'notLoaded', 5 | loading: 'loading', 6 | loaded: 'loaded', 7 | error: 'error' 8 | }; 9 | 10 | /** @type {import('./index.d.ts').LocaleFileStatus[]} */ 11 | export const LocaleFileStatusPriority = [ 12 | LocaleFileStatus.notHandled, 13 | LocaleFileStatus.notLoaded, 14 | LocaleFileStatus.loading, 15 | LocaleFileStatus.error, 16 | LocaleFileStatus.loaded 17 | ]; 18 | 19 | export const isBrowser = typeof window !== 'undefined'; 20 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs-graphs/README.md: -------------------------------------------------------------------------------- 1 | # @gasket/plugin-docs-graphs 2 | 3 | The plugin hooks the **docsGenerate** lifecycle to provide a [`mermaid`] graph 4 | of a given application's lifecycles. 5 | 6 | ## Installation 7 | 8 | ``` 9 | npm i @gasket/plugin-docs-graphs 10 | ``` 11 | 12 | Update your `gasket` file plugin configuration: 13 | 14 | ```diff 15 | // gasket.js 16 | 17 | + import pluginDocsGraphs from '@gasket/plugin-docs-graphs'; 18 | 19 | export default makeGasket({ 20 | plugins: [ 21 | + pluginDocsGraphs 22 | ] 23 | }); 24 | ``` 25 | 26 | [`mermaid`]: https://mermaid-js.github.io/mermaid/#/ 27 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docs/lib/docs-setup.js: -------------------------------------------------------------------------------- 1 | import { 2 | txGasketPackageLinks, 3 | txGasketUrlLinks, 4 | txAbsoluteLinks 5 | } from './utils/transforms.js'; 6 | 7 | /** 8 | * Specify what files to copy and transform 9 | * @type {import('@gasket/core').HookHandler<'docsSetup'>} 10 | */ 11 | export default function docsSetup() { 12 | return { 13 | link: 'README.md', 14 | files: [ 15 | 'README.md', 16 | 'docs/**/*', 17 | 'LICENSE.md' 18 | ], 19 | transforms: [ 20 | txGasketPackageLinks, 21 | txGasketUrlLinks, 22 | txAbsoluteLinks 23 | ] 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /packages/gasket-plugin-happyfeet/lib/actions.js: -------------------------------------------------------------------------------- 1 | import { createRequire } from 'module'; 2 | const require = createRequire(import.meta.url); 3 | const happyFeet = require('happy-feet'); 4 | 5 | let happy; 6 | 7 | /** @type {import('@gasket/core').ActionHandler<'getHappyFeet'>} */ 8 | function getHappyFeet(gasket, happyConfig) { 9 | if (!happy) { 10 | const config = gasket.config.happyFeet || happyConfig || {}; 11 | happy = happyFeet(config); 12 | } 13 | return happy; 14 | } 15 | 16 | export const actions = { 17 | getHappyFeet 18 | }; 19 | 20 | export const testReset = () => { 21 | happy = null; 22 | }; 23 | -------------------------------------------------------------------------------- /packages/gasket-plugin-https/lib/configure.js: -------------------------------------------------------------------------------- 1 | /** @type {import('@gasket/core').HookHandler<'configure'>} */ 2 | export default function configure(gasket, config) { 3 | const { root } = config; 4 | 5 | const setRoot = (serverConfig) => { 6 | if (!serverConfig) return; 7 | if (serverConfig.root) return; 8 | 9 | if (Array.isArray(serverConfig)) { 10 | serverConfig.forEach(item => { 11 | item.root ??= root; 12 | }); 13 | } else { 14 | serverConfig.root = root; 15 | } 16 | }; 17 | 18 | setRoot(config.https); 19 | setRoot(config.http2); 20 | 21 | return config; 22 | } 23 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/mocha/app-router/test/app/page.test.js: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import { describe, it } from 'mocha'; 3 | import { expect } from 'chai'; 4 | import React from 'react'; 5 | 6 | import IndexPage from '../../app/page.jsx'; 7 | 8 | // 9 | // The following test utilities are also available: 10 | // 11 | // import sinon from 'sinon'; 12 | // 13 | 14 | describe('IndexPage', () => { 15 | it('renders page', () => { 16 | render( 17 | 18 | ); 19 | expect(screen.getByText('Welcome to Gasket!')).to.be.ok; 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/gasket-plugin-nextjs/generator/mocha/app-router/test/app/page.test.tsx: -------------------------------------------------------------------------------- 1 | import { render, screen } from '@testing-library/react'; 2 | import { describe, it } from 'mocha'; 3 | import { expect } from 'chai'; 4 | import React from 'react'; 5 | 6 | import IndexPage from '../../app/page.tsx'; 7 | 8 | // 9 | // The following test utilities are also available: 10 | // 11 | // import sinon from 'sinon'; 12 | // 13 | 14 | describe('IndexPage', () => { 15 | it('renders page', () => { 16 | render( 17 | 18 | ); 19 | expect(screen.getByText('Welcome to Gasket!')).to.be.ok; 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docusaurus/lib/prompt.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | /** @type {import('@gasket/core').HookHandler<'prompt'>} */ 4 | export default async function promptHook(gasket, context, { prompt }) { 5 | if (context.useDocs === false) return context; 6 | if ('useDocusaurus' in context) return context; 7 | 8 | const { useDocusaurus } = await prompt([ 9 | { 10 | name: 'useDocusaurus', 11 | message: 'Do you want to use Docusaurus for documentation?', 12 | type: 'confirm' 13 | } 14 | ]); 15 | 16 | return Object.assign({}, context, { useDocusaurus }); 17 | } 18 | -------------------------------------------------------------------------------- /packages/gasket-plugin-swagger/lib/post-create.js: -------------------------------------------------------------------------------- 1 | import buildSwaggerDefinition from './build-swagger-definition.js'; 2 | import path from 'path'; 3 | 4 | /** @type {import('@gasket/core').HookHandler<'postCreate'>} */ 5 | export default async function postCreateHook(gasket, createContext) { 6 | const root = createContext.dest; 7 | const { jsdoc } = createContext.gasketConfig.fields.swagger; 8 | const apis = jsdoc.apis.map(glob => path.join(root, glob)); 9 | const swagger = { 10 | jsdoc: { 11 | ...jsdoc, 12 | apis 13 | } 14 | }; 15 | await buildSwaggerDefinition(gasket, { root, swagger }); 16 | } 17 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/gasket.config.dcs.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | someService: { 3 | extraSecure: false 4 | }, 5 | other: 'setting', 6 | environments: { 7 | 'dev': { 8 | someService: { url: 'https://some-dev.url/' } 9 | }, 10 | 'test': { 11 | someService: { url: 'https://some-test.url/' } 12 | }, 13 | 'prod': { 14 | someService: { extraSecure: true } 15 | }, 16 | 'prod.dc1': { 17 | someService: { url: 'http://some-prod.dc1.url/' } 18 | }, 19 | 'prod.dc2': { 20 | someService: { url: 'http://some-prod.dc2.url/' } 21 | } 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /packages/gasket-plugin-data/lib/init-redux-state.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | 4 | /** 5 | * @type {import('@gasket/core').HookHandler<'initReduxState'>} 6 | */ 7 | export default async function initReduxState(gasket, state, { req }) { 8 | /** @type {import('./index.js').ReduxState} */ 9 | const typedState = state || {}; 10 | const publicGasketData = await gasket.actions.getPublicGasketData(req); 11 | return { 12 | ...typedState, 13 | gasketData: { 14 | ...(typedState.gasketData || {}), 15 | ...publicGasketData 16 | } 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /site/src/pages/index.js: -------------------------------------------------------------------------------- 1 | import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; 2 | import { HomepageHeader, HomepageSections } from '../components/homepage'; 3 | import Layout from '@theme/Layout'; 4 | 5 | export default function Home() { 6 | const { siteConfig } = useDocusaurusContext(); 7 | return ( 8 | 11 |
12 | 13 | 14 |
15 |
16 | ); 17 | } 18 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/lib/build.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { getIntlConfig } from './utils/configure-utils.js'; 4 | import buildManifest from './build-manifest.js'; 5 | import buildModules from './build-modules.js'; 6 | 7 | /** @type {import('@gasket/core').HookHandler<'build'>} */ 8 | async function build(gasket) { 9 | 10 | const intlConfig = getIntlConfig(gasket); 11 | if (intlConfig.modules) { 12 | await buildModules(gasket); 13 | } 14 | await buildManifest(gasket); 15 | } 16 | 17 | export default { 18 | timing: { 19 | first: true 20 | }, 21 | handler: build 22 | }; 23 | -------------------------------------------------------------------------------- /packages/gasket-typescript-tests/test/plugin-docusaurus.spec.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable vitest/expect-expect, jest/expect-expect */ 2 | import { GasketConfigDefinition } from '@gasket/core'; 3 | import '@gasket/plugin-docusaurus'; 4 | 5 | describe('@gasket/plugin-docusaurus', () => { 6 | it('adds a docusaurus config section', () => { 7 | const config: GasketConfigDefinition = { 8 | plugins: [{ name: 'example-plugin', version: '', description: '', hooks: {} }], 9 | docusaurus: { 10 | rootDir: 'docs', 11 | docsDir: 'docs', 12 | port: '3000', 13 | host: 'localhost' 14 | } 15 | }; 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/gasket-react-intl/lib/use-locale-file.js: -------------------------------------------------------------------------------- 1 | import { useContext } from 'react'; 2 | import { GasketIntlContext } from './context.js'; 3 | import { ensureArray, needsToLoad } from './utils.js'; 4 | 5 | /** 6 | * React hook that dispatches locale file load and returns status 7 | * @type {import('./index.d.ts').useLocaleFile} 8 | */ 9 | export default function useLocaleFile(...localeFilePaths) { 10 | const paths = ensureArray(localeFilePaths); 11 | const { getStatus, load } = useContext(GasketIntlContext); 12 | const lowestStatus = getStatus(...paths); 13 | if (needsToLoad(lowestStatus)) load(...paths); 14 | return lowestStatus; 15 | } 16 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/template/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import gasket from '@/gasket'; 3 | import { withGasketData } from '@gasket/nextjs/layout'; 4 | 5 | /** 6 | * Root layout component 7 | * @param {object} props - Component props 8 | * @param {React.ReactNode} props.children - Child components 9 | * @returns {React.ReactElement} Root layout 10 | */ 11 | function RootLayout({ children }: { children: React.ReactNode; }): React.ReactElement { 12 | return ( 13 | 14 | {children} 15 | 16 | ); 17 | } 18 | 19 | export default withGasketData(gasket)(RootLayout); 20 | -------------------------------------------------------------------------------- /packages/gasket-typescript-tests/test/plugin-analyze.spec.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable vitest/expect-expect, jest/expect-expect */ 2 | import type { GasketConfigDefinition } from '@gasket/core'; 3 | import '@gasket/plugin-analyze'; 4 | 5 | describe('@gasket/plugin-analyze', () => { 6 | it('adds bundleAnalyzerConfig to GasketConfig', () => { 7 | const config: GasketConfigDefinition = { 8 | plugins: [{ name: 'example-plugin', version: '', description: '', hooks: {} }], 9 | bundleAnalyzerConfig: { 10 | browser: { 11 | // @ts-expect-error 12 | nonsense: 'value' 13 | } 14 | } 15 | }; 16 | }); 17 | }); 18 | -------------------------------------------------------------------------------- /packages/create-gasket-app/test/fixtures/gasket.config.with-env.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: 'prod.dc1', 3 | someService: { 4 | extraSecure: false 5 | }, 6 | other: 'setting', 7 | environments: { 8 | 'dev': { 9 | someService: { url: 'https://some-dev.url/' } 10 | }, 11 | 'test': { 12 | someService: { url: 'https://some-test.url/' } 13 | }, 14 | 'prod': { 15 | someService: { extraSecure: true } 16 | }, 17 | 'prod.dc1': { 18 | someService: { url: 'http://some-prod.dc1.url/' } 19 | }, 20 | 'prod.dc2': { 21 | someService: { url: 'http://some-prod.dc2.url/' } 22 | } 23 | } 24 | }; 25 | -------------------------------------------------------------------------------- /packages/gasket-fetch/test/test-server.js: -------------------------------------------------------------------------------- 1 | import http from 'http'; 2 | 3 | export const createServer = () => { 4 | return http.createServer((req, res) => { 5 | const chunks = []; 6 | 7 | req.on('data', chunk => chunks.push(chunk)); 8 | req.on('end', () => { 9 | res.writeHead(200, { 10 | 'content-type': 'application/json', 11 | 'cache-control': 'max-age=0, no-cache, no-store', 12 | 'access-control-allow-origin': '*' 13 | }); 14 | 15 | res.end(JSON.stringify({ echo: JSON.parse(chunks.join()) })); 16 | }); 17 | }); 18 | }; 19 | 20 | export const closeServer = (server) => { 21 | server.close(); 22 | }; 23 | -------------------------------------------------------------------------------- /packages/gasket-plugin-fastify/generator/jest/test/index.test.js: -------------------------------------------------------------------------------- 1 | import { jest } from '@jest/globals'; 2 | import { defaultHandler } from '../plugins/routes-plugin.js'; 3 | 4 | describe('Routes', () => { 5 | let mockRequest, mockResponse; 6 | beforeEach(() => { 7 | mockRequest = {}; 8 | mockResponse = { 9 | statusCode: 200, 10 | send: jest.fn() 11 | }; 12 | }); 13 | 14 | it('defaultHandler should use expeced message', async () => { 15 | await defaultHandler(mockRequest, mockResponse); 16 | expect(mockResponse.send).toHaveBeenCalledWith({ 17 | message: 'Welcome to your default route...' 18 | }); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowJs": true, 4 | "checkJs": true, 5 | "esModuleInterop": true, 6 | "jsx": "react", 7 | "moduleResolution": "nodenext", 8 | "module": "NodeNext", 9 | "noEmit": true, 10 | "resolveJsonModule": true, 11 | "skipLibCheck": true, 12 | "target": "ES2020", 13 | "allowImportingTsExtensions": true, 14 | "lib": [ 15 | "esnext", 16 | "dom" 17 | ], 18 | "types": [ 19 | "@types/jest", 20 | "@types/node" 21 | ] 22 | }, 23 | "exclude": [ 24 | "**/test", 25 | "**/coverage", 26 | "**/generator", 27 | "**/cjs" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /packages/gasket-plugin-fastify/generator/vitest/test/index.test.js: -------------------------------------------------------------------------------- 1 | import { vi, expect } from 'vitest'; 2 | import { defaultHandler } from '../plugins/routes-plugin.js'; 3 | 4 | describe('Routes', () => { 5 | let mockRequest, mockResponse; 6 | 7 | beforeEach(() => { 8 | mockRequest = {}; 9 | mockResponse = { 10 | statusCode: 200, 11 | send: vi.fn() 12 | }; 13 | }); 14 | 15 | it('defaultHeader should use expected message', async () => { 16 | await defaultHandler(mockRequest, mockResponse); 17 | expect(mockResponse.send).toHaveBeenCalledWith({ 18 | message: 'Welcome to your default route...' 19 | }); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/gasket-plugin-redux/lib/webpack-config.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | /** @type {import('@gasket/core').HookHandler<'webpackConfig'>} */ 4 | module.exports = function webpackConfigHook( 5 | gasket, 6 | webpackConfig, 7 | { webpack } 8 | ) { 9 | const { redux: reduxConfig } = gasket.config; 10 | 11 | if (!reduxConfig.makeStore) { 12 | return webpackConfig; 13 | } 14 | 15 | return { 16 | ...webpackConfig, 17 | plugins: [ 18 | ...(webpackConfig.plugins || []), 19 | new webpack.EnvironmentPlugin({ 20 | GASKET_MAKE_STORE_FILE: reduxConfig.makeStore 21 | }) 22 | ] 23 | }; 24 | }; 25 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-app/template/intl.ts: -------------------------------------------------------------------------------- 1 | /* -- GENERATED FILE - DO NOT EDIT -- */ 2 | import { makeIntlManager } from '@gasket/intl'; 3 | import type { LocaleManifest } from '@gasket/intl'; 4 | 5 | const manifest: LocaleManifest = { 6 | defaultLocaleFilePath: 'locales', 7 | staticLocaleFilePaths: [ 8 | 'locales' 9 | ], 10 | defaultLocale: 'en-US', 11 | locales: [ 12 | 'en-US', 13 | 'fr-FR' 14 | ], 15 | localesMap: {}, 16 | imports: { 17 | 'locales/en-US': () => import('./locales/en-US.json'), 18 | 'locales/fr-FR': () => import('./locales/fr-FR.json') 19 | } 20 | }; 21 | 22 | export default makeIntlManager(manifest); 23 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-express/template/intl.ts: -------------------------------------------------------------------------------- 1 | /* -- GENERATED FILE - DO NOT EDIT -- */ 2 | import { makeIntlManager } from '@gasket/intl'; 3 | import type { LocaleManifest } from '@gasket/intl'; 4 | 5 | const manifest: LocaleManifest = { 6 | defaultLocaleFilePath: 'locales', 7 | staticLocaleFilePaths: [ 8 | 'locales' 9 | ], 10 | defaultLocale: 'en-US', 11 | locales: [ 12 | 'en-US', 13 | 'fr-FR' 14 | ], 15 | localesMap: {}, 16 | imports: { 17 | 'locales/en-US': () => import('./locales/en-US.json'), 18 | 'locales/fr-FR': () => import('./locales/fr-FR.json') 19 | } 20 | }; 21 | 22 | export default makeIntlManager(manifest); 23 | -------------------------------------------------------------------------------- /packages/gasket-template-nextjs-pages/template/intl.ts: -------------------------------------------------------------------------------- 1 | /* -- GENERATED FILE - DO NOT EDIT -- */ 2 | import { makeIntlManager } from '@gasket/intl'; 3 | import type { LocaleManifest } from '@gasket/intl'; 4 | 5 | const manifest: LocaleManifest = { 6 | defaultLocaleFilePath: 'locales', 7 | staticLocaleFilePaths: [ 8 | 'locales' 9 | ], 10 | defaultLocale: 'en-US', 11 | locales: [ 12 | 'en-US', 13 | 'fr-FR' 14 | ], 15 | localesMap: {}, 16 | imports: { 17 | 'locales/en-US': () => import('./locales/en-US.json'), 18 | 'locales/fr-FR': () => import('./locales/fr-FR.json') 19 | } 20 | }; 21 | 22 | export default makeIntlManager(manifest); 23 | -------------------------------------------------------------------------------- /packages/gasket-plugin-elastic-apm/lib/actions.js: -------------------------------------------------------------------------------- 1 | import { withGasketRequestCache } from '@gasket/request'; 2 | 3 | /** @type {import('@gasket/core').ActionHandler<'getApmTransaction'>} */ 4 | export const getApmTransaction = withGasketRequestCache( 5 | async function getApmTransaction(gasket, req) { 6 | const apm = await import('elastic-apm-node'); 7 | 8 | if (!apm?.default?.isStarted()) { 9 | return; 10 | } 11 | 12 | const transaction = apm.default.currentTransaction; 13 | if (!transaction) { 14 | return; 15 | } 16 | 17 | await gasket.exec('apmTransaction', transaction, { req }); 18 | 19 | return transaction; 20 | } 21 | ); 22 | -------------------------------------------------------------------------------- /packages/gasket-plugin-https/lib/create.js: -------------------------------------------------------------------------------- 1 | import { readFileSync } from 'fs'; 2 | import { fileURLToPath } from 'url'; 3 | import { dirname, join } from 'path'; 4 | 5 | const __filename = fileURLToPath(import.meta.url); 6 | const __dirname = dirname(__filename); 7 | 8 | const packageInfo = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf8')); 9 | const { name, version } = packageInfo; 10 | 11 | /** @type {import('@gasket/core').HookHandler<'create'>} */ 12 | export default async function create(gasket, { pkg, gasketConfig }) { 13 | gasketConfig.addPlugin('pluginHttps', name); 14 | pkg.add('dependencies', { 15 | [name]: `^${version}` 16 | }); 17 | } 18 | -------------------------------------------------------------------------------- /packages/gasket-typescript-tests/vitest.config.js: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vitest/config'; 2 | 3 | export default defineConfig({ 4 | test: { 5 | globals: true 6 | }, 7 | resolve: { 8 | alias: { 9 | // Mock docusaurus dependencies that aren't installed in test environment 10 | '@docusaurus/core': new URL('./test/__mocks__/docusaurus-core.js', import.meta.url).pathname, 11 | '@docusaurus/core/package.json': new URL('./test/__mocks__/docusaurus-core-package.json', import.meta.url).pathname, 12 | '@docusaurus/preset-classic': new URL('./test/__mocks__/docusaurus-preset-classic.js', import.meta.url).pathname 13 | } 14 | } 15 | }); 16 | 17 | -------------------------------------------------------------------------------- /packages/gasket-data/lib/resolve-gasket-data.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import { gasketData } from './gasket-data.js'; 4 | 5 | /** @type {import('./index.d.ts').resolveGasketData} */ 6 | export async function resolveGasketData(gasket, req) { 7 | let data; 8 | if (typeof document !== 'undefined') { 9 | data = gasketData(); 10 | } else { 11 | // Server-side: req may be RequestLike or IncomingMessage. 12 | // getPublicGasketData expects RequestLike, so we cast here. 13 | data = await gasket.actions.getPublicGasketData( 14 | /** @type {import('@gasket/request').RequestLike} */(req) 15 | ); 16 | } 17 | return data; 18 | } 19 | -------------------------------------------------------------------------------- /packages/gasket-plugin-express/generator/vitest/test/index.test.js: -------------------------------------------------------------------------------- 1 | import { defaultHandler } from '../plugins/routes-plugin.js'; 2 | import { vi, expect } from 'vitest'; 3 | 4 | describe('Routes', () => { 5 | let mockRequest, mockResponse; 6 | beforeEach(() => { 7 | mockRequest = {}; 8 | mockResponse = { 9 | status: vi.fn().mockReturnThis(), 10 | json: vi.fn() 11 | }; 12 | }); 13 | 14 | it('defaultHandler should use expected message', async () => { 15 | await defaultHandler(mockRequest, mockResponse); 16 | expect(mockResponse.json).toHaveBeenCalledWith({ 17 | message: 'Welcome to your default route...' 18 | }); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/gasket-plugin-workbox/test/build.spec.js: -------------------------------------------------------------------------------- 1 | const build = require('../lib/build'); 2 | const utils = require('../lib/utils'); 3 | const { copyWorkboxLibraries } = require('workbox-build'); 4 | 5 | describe('build', () => { 6 | let mockGasket; 7 | 8 | beforeEach(() => { 9 | mockGasket = { 10 | config: { 11 | root: '/some-root', 12 | workbox: utils.defaultConfig 13 | } 14 | }; 15 | }); 16 | 17 | it('copies workbox libraries to output dir', () => { 18 | build(mockGasket); 19 | const expectedOutput = utils.getOutputDir(mockGasket); 20 | expect(copyWorkboxLibraries).toHaveBeenCalledWith(expectedOutput); 21 | }); 22 | }); 23 | -------------------------------------------------------------------------------- /packages/gasket-preset-nextjs/README.md: -------------------------------------------------------------------------------- 1 | # @gasket/preset-nextjs 2 | 3 | Framework for building Next.js apps using Gasket. 4 | 5 | ## Installation 6 | 7 | ``` 8 | npx create-gasket-app@latest --presets @gasket/preset-nextjs 9 | ``` 10 | 11 | ## Plugins 12 | 13 | - [@gasket/plugin-express](/packages/gasket-plugin-express/README.md) 14 | - [@gasket/plugin-https](/packages/gasket-plugin-https/README.md) 15 | - [@gasket/plugin-winston](/packages/gasket-plugin-winston/README.md) 16 | - [@gasket/plugin-nextjs](/packages/gasket-plugin-nextjs/README.md) 17 | - [@gasket/plugin-webpack](/packages/gasket-plugin-webpack/README.md) 18 | 19 | ## License 20 | 21 | [MIT](./LICENSE.md) 22 | -------------------------------------------------------------------------------- /packages/create-gasket-app/lib/scaffold/actions/write-pkg.js: -------------------------------------------------------------------------------- 1 | import path from 'path'; 2 | import { writeFile } from 'fs/promises'; 3 | import { withSpinner } from '../with-spinner.js'; 4 | 5 | /** 6 | * Writes the contents of `pkg` to the app's package.json. 7 | * @type {import('../../internal.js').writePkg} 8 | */ 9 | async function writePkg({ context }) { 10 | const { dest, pkg, generatedFiles } = context; 11 | const fileName = 'package.json'; 12 | const filePath = path.join(dest, fileName); 13 | await writeFile(filePath, JSON.stringify(pkg, null, 2), 'utf8'); 14 | generatedFiles.add(fileName); 15 | } 16 | 17 | export default withSpinner('Write package.json', writePkg); 18 | -------------------------------------------------------------------------------- /packages/gasket-plugin-command/lib/utils/create-option.js: -------------------------------------------------------------------------------- 1 | import { Option } from 'commander'; 2 | 3 | /** 4 | * Create a commander option 5 | * @type {import('../internal.d.ts').createOption} 6 | */ 7 | export function createOption(definition) { 8 | const option = new Option(...definition.options); 9 | const { defaultValue, conflicts, parse, hidden, required } = definition; 10 | 11 | if (conflicts.length) option.conflicts(definition.conflicts); 12 | if (hidden) option.hideHelp(); 13 | if (typeof defaultValue !== 'undefined') option.default(defaultValue); 14 | if (parse) option.argParser(parse); 15 | if (required) option.makeOptionMandatory(); 16 | return option; 17 | } 18 | -------------------------------------------------------------------------------- /packages/gasket-plugin-docusaurus/lib/index.d.ts: -------------------------------------------------------------------------------- 1 | import type { Plugin } from '@gasket/core'; 2 | export interface DocusaurusConfig { 3 | rootDir?: string; 4 | docsDir?: string; 5 | port?: string; 6 | host?: string; 7 | } 8 | declare module 'create-gasket-app' { 9 | export interface CreateContext { 10 | useDocusaurus?: boolean; 11 | } 12 | } 13 | 14 | declare module '@gasket/core' { 15 | 16 | export interface GasketConfig { 17 | docusaurus?: DocusaurusConfig; 18 | } 19 | } 20 | 21 | export interface BaseConfig { 22 | /** Preset name */ 23 | name: string; 24 | path: string; 25 | } 26 | 27 | declare const plugin: Plugin; 28 | 29 | export default plugin; 30 | 31 | -------------------------------------------------------------------------------- /packages/gasket-plugin-manifest/lib/serve.js: -------------------------------------------------------------------------------- 1 | const baseConfig = require('./base-config'); 2 | /** 3 | * If configured, serve the resolved manifest.json 4 | * @param {import("@gasket/core").Gasket} gasket The gasket API 5 | * @param {object} app gasket's express/fastify server 6 | * @async 7 | */ 8 | async function serve(gasket, app) { 9 | const { config } = gasket; 10 | const { staticOutput } = (config && config.manifest) || {}; 11 | const { path } = (config && config.manifest) || {}; 12 | 13 | if (!staticOutput) { 14 | app.get(path || baseConfig.path, (req, res) => { 15 | res.send(req.manifest || {}); 16 | }); 17 | } 18 | } 19 | 20 | module.exports = serve; 21 | -------------------------------------------------------------------------------- /packages/create-gasket-app/lib/scaffold/actions/preset-prompt-hooks.js: -------------------------------------------------------------------------------- 1 | import inquirer from 'inquirer'; 2 | import { withGasketSpinner } from '../with-spinner.js'; 3 | 4 | /** 5 | * presetPromptHooks - exec `presetPrompt` hook 6 | * @type {import('../../internal.js').presetPromptHooks} 7 | */ 8 | async function presetPromptHooks({ gasket, context }) { 9 | const prompt = context.prompts ? inquirer.createPromptModule() : () => ({}); 10 | 11 | const nextContext = await gasket.execWaterfall('presetPrompt', context, { prompt }); 12 | 13 | Object.assign(context, nextContext); 14 | } 15 | 16 | export default withGasketSpinner('Preset prompts', presetPromptHooks, { startSpinner: false }); 17 | -------------------------------------------------------------------------------- /packages/gasket-plugin-fastify/generator/vitest/test/index.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect, beforeEach, vi } from 'vitest'; 2 | import { defaultHandler } from '../plugins/routes-plugin.js'; 3 | 4 | describe('Routes', () => { 5 | let mockRequest, mockResponse; 6 | 7 | beforeEach(() => { 8 | mockRequest = {}; 9 | mockResponse = { 10 | statusCode: 200, 11 | send: vi.fn() 12 | }; 13 | }); 14 | 15 | it('defaultHeader should use expected message', async () => { 16 | await defaultHandler(mockRequest, mockResponse); 17 | expect(mockResponse.send).toHaveBeenCalledWith({ 18 | message: 'Welcome to your default route...' 19 | }); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/gasket-template-api-express/template/swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "title": "express-ts", 4 | "version": "0.0.0" 5 | }, 6 | "swagger": "2.0", 7 | "paths": { 8 | "/default": { 9 | "get": { 10 | "summary": "Get default route", 11 | "produces": [ 12 | "application/json" 13 | ], 14 | "responses": { 15 | "200": { 16 | "description": "Returns welcome message.", 17 | "content": "application/json" 18 | } 19 | } 20 | } 21 | } 22 | }, 23 | "definitions": {}, 24 | "responses": {}, 25 | "parameters": {}, 26 | "securityDefinitions": {}, 27 | "tags": [] 28 | } -------------------------------------------------------------------------------- /packages/gasket-template-api-fastify/template/swagger.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "title": "fastify-ts", 4 | "version": "0.0.0" 5 | }, 6 | "swagger": "2.0", 7 | "paths": { 8 | "/default": { 9 | "get": { 10 | "summary": "Get default route", 11 | "produces": [ 12 | "application/json" 13 | ], 14 | "responses": { 15 | "200": { 16 | "description": "Returns welcome message.", 17 | "content": "application/json" 18 | } 19 | } 20 | } 21 | } 22 | }, 23 | "definitions": {}, 24 | "responses": {}, 25 | "parameters": {}, 26 | "securityDefinitions": {}, 27 | "tags": [] 28 | } -------------------------------------------------------------------------------- /packages/gasket-template-api-fastify/template/test/index.test.ts: -------------------------------------------------------------------------------- 1 | import { describe, it, expect, beforeEach, vi } from 'vitest'; 2 | import { defaultHandler } from '../plugins/routes-plugin.js'; 3 | 4 | describe('Routes', () => { 5 | let mockRequest, mockResponse; 6 | 7 | beforeEach(() => { 8 | mockRequest = {}; 9 | mockResponse = { 10 | statusCode: 200, 11 | send: vi.fn() 12 | }; 13 | }); 14 | 15 | it('defaultHeader should use expected message', async () => { 16 | await defaultHandler(mockRequest, mockResponse); 17 | expect(mockResponse.send).toHaveBeenCalledWith({ 18 | message: 'Welcome to your default route...' 19 | }); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/create-gasket-app/lib/utils/create-option.js: -------------------------------------------------------------------------------- 1 | import { Option } from 'commander'; 2 | 3 | /** 4 | * createOption - Create a commander option 5 | * @type {import('../internal.js').createOption} 6 | */ 7 | export function createOption(definition) { 8 | const option = new Option(...definition.options); 9 | const { defaultValue, conflicts, parse, hidden, required } = definition; 10 | 11 | if (conflicts.length) option.conflicts(definition.conflicts); 12 | if (hidden) option.hideHelp(); 13 | if (typeof defaultValue !== 'undefined') option.default(defaultValue); 14 | if (parse) option.argParser(parse); 15 | if (required) option.makeOptionMandatory(); 16 | return option; 17 | } 18 | -------------------------------------------------------------------------------- /packages/gasket-intl/lib/index.js: -------------------------------------------------------------------------------- 1 | import { IntlManager } from './intl-manager.js'; 2 | import { InternalIntlManager } from './internal-intl-manager.js'; 3 | import { LocaleFileStatus, LocaleFileStatusPriority } from './constants.js'; 4 | import { safePaths, lowestStatus } from './locale-handler.js'; 5 | 6 | /** 7 | * Creates an IntlManager instance 8 | * @type {import('./index.d.ts').makeIntlManager} 9 | */ 10 | function makeIntlManager(manifest) { 11 | const manager = new InternalIntlManager(manifest); 12 | return new IntlManager(manager); 13 | } 14 | 15 | export { 16 | makeIntlManager, 17 | LocaleFileStatus, 18 | LocaleFileStatusPriority, 19 | safePaths, 20 | lowestStatus 21 | }; 22 | -------------------------------------------------------------------------------- /packages/gasket-plugin-data/lib/index.js: -------------------------------------------------------------------------------- 1 | /// 2 | 3 | import packageJson from '../package.json' with { type: 'json' }; 4 | const { name, version, description } = packageJson; 5 | 6 | import create from './create.js'; 7 | import configure from './configure.js'; 8 | import { actions } from './actions.js'; 9 | import initReduxState from './init-redux-state.js'; 10 | import metadata from './metadata.js'; 11 | 12 | /** 13 | * @type {import('@gasket/core').Plugin} 14 | */ 15 | export default { 16 | name, 17 | version, 18 | description, 19 | actions, 20 | hooks: { 21 | create, 22 | configure, 23 | initReduxState, 24 | metadata 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /packages/gasket-plugin-express/generator/jest/test/index.test.js: -------------------------------------------------------------------------------- 1 | import { defaultHandler } from '../plugins/routes-plugin.js'; 2 | import { jest, expect, beforeEach } from '@jest/globals'; 3 | 4 | describe('Routes', () => { 5 | let mockRequest, mockResponse; 6 | beforeEach(() => { 7 | mockRequest = {}; 8 | mockResponse = { 9 | status: jest.fn().mockReturnThis(), 10 | json: jest.fn() 11 | }; 12 | }); 13 | 14 | it('defaultHandler should use expeced message', async () => { 15 | await defaultHandler(mockRequest, mockResponse); 16 | expect(mockResponse.json).toHaveBeenCalledWith({ 17 | message: 'Welcome to your default route...' 18 | }); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/gasket-plugin-intl/lib/apm-transaction.js: -------------------------------------------------------------------------------- 1 | // @ts-nocheck - handled by other PR 2 | /// 3 | 4 | import debug from 'debug'; 5 | const debugLog = debug('gasket:plugin:intl:apmTransaction'); 6 | 7 | /** @type {import('@gasket/core').HookHandler<'apmTransaction'>} */ 8 | export default async function apmTransaction(gasket, transaction, { req }) { 9 | const locale = await gasket.actions.getIntlLocale(req); 10 | 11 | if (locale) { 12 | debugLog(`Setting locale label for transaction to ${locale}`); 13 | transaction.setLabel('locale', locale); 14 | } else { 15 | debugLog('Locale could not be determined for transaction'); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /packages/gasket-plugin-lint/lib/index.js: -------------------------------------------------------------------------------- 1 | const { makeSafeRunScript } = require('./utils'); 2 | const prompt = require('./prompt'); 3 | const create = require('./create'); 4 | 5 | const { name, version, description } = require('../package.json'); 6 | 7 | /** @type {import('@gasket/core').Plugin} */ 8 | const plugin = { 9 | name, 10 | version, 11 | description, 12 | hooks: { 13 | prompt, 14 | create, 15 | async postCreate(gasket, context, { runScript }) { 16 | const safeRunScript = makeSafeRunScript(context, runScript); 17 | 18 | await safeRunScript('lint:fix'); 19 | await safeRunScript('stylelint:fix'); 20 | } 21 | } 22 | }; 23 | 24 | module.exports = plugin; 25 | -------------------------------------------------------------------------------- /packages/gasket-plugin-morgan/lib/middleware.js: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | /// 4 | 5 | import morgan from 'morgan'; 6 | import split from 'split'; 7 | 8 | /** @type {import('@gasket/core').HookHandler<'middleware'>} */ 9 | export default function middleware(gasket) { 10 | const { logger, config } = gasket; 11 | const { morgan: { format = 'tiny', options = {} } = {} } = config; 12 | 13 | const stream = split().on('data', (line) => logger.info(line)); 14 | 15 | const morganMiddleware = morgan(format, { ...options, stream }); 16 | 17 | return [morganMiddleware]; 18 | } 19 | -------------------------------------------------------------------------------- /packages/gasket-template-api-express/template/test/index.test.ts: -------------------------------------------------------------------------------- 1 | import { defaultHandler } from '../plugins/routes-plugin.ts'; 2 | import { vi, describe, expect, beforeEach, it } from 'vitest'; 3 | 4 | describe('Routes', () => { 5 | let mockRequest, mockResponse; 6 | beforeEach(() => { 7 | mockRequest = {}; 8 | mockResponse = { 9 | status: vi.fn().mockReturnThis(), 10 | json: vi.fn() 11 | }; 12 | }); 13 | 14 | it('defaultHandler should use expected message', async () => { 15 | await defaultHandler(mockRequest, mockResponse); 16 | expect(mockResponse.json).toHaveBeenCalledWith({ 17 | message: 'Welcome to your default route...' 18 | }); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/gasket-plugin-express/generator/vitest/test/index.test.ts: -------------------------------------------------------------------------------- 1 | import { defaultHandler } from '../plugins/routes-plugin.ts'; 2 | import { vi, describe, expect, beforeEach, it } from 'vitest'; 3 | 4 | describe('Routes', () => { 5 | let mockRequest, mockResponse; 6 | beforeEach(() => { 7 | mockRequest = {}; 8 | mockResponse = { 9 | status: vi.fn().mockReturnThis(), 10 | json: vi.fn() 11 | }; 12 | }); 13 | 14 | it('defaultHandler should use expected message', async () => { 15 | await defaultHandler(mockRequest, mockResponse); 16 | expect(mockResponse.json).toHaveBeenCalledWith({ 17 | message: 'Welcome to your default route...' 18 | }); 19 | }); 20 | }); 21 | --------------------------------------------------------------------------------