-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: rm dynamic load for repl module * fix(deno): add process polyfill fix(deno): fix internal esm > cjs reexport * chore: tweak up polyfill * chore: tweak up deno process polyfill * chore(deno): `process.version` polyfill * chore(deno): tweak up process polyfill * refactor: explicit process module ref * chore: deno process tweak ups * chore: byte shrinking * chore: build-js tweak up * test: tweak up flaky test
- Loading branch information
1 parent
3f36969
commit 704bf34
Showing
11 changed files
with
38 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
import { createRequire } from 'node:module' | ||
import * as process from 'node:process' | ||
|
||
const require = createRequire(import.meta.url) | ||
const __filename = new URL(import.meta.url).pathname | ||
const __dirname = new URL('.', import.meta.url).pathname | ||
|
||
// prettier-ignore | ||
if (globalThis.Deno) { | ||
globalThis.require = require | ||
globalThis.__filename = __filename | ||
globalThis.__dirname = __dirname | ||
globalThis.module = new Proxy({}, { set() { return true } }) | ||
|
||
const p = globalThis.process = globalThis.process || process | ||
p.version || (p.version = 'v18.0.0') | ||
p.version || (p.version = { node: '18.0.0' }) | ||
p.env || (p.env = globalThis.Deno.env.toObject()) | ||
p.argv || (p.argv = [globalThis.Deno.execPath(), globalThis.Deno.mainModule.replace('file://', ''), ...globalThis.Deno.args]) | ||
} | ||
|
||
export { require, __dirname, __filename } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,8 @@ | |
// limitations under the License. | ||
|
||
import { assert } from 'https://deno.land/[email protected]/assert/assert.ts' | ||
import '../../build/globals.js' | ||
import { $ } from '../../build/index.js' | ||
import '../../build/cli.js' | ||
|
||
Deno.test('deno smoke test', async () => { | ||
// smoke test | ||
|