Skip to content

Commit

Permalink
refactor: comments and tests debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
thejackshelton committed Dec 3, 2024
1 parent 257b7d8 commit 746b59a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 21 deletions.
19 changes: 12 additions & 7 deletions libs/qwikdev-astro/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@ const FilterPatternSchema = z.union([
z.null()
]);

const qwikEntrypoints = new Set<string>();
const potentialEntries = new Set<string>();
let resolveEntrypoints: () => void;
const entrypointsReady = new Promise<void>((resolve) => {
resolveEntrypoints = resolve;
});

/**
* This project uses Astro Integration Kit.
* @see https://astro-integration-kit.netlify.app/
Expand Down Expand Up @@ -62,6 +55,14 @@ export default defineIntegration({
let serverDir = "";
let outDir = "";
let finalDir = "";

let resolveEntrypoints: () => void;
const entrypointsReady = new Promise<void>((resolve) => {
resolveEntrypoints = resolve;
});

const qwikEntrypoints = new Set<string>();
const potentialEntries = new Set<string>();
let astroConfig: AstroConfig | null = null;
const { resolve: resolver } = createResolver(import.meta.url);
const filter = createFilter(options?.include, options?.exclude);
Expand All @@ -86,6 +87,8 @@ export default defineIntegration({
clientDir = astroConfig.build.client.pathname;
serverDir = astroConfig.build.server.pathname;
outDir = astroConfig.outDir.pathname;

// check whether it has an adapter instead of output (e.g Node, Netlify, etc.)
finalDir = astroConfig.output === 'static' ? outDir : clientDir;

console.log("SRC DIR:", srcDir);
Expand Down Expand Up @@ -164,6 +167,8 @@ export default defineIntegration({
* @qwik.dev/core
* @qwik.dev/react
*/

// TODO: use parser here (vite gives it)
const qwikImportsRegex =
/@builder\.io\/qwik(-react)?|qwik\.dev\/(core|react)/;

Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion libs/qwikdev-astro/tests/e2e/fixtures/minimal/src/env.d.ts

This file was deleted.

24 changes: 15 additions & 9 deletions libs/qwikdev-astro/tests/e2e/functionality.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
// import { loadFixture } from "@inox-tools/astro-tests/astroFixture";
// import { expect, test } from "@playwright/test";

// function clearGlobalState() {
// (globalThis as any).qManifest = undefined;
// (globalThis as any).symbolMapperFn = undefined;
// }

// test.describe("Dev Mode", () => {
// let devServer: any;
// let fixture: any;

// test.beforeAll(async () => {
// console.log("BEFORE ALL!!!")

// clearGlobalState();

// fixture = await loadFixture({
// root: "../fixtures/minimal"
// root: "../fixtures/minimal",
// devToolbar: {
// enabled: false
// }
// });
// devServer = await fixture.startDevServer({});
// });
Expand Down Expand Up @@ -49,18 +61,12 @@
// test.beforeAll(async () => {
// fixture = await loadFixture({
// root: "../fixtures/minimal",
// output: "static",
// cacheDir: "./.cache",
// outDir: "./dist"
// });

// // Ensure sync before build
// await fixture.sync({});
// clearGlobalState();

// // Build with explicit configuration
// await fixture.build({
// mode: "production"
// });
// await fixture.build();

// preview = await fixture.preview({});
// });
Expand Down
2 changes: 1 addition & 1 deletion libs/qwikdev-astro/tests/fixtures/minimal/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from "astro/config";

import qwik from "../../../src/index";
import qwik from "@qwikdev/astro";

// https://astro.build/config
export default defineConfig({
Expand Down
3 changes: 2 additions & 1 deletion libs/qwikdev-astro/tests/fixtures/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"type": "module",
"version": "0.0.1",
"dependencies": {
"@qwikdev/astro": "workspace:*"
"@qwikdev/astro": "workspace:*",
"astro": "5.0.0-beta.12"
}
}
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default defineConfig({
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
workers: 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 746b59a

Please sign in to comment.