Skip to content

Commit 41bcf0d

Browse files
authored
Merge pull request #2672 from srod/release/v10.0.0
chore: release v10.0.0
2 parents 7f0afa7 + a7d7992 commit 41bcf0d

220 files changed

Lines changed: 9704 additions & 12896 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://unpkg.com/@changesets/config@3.0.3/schema.json",
3-
"changelog": "@changesets/cli/changelog",
3+
"changelog": ["@changesets/cli/changelog", { "repo": "srod/node-minify" }],
44
"commit": false,
55
"fixed": [],
66
"linked": [],

.editorconfig

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

.github/workflows/publish.yml

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,32 @@ on:
66
- main
77
workflow_dispatch:
88

9-
109
concurrency: ${{ github.workflow }}-${{ github.ref }}
1110

1211
jobs:
13-
publish:
14-
name: Publish
12+
release:
13+
name: 🦋 Changesets Release
1514
runs-on: ubuntu-latest
15+
outputs:
16+
published_packages: ${{ steps.changesets.outputs.publishedPackages }}
17+
published: ${{ steps.changesets.outputs.published }}
1618
steps:
17-
- name: Checkout Repo
18-
uses: actions/checkout@v4
19-
20-
- uses: pnpm/action-setup@v4
19+
- name: ⬇️ Checkout Repo
20+
uses: actions/checkout@v6
2121

22-
- name: Setup Node.js environment
23-
uses: actions/setup-node@v4
24-
with:
25-
node-version: 20
26-
cache: 'pnpm'
22+
- name: 📦 Setup Bun
23+
uses: oven-sh/setup-bun@v2
2724

28-
- name: Install dependencies
29-
run: pnpm install --frozen-lockfile
25+
- name: 📥 Install dependencies
26+
run: bun install --frozen-lockfile
3027

31-
- name: Create Release Pull Request or Publish to npm
28+
- name: 🚀 Create Release Pull Request or Publish to NPM
3229
uses: changesets/action@v1
3330
id: changesets
3431
with:
35-
publish: pnpm changeset:release
36-
version: pnpm changeset:version
32+
publish: bun changeset:release
33+
version: bun changeset:version
34+
createGithubReleases: false
3735
env:
3836
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3937
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,30 @@ jobs:
88
strategy:
99
matrix:
1010
os: [ubuntu-latest, windows-latest]
11-
node-version: [18.x, 20.x]
11+
node-version: [20.x, 22.x, 24.x]
1212
steps:
13-
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
14-
uses: actions/checkout@v4
13+
- name: Checkout
14+
uses: actions/checkout@v6
1515

16-
- uses: pnpm/action-setup@v2
17-
with:
18-
version: 8
16+
- name: Setup Bun
17+
uses: oven-sh/setup-bun@v2
1918

2019
- name: Set up JDK 11
21-
uses: actions/setup-java@v4
20+
uses: actions/setup-java@v5
2221
with:
2322
java-version: '11'
2423
distribution: 'adopt'
2524

26-
- name: Setup Node.js environment
27-
uses: actions/setup-node@v4
25+
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
26+
uses: actions/setup-node@v6
2827
with:
2928
node-version: ${{ matrix.node-version }}
30-
cache: 'pnpm'
3129

3230
- name: Install dependencies
33-
run: pnpm install
31+
run: bun install
3432

3533
- name: Run tests
36-
run: pnpm test:ci
34+
run: bun run ci
3735

3836
- run: |
3937
if [ "$RUNNER_OS" == "Linux" ]; then

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ html-dist
1111
lib
1212
.history
1313
tests/tmp
14-
.turbo
14+
*.tsbuildinfo
15+
examples/public/**/*-dist
16+
examples/public/**/*.min.html

.huskyrc

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

.npmrc

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

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

CLAUDE.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Requirements
6+
- **Node.js**: >=20.0.0
7+
- **Bun**: 1.3.5+
8+
9+
## Package Manager
10+
11+
This branch (`main`) uses **Bun** as the package manager and runtime.
12+
13+
## Commands
14+
- **Install**: `bun install`
15+
- **Build**: `bun run build`
16+
- **Lint**: `bun run lint` | **Format**: `bun run format`
17+
- **Test all**: `bun run test`
18+
- **Test single package**: `bun test packages/<name>` (e.g., `bun test packages/core`)
19+
- **Test single file**: `bun test packages/core/__tests__/core.test.ts`
20+
- **Typecheck**: `bun run typecheck`
21+
- **CI (full)**: `bun run ci`
22+
23+
## Code Style (Biome)
24+
- **Indent**: 4 spaces | **Quotes**: double | **Semicolons**: always | **Trailing commas**: ES5
25+
- **Imports**: Use `type` keyword for type-only imports. Use `node:` prefix for Node.js built-ins (e.g., `node:child_process`)
26+
- **File extensions**: Include `.ts` in local imports (e.g., `./setup.ts`)
27+
- **Naming**: camelCase for functions/variables, PascalCase for types/interfaces
28+
- **Tests**: Vitest with `describe`/`test`/`expect`. Files in `packages/*/__tests__/*.test.ts`
29+
- **Error handling**: Use `try/catch` with `if (err instanceof Error)` checks
30+
- **Source files**: Include copyright header: `/*! node-minify ... MIT Licensed */`
31+
32+
## Architecture
33+
34+
This is a Bun monorepo for compressing JavaScript, CSS, and HTML files using various backends.
35+
36+
### Package Structure
37+
38+
**Core packages** (in `/packages`):
39+
- `core` - Main `minify()` function, orchestrates compression
40+
- `utils` - Shared utilities (file operations, gzip sizing)
41+
- `run` - Command execution wrapper for external tools
42+
- `types` - TypeScript type definitions (not compiled)
43+
- `cli` - Command-line interface
44+
45+
**Compressor packages** - Each wraps a specific minification library:
46+
- JS: `babel-minify`, `google-closure-compiler`, `terser`, `uglify-js`, `uglify-es`
47+
- CSS: `clean-css`, `crass`, `cssnano`, `csso`, `sqwish`
48+
- HTML: `html-minifier`
49+
- Other: `yui` (JS/CSS), `jsonminify`, `no-compress` (passthrough)
50+
51+
**Deprecated** (still available but unmaintained upstream):
52+
- `babel-minify` - Babel 6 only, use `terser` instead
53+
- `uglify-es` - Unmaintained, use `terser` instead
54+
55+
### Dependencies
56+
57+
`core` depends on `utils` and `run`. All compressor packages depend on `core`. The build script (`scripts/build-packages.js`) builds `utils` and `run` first, then all other packages in parallel.
58+
59+
### Package Pattern
60+
61+
All packages follow the same structure:
62+
```
63+
packages/<name>/
64+
├── src/index.ts # Main export
65+
├── __tests__/ # Vitest tests
66+
├── package.json
67+
└── tsconfig.json
68+
```
69+
70+
Build: `tsdown` (configured via `tsdown.config.ts`)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Rodolphe Stoclin
3+
Copyright (c) 2025 Rodolphe Stoclin
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)