diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 50b97a5..55ecf16 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -5,11 +5,11 @@ module.exports = { parserOptions: { sourceType: 'module', ecmaVersion: 2020, - extraFileExtensions: ['.svelte'] + extraFileExtensions: ['.svelte'], }, env: { browser: true, es2017: true, - node: true - } + node: true, + }, }; diff --git a/.flox/env.json b/.flox/env.json index 691244c..5b1886f 100644 --- a/.flox/env.json +++ b/.flox/env.json @@ -1,4 +1,4 @@ { - "name": "pyros.sh", - "version": 1 -} \ No newline at end of file + "name": "pyros.sh", + "version": 1 +} diff --git a/.prettierrc b/.prettierrc index 9573023..106dacf 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,8 +1,17 @@ { - "useTabs": true, - "singleQuote": true, - "trailingComma": "none", - "printWidth": 100, - "plugins": ["prettier-plugin-svelte"], - "overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }] -} + "useTabs": true, + "singleQuote": true, + "trailingComma": "all", + "printWidth": 100, + "plugins": [ + "prettier-plugin-svelte" + ], + "overrides": [ + { + "files": "*.svelte", + "options": { + "parser": "svelte" + } + } + ] +} \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 05d1caa..91778ad 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,3 @@ { - "recommendations": [ - "svelte.svelte-vscode", - "antfu.unocss" - ] + "recommendations": ["svelte.svelte-vscode", "antfu.unocss"] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 3e6d379..293bdfc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "[html]": { - "editor.defaultFormatter": "vscode.html-language-features" - }, -} \ No newline at end of file + "[html]": { + "editor.defaultFormatter": "vscode.html-language-features" + } +} diff --git a/package.json b/package.json index 116965a..e6d2014 100644 --- a/package.json +++ b/package.json @@ -1,45 +1,45 @@ { - "name": "website", - "version": "0.0.1", - "private": true, - "type": "module", - "scripts": { - "dev": "vite dev", - "build": "vite build", - "preview": "vite preview", - "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json", - "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch", - "test": "npm run test:integration && npm run test:unit", - "lint": "prettier --check . && eslint .", - "format": "prettier --write .", - "test:integration": "playwright test", - "test:unit": "vitest" - }, - "devDependencies": { - "@iconify/svelte": "^4.0.2", - "@playwright/test": "^1.28.1", - "@poppanator/sveltekit-svg": "^4.2.1", - "@sveltejs/adapter-static": "^3.0.1", - "@sveltejs/enhanced-img": "^0.2.0", - "@sveltejs/kit": "2.5.1", - "@tailwindcss/typography": "^0.5.13", - "@types/eslint": "8.56.0", - "autoprefixer": "^10.4.19", - "eslint": "^8.56.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.36.0-next.4", - "mdsvex": "^0.11.0", - "postcss": "^8.4.38", - "prettier": "^3.1.1", - "prettier-plugin-svelte": "^3.1.2", - "remark-github": "^12.0.0", - "shiki": "^1.1.7", - "super-sitemap": "^0.14.14", - "svelte": "4.2.11", - "svelte-check": "^3.6.0", - "tailwindcss": "^3.4.3", - "typescript": "^5.0.0", - "vite": "^5.0.3", - "vitest": "^1.2.0" - } + "name": "website", + "version": "0.0.1", + "private": true, + "type": "module", + "scripts": { + "dev": "vite dev", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json", + "check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch", + "test": "npm run test:integration && npm run test:unit", + "lint": "prettier --check . && eslint .", + "format": "prettier --write .", + "test:integration": "playwright test", + "test:unit": "vitest" + }, + "devDependencies": { + "@iconify/svelte": "^4.0.2", + "@playwright/test": "^1.28.1", + "@poppanator/sveltekit-svg": "^4.2.1", + "@sveltejs/adapter-static": "^3.0.1", + "@sveltejs/enhanced-img": "^0.2.0", + "@sveltejs/kit": "2.5.1", + "@tailwindcss/typography": "^0.5.13", + "@types/eslint": "8.56.0", + "autoprefixer": "^10.4.19", + "eslint": "^8.56.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-svelte": "^2.36.0-next.4", + "mdsvex": "^0.11.0", + "postcss": "^8.4.38", + "prettier": "^3.1.1", + "prettier-plugin-svelte": "^3.1.2", + "remark-github": "^12.0.0", + "shiki": "^1.1.7", + "super-sitemap": "^0.14.14", + "svelte": "4.2.11", + "svelte-check": "^3.6.0", + "tailwindcss": "^3.4.3", + "typescript": "^5.0.0", + "vite": "^5.0.3", + "vitest": "^1.2.0" + } } diff --git a/playwright.config.js b/playwright.config.js index a43c8c0..4e1cfe9 100644 --- a/playwright.config.js +++ b/playwright.config.js @@ -2,10 +2,10 @@ const config = { webServer: { command: 'npm run build && npm run preview', - port: 4173 + port: 4173, }, testDir: 'tests', - testMatch: /(.+\.)?(test|spec)\.[jt]s/ + testMatch: /(.+\.)?(test|spec)\.[jt]s/, }; export default config; diff --git a/postcss.config.js b/postcss.config.js index 2e7af2b..7b75c83 100644 --- a/postcss.config.js +++ b/postcss.config.js @@ -1,6 +1,6 @@ export default { - plugins: { - tailwindcss: {}, - autoprefixer: {}, - }, -} + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/src/app.css b/src/app.css index bd6213e..b5c61c9 100644 --- a/src/app.css +++ b/src/app.css @@ -1,3 +1,3 @@ @tailwind base; @tailwind components; -@tailwind utilities; \ No newline at end of file +@tailwind utilities; diff --git a/src/app.d.ts b/src/app.d.ts index 40b6c6b..d5560c0 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -3,13 +3,13 @@ import '@poppanator/sveltekit-svg/dist/svg'; declare global { - namespace App { - // interface Error {} - // interface Locals {} - // interface PageData {} - // interface PageState {} - // interface Platform {} - } + namespace App { + // interface Error {} + // interface Locals {} + // interface PageData {} + // interface PageState {} + // interface Platform {} + } } -export { }; +export {}; diff --git a/src/app.html b/src/app.html index ddb8970..f2770ac 100644 --- a/src/app.html +++ b/src/app.html @@ -1,23 +1,23 @@ + + + - + + + + %sveltekit.head% + - gtag('config', 'G-L1TPX7RGP2'); - - - - - %sveltekit.head% - - - -
%sveltekit.body%
- - - \ No newline at end of file + +
%sveltekit.body%
+ + diff --git a/src/lib/assets/images/dark.png b/src/lib/assets/images/dark.png new file mode 100644 index 0000000..61be075 Binary files /dev/null and b/src/lib/assets/images/dark.png differ diff --git a/src/lib/assets/images/light.png b/src/lib/assets/images/light.png new file mode 100644 index 0000000..d7d2980 Binary files /dev/null and b/src/lib/assets/images/light.png differ diff --git a/src/lib/components/Footer.svelte b/src/lib/components/Footer.svelte index abe43ac..e4f31c4 100644 --- a/src/lib/components/Footer.svelte +++ b/src/lib/components/Footer.svelte @@ -1,5 +1,4 @@ @@ -9,10 +8,15 @@
- powered by - - - + Copyright © {new Date().getFullYear()} + + pyrossh + +
diff --git a/src/lib/components/Intro.svelte b/src/lib/components/Intro.svelte new file mode 100644 index 0000000..6fbd673 --- /dev/null +++ b/src/lib/components/Intro.svelte @@ -0,0 +1,8 @@ +

+ The only bible app you will ever need +

+
+ No ads, + No in-app purchases, + No distractions. +
diff --git a/src/lib/components/Slide.svelte b/src/lib/components/Slide.svelte index 347b9a3..4c8ddaa 100644 --- a/src/lib/components/Slide.svelte +++ b/src/lib/components/Slide.svelte @@ -1,7 +1,9 @@
@@ -10,8 +12,8 @@ diff --git a/src/lib/dateUtils.js b/src/lib/dateUtils.js index f3a3b32..8f83235 100644 --- a/src/lib/dateUtils.js +++ b/src/lib/dateUtils.js @@ -1,5 +1,5 @@ export const formatDate = (d) => - new Intl.DateTimeFormat('en-IN').format(new Date(d)).replaceAll('/', '-'); + new Intl.DateTimeFormat('en-IN').format(new Date(d)).replaceAll('/', '-'); export const formatDateLong = (d) => - new Intl.DateTimeFormat('en-IN', { dateStyle: 'long' }).format(new Date(d)); + new Intl.DateTimeFormat('en-IN', { dateStyle: 'long' }).format(new Date(d)); diff --git a/src/posts/gopibot-to-the-rescue.md b/src/posts/gopibot-to-the-rescue.md index 18e4449..11f10a6 100644 --- a/src/posts/gopibot-to-the-rescue.md +++ b/src/posts/gopibot-to-the-rescue.md @@ -42,7 +42,7 @@ const bot_token = process.env.SLACK_BOT_TOKEN; const rtm = new RtmClient(bot_token); const COMMANDS = { - web: 'ssh -i qa.pem user@url docker pull image-name && docker rm -f container-id && docker run -d image-name' + web: 'ssh -i qa.pem user@url docker pull image-name && docker rm -f container-id && docker run -d image-name', }; let deploymentInProgress = false; let counter = 0; @@ -56,7 +56,7 @@ rtm.on(RTM_EVENTS.MESSAGE, (event) => { ) { return rtm.sendMessage( 'Please dont change the message and expect me to correct your past mistakes', - event.channel + event.channel, ); } if (event.subtype) { @@ -69,7 +69,7 @@ rtm.on(RTM_EVENTS.MESSAGE, (event) => { counter = 0; return rtm.sendMessage( "Stop bugging me noob or I'll tell to raise you bugs", - event.channel + event.channel, ); } return rtm.sendMessage('I am already processing a deploy request please wait', event.channel); @@ -108,14 +108,14 @@ rtm.on(RTM_EVENTS.MESSAGE, (event) => { counter = 0; return rtm.sendMessage( "Stop bugging me noob or I'll tell <@U30TXGLS1|gopi> to raise you bugs", - event.channel + event.channel, ); } return rtm.sendMessage( `command '${event.text} ' not found.You need to specify one of these commands [${COMMANDS.map( - (v, k) => k + (v, k) => k, ).join(',')} ]`, - event.channel + event.channel, ); } } diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 5f074d0..b8a10b9 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -81,30 +81,13 @@

đź‘ľ A statically typed, functional programming language inspired by rust, koka.

WIP to support compilation to WASM.

- +

The only bible app you will ever need. No ads, No in-app purchases, No distractions.

-
diff --git a/src/routes/only-bible-app/+page.svelte b/src/routes/only-bible-app/+page.svelte new file mode 100644 index 0000000..d60ef60 --- /dev/null +++ b/src/routes/only-bible-app/+page.svelte @@ -0,0 +1,55 @@ + + + + Only Bible App + + + +
+
+
+ Only Bible App +
+
Only Bible App
+
+
+ +
+
+

Download it now.

+ +
+
+
+ +
+
+
diff --git a/src/routes/only-bible-app/privacy-policy/+page.svelte b/src/routes/only-bible-app/privacy-policy/+page.svelte new file mode 100644 index 0000000..88d4bc0 --- /dev/null +++ b/src/routes/only-bible-app/privacy-policy/+page.svelte @@ -0,0 +1,20 @@ + + Privacy Policy | Only Bible App + + +
+

Privacy Policy

+

+ Only Bible App does not collect any information about you or your usage of the app. It does not + send any information about you to anyone. It does not contain ads. It will never install + additional products on your device or change your device's configuration. No ads, No in-app + purchases, No distractions. +

+

Changes to this Privacy Policy

+ I may update our Privacy Policy from time to time. Thus, you are advised to review this page periodically + for any changes. I will notify you of any changes by posting the new Privacy Policy on this page. +

This policy is effective as of 2023-09-08

+

Contact Us

+ If you have any questions or suggestions for us you can contact us at + pyros2097@gmail.com +
diff --git a/src/routes/only-bible-app/terms-and-conditions/+page.svelte b/src/routes/only-bible-app/terms-and-conditions/+page.svelte new file mode 100644 index 0000000..a80a3b1 --- /dev/null +++ b/src/routes/only-bible-app/terms-and-conditions/+page.svelte @@ -0,0 +1,38 @@ + + Terms and Conditions | Only Bible App + + +
+

Terms and Conditions

+

+ By downloading or using the app, these terms will automatically apply to you – you should make + sure therefore that you read them carefully before using the app. You’re not allowed to copy or + modify the app, any part of the app, or our trademarks in any way. You’re not allowed to attempt + to extract the source code of the app, and you also shouldn’t try to translate the app into + other languages or make derivative versions. The app itself, and all the trademarks, copyright, + database rights, and other intellectual property rights related to it, still belong to us. +

+

+ We are committed to ensuring that the app is as useful and efficient as possible. For that + reason, we reserve the right to make changes to the app or to charge for its services, at any + time and for any reason. We will never charge you for the app or its services without making it + very clear to you exactly what you’re paying for. +

+

+ The Only Bible App app stores and processes personal data that you have provided to us, to + provide my Service. It’s your responsibility to keep your phone and access to the app secure. We + therefore recommend that you do not jailbreak or root your phone, which is the process of + removing software restrictions and limitations imposed by the official operating system of your + device. It could make your phone vulnerable to malware/viruses/malicious programs, compromise + your phone’s security features and it could mean that the Only Bible App app won’t work properly + or at all. +

+

Changes to this Terms and conditions

+ I may update our Terms and conditions from time to time. Thus, you are advised to review this page + periodically for any changes. I will notify you of any changes by posting the new Terms and conditions + on this page. +

This policy is effective as of 2023-09-08

+

Contact Us

+ If you have any questions or suggestions for us you can contact us at + pyros2097@gmail.com +
diff --git a/src/routes/posts/+page.js b/src/routes/posts/+page.js index 6affa89..0b9cd72 100644 --- a/src/routes/posts/+page.js +++ b/src/routes/posts/+page.js @@ -1,7 +1,7 @@ export const load = async ({ params }) => { - const paths = import.meta.glob('/src/posts/*.md', { eager: true }); - const posts = Object.keys(paths) - .map((key) => ({ ...paths[key].metadata, slug: key.split('/').at(-1).replace('.md', '') })) - .sort((first, second) => new Date(second.date).getTime() - new Date(first.date).getTime()); - return { posts }; + const paths = import.meta.glob('/src/posts/*.md', { eager: true }); + const posts = Object.keys(paths) + .map((key) => ({ ...paths[key].metadata, slug: key.split('/').at(-1).replace('.md', '') })) + .sort((first, second) => new Date(second.date).getTime() - new Date(first.date).getTime()); + return { posts }; }; diff --git a/src/routes/posts/[slug]/+page.js b/src/routes/posts/[slug]/+page.js index b3965ea..52738e9 100644 --- a/src/routes/posts/[slug]/+page.js +++ b/src/routes/posts/[slug]/+page.js @@ -1,13 +1,13 @@ import { error } from '@sveltejs/kit'; export async function load({ params }) { - try { - const post = await import(`../../../posts/${params.slug}.md`); - return { - content: post.default, - meta: post.metadata - }; - } catch (e) { - error(404, `Could not find ${params.slug}`); - } + try { + const post = await import(`../../../posts/${params.slug}.md`); + return { + content: post.default, + meta: post.metadata, + }; + } catch (e) { + error(404, `Could not find ${params.slug}`); + } } diff --git a/src/routes/sitemap.xml/+server.js b/src/routes/sitemap.xml/+server.js index fc0ff7a..eeb0173 100644 --- a/src/routes/sitemap.xml/+server.js +++ b/src/routes/sitemap.xml/+server.js @@ -3,13 +3,10 @@ import * as sitemap from 'super-sitemap'; export const prerender = true; export async function GET() { - return await sitemap.response({ - origin: 'https://pyrossh.dev', - paramValues: { - '/posts/[slug]': [ - 'eyecandy-golang-error-reporting', - 'gopibot-to-the-rescue', - ] - } - }); -}; \ No newline at end of file + return await sitemap.response({ + origin: 'https://pyrossh.dev', + paramValues: { + '/posts/[slug]': ['eyecandy-golang-error-reporting', 'gopibot-to-the-rescue'], + }, + }); +} diff --git a/svelte.config.js b/svelte.config.js index e401c19..1f23a52 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -6,38 +6,38 @@ import { getHighlighter } from 'shiki'; /** @type {import('mdsvex').MdsvexOptions} */ const mdsvexOptions = { - extensions: ['.md'], - remarkPlugins: [ - [ - github, - { - repository: 'https://github.com/pyrossh/pyros.sh' - } - ] - ], - highlight: { - highlighter: async (code, lang = 'text') => { - const highlighter = await getHighlighter({ - themes: ['dracula'], - langs: ['javascript', 'typescript', 'go'] - }); - await highlighter.loadLanguage('javascript', 'typescript', 'go'); - const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: 'dracula' })); - return `{@html \`${html}\` }`; - } - } + extensions: ['.md'], + remarkPlugins: [ + [ + github, + { + repository: 'https://github.com/pyrossh/pyros.sh', + }, + ], + ], + highlight: { + highlighter: async (code, lang = 'text') => { + const highlighter = await getHighlighter({ + themes: ['dracula'], + langs: ['javascript', 'typescript', 'go'], + }); + await highlighter.loadLanguage('javascript', 'typescript', 'go'); + const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: 'dracula' })); + return `{@html \`${html}\` }`; + }, + }, }; /** @type {import('@sveltejs/kit').Config} */ const config = { - extensions: ['.svelte', '.md'], - preprocess: [vitePreprocess(), mdsvex(mdsvexOptions)], - kit: { - adapter: adapter({ - strict: true, - fallback: '404.html' - }) - } + extensions: ['.svelte', '.md'], + preprocess: [vitePreprocess(), mdsvex(mdsvexOptions)], + kit: { + adapter: adapter({ + strict: true, + fallback: '404.html', + }), + }, }; export default config; diff --git a/tailwind.config.js b/tailwind.config.js index e82833d..02937d0 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,72 +1,67 @@ /** @type {import('tailwindcss').Config} */ export default { - content: [ - './src/**/*.{html,js,svelte,ts}', - ], - theme: { - fontFamily: { - sans: 'system-ui', - serif: 'system-ui', - mono: 'monospace', - logo: 'cursive' - }, - extend: { - typography: ({ theme }) => ({ - DEFAULT: { - css: { - maxWidth: "70rem", - h1: { - fontWeight: "500", - marginTop: "1rem", - }, - h2: { - color: theme('colors.black'), - }, - pre: { - padding: "16px", - borderRadius: "16px", - fontSize: "0.8rem", - fontFamily: "monospace", - }, - '--tw-prose-body': theme('colors.black'), - '--tw-prose-headings': theme('colors.gray[100]'), - '--tw-prose-lead': theme('colors.black'), - '--tw-prose-links': theme('colors.blue[900]'), - '--tw-prose-bold': theme('colors.black'), - '--tw-prose-counters': theme('colors.black'), - '--tw-prose-bullets': theme('colors.black'), - '--tw-prose-hr': theme('colors.black'), - '--tw-prose-quotes': theme('colors.black'), - '--tw-prose-quote-borders': theme('colors.black'), - '--tw-prose-captions': theme('colors.black'), - '--tw-prose-code': theme('colors.black'), - '--tw-prose-pre-code': theme('colors.black'), - '--tw-prose-pre-bg': theme('colors.black'), - '--tw-prose-th-borders': theme('colors.black'), - '--tw-prose-td-borders': theme('colors.black'), - '--tw-prose-invert-body': theme('colors.black'), - '--tw-prose-invert-headings': theme('colors.white'), - '--tw-prose-invert-lead': theme('colors.black'), - '--tw-prose-invert-links': theme('colors.blue[900]'), - '--tw-prose-invert-bold': theme('colors.white'), - '--tw-prose-invert-counters': theme('colors.black'), - '--tw-prose-invert-bullets': theme('colors.black'), - '--tw-prose-invert-hr': theme('colors.black'), - '--tw-prose-invert-quotes': theme('colors.black'), - '--tw-prose-invert-quote-borders': theme('colors.black'), - '--tw-prose-invert-captions': theme('colors.black'), - '--tw-prose-invert-code': theme('colors.white'), - '--tw-prose-invert-pre-code': theme('colors.black'), - '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', - '--tw-prose-invert-th-borders': theme('colors.black'), - '--tw-prose-invert-td-borders': theme('colors.black'), - }, - }, - }), - }, - }, - plugins: [ - require('@tailwindcss/typography'), - ], -} - + content: ['./src/**/*.{html,js,svelte,ts}'], + theme: { + fontFamily: { + sans: 'system-ui', + serif: 'system-ui', + mono: 'monospace', + logo: 'cursive', + }, + extend: { + typography: ({ theme }) => ({ + DEFAULT: { + css: { + maxWidth: '70rem', + h1: { + fontWeight: '500', + marginTop: '1rem', + }, + h2: { + color: theme('colors.black'), + }, + pre: { + padding: '16px', + borderRadius: '16px', + fontSize: '0.8rem', + fontFamily: 'monospace', + }, + '--tw-prose-body': theme('colors.black'), + '--tw-prose-headings': theme('colors.gray[100]'), + '--tw-prose-lead': theme('colors.black'), + '--tw-prose-links': theme('colors.blue[900]'), + '--tw-prose-bold': theme('colors.black'), + '--tw-prose-counters': theme('colors.black'), + '--tw-prose-bullets': theme('colors.black'), + '--tw-prose-hr': theme('colors.black'), + '--tw-prose-quotes': theme('colors.black'), + '--tw-prose-quote-borders': theme('colors.black'), + '--tw-prose-captions': theme('colors.black'), + '--tw-prose-code': theme('colors.black'), + '--tw-prose-pre-code': theme('colors.black'), + '--tw-prose-pre-bg': theme('colors.black'), + '--tw-prose-th-borders': theme('colors.black'), + '--tw-prose-td-borders': theme('colors.black'), + '--tw-prose-invert-body': theme('colors.black'), + '--tw-prose-invert-headings': theme('colors.white'), + '--tw-prose-invert-lead': theme('colors.black'), + '--tw-prose-invert-links': theme('colors.blue[900]'), + '--tw-prose-invert-bold': theme('colors.white'), + '--tw-prose-invert-counters': theme('colors.black'), + '--tw-prose-invert-bullets': theme('colors.black'), + '--tw-prose-invert-hr': theme('colors.black'), + '--tw-prose-invert-quotes': theme('colors.black'), + '--tw-prose-invert-quote-borders': theme('colors.black'), + '--tw-prose-invert-captions': theme('colors.black'), + '--tw-prose-invert-code': theme('colors.white'), + '--tw-prose-invert-pre-code': theme('colors.black'), + '--tw-prose-invert-pre-bg': 'rgb(0 0 0 / 50%)', + '--tw-prose-invert-th-borders': theme('colors.black'), + '--tw-prose-invert-td-borders': theme('colors.black'), + }, + }, + }), + }, + }, + plugins: [require('@tailwindcss/typography')], +}; diff --git a/tests/sitemap.test.js b/tests/sitemap.test.js index 7357501..7cb959d 100644 --- a/tests/sitemap.test.js +++ b/tests/sitemap.test.js @@ -1,27 +1,27 @@ import { expect, test } from '@playwright/test'; test('/sitemap.xml is valid', async ({ page }) => { - const response = await page.goto('/sitemap.xml'); - expect(response.status()).toBe(200); + const response = await page.goto('/sitemap.xml'); + expect(response.status()).toBe(200); - // Ensure XML is valid. Playwright parses the XML here and will error if it - // cannot be parsed. - const urls = await page.$$eval('url', (urls) => - urls.map((url) => ({ - loc: url.querySelector('loc').textContent, - // changefreq: url.querySelector('changefreq').textContent, // if you enabled in your sitemap - // priority: url.querySelector('priority').textContent, - })) - ); + // Ensure XML is valid. Playwright parses the XML here and will error if it + // cannot be parsed. + const urls = await page.$$eval('url', (urls) => + urls.map((url) => ({ + loc: url.querySelector('loc').textContent, + // changefreq: url.querySelector('changefreq').textContent, // if you enabled in your sitemap + // priority: url.querySelector('priority').textContent, + })), + ); - // Sanity check - expect(urls.length).toBeGreaterThanOrEqual(5); + // Sanity check + expect(urls.length).toBeGreaterThanOrEqual(5); - // Ensure entries are in a valid format. - for (const url of urls) { - expect(url.loc).toBeTruthy(); - expect(() => new URL(url.loc)).not.toThrow(); - // expect(url.changefreq).toBe('daily'); - // expect(url.priority).toBe('0.7'); - } -}); \ No newline at end of file + // Ensure entries are in a valid format. + for (const url of urls) { + expect(url.loc).toBeTruthy(); + expect(() => new URL(url.loc)).not.toThrow(); + // expect(url.changefreq).toBe('daily'); + // expect(url.priority).toBe('0.7'); + } +}); diff --git a/tests/test.js b/tests/test.js index 96d8945..b8b707b 100644 --- a/tests/test.js +++ b/tests/test.js @@ -1,6 +1,6 @@ import { expect, test } from '@playwright/test'; test('index page has expected h1', async ({ page }) => { - await page.goto('/'); - await expect(page.getByRole('heading', { name: 'pyrossh' })).toBeVisible(); + await page.goto('/'); + await expect(page.getByRole('heading', { name: 'pyrossh' })).toBeVisible(); }); diff --git a/vite.config.js b/vite.config.js index 687fc0f..4816ead 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,15 +1,11 @@ import { enhancedImages } from '@sveltejs/enhanced-img'; import { sveltekit } from '@sveltejs/kit/vite'; -import svg from '@poppanator/sveltekit-svg' +import svg from '@poppanator/sveltekit-svg'; import { defineConfig } from 'vitest/config'; export default defineConfig({ - plugins: [ - enhancedImages(), - sveltekit(), - svg(), - ], - test: { - include: ['src/**/*.{test,spec}.{js,ts}'] - } + plugins: [enhancedImages(), sveltekit(), svg()], + test: { + include: ['src/**/*.{test,spec}.{js,ts}'], + }, });