@astral-sh/ruff-wasm-web 0.6.9 → 0.7.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/package.json +1 -1
- package/ruff_wasm.d.ts +34 -38
- package/ruff_wasm.js +68 -64
- package/ruff_wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/ruff_wasm.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
/**
|
|
4
|
-
*/
|
|
5
3
|
export function run(): void;
|
|
6
4
|
|
|
7
5
|
export interface Diagnostic {
|
|
@@ -32,52 +30,50 @@ export interface Diagnostic {
|
|
|
32
30
|
};
|
|
33
31
|
|
|
34
32
|
|
|
35
|
-
/**
|
|
36
|
-
*/
|
|
37
33
|
export class Workspace {
|
|
38
34
|
free(): void;
|
|
39
|
-
/**
|
|
40
|
-
* @returns {string}
|
|
41
|
-
*/
|
|
35
|
+
/**
|
|
36
|
+
* @returns {string}
|
|
37
|
+
*/
|
|
42
38
|
static version(): string;
|
|
43
|
-
/**
|
|
44
|
-
* @param {any} options
|
|
45
|
-
*/
|
|
39
|
+
/**
|
|
40
|
+
* @param {any} options
|
|
41
|
+
*/
|
|
46
42
|
constructor(options: any);
|
|
47
|
-
/**
|
|
48
|
-
* @returns {any}
|
|
49
|
-
*/
|
|
43
|
+
/**
|
|
44
|
+
* @returns {any}
|
|
45
|
+
*/
|
|
50
46
|
static defaultSettings(): any;
|
|
51
|
-
/**
|
|
52
|
-
* @param {string} contents
|
|
53
|
-
* @returns {any}
|
|
54
|
-
*/
|
|
47
|
+
/**
|
|
48
|
+
* @param {string} contents
|
|
49
|
+
* @returns {any}
|
|
50
|
+
*/
|
|
55
51
|
check(contents: string): any;
|
|
56
|
-
/**
|
|
57
|
-
* @param {string} contents
|
|
58
|
-
* @returns {string}
|
|
59
|
-
*/
|
|
52
|
+
/**
|
|
53
|
+
* @param {string} contents
|
|
54
|
+
* @returns {string}
|
|
55
|
+
*/
|
|
60
56
|
format(contents: string): string;
|
|
61
|
-
/**
|
|
62
|
-
* @param {string} contents
|
|
63
|
-
* @returns {string}
|
|
64
|
-
*/
|
|
57
|
+
/**
|
|
58
|
+
* @param {string} contents
|
|
59
|
+
* @returns {string}
|
|
60
|
+
*/
|
|
65
61
|
format_ir(contents: string): string;
|
|
66
|
-
/**
|
|
67
|
-
* @param {string} contents
|
|
68
|
-
* @returns {string}
|
|
69
|
-
*/
|
|
62
|
+
/**
|
|
63
|
+
* @param {string} contents
|
|
64
|
+
* @returns {string}
|
|
65
|
+
*/
|
|
70
66
|
comments(contents: string): string;
|
|
71
|
-
/**
|
|
72
|
-
* Parses the content and returns its AST
|
|
73
|
-
* @param {string} contents
|
|
74
|
-
* @returns {string}
|
|
75
|
-
*/
|
|
67
|
+
/**
|
|
68
|
+
* Parses the content and returns its AST
|
|
69
|
+
* @param {string} contents
|
|
70
|
+
* @returns {string}
|
|
71
|
+
*/
|
|
76
72
|
parse(contents: string): string;
|
|
77
|
-
/**
|
|
78
|
-
* @param {string} contents
|
|
79
|
-
* @returns {string}
|
|
80
|
-
*/
|
|
73
|
+
/**
|
|
74
|
+
* @param {string} contents
|
|
75
|
+
* @returns {string}
|
|
76
|
+
*/
|
|
81
77
|
tokens(contents: string): string;
|
|
82
78
|
}
|
|
83
79
|
|
package/ruff_wasm.js
CHANGED
|
@@ -180,8 +180,7 @@ function debugString(val) {
|
|
|
180
180
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
181
181
|
return className;
|
|
182
182
|
}
|
|
183
|
-
|
|
184
|
-
*/
|
|
183
|
+
|
|
185
184
|
export function run() {
|
|
186
185
|
wasm.run();
|
|
187
186
|
}
|
|
@@ -197,8 +196,7 @@ function handleError(f, args) {
|
|
|
197
196
|
const WorkspaceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
198
197
|
? { register: () => {}, unregister: () => {} }
|
|
199
198
|
: new FinalizationRegistry(ptr => wasm.__wbg_workspace_free(ptr >>> 0, 1));
|
|
200
|
-
|
|
201
|
-
*/
|
|
199
|
+
|
|
202
200
|
export class Workspace {
|
|
203
201
|
|
|
204
202
|
__destroy_into_raw() {
|
|
@@ -213,8 +211,8 @@ export class Workspace {
|
|
|
213
211
|
wasm.__wbg_workspace_free(ptr, 0);
|
|
214
212
|
}
|
|
215
213
|
/**
|
|
216
|
-
|
|
217
|
-
|
|
214
|
+
* @returns {string}
|
|
215
|
+
*/
|
|
218
216
|
static version() {
|
|
219
217
|
let deferred1_0;
|
|
220
218
|
let deferred1_1;
|
|
@@ -232,8 +230,8 @@ export class Workspace {
|
|
|
232
230
|
}
|
|
233
231
|
}
|
|
234
232
|
/**
|
|
235
|
-
|
|
236
|
-
|
|
233
|
+
* @param {any} options
|
|
234
|
+
*/
|
|
237
235
|
constructor(options) {
|
|
238
236
|
try {
|
|
239
237
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -252,8 +250,8 @@ export class Workspace {
|
|
|
252
250
|
}
|
|
253
251
|
}
|
|
254
252
|
/**
|
|
255
|
-
|
|
256
|
-
|
|
253
|
+
* @returns {any}
|
|
254
|
+
*/
|
|
257
255
|
static defaultSettings() {
|
|
258
256
|
try {
|
|
259
257
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -270,9 +268,9 @@ export class Workspace {
|
|
|
270
268
|
}
|
|
271
269
|
}
|
|
272
270
|
/**
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
271
|
+
* @param {string} contents
|
|
272
|
+
* @returns {any}
|
|
273
|
+
*/
|
|
276
274
|
check(contents) {
|
|
277
275
|
try {
|
|
278
276
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
@@ -291,9 +289,9 @@ export class Workspace {
|
|
|
291
289
|
}
|
|
292
290
|
}
|
|
293
291
|
/**
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
292
|
+
* @param {string} contents
|
|
293
|
+
* @returns {string}
|
|
294
|
+
*/
|
|
297
295
|
format(contents) {
|
|
298
296
|
let deferred3_0;
|
|
299
297
|
let deferred3_1;
|
|
@@ -321,9 +319,9 @@ export class Workspace {
|
|
|
321
319
|
}
|
|
322
320
|
}
|
|
323
321
|
/**
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
322
|
+
* @param {string} contents
|
|
323
|
+
* @returns {string}
|
|
324
|
+
*/
|
|
327
325
|
format_ir(contents) {
|
|
328
326
|
let deferred3_0;
|
|
329
327
|
let deferred3_1;
|
|
@@ -351,9 +349,9 @@ export class Workspace {
|
|
|
351
349
|
}
|
|
352
350
|
}
|
|
353
351
|
/**
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
352
|
+
* @param {string} contents
|
|
353
|
+
* @returns {string}
|
|
354
|
+
*/
|
|
357
355
|
comments(contents) {
|
|
358
356
|
let deferred3_0;
|
|
359
357
|
let deferred3_1;
|
|
@@ -381,10 +379,10 @@ export class Workspace {
|
|
|
381
379
|
}
|
|
382
380
|
}
|
|
383
381
|
/**
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
382
|
+
* Parses the content and returns its AST
|
|
383
|
+
* @param {string} contents
|
|
384
|
+
* @returns {string}
|
|
385
|
+
*/
|
|
388
386
|
parse(contents) {
|
|
389
387
|
let deferred3_0;
|
|
390
388
|
let deferred3_1;
|
|
@@ -412,9 +410,9 @@ export class Workspace {
|
|
|
412
410
|
}
|
|
413
411
|
}
|
|
414
412
|
/**
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
413
|
+
* @param {string} contents
|
|
414
|
+
* @returns {string}
|
|
415
|
+
*/
|
|
418
416
|
tokens(contents) {
|
|
419
417
|
let deferred3_0;
|
|
420
418
|
let deferred3_1;
|
|
@@ -451,7 +449,7 @@ async function __wbg_load(module, imports) {
|
|
|
451
449
|
|
|
452
450
|
} catch (e) {
|
|
453
451
|
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
454
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve
|
|
452
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
455
453
|
|
|
456
454
|
} else {
|
|
457
455
|
throw e;
|
|
@@ -611,62 +609,62 @@ function __wbg_get_imports() {
|
|
|
611
609
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
612
610
|
return ret;
|
|
613
611
|
};
|
|
614
|
-
imports.wbg.
|
|
612
|
+
imports.wbg.__wbg_get_5419cf6b954aa11d = function(arg0, arg1) {
|
|
615
613
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
616
614
|
return addHeapObject(ret);
|
|
617
615
|
};
|
|
618
|
-
imports.wbg.
|
|
616
|
+
imports.wbg.__wbg_length_f217bbbf7e8e4df4 = function(arg0) {
|
|
619
617
|
const ret = getObject(arg0).length;
|
|
620
618
|
return ret;
|
|
621
619
|
};
|
|
622
|
-
imports.wbg.
|
|
620
|
+
imports.wbg.__wbg_new_034f913e7636e987 = function() {
|
|
623
621
|
const ret = new Array();
|
|
624
622
|
return addHeapObject(ret);
|
|
625
623
|
};
|
|
626
|
-
imports.wbg.
|
|
624
|
+
imports.wbg.__wbg_new_7a87a0376e40533b = function() {
|
|
627
625
|
const ret = new Map();
|
|
628
626
|
return addHeapObject(ret);
|
|
629
627
|
};
|
|
630
|
-
imports.wbg.
|
|
628
|
+
imports.wbg.__wbg_next_13b477da1eaa3897 = function(arg0) {
|
|
631
629
|
const ret = getObject(arg0).next;
|
|
632
630
|
return addHeapObject(ret);
|
|
633
631
|
};
|
|
634
|
-
imports.wbg.
|
|
632
|
+
imports.wbg.__wbg_next_b06e115d1b01e10b = function() { return handleError(function (arg0) {
|
|
635
633
|
const ret = getObject(arg0).next();
|
|
636
634
|
return addHeapObject(ret);
|
|
637
635
|
}, arguments) };
|
|
638
|
-
imports.wbg.
|
|
636
|
+
imports.wbg.__wbg_done_983b5ffcaec8c583 = function(arg0) {
|
|
639
637
|
const ret = getObject(arg0).done;
|
|
640
638
|
return ret;
|
|
641
639
|
};
|
|
642
|
-
imports.wbg.
|
|
640
|
+
imports.wbg.__wbg_value_2ab8a198c834c26a = function(arg0) {
|
|
643
641
|
const ret = getObject(arg0).value;
|
|
644
642
|
return addHeapObject(ret);
|
|
645
643
|
};
|
|
646
|
-
imports.wbg.
|
|
644
|
+
imports.wbg.__wbg_iterator_695d699a44d6234c = function() {
|
|
647
645
|
const ret = Symbol.iterator;
|
|
648
646
|
return addHeapObject(ret);
|
|
649
647
|
};
|
|
650
|
-
imports.wbg.
|
|
648
|
+
imports.wbg.__wbg_get_ef828680c64da212 = function() { return handleError(function (arg0, arg1) {
|
|
651
649
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
652
650
|
return addHeapObject(ret);
|
|
653
651
|
}, arguments) };
|
|
654
|
-
imports.wbg.
|
|
652
|
+
imports.wbg.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) {
|
|
655
653
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
656
654
|
return addHeapObject(ret);
|
|
657
655
|
}, arguments) };
|
|
658
|
-
imports.wbg.
|
|
656
|
+
imports.wbg.__wbg_new_e69b5f66fda8f13c = function() {
|
|
659
657
|
const ret = new Object();
|
|
660
658
|
return addHeapObject(ret);
|
|
661
659
|
};
|
|
662
|
-
imports.wbg.
|
|
660
|
+
imports.wbg.__wbg_set_425e70f7c64ac962 = function(arg0, arg1, arg2) {
|
|
663
661
|
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
664
662
|
};
|
|
665
|
-
imports.wbg.
|
|
663
|
+
imports.wbg.__wbg_isArray_6f3b47f09adb61b5 = function(arg0) {
|
|
666
664
|
const ret = Array.isArray(getObject(arg0));
|
|
667
665
|
return ret;
|
|
668
666
|
};
|
|
669
|
-
imports.wbg.
|
|
667
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function(arg0) {
|
|
670
668
|
let result;
|
|
671
669
|
try {
|
|
672
670
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -676,11 +674,11 @@ function __wbg_get_imports() {
|
|
|
676
674
|
const ret = result;
|
|
677
675
|
return ret;
|
|
678
676
|
};
|
|
679
|
-
imports.wbg.
|
|
677
|
+
imports.wbg.__wbg_new_70a2f23d1565c04c = function(arg0, arg1) {
|
|
680
678
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
681
679
|
return addHeapObject(ret);
|
|
682
680
|
};
|
|
683
|
-
imports.wbg.
|
|
681
|
+
imports.wbg.__wbg_instanceof_Map_f96986929e7e89ed = function(arg0) {
|
|
684
682
|
let result;
|
|
685
683
|
try {
|
|
686
684
|
result = getObject(arg0) instanceof Map;
|
|
@@ -690,38 +688,38 @@ function __wbg_get_imports() {
|
|
|
690
688
|
const ret = result;
|
|
691
689
|
return ret;
|
|
692
690
|
};
|
|
693
|
-
imports.wbg.
|
|
691
|
+
imports.wbg.__wbg_set_277a63e77c89279f = function(arg0, arg1, arg2) {
|
|
694
692
|
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
695
693
|
return addHeapObject(ret);
|
|
696
694
|
};
|
|
697
|
-
imports.wbg.
|
|
695
|
+
imports.wbg.__wbg_isSafeInteger_b9dff570f01a9100 = function(arg0) {
|
|
698
696
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
699
697
|
return ret;
|
|
700
698
|
};
|
|
701
|
-
imports.wbg.
|
|
699
|
+
imports.wbg.__wbg_entries_c02034de337d3ee2 = function(arg0) {
|
|
702
700
|
const ret = Object.entries(getObject(arg0));
|
|
703
701
|
return addHeapObject(ret);
|
|
704
702
|
};
|
|
705
|
-
imports.wbg.
|
|
703
|
+
imports.wbg.__wbg_fromCodePoint_a9176a674cd93db9 = function() { return handleError(function (arg0) {
|
|
706
704
|
const ret = String.fromCodePoint(arg0 >>> 0);
|
|
707
705
|
return addHeapObject(ret);
|
|
708
706
|
}, arguments) };
|
|
709
|
-
imports.wbg.
|
|
707
|
+
imports.wbg.__wbg_buffer_ccaed51a635d8a2d = function(arg0) {
|
|
710
708
|
const ret = getObject(arg0).buffer;
|
|
711
709
|
return addHeapObject(ret);
|
|
712
710
|
};
|
|
713
|
-
imports.wbg.
|
|
711
|
+
imports.wbg.__wbg_new_fec2611eb9180f95 = function(arg0) {
|
|
714
712
|
const ret = new Uint8Array(getObject(arg0));
|
|
715
713
|
return addHeapObject(ret);
|
|
716
714
|
};
|
|
717
|
-
imports.wbg.
|
|
715
|
+
imports.wbg.__wbg_set_ec2fcf81bc573fd9 = function(arg0, arg1, arg2) {
|
|
718
716
|
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
719
717
|
};
|
|
720
|
-
imports.wbg.
|
|
718
|
+
imports.wbg.__wbg_length_9254c4bd3b9f23c4 = function(arg0) {
|
|
721
719
|
const ret = getObject(arg0).length;
|
|
722
720
|
return ret;
|
|
723
721
|
};
|
|
724
|
-
imports.wbg.
|
|
722
|
+
imports.wbg.__wbg_instanceof_Uint8Array_df0761410414ef36 = function(arg0) {
|
|
725
723
|
let result;
|
|
726
724
|
try {
|
|
727
725
|
result = getObject(arg0) instanceof Uint8Array;
|
|
@@ -774,10 +772,13 @@ function initSync(module) {
|
|
|
774
772
|
if (wasm !== undefined) return wasm;
|
|
775
773
|
|
|
776
774
|
|
|
777
|
-
if (typeof module !== 'undefined'
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
775
|
+
if (typeof module !== 'undefined') {
|
|
776
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
777
|
+
({module} = module)
|
|
778
|
+
} else {
|
|
779
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
780
|
+
}
|
|
781
|
+
}
|
|
781
782
|
|
|
782
783
|
const imports = __wbg_get_imports();
|
|
783
784
|
|
|
@@ -796,10 +797,13 @@ async function __wbg_init(module_or_path) {
|
|
|
796
797
|
if (wasm !== undefined) return wasm;
|
|
797
798
|
|
|
798
799
|
|
|
799
|
-
if (typeof module_or_path !== 'undefined'
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
800
|
+
if (typeof module_or_path !== 'undefined') {
|
|
801
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
802
|
+
({module_or_path} = module_or_path)
|
|
803
|
+
} else {
|
|
804
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
805
|
+
}
|
|
806
|
+
}
|
|
803
807
|
|
|
804
808
|
if (typeof module_or_path === 'undefined') {
|
|
805
809
|
module_or_path = new URL('ruff_wasm_bg.wasm', import.meta.url);
|
package/ruff_wasm_bg.wasm
CHANGED
|
Binary file
|