Skip to content

Commit 3a6035f

Browse files
committed
Initial web monorepo
0 parents  commit 3a6035f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+4384
-0
lines changed

.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
root: true,
3+
// This tells ESLint to load the config from the package `eslint-config-custom`
4+
extends: ['custom']
5+
};

.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
node_modules
5+
.pnp
6+
.pnp.js
7+
8+
# testing
9+
coverage
10+
11+
# svelte
12+
.svelte-kit
13+
14+
# misc
15+
.DS_Store
16+
*.pem
17+
18+
# debug
19+
npm-debug.log*
20+
yarn-debug.log*
21+
yarn-error.log*
22+
23+
# local env files
24+
.env.local
25+
.env.development.local
26+
.env.test.local
27+
.env.production.local
28+
29+
# turbo
30+
.turbo

.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
auto-install-peers = true

.prettierignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.DS_Store
2+
.svelte-kit
3+
node_modules
4+
/build
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
vite.config.js*
10+
11+
# Ignore files for PNPM, NPM and YARN
12+
pnpm-lock.yaml
13+
pnpm-workspace.yaml
14+
package-lock.json
15+
yarn.lock

.prettierrc

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"useTabs": true,
3+
"tabWidth": 2,
4+
"semi": false,
5+
"singleQuote": true,
6+
"trailingComma": "none",
7+
"printWidth": 100,
8+
"svelteSortOrder": "scripts-markup-styles",
9+
"plugins": ["prettier-plugin-svelte"],
10+
"pluginSearchDirs": ["."],
11+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
12+
}

README.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Turborepo Svelte starter
2+
3+
This is an official starter Turborepo.
4+
5+
## Using this example
6+
7+
Run the following command:
8+
9+
```sh
10+
npx create-turbo@latest -e with-svelte
11+
```
12+
13+
## What's inside?
14+
15+
This Turborepo includes the following packages/apps:
16+
17+
### Apps and Packages
18+
19+
- `docs`: a [svelte-kit](https://kit.svelte.dev/) app
20+
- `web`: another [svelte-kit](https://kit.svelte.dev/) app
21+
- `ui`: a stub Svelte component library shared by both `web` and `docs` applications
22+
- `eslint-config-custom`: `eslint` configurations (includes `eslint-plugin-svelte` and `eslint-config-prettier`)
23+
24+
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
25+
26+
### Utilities
27+
28+
This Turborepo has some additional tools already setup for you:
29+
30+
- [TypeScript](https://www.typescriptlang.org/) for static type checking
31+
- [ESLint](https://eslint.org/) for code linting
32+
- [Prettier](https://prettier.io) for code formatting

apps/reauth/.eslintignore

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
10+
# Ignore files for PNPM, NPM and YARN
11+
pnpm-lock.yaml
12+
package-lock.json
13+
yarn.lock

apps/reauth/.eslintrc.cjs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['custom']
3+
};

apps/reauth/.gitignore

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example

apps/reauth/README.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# create-svelte
2+
3+
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
4+
5+
## Creating a project
6+
7+
If you're seeing this, you've probably already done this step. Congrats!
8+
9+
```bash
10+
# create a new project in the current directory
11+
npm init svelte
12+
13+
# create a new project in my-app
14+
npm init svelte my-app
15+
```
16+
17+
## Developing
18+
19+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
20+
21+
```bash
22+
npm run dev
23+
24+
# or start the server and open the app in a new browser tab
25+
npm run dev -- --open
26+
```
27+
28+
## Building
29+
30+
To create a production version of your app:
31+
32+
```bash
33+
npm run build
34+
```
35+
36+
You can preview the production build with `npm run preview`.
37+
38+
> To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.

apps/reauth/package.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "@resplice/reauth",
3+
"version": "0.0.0",
4+
"type": "module",
5+
"scripts": {
6+
"dev": "vite dev --port 3000 --open",
7+
"build": "vite build",
8+
"package": "vite package",
9+
"preview": "vite preview",
10+
"check": "svelte-check --tsconfig ./tsconfig.json",
11+
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
12+
"lint": "prettier --check --ignore-path=../../.prettierignore . && eslint \"src\"",
13+
"format": "prettier --write --ignore-path=../../.prettierignore ."
14+
},
15+
"dependencies": {
16+
"@resplice/components": "*"
17+
},
18+
"devDependencies": {
19+
"@sveltejs/adapter-auto": "latest",
20+
"@sveltejs/kit": "latest",
21+
"eslint-config-custom": "*",
22+
"svelte": "^3.44.0",
23+
"svelte-check": "^2.7.1",
24+
"svelte-preprocess": "^4.10.6",
25+
"tslib": "^2.3.1",
26+
"typescript": "^4.7.2",
27+
"vite": "^4.0.0"
28+
}
29+
}

apps/reauth/src/app.d.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/// <reference types="@sveltejs/kit" />
2+
3+
// See https://kit.svelte.dev/docs/types#app
4+
// for information about these interfaces
5+
// and what to do when importing types
6+
declare namespace App {
7+
// interface Locals {}
8+
// interface Platform {}
9+
// interface Session {}
10+
// interface Stuff {}
11+
}

apps/reauth/src/app.html

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
%sveltekit.head%
8+
</head>
9+
<body>
10+
<div>%sveltekit.body%</div>
11+
</body>
12+
</html>

apps/reauth/src/routes/+page.svelte

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<script lang="ts">
2+
import { MyCounterButton } from '@resplice/components'
3+
</script>
4+
5+
<h1>Web</h1>
6+
<MyCounterButton />
7+
8+
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>

apps/reauth/static/favicon.png

1.53 KB
Loading

apps/reauth/svelte.config.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import adapter from '@sveltejs/adapter-auto';
2+
import preprocess from 'svelte-preprocess';
3+
4+
/** @type {import('@sveltejs/kit').Config} */
5+
const config = {
6+
// Consult https://github.com/sveltejs/svelte-preprocess
7+
// for more information about preprocessors
8+
preprocess: preprocess(),
9+
10+
kit: {
11+
adapter: adapter()
12+
}
13+
};
14+
15+
export default config;

apps/reauth/tsconfig.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "./.svelte-kit/tsconfig.json",
3+
"compilerOptions": {
4+
"allowJs": true,
5+
"checkJs": true,
6+
"esModuleInterop": true,
7+
"forceConsistentCasingInFileNames": true,
8+
"resolveJsonModule": true,
9+
"skipLibCheck": true,
10+
"sourceMap": true,
11+
"strict": true
12+
}
13+
}

apps/reauth/vite.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { sveltekit } from '@sveltejs/kit/vite';
2+
3+
/** @type {import('vite').UserConfig} */
4+
const config = {
5+
plugins: [sveltekit()]
6+
};
7+
8+
export default config;

apps/resplice/.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

apps/resplice/.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["svelte.svelte-vscode"]
3+
}

apps/resplice/README.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Svelte + TS + Vite
2+
3+
This template should help get you started developing with Svelte and TypeScript in Vite.
4+
5+
## Recommended IDE Setup
6+
7+
[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode).
8+
9+
## Need an official Svelte framework?
10+
11+
Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more.
12+
13+
## Technical considerations
14+
15+
**Why use this over SvelteKit?**
16+
17+
- It brings its own routing solution which might not be preferable for some users.
18+
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.
19+
20+
This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project.
21+
22+
Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate.
23+
24+
**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?**
25+
26+
Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information.
27+
28+
**Why include `.vscode/extensions.json`?**
29+
30+
Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project.
31+
32+
**Why enable `allowJs` in the TS template?**
33+
34+
While `allowJs: false` would indeed prevent the use of `.js` files in the project, it does not prevent the use of JavaScript syntax in `.svelte` files. In addition, it would force `checkJs: false`, bringing the worst of both worlds: not being able to guarantee the entire codebase is TypeScript, and also having worse typechecking for the existing JavaScript. In addition, there are valid use cases in which a mixed codebase may be relevant.
35+
36+
**Why is HMR not preserving my local component state?**
37+
38+
HMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr` and `@sveltejs/vite-plugin-svelte` due to its often surprising behavior. You can read the details [here](https://github.com/rixo/svelte-hmr#svelte-hmr).
39+
40+
If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR.
41+
42+
```ts
43+
// store.ts
44+
// An extremely simple external store
45+
import { writable } from 'svelte/store'
46+
export default writable(0)
47+
```

apps/resplice/index.html

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta
7+
name="viewport"
8+
content="width=device-width, initial-scale=1, shrink-to-fit=no, user-scalable=no, viewport-fit=cover"
9+
/>
10+
<link rel="manifest" crossorigin="use-credentials" href="/manifest.json" />
11+
<meta name="theme-color" content="#1BBC9B" />
12+
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
13+
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png" />
14+
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
15+
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#1BBC9B" />
16+
<meta name="msapplication-TileColor" content="#1BBC9B" />
17+
<!-- <script>
18+
// Inlining in head to avoid FOUC (Flash of Unstyled Content)
19+
if (
20+
localStorage.getItem('theme') === 'dark' ||
21+
(!localStorage.getItem('theme') &&
22+
window.matchMedia('(prefers-color-scheme: dark)').matches)
23+
) {
24+
document.documentElement.classList.add('dark')
25+
} else {
26+
document.documentElement.classList.remove('dark')
27+
}
28+
</script> -->
29+
<title>Resplice</title>
30+
</head>
31+
<body>
32+
<div id="app"></div>
33+
<script type="module" src="/src/main.ts"></script>
34+
</body>
35+
</html>

0 commit comments

Comments
 (0)