Skip to content

Commit 6d0d7cc

Browse files
authored
feat: support cjs and esm both by tshy (#1)
BREAKING CHANGE: drop Node.js < 18.19.0 support part of eggjs/egg#3644 eggjs/egg#5257 - change mime-db to 1.52.0 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Rebranded the package as “@eggjs/compressible” with enhanced TypeScript support, updated module exports, and improved type definitions. - **Documentation** - Revised the README with new badges, installation instructions, usage examples, and contributor information. - Updated LICENSE with a new copyright entry. - **Refactor** - Migrated the core compressibility functionality from JavaScript to a streamlined TypeScript implementation. - **Tests** - Added comprehensive tests to ensure robust handling of various MIME type inputs. - **Chores** - Improved development tooling and updated CI workflows for build, release, and package publishing. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 58478ed commit 6d0d7cc

File tree

19 files changed

+277
-558
lines changed

19 files changed

+277
-558
lines changed

.eslintrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": [
3+
"eslint-config-egg/typescript",
4+
"eslint-config-egg/lib/rules/enforce-node-prefix"
5+
]
6+
}

.eslintrc.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 0 additions & 223 deletions
This file was deleted.

.github/workflows/nodejs.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
Job:
11+
name: Node.js
12+
uses: node-modules/github-actions/.github/workflows/node-test.yml@master
13+
with:
14+
version: '18.19.0, 20, 22'
15+
secrets:
16+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/pkg.pr.new.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish Any Commit
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v4
11+
12+
- run: corepack enable
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: 20
16+
17+
- name: Install dependencies
18+
run: npm install
19+
20+
- name: Build
21+
run: npm run prepublishOnly --if-present
22+
23+
- run: npx pkg-pr-new publish

.github/workflows/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
7+
jobs:
8+
release:
9+
name: Node.js
10+
uses: eggjs/github-actions/.github/workflows/node-release.yml@master
11+
secrets:
12+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
13+
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}

.github/workflows/scorecard.yml

Lines changed: 0 additions & 72 deletions
This file was deleted.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ coverage
33
node_modules
44
npm-debug.log
55
package-lock.json
6+
.tshy*
7+
.eslintcache
8+
dist
File renamed without changes.

LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Copyright (c) 2013 Jonathan Ong <[email protected]>
44
Copyright (c) 2014 Jeremiah Senkpiel <[email protected]>
55
Copyright (c) 2015 Douglas Christopher Wilson <[email protected]>
6+
Copyright (c) 2025 - present eggjs and the contributors.
67

78
Permission is hereby granted, free of charge, to any person obtaining
89
a copy of this software and associated documentation files (the

0 commit comments

Comments
 (0)