pybiolib 1.2.1337__py3-none-any.whl → 1.2.1352__py3-none-any.whl
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.
Potentially problematic release.
This version of pybiolib might be problematic. Click here for more details.
- biolib/_internal/templates/gui_template/App.tsx +38 -2
- biolib/_internal/templates/gui_template/biolib-sdk.ts +34 -0
- biolib/_internal/templates/gui_template/dev-data/output.json +7 -0
- biolib/_internal/templates/gui_template/vite-plugin-dev-data.ts +52 -0
- biolib/_internal/templates/gui_template/vite.config.mts +2 -1
- {pybiolib-1.2.1337.dist-info → pybiolib-1.2.1352.dist-info}/METADATA +1 -1
- {pybiolib-1.2.1337.dist-info → pybiolib-1.2.1352.dist-info}/RECORD +10 -7
- {pybiolib-1.2.1337.dist-info → pybiolib-1.2.1352.dist-info}/WHEEL +0 -0
- {pybiolib-1.2.1337.dist-info → pybiolib-1.2.1352.dist-info}/entry_points.txt +0 -0
- {pybiolib-1.2.1337.dist-info → pybiolib-1.2.1352.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,16 +1,52 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
import biolib from "./biolib-sdk";
|
|
3
|
+
|
|
1
4
|
export default function App() {
|
|
5
|
+
const [outputFileData, setOutputFileData] = useState<Uint8Array | null>(null);
|
|
6
|
+
const [loading, setLoading] = useState(true);
|
|
7
|
+
|
|
8
|
+
const loadOutputData = async () => {
|
|
9
|
+
setLoading(true);
|
|
10
|
+
try {
|
|
11
|
+
const data = await biolib.getOutputFileData("output.json");
|
|
12
|
+
setOutputFileData(data);
|
|
13
|
+
} catch (error) {
|
|
14
|
+
console.error("Error loading output data:", error);
|
|
15
|
+
setOutputFileData(null);
|
|
16
|
+
} finally {
|
|
17
|
+
setLoading(false);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
loadOutputData();
|
|
23
|
+
}, []);
|
|
24
|
+
|
|
2
25
|
return (
|
|
3
26
|
<div className="min-h-screen bg-gray-100 flex items-center justify-center">
|
|
4
|
-
<div className="text-center">
|
|
27
|
+
<div className="text-center max-w-2xl mx-auto p-8">
|
|
5
28
|
<h1 className="text-4xl font-bold mb-4">
|
|
6
29
|
Hello, BioLib!
|
|
7
30
|
</h1>
|
|
8
31
|
<p className="text-lg mb-2">
|
|
9
32
|
You have successfully set up your BioLib GUI application.
|
|
10
33
|
</p>
|
|
11
|
-
<p className="italic">
|
|
34
|
+
<p className="italic mb-6">
|
|
12
35
|
This is a simple React template with Tailwind CSS styling.
|
|
13
36
|
</p>
|
|
37
|
+
|
|
38
|
+
<div className="mt-8 p-4 bg-white rounded-lg shadow">
|
|
39
|
+
<h2 className="text-xl font-semibold mb-4">Example: Reading Output Files</h2>
|
|
40
|
+
{loading ? (
|
|
41
|
+
<p className="text-gray-500">Loading output.json...</p>
|
|
42
|
+
) : outputFileData ? (
|
|
43
|
+
<div className="p-3 bg-gray-50 rounded text-left">
|
|
44
|
+
<pre className="text-sm">{new TextDecoder().decode(outputFileData)}</pre>
|
|
45
|
+
</div>
|
|
46
|
+
) : (
|
|
47
|
+
<p className="text-red-500">Failed to load output.json</p>
|
|
48
|
+
)}
|
|
49
|
+
</div>
|
|
14
50
|
</div>
|
|
15
51
|
</div>
|
|
16
52
|
);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface IBioLibGlobals {
|
|
2
|
+
getOutputFileData: (path: string) => Promise<Uint8Array>;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
declare global {
|
|
6
|
+
const biolib: IBioLibGlobals;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/* DEV_DATA_INJECTION */
|
|
10
|
+
|
|
11
|
+
const devSdkBioLib: IBioLibGlobals = {
|
|
12
|
+
getOutputFileData: async (path: string): Promise<Uint8Array> => {
|
|
13
|
+
console.log(`[SDK] getOutputFileData called with path: ${path}`);
|
|
14
|
+
|
|
15
|
+
if (typeof DEV_DATA_FILES !== 'undefined' && path in DEV_DATA_FILES) {
|
|
16
|
+
const base64Data = DEV_DATA_FILES[path];
|
|
17
|
+
const binaryString = atob(base64Data);
|
|
18
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
19
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
20
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
21
|
+
}
|
|
22
|
+
return bytes;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
throw new Error(`File not found: ${path}. Add this file to the dev-data/ folder for local development.`);
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const biolib: IBioLibGlobals =
|
|
30
|
+
process.env.NODE_ENV === "development"
|
|
31
|
+
? devSdkBioLib
|
|
32
|
+
: (window as any).biolib;
|
|
33
|
+
|
|
34
|
+
export default biolib;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Plugin } from 'vite';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
|
|
5
|
+
export function devDataPlugin(): Plugin {
|
|
6
|
+
let isDev = false;
|
|
7
|
+
|
|
8
|
+
return {
|
|
9
|
+
name: 'dev-data-plugin',
|
|
10
|
+
configResolved(config) {
|
|
11
|
+
isDev = config.mode === 'development';
|
|
12
|
+
},
|
|
13
|
+
transform(code: string, id: string) {
|
|
14
|
+
if (id.endsWith('biolib-sdk.ts')) {
|
|
15
|
+
let injectedCode: string;
|
|
16
|
+
|
|
17
|
+
if (isDev) {
|
|
18
|
+
const devDataDir = path.join(__dirname, 'dev-data');
|
|
19
|
+
const devDataMap: Record<string, string> = {};
|
|
20
|
+
|
|
21
|
+
if (fs.existsSync(devDataDir)) {
|
|
22
|
+
const files = fs.readdirSync(devDataDir);
|
|
23
|
+
for (const file of files) {
|
|
24
|
+
const filePath = path.join(devDataDir, file);
|
|
25
|
+
if (fs.statSync(filePath).isFile()) {
|
|
26
|
+
const content = fs.readFileSync(filePath);
|
|
27
|
+
const base64Content = content.toString('base64');
|
|
28
|
+
devDataMap[file] = base64Content;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const devDataJson = JSON.stringify(devDataMap);
|
|
34
|
+
injectedCode = code.replace(
|
|
35
|
+
'/* DEV_DATA_INJECTION */',
|
|
36
|
+
`const DEV_DATA_FILES: Record<string, string> = ${devDataJson};`
|
|
37
|
+
);
|
|
38
|
+
} else {
|
|
39
|
+
injectedCode = code.replace(
|
|
40
|
+
'/* DEV_DATA_INJECTION */',
|
|
41
|
+
'// Dev data not included in production build'
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
code: injectedCode,
|
|
47
|
+
map: null
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -2,7 +2,8 @@ import { defineConfig } from "vite";
|
|
|
2
2
|
import react from "@vitejs/plugin-react";
|
|
3
3
|
import tailwindcss from "@tailwindcss/vite";
|
|
4
4
|
import { viteSingleFile } from "vite-plugin-singlefile";
|
|
5
|
+
import { devDataPlugin } from "./vite-plugin-dev-data";
|
|
5
6
|
|
|
6
7
|
export default defineConfig({
|
|
7
|
-
plugins: [react(), tailwindcss(), viteSingleFile()],
|
|
8
|
+
plugins: [react(), tailwindcss(), devDataPlugin(), viteSingleFile()],
|
|
8
9
|
});
|
|
@@ -28,14 +28,17 @@ biolib/_internal/templates/copilot_template/.github/prompts/biolib_app_inputs.pr
|
|
|
28
28
|
biolib/_internal/templates/copilot_template/.github/prompts/biolib_onboard_repo.prompt.md,sha256=BfCkVyafDHFBMu6qcvKlxpnXKJRHNDp5qR_fN4XB9pI,1515
|
|
29
29
|
biolib/_internal/templates/copilot_template/.github/prompts/biolib_run_apps.prompt.md,sha256=-t1bmGr3zEFa6lKHaLcI98yq4Sg1TCMW8xbelNSHaOA,696
|
|
30
30
|
biolib/_internal/templates/gui_template/.yarnrc.yml,sha256=Rz5t74b8A2OBIODAHQyLurCVZ3JWRg-k6nY-XUaX8nA,25
|
|
31
|
-
biolib/_internal/templates/gui_template/App.tsx,sha256=
|
|
31
|
+
biolib/_internal/templates/gui_template/App.tsx,sha256=VfaJO_mxbheRrfO1dU28G9Q4pGsGzeJpPREqtAT4fGE,1692
|
|
32
32
|
biolib/_internal/templates/gui_template/Dockerfile,sha256=nGZQiL7coQBUnH1E2abK2PJ4XRjVS1QXn6HDX9UGpcE,479
|
|
33
|
+
biolib/_internal/templates/gui_template/biolib-sdk.ts,sha256=cplISOz2eUTHXoiF9kftYVMb4qVnEHLkt_wWqdb0HkY,978
|
|
34
|
+
biolib/_internal/templates/gui_template/dev-data/output.json,sha256=wKcJQtN7NGaCJkmEWyRjEbBtTLMHB6pOkqTgWsKmOh8,162
|
|
33
35
|
biolib/_internal/templates/gui_template/index.css,sha256=WYds1xQY2of84ebHhRW9ummbw0Bg9N-EyfmBzJKigck,70
|
|
34
36
|
biolib/_internal/templates/gui_template/index.html,sha256=EM5xzJ9CsJalgzL-jLNkAoP4tgosw0WYExcH5W6DOs8,403
|
|
35
37
|
biolib/_internal/templates/gui_template/index.tsx,sha256=YrdrpcckwLo0kYIA-2egtzlo0OMWigGxnt7mNN4qmlU,234
|
|
36
38
|
biolib/_internal/templates/gui_template/package.json,sha256=iyYYUC0zKGWvZcH8YxN-3w-0N68W5vx-0WPlluMn6Y4,621
|
|
37
39
|
biolib/_internal/templates/gui_template/tsconfig.json,sha256=T3DJIzeLQ2BL8HLfPHI-IvHtJhnMXdHOoRjkmQlJQAw,541
|
|
38
|
-
biolib/_internal/templates/gui_template/vite.
|
|
40
|
+
biolib/_internal/templates/gui_template/vite-plugin-dev-data.ts,sha256=9Fg7kS1xMB5bgUGRExJX8y_AyE2AcVba3k-EfRj352I,1534
|
|
41
|
+
biolib/_internal/templates/gui_template/vite.config.mts,sha256=Pk9T9wkpHowE0WMqOJ_tuLZYhXsslLzLNNkFHYYjHQ4,344
|
|
39
42
|
biolib/_internal/templates/init_template/.biolib/config.yml,sha256=gxMVd1wjbsDvMv4byc8fKEdJFby4qgi6v38mO5qmhoY,453
|
|
40
43
|
biolib/_internal/templates/init_template/.github/workflows/biolib.yml,sha256=sphjoiycV_oc4VbaA8wbUEokSMpnrdB6N-bYju_5Ibo,522
|
|
41
44
|
biolib/_internal/templates/init_template/.gitignore,sha256=dR_jhtT0boUspgk3S5PPUwuO0o8gKGIbdwu8IH638CY,20
|
|
@@ -158,8 +161,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
|
|
|
158
161
|
biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
|
|
159
162
|
biolib/utils/seq_util.py,sha256=rImaghQGuIqTVWks6b9P2yKuN34uePUYPUFW_Wyoa4A,6737
|
|
160
163
|
biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
|
|
161
|
-
pybiolib-1.2.
|
|
162
|
-
pybiolib-1.2.
|
|
163
|
-
pybiolib-1.2.
|
|
164
|
-
pybiolib-1.2.
|
|
165
|
-
pybiolib-1.2.
|
|
164
|
+
pybiolib-1.2.1352.dist-info/METADATA,sha256=XynyBKvX9QaPKQoKAA1I_WX5_XFZDn9X_zjmP2ivUY0,1644
|
|
165
|
+
pybiolib-1.2.1352.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
166
|
+
pybiolib-1.2.1352.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
|
|
167
|
+
pybiolib-1.2.1352.dist-info/licenses/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
|
168
|
+
pybiolib-1.2.1352.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|