Skip to content

Modernize extension: npm workspaces, TypeScript 6, rollup, Jest, GitHub Actions#440

Open
jessehouwing wants to merge 1 commit intomainfrom
modernize-extension
Open

Modernize extension: npm workspaces, TypeScript 6, rollup, Jest, GitHub Actions#440
jessehouwing wants to merge 1 commit intomainfrom
modernize-extension

Conversation

@jessehouwing
Copy link
Copy Markdown
Owner

Motivation

The build system was outdated: tasks compiled to JS alongside node_modules/ (shipped in the VSIX), had no tests, and used Azure Pipelines for CI/release. This PR brings the repo up to the same modern stack used in @jessehouwing/azdo-marketplace.

What changed

Build toolchain

  • npm workspaces -- root workspace manages both vsts-msbuild-helper/v0 and v1 together; a single npm install at the root sets everything up
  • TypeScript 6 -- upgraded from TS 5.x; shared tsconfig.base.json at the root with task-specific tsconfig.json files extending it
  • rollup -- each task now bundles to dist/vsts-msbuild-helper.js (CJS, all dependencies inlined); the VSIX ships only the dist/ folder instead of a full node_modules/ tree

Source structure

  • Task source moved to src/vsts-msbuild-helper.ts with logic wrapped in an exported run() function and a require.main === module guard, making it fully unit-testable without running in an actual pipeline agent

Tests

  • 68 Jest unit tests added under src/__tests__/vsts-msbuild-helper.test.ts (shared pattern for both v0 and v1), covering all input groups: targets, output paths, MsBuild options, code analysis, layer validation, ASP.NET, and deploy

Extension manifest

  • vss-extension.json updated: files entries now point to dist/ folders; contributions split into explicit v0 and v1 entries
  • task.json execution targets updated to dist/vsts-msbuild-helper.js for Node16/20_1/24; v0 legacy Node/Node10 handlers replaced with the modern ones

CI/CD

  • Added .github/workflows/ci.yml -- build, lint, and test on every push/PR to main/develop
  • Added .github/workflows/release.yml -- manual workflow that builds, tests, packages the VSIX with tfx-cli, publishes to the marketplace via Azure OIDC, and creates a GitHub Release for public releases
  • Removed azure-pipelines.yml

Notes for reviewers

  • ts-jest 29.x does not officially declare support for TypeScript 6, so --legacy-peer-deps is required on install. This is the same approach used in the reference repo and is expected to be resolved once ts-jest 30 stabilises.
  • The @typescript-eslint warning about TS 6 not being officially supported is cosmetic and expected; lint still exits clean.
  • v0 and v1 share identical source -- the separate workspace entries exist to maintain independent task.json versioning and allow independent rollup bundles.

- Restructure to npm workspaces (v0 + v1 tasks)
- Add TypeScript 6 with tsconfig.base.json / tsconfig.jest.json
- Bundle each task to dist/ with rollup (CJS, no node_modules shipped)
- Move task source to src/ subdirectory, export run() for testability
- Add Jest 30 unit tests (68 tests) for full task input coverage
- Update vss-extension.json to reference dist/ instead of node_modules
- Update task.json execution targets to dist/vsts-msbuild-helper.js
- Add GitHub Actions CI workflow (build/test/lint)
- Add GitHub Actions release workflow (OIDC publish to marketplace)
- Remove old Azure Pipelines release workflow
- Update eslint.config.mjs for new source paths

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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