pybiolib 1.2.1337__py3-none-any.whl → 1.2.1361__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.

@@ -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,37 @@
1
+ interface IBioLibGlobals {
2
+ getOutputFileData: (path: string) => Promise<Uint8Array>;
3
+ }
4
+
5
+ declare global {
6
+ const biolib: IBioLibGlobals;
7
+ }
8
+
9
+ // DO NOT MODIFY: Development data files are injected at build time from gui/dev-data/ folder
10
+ const DEV_DATA_FILES: Record<string, string> = {};
11
+
12
+ const devSdkBioLib: IBioLibGlobals = {
13
+ getOutputFileData: async (path: string): Promise<Uint8Array> => {
14
+ console.log(`[SDK] getOutputFileData called with path: ${path}`);
15
+
16
+ const normalizedPath = path.startsWith('/') ? path.slice(1) : path;
17
+
18
+ if (typeof DEV_DATA_FILES !== 'undefined' && normalizedPath in DEV_DATA_FILES) {
19
+ const base64Data = DEV_DATA_FILES[normalizedPath];
20
+ const binaryString = atob(base64Data);
21
+ const bytes = new Uint8Array(binaryString.length);
22
+ for (let i = 0; i < binaryString.length; i++) {
23
+ bytes[i] = binaryString.charCodeAt(i);
24
+ }
25
+ return bytes;
26
+ }
27
+
28
+ throw new Error(`File not found: ${path}. Add this file to the dev-data/ folder for local development.`);
29
+ },
30
+ };
31
+
32
+ const biolib: IBioLibGlobals =
33
+ process.env.NODE_ENV === "development"
34
+ ? devSdkBioLib
35
+ : (window as any).biolib;
36
+
37
+ export default biolib;
@@ -0,0 +1,7 @@
1
+ {
2
+ "message": "Example JSON data for development",
3
+ "results": [
4
+ { "id": 1, "value": "Sample result 1" },
5
+ { "id": 2, "value": "Sample result 2" }
6
+ ]
7
+ }
@@ -14,6 +14,7 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@tailwindcss/vite": "4.0.14",
17
+ "@types/node": "20.17.10",
17
18
  "@types/react": "18.3.3",
18
19
  "@types/react-dom": "18.3.0",
19
20
  "@vitejs/plugin-react": "4.2.1",
@@ -0,0 +1,49 @@
1
+ import type { 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
+ "const DEV_DATA_FILES = {};",
36
+ `const DEV_DATA_FILES = ${devDataJson};`
37
+ );
38
+ } else {
39
+ injectedCode = code;
40
+ }
41
+
42
+ return {
43
+ code: injectedCode,
44
+ map: null
45
+ };
46
+ }
47
+ }
48
+ };
49
+ }
@@ -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 "./gui/vite-plugin-dev-data";
5
6
 
6
7
  export default defineConfig({
7
- plugins: [react(), tailwindcss(), viteSingleFile()],
8
+ plugins: [react(), tailwindcss(), devDataPlugin(), viteSingleFile()],
8
9
  });
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pybiolib
3
- Version: 1.2.1337
3
+ Version: 1.2.1361
4
4
  Summary: BioLib Python Client
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -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=hh_r7P4Pn4HLaE8C1PoECawd81yoC4MfWPu7Op02kWg,509
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=zRN2h4ws7ZuidxYKaRPaurfTxNJN-hX0MdG6POvdxU0,1195
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
- biolib/_internal/templates/gui_template/package.json,sha256=iyYYUC0zKGWvZcH8YxN-3w-0N68W5vx-0WPlluMn6Y4,621
38
+ biolib/_internal/templates/gui_template/package.json,sha256=4E8pDdnrYYjmKAL8NYFE3OZzBf4-CWdHWEZFAo_zBwg,652
37
39
  biolib/_internal/templates/gui_template/tsconfig.json,sha256=T3DJIzeLQ2BL8HLfPHI-IvHtJhnMXdHOoRjkmQlJQAw,541
38
- biolib/_internal/templates/gui_template/vite.config.mts,sha256=Bf1bgRReU3XFsR6rX9yylW2IAxy2cDQI1FHBMjRnyQ4,271
40
+ biolib/_internal/templates/gui_template/vite-plugin-dev-data.ts,sha256=jLFSl7_DU9W3ScM6fm0aFSCzDhAtzhI9G6zr1exze84,1397
41
+ biolib/_internal/templates/gui_template/vite.config.mts,sha256=5RjRfJHgqLOr-LRydBUnDPr5GrHQuRsviTMC60hvKxU,348
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.1337.dist-info/METADATA,sha256=rH78s_I8v02Htgz31ys8-Ap2-E8JBXQD3rfcF86_KsA,1644
162
- pybiolib-1.2.1337.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
163
- pybiolib-1.2.1337.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
164
- pybiolib-1.2.1337.dist-info/licenses/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
165
- pybiolib-1.2.1337.dist-info/RECORD,,
164
+ pybiolib-1.2.1361.dist-info/METADATA,sha256=Mc0J-5SkgNFy4G4hYW2XaekpJp1qODDRm2TB6LlMaww,1644
165
+ pybiolib-1.2.1361.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
166
+ pybiolib-1.2.1361.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
167
+ pybiolib-1.2.1361.dist-info/licenses/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
168
+ pybiolib-1.2.1361.dist-info/RECORD,,