Skip to content

feat(build): migrate project to Vite+ and TypeScript#152

Merged
jenssimon merged 1 commit into
mainfrom
feat/viteplus-migration
Apr 28, 2026
Merged

feat(build): migrate project to Vite+ and TypeScript#152
jenssimon merged 1 commit into
mainfrom
feat/viteplus-migration

Conversation

@jenssimon

Copy link
Copy Markdown
Owner

This pull request migrates the project from Yarn and legacy configuration to the Vite+ unified toolchain and streamlines the development workflow. It removes Yarn-specific files and configurations, replaces CI and pre-commit hooks with Vite+ equivalents, updates documentation, and modernizes project settings for improved consistency and maintainability.

Toolchain migration and configuration:

  • Removed Yarn-specific files and settings, including .yarnrc.yml, .yarn/releases, .yarn/plugins, and replaced package manager commands with Vite+ commands throughout the project. (.yarnrc.yml, .gitattributes, .husky/pre-commit, .husky/commit-msg, lint-staged.config.mjs, eslint.config.mjs, [1] [2] [3] [4] [5] [6]
  • Added .vite-hooks/pre-commit to run vp staged for pre-commit linting and formatting.
  • Updated VSCode recommendations and settings to suggest the Vite+ extension pack and configure formatting and linting tools accordingly. (.vscode/extensions.json, .vscode/settings.json, .vscode/extensions.yml, .vscode/settings.yml, [1] [2] [3] [4]

Continuous Integration (CI) updates:

  • Replaced the CI workflow to use voidzero-dev/setup-vp and Vite+ commands (vp check, vp test, vp pack, vp exec semantic-release) instead of Node.js and Yarn, simplifying setup and caching. (.github/workflows/ci.yml, [1] [2]
  • Removed legacy workflows for commit linting and CodeQL analysis. (.github/workflows/commitlint.yml, .github/workflows/codeql-analysis.yml, [1] [2]

Documentation and onboarding:

  • Added AGENTS.md with a comprehensive guide to using Vite+, common pitfalls, and CI integration instructions.
  • Updated README.md to reflect the migration to pnpm and Vite+ (e.g., install instructions, formatting, and removal of Coveralls badge). [1] [2] [3] [4]

Codebase cleanup:

  • Removed unused or obsolete configuration files and code, including the main plugin implementation (lib/index.js) and commitlint/eslint/lint-staged configs, to reflect the new toolchain. [1] [2] [3] [4]

These changes collectively modernize the project setup, streamline developer experience, and ensure consistency with the Vite+ toolchain.

Copilot AI review requested due to automatic review settings April 28, 2026 20:02
@jenssimon
jenssimon merged commit 4d6b888 into main Apr 28, 2026
4 checks passed
@jenssimon
jenssimon deleted the feat/viteplus-migration branch April 28, 2026 20:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Migrates this Babel plugin repo from a Yarn/legacy setup to a Vite+ + TypeScript-based toolchain, updating build/test/CI/hooks and modernizing config and docs to match the new workflow.

Changes:

  • Replace the CommonJS lib/ implementation with a TypeScript source implementation in src/ and update packaging metadata to publish dist/ outputs.
  • Switch local tooling and CI to Vite+ (vp) commands, removing Husky/lint-staged/ESLint/commitlint workflows/configs.
  • Update tests and documentation to run under the new toolchain and module system.

Reviewed changes

Copilot reviewed 45 out of 52 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
vite.config.ts Adds Vite+ configuration for pack/lint/fmt/staged.
tsconfig.json Introduces TypeScript compiler configuration for the migration.
test/plugin.test.js Migrates tests to Vite+ test runner and registers the plugin via @babel/register.
test/cartridges/package.json Sets test cartridges to CommonJS module mode.
test/cartridges/app_storefront_base/cartridge/scripts/world.js Formatting-only string quote update.
test/cartridges/app_storefront_base/cartridge/scripts/things.js Formatting-only string quote update.
test/cartridges/app_storefront_base/cartridge/scripts/pet.js Formatting-only string quote update.
test/cartridges/app_storefront_base/cartridge/scripts/monde.js Formatting-only string quote update.
test/cartridges/app_storefront_base/cartridge/scripts/hallo.js Formatting-only string quote update.
test/cartridges/app_storefront_base/.tern-project Removes obsolete Tern config from fixtures.
test/cartridges/app_core/cartridge/scripts/things.js Formatting-only string quote update.
test/cartridges/app_core/cartridge/scripts/petstore.js Formatting-only string quote update.
test/cartridges/app_core/cartridge/scripts/pet.js Formatting-only string quote update.
test/cartridges/app_core/cartridge/scripts/monde.js Formatting-only string quote update.
test/cartridges/app_core/cartridge/scripts/hello.js Formatting-only string quote update.
test/cartridges/app_core/cartridge/scripts/hallo.js Formatting-only string quote update.
test/cartridges/app_core/cartridge/scripts/bonjour.js Formatting-only string quote update.
test/cartridges/app_core/.tern-project Removes obsolete Tern config from fixtures.
test/cartridges/app_brand/cartridge/scripts/welt.js Formatting-only string quote update.
test/cartridges/app_brand/cartridge/scripts/things.js Formatting-only string quote update.
test/cartridges/app_brand/cartridge/scripts/pet.js Formatting-only string quote update.
test/cartridges/app_brand/cartridge/scripts/hallo.js Formatting-only string quote update.
test/cartridges/app_brand/.tern-project Removes obsolete Tern config from fixtures.
test/cartridges/.eslintrc Removes fixture-specific ESLint config.
test/.babelrc Removes old test Babel config (now set up in test file).
src/index.ts New TypeScript plugin implementation replacing lib/index.js.
src/imports-visitor.d.ts Adds a local module declaration for imports-visitor.
renovate.json Normalizes formatting of Renovate config.
package.json Switches to ESM package layout, dist/ outputs, Vite+/pnpm toolchain scripts.
lint-staged.config.mjs Removes lint-staged config (replaced by Vite+ staged).
lib/index.js Removes legacy CommonJS implementation.
eslint.config.mjs Removes legacy ESLint configuration (linting now via Vite+).
commitlint.config.mjs Removes commitlint config.
README.md Updates install instructions and examples; removes coverage badge.
AGENTS.md Adds onboarding/usage notes for Vite+ and CI guidance.
.yarnrc.yml Removes Yarn configuration.
.vscode/settings.yml Removes legacy VSCode settings file.
.vscode/settings.json Adds new VSCode settings aligned with Oxc/Vite+.
.vscode/extensions.yml Removes legacy extension recommendations file.
.vscode/extensions.json Recommends the Vite+ extension pack.
.vite-hooks/pre-commit Adds Vite+ pre-commit hook invoking vp staged.
.node-version Adds Node version file for toolchain/CI.
.husky/pre-commit Removes Husky pre-commit hook.
.husky/commit-msg Removes Husky commit-msg hook.
.gitignore Adds dist/ to ignores and removes Yarn-specific ignores.
.github/workflows/commitlint.yml Removes commitlint workflow.
.github/workflows/codeql-analysis.yml Removes CodeQL workflow.
.github/workflows/ci.yml Updates CI to use voidzero-dev/setup-vp and vp commands.
.gitattributes Removes Yarn binary attributes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.ts

const getModulePath = (moduleName: string, basePath: string, cartridge: string, target: string) => {
const relativePath = path.relative(path.dirname(moduleName), `${basePath}/${cartridge}${target}`)
return (relativePath.includes(".") ? "" : "./") + relativePath
Comment thread src/index.ts
// eslint-disable-next-line no-restricted-syntax
for (const imp of imports) {
/**
* Finds and sets the rewrittten module path.
Comment thread src/index.ts
// all cartridges after the found cartridges in cartridge path
const newCartridgePath = cartridgePath.slice(cartridgePath.indexOf(cartridge) + 1)

// Find the the cartridge which contains the next match for the module path
Comment thread package.json
Comment on lines +28 to +36
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
}
},
Comment thread package.json
Comment on lines +57 to +69
"vite-plus": "latest"
},
"release": {
"branches": [
"main"
]
},
"packageManager": "pnpm@10.33.1",
"pnpm": {
"overrides": {
"vite": "npm:@voidzero-dev/vite-plus-core@latest",
"vitest": "npm:@voidzero-dev/vite-plus-test@latest"
}
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.

2 participants