super-svelte-skeleton 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +17 -0
- package/.github/workflows/ninja_i18n.yml +23 -0
- package/.prettierignore +9 -0
- package/.prettierrc +12 -0
- package/.vscode/extensions.json +5 -0
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +30 -0
- package/README.md +237 -0
- package/_gitignore +27 -0
- package/eslint.config.js +40 -0
- package/messages/ar.json +70 -0
- package/messages/en.json +70 -0
- package/messages/es.json +70 -0
- package/package.json +54 -0
- package/project.inlang/settings.json +15 -0
- package/src/app.css +8 -0
- package/src/app.d.ts +20 -0
- package/src/app.html +40 -0
- package/src/auto-imports.d.ts +35 -0
- package/src/hooks.client.ts +17 -0
- package/src/hooks.server.ts +73 -0
- package/src/hooks.ts +15 -0
- package/src/lib/entities/auth/api/endpoints.ts +11 -0
- package/src/lib/entities/auth/api/service.ts +35 -0
- package/src/lib/entities/auth/index.ts +9 -0
- package/src/lib/entities/auth/store.svelte.ts +50 -0
- package/src/lib/entities/auth/types.ts +33 -0
- package/src/lib/entities/user/api/endpoints.ts +6 -0
- package/src/lib/entities/user/api/service.ts +10 -0
- package/src/lib/entities/user/index.ts +2 -0
- package/src/lib/entities/user/types.ts +18 -0
- package/src/lib/features/theme-editor/constants.ts +33 -0
- package/src/lib/features/theme-editor/index.ts +3 -0
- package/src/lib/features/theme-editor/types.ts +10 -0
- package/src/lib/features/theme-editor/ui/CSSOutput.svelte +17 -0
- package/src/lib/features/theme-editor/ui/ColorCard.svelte +66 -0
- package/src/lib/features/theme-editor/ui/ThemeEditorWidget.svelte +319 -0
- package/src/lib/features/theme-editor/ui/ThemePreview.svelte +121 -0
- package/src/lib/features/theme-editor/ui/TypographySettings.svelte +73 -0
- package/src/lib/features/theme-editor/utils.ts +10 -0
- package/src/lib/shared/api/client.ts +47 -0
- package/src/lib/shared/api/index.ts +3 -0
- package/src/lib/shared/api/types.ts +25 -0
- package/src/lib/shared/config/api.ts +1 -0
- package/src/lib/shared/config/index.ts +2 -0
- package/src/lib/shared/config/routes.ts +18 -0
- package/src/lib/shared/i18n/index.ts +1 -0
- package/src/lib/shared/index.ts +2 -0
- package/src/lib/tailwind.config.ts +28 -0
- package/src/lib/widgets/topbar/Topbar.svelte +122 -0
- package/src/lib/widgets/topbar/constants.ts +16 -0
- package/src/lib/widgets/topbar/index.ts +2 -0
- package/src/params/integer.ts +5 -0
- package/src/routes/(app)/(admin)/+layout.server.ts +14 -0
- package/src/routes/(app)/(admin)/admin/+page.svelte +101 -0
- package/src/routes/(app)/+layout.server.ts +9 -0
- package/src/routes/(app)/+layout.svelte +12 -0
- package/src/routes/(app)/settings/+page.svelte +48 -0
- package/src/routes/(app)/theme/+page.svelte +5 -0
- package/src/routes/(auth)/forgot-password/+page.svelte +83 -0
- package/src/routes/(auth)/login/+page.server.ts +66 -0
- package/src/routes/(auth)/login/+page.svelte +156 -0
- package/src/routes/(auth)/logout/+page.server.ts +16 -0
- package/src/routes/(auth)/register/+page.svelte +167 -0
- package/src/routes/(auth)/reset-password/+page.svelte +127 -0
- package/src/routes/+error.svelte +95 -0
- package/src/routes/+layout.svelte +36 -0
- package/src/routes/+layout.ts +24 -0
- package/src/routes/+page.svelte +192 -0
- package/src/routes/+page.ts +3 -0
- package/static/config/config.local.json +3 -0
- package/static/config/config.prod.json +3 -0
- package/static/favicon.svg +1 -0
- package/static/logo.svg +7 -0
- package/static/profile.avif +0 -0
- package/static/smile.jpg +0 -0
- package/static/styles/theme-dark.css +30 -0
- package/static/styles/theme-light.css +28 -0
- package/stats.html +4950 -0
- package/svelte.config.js +78 -0
- package/tsconfig.json +46 -0
- package/vite.config.ts +51 -0
package/svelte.config.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import adapter from '@sveltejs/adapter-node';
|
|
2
|
+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
|
3
|
+
import { loadEnv } from 'vite';
|
|
4
|
+
|
|
5
|
+
// Load environment variables based on NODE_ENV or default to 'development'
|
|
6
|
+
const mode = process.env.NODE_ENV || 'development';
|
|
7
|
+
const env = loadEnv(mode, process.cwd(), 'PUBLIC_');// Only load variables that start with PUBLIC_ to avoid exposing sensitive data
|
|
8
|
+
|
|
9
|
+
/** @type {import('@sveltejs/kit').Config} */
|
|
10
|
+
const config = {
|
|
11
|
+
// ---------------------------------------------------------
|
|
12
|
+
// PREPROCESSORS
|
|
13
|
+
// ---------------------------------------------------------
|
|
14
|
+
|
|
15
|
+
// Enables TypeScript, PostCSS, and things like Tailwind inside .svelte files.
|
|
16
|
+
// Without this, SvelteKit won't understand <script lang="ts"> or Tailwind classes.
|
|
17
|
+
preprocess: vitePreprocess(),
|
|
18
|
+
|
|
19
|
+
// Click element in browser → jump to source file
|
|
20
|
+
vitePlugin: {
|
|
21
|
+
inspector: true
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
kit: {
|
|
25
|
+
// -----------------------------------------------------
|
|
26
|
+
// ADAPTER
|
|
27
|
+
// -----------------------------------------------------
|
|
28
|
+
|
|
29
|
+
// adapter-node builds your app into a Node.js server.
|
|
30
|
+
// Use this when deploying to a VPS, Docker, or any Node environment.
|
|
31
|
+
// precompress: false → You handle gzip/brotli compression yourself (e.g., Cloudflare).
|
|
32
|
+
adapter: adapter({ precompress: false }),
|
|
33
|
+
|
|
34
|
+
// Allows deploying your app under a subfolder.
|
|
35
|
+
// Example: https://example.com/myapp → base = '/myapp'
|
|
36
|
+
paths: {
|
|
37
|
+
base: /** @type {'' | `/${string}`} */ (env.PUBLIC_BASE_PATH || '')
|
|
38
|
+
},
|
|
39
|
+
// Lets you write: import Button from '$components/Button.svelte'
|
|
40
|
+
// instead of: import Button from '../../../lib/components/Button.svelte'
|
|
41
|
+
alias: {
|
|
42
|
+
// ── FSD Layers ──────────────────────────────────────────────
|
|
43
|
+
$shared: 'src/lib/shared', // HTTP client, i18n, global constants
|
|
44
|
+
$entities: 'src/lib/entities', // Business domains: auth, user, config
|
|
45
|
+
$features: 'src/lib/features', // User-interaction slices: theme-editor, etc.
|
|
46
|
+
$widgets: 'src/lib/widgets', // Composite UI blocks: Topbar, Sidebar, etc.
|
|
47
|
+
// ── Kept as-is ──────────────────────────────────────────────
|
|
48
|
+
$paraglide: 'src/lib/paraglide', // Auto-generated i18n (do not edit manually)
|
|
49
|
+
$styles: 'src/lib/styles',
|
|
50
|
+
$server: 'src/lib/server',
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
// CSP (Content Security Policy) helps prevent XSS attacks.
|
|
54
|
+
// mode: 'auto' → SvelteKit automatically adds safe nonces to inline scripts.
|
|
55
|
+
csp: { mode: 'auto' },
|
|
56
|
+
|
|
57
|
+
// -----------------------------------------------------
|
|
58
|
+
// PERFORMANCE
|
|
59
|
+
// -----------------------------------------------------
|
|
60
|
+
|
|
61
|
+
// Splits your JS into smaller chunks per route.
|
|
62
|
+
// This reduces initial load time for large apps.
|
|
63
|
+
output: { bundleStrategy: 'split' },
|
|
64
|
+
|
|
65
|
+
version: {
|
|
66
|
+
// Uses a timestamp as the version string.
|
|
67
|
+
// Ensures the version changes every build → browser knows to refresh.
|
|
68
|
+
name: Date.now().toString(),
|
|
69
|
+
|
|
70
|
+
// How often the browser checks the server for a new version (in ms).
|
|
71
|
+
// 600,000 ms = 10 minutes.
|
|
72
|
+
// Lower this if you want faster auto-updates.
|
|
73
|
+
pollInterval: 600_000
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default config;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./.svelte-kit/tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"types": ["svelte", "node"],
|
|
5
|
+
"rewriteRelativeImportExtensions": true,
|
|
6
|
+
"target": "ESNext",
|
|
7
|
+
"module": "ESNext",
|
|
8
|
+
"moduleResolution": "Bundler",
|
|
9
|
+
"lib": [
|
|
10
|
+
"ESNext",
|
|
11
|
+
"DOM",
|
|
12
|
+
"DOM.Iterable"
|
|
13
|
+
],
|
|
14
|
+
"strict": true,
|
|
15
|
+
"noUnusedLocals": true,
|
|
16
|
+
"noUnusedParameters": true,
|
|
17
|
+
"noUncheckedIndexedAccess": true,
|
|
18
|
+
"exactOptionalPropertyTypes": true,
|
|
19
|
+
"verbatimModuleSyntax": true,
|
|
20
|
+
"isolatedModules": true,
|
|
21
|
+
"allowSyntheticDefaultImports": true,
|
|
22
|
+
"checkJs": true,
|
|
23
|
+
"esModuleInterop": true,
|
|
24
|
+
"forceConsistentCasingInFileNames": true,
|
|
25
|
+
"skipLibCheck": true,
|
|
26
|
+
"sourceMap": true,
|
|
27
|
+
"resolveJsonModule": true,
|
|
28
|
+
"allowJs": true
|
|
29
|
+
},
|
|
30
|
+
"include": [
|
|
31
|
+
".svelte-kit/ambient.d.ts",
|
|
32
|
+
".svelte-kit/env.d.ts",
|
|
33
|
+
"src/**/*.ts",
|
|
34
|
+
"src/**/*.d.ts",
|
|
35
|
+
"src/**/*.svelte",
|
|
36
|
+
"tests/**/*.ts",
|
|
37
|
+
"vite.config.ts",
|
|
38
|
+
"svelte.config.js"
|
|
39
|
+
],
|
|
40
|
+
"exclude": [
|
|
41
|
+
"node_modules",
|
|
42
|
+
".svelte-kit",
|
|
43
|
+
"dist",
|
|
44
|
+
"build"
|
|
45
|
+
]
|
|
46
|
+
}
|
package/vite.config.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { paraglideVitePlugin } from '@inlang/paraglide-js';
|
|
2
|
+
import tailwindcss from '@tailwindcss/vite';
|
|
3
|
+
import { sveltekit } from '@sveltejs/kit/vite';
|
|
4
|
+
import { defineConfig } from 'vite';
|
|
5
|
+
import AutoImport from 'unplugin-auto-import/vite';
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
plugins: [
|
|
9
|
+
// Enables TailwindCSS inside Vite
|
|
10
|
+
tailwindcss(),
|
|
11
|
+
|
|
12
|
+
// Auto-import plugin (no need to manually import onMount, writable, goto, etc.)
|
|
13
|
+
AutoImport({
|
|
14
|
+
// Which files should be scanned for auto-import usage
|
|
15
|
+
include: [
|
|
16
|
+
/\.[tj]s?$/, // JS + TS files
|
|
17
|
+
/\.svelte$/, // Svelte components
|
|
18
|
+
],
|
|
19
|
+
|
|
20
|
+
// What to auto-import
|
|
21
|
+
imports: [
|
|
22
|
+
'svelte', // onMount, beforeUpdate, afterUpdate, tick, etc.
|
|
23
|
+
'svelte/store', // writable, readable, derived
|
|
24
|
+
'svelte/transition', // fade, fly, slide, etc.
|
|
25
|
+
|
|
26
|
+
// Auto-import SvelteKit functions
|
|
27
|
+
{
|
|
28
|
+
'$app/navigation': ['goto', 'invalidate', 'invalidateAll'],
|
|
29
|
+
'@sveltejs/kit': ['redirect'],
|
|
30
|
+
}, {
|
|
31
|
+
'$lib/paraglide/messages': [
|
|
32
|
+
['*', 'm'] // import * as m from '$lib/paraglide/messages'
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
|
|
37
|
+
// Generate TypeScript definitions for auto-imported functions
|
|
38
|
+
dts: './src/auto-imports.d.ts',
|
|
39
|
+
}),
|
|
40
|
+
|
|
41
|
+
// SvelteKit plugin (must come after other Vite plugins)
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
|
+
sveltekit() as unknown as import('vite').PluginOption,
|
|
44
|
+
|
|
45
|
+
// Paraglide i18n plugin (for translations)
|
|
46
|
+
paraglideVitePlugin({
|
|
47
|
+
project: './project.inlang',
|
|
48
|
+
outdir: './src/lib/paraglide'
|
|
49
|
+
}),
|
|
50
|
+
]
|
|
51
|
+
});
|