Skip to content

Commit

Permalink
checkpoint to see if building works before handling more breaking cha…
Browse files Browse the repository at this point in the history
…nges
  • Loading branch information
wkelly17 committed May 1, 2024
1 parent d73747e commit 4c5d1e3
Show file tree
Hide file tree
Showing 25 changed files with 501 additions and 308 deletions.
2 changes: 1 addition & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import cloudflare from "@astrojs/cloudflare";
// https://astro.build/config
import solidJs from "@astrojs/solid-js";
// https://vite-pwa-org.netlify.app/frameworks/astro.html
import AstroPWA from "@vite-pwa/astro";
import AstroPWA from '@vite-pwa/astro'
import { manifest } from "./manifest";
import { visualizer } from "rollup-plugin-visualizer";
const siteUrl = import.meta.env.PROD
Expand Down
4 changes: 4 additions & 0 deletions functions/api/getHtmlForChap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ export const onRequestGet: PagesFunction = async (context) => {
try {
const baseUrl = env.PIPELINE_API_URL_BASE;
const finalUrl = `${baseUrl}/${user}/${repo}/${bookKey}/${chapter}.html`;
console.log(`fetching ${finalUrl}`);
const response = await fetch(finalUrl);
if (!response.ok) {
throw new Error(response.statusText);
}

const newResp = new Response(response.body, {
headers: getHeaders()
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@
"vitest": "vitest",
"vitest-ci": "vitest run",
"test-ct": "playwright test -c playwright-ct.config.ts",
"lint": "npx eslint ./"
"lint": "astro check & npx eslint ./"
},
"dependencies": {
"@astrojs/check": "^0.5.10",
"@astrojs/cloudflare": "9.1.0",
"@astrojs/solid-js": "4.0.1",
"@astrojs/solid-js": "4.1.0",
"@astrojs/tailwind": "^5.1.0",
"@kobalte/core": "^0.12.6",
"@kobalte/core": "^0.13.0",
"@solid-primitives/i18n": "^2.1.1",
"astro": "^4.7.0",
"fflate": "^0.8.2",
Expand All @@ -47,18 +48,18 @@
"@types/workbox-sw": "^4.3.7",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"@vite-pwa/astro": "^0.3.1",
"@vite-pwa/astro": "^0.4.0",
"eslint": "^8.57.0",
"eslint-plugin-astro": "^0.31.4",
"eslint-plugin-astro": "^1.1.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-solid": "^0.13.2",
"eslint-plugin-solid": "^0.14.0",
"prettier": "3.2.5",
"prettier-plugin-astro": "^0.13.0",
"prettier-plugin-tailwindcss": "^0.5.14",
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "^5.4.5",
"vite": "^5.2.10",
"vite-plugin-pwa": "^0.19.8",
"vite-plugin-pwa": "^0.20.0",
"workbox-cacheable-response": "^7.1.0",
"workbox-core": "^7.1.0",
"workbox-expiration": "^7.1.0",
Expand Down
15 changes: 7 additions & 8 deletions playwright-ct.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import type { PlaywrightTestConfig } from "@playwright/experimental-ct-solid";
import { defineConfig } from "@playwright/experimental-ct-solid";
import { devices } from "@playwright/experimental-ct-solid";

const env = process.env as Record<string, string>;
/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
export default defineConfig({
testDir: "./tests",
testIgnore: ["unit/**", "e2e/**"] /* ONLY RUN COMPONENT TESTS */,

Expand All @@ -15,11 +16,11 @@ const config: PlaywrightTestConfig = {
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
forbidOnly: !!env.CI,
/* Retry on CI only */
retries: process.env.CI ? 2 : 0,
retries: env.CI ? 2 : 0,
/* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined,
workers: env.CI ? 1 : undefined,
/* 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 Expand Up @@ -56,6 +57,4 @@ const config: PlaywrightTestConfig = {
}
}
]
};

export default config;
});
Loading

0 comments on commit 4c5d1e3

Please sign in to comment.