Skip to content

Commit e3f3da1

Browse files
committed
Deploy example to github pages
1 parent b10fc60 commit e3f3da1

File tree

11 files changed

+88
-27
lines changed

11 files changed

+88
-27
lines changed

.github/workflows/page.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Deploy example page
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout Repo
13+
uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
17+
- uses: pnpm/action-setup@v4
18+
19+
- name: Setup Node.js 22
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 22.x
23+
cache: pnpm
24+
25+
- name: Install Dependencies
26+
run: pnpm install --ignore-scripts
27+
28+
- name: Cache turbo build setup
29+
uses: actions/cache@v4
30+
with:
31+
path: node_modules/.cache/turbo
32+
key: turbo-${{ github.sha }}
33+
restore-keys: |
34+
turbo-
35+
36+
- name: Build
37+
run: pnpm build
38+
39+
- name: Build site
40+
run: cd examples/sandbox && pnpm build
41+
42+
- name: Upload Pages artifact
43+
uses: actions/upload-pages-artifact@v3
44+
with:
45+
path: dist
46+
47+
deploy:
48+
needs: build
49+
runs-on: ubuntu-latest
50+
51+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
52+
permissions:
53+
pages: write # to deploy to Pages
54+
id-token: write # to verify the deployment originates from an appropriate source
55+
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
60+
steps:
61+
- name: Deploy to GitHub Pages
62+
id: deployment
63+
uses: actions/deploy-pages@v4

.github/workflows/release-ext.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ jobs:
3434
3535
- name: Build
3636
run: pnpm build
37-
env:
38-
CI: true
3937

4038
- name: Upload Extension Artifacts
4139
uses: actions/upload-artifact@v4

.github/workflows/tests.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ jobs:
4040

4141
- name: Run Build and Tests
4242
run: pnpm run build-test:packages
43-
env:
44-
CI: true
4543

4644
- name: Lint
4745
run: pnpm test:lint

examples/sandbox/env.d.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

examples/sandbox/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"dependencies": {
1717
"@solid-devtools/debugger": "workspace:^",
1818
"@solid-devtools/logger": "workspace:^",
19-
"@solid-devtools/overlay": "workspace:^",
20-
"@solid-primitives/timer": "^1.3.10"
19+
"@solid-devtools/overlay": "workspace:^"
2120
}
2221
}

examples/sandbox/src/Overlay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const DevtoolsOverlay = lazy(() => import('./DevtoolsOverlay.tsx'))
33

44
export function Overlay() {
55
return (
6-
<Show when={!process.env.EXT || process.env.BUILD}>
6+
<Show when={!import.meta.env.EXT || !import.meta.env.DEV}>
77
<DevtoolsOverlay defaultOpen noPadding />
88
</Show>
99
)

examples/sandbox/src/env.d.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
/// <reference types="vite/client" />
3+
4+
declare global {
5+
interface ImportMetaEnv {
6+
readonly EXT: boolean
7+
}
8+
9+
interface ImportMeta {
10+
readonly env: ImportMetaEnv
11+
}
12+
}
13+
14+
export {}

examples/sandbox/src/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'solid-devtools'
22

33
async function main() {
4-
if (!process.env.EXT || process.env.BUILD) {
4+
if (!import.meta.env.EXT || !import.meta.env.DEV) {
55
await import('@solid-devtools/debugger/bundled')
66
}
77

examples/sandbox/tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
22
"extends": "../../tsconfig.json",
3-
"compilerOptions": {
4-
"types": ["vite/client"]
5-
}
3+
"include": ["src/**/*"]
64
}

examples/sandbox/vite.config.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,18 @@ export default defineConfig(mode => {
2020
solid({hot: true, dev: true}),
2121
],
2222
define: {
23-
'process.env.EXT': JSON.stringify(is_ext),
24-
'process.env.BUILD': JSON.stringify(is_build),
23+
'import.meta.env.EXT': JSON.stringify(is_ext),
2524
},
2625
mode: 'development',
26+
resolve: {
27+
conditions: ['browser', 'development']
28+
},
2729
build: {
2830
target: 'esnext',
2931
minify: false,
3032
},
31-
optimizeDeps: {},
33+
optimizeDeps: {
34+
exclude: ['solid-devtools', '@solid-devtools/*']
35+
},
3236
}
3337
})

0 commit comments

Comments
 (0)