package jslang import _ "embed" // The starter files Turbo JS writes into a project's .turbo-js directory. // // They live in four files beside this one and are embedded into the binary at // compile time. Written out as text rather than encoded from structs because // they are meant to be read and edited by a person: the comments in them say // what each key is for, which is the whole reason the editor offers to create // them at all rather than only to read them. // // Their contents are the one part of these four files that is about // JavaScript and Node rather than about editing, which is why they live here // and not in turbo-core. // // **The .tmpl suffix is not decoration.** Each file is formatted with // fmt.Sprintf before it is written, and settings.toml.tmpl holds `theme = %q` // — which is not valid TOML. Naming it settings.toml would be a claim it // cannot meet: a TOML linter would reject it, and Turbo JS itself would colour // it as TOML and draw it as broken. The blanks each one takes are documented // on profile.Templates, and templates_test.go holds them to it. // settingsTemplate is the settings file a project gets when it asks for one. // // autosave is on: a project that has gone to the trouble of creating a // settings file has said what it wants, and the file is the visible, editable // place to say otherwise. settings.Default() — what applies with no file at // all — stays off. // //go:embed settings.toml.tmpl var settingsTemplate string // snippetsTemplate is the snippets file a project gets when it asks for one. // // It lists every language name the editor knows in its `languages` comment, // because that comment is where a user finds out what they may write there. A // test iterates syntax.Registered() rather than a hardcoded list, so the // comment cannot fall behind the registry. // //go:embed snippets.toml.tmpl var snippetsTemplate string // toolsTemplate is the tools file a project gets when it asks for one. // // Six commands, and the two features that are invisible otherwise: a // {{placeholder}} that asks for a value before the command runs — Run uses a // real one, because a Node project has no single entry point the editor could // know — and the `menu` key that puts a tool in a menu of its own. // //go:embed tools.toml.tmpl var toolsTemplate string // agentsTemplate is the agents file a project gets when it asks for one. // // It takes two blanks, in this order: the editor's own project directory — // which the example agent's arguments point into — and the path to the user's // own agents file, which a comment names. // //go:embed acp.toml.tmpl var agentsTemplate string