Skip to content

Commit

Permalink
port to ts, modernize everything
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 19, 2024
1 parent 7ed0876 commit 0e45b2d
Show file tree
Hide file tree
Showing 35 changed files with 3,955 additions and 7,034 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
build:
strategy:
matrix:
node-version: [12.x, 14.x, 16.x, 17.x]
node-version: [18.x, 20.x, 21.x]
platform:
- os: ubuntu-latest
shell: bash
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/commit-if-modified.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/copyright-year.sh

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/isaacs-makework.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/package-json-repo.js

This file was deleted.

50 changes: 50 additions & 0 deletions .github/workflows/typedoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages

on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Nodejs ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install dependencies
run: npm install
- name: Generate typedocs
run: npm run typedoc

- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './docs'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
node_modules/
coverage/
.nyc_output/
nyc_output/
/dist/
/.tap
/node_modules/
9 changes: 9 additions & 0 deletions .tshy/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "../src",
"target": "es2022",
"module": "nodenext",
"moduleResolution": "nodenext"
}
}
14 changes: 14 additions & 0 deletions .tshy/commonjs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "./build.json",
"include": [
"../src/**/*.ts",
"../src/**/*.cts",
"../src/**/*.tsx"
],
"exclude": [
"../src/**/*.mts"
],
"compilerOptions": {
"outDir": "../.tshy-build/commonjs"
}
}
12 changes: 12 additions & 0 deletions .tshy/esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "./build.json",
"include": [
"../src/**/*.ts",
"../src/**/*.mts",
"../src/**/*.tsx"
],
"exclude": [],
"compilerOptions": {
"outDir": "../.tshy-build/esm"
}
}
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This module was created to serve the needs of

Brotli is supported in versions of node with a Brotli binding.

## How does this differ from the streams in `require('zlib')`?
## How does this differ from the streams in `'node:zlib'`?

First, there are no convenience methods to compress or decompress a
buffer. If you want those, use the built-in `zlib` module. This is
Expand Down Expand Up @@ -45,9 +45,11 @@ provided by that class.
## USAGE

```js
const zlib = require('minizlib')
import { BrotliDecompress } from 'minizlib'
// or: const BrotliDecompress = require('minizlib')

const input = sourceOfCompressedData()
const decode = new zlib.BrotliDecompress()
const decode = new BrotliDecompress()
const output = whereToWriteTheDecodedData()
input.pipe(decode).pipe(output)
```
Expand Down
Loading

0 comments on commit 0e45b2d

Please sign in to comment.