vue

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package vue implements `sf vue` — helpers over a Vue frontend. `routes` parses a vue-router config (`createRouter({ routes: [...] })`) into a flat route map (full path, name, component, meta), so the agent reads one compact table instead of the whole router file. Extraction is heuristic (no pure-Go TS parser) but the router DSL is regular: objects with path/name/component/meta and nested children.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand() *cobra.Command

NewCommand returns the `vue` group (`sf vue …`).

func Run

func Run(opts Options, w io.Writer) error

Run finds/loads the router file, parses its routes, renders them, and logs.

Types

type Options

type Options struct {
	Root   string // tree to search for router/index.ts (default: cwd)
	File   string // explicit router file (overrides the search)
	Format string
}

Options controls a `vue routes` run.

type Route

type Route struct {
	Path      string `json:"path"`
	Name      string `json:"name,omitempty"`
	Component string `json:"component,omitempty"`
	Meta      string `json:"meta,omitempty"`
}

Route is one resolved route.

func Parse

func Parse(src string) []Route

Parse extracts a flat, depth-resolved route list from router source.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL