Skip to content

feat(web): package Gomplate for npm - #195

Merged
moshloop merged 1 commit into
mainfrom
feat/npm-publishing
Dec 2, 2026
Merged

moshloop merged 1 commit into
mainfrom
feat/npm-publishing

Conversation

@moshloop

@moshloop moshloop commented Dec 2, 2026 •

Copy link
Copy Markdown
Member
  • Packages Gomplate's web language support for npm publishing
  • Adds an npm publish workflow
  • Restructures playground app and packages/lang (src, tests, build configs, lockfile)

Notes

  • Single commit; file list spans workflow, Go render code, and web packages

Summary by CodeRabbit

  • New Features
    • The Gomplate package now includes reusable React playground components, evaluation utilities, and associated styles.
    • Added a manual workflow for publishing the package to npm.
  • Updates
    • The playground now uses the Gomplate package for its language tools and components.
  • Documentation
    • Updated package guidance with installation, playground usage, testing, and publishing information.

Claude-Session-Id: 01a23734-5f8c-71f1-8c77-9670bd54364d
@moshloop
moshloop enabled auto-merge (squash) December 2, 2026 17:05
@github-actions github-actions Bot added the build label Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Benchstat

Base: ed07f4438cb717a4511289446a695d6f499d420d
Head: 3e69ae8f5c811a60620ef65db86c1dd568ef8e19

5 minor regression(s) (all within 5% threshold)

Benchmark Metric Base Head Change p-value
CELProgramEvaluation/expression=comprehension/optimized=true-4 sec/op 4.42 us/op 4.52 us/op +2.33% 0.001
Serialize/items=100/native_values=true-4 sec/op 253 us/op 257 us/op +1.79% 0.003
Serialize/items=1000/native_values=true-4 sec/op 2.59 ms/op 2.62 ms/op +1.07% 0.023
CELProgramEvaluation/expression=comprehension/optimized=false-4 sec/op 4.61 us/op 4.65 us/op +1.00% 0.004
CELProgramEvaluation/expression=scalar/optimized=true-4 sec/op 138 ns/op 139 ns/op +0.51% 0.016
Full benchstat output
goos: linux
goarch: amd64
cpu: AMD EPYC 9V74 80-Core Processor                
                                                                         │ bench-base.txt │           bench-head.txt           │
                                                                         │     sec/op     │   sec/op     vs base               │
CELEnvExtendCustomFunction-4                                                  61.31µ ± 0%   61.20µ ± 0%       ~ (p=0.436 n=10)
CELProgramEvaluation/expression=scalar/optimized=false-4                      138.4n ± 0%   138.3n ± 1%       ~ (p=0.955 n=10)
CELProgramEvaluation/expression=scalar/optimized=true-4                       138.0n ± 0%   138.6n ± 4%  +0.51% (p=0.016 n=10)
CELProgramEvaluation/expression=list_optional_regex/optimized=false-4         3.601µ ± 1%   3.617µ ± 3%       ~ (p=0.617 n=10)
CELProgramEvaluation/expression=list_optional_regex/optimized=true-4          1.311µ ± 0%   1.315µ ± 1%       ~ (p=0.322 n=10)
CELProgramEvaluation/expression=comprehension/optimized=false-4               4.605µ ± 1%   4.651µ ± 1%  +1.00% (p=0.004 n=10)
CELProgramEvaluation/expression=comprehension/optimized=true-4                4.418µ ± 2%   4.521µ ± 1%  +2.33% (p=0.001 n=10)
RunExpressionNativeInput/input=map-4                                          2.269µ ± 3%   2.280µ ± 1%       ~ (p=0.446 n=10)
RunExpressionNativeInput/input=native_struct-4                                2.372µ ± 2%   2.389µ ± 2%       ~ (p=0.060 n=10)
RunExpressionContext/cache=hit/environment=small-4                            1.314µ ± 1%   1.317µ ± 0%       ~ (p=0.193 n=10)
RunExpressionContext/cache=hit/environment=large-4                            1.416µ ± 1%   1.423µ ± 0%       ~ (p=0.059 n=10)
RunExpressionContextCompile/cache=miss/environment=small-4                    245.3µ ± 1%   245.2µ ± 1%       ~ (p=0.481 n=10)
RunExpressionContextCompile/cache=miss/environment=large-4                    244.3µ ± 1%   244.9µ ± 2%       ~ (p=0.579 n=10)
CELEnvExtend/variables=1/functions=0-4                                        4.687µ ± 2%   4.716µ ± 1%       ~ (p=0.224 n=10)
CELEnvExtend/variables=10/functions=0-4                                       5.997µ ± 1%   6.034µ ± 2%       ~ (p=0.075 n=10)
CELEnvExtend/variables=100/functions=0-4                                      17.71µ ± 1%   17.71µ ± 1%       ~ (p=0.739 n=10)
RunExpressionContextFunctions/celFunctions/cache=hit/environment=large-4      3.130µ ± 1%   3.120µ ± 0%       ~ (p=0.197 n=10)
RunExpressionContextFunctions/functions/cache=hit/environment=large-4         3.132µ ± 1%   3.138µ ± 2%       ~ (p=0.343 n=10)
Serialize/items=10/native_values=true-4                                       29.48µ ± 1%   29.67µ ± 2%       ~ (p=0.063 n=10)
Serialize/items=100/native_values=true-4                                      252.7µ ± 1%   257.2µ ± 2%  +1.79% (p=0.003 n=10)
Serialize/items=1000/native_values=true-4                                     2.588m ± 1%   2.616m ± 1%  +1.07% (p=0.023 n=10)
Serialize/items=10000/native_values=true-4                                    28.02m ± 3%   28.42m ± 2%       ~ (p=0.063 n=10)
Serialize_NoNativeTypes/items=100/native_values=false-4                       107.8µ ± 0%   108.1µ ± 1%       ~ (p=0.218 n=10)
Serialize_NoNativeTypes/items=1000/native_values=false-4                      1.079m ± 1%   1.082m ± 2%       ~ (p=0.579 n=10)
Serialize_NoNativeTypes/items=10000/native_values=false-4                     11.00m ± 3%   11.18m ± 3%       ~ (p=0.123 n=10)
RunTemplate_LargeEnv/items=10-4                                               3.904µ ± 4%   3.896µ ± 1%       ~ (p=1.000 n=10)
RunTemplate_LargeEnv/items=1000-4                                             3.819µ ± 4%   3.838µ ± 3%       ~ (p=0.424 n=10)
RunTemplate_LargeEnv/items=10000-4                                            3.678µ ± 1%   3.680µ ± 4%       ~ (p=0.225 n=10)
geomean                                                                       16.51µ        16.60µ       +0.54%

                                                                         │ bench-base.txt │            bench-head.txt             │
                                                                         │      B/op      │     B/op      vs base                 │
CELEnvExtendCustomFunction-4                                                 46.32Ki ± 0%   46.32Ki ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=scalar/optimized=false-4                       96.00 ± 0%     96.00 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=scalar/optimized=true-4                        96.00 ± 0%     96.00 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=list_optional_regex/optimized=false-4        4.252Ki ± 0%   4.252Ki ± 0%       ~ (p=0.696 n=10)
CELProgramEvaluation/expression=list_optional_regex/optimized=true-4         1.150Ki ± 0%   1.150Ki ± 0%       ~ (p=1.000 n=10)
CELProgramEvaluation/expression=comprehension/optimized=false-4              3.063Ki ± 0%   3.063Ki ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=comprehension/optimized=true-4               2.798Ki ± 0%   2.798Ki ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionNativeInput/input=map-4                                         1.375Ki ± 0%   1.375Ki ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionNativeInput/input=native_struct-4                               1.250Ki ± 0%   1.250Ki ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContext/cache=hit/environment=small-4                             840.0 ± 0%     840.0 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContext/cache=hit/environment=large-4                             936.0 ± 0%     936.0 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContextCompile/cache=miss/environment=small-4                   216.0Ki ± 0%   216.0Ki ± 0%       ~ (p=0.447 n=10)
RunExpressionContextCompile/cache=miss/environment=large-4                   216.3Ki ± 0%   216.3Ki ± 0%       ~ (p=0.631 n=10)
CELEnvExtend/variables=1/functions=0-4                                       4.477Ki ± 0%   4.477Ki ± 0%       ~ (p=1.000 n=10) ¹
CELEnvExtend/variables=10/functions=0-4                                      6.157Ki ± 0%   6.157Ki ± 0%       ~ (p=1.000 n=10) ¹
CELEnvExtend/variables=100/functions=0-4                                     23.63Ki ± 0%   23.63Ki ± 0%       ~ (p=0.628 n=10)
RunExpressionContextFunctions/celFunctions/cache=hit/environment=large-4     2.297Ki ± 0%   2.297Ki ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContextFunctions/functions/cache=hit/environment=large-4        2.359Ki ± 0%   2.359Ki ± 0%       ~ (p=1.000 n=10) ¹
Serialize/items=10/native_values=true-4                                      34.39Ki ± 0%   34.39Ki ± 0%       ~ (p=1.000 n=10) ¹
Serialize/items=100/native_values=true-4                                     304.6Ki ± 0%   304.6Ki ± 0%       ~ (p=1.000 n=10) ¹
Serialize/items=1000/native_values=true-4                                    2.946Mi ± 0%   2.946Mi ± 0%       ~ (p=0.718 n=10)
Serialize/items=10000/native_values=true-4                                   29.45Mi ± 0%   29.45Mi ± 0%       ~ (p=0.889 n=10)
Serialize_NoNativeTypes/items=100/native_values=false-4                      104.0Ki ± 0%   104.0Ki ± 0%       ~ (p=1.000 n=10) ¹
Serialize_NoNativeTypes/items=1000/native_values=false-4                     1.007Mi ± 0%   1.007Mi ± 0%       ~ (p=0.370 n=10)
Serialize_NoNativeTypes/items=10000/native_values=false-4                    10.07Mi ± 0%   10.07Mi ± 0%       ~ (p=0.548 n=10)
RunTemplate_LargeEnv/items=10-4                                              5.274Ki ± 0%   5.274Ki ± 0%       ~ (p=1.000 n=10) ¹
RunTemplate_LargeEnv/items=1000-4                                            5.273Ki ± 0%   5.273Ki ± 0%       ~ (p=1.000 n=10) ¹
RunTemplate_LargeEnv/items=10000-4                                           5.273Ki ± 0%   5.273Ki ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                                      14.78Ki        14.78Ki       -0.00%
¹ all samples are equal

                                                                         │ bench-base.txt │            bench-head.txt            │
                                                                         │   allocs/op    │  allocs/op   vs base                 │
CELEnvExtendCustomFunction-4                                                   112.0 ± 0%    112.0 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=scalar/optimized=false-4                       3.000 ± 0%    3.000 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=scalar/optimized=true-4                        3.000 ± 0%    3.000 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=list_optional_regex/optimized=false-4          79.00 ± 0%    79.00 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=list_optional_regex/optimized=true-4           30.00 ± 0%    30.00 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=comprehension/optimized=false-4                91.00 ± 0%    91.00 ± 0%       ~ (p=1.000 n=10) ¹
CELProgramEvaluation/expression=comprehension/optimized=true-4                 87.00 ± 0%    87.00 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionNativeInput/input=map-4                                           36.00 ± 0%    36.00 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionNativeInput/input=native_struct-4                                 29.00 ± 0%    29.00 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContext/cache=hit/environment=small-4                             20.00 ± 0%    20.00 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContext/cache=hit/environment=large-4                             23.00 ± 0%    23.00 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContextCompile/cache=miss/environment=small-4                    2.293k ± 0%   2.293k ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContextCompile/cache=miss/environment=large-4                    2.298k ± 0%   2.298k ± 0%       ~ (p=1.000 n=10) ¹
CELEnvExtend/variables=1/functions=0-4                                         72.00 ± 0%    72.00 ± 0%       ~ (p=1.000 n=10) ¹
CELEnvExtend/variables=10/functions=0-4                                        91.00 ± 0%    91.00 ± 0%       ~ (p=1.000 n=10) ¹
CELEnvExtend/variables=100/functions=0-4                                       193.0 ± 0%    193.0 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContextFunctions/celFunctions/cache=hit/environment=large-4       44.00 ± 0%    44.00 ± 0%       ~ (p=1.000 n=10) ¹
RunExpressionContextFunctions/functions/cache=hit/environment=large-4          48.00 ± 0%    48.00 ± 0%       ~ (p=1.000 n=10) ¹
Serialize/items=10/native_values=true-4                                        424.0 ± 0%    424.0 ± 0%       ~ (p=1.000 n=10) ¹
Serialize/items=100/native_values=true-4                                      3.844k ± 0%   3.844k ± 0%       ~ (p=1.000 n=10) ¹
Serialize/items=1000/native_values=true-4                                     39.53k ± 0%   39.53k ± 0%       ~ (p=1.000 n=10) ¹
Serialize/items=10000/native_values=true-4                                    399.5k ± 0%   399.5k ± 0%       ~ (p=1.000 n=10) ¹
Serialize_NoNativeTypes/items=100/native_values=false-4                       1.721k ± 0%   1.721k ± 0%       ~ (p=1.000 n=10) ¹
Serialize_NoNativeTypes/items=1000/native_values=false-4                      17.77k ± 0%   17.77k ± 0%       ~ (p=1.000 n=10) ¹
Serialize_NoNativeTypes/items=10000/native_values=false-4                     179.8k ± 0%   179.8k ± 0%       ~ (p=1.000 n=10) ¹
RunTemplate_LargeEnv/items=10-4                                                39.00 ± 0%    39.00 ± 0%       ~ (p=1.000 n=10) ¹
RunTemplate_LargeEnv/items=1000-4                                              39.00 ± 0%    39.00 ± 0%       ~ (p=1.000 n=10) ¹
RunTemplate_LargeEnv/items=10000-4                                             39.00 ± 0%    39.00 ± 0%       ~ (p=1.000 n=10) ¹
geomean                                                                        228.2         228.2       +0.00%
¹ all samples are equal

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The language package is renamed to @flanksource/gomplate and gains playground component and stylesheet exports. The playground app now imports those package entry points. A manually triggered workflow builds, tests, packs, and publishes the package to npm.

Changes

Package and playground release

Layer / File(s) Summary
Package exports and build
web/packages/lang/package.json, web/packages/lang/tsconfig*.json, web/packages/lang/vite.config.ts, web/packages/lang/src/*, genmonarch/render.go
The package is renamed and adds playground and stylesheet exports. Build inputs and Vite entries include the playground. Relative imports use explicit .js extensions.
Playground components and types
web/packages/lang/playground/*
The package adds exported playground components and evaluation types. TokensPanel receives Monaco as a prop, and the package adds Tailwind styles.
Playground app integration
web/apps/playground/*, web/package.json, web/packages/lang/test/graphNodes.test.ts
The app and web scripts use @flanksource/gomplate and its playground entry points. The app imports the package stylesheet and passes Monaco to TokensPanel.
Package validation and publishing
web/packages/lang/test/package.test.ts, web/packages/lang/README.md, .github/workflows/npm-publish.yml
Package tests check root and playground exports and stylesheet contents. The README documents package usage and publishing. The new workflow checks, builds, tests, packs, and publishes the package.

Sequence Diagram(s)

sequenceDiagram
  participant Maintainer
  participant GitHubActions
  participant PackageScripts
  participant NpmRegistry
  Maintainer->>GitHubActions: Manually dispatch workflow on main
  GitHubActions->>PackageScripts: Run checks, build, and tests
  GitHubActions->>PackageScripts: Pack language package
  GitHubActions->>NpmRegistry: Publish tarball with public access
Loading

Possibly related PRs

Suggested reviewers: hairyhenderson

Change: Feature

Merge Risk: Low · up to 3e69a · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@moshloop
moshloop merged commit cf91117 into main Dec 2, 2026
12 of 13 checks passed
@moshloop
moshloop deleted the feat/npm-publishing branch December 2, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant