@primate/python 0.7.0 → 0.9.0
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/lib/private/borrow.d.ts +1 -1
- package/lib/private/default.js +10 -8
- package/lib/private/handler-property.d.ts +1 -1
- package/lib/private/helpers.d.ts +1 -1
- package/lib/private/module.d.ts +1 -1
- package/lib/private/to-request.d.ts +5 -4
- package/lib/private/unwrap.d.ts +2 -3
- package/package.json +11 -11
package/lib/private/borrow.d.ts
CHANGED
package/lib/private/default.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import E from "#errors";
|
|
2
2
|
import module from "#module";
|
|
3
3
|
import server from "@primate/core/server";
|
|
4
|
-
import assert from "@rcompat/assert";
|
|
5
4
|
import fs from "@rcompat/fs";
|
|
6
5
|
import io from "@rcompat/io";
|
|
7
6
|
const PACKAGE = "primate-run";
|
|
@@ -39,14 +38,14 @@ function wrap(source, id, packages_str, primate_run) {
|
|
|
39
38
|
return `
|
|
40
39
|
import route from "primate/route";
|
|
41
40
|
import wrapper from "@primate/python/wrapper";
|
|
42
|
-
import
|
|
41
|
+
import app from "$:app";
|
|
43
42
|
import session from "app:config:session";
|
|
44
43
|
const handlers = await wrapper(
|
|
45
44
|
${JSON.stringify(source)},
|
|
46
45
|
${packages_str},
|
|
47
46
|
${JSON.stringify(primate_run)},
|
|
48
47
|
${JSON.stringify(id)},
|
|
49
|
-
{ i18n, session }
|
|
48
|
+
{ i18n: app.i18n, session }
|
|
50
49
|
);
|
|
51
50
|
export default route(handlers);
|
|
52
51
|
`;
|
|
@@ -68,11 +67,14 @@ export default function default_module(input = {}) {
|
|
|
68
67
|
.map(p => p.trim());
|
|
69
68
|
}
|
|
70
69
|
const packages_str = JSON.stringify(packages);
|
|
71
|
-
app.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
app.register(module.name, {
|
|
71
|
+
type: "backend",
|
|
72
|
+
extensions: [extension],
|
|
73
|
+
async onLoad(file) {
|
|
74
|
+
const relative = file.debase(app.path.routes).path.replace(/^\//, "");
|
|
75
|
+
const source = await file.text();
|
|
76
|
+
return wrap(source, relative, packages_str, `${PACKAGE}~=${server.TAG}.0`);
|
|
77
|
+
},
|
|
76
78
|
});
|
|
77
79
|
});
|
|
78
80
|
},
|
package/lib/private/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
|
-
type(value: unknown): "
|
|
2
|
+
type(value: unknown): "array" | "boolean" | "float" | "integer" | "nil" | "object" | "string" | undefined;
|
|
3
3
|
};
|
|
4
4
|
export default _default;
|
|
5
5
|
//# sourceMappingURL=helpers.d.ts.map
|
package/lib/private/module.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { RequestContentType, RequestFacade } from "@primate/core";
|
|
2
|
+
import type { Dict } from "@rcompat/type";
|
|
2
3
|
type FileEntry = {
|
|
3
4
|
bytes: Uint8Array;
|
|
4
5
|
field: string;
|
|
@@ -29,10 +30,10 @@ type BridgedBody = {
|
|
|
29
30
|
export default function to_request(request: RequestFacade, contentType: RequestContentType | ""): Promise<{
|
|
30
31
|
url: URL;
|
|
31
32
|
body: BridgedBody;
|
|
32
|
-
path:
|
|
33
|
-
query:
|
|
34
|
-
headers:
|
|
35
|
-
cookies:
|
|
33
|
+
path: Dict<string>;
|
|
34
|
+
query: Dict<string>;
|
|
35
|
+
headers: Dict<string>;
|
|
36
|
+
cookies: Dict<string>;
|
|
36
37
|
}>;
|
|
37
38
|
export {};
|
|
38
39
|
//# sourceMappingURL=to-request.d.ts.map
|
package/lib/private/unwrap.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
+
import type { Dict } from "@rcompat/type";
|
|
1
2
|
import type { PyProxy } from "pyodide/ffi";
|
|
2
|
-
export default function unwrap(response: PyProxy):
|
|
3
|
-
[k: string]: unknown;
|
|
4
|
-
};
|
|
3
|
+
export default function unwrap(response: PyProxy): Dict;
|
|
5
4
|
//# sourceMappingURL=unwrap.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primate/python",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Python backend for Primate",
|
|
5
5
|
"homepage": "https://primate.run/docs/backend/python",
|
|
6
6
|
"bugs": "https://github.com/primate-run/primate/issues",
|
|
@@ -17,20 +17,20 @@
|
|
|
17
17
|
"!/**/*.spec.*"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@rcompat/assert": "^0.
|
|
21
|
-
"@rcompat/error": "^0.
|
|
22
|
-
"@rcompat/fs": "^0.
|
|
23
|
-
"@rcompat/io": "^0.
|
|
24
|
-
"@rcompat/is": "^0.
|
|
25
|
-
"pyodide": "^0.
|
|
26
|
-
"@primate/core": "^0.
|
|
27
|
-
"pema": "^0.
|
|
20
|
+
"@rcompat/assert": "^0.14.0",
|
|
21
|
+
"@rcompat/error": "^0.9.0",
|
|
22
|
+
"@rcompat/fs": "^0.35.1",
|
|
23
|
+
"@rcompat/io": "^0.11.0",
|
|
24
|
+
"@rcompat/is": "^0.12.0",
|
|
25
|
+
"pyodide": "^314.0.2",
|
|
26
|
+
"@primate/core": "^0.9.0",
|
|
27
|
+
"pema": "^0.9.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@rcompat/type": "^0.
|
|
30
|
+
"@rcompat/type": "^0.18.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"primate": "^0.
|
|
33
|
+
"primate": "^0.40.0"
|
|
34
34
|
},
|
|
35
35
|
"imports": {
|
|
36
36
|
"#*": {
|