refactor(commands): separate commands and its core into two folders (#32)

- I think it would be better if one for commands only, one for the spec
handling core logic so people won't be confused by the core logic inside
the commands folder (cleaner I guess)
- Regen docs
This commit is contained in:
VERSE
2026-07-05 11:27:30 +07:00
committed by GitHub
parent 6b98455957
commit ebde9ba68f
536 changed files with 2241 additions and 2241 deletions
+10 -10
View File
@@ -1,19 +1,19 @@
package js
import (
"github.com/versenilvis/iris/commands/core"
"github.com/versenilvis/iris/spec"
)
func init() {
core.Register(&core.Spec{
spec.Register(&spec.Spec{
Name: "yarn",
Description: "yarn package manager",
Subcommands: []core.Subcommand{
{Name: "install", Description: "install packages", Options: []core.Option{
Subcommands: []spec.Subcommand{
{Name: "install", Description: "install packages", Options: []spec.Option{
{Name: "--frozen-lockfile", Description: "error on lockfile change"},
{Name: "--production", Description: "production only"},
}},
{Name: "add", Description: "add package", Options: []core.Option{
{Name: "add", Description: "add package", Options: []spec.Option{
{Name: "-D", Description: "dev dependency"},
{Name: "-P", Description: "peer dependency"},
{Name: "-E", Description: "exact version"},
@@ -24,30 +24,30 @@ func init() {
{Name: "build", Description: "build project"},
{Name: "dev", Description: "start dev server"},
{Name: "test", Description: "run tests"},
{Name: "upgrade", Description: "upgrade packages", Options: []core.Option{
{Name: "upgrade", Description: "upgrade packages", Options: []spec.Option{
{Name: "--latest", Description: "upgrade to latest"},
{Name: "-i", Description: "interactive"},
}},
{Name: "workspace", Description: "run command in workspace"},
{Name: "workspaces", Description: "list workspaces", Subcommands: []core.Subcommand{
{Name: "workspaces", Description: "list workspaces", Subcommands: []spec.Subcommand{
{Name: "info", Description: "workspace info"},
{Name: "run", Description: "run in all workspaces"},
}},
{Name: "link", Description: "symlink package"},
{Name: "unlink", Description: "unlink package"},
{Name: "audit", Description: "security audit"},
{Name: "cache", Description: "manage cache", Subcommands: []core.Subcommand{
{Name: "cache", Description: "manage cache", Subcommands: []spec.Subcommand{
{Name: "clean", Description: "clear cache"},
{Name: "list", Description: "list cache"},
{Name: "dir", Description: "print cache dir"},
}},
{Name: "init", Description: "create package.json", Options: []core.Option{
{Name: "init", Description: "create package.json", Options: []spec.Option{
{Name: "-2", Description: "berry (v2+)"},
}},
{Name: "publish", Description: "publish package"},
{Name: "info", Description: "show package info"},
},
Options: []core.Option{
Options: []spec.Option{
{Name: "--cwd", Description: "working directory"},
{Name: "--verbose", Description: "verbose output"},
},