Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic docs plugins #1034

Merged
merged 14 commits into from
Feb 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 48 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions packages/create-gasket-app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# `create-gasket-app`

- Add `addCommand` method for create context ([#1034])
- Add `addEnvironment` method for create context ([#1010])

### 7.2.0
Expand Down Expand Up @@ -92,3 +93,4 @@ Added `@gasket/plugin-dynamic-plugin` to default plugins ([#970])
[#970]: https://github.com/godaddy/gasket/pull/970
[#1010]: https://github.com/godaddy/gasket/pull/1010
[#1014]: https://github.com/godaddy/gasket/pull/1014
[#1034]: https://github.com/godaddy/gasket/pull/1034
21 changes: 20 additions & 1 deletion packages/create-gasket-app/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export interface ConfigBuilder<Config> {
addPlugin(pluginImport: string, pluginName: string): void;

/**
* addEnvironment - Add environments to the gasket file and use the value in the plugins array
* addEnvironment - Add environments to the gasket file
* @param {string} key - name of the environment - `local.analyze`
* @param {object} value - configuration for the environment - `{
* dynamicPlugins: [
Expand All @@ -156,6 +156,25 @@ export interface ConfigBuilder<Config> {
*/
addEnvironment(key:string, value: object): void;

/**
* addCommand - Add commands to the gasket file
* @param {string} key - name of the command - `docs`
* @param {object} value - configuration for the command - `{
* dynamicPlugins: [
* '@gasket/plugin-docs',
* ]
* }`
* @example
* commands: {
* 'docs': {
* dynamicPlugins: [
* '@gasket/plugin-docs',
* ]
* }
* },
*/
addCommand(key:string, value: object): void;

/**
* addImport - Add a non-plugin import to the gasket file
* @param {string} importName - name of the import used as a value - `import fs...`
Expand Down
23 changes: 23 additions & 0 deletions packages/create-gasket-app/lib/scaffold/config-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,29 @@ export class ConfigBuilder {
});
}

/**
* addCommand - Add commands to the gasket file
* @param {string} key - name of the command - `docs`
* @param {object} value - configuration for the command - `{
* dynamicPlugins: [
* '@gasket/plugin-docs',
* ]
* }`
* @example
* commands: {
* 'docs': {
* dynamicPlugins: [
* '@gasket/plugin-docs',
* ]
* }
* },
*/
addCommand(key, value) {
this.add('commands', {
[key]: value
});
}

/**
* addImport - Add a non-plugin import to the gasket file
* @param {string} importName - name of the import used as a value - `import fs...`
Expand Down
Loading
Loading