@vercel/python-analysis 0.8.1 → 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/dist/index.cjs +173 -34
- package/dist/index.d.ts +3 -3
- package/dist/index.js +171 -33
- package/dist/manifest/python-selector.d.ts +41 -0
- package/dist/manifest/python-specifiers.d.ts +3 -1
- package/dist/semantic/entrypoints.d.ts +10 -9
- package/dist/wasm/interfaces/wasi-cli-stdin.d.ts +3 -0
- package/dist/wasm/interfaces/wasi-cli-stdout.d.ts +3 -0
- package/dist/wasm/interfaces/wasi-cli-terminal-input.d.ts +8 -0
- package/dist/wasm/interfaces/wasi-cli-terminal-output.d.ts +8 -0
- package/dist/wasm/interfaces/wasi-cli-terminal-stderr.d.ts +3 -0
- package/dist/wasm/interfaces/wasi-cli-terminal-stdin.d.ts +3 -0
- package/dist/wasm/interfaces/wasi-cli-terminal-stdout.d.ts +3 -0
- package/dist/wasm/interfaces/wasi-io-error.d.ts +0 -1
- package/dist/wasm/interfaces/wasi-io-poll.d.ts +9 -0
- package/dist/wasm/interfaces/wasi-io-streams.d.ts +12 -1
- package/dist/wasm/vercel_python_analysis.core.wasm +0 -0
- package/dist/wasm/vercel_python_analysis.core2.wasm +0 -0
- package/dist/wasm/vercel_python_analysis.core3.wasm +0 -0
- package/dist/wasm/vercel_python_analysis.d.ts +17 -1
- package/dist/wasm/vercel_python_analysis.js +542 -157
- package/package.json +1 -1
- package/dist/wasm/vercel_python_analysis.core4.wasm +0 -0
|
@@ -27,6 +27,16 @@
|
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
29
|
export declare function containsAppOrHandler(source: string): Promise<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* Check if a top-level callable with the given name exists in Python source.
|
|
32
|
+
*
|
|
33
|
+
* Returns true if found, false otherwise.
|
|
34
|
+
* Returns false for invalid Python syntax.
|
|
35
|
+
*
|
|
36
|
+
* @param source - The Python source code to analyze
|
|
37
|
+
* @param name - The callable name to look for (e.g. "cleanup")
|
|
38
|
+
*/
|
|
39
|
+
export declare function containsTopLevelCallable(source: string, name: string): Promise<boolean>;
|
|
30
40
|
/**
|
|
31
41
|
* Extract the string value of a top-level constant with the given name.
|
|
32
42
|
* Only considers simple assignments (NAME = "string") and annotated assignments
|
|
@@ -38,12 +48,3 @@ export declare function containsAppOrHandler(source: string): Promise<boolean>;
|
|
|
38
48
|
* @returns The string value or null
|
|
39
49
|
*/
|
|
40
50
|
export declare function getStringConstant(source: string, name: string): Promise<string | null>;
|
|
41
|
-
/**
|
|
42
|
-
* Parse manage.py content for DJANGO_SETTINGS_MODULE (e.g. from
|
|
43
|
-
* os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'app.settings')).
|
|
44
|
-
* Uses the WASM Python parser to extract the value from the AST.
|
|
45
|
-
*
|
|
46
|
-
* @param content - Raw content of manage.py
|
|
47
|
-
* @returns The settings module string (e.g. 'app.settings') or null if not found
|
|
48
|
-
*/
|
|
49
|
-
export declare function parseDjangoSettingsModule(content: string): Promise<string | null>;
|
|
@@ -8,11 +8,22 @@ export interface StreamErrorLastOperationFailed {
|
|
|
8
8
|
export interface StreamErrorClosed {
|
|
9
9
|
tag: 'closed',
|
|
10
10
|
}
|
|
11
|
+
export type Pollable = import('./wasi-io-poll.js').Pollable;
|
|
12
|
+
|
|
13
|
+
export class InputStream {
|
|
14
|
+
/**
|
|
15
|
+
* This type does not have a public constructor.
|
|
16
|
+
*/
|
|
17
|
+
private constructor();
|
|
18
|
+
}
|
|
11
19
|
|
|
12
20
|
export class OutputStream {
|
|
13
21
|
/**
|
|
14
22
|
* This type does not have a public constructor.
|
|
15
23
|
*/
|
|
16
24
|
private constructor();
|
|
17
|
-
|
|
25
|
+
checkWrite(): bigint;
|
|
26
|
+
write(contents: Uint8Array): void;
|
|
27
|
+
blockingFlush(): void;
|
|
28
|
+
subscribe(): Pollable;
|
|
18
29
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -56,21 +56,37 @@ export interface DirectUrlInfoVcs {
|
|
|
56
56
|
import type * as WasiCliEnvironment from './interfaces/wasi-cli-environment.js'; // wasi:cli/environment@0.2.6
|
|
57
57
|
import type * as WasiCliExit from './interfaces/wasi-cli-exit.js'; // wasi:cli/exit@0.2.6
|
|
58
58
|
import type * as WasiCliStderr from './interfaces/wasi-cli-stderr.js'; // wasi:cli/stderr@0.2.6
|
|
59
|
+
import type * as WasiCliStdin from './interfaces/wasi-cli-stdin.js'; // wasi:cli/stdin@0.2.6
|
|
60
|
+
import type * as WasiCliStdout from './interfaces/wasi-cli-stdout.js'; // wasi:cli/stdout@0.2.6
|
|
61
|
+
import type * as WasiCliTerminalInput from './interfaces/wasi-cli-terminal-input.js'; // wasi:cli/terminal-input@0.2.6
|
|
62
|
+
import type * as WasiCliTerminalOutput from './interfaces/wasi-cli-terminal-output.js'; // wasi:cli/terminal-output@0.2.6
|
|
63
|
+
import type * as WasiCliTerminalStderr from './interfaces/wasi-cli-terminal-stderr.js'; // wasi:cli/terminal-stderr@0.2.6
|
|
64
|
+
import type * as WasiCliTerminalStdin from './interfaces/wasi-cli-terminal-stdin.js'; // wasi:cli/terminal-stdin@0.2.6
|
|
65
|
+
import type * as WasiCliTerminalStdout from './interfaces/wasi-cli-terminal-stdout.js'; // wasi:cli/terminal-stdout@0.2.6
|
|
59
66
|
import type * as WasiIoError from './interfaces/wasi-io-error.js'; // wasi:io/error@0.2.6
|
|
67
|
+
import type * as WasiIoPoll from './interfaces/wasi-io-poll.js'; // wasi:io/poll@0.2.6
|
|
60
68
|
import type * as WasiIoStreams from './interfaces/wasi-io-streams.js'; // wasi:io/streams@0.2.6
|
|
61
69
|
import type * as WasiRandomInsecureSeed from './interfaces/wasi-random-insecure-seed.js'; // wasi:random/insecure-seed@0.2.6
|
|
62
70
|
export interface ImportObject {
|
|
63
71
|
'wasi:cli/environment@0.2.6': typeof WasiCliEnvironment,
|
|
64
72
|
'wasi:cli/exit@0.2.6': typeof WasiCliExit,
|
|
65
73
|
'wasi:cli/stderr@0.2.6': typeof WasiCliStderr,
|
|
74
|
+
'wasi:cli/stdin@0.2.6': typeof WasiCliStdin,
|
|
75
|
+
'wasi:cli/stdout@0.2.6': typeof WasiCliStdout,
|
|
76
|
+
'wasi:cli/terminal-input@0.2.6': typeof WasiCliTerminalInput,
|
|
77
|
+
'wasi:cli/terminal-output@0.2.6': typeof WasiCliTerminalOutput,
|
|
78
|
+
'wasi:cli/terminal-stderr@0.2.6': typeof WasiCliTerminalStderr,
|
|
79
|
+
'wasi:cli/terminal-stdin@0.2.6': typeof WasiCliTerminalStdin,
|
|
80
|
+
'wasi:cli/terminal-stdout@0.2.6': typeof WasiCliTerminalStdout,
|
|
66
81
|
'wasi:io/error@0.2.6': typeof WasiIoError,
|
|
82
|
+
'wasi:io/poll@0.2.6': typeof WasiIoPoll,
|
|
67
83
|
'wasi:io/streams@0.2.6': typeof WasiIoStreams,
|
|
68
84
|
'wasi:random/insecure-seed@0.2.6': typeof WasiRandomInsecureSeed,
|
|
69
85
|
}
|
|
70
86
|
export interface Root {
|
|
71
87
|
containsAppOrHandler(source: string): boolean,
|
|
72
88
|
getStringConstant(source: string, name: string): string | undefined,
|
|
73
|
-
|
|
89
|
+
containsTopLevelCallable(source: string, name: string): boolean,
|
|
74
90
|
parseDistMetadata(content: Uint8Array): DistMetadata,
|
|
75
91
|
parseRecord(content: string): Array<RecordEntry>,
|
|
76
92
|
parseDirectUrl(content: string): DirectUrlInfo,
|