npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@globalpayments/vega-bootstrap

v0.2.4

Published

Vega-bootstrap is mainly for auto-generating simple app component with/without framework specification built with vega component

Downloads

1,127

Readme

Vega Bootstrap

Table of Contents

Introduction

demo gif

Vega Bootstrap is a code-generation tool that produces stand-alone, framework-specific Vega component modules from a single TypeScript input config. It eliminates the duplicate effort of writing the same component for VanillaJS, Angular, React, and Vue.

Modify the input config once → all four framework outputs are regenerated automatically.

Supported output frameworks:

| Framework | Output files | |-----------|-------------| | VanillaJS | <component>.html | | Angular | <component>.html + <component>.ts | | React | <component>.jsx | | Vue | <component>.vue |

Architecture

Two diagrams describe the system: the overall pipeline flow and the per-framework builder breakdown.

Pipeline

flowchart LR
    In(["&lt;component&gt;.input.ts"])

    subgraph Validate["① Validate"]
        V["State · undefined ref · duplicate def · reserved name\nAction · undefined ref · duplicate def · reserved name\nView · duplicate node ID"]
    end

    subgraph Preprocess["② Preprocess"]
        P["VanillaJS: auto node IDs · link view → state & action\nAll frameworks: AST prefill for state, action & declarations"]
    end

    subgraph BuildPhase["③ Build"]
        B["Import · View · State · Action · Other blocks\n↕ per framework — see builder matrix below"]
    end

    subgraph Assemble["④ Assemble"]
        A["Apply framework template → Prettier format"]
    end

    In ==> Validate ==> Preprocess ==> BuildPhase ==> Assemble
    Assemble --> o1["VanillaJS\ncomponent.html"]
    Assemble --> o2["Angular\ncomponent.html + component.ts"]
    Assemble --> o3["React\nComponent.jsx"]
    Assemble --> o4["Vue\nComponent.vue"]

Builder Matrix

Each build block has a framework-specific implementation. The table below maps block type → framework output.

block
  columns 5

  hd["Builder"]
  vjs["VanillaJS"]
  ng["Angular"]
  rx["React"]
  vue["Vue"]

  imp["Import\nBlock"]
  imp_v["static script\n& style tags"]
  imp_n["@angular/core\n+ auto-detected\nVega API imports"]
  imp_r["Vega component\nimports"]
  imp_u["Vega component\nimports"]

  viw["View\nBlock"]
  viw_v["HTML attributes\n(no state/action\nbinding)"]
  viw_n["[prop] state bind\n(event) action bind"]
  viw_r["JSX prop &\nevent binding"]
  viw_u[":prop bind\n@event bind"]

  sta["State\nBlock"]
  sta_v["State object\ngetter / setter\nDOM update on set"]
  sta_n["Class property\nwith TS type"]
  sta_r["state { }\nin constructor"]
  sta_u["data()\nreturn { }"]

  act["Action\nBlock"]
  act_v["Action object\n+ addEventListener"]
  act_n["Class methods"]
  act_r["Class methods"]
  act_u["methods: { }"]

  oth["Other\nBlock"]
  oth_v["Node Ref Block\nconst el =\ngetElementById()"]
  oth_n["Regex class fields\nngOnInit() setup"]
  oth_r["componentDidMount()\nsetup code"]
  oth_u["created()\nsetup code"]

  classDef fw fill:#1a5276,color:#fff,stroke:#154360;
  classDef kind fill:#1e8449,color:#fff,stroke:#196f3d;
  class vjs,ng,rx,vue fw
  class imp,viw,sta,act,oth kind
  style hd fill:#212121,color:#fff,stroke:#000;

Original draw.io source: docs/vega-bootstrap.drawio

Get started

Pre-requisite

yarn install

How to create the input

Define a TypeScript input config file under input/. This is the single source of truth — the generator reads it and produces all framework outputs:

// my-component.input.ts
import { ComponentInput } from 'src/types/component/component';

const MyComponentInput: ComponentInput = {
  name: 'MyComponent',
  view: {
    viewNodes: [
      // view nodes composing the component HTML structure
    ],
  },
  state: {
    stateNodes: [
      // state nodes managing component state
    ],
  },
  action: {
    actionNodes: [
      // action nodes handling user interactions
    ],
  },
};

Tip: Due to a known TypeScript limitation, nested object types in literals are not inferred automatically. Cast explicitly to get type hints:

{ type: 'vega-flex' } as ComponentViewNode

How to run it

Build a single component

yarn build \
  -c <input_config_path> \
  -vanilla <vanilla_js_output_path> \
  -angular <angular_output_path> \
  -react   <react_output_path> \
  -vue     <vue_output_path>

Example:

yarn build \
  -c ./input/simple-component.input.ts \
  -vanilla ./output/vanilla-js \
  -angular ./output/angular \
  -react   ./output/react \
  -vue     ./output/vue

Run yarn help to see all CLI options.

Build all components (recommended)

⚠️ Always use build-all:remote when preparing changes for CI.

  • build-all:local writes to ./output/ only — this output is not checked by CI.
  • build-all:remote writes directly into the playground apps (vega-playground/vega-*-hello-world/) which the Cypress integration and SRI tests validate.

Forgetting to run build-all:remote and commit the results will cause integration test failures in the pipeline even when the generator logic is correct.

# Local preview only (writes to ./output/)
yarn build-all:local

# Required before committing (writes to ../vega-playground/)
yarn build-all:remote

Watch mode

For iterative development on a single component, pass -w to auto-regenerate on file save:

yarn build \
  -c ./input/my-component.input.ts \
  -vanilla ./output/vanilla-js \
  -angular ./output/angular \
  -react   ./output/react \
  -vue     ./output/vue \
  -w

Note: watch mode only targets one component at a time. Always run build-all:remote for a final sync before committing.

Development workflow

  1. Edit the .input.ts file under input/.
  2. Iterate locally using watch mode (-w) or build-all:local to preview output under ./output/.
  3. Run pre-release checks to confirm the code is ready:
    yarn pre-release   # runs: jest + tsc --noEmit + eslint + prettier
  4. Sync to the playground so the CI integration tests have up-to-date files:
    yarn build-all:remote
  5. Commit everything together — generator source changes and all generated playground files in a single commit.

Adding new test cases

When you add a new input or change generator logic, unit test snapshots under tst/output/expected/ may need to be updated:

yarn rectify-test   # promotes tst/output/actual/ → tst/output/expected/

Review the diff carefully before committing to confirm the snapshot changes are intentional.

Symlink with existing app for testing

You can symlink ./output/ directly into a playground app to see live changes without running build-all:remote:

cd vega-playground/vega-angular-hello-world/src/app
ln -s ../../../../vega-bootstrap/output/angular/ESS ESS

Import the linked component in app.module.ts:

import { EssHomePage } from './ESS/ess-home-page';

@NgModule({
  declarations: [AppComponent, EssHomePage],
})
export class AppModule {}

Use it in a template:

<ess-home-page></ess-home-page>

Available scripts

| Script | Description | |--------|-------------| | yarn build | Generate output for a single component (see yarn help for CLI flags) | | yarn build-all:local | Generate all components → ./output/ (local preview only) | | yarn build-all:remote | Generate all components → ../vega-playground/ (required before committing) | | yarn test | Run Jest unit tests | | yarn rectify-test | Promote actual test output to expected snapshots | | yarn type-check | TypeScript type-check without emitting | | yarn linter | ESLint + Prettier check (--max-warnings 0) | | yarn pre-release | Full pre-release gate: test + type-check + linter |