windmill-components 1.493.2 → 1.493.4
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/package.json +4 -3
- package/scripts/patch_files.js +57 -0
- package/scripts/untar_ui_builder.js +48 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "windmill-components",
|
|
3
|
-
"version": "1.493.
|
|
3
|
+
"version": "1.493.4",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build",
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"zod": "^3.24.2"
|
|
156
156
|
},
|
|
157
157
|
"peerDependencies": {
|
|
158
|
-
"svelte": "^
|
|
158
|
+
"svelte": "^5.0.0"
|
|
159
159
|
},
|
|
160
160
|
"exports": {
|
|
161
161
|
"./package.json": "./package.json",
|
|
@@ -379,7 +379,8 @@
|
|
|
379
379
|
},
|
|
380
380
|
"files": [
|
|
381
381
|
"dist",
|
|
382
|
-
"package"
|
|
382
|
+
"package",
|
|
383
|
+
"scripts"
|
|
383
384
|
],
|
|
384
385
|
"license": "AGPL-3.0",
|
|
385
386
|
"svelte": "./dist/index.js",
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// patch-editor-worker.mjs
|
|
2
|
+
import { readFile, writeFile } from 'fs/promises'
|
|
3
|
+
import path from 'path'
|
|
4
|
+
import { fileURLToPath } from 'url'
|
|
5
|
+
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
7
|
+
const filePath = path.join(
|
|
8
|
+
__dirname,
|
|
9
|
+
'..',
|
|
10
|
+
'node_modules',
|
|
11
|
+
'@codingame',
|
|
12
|
+
'monaco-vscode-api',
|
|
13
|
+
'workers',
|
|
14
|
+
'editor.worker.js'
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
const originalSnippet = `return requestHandler?.[propKey];`
|
|
18
|
+
|
|
19
|
+
const patchedCode = `
|
|
20
|
+
import '../vscode/src/vs/editor/common/services/editorWebWorkerMain.js';
|
|
21
|
+
import { start } from '../vscode/src/vs/editor/editor.worker.start.js';
|
|
22
|
+
|
|
23
|
+
function initialize(createFn) {
|
|
24
|
+
let requestHandler;
|
|
25
|
+
const foreignModule = new Proxy({}, {
|
|
26
|
+
get(_target, propKey) {
|
|
27
|
+
if (propKey === '$initialize') {
|
|
28
|
+
return async (data) => {
|
|
29
|
+
if (!requestHandler) {
|
|
30
|
+
requestHandler = createFn(context, data);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
const value = requestHandler?.[propKey]
|
|
35
|
+
if (typeof value === 'function') {
|
|
36
|
+
return value.bind(requestHandler);
|
|
37
|
+
}
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
const context = start(foreignModule);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { initialize };
|
|
45
|
+
`
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
const current = await readFile(filePath, 'utf8')
|
|
49
|
+
if (current.includes(originalSnippet)) {
|
|
50
|
+
await writeFile(filePath, patchedCode, 'utf8')
|
|
51
|
+
console.log('✅ editor.worker.js patched successfully.')
|
|
52
|
+
} else {
|
|
53
|
+
console.log('ℹ️ Patch already applied or file has changed.')
|
|
54
|
+
}
|
|
55
|
+
} catch (err) {
|
|
56
|
+
console.error('❌ Failed to patch editor.worker.js:', err)
|
|
57
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import path from 'path'
|
|
2
|
+
import fs from 'fs'
|
|
3
|
+
|
|
4
|
+
import { x } from 'tar'
|
|
5
|
+
|
|
6
|
+
const tarUrl = 'https://pub-06154ed168a24e73a86ab84db6bf15d8.r2.dev/ui_builder-d44b577.tar.gz'
|
|
7
|
+
const outputTarPath = path.join(process.cwd(), 'ui_builder.tar.gz')
|
|
8
|
+
const extractTo = path.join(process.cwd(), 'static/ui_builder/')
|
|
9
|
+
|
|
10
|
+
import { fileURLToPath } from 'url'
|
|
11
|
+
import { dirname } from 'path'
|
|
12
|
+
|
|
13
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
14
|
+
const __dirname = dirname(__filename)
|
|
15
|
+
|
|
16
|
+
// Download the tar file
|
|
17
|
+
const response = await fetch(tarUrl)
|
|
18
|
+
const buffer = await response.arrayBuffer()
|
|
19
|
+
await fs.promises.writeFile(outputTarPath, Buffer.from(buffer))
|
|
20
|
+
|
|
21
|
+
// Check if this script is being run from the package root
|
|
22
|
+
const isRootInstall = process.cwd() + '/scripts' === __dirname
|
|
23
|
+
|
|
24
|
+
if (isRootInstall) {
|
|
25
|
+
console.log('Running postinstall: direct install')
|
|
26
|
+
// Your postinstall logic here
|
|
27
|
+
} else {
|
|
28
|
+
console.log('Skipping postinstall: installed as dependency')
|
|
29
|
+
process.exit(0)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Create extract directory if it doesn't exist
|
|
33
|
+
try {
|
|
34
|
+
await fs.promises.mkdir(extractTo, { recursive: true })
|
|
35
|
+
} catch (err) {
|
|
36
|
+
if (err.code !== 'EEXIST') {
|
|
37
|
+
throw err
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
await x({
|
|
42
|
+
file: outputTarPath,
|
|
43
|
+
cwd: extractTo,
|
|
44
|
+
sync: false,
|
|
45
|
+
gzip: true
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
await fs.promises.unlink(outputTarPath)
|