Skip to content

Commit cb38e04

Browse files
chore: Define Deno shims that use node-compat imports (we don't allow url imports!)
1 parent c3fd76c commit cb38e04

39 files changed

Lines changed: 163 additions & 9 deletions
Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
// Incrementally enforcing some stricter rules
22
const strictConfig = require('../../../eslint.config.strict.js');
33

4-
module.exports = [
5-
...strictConfig,
6-
{
7-
files: ['src/shims/**/*.ts'],
8-
rules: {
9-
'@typescript-eslint/ban-ts-comment': 'off',
10-
},
11-
},
12-
];
4+
module.exports = [...strictConfig];
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
import { Duplex } from 'node:stream';
4+
export const from = Duplex.from;
5+
export const fromWeb = Duplex.fromWeb;
6+
export const toWeb = Duplex.toWeb;
7+
export { Duplex as default };
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
export { PassThrough as default } from 'node:stream';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
import { Readable } from 'node:stream';
4+
export { Readable as default };
5+
export const from = Readable.from;
6+
export const ReadableState = Readable.ReadableState;
7+
export const _fromList = Readable._fromList;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
export { Transform as default } from 'node:stream';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
import { Writable } from 'node:stream';
4+
export { Writable as default };
5+
export const WritableState = Writable.WritableState;
6+
export const fromWeb = Writable.fromWeb;
7+
export const toWeb = Writable.toWeb;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
export * from 'node:assert';
4+
export { default } from 'node:assert';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
export * from 'node:assert/strict';
4+
export { default } from 'node:assert/strict';
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
export * from 'node:async_hooks';
4+
export { default } from 'node:async_hooks';
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/* eslint-disable */
2+
// @ts-nocheck
3+
export * from 'node:buffer';
4+
import { default as buffer } from 'node:buffer';
5+
export const kMaxLength = 4294967296;
6+
buffer.kMaxLength = kMaxLength;
7+
export default buffer;

0 commit comments

Comments
 (0)