Skip to content

Commit 93e732f

Browse files
committed
chore: add Windows to the unit tests CI
1 parent b3f03f9 commit 93e732f

File tree

6 files changed

+36
-13
lines changed

6 files changed

+36
-13
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,13 @@ jobs:
592592
test-unit:
593593
name: Unit Tests
594594
if: always() && needs.changes.outputs.build-unit == 'true'
595-
runs-on: ubuntu-latest
595+
strategy:
596+
matrix:
597+
settings:
598+
- host: ubuntu-latest
599+
- host: windows-latest
600+
601+
runs-on: ${{ matrix.settings.host }}
596602
needs:
597603
- changes
598604
- build-other-packages

packages/insights/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@types/density-clustering": "1.3.3",
2323
"@types/node": "24.0.4",
2424
"autoprefixer": "10.4.19",
25-
"better-sqlite3": "9.6.0",
25+
"better-sqlite3": "12.2.0",
2626
"eslint": "9.25.1",
2727
"eslint-plugin-qwik": "workspace:*",
2828
"globals": "16.0.0",

packages/qwik/src/optimizer/src/plugins/plugin.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,10 @@ export function createQwikPlugin(optimizerOptions: OptimizerOptions = {}) {
242242
// we only provide inputs if none were provided by the user
243243
if (opts.target === 'ssr') {
244244
// this is for dev mode, prod will have own setting
245-
opts.input = [path.resolve(srcDir, 'entry.ssr')];
245+
opts.input = [normalizePath(path.resolve(srcDir, 'entry.ssr'))];
246246
} else if (opts.target === 'client') {
247247
// not really an entry, just a starting point
248-
opts.input = [path.resolve(srcDir, 'root')];
248+
opts.input = [normalizePath(path.resolve(srcDir, 'root'))];
249249
} else {
250250
// others including lib should be ok already
251251
opts.input = undefined!;
@@ -390,6 +390,10 @@ export function createQwikPlugin(optimizerOptions: OptimizerOptions = {}) {
390390
if (opts.input && typeof opts.input === 'string') {
391391
opts.input = [opts.input];
392392
}
393+
// Normalize input paths to ensure consistent path separators across platforms
394+
if (opts.input && Array.isArray(opts.input)) {
395+
opts.input = opts.input.map((input) => normalizePath(input));
396+
}
393397
return out;
394398
};
395399

packages/qwik/src/optimizer/src/plugins/rollup.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ const getChunkFileName = (
170170
// The chunk name can often be a path. We sanitize it to use dashes instead of slashes, to keep the same folder structure as without debug:true.
171171
// Besides, Rollup doesn't accept absolute or relative paths as inputs for the [name] placeholder for the same reason.
172172
const relativePath = optimizer.sys.path.relative(optimizer.sys.cwd(), chunkInfo.name);
173-
const sanitized = relativePath
173+
// Normalize path separators to forward slashes before sanitizing
174+
const normalizedPath = relativePath.replace(/\\/g, '/');
175+
const sanitized = normalizedPath
174176
.replace(/^(\.\.\/)+/, '')
175177
.replace(/^\/+/, '')
176178
.replace(/\//g, '-');

packages/qwik/src/optimizer/src/plugins/vite.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,16 @@ export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {
183183
const opts = await qwikPlugin.normalizeOptions(pluginOpts);
184184
input ||= opts.input;
185185

186+
// Normalize input paths to ensure consistent path separators across platforms
187+
if (input && Array.isArray(input)) {
188+
input = input.map((inputPath) => {
189+
// Preserve relative path prefixes (./) while normalizing separators
190+
const isRelative = inputPath.startsWith('./');
191+
const normalized = qwikPlugin.normalizePath(inputPath);
192+
return isRelative && !normalized.startsWith('./') ? `./${normalized}` : normalized;
193+
});
194+
}
195+
186196
manifestInput = opts.manifestInput;
187197
srcDir = opts.srcDir;
188198
rootDir = opts.rootDir;

pnpm-lock.yaml

Lines changed: 9 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)