Skip to content

Commit

Permalink
feat: add @deno/shim-deno package (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsherret authored Dec 23, 2021
1 parent f4560b3 commit ee4710f
Show file tree
Hide file tree
Showing 145 changed files with 119 additions and 262 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -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
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
16 changes: 8 additions & 8 deletions .vscode/project.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
}
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
34 changes: 22 additions & 12 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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"
]
}
}
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "deno.ns-workspace",
"name": "node-shimsworkspace",
"workspaces": [
"packages/deno.ns",
"packages/shim-deno",
"packages/shim-prompts",
"packages/shim-timers"
],
Expand Down
10 changes: 0 additions & 10 deletions packages/deno.ns/src/global.ts

This file was deleted.

39 changes: 0 additions & 39 deletions packages/deno.ns/src/hacks/web-streams.ts

This file was deleted.

52 changes: 0 additions & 52 deletions packages/deno.ns/src/index.ts

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Stable Progress

91%. 13 stable members to go:
90%. 15 stable members to go:

- [x] 👻 **`Addr`**
- [ ] 👎 **`Buffer`**
Expand All @@ -17,7 +17,7 @@
- [x] 👻 **`FsEventFlag`**
- [x] 👻 **`FsWatcher`**
- [x] 👻 **`HrtimePermissionDescriptor`**
- [x] 👻 **`HttpConn`**
- [ ] 👻 **`HttpConn`**
- [x] 👻 **`InspectOptions`**
- [x] 👻 **`ListenOptions`**
- [x] 👻 **`ListenTlsOptions`**
Expand Down Expand Up @@ -45,7 +45,7 @@
- [x] 👻 **`ReaderSync`**
- [ ] 👻 **`RecordType`**
- [x] 👻 **`RemoveOptions`**
- [x] 👻 **`RequestEvent`**
- [ ] 👻 **`RequestEvent`**
- [ ] 👻 **`ResolveDnsOptions`**
- [x] 👻 **`ResourceMap`**
- [x] 👻 **`RunOptions`**
Expand Down Expand Up @@ -230,7 +230,7 @@
- [ ] 🧪 **`removeSignalListener`**
- [x] **`run`**
- [ ] 🧪 **`setRaw`**
- [ ] 🧪 **`sleepSync`**
- [x] 🧪 **`sleepSync`**
- [ ] **`systemMemoryInfo`**
- [ ] 🧪 **`umask`**
- [ ] 🧪 **`unrefTimer`**
Expand Down
24 changes: 2 additions & 22 deletions packages/deno.ns/README.md → packages/shim-deno/README.md
Original file line number Diff line number Diff line change
@@ -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 <denoBundleOutput>`,

or https://github.com/wojpawlik/deno2node#shimming
[PROGRESS.md](https://github.com/denoland/node-shims/blob/main/packages/shim-deno/PROGRESS.md)

## Acknowledgements

Expand Down
Loading

0 comments on commit ee4710f

Please sign in to comment.