Skip to content

Commit 7d3659e

Browse files
committed
fix: rollback sdk to v3.25.1
1 parent f6d6aa7 commit 7d3659e

35 files changed

+396
-1953
lines changed

.github/workflows/release.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,6 @@ jobs:
7676
env:
7777
KIT: ${{ env.kit_path }}
7878

79-
# - name: Script Kit run test-ts John
80-
# id: test-script-ts
81-
# shell: bash
82-
# run: |
83-
# export KENV=${{ env.wd_path }}
84-
# export KENV_PREFIX=$KENV/scripts
85-
# export KIT=${{ env.kit_path }}
86-
# cd ${{ env.wd_path }}
87-
# pnpm node --experimental-loader "$KIT/build/loader.js" "$KIT/run/github-workflow.js" test-ts John
88-
# - run: |
89-
# [ "${{ steps.test-script-ts.outputs.result }}" != "John" ] && exit 1
90-
# [ "${{ steps.test-script-ts.outputs.result }}" = "John" ] && echo "Passed 🎉"
91-
9279
test-mac-and-ubuntu:
9380
strategy:
9481
matrix:
@@ -201,18 +188,6 @@ jobs:
201188
env:
202189
KIT: ${{ env.kit_path }}
203190

204-
# - name: Script Kit run test-ts John
205-
# id: test-script-ts
206-
# run: |
207-
# export KENV=${{ env.wd_path }}
208-
# export KENV_PREFIX=$KENV/scripts
209-
# export KIT=${{ env.kit_path }}
210-
# cd ${{ env.wd_path }}
211-
# pnpm node --experimental-loader "$KIT/build/loader.js" "$KIT/run/github-workflow.js" test-ts John
212-
# - run: |
213-
# [ "${{ steps.test-script-ts.outputs.result }}" != "John" ] && exit 1
214-
# [ "${{ steps.test-script-ts.outputs.result }}" = "John" ] && echo "Passed 🎉"
215-
216191
release:
217192
runs-on: macos-latest
218193
needs: [test-windows, test-mac-and-ubuntu]

build/build-kit.ts

Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -357,43 +357,30 @@ if (packageJsonChanged) {
357357
}
358358
}
359359

360-
console.log('Checking network connectivity...')
361-
const { checkOnline } = await import('./check-online')
362-
const isOnline = await checkOnline()
360+
console.log('Download docs')
361+
await ensureDir(kitPath('data'))
362+
console.log('Created data directory')
363+
const { default: download } = await import('./download')
364+
console.log('Imported download module')
363365

364-
if (!isOnline) {
365-
console.warn('⚠️ No internet connection detected. Skipping downloads of docs.json and hot.json.')
366-
console.warn(' You can manually download these files later when online.')
367-
} else {
368-
console.log('Download docs')
369-
await ensureDir(kitPath('data'))
370-
console.log('Created data directory')
371-
const { default: download } = await import('./download')
372-
console.log('Imported download module')
373-
374-
try {
375-
console.log('Downloading docs.json...')
376-
const docsBuffer = await download('https://www.scriptkit.com/data/docs.json', { timeout: 10000 })
377-
console.log('Writing docs.json to disk...')
378-
await writeFile(kitPath('data', 'docs.json'), docsBuffer)
379-
console.log('docs.json downloaded and saved successfully')
380-
} catch (e) {
381-
console.warn('Warning: Could not download docs.json. This may be due to firewall restrictions.')
382-
console.warn('The build will continue without docs.json. You can manually download it later.')
383-
console.warn('Error details:', e instanceof Error ? e.message : e)
384-
}
366+
try {
367+
console.log('Downloading docs.json...')
368+
const docsBuffer = await download('https://www.scriptkit.com/data/docs.json')
369+
console.log('Writing docs.json to disk...')
370+
await writeFile(kitPath('data', 'docs.json'), docsBuffer)
371+
console.log('docs.json downloaded and saved successfully')
372+
} catch (e) {
373+
console.error('Error downloading docs.json:', e)
374+
}
385375

386-
try {
387-
console.log('Downloading hot.json...')
388-
const hotBuffer = await download('https://www.scriptkit.com/data/hot.json', { timeout: 10000 })
389-
console.log('Writing hot.json to disk...')
390-
await writeFile(kitPath('data', 'hot.json'), hotBuffer)
391-
console.log('hot.json downloaded and saved successfully')
392-
} catch (e) {
393-
console.warn('Warning: Could not download hot.json. This may be due to firewall restrictions.')
394-
console.warn('The build will continue without hot.json. You can manually download it later.')
395-
console.warn('Error details:', e instanceof Error ? e.message : e)
396-
}
376+
try {
377+
console.log('Downloading hot.json...')
378+
const hotBuffer = await download('https://www.scriptkit.com/data/hot.json')
379+
console.log('Writing hot.json to disk...')
380+
await writeFile(kitPath('data', 'hot.json'), hotBuffer)
381+
console.log('hot.json downloaded and saved successfully')
382+
} catch (e) {
383+
console.error('Error downloading hot.json:', e)
397384
}
398385

399386
console.log('Writing .kitignore file...')

build/check-online.ts

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

build/download.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ interface DownloadOptions {
77
rejectUnauthorized?: boolean
88
/** Maximum number of redirects to follow. Defaults to 5. */
99
maxRedirects?: number
10-
/** Request timeout in milliseconds. Defaults to 10000 (10 seconds). */
11-
timeout?: number
1210
}
1311

1412
/**
@@ -26,7 +24,7 @@ interface DownloadOptions {
2624
* ```
2725
*/
2826
const download = (uri: string, opts: DownloadOptions = {}): Promise<Buffer> => {
29-
const { maxRedirects = 5, timeout = 10000 } = opts
27+
const { maxRedirects = 5 } = opts
3028

3129
const followRedirect = (url: string, redirectCount = 0): Promise<Buffer> => {
3230
console.log(`Downloading ${url}`)
@@ -35,13 +33,12 @@ const download = (uri: string, opts: DownloadOptions = {}): Promise<Buffer> => {
3533
...opts,
3634
headers: {
3735
"User-Agent": "Node.js"
38-
},
39-
timeout
36+
}
4037
}
4138

4239
return new Promise((resolve, reject) => {
4340
const protocol = url.startsWith("https:") ? https : http
44-
const request = protocol
41+
protocol
4542
.get(url, options, (res) => {
4643
if (
4744
res.statusCode &&
@@ -74,10 +71,6 @@ const download = (uri: string, opts: DownloadOptions = {}): Promise<Buffer> => {
7471
})
7572
})
7673
.on("error", reject)
77-
.on("timeout", () => {
78-
request.destroy()
79-
reject(new Error(`Request timeout after ${timeout}ms`))
80-
})
8174
})
8275
}
8376

orientation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Script Kit API Orientation Documents (Auto-Generated)
1+
# Script Kit API Orientation Documents
22

33
This directory contains comprehensive orientation documents for Script Kit APIs. Each document follows a systematic approach to explain how the API works internally, from SDK implementation through to system integration.
44

orientation/form.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
The `form` API creates multi-field HTML forms for structured data input. It provides a flexible way to collect complex user input through standard HTML form elements that are rendered in the Script Kit Electron app.
55

66
## Main Function Definition
7-
Located in `sdk/src/target/app.ts`:
7+
Located in `/workspace/sdk/src/target/app.ts`:
88

99
```typescript
1010
global.form = async (
@@ -120,17 +120,17 @@ let result = await form({
120120

121121
### Form Rendering Process
122122

123-
1. **SDK Side** (`sdk/src/target/app.ts:1517`):
123+
1. **SDK Side** (`/workspace/sdk/src/target/app.ts:1517`):
124124
- `global.form` creates a PromptConfig with `ui: UI.form`
125125
- Sends configuration to app via `kitPrompt`
126126
- Automatically sets enter button text to "Submit" if not specified
127127

128-
2. **Main Process** (`app/src/main/messages.ts`):
128+
2. **Main Process** (`/workspace/app/src/main/messages.ts`):
129129
- `SET_FORM` handler receives form configuration and forwards to renderer
130130
- `SET_FORM_DATA` updates form field values dynamically
131131
- Previously had `SET_FORM_HTML` (now commented out)
132132

133-
3. **Renderer Process** (`app/src/renderer/src/components/form.tsx`):
133+
3. **Renderer Process** (`/workspace/app/src/renderer/src/components/form.tsx`):
134134
- React component that renders the form HTML using `html-react-parser`
135135
- Manages form state through Jotai atoms:
136136
- `formHTMLAtom` - Stores the HTML string
@@ -141,7 +141,7 @@ let result = await form({
141141
- Enter key (when submit button exists)
142142
- Cmd/Ctrl+S or Cmd/Ctrl+Enter keyboard shortcuts
143143

144-
4. **Form HTML Processing** (`app/src/renderer/src/utils/state-utils.ts:122`):
144+
4. **Form HTML Processing** (`/workspace/app/src/renderer/src/utils/state-utils.ts:122`):
145145
- `ensureFormHasSubmit` function automatically adds a hidden submit button if none exists
146146
- Ensures forms can always be submitted via keyboard
147147

@@ -201,7 +201,7 @@ Forms use Jotai atoms for state management:
201201
To analyze the complete form implementation, use:
202202

203203
```bash
204-
repomix --include "sdk/src/target/app.ts,app/src/renderer/src/components/form.tsx,app/src/main/messages.ts,app/src/renderer/src/jotai.ts,app/src/renderer/src/utils/state-utils.ts,sdk/orientation/form.md"
204+
repomix --include "/workspace/sdk/src/target/app.ts" "/workspace/app/src/renderer/src/components/form.tsx" "/workspace/app/src/main/messages.ts" "/workspace/app/src/renderer/src/jotai.ts" "/workspace/app/src/renderer/src/utils/state-utils.ts"
205205
```
206206

207207
This will generate a comprehensive report of all form-related implementation files.

package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@
7777
}
7878
},
7979
"dependencies": {
80-
"@actions/core": "1.11.1",
81-
"@actions/github": "6.0.1",
8280
"@ai-sdk/anthropic": "1.2.12",
8381
"@ai-sdk/google": "1.2.19",
8482
"@ai-sdk/openai": "^1.3.22",
@@ -133,8 +131,6 @@
133131
"p-retry": "6.2.1",
134132
"project-name-generator": "2.1.9",
135133
"quick-score": "^0.2.0",
136-
"react": "^19.1.0",
137-
"react-dom": "^19.1.0",
138134
"replace-in-file": "8.3.0",
139135
"rimraf": "6.0.1",
140136
"safe-stable-stringify": "^2.5.0",
@@ -151,8 +147,6 @@
151147
"@types/debug": "4.1.12",
152148
"@types/node": "^22.15.30",
153149
"@types/node-ipc": "9.2.3",
154-
"@types/react": "19.1.8",
155-
"@types/react-dom": "19.1.6",
156150
"@types/sinon": "17.0.4",
157151
"acorn-walk": "8.3.4",
158152
"ava": "^6.4.0",

0 commit comments

Comments
 (0)