mirror of
https://github.com/project-gauntlet/gauntlet.git
synced 2025-12-23 10:35:53 +00:00
Add a bunch of plugin examples for entrypoint generators
This commit is contained in:
parent
b8f07d5028
commit
a72329aeb7
36 changed files with 516 additions and 0 deletions
2
example_plugins/plugins/command/.gitignore
vendored
Normal file
2
example_plugins/plugins/command/.gitignore
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
dist
|
||||
node_modules
|
||||
35
example_plugins/plugins/command/gauntlet.toml
Normal file
35
example_plugins/plugins/command/gauntlet.toml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
[gauntlet]
|
||||
name = 'Docs Command'
|
||||
description = ''
|
||||
|
||||
# docs-code-segment:start simple
|
||||
[[entrypoint]]
|
||||
id = 'simple'
|
||||
name = 'Simple'
|
||||
path = 'src/simple.tsx'
|
||||
type = 'command'
|
||||
description = ''
|
||||
# docs-code-segment:end
|
||||
|
||||
# docs-code-segment:start preferences
|
||||
[[preferences]]
|
||||
id = 'testBool'
|
||||
name = 'Test Boolean Preference'
|
||||
type = 'bool'
|
||||
default = true
|
||||
description = ""
|
||||
|
||||
[[entrypoint]]
|
||||
id = 'preferences'
|
||||
name = 'Preferences'
|
||||
path = 'src/preferences.tsx'
|
||||
type = 'command'
|
||||
description = ''
|
||||
|
||||
[[entrypoint.preferences]]
|
||||
id = 'testStr'
|
||||
name = 'Test String Preference'
|
||||
type = 'string'
|
||||
default = 'test_value'
|
||||
description = ""
|
||||
# docs-code-segment:end
|
||||
17
example_plugins/plugins/command/package.json
Normal file
17
example_plugins/plugins/command/package.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "@project-gauntlet/docs-command",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "gauntlet build",
|
||||
"dev": "gauntlet dev"
|
||||
},
|
||||
"dependencies": {
|
||||
"@project-gauntlet/api": "file:../../js/api"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "*",
|
||||
"@types/deno": "*",
|
||||
"@project-gauntlet/tools": "*",
|
||||
"typescript": "*"
|
||||
}
|
||||
}
|
||||
8
example_plugins/plugins/command/src/preferences.tsx
Normal file
8
example_plugins/plugins/command/src/preferences.tsx
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { CommandContext } from "@project-gauntlet/api/helpers";
|
||||
|
||||
type PluginCommandContext = CommandContext<{ testBool: boolean }, {testStr: string }>;
|
||||
|
||||
export default async function Command({ pluginPreferences, entrypointPreferences }: PluginCommandContext) {
|
||||
console.log(pluginPreferences.testBool);
|
||||
console.log(entrypointPreferences.testStr);
|
||||
}
|
||||
3
example_plugins/plugins/command/src/simple.tsx
Normal file
3
example_plugins/plugins/command/src/simple.tsx
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default async function Command() {
|
||||
console.log("Running the Gauntlet...")
|
||||
}
|
||||
11
example_plugins/plugins/command/tsconfig.json
Normal file
11
example_plugins/plugins/command/tsconfig.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"module": "ES2022",
|
||||
"esModuleInterop": true,
|
||||
"target": "ES2022",
|
||||
"moduleResolution": "bundler",
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
"lib": ["ES2020"]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue