This commit is contained in:
parent
c4fa06d3e7
commit
49e49166bd
10 changed files with 71 additions and 32 deletions
41
.forgejo/workflows/deploy.yml
Normal file
41
.forgejo/workflows/deploy.yml
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
name: Docs
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: pages
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: node22
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: pnpm/action-setup@v2
|
||||||
|
- name: Setup
|
||||||
|
run: |
|
||||||
|
echo "VITE_API_ID=${{ secrets.API_ID }}" >> .env
|
||||||
|
echo "VITE_API_HASH=${{ secrets.API_HASH }}" >> .env
|
||||||
|
echo "VITE_IFRAME_URL=https://mtcute-repl-iframe.pages.dev" >> .env
|
||||||
|
echo "VITE_HOST_ORIGIN=https://play.mtcute.dev" >> .env
|
||||||
|
|
||||||
|
echo "ignore-workspace-root-check=true" >> .npmrc
|
||||||
|
|
||||||
|
pnpm install
|
||||||
|
- name: Build
|
||||||
|
run: pnpm run build
|
||||||
|
- name: Deploy (mtcute-repl)
|
||||||
|
uses: https://github.com/cloudflare/wrangler-action@v3
|
||||||
|
with:
|
||||||
|
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
|
||||||
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
|
command: pages deploy packages/repl/dist --project-name=mtcute-repl
|
||||||
|
- name: Deploy (mtcute-repl-iframe)
|
||||||
|
uses: https://github.com/cloudflare/wrangler-action@v3
|
||||||
|
with:
|
||||||
|
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
|
||||||
|
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||||
|
command: pages deploy packages/worker/dist --project-name=mtcute-repl-iframe
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -26,3 +26,4 @@ dist-ssr
|
||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
*.tsbuildinfo
|
|
@ -5,7 +5,8 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@9.5.0",
|
"packageManager": "pnpm@9.5.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "pnpm -r --parallel dev"
|
"dev": "pnpm -r --parallel dev",
|
||||||
|
"build": "tsc -b && pnpm -r build"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@antfu/eslint-config": "^3.13.0",
|
"@antfu/eslint-config": "^3.13.0",
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
"packageManager": "pnpm@9.5.0",
|
"packageManager": "pnpm@9.5.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc -b && vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -15,7 +15,7 @@
|
||||||
"@fuman/io": "0.0.8",
|
"@fuman/io": "0.0.8",
|
||||||
"@fuman/utils": "0.0.4",
|
"@fuman/utils": "0.0.4",
|
||||||
"@kobalte/core": "^0.13.7",
|
"@kobalte/core": "^0.13.7",
|
||||||
"@mtcute/convert": "^0.19.4",
|
"@mtcute/convert": "^0.19.8",
|
||||||
"@mtcute/web": "^0.19.5",
|
"@mtcute/web": "^0.19.5",
|
||||||
"@nanostores/persistent": "^0.10.2",
|
"@nanostores/persistent": "^0.10.2",
|
||||||
"class-variance-authority": "^0.7.1",
|
"class-variance-authority": "^0.7.1",
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
import { createSignal } from 'solid-js'
|
|
||||||
|
|
||||||
export function Actions(props: {
|
|
||||||
class?: string
|
|
||||||
devtoolsIframe: HTMLIFrameElement | undefined
|
|
||||||
}) {
|
|
||||||
const [running, setRunning] = createSignal(false)
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div class={props.class}>
|
|
||||||
|
|
||||||
{/* <iframe
|
|
||||||
ref={setRunnerIframe}
|
|
||||||
src="about:blank"
|
|
||||||
class="size-full"
|
|
||||||
/> */}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
|
@ -15,6 +15,11 @@ export default defineConfig((env): UserConfig => {
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
exclude: ['@mtcute/wasm'],
|
exclude: ['@mtcute/wasm'],
|
||||||
},
|
},
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
external: ['node:fs/promises', 'node:crypto'],
|
||||||
|
},
|
||||||
|
},
|
||||||
server: {
|
server: {
|
||||||
port: 3000,
|
port: 3000,
|
||||||
},
|
},
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc -b && vite build",
|
"build": "vite build",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
"@fuman/fetch": "^0.0.8",
|
"@fuman/fetch": "^0.0.8",
|
||||||
"@fuman/io": "0.0.8",
|
"@fuman/io": "0.0.8",
|
||||||
"@fuman/utils": "0.0.4",
|
"@fuman/utils": "0.0.4",
|
||||||
"@mtcute/convert": "^0.19.4",
|
"@mtcute/convert": "^0.19.8",
|
||||||
"@mtcute/web": "^0.19.5",
|
"@mtcute/web": "^0.19.5",
|
||||||
"@nanostores/persistent": "^0.10.2",
|
"@nanostores/persistent": "^0.10.2",
|
||||||
"fflate": "^0.8.2",
|
"fflate": "^0.8.2",
|
||||||
|
|
|
@ -6,7 +6,7 @@ import { clearCache, forgetScript, handleRuntimeRequest, uploadScript } from './
|
||||||
|
|
||||||
declare const self: ServiceWorkerGlobalScope
|
declare const self: ServiceWorkerGlobalScope
|
||||||
|
|
||||||
async function handleSwRequest(req: Request, url: URL): Promise<Response> {
|
async function handleSwRequest(_req: Request, url: URL): Promise<Response> {
|
||||||
if (url.pathname.startsWith('/sw/avatar/')) {
|
if (url.pathname.startsWith('/sw/avatar/')) {
|
||||||
const accountId = url.pathname.split('/')[3]
|
const accountId = url.pathname.split('/')[3]
|
||||||
return handleAvatarRequest(accountId)
|
return handleAvatarRequest(accountId)
|
||||||
|
|
|
@ -17,6 +17,11 @@ export default defineConfig((env): UserConfig => {
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
exclude: ['@mtcute/wasm'],
|
exclude: ['@mtcute/wasm'],
|
||||||
},
|
},
|
||||||
|
build: {
|
||||||
|
rollupOptions: {
|
||||||
|
external: ['node:fs/promises', 'node:crypto'],
|
||||||
|
},
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
externalizeDeps({
|
externalizeDeps({
|
||||||
externals: [],
|
externals: [],
|
||||||
|
|
|
@ -72,8 +72,8 @@ importers:
|
||||||
specifier: ^0.13.7
|
specifier: ^0.13.7
|
||||||
version: 0.13.7(solid-js@1.9.4)
|
version: 0.13.7(solid-js@1.9.4)
|
||||||
'@mtcute/convert':
|
'@mtcute/convert':
|
||||||
specifier: ^0.19.4
|
specifier: ^0.19.8
|
||||||
version: 0.19.4
|
version: 0.19.8
|
||||||
'@mtcute/web':
|
'@mtcute/web':
|
||||||
specifier: ^0.19.5
|
specifier: ^0.19.5
|
||||||
version: 0.19.5
|
version: 0.19.5
|
||||||
|
@ -166,8 +166,8 @@ importers:
|
||||||
specifier: 0.0.4
|
specifier: 0.0.4
|
||||||
version: 0.0.4
|
version: 0.0.4
|
||||||
'@mtcute/convert':
|
'@mtcute/convert':
|
||||||
specifier: ^0.19.4
|
specifier: ^0.19.8
|
||||||
version: 0.19.4
|
version: 0.19.8
|
||||||
'@mtcute/web':
|
'@mtcute/web':
|
||||||
specifier: ^0.19.5
|
specifier: ^0.19.5
|
||||||
version: 0.19.5
|
version: 0.19.5
|
||||||
|
@ -793,8 +793,13 @@ packages:
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
solid-js: ^1.8.8
|
solid-js: ^1.8.8
|
||||||
|
|
||||||
'@mtcute/convert@0.19.4':
|
'@mtcute/convert@0.19.8':
|
||||||
resolution: {integrity: sha512-Elqomoif50GMYhjt03kp4iOuQcK8elSlKPfS9gRnY5weAJxhHU6rcc+Qa+OZdnLSNoFRf0vjf0ZZNGvb4f2mmA==}
|
resolution: {integrity: sha512-lk3MG3mBIof/cVZ0cMCdQ+gBSgDHURNWzMO3KM/xvd5wCrKUkUMXoPYs4GWP/+BwFq0EBJw5DcpKMWR+0vP7nA==}
|
||||||
|
peerDependencies:
|
||||||
|
'@mtcute/node': ^0.19.3
|
||||||
|
peerDependenciesMeta:
|
||||||
|
'@mtcute/node':
|
||||||
|
optional: true
|
||||||
|
|
||||||
'@mtcute/core@0.19.6':
|
'@mtcute/core@0.19.6':
|
||||||
resolution: {integrity: sha512-cBm8kdZglHm40nksF2wXn5RkKzlyo+9iJKi/mTk2fRRfCBgUSuP5f7l5OqA7HaJcwVRtbB46k9BLKs2H/jqhZg==}
|
resolution: {integrity: sha512-cBm8kdZglHm40nksF2wXn5RkKzlyo+9iJKi/mTk2fRRfCBgUSuP5f7l5OqA7HaJcwVRtbB46k9BLKs2H/jqhZg==}
|
||||||
|
@ -3265,7 +3270,7 @@ snapshots:
|
||||||
'@solid-primitives/utils': 6.2.3(solid-js@1.9.4)
|
'@solid-primitives/utils': 6.2.3(solid-js@1.9.4)
|
||||||
solid-js: 1.9.4
|
solid-js: 1.9.4
|
||||||
|
|
||||||
'@mtcute/convert@0.19.4':
|
'@mtcute/convert@0.19.8':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@fuman/io': 0.0.8
|
'@fuman/io': 0.0.8
|
||||||
'@fuman/net': 0.0.9
|
'@fuman/net': 0.0.9
|
||||||
|
|
Loading…
Reference in a new issue