Skip to content

build: [SDK-4530] migrate web-shim-codegen and shims to Vite+ toolchain#135

Open
fadi-george wants to merge 13 commits into
mainfrom
fadi/sdk-4530
Open

build: [SDK-4530] migrate web-shim-codegen and shims to Vite+ toolchain#135
fadi-george wants to merge 13 commits into
mainfrom
fadi/sdk-4530

Conversation

@fadi-george
Copy link
Copy Markdown
Collaborator

@fadi-george fadi-george commented May 15, 2026

Description

Migrate the codegen pipeline and all generated shims (React, Vue 2, Vue 3, Angular/ngx) to the Vite+ (`vp`) toolchain, modernize tooling, and clean up legacy config.

Details

Codegen project (root)

  • Switched `main.ts` bundling from `tsc` to `vp pack` (CJS output to `ts-to-es6/main.cjs`); updated `codegenconfig.json` accordingly.
  • Fixed `scripts/build.sh` to use `vp`/`vpx` and removed extraneous `--` from the Angular build invocation.
  • Added `vite.config.ts` at repo root with shared `fmt`/`lint` config; added `scripts/copy-static` rewrite that uses bash `nullglob` and the correct rsync flags so it no longer errors on missing dotfiles or copies sibling shim dirs into each output.
  • `scripts/copy-build-to-outputs.sh`: added `--delete` and excluded `bun.lock`/`node_modules`/`dist` so stale files in `outputs/` are pruned automatically.
  • Hardened `src/support/utils.ts`: corrected regex escapes, removed implicit `any`, properly typed `parseFunctionSig` against `IFunctionSignature`, and added an ambient `curlrequest` declaration.
  • Fixed snippet path resolution in `*WriterManager` files (use `path.resolve(__dirname, '..', 'src', 'snippets', ...)`) so it survives `vp pack` bundling.
  • Added definite-assignment default branch in `CodeGenManager`; resolved floating promise in `main.ts`.

React shim (`src/static/react`)

  • `package.json`: scripts to `vp lint`/`vp test`/`vp pack`, removed legacy ESLint deps, added `vite-plus` devDep, `overrides` redirecting `vite` and `vitest` to `@voidzero-dev/vite-plus-core`/`@voidzero-dev/vite-plus-test`, `packageManager: bun@1.3.13`, bumped `engines.node` to `>=18`.
  • New `vite.config.ts` (consolidates Vitest + `pack`/`fmt`/`lint`/`staged` config); `tsconfig.json` switched to `moduleResolution: bundler`.
  • Removed `.eslintrc.cjs`, `rollup.config.js`, `vitest.config.ts`, `package-lock.json`, `.travis.yml`, `.github/workflows/asana-create-task.yml`.
  • Added `AGENTS.md`.
  • Example app: switched `start` to `vp dev`, added `prestart` running a new `scripts/setup.sh` that builds + packs the parent into a tarball and installs it as a file dep (avoids the `file:../` recursion problem).

Vue 2 / Vue 3 shims

  • Mirror of the React migration: `vp` scripts, `overrides`, `vite-plus`, `packageManager`, latest TypeScript, `vite.config.ts`, `tsconfig.json` cleanup, AGENTS.md.
  • Removed `.eslintrc.cjs`, `rollup.config.js`, `package-lock.json` from each.

Angular (`onesignal-ngx`)

  • Set `packageManager: bun@1.3.13` on both the source (`src/scaffolds/angular-workspace/projects/onesignal-ngx/package.json`) and the published `outputs/onesignal-ngx/package.json` (was `pnpm@11.1.2`).
  • Removed stray `pnpm-lock.yaml` files from `build/` and `outputs/`.
  • Library is still built with `ng-packagr` (Angular Package Format requires it); the `vp` migration here is workflow-level only.

Repo-wide cleanup

  • Removed redundant `.npmignore` (the per-shim `files` arrays are sufficient).
  • Removed legacy `asana-create-task` workflows and `claude.yml`.
  • Regenerated `outputs/` so they reflect the new sources.

Testing

  • `vp run build:outputs` succeeds end-to-end:
    • Lint clean across codegen sources (0 warnings, 0 errors)
    • `tsdown` bundle of `main.cjs` succeeds
    • Yellicode runs without errors
    • `ng build --configuration=production` produces FESM2015 + UMD + min UMD + metadata
    • Per-shim `vp install` post-build all exit 0
  • `outputs/onesignal-ngx/` package.json `main`/`module`/`fesm2015`/`typings`/`metadata` paths all resolve to existing files.

Affected code checklist

  • Build pipeline / scripts
  • React shim
  • Vue 2 shim
  • Vue 3 shim
  • Angular (`onesignal-ngx`) shim
  • Generated outputs

Checklist

  • Re-ran `scripts/build.sh` and `scripts/copy-build-to-outputs.sh`; outputs are up to date.
  • No new lint/type errors.

Made with Cursor

@fadi-george fadi-george requested a review from sherwinski May 15, 2026 00:20
fadi-george and others added 2 commits May 14, 2026 17:23
Use native fetch in remoteFetchFile (Node 18+) and remove the unused React
plugin dep.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant