diff --git a/.changeset/reorganize-tests.md b/.changeset/reorganize-tests.md index 22e5365..157de9c 100644 --- a/.changeset/reorganize-tests.md +++ b/.changeset/reorganize-tests.md @@ -1,8 +1,9 @@ --- -"@ankhorage/devtools": patch +'@ankhorage/devtools': patch --- Reorganize tests and update configuration: + - Move test files from `tests/` to `src/` to follow project standards. - Update `tsconfig.json` to exclude `*.test.ts` from build output. - Update `tsconfig.test.json` to include `*.test.ts` for linting and IDE support. diff --git a/.changeset/standard-bun-workflows.md b/.changeset/standard-bun-workflows.md new file mode 100644 index 0000000..d363b43 --- /dev/null +++ b/.changeset/standard-bun-workflows.md @@ -0,0 +1,5 @@ +--- +'@ankhorage/devtools': patch +--- + +Standardize CI/release workflow files and update the Bun tooling baseline. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..e540a4c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,77 @@ +name: CI + +on: + pull_request: + push: + branches: + - main + +permissions: + contents: read + +jobs: + validate: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: '1.3.13' + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Run build + run: | + if node -e "const p=require('./package.json'); process.exit(p.scripts?.build ? 0 : 1)"; then + bun run build + else + echo "No build script found; skipping." + fi + + - name: Run lint + run: | + if node -e "const p=require('./package.json'); process.exit(p.scripts?.lint ? 0 : 1)"; then + bun run lint + else + echo "No lint script found; skipping." + fi + + - name: Run format check + run: | + if node -e "const p=require('./package.json'); process.exit(p.scripts?.['format:check'] ? 0 : 1)"; then + bun run format:check + else + echo "No format:check script found; skipping." + fi + + - name: Run tests + run: | + if node -e "const p=require('./package.json'); process.exit(p.scripts?.test ? 0 : 1)"; then + bun run test + else + echo "No test script found; skipping." + fi + + - name: Run typecheck + run: | + if node -e "const p=require('./package.json'); process.exit(p.scripts?.typecheck ? 0 : 1)"; then + bun run typecheck + else + echo "No typecheck script found; skipping." + fi + + - name: Check changesets + if: github.event_name == 'pull_request' + run: | + if [ -f ./scripts/check-changeset-status.sh ]; then + bash ./scripts/check-changeset-status.sh + else + echo "No changeset status script found; skipping." + fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..71e5870 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,65 @@ +name: Release + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + id-token: write + +concurrency: + group: release-${{ github.ref }} + cancel-in-progress: false + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: '1.3.13' + + - name: Setup Node for npm publishing + uses: actions/setup-node@v4 + with: + node-version: 24 + registry-url: https://registry.npmjs.org + + - name: Update npm + run: npm install -g npm@latest + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Build package + run: | + if node -e "const p=require('./package.json'); process.exit(p.scripts?.build ? 0 : 1)"; then + bun run build + else + echo "No build script found; skipping." + fi + + - name: Create release pull request or publish to npm + if: hashFiles('.changeset/config.json') != '' + uses: changesets/action@v1 + with: + version: bun run version-packages + publish: bunx changeset publish + commit: Version Packages + title: Version Packages + env: + GITHUB_TOKEN: ${{ github.token }} + + - name: Skip release + if: hashFiles('.changeset/config.json') == '' + run: echo "No Changesets config found; skipping release." diff --git a/README.md b/README.md index 9d7326e..fcd9dc8 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,14 @@ Shared ESLint and Prettier configuration for modern TypeScript projects. ## What you get + - Consistent linting across repos - Zero-config Prettier setup - Strict TypeScript rules without compromise - One source of truth for tooling ## Features + - Flat ESLint config (latest standard) - Preconfigured plugin ecosystem - Prettier integration @@ -25,9 +27,9 @@ bun add -D @ankhorage/devtools ### ESLint ```js -import config from '@ankhorage/devtools/eslint' +import config from '@ankhorage/devtools/eslint'; -export default config() +export default config(); ``` ### Prettier @@ -39,6 +41,7 @@ export default config() ``` ## Use Cases + - Monorepos with shared standards - Teams that want strict, predictable linting - Projects avoiding duplicated config @@ -46,6 +49,7 @@ export default config() ## Why this exists Maintaining ESLint + Prettier configs across multiple repositories leads to: + - duplication - inconsistency - drift over time @@ -55,9 +59,11 @@ This package centralizes tooling so all projects stay aligned. ## Scope Includes: + - ESLint configuration - Prettier configuration Excludes: + - runtime code - build tooling diff --git a/bun.lock b/bun.lock index b7d84d1..8f51c86 100644 --- a/bun.lock +++ b/bun.lock @@ -17,8 +17,8 @@ }, "devDependencies": { "@changesets/cli": "^2.30.0", + "@types/bun": "^1.3.13", "@types/node": "^25.2.3", - "bun-types": "^1.3.11", "typescript": "^5.9.3", }, }, @@ -100,6 +100,8 @@ "@rtsao/scc": ["@rtsao/scc@1.1.0", "", {}, "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g=="], + "@types/bun": ["@types/bun@1.3.13", "", { "dependencies": { "bun-types": "1.3.13" } }, "sha512-9fqXWk5YIHGGnUau9TEi+qdlTYDAnOj+xLCmSTwXfAIqXr2x4tytJb43E9uCvt09zJURKXwAtkoH4nLQfzeTXw=="], + "@types/esrecurse": ["@types/esrecurse@4.3.1", "", {}, "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw=="], "@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="], @@ -168,7 +170,7 @@ "braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="], - "bun-types": ["bun-types@1.3.11", "", { "dependencies": { "@types/node": "*" } }, "sha512-1KGPpoxQWl9f6wcZh57LvrPIInQMn2TQ7jsgxqpRzg+l0QPOFvJVH7HmvHo/AiPgwXy+/Thf6Ov3EdVn1vOabg=="], + "bun-types": ["bun-types@1.3.13", "", { "dependencies": { "@types/node": "*" } }, "sha512-QXKeHLlOLqQX9LgYaHJfzdBaV21T63HhFJnvuRCcjZiaUDpbs5ED1MgxbMra71CsryN/1dAoXuJJJwIv/2drVA=="], "call-bind": ["call-bind@1.0.8", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="], diff --git a/package.json b/package.json index 565738f..5d13533 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,14 @@ "name": "@ankhorage/devtools", "version": "1.0.1", "description": "Shared Lint and Format Configuration for Ankhorage", + "homepage": "https://github.com/ankhorage/devtools#readme", + "bugs": { + "url": "https://github.com/ankhorage/devtools/issues" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ankhorage/devtools.git" + }, "type": "module", "publishConfig": { "access": "public" @@ -26,7 +34,8 @@ "lint": "eslint .", "format": "prettier --write .", "format:check": "prettier --check .", - "test": "bun test" + "test": "bun test", + "version-packages": "changeset version" }, "dependencies": { "@eslint/js": "^10.0.1", @@ -41,8 +50,9 @@ }, "devDependencies": { "@changesets/cli": "^2.30.0", + "@types/bun": "^1.3.13", "@types/node": "^25.2.3", - "bun-types": "^1.3.11", "typescript": "^5.9.3" - } + }, + "packageManager": "bun@1.3.13" } diff --git a/tsconfig.json b/tsconfig.json index 5f05acf..196c29d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "types": ["bun-types"] + "types": ["bun"] }, "include": ["src/**/*"], "exclude": ["src/**/*.test.ts"]