Skip to content

Commit

Permalink
refactor: ♻️ move to pnpm workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
spences10 committed Jan 5, 2024
1 parent 85e530c commit 0d3637c
Show file tree
Hide file tree
Showing 82 changed files with 2,301 additions and 1,671 deletions.
24 changes: 0 additions & 24 deletions .eslintrc.cjs

This file was deleted.

14 changes: 0 additions & 14 deletions .prettierrc

This file was deleted.

File renamed without changes.
31 changes: 31 additions & 0 deletions apps/web/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/** @type { import("eslint").Linter.Config } */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier',
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte'],
},
env: {
browser: true,
es2017: true,
node: true,
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
},
],
};
11 changes: 11 additions & 0 deletions apps/web/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
.vercel
File renamed without changes.
4 changes: 4 additions & 0 deletions apps/web/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock
20 changes: 20 additions & 0 deletions apps/web/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "all",
"printWidth": 70,
"arrowParens": "avoid",
"proseWrap": "always",
"plugins": [
"prettier-plugin-svelte",
"prettier-plugin-tailwindcss"
],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}
44 changes: 44 additions & 0 deletions apps/web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# create-svelte

Everything you need to build a Svelte project, powered by
[`create-svelte`](https://github.com/sveltejs/kit/tree/main/packages/create-svelte).

## Creating a project

If you're seeing this, you've probably already done this step.
Congrats!

```bash
# create a new project in the current directory
npm create svelte@latest

# create a new project in my-app
npm create svelte@latest my-app
```

## Developing

Once you've created a project and installed dependencies with
`npm install` (or `pnpm install` or `yarn`), start a development
server:

```bash
npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open
```

## Building

To create a production version of your app:

```bash
npm run build
```

You can preview the production build with `npm run preview`.

> To deploy your app, you may need to install an
> [adapter](https://kit.svelte.dev/docs/adapters) for your target
> environment.
6 changes: 3 additions & 3 deletions mdsvex.config.js → apps/web/mdsvex.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineMDSveXConfig as defineConfig } from 'mdsvex'
import { defineMDSveXConfig as defineConfig } from 'mdsvex';

const config = defineConfig({
extensions: ['.svelte.md', '.md', '.svx'],
Expand All @@ -9,6 +9,6 @@ const config = defineConfig({

remarkPlugins: [],
rehypePlugins: [],
})
});

export default config
export default config;
49 changes: 49 additions & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "@svead/web",
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"test": "npm run test:integration && npm run test:unit",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --check . && eslint .",
"format": "prettier --write .",
"test:integration": "playwright test",
"test:unit": "vitest"
},
"devDependencies": {
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@tailwindcss/typography": "^0.5.10",
"@testing-library/svelte": "^4.0.5",
"@types/eslint": "8.56.0",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"autoprefixer": "^10.4.16",
"daisyui": "^4.4.20",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.35.1",
"fathom-client": "^3.6.0",
"jsdom": "^23.1.0",
"mdsvex": "^0.11.0",
"postcss": "^8.4.32",
"postcss-load-config": "^5.0.2",
"prettier": "^3.1.1",
"prettier-plugin-svelte": "^3.1.2",
"prettier-plugin-tailwindcss": "^0.5.9",
"svelte": "^5.0.0-next.1",
"svelte-check": "^3.6.0",
"tailwindcss": "^3.3.6",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^5.0.3",
"vitest": "^1.0.0"
},
"type": "module"
}
12 changes: 12 additions & 0 deletions apps/web/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import type { PlaywrightTestConfig } from '@playwright/test';

const config: PlaywrightTestConfig = {
webServer: {
command: 'pnpm run build && pnpm run preview',
port: 4173,
},
testDir: 'tests',
testMatch: /(.+\.)?(test|spec)\.[jt]s/,
};

export default config;
8 changes: 4 additions & 4 deletions postcss.config.cjs → apps/web/postcss.config.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const tailwindcss = require('tailwindcss')
const autoprefixer = require('autoprefixer')
const tailwindcss = require('tailwindcss');
const autoprefixer = require('autoprefixer');

const config = {
plugins: [
Expand All @@ -8,6 +8,6 @@ const config = {
//But others, like autoprefixer, need to run after,
autoprefixer,
],
}
};

module.exports = config
module.exports = config;
3 changes: 2 additions & 1 deletion src/app.d.ts → apps/web/src/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ declare global {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}

export {}
export {};
4 changes: 2 additions & 2 deletions src/app.html → apps/web/src/app.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand All @@ -10,6 +10,6 @@
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
<div class="flex flex-col min-h-screen">%sveltekit.body%</div>
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>
10 changes: 5 additions & 5 deletions src/app.css → apps/web/src/app.postcss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ html {
/* Firefox */
* {
scrollbar-width: thin;
scrollbar-color: hsl(var(--s)) hsl(var(--p));
scrollbar-color: oklch(var(--s)) oklch(var(--p));
}

/* Chrome, Edge, and Safari */
Expand All @@ -20,18 +20,18 @@ html {
}

*::-webkit-scrollbar-track {
background: hsl(var(--p));
background: oklch(var(--p));
border-radius: 5px;
}

*::-webkit-scrollbar-thumb {
background-color: hsl(var(--s));
background-color: oklch(var(--s));
border-radius: 14px;
border: 3px solid hsl(var(--p));
border: 3px solid oklch(var(--p));
}

*::-webkit-scrollbar-thumb:hover {
background-color: hsl(var(--a));
background-color: oklch(var(--a));
}

@tailwind components;
Expand Down
7 changes: 7 additions & 0 deletions apps/web/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { describe, expect, it } from 'vitest';

describe('sum test', () => {
it('adds 1 + 2 to equal 3', () => {
expect(1 + 2).toBe(3);
});
});
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<script lang="ts">
import type { AuthorType, MainEntity } from '$lib/types'
import type { MainEntityType } from '../main-entity-types'
import type { SchemaOrgProps } from './schema-org-props'
import SchemaOrg from './schema-org.svelte'
import type { AuthorType, MainEntity } from '$lib/types';
import type { MainEntityType } from '../main-entity-types';
import type { SchemaOrgProps } from './schema-org-props';
import SchemaOrg from './schema-org.svelte';
// Required props
export let url: string // Full URL of the current page
export let title: string // Page title
export let description: string // Page description
export let url: string; // Full URL of the current page
export let title: string; // Page title
export let description: string; // Page description
// Optional props
export let website: string = '' // Website URL
export let authorName: string = '' // Author name
export let image: string = '' // Open Graph image URL
export let paymentPointer: string = '' // Web Monetization payment pointer
export let datePublished: string = '' // ISO 8601 format
export let dateModified: string = '' // ISO 8601 format
export let contentType: MainEntityType = 'WebPage'
export let language: string = 'en'
export let authorType: AuthorType = 'Person'
export let authorUrl: string = ''
export let website: string = ''; // Website URL
export let authorName: string = ''; // Author name
export let image: string = ''; // Open Graph image URL
export let paymentPointer: string = ''; // Web Monetization payment pointer
export let datePublished: string = ''; // ISO 8601 format
export let dateModified: string = ''; // ISO 8601 format
export let contentType: MainEntityType = 'WebPage';
export let language: string = 'en';
export let authorType: AuthorType = 'Person';
export let authorUrl: string = '';
const mainEntity: MainEntity = {
type: contentType,
Expand All @@ -40,7 +40,7 @@
name: website,
logo: '',
},
}
};
const schemaOrgProps: SchemaOrgProps = {
url,
Expand All @@ -56,7 +56,7 @@
language,
mainEntity,
breadcrumbs: [],
}
};
</script>

<svelte:head>
Expand Down
Loading

0 comments on commit 0d3637c

Please sign in to comment.