Archived
init
This commit is contained in:
@@ -5,10 +5,13 @@ jsxSingleQuote: false
|
||||
semi: false
|
||||
arrowParens: avoid
|
||||
endOfLine: auto
|
||||
overrides:
|
||||
- files: "*.{css,sass,scss}"
|
||||
options:
|
||||
tabWidth: 2
|
||||
plugins:
|
||||
- prettier-plugin-tailwindcss
|
||||
parser: typescript
|
||||
- prettier-plugin-svelte
|
||||
overrides:
|
||||
- files: '*.{css,sass,scss}'
|
||||
options:
|
||||
tabWidth: 2
|
||||
parser: scss
|
||||
- files: '*.svelte'
|
||||
options:
|
||||
parser: 'svelte'
|
||||
|
||||
@@ -14,8 +14,8 @@ Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also pow
|
||||
|
||||
**Why use this over SvelteKit?**
|
||||
|
||||
- It brings its own routing solution which might not be preferable for some users.
|
||||
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.
|
||||
- It brings its own routing solution which might not be preferable for some users.
|
||||
- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app.
|
||||
|
||||
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.
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Svelte 5 Demo</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Svelte 5 Demo</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/main.ts"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+50
-50
@@ -1,53 +1,53 @@
|
||||
{
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview",
|
||||
"lint": "eslint --c .eslintrc.yaml src",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json && tsc -p tsconfig.node.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@rage-fw/shared": "workspace:^",
|
||||
"@entityseven/rage-fw-rpc": "0.2.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.6",
|
||||
"@tsconfig/svelte": "^5.0.4",
|
||||
"@types/node": "^22.5.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.2.0",
|
||||
"@typescript-eslint/parser": "^8.2.0",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"eslint": "^9.3.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"globals": "^15.9.0",
|
||||
"prettier": "^3.3.3",
|
||||
"prettier-plugin-svelte": "^3.2.6",
|
||||
"svelte": "5.1.3",
|
||||
"svelte-check": "^3.8.5",
|
||||
"tslib": "^2.6.3",
|
||||
"typescript": "^5.5.3",
|
||||
"typescript-eslint": "^8.2.0",
|
||||
"vite": "^5.4.1"
|
||||
},
|
||||
"name": "src-web",
|
||||
"private": true,
|
||||
"homepage": ".",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"preview": "vite preview",
|
||||
"lint": "eslint --c .eslintrc.yaml src",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json && tsc -p tsconfig.node.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@entityseven/rage-fw-browser": "0.2.0",
|
||||
"@rage-fw/shared": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^4.0.0-next.6",
|
||||
"@tsconfig/svelte": "^5.0.4",
|
||||
"@types/node": "^22.5.0",
|
||||
"@typescript-eslint/eslint-plugin": "^8.2.0",
|
||||
"@typescript-eslint/parser": "^8.2.0",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"eslint": "^9.3.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"eslint-plugin-prettier": "^5.2.1",
|
||||
"globals": "^15.9.0",
|
||||
"prettier": "^3.3.3",
|
||||
"prettier-plugin-svelte": "^3.3.3",
|
||||
"svelte": "5.1.3",
|
||||
"svelte-check": "^3.8.5",
|
||||
"tslib": "^2.6.3",
|
||||
"typescript": "^5.5.3",
|
||||
"typescript-eslint": "^8.2.0",
|
||||
"vite": "^5.4.1"
|
||||
},
|
||||
"name": "src-web",
|
||||
"private": true,
|
||||
"homepage": ".",
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"browserslist": {
|
||||
"production": [
|
||||
">0.2%",
|
||||
"not dead",
|
||||
"not op_mini all"
|
||||
],
|
||||
"development": [
|
||||
"last 1 chrome version",
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"trustedDependencies": [
|
||||
"svelte-preprocess"
|
||||
]
|
||||
},
|
||||
"trustedDependencies": [
|
||||
"svelte-preprocess"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,20 +1,24 @@
|
||||
<script lang="ts">
|
||||
import { fw } from '@entityseven/rage-fw-browser'
|
||||
import type { RageFW_ICustomBrowserEvent } from '@entityseven/rage-fw-shared-types'
|
||||
import { onMount } from 'svelte'
|
||||
import { events } from '@rage-fw/shared'
|
||||
import { rpc } from '@/lib'
|
||||
|
||||
let data = $state<string>('')
|
||||
let data =
|
||||
$state<ReturnType<RageFW_ICustomBrowserEvent['customBrowserEvent']>>()
|
||||
|
||||
onMount(() => {
|
||||
rpc.register(events.browser.customBrowserEvent, (args: string) => {
|
||||
data = data + ' | ' + args
|
||||
return 'response from cef'
|
||||
})
|
||||
rpc.callClient(events.client.cefReady, ['hello from cef'])
|
||||
try {
|
||||
fw.event.register('customBrowserEvent', async greeting => {
|
||||
data += greeting
|
||||
return 'from cef'
|
||||
})
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<div style="width: '100%';color: 'white';text-align: 'center'">
|
||||
<h1>Hello World!</h1>
|
||||
<h2>{data}</h2>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import { Rpc } from '@entityseven/rage-fw-rpc'
|
||||
|
||||
export const rpc = new Rpc({
|
||||
debugLogs: true,
|
||||
})
|
||||
+29
-28
@@ -1,32 +1,33 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"useDefineForClassFields": true,
|
||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||
"module": "ESNext",
|
||||
"skipLibCheck": true,
|
||||
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
/* Bundler mode */
|
||||
"moduleResolution": "bundler",
|
||||
"allowImportingTsExtensions": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx",
|
||||
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"types": [
|
||||
"../../node_modules/@ragempcommunity/types-cef",
|
||||
],
|
||||
"paths": {
|
||||
"@": ["./src"],
|
||||
"@/*": ["./src/*"],
|
||||
}
|
||||
},
|
||||
"include": ["src"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
/* Linting */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"types": [
|
||||
"../../node_modules/@ragempcommunity/types-cef",
|
||||
"../shared/declarations/rage-fw-shared-types/"
|
||||
],
|
||||
"paths": {
|
||||
"@": ["./src"],
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src"],
|
||||
"references": [{ "path": "./tsconfig.node.json" }]
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
// "noEmit": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "bundler",
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo"
|
||||
},
|
||||
"include": ["vite.config.ts"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user