From ee4710f96270ba0ed4ceb6f939078404a50fd294 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Wed, 22 Dec 2021 20:29:09 -0500 Subject: [PATCH] feat: add `@deno/shim-deno` package (#68) --- .gitattributes | 2 +- .github/workflows/ci.yml | 10 ++-- .gitmodules | 4 +- .vscode/project.code-workspace | 16 +++--- README.md | 4 +- deno.json | 34 +++++++----- package-lock.json | 6 +-- package.json | 4 +- packages/deno.ns/src/global.ts | 10 ---- packages/deno.ns/src/hacks/web-streams.ts | 39 -------------- packages/deno.ns/src/index.ts | 52 ------------------- packages/{deno.ns => shim-deno}/LICENSE | 0 packages/{deno.ns => shim-deno}/PROGRESS.md | 8 +-- packages/{deno.ns => shim-deno}/README.md | 24 +-------- .../lib/shim-deno.lib.d.ts} | 44 +--------------- .../{deno.ns => shim-deno}/package-lock.json | 22 ++------ packages/{deno.ns => shim-deno}/package.json | 13 ++--- packages/{deno.ns => shim-deno}/src/deno.ts | 0 .../src/deno/internal/Conn.ts | 2 +- .../src/deno/internal/Listener.ts | 0 .../src/deno/internal/consts.ts | 0 .../src/deno/internal/errorMap.ts | 0 .../src/deno/internal/fs_flags.ts | 0 .../src/deno/internal/iterutil.ts | 0 .../src/deno/internal/random_id.ts | 0 .../src/deno/internal/streams.test.ts | 0 .../src/deno/internal/streams.ts | 0 .../src/deno/internal/test.ts | 0 .../src/deno/internal/version.ts | 0 .../src/deno/stable/classes.ts | 0 .../src/deno/stable/classes/File.ts | 0 .../deno/stable/classes/PermissionStatus.ts | 0 .../src/deno/stable/classes/Permissions.ts | 0 .../src/deno/stable/enums.ts | 0 .../src/deno/stable/enums/SeekMode.ts | 0 .../src/deno/stable/functions.ts | 0 .../src/deno/stable/functions/chdir.ts | 0 .../src/deno/stable/functions/chmod.ts | 0 .../src/deno/stable/functions/chmodSync.ts | 0 .../src/deno/stable/functions/chown.ts | 0 .../src/deno/stable/functions/chownSync.ts | 0 .../src/deno/stable/functions/close.ts | 0 .../src/deno/stable/functions/connect.ts | 0 .../src/deno/stable/functions/connectTls.ts | 0 .../src/deno/stable/functions/copy.ts | 0 .../src/deno/stable/functions/copyFile.ts | 0 .../src/deno/stable/functions/copyFileSync.ts | 0 .../src/deno/stable/functions/create.ts | 0 .../src/deno/stable/functions/createSync.ts | 0 .../src/deno/stable/functions/cwd.ts | 0 .../src/deno/stable/functions/execPath.ts | 0 .../src/deno/stable/functions/exit.ts | 0 .../src/deno/stable/functions/fdatasync.ts | 0 .../deno/stable/functions/fdatasyncSync.ts | 0 .../src/deno/stable/functions/fstat.ts | 0 .../src/deno/stable/functions/fstatSync.ts | 0 .../src/deno/stable/functions/fsync.ts | 0 .../src/deno/stable/functions/fsyncSync.ts | 0 .../src/deno/stable/functions/ftruncate.ts | 0 .../deno/stable/functions/ftruncateSync.ts | 0 .../src/deno/stable/functions/inspect.ts | 0 .../src/deno/stable/functions/kill.ts | 0 .../src/deno/stable/functions/link.ts | 0 .../src/deno/stable/functions/linkSync.ts | 0 .../src/deno/stable/functions/listen.ts | 0 .../src/deno/stable/functions/listenTls.ts | 0 .../src/deno/stable/functions/lstat.ts | 0 .../src/deno/stable/functions/lstatSync.ts | 0 .../src/deno/stable/functions/makeTempDir.ts | 0 .../deno/stable/functions/makeTempDirSync.ts | 0 .../src/deno/stable/functions/makeTempFile.ts | 0 .../deno/stable/functions/makeTempFileSync.ts | 0 .../src/deno/stable/functions/memoryUsage.ts | 0 .../src/deno/stable/functions/mkdir.ts | 0 .../src/deno/stable/functions/mkdirSync.ts | 0 .../src/deno/stable/functions/open.ts | 0 .../src/deno/stable/functions/openSync.ts | 0 .../src/deno/stable/functions/read.ts | 0 .../src/deno/stable/functions/readDir.ts | 0 .../src/deno/stable/functions/readDirSync.ts | 0 .../src/deno/stable/functions/readFile.ts | 0 .../src/deno/stable/functions/readFileSync.ts | 0 .../src/deno/stable/functions/readLink.ts | 0 .../src/deno/stable/functions/readLinkSync.ts | 0 .../src/deno/stable/functions/readSync.ts | 0 .../src/deno/stable/functions/readTextFile.ts | 0 .../deno/stable/functions/readTextFileSync.ts | 0 .../src/deno/stable/functions/realPath.ts | 0 .../src/deno/stable/functions/realPathSync.ts | 0 .../src/deno/stable/functions/remove.ts | 0 .../src/deno/stable/functions/removeSync.ts | 0 .../src/deno/stable/functions/rename.ts | 0 .../src/deno/stable/functions/renameSync.ts | 0 .../src/deno/stable/functions/run.test.ts | 0 .../src/deno/stable/functions/run.ts | 0 .../src/deno/stable/functions/shutdown.ts | 0 .../src/deno/stable/functions/sleepSync.ts | 0 .../src/deno/stable/functions/stat.ts | 0 .../src/deno/stable/functions/statSync.ts | 0 .../src/deno/stable/functions/symlink.ts | 0 .../src/deno/stable/functions/symlinkSync.ts | 0 .../src/deno/stable/functions/test.ts | 0 .../src/deno/stable/functions/truncate.ts | 0 .../src/deno/stable/functions/truncateSync.ts | 0 .../src/deno/stable/functions/watchFs.ts | 0 .../src/deno/stable/functions/write.ts | 0 .../src/deno/stable/functions/writeFile.ts | 0 .../deno/stable/functions/writeFileSync.ts | 0 .../src/deno/stable/functions/writeSync.ts | 0 .../deno/stable/functions/writeTextFile.ts | 0 .../stable/functions/writeTextFileSync.ts | 0 .../src/deno/stable/main.ts | 0 .../src/deno/stable/types.js | 0 .../src/deno/stable/types.ts | 2 - .../src/deno/stable/variables.ts | 0 .../src/deno/stable/variables/args.ts | 0 .../src/deno/stable/variables/build.ts | 0 .../deno/stable/variables/customInspect.ts | 0 .../src/deno/stable/variables/env.ts | 0 .../src/deno/stable/variables/errors.ts | 0 .../src/deno/stable/variables/mainModule.ts | 0 .../src/deno/stable/variables/metrics.ts | 2 +- .../src/deno/stable/variables/noColor.ts | 0 .../src/deno/stable/variables/permissions.ts | 0 .../src/deno/stable/variables/pid.ts | 0 .../src/deno/stable/variables/ppid.ts | 0 .../src/deno/stable/variables/resources.ts | 2 +- .../src/deno/stable/variables/std.ts | 0 .../src/deno/stable/variables/version.ts | 0 .../src/deno/unstable/main.ts | 0 packages/shim-deno/src/index.ts | 1 + .../{deno.ns => shim-deno}/src/package.json | 0 .../{deno.ns => shim-deno}/third_party/deno | 0 .../third_party/package.json | 0 .../tools/.vscode/settings.json | 0 .../{deno.ns => shim-deno}/tools/denolib.ts | 0 packages/{deno.ns => shim-deno}/tools/deps.ts | 0 .../tools/generateDeclarationFile.ts | 19 +------ .../{deno.ns => shim-deno}/tools/missing.ts | 0 .../tools/run_tests.mjs | 47 ++++++++++++++++- .../{deno.ns => shim-deno}/tools/untested.sh | 0 .../tools/working_test_files.txt | 0 packages/{deno.ns => shim-deno}/tsconfig.json | 2 +- packages/shim-prompts/package.json | 6 +-- packages/shim-timers/package.json | 6 +-- 145 files changed, 119 insertions(+), 262 deletions(-) delete mode 100644 packages/deno.ns/src/global.ts delete mode 100644 packages/deno.ns/src/hacks/web-streams.ts delete mode 100644 packages/deno.ns/src/index.ts rename packages/{deno.ns => shim-deno}/LICENSE (100%) rename packages/{deno.ns => shim-deno}/PROGRESS.md (98%) rename packages/{deno.ns => shim-deno}/README.md (51%) rename packages/{deno.ns/lib/deno.ns.lib.d.ts => shim-deno/lib/shim-deno.lib.d.ts} (98%) rename packages/{deno.ns => shim-deno}/package-lock.json (95%) rename packages/{deno.ns => shim-deno}/package.json (83%) rename packages/{deno.ns => shim-deno}/src/deno.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/internal/Conn.ts (91%) rename packages/{deno.ns => shim-deno}/src/deno/internal/Listener.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/internal/consts.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/internal/errorMap.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/internal/fs_flags.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/internal/iterutil.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/internal/random_id.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/internal/streams.test.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/internal/streams.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/internal/test.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/internal/version.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/classes.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/classes/File.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/classes/PermissionStatus.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/classes/Permissions.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/enums.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/enums/SeekMode.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/chdir.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/chmod.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/chmodSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/chown.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/chownSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/close.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/connect.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/connectTls.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/copy.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/copyFile.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/copyFileSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/create.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/createSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/cwd.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/execPath.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/exit.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/fdatasync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/fdatasyncSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/fstat.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/fstatSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/fsync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/fsyncSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/ftruncate.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/ftruncateSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/inspect.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/kill.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/link.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/linkSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/listen.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/listenTls.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/lstat.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/lstatSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/makeTempDir.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/makeTempDirSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/makeTempFile.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/makeTempFileSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/memoryUsage.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/mkdir.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/mkdirSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/open.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/openSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/read.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/readDir.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/readDirSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/readFile.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/readFileSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/readLink.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/readLinkSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/readSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/readTextFile.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/readTextFileSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/realPath.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/realPathSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/remove.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/removeSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/rename.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/renameSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/run.test.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/run.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/shutdown.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/sleepSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/stat.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/statSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/symlink.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/symlinkSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/test.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/truncate.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/truncateSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/watchFs.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/write.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/writeFile.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/writeFileSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/writeSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/writeTextFile.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/functions/writeTextFileSync.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/main.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/types.js (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/types.ts (96%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/args.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/build.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/customInspect.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/env.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/errors.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/mainModule.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/metrics.ts (93%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/noColor.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/permissions.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/pid.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/ppid.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/resources.ts (88%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/std.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/stable/variables/version.ts (100%) rename packages/{deno.ns => shim-deno}/src/deno/unstable/main.ts (100%) create mode 100644 packages/shim-deno/src/index.ts rename packages/{deno.ns => shim-deno}/src/package.json (100%) rename packages/{deno.ns => shim-deno}/third_party/deno (100%) rename packages/{deno.ns => shim-deno}/third_party/package.json (100%) rename packages/{deno.ns => shim-deno}/tools/.vscode/settings.json (100%) rename packages/{deno.ns => shim-deno}/tools/denolib.ts (100%) rename packages/{deno.ns => shim-deno}/tools/deps.ts (100%) rename packages/{deno.ns => shim-deno}/tools/generateDeclarationFile.ts (95%) rename packages/{deno.ns => shim-deno}/tools/missing.ts (100%) rename packages/{deno.ns => shim-deno}/tools/run_tests.mjs (80%) rename packages/{deno.ns => shim-deno}/tools/untested.sh (100%) rename packages/{deno.ns => shim-deno}/tools/working_test_files.txt (100%) rename packages/{deno.ns => shim-deno}/tsconfig.json (89%) diff --git a/.gitattributes b/.gitattributes index 3fab650..71dc576 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1 @@ -packages/deno.ns/lib/deno.ns.lib.d.ts linguist-generated=true +packages/shim-deno/lib/shim-deno.lib.d.ts linguist-generated=true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80c6bfe..8b6daf0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - run: (cd packages/deno.ns/third_party/deno; git submodule update --init --depth=1 test_util/std) + - run: (cd packages/shim-deno/third_party/deno; git submodule update --init --depth=1 test_util/std) shell: bash - uses: actions/setup-node@v2 with: @@ -35,12 +35,12 @@ jobs: - run: npm ci --ignore-scripts - run: npm run --silent test --workspaces - run: npm run --silent prepare --workspaces - - run: cd packages/deno.ns && tools/missing.ts || echo "Some items are missing" + - run: cd packages/shim-deno && tools/missing.ts || echo "Some items are missing" if: matrix.os == 'ubuntu-latest' - - run: cd packages/deno.ns && tools/untested.sh + - run: cd packages/shim-deno && tools/untested.sh if: matrix.os == 'ubuntu-latest' - name: npm publish - if: matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/deno.ns' + if: matrix.os == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/node-shims' env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: cd packages/deno.ns && npm publish + run: cd packages/shim-deno && npm publish diff --git a/.gitmodules b/.gitmodules index e35ab19..64d3be3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "packages/deno.ns/third_party/deno"] - path = packages/deno.ns/third_party/deno +[submodule "packages/shim-deno/third_party/deno"] + path = packages/shim-deno/third_party/deno url = https://github.com/denoland/deno diff --git a/.vscode/project.code-workspace b/.vscode/project.code-workspace index cac0dcd..62c70d4 100644 --- a/.vscode/project.code-workspace +++ b/.vscode/project.code-workspace @@ -5,16 +5,16 @@ "path": "../" }, { - "name": "deno.ns", - "path": "../packages/deno.ns/src/" + "name": "shim-deno", + "path": "../packages/shim-deno/src/" }, { - "name": "deno.ns-tools", - "path": "../packages/deno.ns/tools" + "name": "shim-deno-tools", + "path": "../packages/shim-deno/tools" }, { "name": "third_party", - "path": "../packages/deno.ns/third_party" + "path": "../packages/shim-deno/third_party" }, { "name": "shim-timers", @@ -28,9 +28,9 @@ "**/.hg": true, "**/CVS": true, "**/.DS_Store": true, - "packages/deno.ns/src/": true, - "packages/deno.ns/tools/": true, - "packages/deno.ns/third_party/": true + "packages/shim-deno/src/": true, + "packages/shim-deno/tools/": true, + "packages/shim-deno/third_party/": true } } } \ No newline at end of file diff --git a/README.md b/README.md index 92fe96d..6135cd2 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# `deno.ns` +# node-shims Deno shims for Node.js ## Packages -- [deno.ns](packages/deno.ns) - Deno namespace shim. +- [@deno/shim-deno](packages/shim-deno) - Deno namespace shim. - [@deno/shim-prompts](packages/shim-prompts) - Shims for `alert`, `confirm` and `prompt`. - [@deno/shim-timers](packages/shim-timers) - Shims for `setTimeout` and diff --git a/deno.json b/deno.json index 5156f8d..513fada 100644 --- a/deno.json +++ b/deno.json @@ -3,12 +3,17 @@ "files": { "exclude": [ "node_modules", - "packages/deno.ns/node_modules", - "packages/deno.ns/dist", - "packages/deno.ns/src/deno/stable/lib.deno.d.ts", - "packages/deno.ns/src/deno/unstable/lib.deno.unstable.d.ts", - "packages/deno.ns/lib", - "packages/deno.ns/third_party" + "dist", + "packages/shim-deno/dist", + "packages/shim-deno/node_modules", + "packages/shim-deno/src/deno/stable/lib.deno.d.ts", + "packages/shim-deno/src/deno/unstable/lib.deno.unstable.d.ts", + "packages/shim-deno/lib", + "packages/shim-deno/third_party", + "packages/shim-prompts/dist", + "packages/shim-prompts/node_modules", + "packages/shim-timers/dist", + "packages/shim-timers/node_modules" ] }, "rules": { @@ -19,12 +24,17 @@ "files": { "exclude": [ "node_modules", - "packages/deno.ns/node_modules", - "packages/deno.ns/dist", - "packages/deno.ns/src/deno/stable/lib.deno.d.ts", - "packages/deno.ns/src/deno/unstable/lib.deno.unstable.d.ts", - "packages/deno.ns/lib", - "packages/deno.ns/third_party" + "dist", + "packages/shim-deno/dist", + "packages/shim-deno/node_modules", + "packages/shim-deno/src/deno/stable/lib.deno.d.ts", + "packages/shim-deno/src/deno/unstable/lib.deno.unstable.d.ts", + "packages/shim-deno/lib", + "packages/shim-deno/third_party", + "packages/shim-prompts/dist", + "packages/shim-prompts/node_modules", + "packages/shim-timers/dist", + "packages/shim-timers/node_modules" ] } } diff --git a/package-lock.json b/package-lock.json index 431b255..1f19930 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "deno.ns-workspace", + "name": "node-shims-workspace", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "deno.ns-workspace", + "name": "node-shims-workspace", "workspaces": [ - "packages/deno.ns", + "packages/shim-deno", "packages/shim-prompts", "packages/shim-timers" ] diff --git a/package.json b/package.json index 2150d52..cc5c134 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "deno.ns-workspace", + "name": "node-shimsworkspace", "workspaces": [ - "packages/deno.ns", + "packages/shim-deno", "packages/shim-prompts", "packages/shim-timers" ], diff --git a/packages/deno.ns/src/global.ts b/packages/deno.ns/src/global.ts deleted file mode 100644 index dbdd24c..0000000 --- a/packages/deno.ns/src/global.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as globals from "./index.js"; -// Adds WhatWG Streams to globalThis -import "./hacks/web-streams.js"; - -Object.assign( - globalThis, - Object.fromEntries( - Object.entries(globals).filter(([k]) => !(k in globalThis)), - ), -); diff --git a/packages/deno.ns/src/hacks/web-streams.ts b/packages/deno.ns/src/hacks/web-streams.ts deleted file mode 100644 index 06d9393..0000000 --- a/packages/deno.ns/src/hacks/web-streams.ts +++ /dev/null @@ -1,39 +0,0 @@ -// based on https://github.com/node-fetch/fetch-blob/blob/46476faf498dec035ab91b5a2d0fccd279629bce/streams.cjs - -/* c8 ignore start */ -// 64 KiB (same size chrome slice theirs blob into Uint8array's) -const POOL_SIZE = 65536; - -try { - if (!globalThis.ReadableStream) { - Object.assign(globalThis, require("stream/web")); - } - const { Blob } = require("buffer"); - if (Blob && !Blob.prototype.stream) { - Blob.prototype.stream = function name() { - let position = 0; - //deno-lint-ignore no-this-alias - const blob = this; - - return new ReadableStream({ - type: "bytes", - async pull(ctrl) { - const chunk = blob.slice( - position, - Math.min(blob.size, position + POOL_SIZE), - ); - const buffer = await chunk.arrayBuffer(); - position += buffer.byteLength; - ctrl.enqueue(new Uint8Array(buffer)); - - if (position === blob.size) { - ctrl.close(); - } - }, - }); - }; - } -} catch { - // ignore failures -} -/* c8 ignore end */ diff --git a/packages/deno.ns/src/index.ts b/packages/deno.ns/src/index.ts deleted file mode 100644 index 740fad1..0000000 --- a/packages/deno.ns/src/index.ts +++ /dev/null @@ -1,52 +0,0 @@ -export { webcrypto as crypto } from "crypto"; -export * as Deno from "./deno.js"; - -// TODO: Wait for node builtin WhatWG Streams or fetch-blob to export them without assigning to globalThis -import * as undici from "undici"; -import { Blob as BufferBlob } from "buffer"; - -// fallback to using the global types and values if they exist - -/** @removeExportKeyword */ -export type GlobalThisPrototypeType = - (typeof globalThis) extends { - [P in TKey]: { - prototype: infer T; - }; - } ? T - : FallbackType; - -/** @removeExportKeyword */ -export type GlobalThisType = - (typeof globalThis) extends { - [P in TKey]: infer T; - } ? T - : FallbackType; - -export type Blob = GlobalThisPrototypeType<"Blob", BufferBlob>; -export const Blob: GlobalThisType<"Blob", typeof BufferBlob> = - (globalThis as any)["Blob"] ?? BufferBlob; - -export const fetch: GlobalThisType<"fetch", typeof undici.fetch> = - (globalThis as any)["fetch"] ?? - undici.fetch; - -export type File = GlobalThisPrototypeType<"File", undici.File>; -export const File: GlobalThisType<"File", typeof undici.File> = - (globalThis as any)["File"] ?? undici.File; - -export type FormData = GlobalThisPrototypeType<"FormData", undici.FormData>; -export const FormData: GlobalThisType<"FormData", typeof undici.FormData> = - (globalThis as any)["FormData"] ?? undici.FormData; - -export type Headers = GlobalThisPrototypeType<"Headers", undici.Headers>; -export const Headers: GlobalThisType<"Headers", typeof undici.Headers> = - (globalThis as any)["Headers"] ?? undici.Headers; - -export type Request = GlobalThisPrototypeType<"Request", undici.Request>; -export const Request: GlobalThisType<"Request", typeof undici.Request> = - (globalThis as any)["Request"] ?? undici.Request; - -export type Response = GlobalThisPrototypeType<"Response", undici.Response>; -export const Response: GlobalThisType<"Response", typeof undici.Response> = - (globalThis as any)["Response"] ?? undici.Response; diff --git a/packages/deno.ns/LICENSE b/packages/shim-deno/LICENSE similarity index 100% rename from packages/deno.ns/LICENSE rename to packages/shim-deno/LICENSE diff --git a/packages/deno.ns/PROGRESS.md b/packages/shim-deno/PROGRESS.md similarity index 98% rename from packages/deno.ns/PROGRESS.md rename to packages/shim-deno/PROGRESS.md index 6a116ff..eb11e33 100644 --- a/packages/deno.ns/PROGRESS.md +++ b/packages/shim-deno/PROGRESS.md @@ -1,6 +1,6 @@ # Stable Progress -91%. 13 stable members to go: +90%. 15 stable members to go: - [x] ๐Ÿ‘ป **`Addr`** - [ ] ๐Ÿ‘Ž **`Buffer`** @@ -17,7 +17,7 @@ - [x] ๐Ÿ‘ป **`FsEventFlag`** - [x] ๐Ÿ‘ป **`FsWatcher`** - [x] ๐Ÿ‘ป **`HrtimePermissionDescriptor`** -- [x] ๐Ÿ‘ป **`HttpConn`** +- [ ] ๐Ÿ‘ป **`HttpConn`** - [x] ๐Ÿ‘ป **`InspectOptions`** - [x] ๐Ÿ‘ป **`ListenOptions`** - [x] ๐Ÿ‘ป **`ListenTlsOptions`** @@ -45,7 +45,7 @@ - [x] ๐Ÿ‘ป **`ReaderSync`** - [ ] ๐Ÿ‘ป **`RecordType`** - [x] ๐Ÿ‘ป **`RemoveOptions`** -- [x] ๐Ÿ‘ป **`RequestEvent`** +- [ ] ๐Ÿ‘ป **`RequestEvent`** - [ ] ๐Ÿ‘ป **`ResolveDnsOptions`** - [x] ๐Ÿ‘ป **`ResourceMap`** - [x] ๐Ÿ‘ป **`RunOptions`** @@ -230,7 +230,7 @@ - [ ] ๐Ÿงช **`removeSignalListener`** - [x] **`run`** - [ ] ๐Ÿงช **`setRaw`** -- [ ] ๐Ÿงช **`sleepSync`** +- [x] ๐Ÿงช **`sleepSync`** - [ ] **`systemMemoryInfo`** - [ ] ๐Ÿงช **`umask`** - [ ] ๐Ÿงช **`unrefTimer`** diff --git a/packages/deno.ns/README.md b/packages/shim-deno/README.md similarity index 51% rename from packages/deno.ns/README.md rename to packages/shim-deno/README.md index 20ed47d..c5a9220 100644 --- a/packages/deno.ns/README.md +++ b/packages/shim-deno/README.md @@ -1,29 +1,9 @@ -# `deno.ns` +# @deno/shim-deno [`Deno` namespace](https://doc.deno.land/builtin/stable) shim for Node.js. See -[PROGRESS.md](https://github.com/denoland/deno.ns/blob/main/packages/deno.ns/PROGRESS.md) - -## Usage - -```js -const { - Blob, - crypto, - Deno, - fetch, - File, - FormData, - Headers, - Request, - Response, -} = require("deno.ns"); -``` - -or `node --require=deno.ns/global `, - -or https://github.com/wojpawlik/deno2node#shimming +[PROGRESS.md](https://github.com/denoland/node-shims/blob/main/packages/shim-deno/PROGRESS.md) ## Acknowledgements diff --git a/packages/deno.ns/lib/deno.ns.lib.d.ts b/packages/shim-deno/lib/shim-deno.lib.d.ts similarity index 98% rename from packages/deno.ns/lib/deno.ns.lib.d.ts rename to packages/shim-deno/lib/shim-deno.lib.d.ts index de8fdd7..6937561 100644 --- a/packages/deno.ns/lib/deno.ns.lib.d.ts +++ b/packages/shim-deno/lib/shim-deno.lib.d.ts @@ -3,8 +3,6 @@ /// import { URL } from "url"; -import * as undici from "undici"; -import { Blob as BufferBlob } from "buffer"; /** * EventTarget is a DOM interface implemented by objects that can receive events @@ -162,28 +160,6 @@ interface EventListenerObject { declare type EventListenerOrEventListenerObject = | EventListener | EventListenerObject; -export { webcrypto as crypto } from "crypto"; -declare type GlobalThisPrototypeType = (typeof globalThis) extends { - [P in TKey]: { - prototype: infer T; - }; - } ? T : FallbackType; -declare type GlobalThisType = (typeof globalThis) extends { - [P in TKey]: infer T; - } ? T : FallbackType; -export declare type Blob = GlobalThisPrototypeType<"Blob", BufferBlob>; -export declare const Blob: GlobalThisType<"Blob", typeof BufferBlob>; -export declare const fetch: GlobalThisType<"fetch", typeof undici.fetch>; -export declare type File = GlobalThisPrototypeType<"File", undici.File>; -export declare const File: GlobalThisType<"File", typeof undici.File>; -export declare type FormData = GlobalThisPrototypeType<"FormData", undici.FormData>; -export declare const FormData: GlobalThisType<"FormData", typeof undici.FormData>; -export declare type Headers = GlobalThisPrototypeType<"Headers", undici.Headers>; -export declare const Headers: GlobalThisType<"Headers", typeof undici.Headers>; -export declare type Request = GlobalThisPrototypeType<"Request", undici.Request>; -export declare const Request: GlobalThisType<"Request", typeof undici.Request>; -export declare type Response = GlobalThisPrototypeType<"Response", undici.Response>; -export declare const Response: GlobalThisType<"Response", typeof undici.Response>; export declare namespace Deno { export class File implements Deno.File { @@ -1816,12 +1792,6 @@ export declare namespace Deno { name: "hrtime"; } - export interface HttpConn extends AsyncIterable { - readonly rid: number; - nextRequest(): Promise; - close(): void; - } - export interface InspectOptions { /** Stylize output with ANSI colors. Defaults to false. */ colors?: boolean; @@ -2141,11 +2111,6 @@ export declare namespace Deno { recursive?: boolean; } - export interface RequestEvent { - readonly request: Request; - respondWith(r: Response | Promise): Promise; - } - export interface ResourceMap { [rid: number]: any; } @@ -2807,14 +2772,7 @@ export declare namespace Deno { export function sleepSync(millis: number): void; } -declare module "deno.ns/deno" { - export = Deno; -} - -declare module "deno.ns/global" { -} - -declare module "deno.ns/test-internals" { +declare module "@deno/shim-deno/test-internals" { /** Reference to the array that `Deno.test` calls insert their definition into. */ export const testDefinitions: Deno.TestDefinition[]; } diff --git a/packages/deno.ns/package-lock.json b/packages/shim-deno/package-lock.json similarity index 95% rename from packages/deno.ns/package-lock.json rename to packages/shim-deno/package-lock.json index b532ee0..d39de9f 100644 --- a/packages/deno.ns/package-lock.json +++ b/packages/shim-deno/package-lock.json @@ -1,15 +1,14 @@ { - "name": "deno.ns", - "version": "0.8.0", + "name": "@deno/shim-deno", + "version": "0.1.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "deno.ns", - "version": "0.8.0", + "name": "@deno/shim-deno", + "version": "0.1.0", "license": "MIT", "dependencies": { - "undici": "^4.5.1", "which": "^2.0.2" }, "devDependencies": { @@ -186,14 +185,6 @@ "node": ">=4.2.0" } }, - "node_modules/undici": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-4.8.1.tgz", - "integrity": "sha512-0HYfUmepa5euTv3ewj9OqJDiBrZrBEr4o8HPdNHeWOsPCLLXZSBVovW+D3D1LoFeGXhe5Bm2V/e7YJatUjeWfQ==", - "engines": { - "node": ">=12.18" - } - }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", @@ -337,11 +328,6 @@ "integrity": "sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==", "dev": true }, - "undici": { - "version": "4.8.1", - "resolved": "https://registry.npmjs.org/undici/-/undici-4.8.1.tgz", - "integrity": "sha512-0HYfUmepa5euTv3ewj9OqJDiBrZrBEr4o8HPdNHeWOsPCLLXZSBVovW+D3D1LoFeGXhe5Bm2V/e7YJatUjeWfQ==" - }, "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/packages/deno.ns/package.json b/packages/shim-deno/package.json similarity index 83% rename from packages/deno.ns/package.json rename to packages/shim-deno/package.json index 46db9eb..475a971 100644 --- a/packages/deno.ns/package.json +++ b/packages/shim-deno/package.json @@ -1,6 +1,6 @@ { - "name": "deno.ns", - "version": "0.8.0", + "name": "@deno/shim-deno", + "version": "0.1.0", "description": "Deno namespace shim for Node.js", "keywords": [ "deno namespace", @@ -10,7 +10,7 @@ "shim" ], "main": "./dist/index.js", - "types": "./lib/deno.ns.lib.d.ts", + "types": "./lib/shim-deno.lib.d.ts", "author": "Thomas Rory Gummerson (https://trgwii.no/)", "contributors": [ "Wojciech Pawlik ", @@ -19,17 +19,15 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/denoland/deno.ns.git" + "url": "https://github.com/denoland/node-shims.git" }, "exports": { ".": "./dist/index.js", - "./global": "./dist/global.js", - "./deno": "./dist/deno.js", "./test-internals": "./dist/deno/internal/test.js" }, "files": [ "dist", - "lib/deno.ns.lib.d.ts" + "lib/shim-deno.lib.d.ts" ], "scripts": { "build": "tsc", @@ -44,7 +42,6 @@ "node": ">=16.7.0" }, "dependencies": { - "undici": "^4.5.1", "which": "^2.0.2" }, "devDependencies": { diff --git a/packages/deno.ns/src/deno.ts b/packages/shim-deno/src/deno.ts similarity index 100% rename from packages/deno.ns/src/deno.ts rename to packages/shim-deno/src/deno.ts diff --git a/packages/deno.ns/src/deno/internal/Conn.ts b/packages/shim-deno/src/deno/internal/Conn.ts similarity index 91% rename from packages/deno.ns/src/deno/internal/Conn.ts rename to packages/shim-deno/src/deno/internal/Conn.ts index c03ebda..5303e15 100644 --- a/packages/deno.ns/src/deno/internal/Conn.ts +++ b/packages/shim-deno/src/deno/internal/Conn.ts @@ -24,7 +24,7 @@ export class Conn extends File implements Deno.Conn { export class TlsConn extends Conn implements Deno.TlsConn { handshake(): Promise { - console.warn("deno.ns: Handshake is not supported."); + console.warn("@deno/shim-deno: Handshake is not supported."); return Promise.resolve({ alpnProtocol: null, }); diff --git a/packages/deno.ns/src/deno/internal/Listener.ts b/packages/shim-deno/src/deno/internal/Listener.ts similarity index 100% rename from packages/deno.ns/src/deno/internal/Listener.ts rename to packages/shim-deno/src/deno/internal/Listener.ts diff --git a/packages/deno.ns/src/deno/internal/consts.ts b/packages/shim-deno/src/deno/internal/consts.ts similarity index 100% rename from packages/deno.ns/src/deno/internal/consts.ts rename to packages/shim-deno/src/deno/internal/consts.ts diff --git a/packages/deno.ns/src/deno/internal/errorMap.ts b/packages/shim-deno/src/deno/internal/errorMap.ts similarity index 100% rename from packages/deno.ns/src/deno/internal/errorMap.ts rename to packages/shim-deno/src/deno/internal/errorMap.ts diff --git a/packages/deno.ns/src/deno/internal/fs_flags.ts b/packages/shim-deno/src/deno/internal/fs_flags.ts similarity index 100% rename from packages/deno.ns/src/deno/internal/fs_flags.ts rename to packages/shim-deno/src/deno/internal/fs_flags.ts diff --git a/packages/deno.ns/src/deno/internal/iterutil.ts b/packages/shim-deno/src/deno/internal/iterutil.ts similarity index 100% rename from packages/deno.ns/src/deno/internal/iterutil.ts rename to packages/shim-deno/src/deno/internal/iterutil.ts diff --git a/packages/deno.ns/src/deno/internal/random_id.ts b/packages/shim-deno/src/deno/internal/random_id.ts similarity index 100% rename from packages/deno.ns/src/deno/internal/random_id.ts rename to packages/shim-deno/src/deno/internal/random_id.ts diff --git a/packages/deno.ns/src/deno/internal/streams.test.ts b/packages/shim-deno/src/deno/internal/streams.test.ts similarity index 100% rename from packages/deno.ns/src/deno/internal/streams.test.ts rename to packages/shim-deno/src/deno/internal/streams.test.ts diff --git a/packages/deno.ns/src/deno/internal/streams.ts b/packages/shim-deno/src/deno/internal/streams.ts similarity index 100% rename from packages/deno.ns/src/deno/internal/streams.ts rename to packages/shim-deno/src/deno/internal/streams.ts diff --git a/packages/deno.ns/src/deno/internal/test.ts b/packages/shim-deno/src/deno/internal/test.ts similarity index 100% rename from packages/deno.ns/src/deno/internal/test.ts rename to packages/shim-deno/src/deno/internal/test.ts diff --git a/packages/deno.ns/src/deno/internal/version.ts b/packages/shim-deno/src/deno/internal/version.ts similarity index 100% rename from packages/deno.ns/src/deno/internal/version.ts rename to packages/shim-deno/src/deno/internal/version.ts diff --git a/packages/deno.ns/src/deno/stable/classes.ts b/packages/shim-deno/src/deno/stable/classes.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/classes.ts rename to packages/shim-deno/src/deno/stable/classes.ts diff --git a/packages/deno.ns/src/deno/stable/classes/File.ts b/packages/shim-deno/src/deno/stable/classes/File.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/classes/File.ts rename to packages/shim-deno/src/deno/stable/classes/File.ts diff --git a/packages/deno.ns/src/deno/stable/classes/PermissionStatus.ts b/packages/shim-deno/src/deno/stable/classes/PermissionStatus.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/classes/PermissionStatus.ts rename to packages/shim-deno/src/deno/stable/classes/PermissionStatus.ts diff --git a/packages/deno.ns/src/deno/stable/classes/Permissions.ts b/packages/shim-deno/src/deno/stable/classes/Permissions.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/classes/Permissions.ts rename to packages/shim-deno/src/deno/stable/classes/Permissions.ts diff --git a/packages/deno.ns/src/deno/stable/enums.ts b/packages/shim-deno/src/deno/stable/enums.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/enums.ts rename to packages/shim-deno/src/deno/stable/enums.ts diff --git a/packages/deno.ns/src/deno/stable/enums/SeekMode.ts b/packages/shim-deno/src/deno/stable/enums/SeekMode.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/enums/SeekMode.ts rename to packages/shim-deno/src/deno/stable/enums/SeekMode.ts diff --git a/packages/deno.ns/src/deno/stable/functions.ts b/packages/shim-deno/src/deno/stable/functions.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions.ts rename to packages/shim-deno/src/deno/stable/functions.ts diff --git a/packages/deno.ns/src/deno/stable/functions/chdir.ts b/packages/shim-deno/src/deno/stable/functions/chdir.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/chdir.ts rename to packages/shim-deno/src/deno/stable/functions/chdir.ts diff --git a/packages/deno.ns/src/deno/stable/functions/chmod.ts b/packages/shim-deno/src/deno/stable/functions/chmod.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/chmod.ts rename to packages/shim-deno/src/deno/stable/functions/chmod.ts diff --git a/packages/deno.ns/src/deno/stable/functions/chmodSync.ts b/packages/shim-deno/src/deno/stable/functions/chmodSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/chmodSync.ts rename to packages/shim-deno/src/deno/stable/functions/chmodSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/chown.ts b/packages/shim-deno/src/deno/stable/functions/chown.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/chown.ts rename to packages/shim-deno/src/deno/stable/functions/chown.ts diff --git a/packages/deno.ns/src/deno/stable/functions/chownSync.ts b/packages/shim-deno/src/deno/stable/functions/chownSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/chownSync.ts rename to packages/shim-deno/src/deno/stable/functions/chownSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/close.ts b/packages/shim-deno/src/deno/stable/functions/close.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/close.ts rename to packages/shim-deno/src/deno/stable/functions/close.ts diff --git a/packages/deno.ns/src/deno/stable/functions/connect.ts b/packages/shim-deno/src/deno/stable/functions/connect.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/connect.ts rename to packages/shim-deno/src/deno/stable/functions/connect.ts diff --git a/packages/deno.ns/src/deno/stable/functions/connectTls.ts b/packages/shim-deno/src/deno/stable/functions/connectTls.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/connectTls.ts rename to packages/shim-deno/src/deno/stable/functions/connectTls.ts diff --git a/packages/deno.ns/src/deno/stable/functions/copy.ts b/packages/shim-deno/src/deno/stable/functions/copy.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/copy.ts rename to packages/shim-deno/src/deno/stable/functions/copy.ts diff --git a/packages/deno.ns/src/deno/stable/functions/copyFile.ts b/packages/shim-deno/src/deno/stable/functions/copyFile.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/copyFile.ts rename to packages/shim-deno/src/deno/stable/functions/copyFile.ts diff --git a/packages/deno.ns/src/deno/stable/functions/copyFileSync.ts b/packages/shim-deno/src/deno/stable/functions/copyFileSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/copyFileSync.ts rename to packages/shim-deno/src/deno/stable/functions/copyFileSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/create.ts b/packages/shim-deno/src/deno/stable/functions/create.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/create.ts rename to packages/shim-deno/src/deno/stable/functions/create.ts diff --git a/packages/deno.ns/src/deno/stable/functions/createSync.ts b/packages/shim-deno/src/deno/stable/functions/createSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/createSync.ts rename to packages/shim-deno/src/deno/stable/functions/createSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/cwd.ts b/packages/shim-deno/src/deno/stable/functions/cwd.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/cwd.ts rename to packages/shim-deno/src/deno/stable/functions/cwd.ts diff --git a/packages/deno.ns/src/deno/stable/functions/execPath.ts b/packages/shim-deno/src/deno/stable/functions/execPath.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/execPath.ts rename to packages/shim-deno/src/deno/stable/functions/execPath.ts diff --git a/packages/deno.ns/src/deno/stable/functions/exit.ts b/packages/shim-deno/src/deno/stable/functions/exit.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/exit.ts rename to packages/shim-deno/src/deno/stable/functions/exit.ts diff --git a/packages/deno.ns/src/deno/stable/functions/fdatasync.ts b/packages/shim-deno/src/deno/stable/functions/fdatasync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/fdatasync.ts rename to packages/shim-deno/src/deno/stable/functions/fdatasync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/fdatasyncSync.ts b/packages/shim-deno/src/deno/stable/functions/fdatasyncSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/fdatasyncSync.ts rename to packages/shim-deno/src/deno/stable/functions/fdatasyncSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/fstat.ts b/packages/shim-deno/src/deno/stable/functions/fstat.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/fstat.ts rename to packages/shim-deno/src/deno/stable/functions/fstat.ts diff --git a/packages/deno.ns/src/deno/stable/functions/fstatSync.ts b/packages/shim-deno/src/deno/stable/functions/fstatSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/fstatSync.ts rename to packages/shim-deno/src/deno/stable/functions/fstatSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/fsync.ts b/packages/shim-deno/src/deno/stable/functions/fsync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/fsync.ts rename to packages/shim-deno/src/deno/stable/functions/fsync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/fsyncSync.ts b/packages/shim-deno/src/deno/stable/functions/fsyncSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/fsyncSync.ts rename to packages/shim-deno/src/deno/stable/functions/fsyncSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/ftruncate.ts b/packages/shim-deno/src/deno/stable/functions/ftruncate.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/ftruncate.ts rename to packages/shim-deno/src/deno/stable/functions/ftruncate.ts diff --git a/packages/deno.ns/src/deno/stable/functions/ftruncateSync.ts b/packages/shim-deno/src/deno/stable/functions/ftruncateSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/ftruncateSync.ts rename to packages/shim-deno/src/deno/stable/functions/ftruncateSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/inspect.ts b/packages/shim-deno/src/deno/stable/functions/inspect.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/inspect.ts rename to packages/shim-deno/src/deno/stable/functions/inspect.ts diff --git a/packages/deno.ns/src/deno/stable/functions/kill.ts b/packages/shim-deno/src/deno/stable/functions/kill.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/kill.ts rename to packages/shim-deno/src/deno/stable/functions/kill.ts diff --git a/packages/deno.ns/src/deno/stable/functions/link.ts b/packages/shim-deno/src/deno/stable/functions/link.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/link.ts rename to packages/shim-deno/src/deno/stable/functions/link.ts diff --git a/packages/deno.ns/src/deno/stable/functions/linkSync.ts b/packages/shim-deno/src/deno/stable/functions/linkSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/linkSync.ts rename to packages/shim-deno/src/deno/stable/functions/linkSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/listen.ts b/packages/shim-deno/src/deno/stable/functions/listen.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/listen.ts rename to packages/shim-deno/src/deno/stable/functions/listen.ts diff --git a/packages/deno.ns/src/deno/stable/functions/listenTls.ts b/packages/shim-deno/src/deno/stable/functions/listenTls.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/listenTls.ts rename to packages/shim-deno/src/deno/stable/functions/listenTls.ts diff --git a/packages/deno.ns/src/deno/stable/functions/lstat.ts b/packages/shim-deno/src/deno/stable/functions/lstat.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/lstat.ts rename to packages/shim-deno/src/deno/stable/functions/lstat.ts diff --git a/packages/deno.ns/src/deno/stable/functions/lstatSync.ts b/packages/shim-deno/src/deno/stable/functions/lstatSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/lstatSync.ts rename to packages/shim-deno/src/deno/stable/functions/lstatSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/makeTempDir.ts b/packages/shim-deno/src/deno/stable/functions/makeTempDir.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/makeTempDir.ts rename to packages/shim-deno/src/deno/stable/functions/makeTempDir.ts diff --git a/packages/deno.ns/src/deno/stable/functions/makeTempDirSync.ts b/packages/shim-deno/src/deno/stable/functions/makeTempDirSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/makeTempDirSync.ts rename to packages/shim-deno/src/deno/stable/functions/makeTempDirSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/makeTempFile.ts b/packages/shim-deno/src/deno/stable/functions/makeTempFile.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/makeTempFile.ts rename to packages/shim-deno/src/deno/stable/functions/makeTempFile.ts diff --git a/packages/deno.ns/src/deno/stable/functions/makeTempFileSync.ts b/packages/shim-deno/src/deno/stable/functions/makeTempFileSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/makeTempFileSync.ts rename to packages/shim-deno/src/deno/stable/functions/makeTempFileSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/memoryUsage.ts b/packages/shim-deno/src/deno/stable/functions/memoryUsage.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/memoryUsage.ts rename to packages/shim-deno/src/deno/stable/functions/memoryUsage.ts diff --git a/packages/deno.ns/src/deno/stable/functions/mkdir.ts b/packages/shim-deno/src/deno/stable/functions/mkdir.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/mkdir.ts rename to packages/shim-deno/src/deno/stable/functions/mkdir.ts diff --git a/packages/deno.ns/src/deno/stable/functions/mkdirSync.ts b/packages/shim-deno/src/deno/stable/functions/mkdirSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/mkdirSync.ts rename to packages/shim-deno/src/deno/stable/functions/mkdirSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/open.ts b/packages/shim-deno/src/deno/stable/functions/open.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/open.ts rename to packages/shim-deno/src/deno/stable/functions/open.ts diff --git a/packages/deno.ns/src/deno/stable/functions/openSync.ts b/packages/shim-deno/src/deno/stable/functions/openSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/openSync.ts rename to packages/shim-deno/src/deno/stable/functions/openSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/read.ts b/packages/shim-deno/src/deno/stable/functions/read.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/read.ts rename to packages/shim-deno/src/deno/stable/functions/read.ts diff --git a/packages/deno.ns/src/deno/stable/functions/readDir.ts b/packages/shim-deno/src/deno/stable/functions/readDir.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/readDir.ts rename to packages/shim-deno/src/deno/stable/functions/readDir.ts diff --git a/packages/deno.ns/src/deno/stable/functions/readDirSync.ts b/packages/shim-deno/src/deno/stable/functions/readDirSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/readDirSync.ts rename to packages/shim-deno/src/deno/stable/functions/readDirSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/readFile.ts b/packages/shim-deno/src/deno/stable/functions/readFile.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/readFile.ts rename to packages/shim-deno/src/deno/stable/functions/readFile.ts diff --git a/packages/deno.ns/src/deno/stable/functions/readFileSync.ts b/packages/shim-deno/src/deno/stable/functions/readFileSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/readFileSync.ts rename to packages/shim-deno/src/deno/stable/functions/readFileSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/readLink.ts b/packages/shim-deno/src/deno/stable/functions/readLink.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/readLink.ts rename to packages/shim-deno/src/deno/stable/functions/readLink.ts diff --git a/packages/deno.ns/src/deno/stable/functions/readLinkSync.ts b/packages/shim-deno/src/deno/stable/functions/readLinkSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/readLinkSync.ts rename to packages/shim-deno/src/deno/stable/functions/readLinkSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/readSync.ts b/packages/shim-deno/src/deno/stable/functions/readSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/readSync.ts rename to packages/shim-deno/src/deno/stable/functions/readSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/readTextFile.ts b/packages/shim-deno/src/deno/stable/functions/readTextFile.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/readTextFile.ts rename to packages/shim-deno/src/deno/stable/functions/readTextFile.ts diff --git a/packages/deno.ns/src/deno/stable/functions/readTextFileSync.ts b/packages/shim-deno/src/deno/stable/functions/readTextFileSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/readTextFileSync.ts rename to packages/shim-deno/src/deno/stable/functions/readTextFileSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/realPath.ts b/packages/shim-deno/src/deno/stable/functions/realPath.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/realPath.ts rename to packages/shim-deno/src/deno/stable/functions/realPath.ts diff --git a/packages/deno.ns/src/deno/stable/functions/realPathSync.ts b/packages/shim-deno/src/deno/stable/functions/realPathSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/realPathSync.ts rename to packages/shim-deno/src/deno/stable/functions/realPathSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/remove.ts b/packages/shim-deno/src/deno/stable/functions/remove.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/remove.ts rename to packages/shim-deno/src/deno/stable/functions/remove.ts diff --git a/packages/deno.ns/src/deno/stable/functions/removeSync.ts b/packages/shim-deno/src/deno/stable/functions/removeSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/removeSync.ts rename to packages/shim-deno/src/deno/stable/functions/removeSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/rename.ts b/packages/shim-deno/src/deno/stable/functions/rename.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/rename.ts rename to packages/shim-deno/src/deno/stable/functions/rename.ts diff --git a/packages/deno.ns/src/deno/stable/functions/renameSync.ts b/packages/shim-deno/src/deno/stable/functions/renameSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/renameSync.ts rename to packages/shim-deno/src/deno/stable/functions/renameSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/run.test.ts b/packages/shim-deno/src/deno/stable/functions/run.test.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/run.test.ts rename to packages/shim-deno/src/deno/stable/functions/run.test.ts diff --git a/packages/deno.ns/src/deno/stable/functions/run.ts b/packages/shim-deno/src/deno/stable/functions/run.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/run.ts rename to packages/shim-deno/src/deno/stable/functions/run.ts diff --git a/packages/deno.ns/src/deno/stable/functions/shutdown.ts b/packages/shim-deno/src/deno/stable/functions/shutdown.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/shutdown.ts rename to packages/shim-deno/src/deno/stable/functions/shutdown.ts diff --git a/packages/deno.ns/src/deno/stable/functions/sleepSync.ts b/packages/shim-deno/src/deno/stable/functions/sleepSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/sleepSync.ts rename to packages/shim-deno/src/deno/stable/functions/sleepSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/stat.ts b/packages/shim-deno/src/deno/stable/functions/stat.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/stat.ts rename to packages/shim-deno/src/deno/stable/functions/stat.ts diff --git a/packages/deno.ns/src/deno/stable/functions/statSync.ts b/packages/shim-deno/src/deno/stable/functions/statSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/statSync.ts rename to packages/shim-deno/src/deno/stable/functions/statSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/symlink.ts b/packages/shim-deno/src/deno/stable/functions/symlink.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/symlink.ts rename to packages/shim-deno/src/deno/stable/functions/symlink.ts diff --git a/packages/deno.ns/src/deno/stable/functions/symlinkSync.ts b/packages/shim-deno/src/deno/stable/functions/symlinkSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/symlinkSync.ts rename to packages/shim-deno/src/deno/stable/functions/symlinkSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/test.ts b/packages/shim-deno/src/deno/stable/functions/test.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/test.ts rename to packages/shim-deno/src/deno/stable/functions/test.ts diff --git a/packages/deno.ns/src/deno/stable/functions/truncate.ts b/packages/shim-deno/src/deno/stable/functions/truncate.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/truncate.ts rename to packages/shim-deno/src/deno/stable/functions/truncate.ts diff --git a/packages/deno.ns/src/deno/stable/functions/truncateSync.ts b/packages/shim-deno/src/deno/stable/functions/truncateSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/truncateSync.ts rename to packages/shim-deno/src/deno/stable/functions/truncateSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/watchFs.ts b/packages/shim-deno/src/deno/stable/functions/watchFs.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/watchFs.ts rename to packages/shim-deno/src/deno/stable/functions/watchFs.ts diff --git a/packages/deno.ns/src/deno/stable/functions/write.ts b/packages/shim-deno/src/deno/stable/functions/write.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/write.ts rename to packages/shim-deno/src/deno/stable/functions/write.ts diff --git a/packages/deno.ns/src/deno/stable/functions/writeFile.ts b/packages/shim-deno/src/deno/stable/functions/writeFile.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/writeFile.ts rename to packages/shim-deno/src/deno/stable/functions/writeFile.ts diff --git a/packages/deno.ns/src/deno/stable/functions/writeFileSync.ts b/packages/shim-deno/src/deno/stable/functions/writeFileSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/writeFileSync.ts rename to packages/shim-deno/src/deno/stable/functions/writeFileSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/writeSync.ts b/packages/shim-deno/src/deno/stable/functions/writeSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/writeSync.ts rename to packages/shim-deno/src/deno/stable/functions/writeSync.ts diff --git a/packages/deno.ns/src/deno/stable/functions/writeTextFile.ts b/packages/shim-deno/src/deno/stable/functions/writeTextFile.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/writeTextFile.ts rename to packages/shim-deno/src/deno/stable/functions/writeTextFile.ts diff --git a/packages/deno.ns/src/deno/stable/functions/writeTextFileSync.ts b/packages/shim-deno/src/deno/stable/functions/writeTextFileSync.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/functions/writeTextFileSync.ts rename to packages/shim-deno/src/deno/stable/functions/writeTextFileSync.ts diff --git a/packages/deno.ns/src/deno/stable/main.ts b/packages/shim-deno/src/deno/stable/main.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/main.ts rename to packages/shim-deno/src/deno/stable/main.ts diff --git a/packages/deno.ns/src/deno/stable/types.js b/packages/shim-deno/src/deno/stable/types.js similarity index 100% rename from packages/deno.ns/src/deno/stable/types.js rename to packages/shim-deno/src/deno/stable/types.js diff --git a/packages/deno.ns/src/deno/stable/types.ts b/packages/shim-deno/src/deno/stable/types.ts similarity index 96% rename from packages/deno.ns/src/deno/stable/types.ts rename to packages/shim-deno/src/deno/stable/types.ts index 00e2000..9fd0c78 100644 --- a/packages/deno.ns/src/deno/stable/types.ts +++ b/packages/shim-deno/src/deno/stable/types.ts @@ -12,7 +12,6 @@ export type FsEvent = Deno.FsEvent; export type FsEventFlag = Deno.FsEventFlag; export type FsWatcher = Deno.FsWatcher; export type HrtimePermissionDescriptor = Deno.HrtimePermissionDescriptor; -export type HttpConn = Deno.HttpConn; export type InspectOptions = Deno.InspectOptions; export type Listener = Deno.Listener; export type ListenOptions = Deno.ListenOptions; @@ -35,7 +34,6 @@ export type ReaderSync = Deno.ReaderSync; export type ReadFileOptions = Deno.ReadFileOptions; export type ReadPermissionDescriptor = Deno.ReadPermissionDescriptor; export type RemoveOptions = Deno.RemoveOptions; -export type RequestEvent = Deno.RequestEvent; export type ResourceMap = Deno.ResourceMap; export type RunOptions = Deno.RunOptions; export type RunPermissionDescriptor = Deno.RunPermissionDescriptor; diff --git a/packages/deno.ns/src/deno/stable/variables.ts b/packages/shim-deno/src/deno/stable/variables.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables.ts rename to packages/shim-deno/src/deno/stable/variables.ts diff --git a/packages/deno.ns/src/deno/stable/variables/args.ts b/packages/shim-deno/src/deno/stable/variables/args.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables/args.ts rename to packages/shim-deno/src/deno/stable/variables/args.ts diff --git a/packages/deno.ns/src/deno/stable/variables/build.ts b/packages/shim-deno/src/deno/stable/variables/build.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables/build.ts rename to packages/shim-deno/src/deno/stable/variables/build.ts diff --git a/packages/deno.ns/src/deno/stable/variables/customInspect.ts b/packages/shim-deno/src/deno/stable/variables/customInspect.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables/customInspect.ts rename to packages/shim-deno/src/deno/stable/variables/customInspect.ts diff --git a/packages/deno.ns/src/deno/stable/variables/env.ts b/packages/shim-deno/src/deno/stable/variables/env.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables/env.ts rename to packages/shim-deno/src/deno/stable/variables/env.ts diff --git a/packages/deno.ns/src/deno/stable/variables/errors.ts b/packages/shim-deno/src/deno/stable/variables/errors.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables/errors.ts rename to packages/shim-deno/src/deno/stable/variables/errors.ts diff --git a/packages/deno.ns/src/deno/stable/variables/mainModule.ts b/packages/shim-deno/src/deno/stable/variables/mainModule.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables/mainModule.ts rename to packages/shim-deno/src/deno/stable/variables/mainModule.ts diff --git a/packages/deno.ns/src/deno/stable/variables/metrics.ts b/packages/shim-deno/src/deno/stable/variables/metrics.ts similarity index 93% rename from packages/deno.ns/src/deno/stable/variables/metrics.ts rename to packages/shim-deno/src/deno/stable/variables/metrics.ts index b65d929..fe7f7be 100644 --- a/packages/deno.ns/src/deno/stable/variables/metrics.ts +++ b/packages/shim-deno/src/deno/stable/variables/metrics.ts @@ -4,7 +4,7 @@ export const metrics: typeof Deno.metrics = function metrics() { console.warn( [ "Deno.metrics() shim returns a dummy object that does not update.", - "If you think this is a mistake, raise an issue at https://github.com/fromdeno/deno.ns/issues", + "If you think this is a mistake, raise an issue at https://github.com/denoland/node-shims/issues", ].join("\n"), ); diff --git a/packages/deno.ns/src/deno/stable/variables/noColor.ts b/packages/shim-deno/src/deno/stable/variables/noColor.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables/noColor.ts rename to packages/shim-deno/src/deno/stable/variables/noColor.ts diff --git a/packages/deno.ns/src/deno/stable/variables/permissions.ts b/packages/shim-deno/src/deno/stable/variables/permissions.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables/permissions.ts rename to packages/shim-deno/src/deno/stable/variables/permissions.ts diff --git a/packages/deno.ns/src/deno/stable/variables/pid.ts b/packages/shim-deno/src/deno/stable/variables/pid.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables/pid.ts rename to packages/shim-deno/src/deno/stable/variables/pid.ts diff --git a/packages/deno.ns/src/deno/stable/variables/ppid.ts b/packages/shim-deno/src/deno/stable/variables/ppid.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables/ppid.ts rename to packages/shim-deno/src/deno/stable/variables/ppid.ts diff --git a/packages/deno.ns/src/deno/stable/variables/resources.ts b/packages/shim-deno/src/deno/stable/variables/resources.ts similarity index 88% rename from packages/deno.ns/src/deno/stable/variables/resources.ts rename to packages/shim-deno/src/deno/stable/variables/resources.ts index 1959566..aa9e394 100644 --- a/packages/deno.ns/src/deno/stable/variables/resources.ts +++ b/packages/shim-deno/src/deno/stable/variables/resources.ts @@ -4,7 +4,7 @@ export const resources: typeof Deno.resources = function resources() { console.warn( [ "Deno.resources() shim returns a dummy object that does not update.", - "If you think this is a mistake, raise an issue at https://github.com/fromdeno/deno.ns/issues", + "If you think this is a mistake, raise an issue at https://github.com/denoland/node-shims/issues", ].join("\n"), ); diff --git a/packages/deno.ns/src/deno/stable/variables/std.ts b/packages/shim-deno/src/deno/stable/variables/std.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables/std.ts rename to packages/shim-deno/src/deno/stable/variables/std.ts diff --git a/packages/deno.ns/src/deno/stable/variables/version.ts b/packages/shim-deno/src/deno/stable/variables/version.ts similarity index 100% rename from packages/deno.ns/src/deno/stable/variables/version.ts rename to packages/shim-deno/src/deno/stable/variables/version.ts diff --git a/packages/deno.ns/src/deno/unstable/main.ts b/packages/shim-deno/src/deno/unstable/main.ts similarity index 100% rename from packages/deno.ns/src/deno/unstable/main.ts rename to packages/shim-deno/src/deno/unstable/main.ts diff --git a/packages/shim-deno/src/index.ts b/packages/shim-deno/src/index.ts new file mode 100644 index 0000000..466def1 --- /dev/null +++ b/packages/shim-deno/src/index.ts @@ -0,0 +1 @@ +export * as Deno from "./deno.js"; diff --git a/packages/deno.ns/src/package.json b/packages/shim-deno/src/package.json similarity index 100% rename from packages/deno.ns/src/package.json rename to packages/shim-deno/src/package.json diff --git a/packages/deno.ns/third_party/deno b/packages/shim-deno/third_party/deno similarity index 100% rename from packages/deno.ns/third_party/deno rename to packages/shim-deno/third_party/deno diff --git a/packages/deno.ns/third_party/package.json b/packages/shim-deno/third_party/package.json similarity index 100% rename from packages/deno.ns/third_party/package.json rename to packages/shim-deno/third_party/package.json diff --git a/packages/deno.ns/tools/.vscode/settings.json b/packages/shim-deno/tools/.vscode/settings.json similarity index 100% rename from packages/deno.ns/tools/.vscode/settings.json rename to packages/shim-deno/tools/.vscode/settings.json diff --git a/packages/deno.ns/tools/denolib.ts b/packages/shim-deno/tools/denolib.ts similarity index 100% rename from packages/deno.ns/tools/denolib.ts rename to packages/shim-deno/tools/denolib.ts diff --git a/packages/deno.ns/tools/deps.ts b/packages/shim-deno/tools/deps.ts similarity index 100% rename from packages/deno.ns/tools/deps.ts rename to packages/shim-deno/tools/deps.ts diff --git a/packages/deno.ns/tools/generateDeclarationFile.ts b/packages/shim-deno/tools/generateDeclarationFile.ts similarity index 95% rename from packages/deno.ns/tools/generateDeclarationFile.ts rename to packages/shim-deno/tools/generateDeclarationFile.ts index fba0c55..9a63646 100644 --- a/packages/deno.ns/tools/generateDeclarationFile.ts +++ b/packages/shim-deno/tools/generateDeclarationFile.ts @@ -30,8 +30,6 @@ statements.push((writer) => { .writeLine(`/// `) .blankLine() .writeLine(`import { URL } from "url";`) - .writeLine(`import * as undici from "undici";`) - .writeLine(`import { Blob as BufferBlob } from "buffer";`) .blankLine(); }); @@ -39,20 +37,7 @@ statements.push(...getMainStatements()); statements.push({ kind: StructureKind.Module, - name: `"deno.ns/deno"`, - statements: (writer) => { - writer.writeLine("export = Deno;"); - }, -}); - -statements.push({ - kind: StructureKind.Module, - name: `"deno.ns/global"`, -}); - -statements.push({ - kind: StructureKind.Module, - name: `"deno.ns/test-internals"`, + name: `"@deno/shim-deno/test-internals"`, statements: [ ...Array.from( fileExportsToStructures( @@ -78,7 +63,7 @@ const newProject = new Project({ }, }); const sourceFile = newProject.createSourceFile( - `./lib/deno.ns.lib.d.ts`, + `./lib/shim-deno.lib.d.ts`, { statements }, { overwrite: true }, ); diff --git a/packages/deno.ns/tools/missing.ts b/packages/shim-deno/tools/missing.ts similarity index 100% rename from packages/deno.ns/tools/missing.ts rename to packages/shim-deno/tools/missing.ts diff --git a/packages/deno.ns/tools/run_tests.mjs b/packages/shim-deno/tools/run_tests.mjs similarity index 80% rename from packages/deno.ns/tools/run_tests.mjs rename to packages/shim-deno/tools/run_tests.mjs index 97bae87..6bb6ed2 100644 --- a/packages/deno.ns/tools/run_tests.mjs +++ b/packages/shim-deno/tools/run_tests.mjs @@ -64,7 +64,7 @@ const testsToSkip = new Set([ "readDirPerm", // permissions // testing_test - "invalidStepArguments", // no test runner in deno.ns + "invalidStepArguments", // no test runner in shim-deno // timers_test "clearTimeoutShouldConvertToNumber", // Timeout is an object, not a number @@ -169,5 +169,48 @@ async function setupTests() { // let Deno tests access third_party/deno/cli/tests/fixture.json process.chdir("third_party/deno/"); - await import("../src/global.ts"); + globalThis.Deno = (await import("../src/index.ts")).Deno; + globalThis.Blob = (await import("buffer")).Blob; + await webStreamHack(); + + globalThis.crypto = (await import("crypto")).webcrypto; +} + +async function webStreamHack() { + // https://github.com/node-fetch/fetch-blob/blob/c5c2b5215446334bf496733d4cdb48a981b4c440/streams.cjs + // 64 KiB (same size chrome slice theirs blob into Uint8array's) + const POOL_SIZE = 65536; + + try { + if (!globalThis.ReadableStream) { + Object.assign(globalThis, await import("stream/web")); + } + const { Blob } = await import("buffer"); + if (Blob && !Blob.prototype.stream) { + Blob.prototype.stream = function name() { + let position = 0; + //deno-lint-ignore no-this-alias + const blob = this; + + return new ReadableStream({ + type: "bytes", + async pull(ctrl) { + const chunk = blob.slice( + position, + Math.min(blob.size, position + POOL_SIZE), + ); + const buffer = await chunk.arrayBuffer(); + position += buffer.byteLength; + ctrl.enqueue(new Uint8Array(buffer)); + + if (position === blob.size) { + ctrl.close(); + } + }, + }); + }; + } + } catch (_error) { + // ignore + } } diff --git a/packages/deno.ns/tools/untested.sh b/packages/shim-deno/tools/untested.sh similarity index 100% rename from packages/deno.ns/tools/untested.sh rename to packages/shim-deno/tools/untested.sh diff --git a/packages/deno.ns/tools/working_test_files.txt b/packages/shim-deno/tools/working_test_files.txt similarity index 100% rename from packages/deno.ns/tools/working_test_files.txt rename to packages/shim-deno/tools/working_test_files.txt diff --git a/packages/deno.ns/tsconfig.json b/packages/shim-deno/tsconfig.json similarity index 89% rename from packages/deno.ns/tsconfig.json rename to packages/shim-deno/tsconfig.json index bb74a33..0392b3b 100644 --- a/packages/deno.ns/tsconfig.json +++ b/packages/shim-deno/tsconfig.json @@ -16,5 +16,5 @@ "module": "ES2015" } }, - "files": ["src/index.ts", "src/global.ts"] + "files": ["src/index.ts"] } diff --git a/packages/shim-prompts/package.json b/packages/shim-prompts/package.json index 7534800..12a181a 100644 --- a/packages/shim-prompts/package.json +++ b/packages/shim-prompts/package.json @@ -14,7 +14,7 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/denoland/deno.ns.git" + "url": "git+https://github.com/denoland/node-shims.git" }, "keywords": [ "shim", @@ -25,9 +25,9 @@ "author": "The Deno authors", "license": "MIT", "bugs": { - "url": "https://github.com/denoland/deno.ns/issues" + "url": "https://github.com/denoland/node-shims/issues" }, - "homepage": "https://github.com/denoland/deno.ns#readme", + "homepage": "https://github.com/denoland/node-shims#readme", "devDependencies": { "@types/node": "^16.4.13", "typescript": "^4.5.2" diff --git a/packages/shim-timers/package.json b/packages/shim-timers/package.json index bcd58c5..845d095 100644 --- a/packages/shim-timers/package.json +++ b/packages/shim-timers/package.json @@ -14,7 +14,7 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/denoland/deno.ns.git" + "url": "git+https://github.com/denoland/node-shims.git" }, "keywords": [ "shim", @@ -25,9 +25,9 @@ "author": "The Deno authors", "license": "MIT", "bugs": { - "url": "https://github.com/denoland/deno.ns/issues" + "url": "https://github.com/denoland/node-shims/issues" }, - "homepage": "https://github.com/denoland/deno.ns#readme", + "homepage": "https://github.com/denoland/node-shims#readme", "devDependencies": { "typescript": "^4.5.2", "ts-node": "^10.4.0"