Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
e6b3552
feat: deno runtime for typescript
dmmordvi Feb 13, 2026
d8f4d76
wip: chart ts init / chart ts build, changes for ts init
dmmordvi Feb 17, 2026
deb9960
wip: fixes for init ts test
dmmordvi Feb 17, 2026
ced72e2
wip: `deno task build` in deno.json
dmmordvi Feb 17, 2026
38f495b
wip: missing import
dmmordvi Feb 17, 2026
0cde3ee
wip: deno bundle implementation
dmmordvi Feb 18, 2026
46ba3e4
Merge branch 'main' into feat/typescript-deno
dmmordvi Feb 18, 2026
2f26171
wip: format fix
dmmordvi Feb 18, 2026
238a355
wip: helm ignore node_modules
dmmordvi Feb 19, 2026
0422508
wip: move `deno bundle` logic to 3p-helm, draft for `nelm chart ts bu…
dmmordvi Feb 20, 2026
d795632
feat: fixes for ts build
dmmordvi Feb 20, 2026
13102ea
wip: ChartName for ts init (from werf)
dmmordvi Feb 25, 2026
cb061b4
Merge branch 'main' into feat/typescript-deno
dmmordvi Feb 25, 2026
b21d3a7
wip: apply wormatter
dmmordvi Feb 25, 2026
7c13ab2
wip: write context as `input.yaml` into temp dir and pass to deno run
dmmordvi Feb 25, 2026
92a0580
wip: test fixes for ts/init
dmmordvi Feb 25, 2026
83406cf
wip: tree folder structure for typescript render
dmmordvi Feb 26, 2026
28db0c4
wip: DenoRuntime class + binary downloader with double-checked lockin…
dmmordvi Feb 26, 2026
e928058
Merge branch 'main' into feat/typescript-deno
dmmordvi Feb 26, 2026
5c339a9
wip: updated 3p-helm version
dmmordvi Feb 26, 2026
1b95a3c
wip: fixes for logging
dmmordvi Feb 26, 2026
8b3dec7
wip: changed naming for ts package from 3p-helm
dmmordvi Feb 27, 2026
30423bf
wip: --rebuild-ts and --deno-bin-path flags
dmmordvi Feb 27, 2026
e17d511
Merge branch 'main' into feat/typescript-deno
dmmordvi Feb 27, 2026
ef3ce5f
fix: review recommendations fixes
dmmordvi Mar 6, 2026
caca802
Merge branch 'main' into feat/typescript-deno
dmmordvi Mar 6, 2026
bf3aeab
fix: changed ts rebuild flag
dmmordvi Mar 6, 2026
2a5a401
fix: changes for chart ts init, small refactor for BundleChartRecursi…
dmmordvi Mar 10, 2026
9bbdee1
fix: format fixes
dmmordvi Mar 10, 2026
dd2dcb2
Merge branch 'main' into feat/typescript-deno
dmmordvi Mar 10, 2026
920e4b9
fix: changed comment for InitChartStructure
dmmordvi Mar 11, 2026
53c6b7a
Merge branch 'main' into feat/typescript-deno
dmmordvi Mar 12, 2026
de00522
fix: moved changes from 3p-helm
dmmordvi Mar 12, 2026
1cf3d0e
refactor: use separate functions instead of DenoRuntime class
dmmordvi Mar 12, 2026
fa7d4bd
wip: updated version of npm package for init ts, changed description …
dmmordvi Mar 12, 2026
c8b7f0a
wip: changed the way to pass DenoBinaryPath
dmmordvi Mar 13, 2026
7064989
wip: changed the way to pass DenoBinaryPath
dmmordvi Mar 13, 2026
4230257
Merge branch 'main' into feat/typescript-deno
dmmordvi Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ linters:
gosec:
excludes:
- G306
- G110 # Potential DoS vulnerability via decompression bomb
wsl_v5:
allow-whole-block: true
wrapcheck:
Expand Down
2 changes: 1 addition & 1 deletion cmd/nelm/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ func newChartCommand(ctx context.Context, afterAllCommandsBuiltFuncs map[*cobra.
cli.GroupCommandOptions{},
)

cmd.AddCommand(newChartInitCommand(ctx, afterAllCommandsBuiltFuncs))
cmd.AddCommand(newChartRenderCommand(ctx, afterAllCommandsBuiltFuncs))
cmd.AddCommand(newChartDependencyCommand(ctx, afterAllCommandsBuiltFuncs))
cmd.AddCommand(newChartDownloadCommand(ctx, afterAllCommandsBuiltFuncs))
cmd.AddCommand(newChartUploadCommand(ctx, afterAllCommandsBuiltFuncs))
cmd.AddCommand(newChartPackCommand(ctx, afterAllCommandsBuiltFuncs))
cmd.AddCommand(newChartLintCommand(ctx, afterAllCommandsBuiltFuncs))
cmd.AddCommand(newChartSecretCommand(ctx, afterAllCommandsBuiltFuncs))
cmd.AddCommand(newChartTSCommand(ctx, afterAllCommandsBuiltFuncs))

return cmd
}
14 changes: 14 additions & 0 deletions cmd/nelm/chart_lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,20 @@ func newChartLintCommand(ctx context.Context, afterAllCommandsBuiltFuncs map[*co
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.IgnoreBundleJS, "ignore-bundle-js", false, IgnoreBundleJSFlagDescription, cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: tsFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.DenoBinaryPath, "deno-binary-path", "", "Path to the Deno binary to use instead of auto-downloading.", cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: tsFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.LogColorMode, "color-mode", common.DefaultLogColorMode, "Color mode for logs. "+allowedLogColorModesHelp(), cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: miscFlagGroup,
Expand Down
24 changes: 15 additions & 9 deletions cmd/nelm/chart_pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import (
"github.com/werf/common-go/pkg/cli"
helm_v3 "github.com/werf/nelm/internal/helm/cmd/helm"
"github.com/werf/nelm/internal/helm/pkg/chart/loader"
"github.com/werf/nelm/internal/helm/pkg/werf/helmopts"
"github.com/werf/nelm/internal/ts"
"github.com/werf/nelm/pkg/featgate"
"github.com/werf/nelm/pkg/log"
)

func newChartPackCommand(ctx context.Context, afterAllCommandsBuiltFuncs map[*cobra.Command]func(cmd *cobra.Command) error) *cobra.Command {
opts := helmopts.TypeScriptOptions{}
cmd := lo.Must(lo.Find(helmRootCmd.Commands(), func(c *cobra.Command) bool {
return strings.HasPrefix(c.Use, "package")
}))
Expand All @@ -33,23 +34,28 @@ func newChartPackCommand(ctx context.Context, afterAllCommandsBuiltFuncs map[*co
helmSettings := helm_v3.Settings

ctx = log.SetupLogging(ctx, lo.Ternary(helmSettings.Debug, log.DebugLevel, log.InfoLevel), log.SetupLoggingOptions{})
ctx = ts.NewContextWithTSOptions(ctx, opts)
cmd.SetContext(ctx)

loader.NoChartLockWarning = ""

if featgate.FeatGateTypescript.Enabled() {
for _, chartPath := range args {
if err := ts.BuildVendorBundleToDir(ctx, chartPath); err != nil {
return fmt.Errorf("build TypeScript vendor bundle in %q: %w", chartPath, err)
}
}
}

if err := originalRunE(cmd, args); err != nil {
return err
}

return nil
}

afterAllCommandsBuiltFuncs[cmd] = func(cmd *cobra.Command) error {
if err := cli.AddFlag(cmd, &opts.DenoBinaryPath, "deno-binary-path", "", "Path to the Deno binary to use instead of auto-downloading.", cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: tsFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

return nil
}

return cmd
}
14 changes: 14 additions & 0 deletions cmd/nelm/chart_render.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,20 @@ func newChartRenderCommand(ctx context.Context, afterAllCommandsBuiltFuncs map[*
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.IgnoreBundleJS, "ignore-bundle-js", false, IgnoreBundleJSFlagDescription, cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: tsFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.DenoBinaryPath, "deno-binary-path", "", "Path to the Deno binary to use instead of auto-downloading.", cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: tsFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.LogColorMode, "color-mode", common.DefaultLogColorMode, "Color mode for logs. "+allowedLogColorModesHelp(), cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: miscFlagGroup,
Expand Down
25 changes: 25 additions & 0 deletions cmd/nelm/chart_ts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package main

import (
"context"

"github.com/spf13/cobra"

"github.com/werf/common-go/pkg/cli"
)

func newChartTSCommand(ctx context.Context, afterAllCommandsBuiltFuncs map[*cobra.Command]func(cmd *cobra.Command) error) *cobra.Command {
cmd := cli.NewGroupCommand(
ctx,
"ts",
"Manage TypeScript charts.",
"Manage TypeScript charts.",
tsCmdGroup,
cli.GroupCommandOptions{},
)

cmd.AddCommand(newChartTSInitCommand(ctx, afterAllCommandsBuiltFuncs))
cmd.AddCommand(newChartTSBuildCommand(ctx, afterAllCommandsBuiltFuncs))

return cmd
}
39 changes: 20 additions & 19 deletions cmd/nelm/chart_init.go → cmd/nelm/chart_ts_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ import (
"github.com/werf/nelm/pkg/log"
)

type chartInitConfig struct {
action.ChartInitOptions
type chartTSBuildConfig struct {
action.ChartTSBuildOptions

LogColorMode string
LogLevel string
}

func newChartInitCommand(ctx context.Context, afterAllCommandsBuiltFuncs map[*cobra.Command]func(cmd *cobra.Command) error) *cobra.Command {
cfg := &chartInitConfig{}
func newChartTSBuildCommand(ctx context.Context, afterAllCommandsBuiltFuncs map[*cobra.Command]func(cmd *cobra.Command) error) *cobra.Command {
cfg := &chartTSBuildConfig{}

cmd := cli.NewSubCommand(
ctx,
"init [PATH]",
"Initialize a new chart.",
"Initialize a new chart in the specified directory. If PATH is not specified, uses the current directory.",
"build [PATH]",
"Build TypeScript chart.",
"Build TypeScript chart in the specified directory. If PATH is not specified, uses the current directory.",
10, // priority for ordering in help
chartCmdGroup,
tsCmdGroup,
cli.SubCommandOptions{
Args: cobra.MaximumNArgs(1),
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
Expand All @@ -45,39 +45,40 @@ func newChartInitCommand(ctx context.Context, afterAllCommandsBuiltFuncs map[*co
cfg.ChartDirPath = args[0]
}

if err := action.ChartInit(ctx, cfg.ChartInitOptions); err != nil {
return fmt.Errorf("chart init: %w", err)
if err := action.ChartTSBuild(ctx, cfg.ChartTSBuildOptions); err != nil {
return fmt.Errorf("chart build: %w", err)
}

return nil
},
)

afterAllCommandsBuiltFuncs[cmd] = func(cmd *cobra.Command) error {
if err := cli.AddFlag(cmd, &cfg.TS, "ts", false, "Initialize TypeScript chart", cli.AddFlagOptions{
Group: mainFlagGroup,
if err := cli.AddFlag(cmd, &cfg.LogColorMode, "color-mode", common.DefaultLogColorMode, "Color mode for logs. "+allowedLogColorModesHelp(), cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: miscFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.TempDirPath, "temp-dir", "", "The directory for temporary files. By default, create a new directory in the default system directory for temporary files", cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalEnvVarRegexes,
if err := cli.AddFlag(cmd, &cfg.LogLevel, "log-level", string(log.InfoLevel), "Set log level. "+allowedLogLevelsHelp(), cli.AddFlagOptions{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check which flags are present in any command. Even if not always used. At least tempdir flag is missing.

GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: miscFlagGroup,
Type: cli.FlagTypeDir,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.LogColorMode, "color-mode", common.DefaultLogColorMode, "Color mode for logs. "+allowedLogColorModesHelp(), cli.AddFlagOptions{
if err := cli.AddFlag(cmd, &cfg.DenoBinaryPath, "deno-binary-path", "", "Path to the Deno binary to use instead of auto-downloading.", cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: miscFlagGroup,
Group: tsFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.LogLevel, "log-level", string(log.InfoLevel), "Set log level. "+allowedLogLevelsHelp(), cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
if err := cli.AddFlag(cmd, &cfg.TempDirPath, "temp-dir", "", "The directory for temporary files. By default, create a new directory in the default system directory for temporary files", cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalEnvVarRegexes,
Group: miscFlagGroup,
Type: cli.FlagTypeDir,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}
Expand Down
83 changes: 83 additions & 0 deletions cmd/nelm/chart_ts_init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package main

import (
"cmp"
"context"
"fmt"

"github.com/spf13/cobra"

"github.com/werf/common-go/pkg/cli"
"github.com/werf/nelm/pkg/action"
"github.com/werf/nelm/pkg/common"
"github.com/werf/nelm/pkg/log"
)

type chartTSInitConfig struct {
action.ChartTSInitOptions

LogColorMode string
LogLevel string
}

func newChartTSInitCommand(ctx context.Context, afterAllCommandsBuiltFuncs map[*cobra.Command]func(cmd *cobra.Command) error) *cobra.Command {
cfg := &chartTSInitConfig{}

cmd := cli.NewSubCommand(
ctx,
"init [PATH]",
"Initialize the files needed to render manifests using TypeScript.",
"Initialize the files needed to render manifests using TypeScript. If PATH is not specified, uses the current directory.",
20, // priority for ordering in help
tsCmdGroup,
cli.SubCommandOptions{
Args: cobra.MaximumNArgs(1),
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
return nil, cobra.ShellCompDirectiveFilterDirs
},
},
func(cmd *cobra.Command, args []string) error {
ctx = log.SetupLogging(ctx, cmp.Or(log.Level(cfg.LogLevel), log.InfoLevel), log.SetupLoggingOptions{
ColorMode: cfg.LogColorMode,
})

if len(args) > 0 {
cfg.ChartDirPath = args[0]
}

if err := action.ChartTSInit(ctx, cfg.ChartTSInitOptions); err != nil {
return fmt.Errorf("chart ts init: %w", err)
}

return nil
},
)

afterAllCommandsBuiltFuncs[cmd] = func(cmd *cobra.Command) error {
if err := cli.AddFlag(cmd, &cfg.TempDirPath, "temp-dir", "", "The directory for temporary files. By default, create a new directory in the default system directory for temporary files", cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalEnvVarRegexes,
Group: miscFlagGroup,
Type: cli.FlagTypeDir,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.LogColorMode, "color-mode", common.DefaultLogColorMode, "Color mode for logs. "+allowedLogColorModesHelp(), cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: miscFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.LogLevel, "log-level", string(log.InfoLevel), "Set log level. "+allowedLogLevelsHelp(), cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: miscFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

return nil
}

return cmd
}
2 changes: 2 additions & 0 deletions cmd/nelm/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"github.com/werf/nelm/pkg/log"
)

const IgnoreBundleJSFlagDescription = "Do not use the existing bundle.js file. Requires TypeScript source files and Deno to rebuild."

var helmRootCmd *cobra.Command

func allowedLogColorModesHelp() string {
Expand Down
2 changes: 2 additions & 0 deletions cmd/nelm/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ var (
chartCmdGroup = cli.NewCommandGroup("chart", "Chart commands:", 90)
secretCmdGroup = cli.NewCommandGroup("secret", "Secret commands:", 80)
dependencyCmdGroup = cli.NewCommandGroup("dependency", "Dependency commands:", 70)
tsCmdGroup = cli.NewCommandGroup("ts", "TypeScript commands:", 60)
repoCmdGroup = cli.NewCommandGroup("repo", "Repo commands:", 60)
miscCmdGroup = cli.NewCommandGroup("misc", "Other commands:", 0)
mainFlagGroup = cli.NewFlagGroup("main", "Options:", 100)
valuesFlagGroup = cli.NewFlagGroup("values", "Values options:", 90)
secretFlagGroup = cli.NewFlagGroup("secret", "Secret options:", 80)
resourceValidationGroup = cli.NewFlagGroup("resource-validation", "Resource validation options:", 75)
patchFlagGroup = cli.NewFlagGroup("patch", "Patch options:", 70)
tsFlagGroup = cli.NewFlagGroup("typescript", "TypeScript options:", 67)
progressFlagGroup = cli.NewFlagGroup("progress", "Progress options:", 65)
chartRepoFlagGroup = cli.NewFlagGroup("chart-repo", "Chart repository options:", 60)
kubeConnectionFlagGroup = cli.NewFlagGroup("kube-connection", "Kubernetes connection options:", 50)
Expand Down
14 changes: 14 additions & 0 deletions cmd/nelm/release_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,20 @@ func newReleaseInstallCommand(ctx context.Context, afterAllCommandsBuiltFuncs ma
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.IgnoreBundleJS, "ignore-bundle-js", false, IgnoreBundleJSFlagDescription, cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: tsFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.DenoBinaryPath, "deno-binary-path", "", "Path to the Deno binary to use instead of auto-downloading.", cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: tsFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.PlanArtifactPath, "use-plan", "", "Use the gzip-compressed JSON plan file from the specified path during release install", cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagLocalEnvVarRegexes,
Group: mainFlagGroup,
Expand Down
14 changes: 14 additions & 0 deletions cmd/nelm/release_plan_install.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,20 @@ func newReleasePlanInstallCommand(ctx context.Context, afterAllCommandsBuiltFunc
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.IgnoreBundleJS, "ignore-bundle-js", false, IgnoreBundleJSFlagDescription, cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: tsFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.DenoBinaryPath, "deno-binary-path", "", "Path to the Deno binary to use instead of auto-downloading.", cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: tsFlagGroup,
}); err != nil {
return fmt.Errorf("add flag: %w", err)
}

if err := cli.AddFlag(cmd, &cfg.Timeout, "timeout", 0, "Fail if not finished in time", cli.AddFlagOptions{
GetEnvVarRegexesFunc: cli.GetFlagGlobalAndLocalEnvVarRegexes,
Group: mainFlagGroup,
Expand Down
Loading
Loading