mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-02-18 21:38:58 +00:00
feat(create-turbo): apply official-starter transform
This commit is contained in:
32
turbo-svelte/.gitignore
vendored
Normal file
32
turbo-svelte/.gitignore
vendored
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
node_modules
|
||||||
|
.pnp
|
||||||
|
.pnp.js
|
||||||
|
|
||||||
|
# testing
|
||||||
|
coverage
|
||||||
|
|
||||||
|
# svelte
|
||||||
|
.svelte-kit
|
||||||
|
|
||||||
|
# misc
|
||||||
|
.DS_Store
|
||||||
|
*.pem
|
||||||
|
|
||||||
|
# debug
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
|
||||||
|
# local env files
|
||||||
|
.env.local
|
||||||
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
|
||||||
|
# turbo
|
||||||
|
.turbo
|
||||||
|
|
||||||
|
dist
|
||||||
1
turbo-svelte/.npmrc
Normal file
1
turbo-svelte/.npmrc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
auto-install-peers = true
|
||||||
15
turbo-svelte/.prettierignore
Normal file
15
turbo-svelte/.prettierignore
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
.DS_Store
|
||||||
|
.svelte-kit
|
||||||
|
node_modules
|
||||||
|
/build
|
||||||
|
/package
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
vite.config.js*
|
||||||
|
|
||||||
|
# Ignore files for PNPM, NPM and YARN
|
||||||
|
pnpm-lock.yaml
|
||||||
|
pnpm-workspace.yaml
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
5
turbo-svelte/.prettierrc
Normal file
5
turbo-svelte/.prettierrc
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"printWidth": 100
|
||||||
|
}
|
||||||
32
turbo-svelte/README.md
Normal file
32
turbo-svelte/README.md
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
# Turborepo Svelte starter
|
||||||
|
|
||||||
|
This Turborepo starter is maintained by the Turborepo core team.
|
||||||
|
|
||||||
|
## Using this example
|
||||||
|
|
||||||
|
Run the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
npx create-turbo@latest -e with-svelte
|
||||||
|
```
|
||||||
|
|
||||||
|
## What's inside?
|
||||||
|
|
||||||
|
This Turborepo includes the following packages/apps:
|
||||||
|
|
||||||
|
### Apps and Packages
|
||||||
|
|
||||||
|
- `docs`: a [svelte-kit](https://kit.svelte.dev/) app
|
||||||
|
- `web`: another [svelte-kit](https://kit.svelte.dev/) app
|
||||||
|
- `ui`: a stub Svelte component library shared by both `web` and `docs` applications
|
||||||
|
- `eslint-config-custom`: `eslint` configurations (includes `eslint-plugin-svelte` and `eslint-config-prettier`)
|
||||||
|
|
||||||
|
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
|
||||||
|
|
||||||
|
### Utilities
|
||||||
|
|
||||||
|
This Turborepo has some additional tools already setup for you:
|
||||||
|
|
||||||
|
- [TypeScript](https://www.typescriptlang.org/) for static type checking
|
||||||
|
- [ESLint](https://eslint.org/) for code linting
|
||||||
|
- [Prettier](https://prettier.io) for code formatting
|
||||||
10
turbo-svelte/apps/docs/.gitignore
vendored
Normal file
10
turbo-svelte/apps/docs/.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/build
|
||||||
|
/.svelte-kit
|
||||||
|
/package
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
vite.config.js.timestamp-*
|
||||||
|
vite.config.ts.timestamp-*
|
||||||
1
turbo-svelte/apps/docs/.npmrc
Normal file
1
turbo-svelte/apps/docs/.npmrc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
engine-strict=true
|
||||||
14
turbo-svelte/apps/docs/.prettierignore
Normal file
14
turbo-svelte/apps/docs/.prettierignore
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/build
|
||||||
|
/.svelte-kit
|
||||||
|
/package
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
# Ignore files for PNPM, NPM and YARN
|
||||||
|
pnpm-lock.yaml
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
|
vite.config.*.timestamp-*
|
||||||
8
turbo-svelte/apps/docs/.prettierrc
Normal file
8
turbo-svelte/apps/docs/.prettierrc
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"useTabs": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"printWidth": 100,
|
||||||
|
"plugins": ["prettier-plugin-svelte"],
|
||||||
|
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
||||||
|
}
|
||||||
38
turbo-svelte/apps/docs/README.md
Normal file
38
turbo-svelte/apps/docs/README.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# create-svelte
|
||||||
|
|
||||||
|
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/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.
|
||||||
8
turbo-svelte/apps/docs/eslint.config.js
Normal file
8
turbo-svelte/apps/docs/eslint.config.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { config } from '@repo/eslint-config/index.js';
|
||||||
|
|
||||||
|
export default [
|
||||||
|
...config,
|
||||||
|
{
|
||||||
|
ignores: ['.svelte-kit/*']
|
||||||
|
}
|
||||||
|
];
|
||||||
37
turbo-svelte/apps/docs/package.json
Normal file
37
turbo-svelte/apps/docs/package.json
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"name": "docs",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite dev",
|
||||||
|
"build": "svelte-kit sync && vite build",
|
||||||
|
"preview": "vite preview",
|
||||||
|
"test": "npm run test:integration && npm run test:unit",
|
||||||
|
"check-types": "tsc --noEmit",
|
||||||
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"test:integration": "playwright test",
|
||||||
|
"test:unit": "vitest"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@repo/ui": "workspace:*"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@repo/eslint-config": "workspace:*",
|
||||||
|
"@repo/typescript-config": "workspace:*",
|
||||||
|
"@sveltejs/adapter-auto": "^4.0.0",
|
||||||
|
"@sveltejs/kit": "^2.36.1",
|
||||||
|
"@sveltejs/vite-plugin-svelte": "^5.1.0",
|
||||||
|
"prettier": "^3.6.0",
|
||||||
|
"eslint": "^9.34.0",
|
||||||
|
"prettier-plugin-svelte": "^3.4.0",
|
||||||
|
"svelte": "^5.38.0",
|
||||||
|
"svelte-check": "^4.3.0",
|
||||||
|
"tslib": "^2.8.1",
|
||||||
|
"typescript": "5.9.2",
|
||||||
|
"vite": "^6.3.2",
|
||||||
|
"vitest": "^3.2.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
12
turbo-svelte/apps/docs/playwright.config.ts
Normal file
12
turbo-svelte/apps/docs/playwright.config.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
|
const config: PlaywrightTestConfig = {
|
||||||
|
webServer: {
|
||||||
|
command: 'npm run build && npm run preview',
|
||||||
|
port: 4173
|
||||||
|
},
|
||||||
|
testDir: 'tests',
|
||||||
|
testMatch: /(.+\.)?(test|spec)\.[jt]s/
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
12
turbo-svelte/apps/docs/src/app.d.ts
vendored
Normal file
12
turbo-svelte/apps/docs/src/app.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// See https://kit.svelte.dev/docs/types#app
|
||||||
|
// for information about these interfaces
|
||||||
|
declare global {
|
||||||
|
namespace App {
|
||||||
|
// interface Error {}
|
||||||
|
// interface Locals {}
|
||||||
|
// interface PageData {}
|
||||||
|
// interface Platform {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {};
|
||||||
12
turbo-svelte/apps/docs/src/app.html
Normal file
12
turbo-svelte/apps/docs/src/app.html
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
%sveltekit.head%
|
||||||
|
</head>
|
||||||
|
<body data-sveltekit-preload-data="hover">
|
||||||
|
<div style="display: contents">%sveltekit.body%</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
7
turbo-svelte/apps/docs/src/index.test.ts
Normal file
7
turbo-svelte/apps/docs/src/index.test.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
|
||||||
|
describe('sum test', () => {
|
||||||
|
it('adds 1 + 2 to equal 3', () => {
|
||||||
|
expect(1 + 2).toBe(3);
|
||||||
|
});
|
||||||
|
});
|
||||||
1
turbo-svelte/apps/docs/src/lib/index.ts
Normal file
1
turbo-svelte/apps/docs/src/lib/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// place files you want to import through the `$lib` alias in this folder.
|
||||||
7
turbo-svelte/apps/docs/src/routes/+page.svelte
Normal file
7
turbo-svelte/apps/docs/src/routes/+page.svelte
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { MyCounterButton } from '@repo/ui';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1>Docs</h1>
|
||||||
|
<MyCounterButton />
|
||||||
|
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
|
||||||
BIN
turbo-svelte/apps/docs/static/favicon.png
vendored
Normal file
BIN
turbo-svelte/apps/docs/static/favicon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
17
turbo-svelte/apps/docs/svelte.config.js
Normal file
17
turbo-svelte/apps/docs/svelte.config.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import adapter from '@sveltejs/adapter-auto';
|
||||||
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||||
|
|
||||||
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
|
const config = {
|
||||||
|
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
||||||
|
// for more information about preprocessors
|
||||||
|
preprocess: vitePreprocess(),
|
||||||
|
kit: {
|
||||||
|
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
||||||
|
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
|
||||||
|
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
||||||
|
adapter: adapter()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
3
turbo-svelte/apps/docs/tsconfig.json
Normal file
3
turbo-svelte/apps/docs/tsconfig.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": ["@repo/typescript-config/svelte.json", "./.svelte-kit/tsconfig.json"]
|
||||||
|
}
|
||||||
6
turbo-svelte/apps/docs/vite.config.ts
Normal file
6
turbo-svelte/apps/docs/vite.config.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { sveltekit } from '@sveltejs/kit/vite';
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [sveltekit()]
|
||||||
|
});
|
||||||
10
turbo-svelte/apps/web/.gitignore
vendored
Normal file
10
turbo-svelte/apps/web/.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/build
|
||||||
|
/.svelte-kit
|
||||||
|
/package
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
vite.config.js.timestamp-*
|
||||||
|
vite.config.ts.timestamp-*
|
||||||
1
turbo-svelte/apps/web/.npmrc
Normal file
1
turbo-svelte/apps/web/.npmrc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
engine-strict=true
|
||||||
14
turbo-svelte/apps/web/.prettierignore
Normal file
14
turbo-svelte/apps/web/.prettierignore
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
.DS_Store
|
||||||
|
node_modules
|
||||||
|
/build
|
||||||
|
/.svelte-kit
|
||||||
|
/package
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
|
||||||
|
# Ignore files for PNPM, NPM and YARN
|
||||||
|
pnpm-lock.yaml
|
||||||
|
package-lock.json
|
||||||
|
yarn.lock
|
||||||
|
vite.config.*.timestamp-*
|
||||||
8
turbo-svelte/apps/web/.prettierrc
Normal file
8
turbo-svelte/apps/web/.prettierrc
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"useTabs": true,
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "none",
|
||||||
|
"printWidth": 100,
|
||||||
|
"plugins": ["prettier-plugin-svelte"],
|
||||||
|
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
|
||||||
|
}
|
||||||
38
turbo-svelte/apps/web/README.md
Normal file
38
turbo-svelte/apps/web/README.md
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
# create-svelte
|
||||||
|
|
||||||
|
Everything you need to build a Svelte project, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/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.
|
||||||
8
turbo-svelte/apps/web/eslint.config.js
Normal file
8
turbo-svelte/apps/web/eslint.config.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { config } from '@repo/eslint-config/index.js';
|
||||||
|
|
||||||
|
export default [
|
||||||
|
...config,
|
||||||
|
{
|
||||||
|
ignores: ['.svelte-kit/*']
|
||||||
|
}
|
||||||
|
];
|
||||||
37
turbo-svelte/apps/web/package.json
Normal file
37
turbo-svelte/apps/web/package.json
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"name": "web",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite dev",
|
||||||
|
"build": "svelte-kit sync && vite build",
|
||||||
|
"preview": "vite preview",
|
||||||
|
"test": "npm run test:integration && npm run test:unit",
|
||||||
|
"check-types": "tsc --noEmit",
|
||||||
|
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||||
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"test:integration": "playwright test",
|
||||||
|
"test:unit": "vitest"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@repo/ui": "workspace:*"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@repo/eslint-config": "workspace:*",
|
||||||
|
"@repo/typescript-config": "workspace:*",
|
||||||
|
"@sveltejs/adapter-auto": "^4.0.0",
|
||||||
|
"@sveltejs/kit": "^2.36.1",
|
||||||
|
"@sveltejs/vite-plugin-svelte": "^5.1.0",
|
||||||
|
"prettier": "^3.6.0",
|
||||||
|
"eslint": "^9.34.0",
|
||||||
|
"prettier-plugin-svelte": "^3.4.0",
|
||||||
|
"svelte": "^5.38.0",
|
||||||
|
"svelte-check": "^4.3.0",
|
||||||
|
"tslib": "^2.8.1",
|
||||||
|
"typescript": "5.9.2",
|
||||||
|
"vite": "^6.3.2",
|
||||||
|
"vitest": "^3.2.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
12
turbo-svelte/apps/web/playwright.config.ts
Normal file
12
turbo-svelte/apps/web/playwright.config.ts
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
import type { PlaywrightTestConfig } from '@playwright/test';
|
||||||
|
|
||||||
|
const config: PlaywrightTestConfig = {
|
||||||
|
webServer: {
|
||||||
|
command: 'npm run build && npm run preview',
|
||||||
|
port: 4173
|
||||||
|
},
|
||||||
|
testDir: 'tests',
|
||||||
|
testMatch: /(.+\.)?(test|spec)\.[jt]s/
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
12
turbo-svelte/apps/web/src/app.d.ts
vendored
Normal file
12
turbo-svelte/apps/web/src/app.d.ts
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// See https://kit.svelte.dev/docs/types#app
|
||||||
|
// for information about these interfaces
|
||||||
|
declare global {
|
||||||
|
namespace App {
|
||||||
|
// interface Error {}
|
||||||
|
// interface Locals {}
|
||||||
|
// interface PageData {}
|
||||||
|
// interface Platform {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export {};
|
||||||
12
turbo-svelte/apps/web/src/app.html
Normal file
12
turbo-svelte/apps/web/src/app.html
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
%sveltekit.head%
|
||||||
|
</head>
|
||||||
|
<body data-sveltekit-preload-data="hover">
|
||||||
|
<div style="display: contents">%sveltekit.body%</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
7
turbo-svelte/apps/web/src/index.test.ts
Normal file
7
turbo-svelte/apps/web/src/index.test.ts
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
|
||||||
|
describe('sum test', () => {
|
||||||
|
it('adds 1 + 2 to equal 3', () => {
|
||||||
|
expect(1 + 2).toBe(3);
|
||||||
|
});
|
||||||
|
});
|
||||||
1
turbo-svelte/apps/web/src/lib/index.ts
Normal file
1
turbo-svelte/apps/web/src/lib/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
// place files you want to import through the `$lib` alias in this folder.
|
||||||
7
turbo-svelte/apps/web/src/routes/+page.svelte
Normal file
7
turbo-svelte/apps/web/src/routes/+page.svelte
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { MyCounterButton } from '@repo/ui';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1>Web</h1>
|
||||||
|
<MyCounterButton />
|
||||||
|
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
|
||||||
BIN
turbo-svelte/apps/web/static/favicon.png
Normal file
BIN
turbo-svelte/apps/web/static/favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
17
turbo-svelte/apps/web/svelte.config.js
Normal file
17
turbo-svelte/apps/web/svelte.config.js
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import adapter from '@sveltejs/adapter-auto';
|
||||||
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||||
|
|
||||||
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
|
const config = {
|
||||||
|
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
||||||
|
// for more information about preprocessors
|
||||||
|
preprocess: vitePreprocess(),
|
||||||
|
kit: {
|
||||||
|
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
|
||||||
|
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
|
||||||
|
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
|
||||||
|
adapter: adapter()
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
3
turbo-svelte/apps/web/tsconfig.json
Normal file
3
turbo-svelte/apps/web/tsconfig.json
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"extends": ["@repo/typescript-config/svelte.json", "./.svelte-kit/tsconfig.json"]
|
||||||
|
}
|
||||||
6
turbo-svelte/apps/web/vite.config.ts
Normal file
6
turbo-svelte/apps/web/vite.config.ts
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import { sveltekit } from '@sveltejs/kit/vite';
|
||||||
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [sveltekit()]
|
||||||
|
});
|
||||||
20
turbo-svelte/package.json
Normal file
20
turbo-svelte/package.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"name": "with-svelte",
|
||||||
|
"private": true,
|
||||||
|
"scripts": {
|
||||||
|
"build": "turbo run build",
|
||||||
|
"dev": "turbo run dev",
|
||||||
|
"lint": "turbo run lint",
|
||||||
|
"format": "prettier --write .",
|
||||||
|
"check-types": "turbo run check-types"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"prettier": "^3.6.0",
|
||||||
|
"prettier-plugin-svelte": "^3.4.0",
|
||||||
|
"turbo": "^2.5.8"
|
||||||
|
},
|
||||||
|
"packageManager": "pnpm@10.0.0",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
}
|
||||||
27
turbo-svelte/packages/eslint-config/index.js
Normal file
27
turbo-svelte/packages/eslint-config/index.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
import js from '@eslint/js';
|
||||||
|
import svelte from 'eslint-plugin-svelte';
|
||||||
|
import globals from 'globals';
|
||||||
|
import ts from 'typescript-eslint';
|
||||||
|
|
||||||
|
export const config = ts.config(
|
||||||
|
js.configs.recommended,
|
||||||
|
...ts.configs.recommended,
|
||||||
|
...svelte.configs['flat/recommended'],
|
||||||
|
{
|
||||||
|
languageOptions: {
|
||||||
|
globals: {
|
||||||
|
...globals.browser,
|
||||||
|
...globals.node
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/*.svelte'],
|
||||||
|
ignores: ['.svelte-kit/*'],
|
||||||
|
languageOptions: {
|
||||||
|
parserOptions: {
|
||||||
|
parser: ts.parser
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
17
turbo-svelte/packages/eslint-config/package.json
Normal file
17
turbo-svelte/packages/eslint-config/package.json
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/eslint-config",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"type": "module",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@eslint/eslintrc": "^3.3.1",
|
||||||
|
"@eslint/js": "^9.34.0",
|
||||||
|
"eslint-config-prettier": "^10.1.1",
|
||||||
|
"eslint-config-turbo": "^2.5.0",
|
||||||
|
"eslint-plugin-svelte": "^2.46.1",
|
||||||
|
"globals": "^15.15.0",
|
||||||
|
"typescript-eslint": "^8.40.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
10
turbo-svelte/packages/typescript-config/package.json
Normal file
10
turbo-svelte/packages/typescript-config/package.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/typescript-config",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
|
"license": "MIT",
|
||||||
|
"publishConfig": {
|
||||||
|
"access": "public"
|
||||||
|
}
|
||||||
|
}
|
||||||
18
turbo-svelte/packages/typescript-config/svelte.json
Normal file
18
turbo-svelte/packages/typescript-config/svelte.json
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"allowJs": true,
|
||||||
|
"checkJs": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"strict": true,
|
||||||
|
"moduleResolution": "NodeNext",
|
||||||
|
"module": "NodeNext",
|
||||||
|
"target": "ESNext",
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"lib": ["esnext", "DOM", "DOM.Iterable"]
|
||||||
|
}
|
||||||
|
}
|
||||||
8
turbo-svelte/packages/ui/eslint.config.js
Normal file
8
turbo-svelte/packages/ui/eslint.config.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { config } from '@repo/eslint-config/index.js';
|
||||||
|
|
||||||
|
export default [
|
||||||
|
...config,
|
||||||
|
{
|
||||||
|
ignores: ['.svelte-kit/**', 'dist/**']
|
||||||
|
}
|
||||||
|
];
|
||||||
1
turbo-svelte/packages/ui/index.ts
Normal file
1
turbo-svelte/packages/ui/index.ts
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export { default as MyCounterButton } from './components/MyCounterButton.svelte';
|
||||||
43
turbo-svelte/packages/ui/package.json
Normal file
43
turbo-svelte/packages/ui/package.json
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/ui",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "svelte-kit sync && svelte-package --watch --input=src",
|
||||||
|
"build": "svelte-kit sync && svelte-package --input=src",
|
||||||
|
"lint": "eslint .",
|
||||||
|
"check-types": "svelte-check --tsconfig ./tsconfig.json"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"dist",
|
||||||
|
"!dist/**/*.test.*",
|
||||||
|
"!dist/**/*.spec.*",
|
||||||
|
"src",
|
||||||
|
"!src/**/*.test.*",
|
||||||
|
"!src/**/*.spec.*"
|
||||||
|
],
|
||||||
|
"sideEffects": [
|
||||||
|
"**/*.css"
|
||||||
|
],
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"types": "./dist/index.d.ts",
|
||||||
|
"svelte": "./dist/index.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"svelte": "^5.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@repo/eslint-config": "workspace:*",
|
||||||
|
"@repo/typescript-config": "workspace:*",
|
||||||
|
"@sveltejs/kit": "^2.36.1",
|
||||||
|
"@sveltejs/package": "^2.5.0",
|
||||||
|
"@sveltejs/vite-plugin-svelte": "^5.1.0",
|
||||||
|
"eslint": "^9.34.0",
|
||||||
|
"svelte": "^5.38.0",
|
||||||
|
"svelte-check": "^4.3.0",
|
||||||
|
"typescript": "5.9.2",
|
||||||
|
"vite": "^6.3.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
11
turbo-svelte/packages/ui/src/MyCounterButton.svelte
Normal file
11
turbo-svelte/packages/ui/src/MyCounterButton.svelte
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
let count = $state(0);
|
||||||
|
|
||||||
|
function handleClick() {
|
||||||
|
count += 1;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<button onclick={handleClick}>
|
||||||
|
clicks: {count}
|
||||||
|
</button>
|
||||||
2
turbo-svelte/packages/ui/src/index.ts
Normal file
2
turbo-svelte/packages/ui/src/index.ts
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export { Counter } from './my-counter-class.svelte';
|
||||||
|
export { default as MyCounterButton } from './MyCounterButton.svelte';
|
||||||
11
turbo-svelte/packages/ui/src/my-counter-class.svelte.ts
Normal file
11
turbo-svelte/packages/ui/src/my-counter-class.svelte.ts
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
export class Counter {
|
||||||
|
count = $state(0);
|
||||||
|
|
||||||
|
increment = () => {
|
||||||
|
this.count++;
|
||||||
|
};
|
||||||
|
|
||||||
|
decrement = () => {
|
||||||
|
this.count--;
|
||||||
|
};
|
||||||
|
}
|
||||||
10
turbo-svelte/packages/ui/svelte.config.js
Normal file
10
turbo-svelte/packages/ui/svelte.config.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
||||||
|
|
||||||
|
/** @type {import('@sveltejs/kit').Config} */
|
||||||
|
const config = {
|
||||||
|
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
|
||||||
|
// for more information about preprocessors
|
||||||
|
preprocess: vitePreprocess()
|
||||||
|
};
|
||||||
|
|
||||||
|
export default config;
|
||||||
10
turbo-svelte/packages/ui/tsconfig.json
Normal file
10
turbo-svelte/packages/ui/tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"extends": ["@repo/typescript-config/svelte.json", "./.svelte-kit/tsconfig.json"],
|
||||||
|
"compilerOptions": {
|
||||||
|
"declaration": true,
|
||||||
|
"declarationMap": true,
|
||||||
|
"allowArbitraryExtensions": true
|
||||||
|
},
|
||||||
|
"include": ["dist", "./src/**/*.svelte", "./src/**/*.ts"],
|
||||||
|
"exclude": ["node_modules", ".svelte-kit"]
|
||||||
|
}
|
||||||
8
turbo-svelte/packages/ui/vite.config.js
Normal file
8
turbo-svelte/packages/ui/vite.config.js
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
import { defineConfig } from 'vite';
|
||||||
|
import { svelte } from '@sveltejs/vite-plugin-svelte';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
svelte()
|
||||||
|
]
|
||||||
|
});
|
||||||
2774
turbo-svelte/pnpm-lock.yaml
generated
Normal file
2774
turbo-svelte/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
3
turbo-svelte/pnpm-workspace.yaml
Normal file
3
turbo-svelte/pnpm-workspace.yaml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
packages:
|
||||||
|
- "apps/*"
|
||||||
|
- "packages/*"
|
||||||
21
turbo-svelte/turbo.json
Normal file
21
turbo-svelte/turbo.json
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://turborepo.com/schema.json",
|
||||||
|
"ui": "tui",
|
||||||
|
"tasks": {
|
||||||
|
"build": {
|
||||||
|
"dependsOn": ["^build"],
|
||||||
|
"inputs": ["$TURBO_DEFAULT$", ".env*"],
|
||||||
|
"outputs": [".svelte-kit/**", ".vercel/**"]
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"dependsOn": ["^lint"]
|
||||||
|
},
|
||||||
|
"check-types": {
|
||||||
|
"dependsOn": ["^check-types"]
|
||||||
|
},
|
||||||
|
"dev": {
|
||||||
|
"cache": false,
|
||||||
|
"persistent": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user