To get started creating a new app, use a package runner with create-gasket-app
:
npx create-gasket-app --help
# OR
yarn create gasket-app --help
In this example we will create a Next.js app by specifying the app name along with the preset @gasket/preset-nextjs
:
npx create-gasket-app <app-name> --presets @gasket/preset-nextjs
This will create a new directory with the name of your app.
cd ./your-app-name
From here, you can start your app in local development mode:
npm run local
Otherwise you can build and start your app directly:
npm run build
npm run start
If you have an existing app, some plugins can be added after create. First, install the necessary node modules:
npm i @gasket/plugin-docs @gasket/plugin-docusaurus
Then, in the app's gasket.js
, add the plugins:
import { makeGasket } from '@gasket/core';
+import pluginDocs from '@gasket/plugin-docs';
+import pluginDocusaurus from '@gasket/plugin-docusaurus';
export default makeGasket({
plugins: [
// other plugins
+ pluginDocs,
+ pluginDocusaurus
]
});
Now, when you run the docs command, a site will open in your default browser with docs for what is configured in your app. See the @gasket/plugin-command documentation for more information about Gasket commands.
node gasket.js docs
Newly created Gasket apps will use ESM and type: module
. This means that you will need to use .js
extensions in your imports. For example:
import { myFunction } from './myModule.js';