Add a bunch of plugin examples for entrypoint generators

This commit is contained in:
Exidex 2025-04-20 17:16:00 +02:00
parent b8f07d5028
commit a72329aeb7
No known key found for this signature in database
GPG key ID: AC63AA86DD4F2D45
36 changed files with 516 additions and 0 deletions

View file

@ -0,0 +1,2 @@
dist
node_modules

View 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

View 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": "*"
}
}

View 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);
}

View file

@ -0,0 +1,3 @@
export default async function Command() {
console.log("Running the Gauntlet...")
}

View file

@ -0,0 +1,11 @@
{
"compilerOptions": {
"strict": true,
"module": "ES2022",
"esModuleInterop": true,
"target": "ES2022",
"moduleResolution": "bundler",
"jsx": "react-jsx"
},
"lib": ["ES2020"]
}