Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30,462 changes: 4,031 additions & 26,431 deletions dist/index.js

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions esbuild.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { build } from 'esbuild';

await build({
entryPoints: ['src/index.ts'],
outfile: 'dist/index.js',
bundle: true,
platform: 'node',
target: 'node24',
format: 'esm',
// Bundled dependencies still call `require`, which ESM does not define.
banner: {
js: "import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);",
},
// Drops the comments the dependencies bring along.
minifyWhitespace: true,
// Without it, `minifyWhitespace` collapses the bundle into a few enormous lines.
lineLimit: 200,
});
2 changes: 1 addition & 1 deletion knip.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"project": ["src/**/*.ts"],
// Build output, not source.
// knip hints "Remove from ignore" while `dist/` is absent, but with the bundle
// present, dropping this makes it scan 1.1mb of CJS and report its requires.
// present, dropping this makes it scan the whole bundle and report its requires.
"ignore": ["dist/**"],
"vitest": {
"entry": ["tests/*.spec.ts"],
Expand Down
1 change: 1 addition & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pre-commit:
- name: build
glob:
- 'src/**'
- 'esbuild.config.ts'
- 'package.json'
- 'pnpm-lock.yaml'
# the bundle ships from the repo, so it belongs in the commit that changed it
Expand Down
5 changes: 2 additions & 3 deletions oxfmt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import { defineConfig } from 'oxfmt';
export default defineConfig({
...oxfmtConfig,
ignorePatterns: [
// The committed bundle: generated, and 1.1mb of it.
// The committed bundle:
// `.gitignore` cannot hold it, because the action runs `dist/` from the repo.
'dist',
// Written by release-please on every release.
// Reformatting it only fights whatever it generates next.
// Written by release-please on every release (no option to format it).
'CHANGELOG.md',
],
});
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "module",
"scripts": {
"prepare": "lefthook install",
"build": "esbuild src/index.ts --bundle --platform=node --target=node24 --format=esm --banner:js=\"import { createRequire } from 'node:module'; const require = createRequire(import.meta.url);\" --outfile=dist/index.js",
"build": "node esbuild.config.ts",
"typecheck": "tsc -p tsconfig.json",
"test": "vitest",
"format": "oxfmt --write .",
Expand All @@ -22,7 +22,7 @@
},
"dependencies": {
"@actions/core": "3.0.1",
"@stats-forge/github-stats-forge-core": "0.0.2"
"@stats-forge/github-stats-forge-core": "0.1.0"
},
"devDependencies": {
"@marcalexiei/oxfmt-config": "1.3.0",
Expand Down
31 changes: 12 additions & 19 deletions pnpm-lock.yaml

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

5 changes: 3 additions & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ minimumReleaseAge: 4320
# It buys nothing against our own packages, and would hold the action three days
# behind every release we make ourselves.
minimumReleaseAgeExclude:
- '@stats-forge/*'
- '@marcalexiei/*'
- '@stats-forge/github-stats-forge-core'
- '@marcalexiei/oxfmt-config'
- '@marcalexiei/oxlint-config'

# Reject a version with weaker publish trust evidence than an earlier one.
trustPolicy: no-downgrade
Expand Down
9 changes: 8 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,12 @@

"noEmit": true
},
"include": ["src", "tests", "oxfmt.config.ts", "oxlint.config.ts", "vitest.config.ts"]
"include": [
"src",
"tests",
"esbuild.config.ts",
"oxfmt.config.ts",
"oxlint.config.ts",
"vitest.config.ts"
]
}