diff --git a/modules/core/build.gradle.kts b/modules/core/build.gradle.kts index 22e7e4de..4fa917bb 100644 --- a/modules/core/build.gradle.kts +++ b/modules/core/build.gradle.kts @@ -15,6 +15,7 @@ dependencies { bundledPlugin("com.intellij.java") bundledPlugin("org.jetbrains.plugins.terminal") + bundledPlugin("org.toml.lang") jetbrainsRuntime() } diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/MiseConstants.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/MiseConstants.kt deleted file mode 100644 index a312e397..00000000 --- a/modules/core/src/main/kotlin/com/github/l34130/mise/core/MiseConstants.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.github.l34130.mise.core - -import com.intellij.openapi.externalSystem.model.ProjectSystemId - -object MiseConstants { - val SYSTEM_ID = ProjectSystemId("Mise") -} diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/MiseHelper.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/MiseHelper.kt deleted file mode 100644 index b4f46e23..00000000 --- a/modules/core/src/main/kotlin/com/github/l34130/mise/core/MiseHelper.kt +++ /dev/null @@ -1,45 +0,0 @@ -package com.github.l34130.mise.core - -import com.github.l34130.mise.core.command.MiseCommandLineHelper -import com.github.l34130.mise.core.command.MiseCommandLineNotFoundException -import com.github.l34130.mise.core.notification.MiseNotificationServiceUtils -import com.github.l34130.mise.core.run.MiseRunConfigurationSettingsEditor -import com.github.l34130.mise.core.setting.MiseSettings -import com.intellij.execution.configurations.RunConfigurationBase -import com.intellij.openapi.components.service -import com.intellij.util.application -import java.util.function.Supplier - -object MiseHelper { - fun getMiseEnvVarsOrNotify( - configuration: RunConfigurationBase<*>, - workingDirectory: Supplier, - ): Map { - val project = configuration.project - val projectState = application.service().state - val runConfigState = MiseRunConfigurationSettingsEditor.getMiseRunConfigurationState(configuration) - - val (workDir, configEnvironment) = - when { - projectState.useMiseDirEnv -> { - project.basePath to projectState.miseConfigEnvironment - } - runConfigState?.useMiseDirEnv == true -> { - (workingDirectory.get() ?: project.basePath) to runConfigState.miseConfigEnvironment - } - else -> return emptyMap() - } - - return MiseCommandLineHelper - .getEnvVars(workDir, configEnvironment) - .fold( - onSuccess = { envVars -> envVars }, - onFailure = { - if (it !is MiseCommandLineNotFoundException) { - MiseNotificationServiceUtils.notifyException("Failed to load environment variables", it) - } - emptyMap() - }, - ) - } -} diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/MiseTomlFileType.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/MiseTomlFileType.kt new file mode 100644 index 00000000..9c9706cb --- /dev/null +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/MiseTomlFileType.kt @@ -0,0 +1,15 @@ +package com.github.l34130.mise.core.lang + +import com.github.l34130.mise.core.icon.MiseIcons +import com.intellij.openapi.fileTypes.LanguageFileType +import javax.swing.Icon + +object MiseTomlFileType : LanguageFileType(MiseTomlLanguage) { + override fun getName(): String = "mise" + + override fun getDescription(): String = "Mise Configuration file" + + override fun getDefaultExtension(): String = "toml" + + override fun getIcon(): Icon = MiseIcons.DEFAULT +} diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/MiseTomlLanguage.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/MiseTomlLanguage.kt new file mode 100644 index 00000000..3241bf0c --- /dev/null +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/MiseTomlLanguage.kt @@ -0,0 +1,6 @@ +package com.github.l34130.mise.core.lang + +import com.intellij.lang.Language +import org.toml.lang.TomlLanguage + +object MiseTomlLanguage : Language(TomlLanguage, "MiseToml") diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/completion/InsertionHandlers.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/completion/InsertionHandlers.kt new file mode 100644 index 00000000..630a6412 --- /dev/null +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/completion/InsertionHandlers.kt @@ -0,0 +1,37 @@ +package com.github.l34130.mise.core.lang.completion + +import com.intellij.codeInsight.completion.InsertHandler +import com.intellij.codeInsight.completion.InsertionContext +import com.intellij.codeInsight.lookup.LookupElement +import com.intellij.psi.PsiElement +import com.intellij.psi.tree.TokenSet +import com.intellij.psi.util.PsiTreeUtil +import org.toml.lang.psi.TomlElementTypes +import org.toml.lang.psi.TomlLiteral +import org.toml.lang.psi.ext.elementType + +class StringLiteralInsertionHandler : InsertHandler { + override fun handleInsert( + context: InsertionContext, + item: LookupElement, + ) { + val leaf = context.getElementOfType() ?: return + val elementType = (leaf.parent as? TomlLiteral)?.elementType + + val hasQuotes = elementType in tokenSet + if (!hasQuotes) { + context.document.insertString(context.startOffset, "\"") + context.document.insertString(context.selectionEndOffset, "\"") + } + } + + private val tokenSet = + TokenSet.create( + TomlElementTypes.BASIC_STRING, + TomlElementTypes.LITERAL_STRING, + TomlElementTypes.LITERAL, + ) +} + +inline fun InsertionContext.getElementOfType(strict: Boolean = false): T? = + PsiTreeUtil.findElementOfClassAtOffset(file, tailOffset - 1, T::class.java, strict) diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/completion/MiseTomlCompletionContributor.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/completion/MiseTomlCompletionContributor.kt new file mode 100644 index 00000000..a61ecce9 --- /dev/null +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/completion/MiseTomlCompletionContributor.kt @@ -0,0 +1,11 @@ +package com.github.l34130.mise.core.lang.completion + +import com.github.l34130.mise.core.lang.psi.MiseTomlPsiPatterns +import com.intellij.codeInsight.completion.CompletionContributor +import com.intellij.codeInsight.completion.CompletionType + +class MiseTomlCompletionContributor : CompletionContributor() { + init { + extend(CompletionType.BASIC, MiseTomlPsiPatterns.inTaskDependsArray, MiseTomlTaskCompletionProvider()) + } +} diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/completion/MiseTomlTaskCompletionProvider.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/completion/MiseTomlTaskCompletionProvider.kt new file mode 100644 index 00000000..ed401b5b --- /dev/null +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/completion/MiseTomlTaskCompletionProvider.kt @@ -0,0 +1,53 @@ +package com.github.l34130.mise.core.lang.completion + +import com.github.l34130.mise.core.lang.psi.MiseTomlFile +import com.github.l34130.mise.core.lang.psi.allTasks +import com.github.l34130.mise.core.lang.psi.stringValue +import com.github.l34130.mise.core.lang.psi.taskName +import com.intellij.codeInsight.completion.CompletionParameters +import com.intellij.codeInsight.completion.CompletionProvider +import com.intellij.codeInsight.completion.CompletionResultSet +import com.intellij.codeInsight.lookup.LookupElementBuilder +import com.intellij.psi.util.parentOfType +import com.intellij.util.ProcessingContext +import org.toml.lang.psi.TomlArray +import org.toml.lang.psi.TomlTable + +/** + * ``` + * [tasks.foo] + * ... + * + * [tasks.] + * depends = [ "f" ] + * #^ Provides completion for "foo" + */ +class MiseTomlTaskCompletionProvider : CompletionProvider() { + override fun addCompletions( + parameters: CompletionParameters, + context: ProcessingContext, + result: CompletionResultSet, + ) { + val element = parameters.position + val miseTomlFile = element.containingFile as? MiseTomlFile ?: return + + val dependsArray = (element.parent.parent as? TomlArray) ?: return + + val parentTable = element.parentOfType() ?: return + val parentTaskName = parentTable.taskName + + for (task in miseTomlFile.allTasks()) { + val taskName = task.name ?: continue + if (dependsArray.elements.any { it.stringValue == taskName }) continue + if (taskName == parentTaskName) continue + + result.addElement( + LookupElementBuilder + .createWithSmartPointer(taskName, task) + .withInsertHandler(StringLiteralInsertionHandler()), + ) + } + } + + // TODO: Need to support literal string completion +} diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/json/MiseTomlJsonSchemaFileProviderFactory.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/json/MiseTomlJsonSchemaFileProviderFactory.kt new file mode 100644 index 00000000..567c751b --- /dev/null +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/json/MiseTomlJsonSchemaFileProviderFactory.kt @@ -0,0 +1,27 @@ +package com.github.l34130.mise.core.lang.json + +import com.github.l34130.mise.core.lang.MiseTomlFileType +import com.intellij.openapi.project.DumbAware +import com.intellij.openapi.project.Project +import com.intellij.openapi.vfs.VirtualFile +import com.jetbrains.jsonSchema.extension.JsonSchemaFileProvider +import com.jetbrains.jsonSchema.extension.JsonSchemaProviderFactory +import com.jetbrains.jsonSchema.extension.SchemaType + +class MiseTomlJsonSchemaFileProviderFactory : + JsonSchemaProviderFactory, + DumbAware { + override fun getProviders(project: Project): List = listOf(MiseTomlJsonSchemaFileProvider()) + + class MiseTomlJsonSchemaFileProvider : JsonSchemaFileProvider { + override fun isAvailable(file: VirtualFile): Boolean = file.fileType is MiseTomlFileType + + override fun getName(): String = "mise" + + override fun getSchemaType(): SchemaType = SchemaType.embeddedSchema + + override fun isUserVisible(): Boolean = false + + override fun getSchemaFile(): VirtualFile? = JsonSchemaProviderFactory.getResourceFile(javaClass, "/schemas/mise.json") + } +} diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/json/MiseTomlPsiWalkerFactory.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/json/MiseTomlPsiWalkerFactory.kt new file mode 100644 index 00000000..722fb5bf --- /dev/null +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/json/MiseTomlPsiWalkerFactory.kt @@ -0,0 +1,14 @@ +package com.github.l34130.mise.core.lang.json + +import com.github.l34130.mise.core.lang.MiseTomlLanguage +import com.intellij.psi.PsiElement +import com.jetbrains.jsonSchema.extension.JsonLikePsiWalker +import com.jetbrains.jsonSchema.extension.JsonLikePsiWalkerFactory +import com.jetbrains.jsonSchema.impl.JsonSchemaObject +import org.toml.ide.json.TomlJsonPsiWalker + +class MiseTomlPsiWalkerFactory : JsonLikePsiWalkerFactory { + override fun handles(element: PsiElement): Boolean = element.containingFile.language is MiseTomlLanguage + + override fun create(schemaObject: JsonSchemaObject): JsonLikePsiWalker = TomlJsonPsiWalker +} diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/psi/MiseTomlFile.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/psi/MiseTomlFile.kt new file mode 100644 index 00000000..c014ce36 --- /dev/null +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/psi/MiseTomlFile.kt @@ -0,0 +1,14 @@ +package com.github.l34130.mise.core.lang.psi + +import com.github.l34130.mise.core.lang.MiseTomlFileType +import com.github.l34130.mise.core.lang.MiseTomlLanguage +import com.intellij.extapi.psi.PsiFileBase +import com.intellij.psi.FileViewProvider + +class MiseTomlFile( + viewProvider: FileViewProvider, +) : PsiFileBase(viewProvider, MiseTomlLanguage) { + override fun getFileType() = MiseTomlFileType + + override fun toString() = "Mise Toml File" +} diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/psi/MiseTomlParserDefinition.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/psi/MiseTomlParserDefinition.kt new file mode 100644 index 00000000..da5d4361 --- /dev/null +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/psi/MiseTomlParserDefinition.kt @@ -0,0 +1,36 @@ +package com.github.l34130.mise.core.lang.psi + +import com.github.l34130.mise.core.lang.MiseTomlLanguage +import com.intellij.lang.ASTNode +import com.intellij.lang.ParserDefinition +import com.intellij.lang.PsiParser +import com.intellij.lexer.Lexer +import com.intellij.openapi.project.Project +import com.intellij.psi.FileViewProvider +import com.intellij.psi.PsiElement +import com.intellij.psi.PsiFile +import com.intellij.psi.tree.IFileElementType +import com.intellij.psi.tree.TokenSet +import org.toml.lang.lexer.TomlLexer +import org.toml.lang.parse.TomlParser +import org.toml.lang.psi.TOML_COMMENTS + +class MiseTomlParserDefinition : ParserDefinition { + override fun createLexer(project: Project): Lexer = TomlLexer() + + override fun createParser(project: Project): PsiParser = TomlParser() + + override fun getFileNodeType(): IFileElementType = FILE + + override fun getCommentTokens(): TokenSet = TOML_COMMENTS + + override fun getStringLiteralElements(): TokenSet = TokenSet.EMPTY + + override fun createElement(node: ASTNode): PsiElement = throw UnsupportedOperationException() + + override fun createFile(viewProvider: FileViewProvider): PsiFile = MiseTomlFile(viewProvider) + + companion object { + val FILE = IFileElementType(MiseTomlLanguage) + } +} diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/psi/MiseTomlPsiPatterns.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/psi/MiseTomlPsiPatterns.kt new file mode 100644 index 00000000..7ba4e073 --- /dev/null +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/psi/MiseTomlPsiPatterns.kt @@ -0,0 +1,97 @@ +package com.github.l34130.mise.core.lang.psi + +import com.github.l34130.mise.core.lang.MiseTomlFileType +import com.intellij.patterns.ObjectPattern +import com.intellij.patterns.PatternCondition +import com.intellij.patterns.PlatformPatterns +import com.intellij.patterns.PsiElementPattern +import com.intellij.patterns.StandardPatterns +import com.intellij.patterns.VirtualFilePattern +import com.intellij.psi.PsiElement +import com.intellij.util.ProcessingContext +import org.toml.lang.psi.TomlArray +import org.toml.lang.psi.TomlKeyValue +import org.toml.lang.psi.TomlLiteral +import org.toml.lang.psi.TomlTable +import org.toml.lang.psi.TomlTableHeader +import org.toml.lang.psi.ext.TomlLiteralKind +import org.toml.lang.psi.ext.kind +import org.toml.lang.psi.ext.name + +object MiseTomlPsiPatterns { + private inline fun miseTomlPsiElement(): PsiElementPattern.Capture = + psiElement().inVirtualFile( + VirtualFilePattern().ofType(MiseTomlFileType), + ) + + fun miseTomlStringLiteral() = miseTomlPsiElement().with("stringLiteral") { e, _ -> e.kind is TomlLiteralKind.String } + + private val onSpecificTaskTable = + miseTomlPsiElement() + .withChild( + psiElement() + .with("specificTaskCondition") { header, _ -> + header.isSpecificTaskTableHeader + }, + ) + + /** + * ``` + * [tasks] + * foo = { $name = [] } + * #^ + * ``` + * + * ``` + * [tasks.foo] + * $name = [] + * #^ + * ``` + */ + private fun taskProperty(name: String) = + psiElement() + .with("name") { e, _ -> e.key.name == name } + .withParent( + onSpecificTaskTable, +// onSpecificTaskTable.andOr( +// psiElement().withSuperParent(2, onTaskTable), +// ), + ) + + /** + * ``` + * [tasks] + * foo = { version = "*", depends = [] } + * #^ + * ``` + * + * ``` + * [tasks.foo] + * depends = [] + * #^ + * ``` + */ + private val onTaskDependsArray = + StandardPatterns.or( + psiElement() + .withParent(taskProperty("depends")), + psiElement() + .withParent(taskProperty("depends_post")), + ) + val inTaskDependsArray = miseTomlPsiElement().inside(onTaskDependsArray) + + inline fun psiElement() = PlatformPatterns.psiElement(I::class.java) + + fun > ObjectPattern.with( + name: String, + cond: (T, ProcessingContext?) -> Boolean, + ): Self = + with( + object : PatternCondition(name) { + override fun accepts( + t: T, + context: ProcessingContext?, + ): Boolean = cond(t, context) + }, + ) +} diff --git a/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/psi/MiseTomlPsiUtils.kt b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/psi/MiseTomlPsiUtils.kt new file mode 100644 index 00000000..69067451 --- /dev/null +++ b/modules/core/src/main/kotlin/com/github/l34130/mise/core/lang/psi/MiseTomlPsiUtils.kt @@ -0,0 +1,56 @@ +package com.github.l34130.mise.core.lang.psi + +import com.intellij.psi.util.childrenOfType +import org.toml.lang.psi.TomlKeySegment +import org.toml.lang.psi.TomlKeyValueOwner +import org.toml.lang.psi.TomlLiteral +import org.toml.lang.psi.TomlTable +import org.toml.lang.psi.TomlTableHeader +import org.toml.lang.psi.TomlValue +import org.toml.lang.psi.ext.TomlLiteralKind +import org.toml.lang.psi.ext.kind + +fun MiseTomlFile.allTasks(): Sequence { + val explicitTasks = hashSetOf() + + return childrenOfType() + .asSequence() + .flatMap { table -> + val header = table.header + when { + // [tasks.] + header.isSpecificTaskTableHeader -> { + val lastKey = header.key?.segments?.last() + if (lastKey != null && lastKey.name !in explicitTasks) { + sequenceOf(lastKey) + } else { + emptySequence() + } + } + else -> emptySequence() + } + }.constrainOnce() +} + +val TomlTable.taskName: String? + get() { + if (header.isSpecificTaskTableHeader) { + val headerKey = header.key ?: return null + return headerKey.segments.lastOrNull()?.name + } + return null + } + +val TomlTableHeader.isSpecificTaskTableHeader: Boolean + get() { + val names = key?.segments.orEmpty() + return names.getOrNull(names.size - 2)?.name == "tasks" + } + +fun TomlKeyValueOwner.getValueWithKey(key: String): TomlValue? = entries.find { it.key.text == key }?.value + +val TomlValue.stringValue: String? + get() { + val kind = (this as? TomlLiteral)?.kind + return (kind as? TomlLiteralKind.String)?.value + } diff --git a/modules/core/src/main/resources/schemas/mise-task.json b/modules/core/src/main/resources/schemas/mise-task.json new file mode 100644 index 00000000..4944b3e8 --- /dev/null +++ b/modules/core/src/main/resources/schemas/mise-task.json @@ -0,0 +1,238 @@ +{ + "$id": "https://mise.jdx.dev/schema/mise-task.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "mise-task-schema", + "type": "object", + "$defs": { + "task": { + "oneOf": [ + { + "description": "script to run", + "type": "string" + }, + { + "description": "script to run", + "items": { + "description": "script to run", + "type": "string" + }, + "type": "array" + }, + { + "additionalProperties": false, + "properties": { + "alias": { + "oneOf": [ + { + "description": "alias for this task", + "type": "string" + }, + { + "description": "alias for this task", + "items": { + "description": "alias for this task", + "type": "string" + }, + "type": "array" + } + ] + }, + "depends": { + "description": "other tasks to run before this task", + "items": { + "oneOf": [ + { + "description": "task with args to run before this task", + "type": "string" + }, + { + "description": "task with args to run before this task", + "items": { + "description": "task name and args", + "type": "string" + }, + "type": "array" + } + ] + }, + "type": "array" + }, + "depends_post": { + "description": "other tasks to run after this task", + "items": { + "oneOf": [ + { + "description": "task with args to run after this task", + "type": "string" + }, + { + "description": "task with args to run after this task", + "items": { + "description": "task name and args", + "type": "string" + }, + "type": "array" + } + ] + }, + "type": "array" + }, + "wait_for": { + "description": "if these tasks run, wait for them to complete first", + "items": { + "description": "task to run before this task", + "type": "string" + }, + "type": "array" + }, + "description": { + "description": "description of task", + "type": "string" + }, + "dir": { + "description": "directory to run script in, default is current working directory", + "type": "string" + }, + "env": { + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "enum": [false], + "type": "boolean" + } + ] + }, + "description": "environment variables", + "type": "object" + }, + "tools": { + "description": "tools to install/activate before running this task", + "additionalProperties": { + "oneOf": [ + { + "description": "version of the tool to install", + "type": "string" + }, + { + "properties": { + "version": { + "description": "version of the tool to install", + "type": "string" + }, + "os": { + "oneOf": [ + { + "description": "operating system to install on", + "type": "array" + }, + { + "description": "option to pass to tool", + "type": "string" + }, + { + "description": "option to pass to tool", + "type": "boolean" + } + ] + } + }, + "required": ["version"], + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + } + ] + } + } + ] + }, + "type": "object" + }, + "hide": { + "description": "do not display this task", + "type": "boolean" + }, + "outputs": { + "description": "files created by this task", + "items": { + "description": "glob pattern or path to files created by this task", + "type": "string" + }, + "type": "array" + }, + "quiet": { + "description": "do not display mise information for this task", + "type": "boolean" + }, + "raw": { + "description": "directly connect task to stdin/stdout/stderr", + "type": "boolean" + }, + "run": { + "oneOf": [ + { + "description": "script to run", + "type": "string" + }, + { + "description": "script to run", + "items": { + "description": "script to run", + "type": "string" + }, + "type": "array" + } + ] + }, + "run_windows": { + "oneOf": [ + { + "description": "script to run on windows", + "type": "string" + }, + { + "description": "script to run on windows", + "items": { + "description": "script to run on windows", + "type": "string" + }, + "type": "array" + } + ] + }, + "file": { + "description": "Execute an external script", + "type": "string" + }, + "sources": { + "description": "files that this task depends on", + "items": { + "description": "glob pattern or path to files that this task depends on", + "type": "string" + }, + "type": "array" + }, + "shell": { + "description": "specify a shell command to run the script with", + "type": "string", + "default": "sh -c" + } + }, + "type": "object" + } + ] + } + }, + "description": "Config file for included mise tasks (https://mise.jdx.dev/tasks/#task-configuration)", + "additionalProperties": { + "$ref": "#/$defs/task" + } +} diff --git a/modules/core/src/main/resources/schemas/mise.json b/modules/core/src/main/resources/schemas/mise.json new file mode 100644 index 00000000..82107f90 --- /dev/null +++ b/modules/core/src/main/resources/schemas/mise.json @@ -0,0 +1,1457 @@ +{ + "$id": "https://mise.jdx.dev/schema/mise.json", + "$schema": "http://json-schema.org/2019-09/schema#", + "title": "mise", + "type": "object", + "$defs": { + "env": { + "additionalProperties": { + "oneOf": [ + { + "type": "object", + "properties": { + "value": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "tools": { + "type": "boolean", + "description": "load tools before resolving" + }, + "redact": { + "type": "boolean", + "description": "redact the value from logs" + } + } + }, + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + } + ] + }, + "description": "environment variables", + "properties": { + "_": { + "description": "environment modules", + "additionalProperties": true, + "properties": { + "file": { + "oneOf": [ + { + "type": "object", + "properties": { + "path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "tools": { + "type": "boolean", + "description": "load tools before resolving" + }, + "redact": { + "type": "boolean", + "description": "redact the value from logs" + } + } + }, + { + "description": "dotenv file to load", + "type": "string" + }, + { + "description": "dotenv files to load", + "items": { + "description": "dotenv file to load", + "type": "string" + }, + "type": "array" + } + ] + }, + "path": { + "oneOf": [ + { + "type": "object", + "properties": { + "path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "redact": { + "type": "boolean", + "description": "redact the value from logs" + } + } + }, + { + "description": "PATH entry to add", + "type": "string" + }, + { + "description": "PATH entries to add", + "items": { + "description": "PATH entry to add", + "type": "string" + }, + "type": "array" + } + ] + }, + "python": { + "description": "python environment", + "properties": { + "venv": { + "oneOf": [ + { + "description": "path to python virtual environment to use", + "type": "string" + }, + { + "description": "virtualenv options", + "properties": { + "create": { + "default": false, + "description": "create a new virtual environment if one does not exist", + "type": "boolean" + }, + "path": { + "description": "path to python virtual environment to use", + "type": "string" + }, + "python": { + "description": "python version to use", + "type": "string" + }, + "python_create_args": { + "description": "additional arguments to pass to python when creating a virtual environment", + "type": "string" + }, + "uv_create_args": { + "description": "additional arguments to pass to uv when creating a virtual environment", + "type": "string" + } + }, + "required": ["path"], + "type": "object" + } + ] + } + }, + "type": "object" + }, + "source": { + "oneOf": [ + { + "type": "object", + "properties": { + "path": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "tools": { + "type": "boolean", + "description": "load tools before resolving" + }, + "redact": { + "type": "boolean", + "description": "redact the value from logs" + } + } + }, + { + "description": "bash script to load", + "type": "string" + }, + { + "description": "bash scripts to load", + "items": { + "description": "bash script to load", + "type": "string" + }, + "type": "array" + } + ] + } + }, + "type": "object" + } + }, + "type": "object" + }, + "settings": { + "properties": { + "activate_aggressive": { + "description": "Pushes tools' bin-paths to the front of PATH instead of allowing modifications of PATH after activation to take precedence.", + "type": "boolean" + }, + "all_compile": { + "description": "do not use precompiled binaries for any tool", + "type": "boolean" + }, + "always_keep_download": { + "description": "should mise keep downloaded files after installation", + "type": "boolean" + }, + "always_keep_install": { + "description": "should mise keep install files after installation even if the installation fails", + "type": "boolean" + }, + "aqua": { + "additionalProperties": false, + "properties": { + "cosign": { + "default": true, + "description": "Use cosign to verify aqua tool signatures.", + "type": "boolean" + }, + "minisign": { + "default": true, + "description": "Use minisign to verify aqua tool signatures.", + "type": "boolean" + }, + "registry_url": { + "description": "URL to fetch aqua registry from.", + "type": "string" + }, + "slsa": { + "default": true, + "description": "Use SLSA to verify aqua tool signatures.", + "type": "boolean" + } + } + }, + "arch": { + "description": "Architecture to use for precompiled binaries.", + "type": "string" + }, + "asdf": { + "description": "use asdf as a default plugin backend", + "type": "boolean", + "deprecated": true + }, + "asdf_compat": { + "description": "set to true to ensure .tool-versions will be compatible with asdf", + "type": "boolean", + "deprecated": true + }, + "auto_install": { + "default": true, + "description": "Automatically install missing tools when running `mise x`, `mise run`, or as part of the 'not found' handler.", + "type": "boolean" + }, + "auto_install_disable_tools": { + "description": "List of tools to skip automatically installing when running `mise x`, `mise run`, or as part of the 'not found' handler.", + "type": "array", + "items": { + "type": "string" + } + }, + "cache_prune_age": { + "default": "30d", + "description": "Delete files in cache that have not been accessed in this duration", + "type": "string" + }, + "cargo": { + "additionalProperties": false, + "properties": { + "binstall": { + "default": true, + "description": "Use cargo-binstall instead of cargo install if available", + "type": "boolean" + } + } + }, + "cargo_binstall": { + "description": "Use cargo-binstall instead of cargo install if available", + "type": "boolean", + "deprecated": true + }, + "cd": { + "description": "Path to change to after launching mise", + "type": "string" + }, + "ci": { + "description": "Set to true if running in a CI environment", + "type": "boolean" + }, + "color": { + "default": true, + "description": "Use color in mise terminal output", + "type": "boolean" + }, + "debug": { + "description": "Sets log level to debug", + "type": "boolean" + }, + "default_config_filename": { + "default": "mise.toml", + "description": "The default config filename read. `mise use` and other commands that create new config files will use this value. This must be an env var.", + "type": "string" + }, + "default_tool_versions_filename": { + "default": ".tool-versions", + "description": "The default .tool-versions filename read. This will not ignore .tool-versions—use override_tool_versions_filename for that. This must be an env var.", + "type": "string" + }, + "disable_backends": { + "default": [], + "description": "Backends to disable such as `asdf` or `pipx`", + "type": "array", + "items": { + "type": "string" + } + }, + "disable_default_registry": { + "description": "Disable the default mapping of short tool names like `go` -> `vfox:version-fox/vfox-golang`", + "type": "boolean" + }, + "disable_default_shorthands": { + "description": "Disables built-in shorthands to asdf/vfox plugins", + "type": "boolean", + "deprecated": true + }, + "disable_hints": { + "default": [], + "description": "Turns off helpful hints when using different mise features", + "type": "array", + "items": { + "type": "string" + } + }, + "disable_tools": { + "default": [], + "description": "Tools defined in mise.toml that should be ignored", + "type": "array", + "items": { + "type": "string" + } + }, + "dotnet": { + "additionalProperties": false, + "properties": { + "package_flags": { + "default": [], + "description": "Extends dotnet search and install abilities.", + "type": "array", + "items": { + "type": "string" + } + }, + "registry_url": { + "default": "https://api.nuget.org/v3/index.json", + "description": "URL to fetch dotnet tools from.", + "type": "string" + } + } + }, + "env": { + "default": [], + "description": "Env to use for mise..toml files.", + "type": "array", + "items": { + "type": "string" + } + }, + "env_file": { + "description": "Path to a file containing environment variables to automatically load.", + "type": "string" + }, + "erlang": { + "additionalProperties": false, + "properties": { + "compile": { + "description": "If true, compile erlang from source. If false, use precompiled binaries. If not set, use precompiled binaries if available.", + "type": "boolean" + } + } + }, + "exec_auto_install": { + "default": true, + "description": "Automatically install missing tools when running `mise x`.", + "type": "boolean" + }, + "experimental": { + "description": "Enable experimental mise features which are incomplete or unstable—breakings changes may occur", + "type": "boolean" + }, + "fetch_remote_versions_cache": { + "default": "1h", + "description": "How long to cache remote versions for tools.", + "type": "string" + }, + "fetch_remote_versions_timeout": { + "default": "5s", + "description": "Timeout in seconds for HTTP requests to fetch new tool versions in mise.", + "type": "string" + }, + "global_config_file": { + "description": "Path to the global mise config file. Default is `~/.config/mise/config.toml`. This must be an env var.", + "type": "string" + }, + "global_config_root": { + "description": "Path which is used as `{{config_root}}` for the global config file. Default is `$HOME`. This must be an env var.", + "type": "string" + }, + "go_default_packages_file": { + "default": "~/.default-go-packages", + "description": "Path to a file containing default go packages to install when installing go", + "type": "string" + }, + "go_download_mirror": { + "default": "https://dl.google.com/go", + "description": "Mirror to download go sdk tarballs from.", + "type": "string" + }, + "go_repo": { + "default": "https://github.com/golang/go", + "description": "URL to fetch go from.", + "type": "string" + }, + "go_set_gobin": { + "description": "Changes where `go install` installs binaries to.", + "type": "boolean" + }, + "go_set_gopath": { + "description": "[deprecated] Set to true to set GOPATH=~/.local/share/mise/installs/go/.../packages.", + "type": "boolean", + "deprecated": true + }, + "go_set_goroot": { + "default": true, + "description": "Sets GOROOT=~/.local/share/mise/installs/go/.../.", + "type": "boolean" + }, + "go_skip_checksum": { + "description": "Set to true to skip checksum verification when downloading go sdk tarballs.", + "type": "boolean" + }, + "http_timeout": { + "default": "30s", + "description": "Timeout in seconds for all HTTP requests in mise.", + "type": "string" + }, + "idiomatic_version_file": { + "default": true, + "description": "Set to false to disable the idiomatic version files such as .node-version, .ruby-version, etc.", + "type": "boolean" + }, + "idiomatic_version_file_disable_tools": { + "default": [], + "description": "Specific tools to disable idiomatic version files for.", + "type": "array", + "items": { + "type": "string" + } + }, + "ignored_config_paths": { + "default": [], + "description": "This is a list of config paths that mise will ignore.", + "type": "array", + "items": { + "type": "string" + } + }, + "jobs": { + "default": 8, + "description": "How many jobs to run concurrently such as tool installs.", + "type": "number" + }, + "legacy_version_file": { + "default": true, + "description": "Set to false to disable the idiomatic version files such as .node-version, .ruby-version, etc.", + "type": "boolean", + "deprecated": true + }, + "legacy_version_file_disable_tools": { + "default": [], + "description": "Specific tools to disable idiomatic version files for.", + "type": "array", + "deprecated": true, + "items": { + "type": "string" + } + }, + "libgit2": { + "default": true, + "description": "Use libgit2 for git operations, set to false to shell out to git.", + "type": "boolean" + }, + "lockfile": { + "default": true, + "description": "Create and read lockfiles for tool versions.", + "type": "boolean" + }, + "log_level": { + "default": "info", + "description": "Show more/less output.", + "type": "string", + "enum": ["trace", "debug", "info", "warn", "error"] + }, + "node": { + "additionalProperties": false, + "properties": { + "compile": { + "description": "Compile node from source.", + "type": "boolean" + }, + "flavor": { + "description": "Install a specific node flavor like glibc-217 or musl. Use with unofficial node build repo.", + "type": "string" + }, + "gpg_verify": { + "description": "Use gpg to verify node tool signatures.", + "type": "boolean" + }, + "mirror_url": { + "description": "Mirror to download node tarballs from.", + "type": "string" + } + } + }, + "not_found_auto_install": { + "default": true, + "description": "Set to false to disable the \"command not found\" handler to autoinstall missing tool versions.", + "type": "boolean" + }, + "npm": { + "additionalProperties": false, + "properties": { + "bun": { + "description": "Use bun instead of npm if bun is installed and on PATH.", + "type": "boolean" + } + } + }, + "override_config_filenames": { + "default": [], + "description": "If set, mise will ignore default config files like `mise.toml` and use these filenames instead. This must be an env var.", + "type": "array", + "items": { + "type": "string" + } + }, + "override_tool_versions_filename": { + "default": [], + "description": "If set, mise will ignore .tool-versions files and use these filename instead. Can be set to `none` to disable .tool-versions. This must be an env var.", + "type": "array", + "items": { + "type": "string" + } + }, + "paranoid": { + "description": "Enables extra-secure behavior.", + "type": "boolean" + }, + "pin": { + "description": "Default to pinning versions when running `mise use` in mise.toml files.", + "type": "boolean" + }, + "pipx": { + "additionalProperties": false, + "properties": { + "uvx": { + "description": "Use uvx instead of pipx if uv is installed and on PATH.", + "type": "boolean" + } + } + }, + "pipx_uvx": { + "description": "Use uvx instead of pipx if uv is installed and on PATH.", + "type": "boolean" + }, + "plugin_autoupdate_last_check_duration": { + "default": "7d", + "description": "How long to wait before updating plugins automatically (note this isn't currently implemented).", + "type": "string" + }, + "profile": { + "description": "Profile to use for mise.${MISE_PROFILE}.toml files.", + "type": "string", + "deprecated": true + }, + "python": { + "additionalProperties": false, + "properties": { + "compile": { + "description": "If true, compile python from source. If false, use precompiled binaries. If not set, use precompiled binaries if available.", + "type": "boolean" + }, + "default_packages_file": { + "description": "Path to a file containing default python packages to install when installing a python version.", + "type": "string" + }, + "patch_url": { + "description": "URL to fetch python patches from to pass to python-build.", + "type": "string" + }, + "patches_directory": { + "description": "Directory to fetch python patches from.", + "type": "string" + }, + "precompiled_arch": { + "description": "Specify the architecture to use for precompiled binaries.", + "type": "string" + }, + "precompiled_flavor": { + "description": "Specify the flavor to use for precompiled binaries.", + "type": "string" + }, + "precompiled_os": { + "description": "Specify the OS to use for precompiled binaries.", + "type": "string" + }, + "pyenv_repo": { + "default": "https://github.com/pyenv/pyenv.git", + "description": "URL to fetch pyenv from for compiling python with python-build.", + "type": "string" + }, + "uv_venv_auto": { + "description": "Integrate with uv to automatically create/source venvs if uv.lock is present.", + "type": "boolean" + }, + "uv_venv_create_args": { + "description": "Arguments to pass to uv when creating a venv.", + "type": "array", + "items": { + "type": "string" + } + }, + "venv_auto_create": { + "description": "Automatically create virtualenvs for python tools.", + "type": "boolean", + "deprecated": true + }, + "venv_create_args": { + "description": "Arguments to pass to python when creating a venv. (not used for uv venv creation)", + "type": "array", + "items": { + "type": "string" + } + }, + "venv_stdlib": { + "description": "Prefer to use venv from Python's standard library.", + "type": "boolean" + } + } + }, + "python_compile": { + "description": "If true, compile python from source. If false, use precompiled binaries. If not set, use precompiled binaries if available.", + "type": "boolean", + "deprecated": true + }, + "python_default_packages_file": { + "description": "Path to a file containing default python packages to install when installing python.", + "type": "string", + "deprecated": true + }, + "python_patch_url": { + "description": "URL to fetch python patches from.", + "type": "string", + "deprecated": true + }, + "python_patches_directory": { + "description": "Directory to fetch python patches from.", + "type": "string", + "deprecated": true + }, + "python_precompiled_arch": { + "description": "Specify the architecture to use for precompiled binaries.", + "type": "string", + "deprecated": true + }, + "python_precompiled_os": { + "description": "Specify the OS to use for precompiled binaries.", + "type": "string", + "deprecated": true + }, + "python_pyenv_repo": { + "description": "URL to fetch pyenv from for compiling python.", + "type": "string", + "deprecated": true + }, + "python_venv_auto_create": { + "description": "Automatically create virtualenvs for python tools.", + "type": "boolean", + "deprecated": true + }, + "python_venv_stdlib": { + "description": "Prefer to use venv from Python's standard library.", + "type": "boolean", + "deprecated": true + }, + "quiet": { + "description": "Suppress all output except errors.", + "type": "boolean" + }, + "raw": { + "description": "Connect stdin/stdout/stderr to child processes.", + "type": "boolean" + }, + "ruby": { + "additionalProperties": false, + "properties": { + "apply_patches": { + "description": "A list of patch files or URLs to apply to ruby source.", + "type": "string" + }, + "default_packages_file": { + "default": "~/.default-gems", + "description": "Path to a file containing default ruby gems to install when installing ruby.", + "type": "string" + }, + "ruby_build_opts": { + "description": "Options to pass to ruby-build.", + "type": "string" + }, + "ruby_build_repo": { + "default": "https://github.com/rbenv/ruby-build.git", + "description": "URL to fetch ruby-build from.", + "type": "string" + }, + "ruby_install": { + "description": "Use ruby-install instead of ruby-build.", + "type": "boolean" + }, + "ruby_install_opts": { + "description": "Options to pass to ruby-install.", + "type": "string" + }, + "ruby_install_repo": { + "default": "https://github.com/postmodern/ruby-install.git", + "description": "URL to fetch ruby-install from.", + "type": "string" + }, + "verbose_install": { + "description": "Set to true to enable verbose output during ruby installation.", + "type": "boolean" + } + } + }, + "rust": { + "additionalProperties": false, + "properties": { + "cargo_home": { + "description": "Path to the cargo home directory. Defaults to ~/.cargo or %USERPROFILE%\\.cargo", + "type": "string" + }, + "rustup_home": { + "description": "Path to the rustup home directory. Defaults to ~/.rustup or %USERPROFILE%\\.rustup", + "type": "string" + } + } + }, + "shorthands_file": { + "description": "Path to a file containing custom tool shorthands.", + "type": "string" + }, + "silent": { + "description": "Suppress all `mise run|watch` output except errors—including what tasks output.", + "type": "boolean" + }, + "sops": { + "additionalProperties": false, + "properties": { + "age_key": { + "description": "The age private key to use for sops secret decryption.", + "type": "string" + }, + "age_key_file": { + "description": "Path to the age private key file to use for sops secret decryption.", + "type": "string" + }, + "age_recipients": { + "description": "The age public keys to use for sops secret encryption.", + "type": "string" + }, + "rops": { + "default": true, + "description": "Use rops to decrypt sops files. Disable to shell out to `sops` which will slow down mise but sops may offer features not available in rops.", + "type": "boolean" + } + } + }, + "status": { + "additionalProperties": false, + "properties": { + "missing_tools": { + "default": "if_other_versions_installed", + "description": "Show a warning if tools are not installed when entering a directory with a mise.toml file.", + "type": "string" + }, + "show_env": { + "description": "Show configured env vars when entering a directory with a mise.toml file.", + "type": "boolean" + }, + "show_tools": { + "description": "Show configured env vars when entering a directory with a mise.toml file.", + "type": "boolean" + } + } + }, + "swift": { + "additionalProperties": false, + "properties": { + "gpg_verify": { + "description": "Use gpg to verify swift tool signatures.", + "type": "boolean" + }, + "platform": { + "description": "Override the platform to use for precompiled binaries.", + "type": "string" + } + } + }, + "system_config_file": { + "description": "Path to the system mise config file. Default is `/etc/mise/config.toml`. This must be an env var.", + "type": "string" + }, + "task_disable_paths": { + "default": [], + "description": "Paths that mise will not look for tasks in.", + "type": "array", + "items": { + "type": "string" + } + }, + "task_output": { + "description": "Change output style when executing tasks.", + "type": "string", + "enum": [ + "prefix", + "interleave", + "keep-order", + "replacing", + "timed", + "quiet", + "silent" + ] + }, + "task_run_auto_install": { + "default": true, + "description": "Automatically install missing tools when executing tasks.", + "type": "boolean" + }, + "task_skip": { + "default": [], + "description": "Tasks to skip when running `mise run`.", + "type": "array", + "items": { + "type": "string" + } + }, + "task_timings": { + "description": "Show completion message with elapsed time for each task on `mise run`. Default shows when output type is `prefix`.", + "type": "boolean" + }, + "trace": { + "description": "Sets log level to trace", + "type": "boolean" + }, + "trusted_config_paths": { + "default": [], + "description": "This is a list of config paths that mise will automatically mark as trusted.", + "type": "array", + "items": { + "type": "string" + } + }, + "unix_default_file_shell_args": { + "default": "sh", + "description": "List of default shell arguments for unix to be used with `file`. For example `sh`.", + "type": "string" + }, + "unix_default_inline_shell_args": { + "default": "sh -c -o errexit", + "description": "List of default shell arguments for unix to be used with inline commands. For example, `sh`, `-c` for sh.", + "type": "string" + }, + "use_file_shell_for_executable_tasks": { + "default": false, + "description": "Determines whether to use a specified shell for executing tasks in the tasks directory. When set to true, the shell defined in the file will be used, or the default shell specified by `windows_default_file_shell_args` or `unix_default_file_shell_args` will be applied. If set to false, tasks will be executed directly as programs.", + "type": "boolean" + }, + "use_versions_host": { + "default": true, + "description": "Set to false to disable using the mise-versions API as a quick way for mise to query for new versions.", + "type": "boolean" + }, + "verbose": { + "description": "Shows more verbose output such as installation logs when installing tools.", + "type": "boolean" + }, + "vfox": { + "description": "Use vfox as a default plugin backend instead of asdf.", + "type": "boolean", + "deprecated": true + }, + "windows_default_file_shell_args": { + "default": "cmd /c", + "description": "List of default shell arguments for Windows to be used for file commands. For example, `cmd`, `/c` for cmd.exe.", + "type": "array", + "items": { + "type": "string" + } + }, + "windows_default_inline_shell_args": { + "default": "cmd /c", + "description": "List of default shell arguments for Windows to be used for inline commands. For example, `cmd`, `/c` for cmd.exe.", + "type": "string" + }, + "windows_executable_extensions": { + "default": ["exe", "bat", "cmd", "com", "ps1", "vbs"], + "description": "List of executable extensions for Windows. For example, `exe` for .exe files, `bat` for .bat files, and so on.", + "type": "array", + "items": { + "type": "string" + } + }, + "yes": { + "description": "This will automatically answer yes or no to prompts. This is useful for scripting.", + "type": "boolean" + } + } + }, + "task": { + "oneOf": [ + { + "description": "script to run", + "type": "string" + }, + { + "description": "script to run", + "items": { + "description": "script to run", + "type": "string" + }, + "type": "array" + }, + { + "additionalProperties": false, + "properties": { + "alias": { + "oneOf": [ + { + "description": "alias for this task", + "type": "string" + }, + { + "description": "alias for this task", + "items": { + "description": "alias for this task", + "type": "string" + }, + "type": "array" + } + ] + }, + "depends": { + "description": "other tasks to run before this task", + "items": { + "oneOf": [ + { + "description": "task with args to run before this task", + "type": "string" + }, + { + "description": "task with args to run before this task", + "items": { + "description": "task name and args", + "type": "string" + }, + "type": "array" + } + ] + }, + "type": "array" + }, + "depends_post": { + "description": "other tasks to run after this task", + "items": { + "oneOf": [ + { + "description": "task with args to run after this task", + "type": "string" + }, + { + "description": "task with args to run after this task", + "items": { + "description": "task name and args", + "type": "string" + }, + "type": "array" + } + ] + }, + "type": "array" + }, + "wait_for": { + "description": "if these tasks run, wait for them to complete first", + "items": { + "description": "task to run before this task", + "type": "string" + }, + "type": "array" + }, + "description": { + "description": "description of task", + "type": "string" + }, + "dir": { + "description": "directory to run script in, default is current working directory", + "type": "string" + }, + "env": { + "additionalProperties": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "enum": [false], + "type": "boolean" + } + ] + }, + "description": "environment variables", + "type": "object" + }, + "tools": { + "description": "tools to install/activate before running this task", + "additionalProperties": { + "oneOf": [ + { + "description": "version of the tool to install", + "type": "string" + }, + { + "properties": { + "version": { + "description": "version of the tool to install", + "type": "string" + }, + "os": { + "oneOf": [ + { + "description": "operating system to install on", + "type": "array" + }, + { + "description": "option to pass to tool", + "type": "string" + }, + { + "description": "option to pass to tool", + "type": "boolean" + } + ] + } + }, + "required": ["version"], + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + } + ] + } + } + ] + }, + "type": "object" + }, + "hide": { + "description": "do not display this task", + "type": "boolean" + }, + "outputs": { + "description": "files created by this task", + "items": { + "description": "glob pattern or path to files created by this task", + "type": "string" + }, + "type": "array" + }, + "quiet": { + "description": "do not display mise information for this task", + "type": "boolean" + }, + "raw": { + "description": "directly connect task to stdin/stdout/stderr", + "type": "boolean" + }, + "run": { + "oneOf": [ + { + "description": "script to run", + "type": "string" + }, + { + "description": "script to run", + "items": { + "description": "script to run", + "type": "string" + }, + "type": "array" + } + ] + }, + "run_windows": { + "oneOf": [ + { + "description": "script to run on windows", + "type": "string" + }, + { + "description": "script to run on windows", + "items": { + "description": "script to run on windows", + "type": "string" + }, + "type": "array" + } + ] + }, + "file": { + "description": "Execute an external script", + "type": "string" + }, + "sources": { + "description": "files that this task depends on", + "items": { + "description": "glob pattern or path to files that this task depends on", + "type": "string" + }, + "type": "array" + }, + "shell": { + "description": "specify a shell command to run the script with", + "type": "string", + "default": "sh -c" + }, + "usage": { + "description": "Specify usage (https://usage.jdx.dev/) specs for the task", + "type": "string" + } + }, + "type": "object" + } + ] + }, + "vars": { + "description": "variables to set", + "type": "object", + "properties": { + "_": { + "description": "vars modules", + "additionalProperties": true, + "properties": { + "file": { + "oneOf": [ + { + "description": "dotenv file to load", + "type": "string" + }, + { + "description": "dotenv files to load", + "items": { + "description": "dotenv file to load", + "type": "string" + }, + "type": "array" + } + ] + }, + "source": { + "oneOf": [ + { + "description": "bash script to load", + "type": "string" + }, + { + "description": "bash scripts to load", + "items": { + "description": "bash script to load", + "type": "string" + }, + "type": "array" + } + ] + } + }, + "type": "object" + } + }, + "additionalProperties": { + "description": "value of variable", + "type": "string" + } + }, + "task_config": { + "description": "configuration for task execution/management", + "type": "object", + "additionalProperties": false, + "properties": { + "dir": { + "description": "default directory to run tasks in defined in this file", + "type": "string" + }, + "includes": { + "description": "files/directories to include searching for tasks", + "items": { + "description": "file/directory root to include in task execution", + "type": "string" + }, + "type": "array" + } + } + }, + "tool": { + "oneOf": [ + { + "description": "version of the tool to install", + "type": "string" + }, + { + "properties": { + "version": { + "description": "version of the tool to install", + "type": "string" + }, + "os": { + "oneOf": [ + { + "description": "operating system to install on", + "type": "array" + }, + { + "description": "option to pass to tool", + "type": "string" + }, + { + "description": "option to pass to tool", + "type": "boolean" + } + ] + } + }, + "required": ["version"], + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "type": "string" + } + ] + } + } + ] + }, + "hooks": { + "description": "hooks to run", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "description": "script to run", + "type": "string" + }, + { + "description": "script to run", + "items": { + "description": "script to run", + "type": "string" + }, + "type": "array" + }, + { + "additionalProperties": false, + "properties": { + "script": { + "description": "script to run", + "type": "string" + }, + "shell": { + "description": "specify the shell to run the script inside of", + "type": "string" + } + }, + "type": "object" + } + ] + } + }, + "watch_files": { + "description": "files to watch for changes", + "type": "array", + "items": { + "type": "object", + "description": "file to watch for changes", + "additionalProperties": false, + "properties": { + "run": { + "type": "string", + "description": "script to run when file changes", + "items": { + "type": "string" + } + }, + "patterns": { + "type": "array", + "description": "patterns to watch for", + "items": { + "type": "string" + } + } + } + } + } + }, + "additionalProperties": false, + "description": "config file for mise version manager (mise.toml)", + "properties": { + "alias": { + "description": "custom shorthands", + "type": "object", + "additionalProperties": { + "oneOf": [ + { + "description": "where the alias goes", + "type": "string" + }, + { + "description": "tool to set aliases for", + "type": "object", + "additionalProperties": { + "description": "version alias points to", + "type": "string" + } + } + ] + } + }, + "env": { + "oneOf": [ + { + "$ref": "#/$defs/env" + }, + { + "type": "array", + "items": { + "$ref": "#/$defs/env" + } + } + ] + }, + "min_version": { + "description": "minimum version of mise required to use this config", + "pattern": "^\\d+\\.\\d+\\.\\d+$", + "type": "string" + }, + "redactions": { + "description": "env or vars keys to redact from logs", + "type": "array", + "items": { + "type": "string" + } + }, + "plugins": { + "additionalProperties": { + "description": "url to plugin repository", + "type": "string" + }, + "description": "plugins to use", + "type": "object" + }, + "settings": { + "$ref": "#/$defs/settings", + "additionalProperties": false, + "description": "mise settings", + "type": "object" + }, + "task_config": { + "$ref": "#/$defs/task_config" + }, + "tasks": { + "additionalProperties": { + "$ref": "#/$defs/task" + }, + "description": "task runner tasks", + "type": "object" + }, + "tools": { + "additionalProperties": { + "oneOf": [ + { + "items": { + "$ref": "#/$defs/tool" + }, + "type": "array" + }, + { + "$ref": "#/$defs/tool" + } + ] + }, + "description": "dev tools to use", + "type": "object" + }, + "hooks": { + "$ref": "#/$defs/hooks" + }, + "vars": { + "$ref": "#/$defs/vars" + }, + "watch_files": { + "$ref": "#/$defs/watch_files" + }, + "_": { + "additionalProperties": true + } + } +} diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 15d810c9..d9c3718e 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -5,6 +5,28 @@ 134130 com.intellij.modules.platform + org.toml.lang + + + + + + + + + + + + + + com.intellij.java JavaScript com.intellij.modules.rider - org.toml.lang