Skip to content

Commit

Permalink
Wk update deps (#20)
Browse files Browse the repository at this point in the history
* non breaking deps updated and tests updated from some previous failures

* checkpoint to see if building works before handling more breaking changes

* see if builds in prod

* updating deps

* updating deps stil & adjusting sw

* updating deps stil & adjusting sw

* add suspense that was causing some jarring save offline behaviors
  • Loading branch information
wkelly17 authored Jun 13, 2024
1 parent 135f7e7 commit f72e37e
Show file tree
Hide file tree
Showing 41 changed files with 14,647 additions and 23,980 deletions.
5 changes: 5 additions & 0 deletions .astro/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"_variables": {
"lastUpdateCheck": 1718299609103
}
}
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ File/Folder tree below:

Example links:

- Bible = http://localhost:3000/WycliffeAssociates/en_ulb
- TN = http://localhost:3000/WycliffeAssociates/en_tn
- TQ = http://localhost:3000/WycliffeAssociates/en_tq
- BC = http://localhost:3000/WycliffeAssociates/en_bc
- TW = http://localhost:3000/WycliffeAssociates/en_tw
- TM = http://localhost:3000/WycliffeAssociates/en_tm
- Bible = http://localhost:4321/WycliffeAssociates/en_ulb
- TN = http://localhost:4321/WycliffeAssociates/en_tn
- TQ = http://localhost:4321/WycliffeAssociates/en_tq
- BC = http://localhost:4321/WycliffeAssociates/en_bc
- TW = http://localhost:4321/WycliffeAssociates/en_tw
- TM = http://localhost:4321/WycliffeAssociates/en_tm

## Folders

Expand Down
30 changes: 22 additions & 8 deletions astro.config.mjs → astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@ const siteUrl = import.meta.env.PROD
: import.meta.env.DEV
? "https://read-dev.bibleineverylanguage.org"
: "";
const isDev = import.meta.env.DEV;

// https://astro.build/config
export default defineConfig({
site: siteUrl,
output: "server",
adapter: cloudflare({
mode: "directory"
platformProxy: {
enabled: true,
configPath: ".dev.vars"
}
}),
integrations: [
tailwind(),
Expand All @@ -35,13 +40,7 @@ export default defineConfig({
registerType: "autoUpdate",
manifest: manifest,
injectManifest: {
globIgnores: [
"**/node_modules/**/*",
// Somehow or another, Vite PWA was trying to cache server build things, which resulted in a bad precaching response, which broke the build
// WK Friday January 27, 2023 05:00PM
"$server_build/*",
"$server_build/**/*"
]
globIgnores: ["**/_worker.js/**"]
},
devOptions: {
enabled: true,
Expand All @@ -51,8 +50,23 @@ export default defineConfig({
})
],
vite: {
// https://discord.com/channels/830184174198718474/1239920931510554655/1249724228794585178
/*
For anyone that might land here in the future, due to the hydration being broken in Solid it creates an unfortunate situation with an easy workaround, at least until it gets fixed in core:
In local development everytinhg will work fine by default but it won't build with the problem I described in the post, by applying a manual resolver to vite it will break the development server but the production build will work just fine, so in order to have both, in your astro.config.mjs:
last checked: June 13, 2024
*/
resolve: {
conditions: !isDev ? ["worker", "webworker"] : [],
mainFields: !isDev ? ["module"] : []
},
plugins: [
// @ts-expect-error Not sure why error, but works for when you want tto look at bundle a little closer
visualizer({
brotliSize: true,
template: "treemap",
// open: true,
// goal: ~100kib of HTML/CSS/Fonts (e.g. check network tab for amount loaded), and then ~300-350kib JS gzipped: see readme for link to article
gzipSize: true
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changes

## May 20, 2024
- Maintenance upgrade deps.
- Migrate from cloudflare functions to astro endpoints acc. to this set of breaking changes in the cloudflare adapter. https://github.com/withastro/adapters/blob/main/packages/cloudflare/CHANGELOG.md#1000
124 changes: 0 additions & 124 deletions functions/shared.ts

This file was deleted.

68 changes: 35 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
"type": "module",
"version": "0.0.1",
"private": true,
"engines": {
"node": ">=18.0.0 <22.0.0"
},
"packageManager": "pnpm@9.3.0",
"pnpm": {
"updateConfig": {
"ignoreDependencies": [
Expand All @@ -24,50 +22,54 @@
"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/cloudflare": "9.1.0",
"@astrojs/solid-js": "4.0.1",
"@astrojs/check": "^0.7.0",
"@astrojs/cloudflare": "10.4.0",
"@astrojs/solid-js": "4.3.0",
"@astrojs/tailwind": "^5.1.0",
"@kobalte/core": "^0.12.4",
"@kobalte/core": "^0.13.3",
"@solid-primitives/i18n": "^2.1.1",
"astro": "^4.5.3",
"astro": "^4.10.2",
"fflate": "^0.8.2",
"idb-keyval": "^6.2.1",
"logrocket": "^8.1.0",
"p-limit": "^5.0.0",
"solid-js": "^1.8.15",
"tailwindcss": "^3.4.1",
"vitest": "^1.3.1"
"tailwindcss": "^3.4.4",
"vitest": "^1.6.0"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20240312.0",
"@playwright/experimental-ct-solid": "^1.42.1",
"@playwright/test": "^1.42.1",
"@cloudflare/workers-types": "^4.20240605.0",
"@playwright/experimental-ct-solid": "^1.44.1",
"@playwright/test": "^1.44.1",
"@types/workbox-sw": "^4.3.7",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vite-pwa/astro": "^0.3.0",
"@typescript-eslint/eslint-plugin": "^7.13.0",
"@typescript-eslint/parser": "^7.13.0",
"@vite-pwa/astro": "^0.4.0",
"eslint": "^8.57.0",
"eslint-plugin-astro": "^0.31.4",
"eslint-plugin-astro": "^1.2.2",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-solid": "^0.13.1",
"prettier": "3.2.5",
"prettier-plugin-astro": "^0.13.0",
"prettier-plugin-tailwindcss": "^0.5.12",
"eslint-plugin-solid": "^0.14.0",
"htmlrewriter": "^0.0.7",
"prettier": "3.3.2",
"prettier-plugin-astro": "^0.14.0",
"prettier-plugin-tailwindcss": "^0.6.4",
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "^5.4.2",
"vite": "^5.1.6",
"vite-plugin-pwa": "^0.19.3",
"workbox-cacheable-response": "^7.0.0",
"workbox-core": "^7.0.0",
"workbox-expiration": "^7.0.0",
"workbox-precaching": "^7.0.0",
"workbox-recipes": "^7.0.0",
"workbox-routing": "^7.0.0",
"workbox-strategies": "^7.0.0",
"workbox-window": "^7.0.0",
"wrangler": "^3.34.1"
"typescript": "^5.4.5",
"vite": "^5.3.0",
"vite-plugin-pwa": "^0.20.0",
"vitest": "^1.5.3",
"workbox-cacheable-response": "^7.1.0",
"workbox-core": "^7.1.0",
"workbox-expiration": "^7.1.0",
"workbox-precaching": "^7.1.0",
"workbox-recipes": "^7.1.0",
"workbox-routing": "^7.1.0",
"workbox-strategies": "^7.1.0",
"workbox-window": "^7.1.0",
"wrangler": "^3.60.2"
},
"resolutions": {
"intl-messageformat": "10.5.4"
Expand Down
20 changes: 11 additions & 9 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 All @@ -29,8 +30,11 @@ const config: PlaywrightTestConfig = {
/* Port to use for Playwright component endpoint. */
ctPort: 3100,
ctViteConfig: {
root: ".",
resolve: {
alias: {}
alias: {
// src: path.resolve("src")
}
}
}
},
Expand All @@ -56,6 +60,4 @@ const config: PlaywrightTestConfig = {
}
}
]
};

export default config;
});
Loading

0 comments on commit f72e37e

Please sign in to comment.