From a2cd0087cc829d97535a7a2d8c82d7b027fd84bf Mon Sep 17 00:00:00 2001 From: Andrei Hasna Date: Mon, 27 Jul 2026 09:01:21 +0300 Subject: [PATCH] feat: Repo hygiene: add prepack build + CI + CHANGELOG.md + .editorconfig --- .editorconfig | 12 ++++++++++++ .github/workflows/ci.yml | 24 ++++++++++++++++++++++++ CHANGELOG.md | 14 ++++++++++++++ package.json | 1 + src/scaffold.test.ts | 1 + 5 files changed, 52 insertions(+) create mode 100644 .editorconfig create mode 100644 .github/workflows/ci.yml create mode 100644 CHANGELOG.md diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..1014ba7 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a745914 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + pull_request: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + with: + bun-version: "1.3.14" + - name: Install dependencies + run: bun install --frozen-lockfile + - name: Type check + run: bun run typecheck + - name: Test + run: bun test + - name: Build + run: bun run build diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..877df2d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +## [Unreleased] + +### Added + +- Continuous integration checks for typechecking, tests, and builds. +- EditorConfig defaults for consistent formatting. + +### Fixed + +- Build package artifacts before creating an npm package. diff --git a/package.json b/package.json index 19975f3..6ee6648 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,7 @@ "dev:cli": "bun run src/cli/index.ts", "dev:mcp": "bun run src/mcp/index.ts", "dev:daemon": "bun run src/daemon/index.ts", + "prepack": "bun run build", "prepublishOnly": "bun run build", "postinstall": "mkdir -p $HOME/.hasna/dispatch 2>/dev/null || true" }, diff --git a/src/scaffold.test.ts b/src/scaffold.test.ts index 95e9199..2b3713d 100644 --- a/src/scaffold.test.ts +++ b/src/scaffold.test.ts @@ -14,6 +14,7 @@ describe("scaffold", () => { expect(pkg.type).toBe("module"); expect(pkg.license).toBe("Apache-2.0"); expect(pkg.publishConfig.access).toBe("public"); + expect(pkg.scripts.prepack).toBe("bun run build"); }); test("exposes the three binaries", () => {