diff --git a/.github/workflows/delete_me b/.github/workflows/delete_me deleted file mode 100644 index 669043b6..00000000 --- a/.github/workflows/delete_me +++ /dev/null @@ -1,67 +0,0 @@ -name: "e2e tests" - -on: - deployment_status: - types: [success] - -jobs: - e2e: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: '18' - - - name: Install dependencies - run: npm install - - - name: Wait for deployment to be live - run: | - echo "Waiting for Vercel deployment to be live..." - until curl -sSf https://testing3.discours.io > /dev/null; do - printf '.' - sleep 10 - done - - - name: Install Playwright and dependencies - run: npm run e2e:install - - - name: Run Playwright tests - run: npm run e2e:tests:ci - env: - BASE_URL: https://testing3.discours.io - - -name: "deploy" - -on: [push] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - - - name: Install dependencies - run: npm i - - - name: Install CI checks - run: npm ci - - - name: Check types - run: npm run typecheck - - - name: Lint with Biome - run: npx @biomejs/biome check src/. - - - name: Lint styles - run: npx stylelint **/*.{scss,css} - - - name: Test production build - run: npm run build \ No newline at end of file diff --git a/app.config.ts b/app.config.ts index 8605b488..ef06d86d 100644 --- a/app.config.ts +++ b/app.config.ts @@ -1,19 +1,31 @@ import { SolidStartInlineConfig, defineConfig } from '@solidjs/start/config' +import { CSSOptions } from 'vite' // import { visualizer } from 'rollup-plugin-visualizer' import mkcert from 'vite-plugin-mkcert' -import { nodePolyfills } from 'vite-plugin-node-polyfills' +import { PolyfillOptions, nodePolyfills } from 'vite-plugin-node-polyfills' import sassDts from 'vite-plugin-sass-dts' const isVercel = Boolean(process?.env.VERCEL) const isBun = Boolean(process.env.BUN) -const isE2E = Boolean(process.env.E2E) + +const polyfillOptions = { + include: ['path', 'stream', 'util'], + exclude: ['http'], + globals: { + Buffer: true + }, + overrides: { + fs: 'memfs' + }, + protocolImports: true +} as PolyfillOptions export default defineConfig({ ssr: true, server: { preset: isVercel ? 'vercel_edge' : isBun ? 'bun' : 'node', port: 3000, - https: isE2E + https: isBun }, devOverlay: true, build: { @@ -24,17 +36,7 @@ export default defineConfig({ envPrefix: 'PUBLIC_', plugins: [ !isVercel && mkcert(), - nodePolyfills({ - include: ['path', 'stream', 'util'], - exclude: ['http'], - globals: { - Buffer: true - }, - overrides: { - fs: 'memfs' - }, - protocolImports: true - }), + nodePolyfills(polyfillOptions), sassDts() ], css: { @@ -43,17 +45,7 @@ export default defineConfig({ additionalData: '@import "src/styles/imports";\n', includePaths: ['./public', './src/styles'] } - } - }, - build: { - chunkSizeWarningLimit: 1024, - target: 'esnext', - rollupOptions: { - // plugins: [visualizer()] - } - }, - server: { - https: true + } as CSSOptions["preprocessorOptions"] } } } as SolidStartInlineConfig) diff --git a/package.json b/package.json index 6a4b9e49..a3cd93a3 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "discoursio-webapp", "private": true, "version": "0.9.5", - "contributors": [], "type": "module", "scripts": { "dev": "vinxi dev", @@ -122,8 +121,5 @@ "form-data": "^4.0.0", "idb": "^8.0.0", "mailgun.js": "^10.2.1" - }, - "engines": { - "node": "20.x" } } diff --git a/src/components/Nav/Header/Header.tsx b/src/components/Nav/Header/Header.tsx index aeda0fd1..5b65f7e1 100644 --- a/src/components/Nav/Header/Header.tsx +++ b/src/components/Nav/Header/Header.tsx @@ -1,12 +1,14 @@ import { A, redirect, useSearchParams } from '@solidjs/router' import { clsx } from 'clsx' import { For, Show, createEffect, createSignal, onCleanup, onMount } from 'solid-js' + +import type { Topic } from '~/graphql/schema/core.gen' +import { getRandomTopicsFromArray } from '~/lib/getRandomTopicsFromArray' + import { useLocalize } from '~/context/localize' import { useSession } from '~/context/session' import { useTopics } from '~/context/topics' import { useUI } from '~/context/ui' -import type { Topic } from '../../../graphql/schema/core.gen' -import { getRandomTopicsFromArray } from '../../../lib/getRandomTopicsFromArray' import { SharePopup, getShareUrl } from '../../Article/SharePopup' import { Icon } from '../../_shared/Icon' import { Newsletter } from '../../_shared/Newsletter' diff --git a/src/components/Nav/TopicsNav/TopicsNav.tsx b/src/components/Nav/TopicsNav/TopicsNav.tsx index 874e37c5..54c65c39 100644 --- a/src/components/Nav/TopicsNav/TopicsNav.tsx +++ b/src/components/Nav/TopicsNav/TopicsNav.tsx @@ -44,7 +44,7 @@ export const TopicsNav = () => { #{t('Poetry')}
  • - + {t('All topics')} diff --git a/src/context/topics.tsx b/src/context/topics.tsx index 6a39e44d..53297d61 100644 --- a/src/context/topics.tsx +++ b/src/context/topics.tsx @@ -31,7 +31,8 @@ const TopicsContext = createContext({ topTopics: () => [] as Topic[], setTopicsSort: (_s: string) => undefined, addTopics: (_ttt: Topic[]) => undefined, - loadTopics: async () => [] as Topic[] + loadTopics: async () => [] as Topic[], + randomTopic: () => undefined } as TopicsContextType) export function useTopics() { diff --git a/src/routes/[slug]/[...tab].tsx b/src/routes/[slug]/[...tab].tsx index 9a7d80a2..a79849f6 100644 --- a/src/routes/[slug]/[...tab].tsx +++ b/src/routes/[slug]/[...tab].tsx @@ -29,7 +29,7 @@ export const route: RouteDefinition = { type ArticlePageProps = { article?: Shout; comments?: Reaction[]; votes?: Reaction[]; author?: Author } -export const ArticlePage = (props: RouteSectionProps) => { +export function ArticlePage(props: RouteSectionProps) { const loc = useLocation() const { t } = useLocalize() const [scrollToComments, setScrollToComments] = createSignal(false)