Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:

e2e-test:
name: ${{ matrix.project.name }} E2E test
env:
# For packing manager install from github package registry
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: read
packages: read
Expand All @@ -50,6 +53,19 @@ jobs:
command: |
pnpm run --filter="@skeletonlabs/*" --filter="!*skeleton.dev" --sequential build
pnpm test
- name: rollipop
node-version: 22
skip-install: true
command: |
vite install --no-frozen-lockfile
vite run -r build
vite run lint
vite run -r typecheck
vite run format
vite run @rollipop/common#test
vite run @rollipop/core#test
vite run @rollipop/dev-server#test

steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ./.github/actions/clone
Expand Down Expand Up @@ -97,7 +113,12 @@ jobs:
- name: Install vite-plus from tgz in ${{ matrix.project.name }}
working-directory: ecosystem-ci/${{ matrix.project.name }}
run: |
# avoid the vite migration using the wrong ignore file
rm -f ../.gitignore
node ../patch-project.ts ${{ matrix.project.name }}
if [ -n "${{ matrix.project.skip-install }}" ]; then
exit 0
fi
pnpm install --no-frozen-lockfile
pnpm playwright install --with-deps

Expand Down
3 changes: 2 additions & 1 deletion ecosystem-ci/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
vibe-dashboard
skeleton
skeleton
rollipop
23 changes: 23 additions & 0 deletions ecosystem-ci/patch-project.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { execSync } from 'node:child_process';
import fs from 'node:fs';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
Expand Down Expand Up @@ -208,13 +209,35 @@ peerDependencyRules:
}
}

async function migrateProject(project: string) {
const repoRoot = join(projectDir, project);
// run vite migrate
execSync('vite migrate', {
cwd: repoRoot,
stdio: 'inherit',
env: {
...process.env,
VITE_PLUS_OVERRIDE_PACKAGES: JSON.stringify({
vite: `file:${tgzPath}/voidzero-dev-vite-plus-core-0.0.0.tgz`,
vitest: `file:${tgzPath}/voidzero-dev-vite-plus-test-0.0.0.tgz`,
'@voidzero-dev/vite-plus-core': `file:${tgzPath}/voidzero-dev-vite-plus-core-0.0.0.tgz`,
'@voidzero-dev/vite-plus-test': `file:${tgzPath}/voidzero-dev-vite-plus-test-0.0.0.tgz`,
}),
VITE_PLUS_VERSION: `file:${tgzPath}/voidzero-dev-vite-plus-0.0.0.tgz`,
},
});
}

switch (project) {
case 'vibe-dashboard':
await patchVibeDashboard();
break;
case 'skeleton':
await patchSkeleton();
break;
case 'rollipop':
await migrateProject(project);
break;
default:
console.error(`Project ${project} is not supported`);
process.exit(1);
Expand Down
5 changes: 5 additions & 0 deletions ecosystem-ci/repo.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@
"repository": "https://github.com/voidzero-dev/vibe-dashboard.git",
"branch": "main",
"hash": "30c68c9ad65c1315abf4c69366b21bc63b5d0fb4"
},
"rollipop": {
"repository": "https://github.com/leegeunhyeok/rollipop.git",
"branch": "main",
"hash": "9beb8dd8fb70ef298b3a18703a831d6d4d3c01a1"
}
}
5 changes: 4 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"types": "./dist/pluginutils/index.d.ts"
},
"./lib": {
"default": "./dist/tsdown/index.mjs",
"default": "./dist/tsdown/index.js",
"types": "./dist/tsdown/index-types.d.ts"
},
"./types/*": {
Expand Down Expand Up @@ -82,6 +82,9 @@
"dist"
],
"dependencies": {
"@babel/generator": "^7.28.5",
Comment thread
fengmk2 marked this conversation as resolved.
"@babel/parser": "^7.28.5",
"@babel/types": "^7.28.5",
"@oxc-project/runtime": "catalog:",
"lightningcss": "^1.30.2",
"postcss": "^8.5.6",
Expand Down
29 changes: 13 additions & 16 deletions packages/global/src/migration/migrator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@ import {
detectPackageMetadata,
VITE_PLUS_NAME,
VITE_PLUS_VERSION,
VITE_PLUS_OVERRIDE_PACKAGES,
} from '../utils/index.js';
import { detectConfigs, type ConfigFiles } from './detector.js';

const OVERRIDE_PACKAGES = {
vite: 'npm:@voidzero-dev/vite-plus-core@latest',
vitest: 'npm:@voidzero-dev/vite-plus-test@latest',
} as const;
// packages that are replaced with vite-plus
const REMOVE_PACKAGES = [
'oxlint',
Expand Down Expand Up @@ -102,24 +99,24 @@ export function rewriteStandaloneProject(projectPath: string, workspaceInfo: Wor
if (packageManager === PackageManager.yarn) {
pkg.resolutions = {
...pkg.resolutions,
...OVERRIDE_PACKAGES,
...VITE_PLUS_OVERRIDE_PACKAGES,
};
} else if (packageManager === PackageManager.npm) {
pkg.overrides = {
...pkg.overrides,
...OVERRIDE_PACKAGES,
...VITE_PLUS_OVERRIDE_PACKAGES,
};
} else if (packageManager === PackageManager.pnpm) {
pkg.pnpm = {
...pkg.pnpm,
overrides: {
...pkg.pnpm?.overrides,
...OVERRIDE_PACKAGES,
...VITE_PLUS_OVERRIDE_PACKAGES,
},
};
// remove packages from `resolutions` field if they exist
// https://pnpm.io/9.x/package_json#resolutions
for (const key of [...Object.keys(OVERRIDE_PACKAGES), ...REMOVE_PACKAGES]) {
for (const key of [...Object.keys(VITE_PLUS_OVERRIDE_PACKAGES), ...REMOVE_PACKAGES]) {
if (pkg.resolutions?.[key]) {
delete pkg.resolutions[key];
}
Expand Down Expand Up @@ -220,7 +217,7 @@ function rewritePnpmWorkspaceYaml(projectPath: string): void {
rewriteCatalog(doc);

// overrides
for (const key of Object.keys(OVERRIDE_PACKAGES)) {
for (const key of Object.keys(VITE_PLUS_OVERRIDE_PACKAGES)) {
doc.setIn(['overrides', scalarString(key)], scalarString('catalog:'));
}
// remove dependency selector from vite, e.g. "vite-plugin-svgr>vite": "npm:rolldown-vite@7.0.12"
Expand All @@ -240,7 +237,7 @@ function rewritePnpmWorkspaceYaml(projectPath: string): void {
allowAny = new YAMLSeq<Scalar<string>>();
}
const existing = new Set(allowAny.items.map((n) => n.value));
for (const key of Object.keys(OVERRIDE_PACKAGES)) {
for (const key of Object.keys(VITE_PLUS_OVERRIDE_PACKAGES)) {
if (!existing.has(key)) {
allowAny.add(scalarString(key));
}
Expand All @@ -255,7 +252,7 @@ function rewritePnpmWorkspaceYaml(projectPath: string): void {
if (!allowedVersions) {
allowedVersions = new YAMLMap<Scalar<string>, Scalar<string>>();
}
for (const key of Object.keys(OVERRIDE_PACKAGES)) {
for (const key of Object.keys(VITE_PLUS_OVERRIDE_PACKAGES)) {
// - vite: '*'
allowedVersions.set(scalarString(key), scalarString('*'));
}
Expand Down Expand Up @@ -325,7 +322,7 @@ function rewriteYarnrcYml(projectPath: string): void {
* @param doc - The document to rewrite
*/
function rewriteCatalog(doc: YamlDocument): void {
for (const [key, value] of Object.entries(OVERRIDE_PACKAGES)) {
for (const [key, value] of Object.entries(VITE_PLUS_OVERRIDE_PACKAGES)) {
doc.setIn(['catalog', key], scalarString(value));
}
doc.setIn(['catalog', VITE_PLUS_NAME], scalarString(VITE_PLUS_VERSION));
Expand Down Expand Up @@ -362,19 +359,19 @@ function rewriteRootWorkspacePackageJson(
...pkg.resolutions,
// FIXME: yarn don't support catalog on resolutions
// https://github.com/yarnpkg/berry/issues/6979
...OVERRIDE_PACKAGES,
...VITE_PLUS_OVERRIDE_PACKAGES,
};
} else if (packageManager === PackageManager.npm) {
pkg.overrides = {
...pkg.overrides,
...OVERRIDE_PACKAGES,
...VITE_PLUS_OVERRIDE_PACKAGES,
};
} else if (packageManager === PackageManager.pnpm) {
// pnpm use overrides field at pnpm-workspace.yaml
// so we don't need to set overrides field at package.json
// remove packages from `resolutions` field and `pnpm.overrides` field if they exist
// https://pnpm.io/9.x/package_json#resolutions
for (const key of [...Object.keys(OVERRIDE_PACKAGES), ...REMOVE_PACKAGES]) {
for (const key of [...Object.keys(VITE_PLUS_OVERRIDE_PACKAGES), ...REMOVE_PACKAGES]) {
if (pkg.pnpm?.overrides?.[key]) {
delete pkg.pnpm.overrides[key];
}
Expand Down Expand Up @@ -439,7 +436,7 @@ export function rewritePackageJson(
}
const supportCatalog = isMonorepo && packageManager !== PackageManager.npm;
let needVitePlus = false;
for (const [key, version] of Object.entries(OVERRIDE_PACKAGES)) {
for (const [key, version] of Object.entries(VITE_PLUS_OVERRIDE_PACKAGES)) {
const value = supportCatalog ? 'catalog:' : version;
if (pkg.devDependencies?.[key]) {
pkg.devDependencies[key] = value;
Expand Down
10 changes: 9 additions & 1 deletion packages/global/src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
export const VITE_PLUS_NAME = '@voidzero-dev/vite-plus';
export const VITE_PLUS_VERSION = 'latest';
export const VITE_PLUS_VERSION = process.env.VITE_PLUS_VERSION || 'latest';

export const VITE_PLUS_OVERRIDE_PACKAGES: Record<string, string> = process.env
.VITE_PLUS_OVERRIDE_PACKAGES
? JSON.parse(process.env.VITE_PLUS_OVERRIDE_PACKAGES)
: {
vite: 'npm:@voidzero-dev/vite-plus-core@latest',
vitest: 'npm:@voidzero-dev/vite-plus-test@latest',
};
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading