diff --git a/.eslintrc.js b/.eslintrc.js index 89dfbbc..e840167 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,7 +2,7 @@ /** @type {import("eslint").Linter.Config} */ module.exports = { ignorePatterns: ["apps/**", "packages/**", "scripts/**"], - extends: ["@repo/eslint-config/library.js"], + extends: ["@xeol/eslint-config/library.js"], parser: "@typescript-eslint/parser", parserOptions: { project: true, diff --git a/.github/contributing.md b/.github/contributing.md new file mode 100644 index 0000000..608d618 --- /dev/null +++ b/.github/contributing.md @@ -0,0 +1,16 @@ +# Contributing + +### Publishing on Npm + +We manage _what_ gets merged _when_ using the pull request labels `release` and `prerelease`. + +When the `prerelease` label is added to a pull request: + +- the version in the package.json is verified, asserting that it is greater than the version in the main branch and includes a prerelease suffix (_e.g 1.2.3-rc.1_) +- the package is published to NPM with the `--next` tag. The next tag is how alpha and beta package versions are published to NPM. When a developer runs `npm install @vesselapi/integrations` versions with the next tag are ignored -- unless they are specifically specified `npm install @vesselapi/integrations@1.2.3-rc.1`. + +When the `release` label is added to a pull request: + +- the version in the package.json is verified, asserting that it is greater than the version in the main branch and does not include a prerelease suffix + +When no release label is provided github actions verifies that the version has not changed so versions of the package are not published erroneously. diff --git a/.github/versioning.js b/.github/versioning.js new file mode 100644 index 0000000..5e1e6fd --- /dev/null +++ b/.github/versioning.js @@ -0,0 +1,72 @@ +const semver = require("semver"); + +const { PR_VERSION: pr, MAIN_VERSION: main } = process.env; + +const assertIsValidPrerelease = ({ github, context, core }) => { + const pr_clean = pr.replace(/\-.+$/, ""); + const pr_is_greater = semver.gt(pr_clean, main); + + if (pr_is_greater) { + core.debug( + `The pr version (${pr} -> ${pr_clean}) is higher than the main version (${main}).` + ); + } else { + core.setFailed( + `The pr version (${pr}) is not greater than the main version (${main}). A pull request labeled with 'prerelease' must have a valid version bump.` + ); + } + const pr_is_prerelease = semver.prerelease(pr) !== null; + if (pr_is_prerelease) { + core.debug(`The pr version (${pr}) is a prerelease.`); + } else { + core.setFailed( + `The pr version (${pr}) is not a prerelease. A pull request labeled with 'prerelease' must have a valid prerelease version (1.2.3-rc.1).` + ); + } +}; + +const assertIsValidRelease = ({ github, context, core }) => { + const pr_is_greater = semver.gt(pr, main); + if (pr_is_greater) { + core.debug( + `Success, the pr version (${pr}) is higher than the main version (${main}).` + ); + } else { + core.setFailed( + `The pr version (${pr}) is not greater than the main version (${main}). A pull request labeled with 'release' must have a valid version bump.` + ); + } + const pr_is_prerelease = semver.prerelease(pr) !== null; + if (!pr_is_prerelease) { + core.debug(`The pr version (${pr}) is not a prerelease.`); + } else { + core.setFailed( + `The pr version (${pr}) is a prerelease. A pull request labeled with 'release' cannot have a prerelease version (1.2.3-alpha.1 or 1.2.3-rc.1)` + ); + } +}; + +const assertIsUnchanged = ({ github, context, core }) => { + if (pr.trim() === main.trim()) { + core.debug( + `Success, the pr version (${pr}) is the same as the main version (${main}).` + ); + } else { + core.setFailed( + `The pr version (${pr}) is not the same as the main version (${main}). A pull request without a 'release' or 'prerelease' label cannot include a version bump.` + ); + } +}; + +exports.verify = ({ github, context, core }) => { + const labels = (context.payload?.pull_request?.labels ?? []).map((l) => + l.name.toLowerCase() + ); + if (labels.includes("prerelease")) { + return assertIsValidPrerelease({ github, context, core }); + } + if (labels.includes("release")) { + return assertIsValidRelease({ github, context, core }); + } + assertIsUnchanged({ github, context, core }); +}; diff --git a/.github/workflows/publish-cli-to-npm.yml b/.github/workflows/publish-cli-on-merge.yml similarity index 57% rename from .github/workflows/publish-cli-to-npm.yml rename to .github/workflows/publish-cli-on-merge.yml index 2faaa83..c305f0e 100644 --- a/.github/workflows/publish-cli-to-npm.yml +++ b/.github/workflows/publish-cli-on-merge.yml @@ -1,36 +1,39 @@ -name: Publish bumpgen cli to npmjs +name: Release to Npm on: push: branches: [main] paths: - - 'apps/cli/**' + - "apps/cli/**" jobs: check: - name: 'Check if release is needed' - runs-on: 'ubuntu-latest' + name: "Check if release is needed" + runs-on: "ubuntu-latest" outputs: exists: ${{ steps.check-tag.outputs.exists }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + # retrieves the version from package.json - uses: martinbeentjes/npm-get-version-action@main id: get-version + # check if the tag exists on the repo - uses: mukunku/tag-exists-action@v1.1.0 id: check-tag with: tag: v${{ steps.get-version.outputs.current-version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + release: - name: 'Release' + name: "Release" needs: check if: needs.check.outputs.exists == 'false' - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" permissions: contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: martinbeentjes/npm-get-version-action@main id: get-version - uses: actions/create-release@v1 @@ -48,24 +51,11 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - uses: ./tooling/github/setup - name: Install pnpm - with: - version: 8 - run_install: false - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version-file: ".nvmrc" - cache: pnpm - registry-url: https://registry.npmjs.org - - - name: 📦️ Install dependencies - run: pnpm install --frozen-lockfile + - name: Setup + uses: ./tooling/github/setup - - name: 🚀 Publish bumpgen cli to npm - shell: bash - run: pnpm publish apps/cli + - run: pnpm install --frozen-lockfile + - run: pnpm --filter=bumpgen run build + - run: pnpm --filter=bumpgen publish --tag latest --access public --no-git-checks env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + NODE_AUTH_TOKEN: "${{ secrets.NPM_TOKEN }}" diff --git a/.github/workflows/publish-cli-on-prerelease-pr.yml b/.github/workflows/publish-cli-on-prerelease-pr.yml new file mode 100644 index 0000000..54b66f9 --- /dev/null +++ b/.github/workflows/publish-cli-on-prerelease-pr.yml @@ -0,0 +1,49 @@ +name: Publish Prerelease for CLI +on: + pull_request: + branches: [main] + types: [labeled, unlabeled, opened, synchronize] + paths: + - "apps/cli/**" + +jobs: + publish-prerelease: + if: contains(github.event.pull_request.labels.*.name, 'prerelease') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: main + + - uses: martinbeentjes/npm-get-version-action@main + with: + path: apps/cli + id: main-version + + - uses: actions/checkout@v4 + + - uses: martinbeentjes/npm-get-version-action@main + with: + path: apps/cli + id: pr-version + + - name: Setup + uses: ./tooling/github/setup + + - uses: actions/github-script@v6 + env: + PR_VERSION: ${{steps.pr-version.outputs.current-version}} + MAIN_VERSION: ${{steps.main-version.outputs.current-version}} + with: + script: require('./.github/versioning.js').verify({ github, context, core }) + + - name: set publishing config + run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + - run: pnpm i + - run: pnpm --filter=bumpgen run build + - run: pnpm --filter=bumpgen publish --tag next --access public --no-git-checks + env: + NODE_AUTH_TOKEN: "${{ secrets.NPM_TOKEN }}" diff --git a/.github/workflows/publish-core-to-npm.yml b/.github/workflows/publish-core-on-merge.yml similarity index 59% rename from .github/workflows/publish-core-to-npm.yml rename to .github/workflows/publish-core-on-merge.yml index 13b6fbe..803c0db 100644 --- a/.github/workflows/publish-core-to-npm.yml +++ b/.github/workflows/publish-core-on-merge.yml @@ -4,16 +4,16 @@ on: push: branches: [main] paths: - - 'packages/bumpgen-core/**' + - "packages/bumpgen-core/**" jobs: check: - name: 'Check if release is needed' - runs-on: 'ubuntu-latest' + name: "Check if release is needed" + runs-on: "ubuntu-latest" outputs: exists: ${{ steps.check-tag.outputs.exists }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: martinbeentjes/npm-get-version-action@main id: get-version - uses: mukunku/tag-exists-action@v1.1.0 @@ -22,15 +22,16 @@ jobs: tag: v${{ steps.get-version.outputs.current-version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + release: - name: 'Release' + name: "Release" needs: check if: needs.check.outputs.exists == 'false' - runs-on: 'ubuntu-latest' + runs-on: "ubuntu-latest" permissions: contents: write steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: martinbeentjes/npm-get-version-action@main id: get-version - uses: actions/create-release@v1 @@ -42,29 +43,18 @@ jobs: tag_name: v${{ steps.get-version.outputs.current-version}} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + publish: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - - uses: ./tooling/github/setup - name: Install pnpm - with: - version: 8 - run_install: false - - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version-file: ".nvmrc" - cache: pnpm - registry-url: https://registry.npmjs.org - - - name: 📦️ Install dependencies - run: pnpm install --frozen-lockfile + - name: Setup + uses: ./tooling/github/setup - - name: 🚀 Publish bumpgen-core to npm - run: pnpm publish packages/bumpgen-core + - run: pnpm install --frozen-lockfile + - run: pnpm --filter=@xeol/bumpgen-core run build + - run: pnpm --filter=@xeol/bumpgen-core publish --tag latest --access public --no-git-checks env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/publish-core-on-prerelease-pr.yml b/.github/workflows/publish-core-on-prerelease-pr.yml new file mode 100644 index 0000000..805f550 --- /dev/null +++ b/.github/workflows/publish-core-on-prerelease-pr.yml @@ -0,0 +1,47 @@ +name: Publish Prerelease for @xeol/bumpgen-core +on: + pull_request: + branches: [main] + types: [labeled, unlabeled, opened, synchronize] + paths: + - "packages/bumpgen-core/**" + +jobs: + publish-prerelease: + if: contains(github.event.pull_request.labels.*.name, 'prerelease') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: main + - uses: martinbeentjes/npm-get-version-action@main + with: + path: packages/bumpgen-core + id: main-version + + - uses: actions/checkout@v4 + - uses: martinbeentjes/npm-get-version-action@main + with: + path: packages/bumpgen-core + id: pr-version + + - name: Setup + uses: ./tooling/github/setup + + - uses: actions/github-script@v6 + env: + PR_VERSION: ${{steps.pr-version.outputs.current-version}} + MAIN_VERSION: ${{steps.main-version.outputs.current-version}} + with: + script: require('./.github/versioning.js').verify({ github, context, core }) + + - name: set publishing config + run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + - run: pnpm i + - run: pnpm --filter=@xeol/bumpgen-core run build + - run: pnpm --filter=@xeol/bumpgen-core publish --tag next --access public --no-git-checks + env: + NODE_AUTH_TOKEN: "${{ secrets.NPM_TOKEN }}" diff --git a/.github/workflows/verify-cli-version-on-pr.yml b/.github/workflows/verify-cli-version-on-pr.yml new file mode 100644 index 0000000..4a359b8 --- /dev/null +++ b/.github/workflows/verify-cli-version-on-pr.yml @@ -0,0 +1,47 @@ +name: verify version of bumpgen cli +on: + pull_request: + branches: [main] + types: [labeled, unlabeled, opened, synchronize] + paths: + - "apps/cli/**" + +jobs: + verify-version: + runs-on: ubuntu-latest + steps: + # get main version + - uses: actions/checkout@v4 + with: + ref: main + - uses: martinbeentjes/npm-get-version-action@main + with: + path: apps/cli + id: main-version + + # get pr version + - uses: actions/checkout@v4 + - uses: martinbeentjes/npm-get-version-action@main + with: + path: apps/cli + id: pr-version + + - name: Setup + uses: ./tooling/github/setup + + - uses: actions/github-script@v6 + env: + PR_VERSION: ${{steps.pr-version.outputs.current-version}} + MAIN_VERSION: ${{steps.main-version.outputs.current-version}} + with: + script: | + require('./.github/versioning.js').verify({ github, context, core }) + + block-prerelease: + if: contains(github.event.pull_request.labels.*.name, 'prerelease') + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v6 + with: + script: | + core.setFailed(`PR with a prerelease label cannot be merged. Remove the label or change it to a release label and adjust the version as needed to fix.`) diff --git a/.github/workflows/verify-core-version-on-pr.yml b/.github/workflows/verify-core-version-on-pr.yml new file mode 100644 index 0000000..f763847 --- /dev/null +++ b/.github/workflows/verify-core-version-on-pr.yml @@ -0,0 +1,47 @@ +name: verify version of @xeol/bumpgen-core on PR +on: + pull_request: + branches: [main] + types: [labeled, unlabeled, opened, synchronize] + paths: + - "packages/bumpgen-core/**" + +jobs: + verify-version: + runs-on: ubuntu-latest + steps: + # get main version + - uses: actions/checkout@v4 + with: + ref: main + - uses: martinbeentjes/npm-get-version-action@main + with: + path: packages/bumpgen-core + id: main-version + + # get pr version + - uses: actions/checkout@v4 + - uses: martinbeentjes/npm-get-version-action@main + with: + path: packages/bumpgen-core + id: pr-version + + - name: Setup + uses: ./tooling/github/setup + + - uses: actions/github-script@v6 + env: + PR_VERSION: ${{steps.pr-version.outputs.current-version}} + MAIN_VERSION: ${{steps.main-version.outputs.current-version}} + with: + script: | + require('./.github/versioning.js').verify({ github, context, core }) + + block-prerelease: + if: contains(github.event.pull_request.labels.*.name, 'prerelease') + runs-on: ubuntu-latest + steps: + - uses: actions/github-script@v6 + with: + script: | + core.setFailed(`PR with a prerelease label cannot be merged. Remove the label or change it to a release label and adjust the version as needed to fix.`) diff --git a/README.md b/README.md index 83afe27..2feb566 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ Dependabot but fixes the breaking changes for you as well. └┴────────────────────────────────────┘ └┴───────────────────────────────────┘ ``` + #### CLI A CLI wrapper on top of the core logic diff --git a/apps/cli/package.json b/apps/cli/package.json index fe1230f..07e2bef 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -13,7 +13,7 @@ "dependencies": { "@commander-js/extra-typings": "^12.0.1", "@inquirer/prompts": "^5.0.2", - "@repo/bumpgen-core": "workspace:*", + "@xeol/bumpgen-core": "workspace:*", "@sindresorhus/tsconfig": "^3.0.1", "cfonts": "^3.2.0", "cli-spinners": "^2.9.2", @@ -38,9 +38,9 @@ "dist" ], "devDependencies": { - "@repo/eslint-config": "workspace:*", - "@repo/prettier-config": "workspace:*", - "@repo/tsconfig": "workspace:*", + "@xeol/eslint-config": "workspace:*", + "@xeol/prettier-config": "workspace:*", + "@xeol/tsconfig": "workspace:*", "@types/eslint": "^8.56.5", "@types/express": "^4.17.21", "@types/ms": "^0.7.34", @@ -53,8 +53,8 @@ "eslintConfig": { "root": true, "extends": [ - "@repo/eslint-config/base" + "@xeol/eslint-config/base" ] }, - "prettier": "@repo/prettier-config" + "prettier": "@xeol/prettier-config" } diff --git a/apps/cli/src/app.tsx b/apps/cli/src/app.tsx index 4293e40..8fe6bfd 100644 --- a/apps/cli/src/app.tsx +++ b/apps/cli/src/app.tsx @@ -1,4 +1,12 @@ import { spawn } from "child_process"; +import type { + BumpgenGraph, + PlanGraphNode, + SerializeableBumpgenEvent, + SerializeableBumpgenGraph, + SupportedLanguage, + SupportedModel, +} from "@xeol/bumpgen-core"; import type { BoxProps, DOMElement } from "ink"; import type { ReactNode } from "react"; import React, { useEffect, useRef, useState } from "react"; @@ -10,16 +18,7 @@ import Spinner from "ink-spinner"; import { omit } from "radash"; import stripAnsi from "strip-ansi"; -import type { - BumpgenGraph, - PlanGraphNode, - SerializeableBumpgenEvent, - SerializeableBumpgenGraph, - SupportedLanguage, - SupportedModel, -} from "@repo/bumpgen-core"; - -import { Sidebar } from "./components/Sidebar"; +import { Sidebar } from "./components/sidebar"; import { TitleText } from "./components/TitleText"; import { useStdoutDimensions } from "./use-stdout-dimensions"; diff --git a/apps/cli/src/components/sidebar.tsx b/apps/cli/src/components/sidebar.tsx index d6bedc9..ddce5f3 100644 --- a/apps/cli/src/components/sidebar.tsx +++ b/apps/cli/src/components/sidebar.tsx @@ -1,11 +1,10 @@ +import type { SerializeableBumpgenEvent } from "@xeol/bumpgen-core"; import type { BoxProps, DOMElement } from "ink"; import React, { useEffect, useRef, useState } from "react"; import spinners from "cli-spinners"; import { Box, measureElement, Text } from "ink"; import ms from "ms"; -import type { SerializeableBumpgenEvent } from "@repo/bumpgen-core"; - import { Bold } from "../common/bold"; import { useStdoutDimensions } from "../use-stdout-dimensions"; import { Task } from "./task-list"; diff --git a/apps/cli/src/index.tsx b/apps/cli/src/index.tsx index 21cbc0f..d11e224 100644 --- a/apps/cli/src/index.tsx +++ b/apps/cli/src/index.tsx @@ -10,7 +10,7 @@ import { makeBumpgen, SupportedLanguages, SupportedModels, -} from "@repo/bumpgen-core"; +} from "@xeol/bumpgen-core"; import App from "./app"; diff --git a/apps/cli/tsconfig.json b/apps/cli/tsconfig.json index 023233d..51b07c5 100644 --- a/apps/cli/tsconfig.json +++ b/apps/cli/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@repo/tsconfig/base.json", + "extends": "@xeol/tsconfig/base.json", "compilerOptions": { "outDir": "dist" }, diff --git a/package.json b/package.json index 68da311..cea2bd7 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,16 @@ "typecheck": "turbo typecheck" }, "devDependencies": { - "@repo/eslint-config": "workspace:*", - "@repo/tsconfig": "workspace:*", + "@xeol/eslint-config": "workspace:*", + "@xeol/tsconfig": "workspace:*", "prettier": "^3.2.5", "turbo": "latest" }, "packageManager": "pnpm@9.0.6", "engines": { "node": ">=21" + }, + "dependencies": { + "semver": "^7.6.0" } } diff --git a/packages/bumpgen-core/package.json b/packages/bumpgen-core/package.json index 1a24b9a..7c33b22 100644 --- a/packages/bumpgen-core/package.json +++ b/packages/bumpgen-core/package.json @@ -1,5 +1,5 @@ { - "name": "@repo/bumpgen-core", + "name": "@xeol/bumpgen-core", "version": "0.0.1", "main": "dist/index.js", "module": "dist/index.mjs", @@ -28,10 +28,10 @@ "zod": "^3.22.4" }, "devDependencies": { - "@repo/eslint-config": "workspace:*", - "@repo/prettier-config": "workspace:*", - "@repo/test-project": "workspace:*", - "@repo/tsconfig": "workspace:*", + "@xeol/eslint-config": "workspace:*", + "@xeol/prettier-config": "workspace:*", + "@xeol/test-project": "workspace:*", + "@xeol/tsconfig": "workspace:*", "@types/eslint": "^8.56.5", "@types/jest": "^29.5.12", "@types/node": "^20.11.24", @@ -47,8 +47,8 @@ "eslintConfig": { "root": true, "extends": [ - "@repo/eslint-config/base" + "@xeol/eslint-config/base" ] }, - "prettier": "@repo/prettier-config" + "prettier": "@xeol/prettier-config" } diff --git a/packages/bumpgen-core/src/services/language/typescript/index.test.ts b/packages/bumpgen-core/src/services/language/typescript/index.test.ts index 17ce05a..f2f2b22 100644 --- a/packages/bumpgen-core/src/services/language/typescript/index.test.ts +++ b/packages/bumpgen-core/src/services/language/typescript/index.test.ts @@ -6,7 +6,7 @@ const client = injectTypescriptService(); describe("dependencyGraphService", () => { it("initializes", () => { - const pkg = path.dirname(require.resolve("@repo/test-project")); + const pkg = path.dirname(require.resolve("@xeol/test-project")); const rootDir = pkg.slice(0, -4); // remove /src const project = client.ast.initialize(rootDir); diff --git a/packages/bumpgen-core/tsconfig.json b/packages/bumpgen-core/tsconfig.json index 805aa69..0d122bd 100644 --- a/packages/bumpgen-core/tsconfig.json +++ b/packages/bumpgen-core/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@repo/tsconfig/base.json", + "extends": "@xeol/tsconfig/base.json", "compilerOptions": { "outDir": "dist", "incremental": false diff --git a/packages/test-project/package.json b/packages/test-project/package.json index 0f02077..3ac9f8a 100644 --- a/packages/test-project/package.json +++ b/packages/test-project/package.json @@ -1,12 +1,11 @@ { - "name": "@repo/test-project", + "name": "@xeol/test-project", "version": "0.0.0", "private": true, "exports": { ".": "./src/index.ts" }, - "scripts": { - }, + "scripts": {}, "dependencies": { "@tanstack/react-query": "^5.29.2", "graphology": "^0.25.4", @@ -20,9 +19,9 @@ "zod": "^3.22.4" }, "devDependencies": { - "@repo/eslint-config": "workspace:*", - "@repo/prettier-config": "workspace:*", - "@repo/tsconfig": "workspace:*", + "@xeol/eslint-config": "workspace:*", + "@xeol/prettier-config": "workspace:*", + "@xeol/tsconfig": "workspace:*", "@types/eslint": "^8.56.5", "@types/jest": "^29.5.12", "@types/node": "^20.11.24", @@ -34,8 +33,8 @@ "eslintConfig": { "root": true, "extends": [ - "@repo/eslint-config/base" + "@xeol/eslint-config/base" ] }, - "prettier": "@repo/prettier-config" + "prettier": "@xeol/prettier-config" } diff --git a/packages/test-project/tsconfig.json b/packages/test-project/tsconfig.json index 023233d..51b07c5 100644 --- a/packages/test-project/tsconfig.json +++ b/packages/test-project/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@repo/tsconfig/base.json", + "extends": "@xeol/tsconfig/base.json", "compilerOptions": { "outDir": "dist" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 94ecd7e..9a05aa2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,11 +7,15 @@ settings: importers: .: + dependencies: + semver: + specifier: ^7.6.0 + version: 7.6.0 devDependencies: - '@repo/eslint-config': + '@xeol/eslint-config': specifier: workspace:* version: link:tooling/eslint - '@repo/tsconfig': + '@xeol/tsconfig': specifier: workspace:* version: link:tooling/typescript prettier: @@ -29,12 +33,12 @@ importers: '@inquirer/prompts': specifier: ^5.0.2 version: 5.0.2 - '@repo/bumpgen-core': - specifier: workspace:* - version: link:../../packages/bumpgen-core '@sindresorhus/tsconfig': specifier: ^3.0.1 version: 3.0.1 + '@xeol/bumpgen-core': + specifier: workspace:* + version: link:../../packages/bumpgen-core cfonts: specifier: ^3.2.0 version: 3.2.0 @@ -90,15 +94,6 @@ importers: specifier: ^3.22.4 version: 3.22.4 devDependencies: - '@repo/eslint-config': - specifier: workspace:* - version: link:../../tooling/eslint - '@repo/prettier-config': - specifier: workspace:* - version: link:../../tooling/prettier - '@repo/tsconfig': - specifier: workspace:* - version: link:../../tooling/typescript '@types/eslint': specifier: ^8.56.5 version: 8.56.5 @@ -114,6 +109,15 @@ importers: '@types/react': specifier: ^18.2.79 version: 18.2.79 + '@xeol/eslint-config': + specifier: workspace:* + version: link:../../tooling/eslint + '@xeol/prettier-config': + specifier: workspace:* + version: link:../../tooling/prettier + '@xeol/tsconfig': + specifier: workspace:* + version: link:../../tooling/typescript eslint: specifier: ^8.57.0 version: 8.57.0 @@ -175,18 +179,6 @@ importers: specifier: ^3.22.4 version: 3.22.4 devDependencies: - '@repo/eslint-config': - specifier: workspace:* - version: link:../../tooling/eslint - '@repo/prettier-config': - specifier: workspace:* - version: link:../../tooling/prettier - '@repo/test-project': - specifier: workspace:* - version: link:../test-project - '@repo/tsconfig': - specifier: workspace:* - version: link:../../tooling/typescript '@types/eslint': specifier: ^8.56.5 version: 8.56.5 @@ -205,6 +197,18 @@ importers: '@types/uuid': specifier: ^9.0.8 version: 9.0.8 + '@xeol/eslint-config': + specifier: workspace:* + version: link:../../tooling/eslint + '@xeol/prettier-config': + specifier: workspace:* + version: link:../../tooling/prettier + '@xeol/test-project': + specifier: workspace:* + version: link:../test-project + '@xeol/tsconfig': + specifier: workspace:* + version: link:../../tooling/typescript eslint: specifier: ^8.57.0 version: 8.57.0 @@ -254,15 +258,6 @@ importers: specifier: ^3.22.4 version: 3.22.4 devDependencies: - '@repo/eslint-config': - specifier: workspace:* - version: link:../../tooling/eslint - '@repo/prettier-config': - specifier: workspace:* - version: link:../../tooling/prettier - '@repo/tsconfig': - specifier: workspace:* - version: link:../../tooling/typescript '@types/eslint': specifier: ^8.56.5 version: 8.56.5 @@ -272,6 +267,15 @@ importers: '@types/node': specifier: ^20.11.24 version: 20.11.24 + '@xeol/eslint-config': + specifier: workspace:* + version: link:../../tooling/eslint + '@xeol/prettier-config': + specifier: workspace:* + version: link:../../tooling/prettier + '@xeol/tsconfig': + specifier: workspace:* + version: link:../../tooling/typescript eslint: specifier: ^8.57.0 version: 8.57.0 @@ -293,7 +297,7 @@ importers: '@npmcli/package-json': specifier: ^5.0.3 version: 5.0.3 - '@repo/bumpgen-core': + '@xeol/bumpgen-core': specifier: workspace:* version: link:../packages/bumpgen-core graphology: @@ -330,18 +334,6 @@ importers: specifier: ^3.22.4 version: 3.22.4 devDependencies: - '@repo/eslint-config': - specifier: workspace:* - version: link:../tooling/eslint - '@repo/prettier-config': - specifier: workspace:* - version: link:../tooling/prettier - '@repo/test-project': - specifier: workspace:* - version: link:../packages/test-project - '@repo/tsconfig': - specifier: workspace:* - version: link:../tooling/typescript '@types/eslint': specifier: ^8.56.5 version: 8.56.5 @@ -357,6 +349,18 @@ importers: '@types/semver': specifier: ^7.5.8 version: 7.5.8 + '@xeol/eslint-config': + specifier: workspace:* + version: link:../tooling/eslint + '@xeol/prettier-config': + specifier: workspace:* + version: link:../tooling/prettier + '@xeol/test-project': + specifier: workspace:* + version: link:../packages/test-project + '@xeol/tsconfig': + specifier: workspace:* + version: link:../tooling/typescript eslint: specifier: ^8.57.0 version: 8.57.0 @@ -400,15 +404,15 @@ importers: specifier: ^4.6.0 version: 4.6.0(eslint@8.57.0) devDependencies: - '@repo/prettier-config': + '@types/eslint': + specifier: ^8.56.2 + version: 8.56.5 + '@xeol/prettier-config': specifier: workspace:* version: link:../prettier - '@repo/tsconfig': + '@xeol/tsconfig': specifier: workspace:* version: link:../typescript - '@types/eslint': - specifier: ^8.56.2 - version: 8.56.5 eslint: specifier: ^8.57.0 version: 8.57.0 @@ -428,7 +432,7 @@ importers: specifier: ^3.1.1 version: 3.2.5 devDependencies: - '@repo/tsconfig': + '@xeol/tsconfig': specifier: workspace:* version: link:../typescript typescript: diff --git a/scripts/package.json b/scripts/package.json index 302a80e..2abfe11 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@commander-js/extra-typings": "^12.0.1", - "@repo/bumpgen-core": "workspace:*", + "@xeol/bumpgen-core": "workspace:*", "@npmcli/package-json": "^5.0.3", "graphology": "^0.25.4", "graphology-dag": "^0.4.1", @@ -26,10 +26,10 @@ "zod": "^3.22.4" }, "devDependencies": { - "@repo/eslint-config": "workspace:*", - "@repo/prettier-config": "workspace:*", - "@repo/test-project": "workspace:*", - "@repo/tsconfig": "workspace:*", + "@xeol/eslint-config": "workspace:*", + "@xeol/prettier-config": "workspace:*", + "@xeol/test-project": "workspace:*", + "@xeol/tsconfig": "workspace:*", "@types/eslint": "^8.56.5", "@types/jest": "^29.5.12", "@types/node": "^20.11.24", @@ -43,9 +43,11 @@ "eslintConfig": { "root": true, "extends": [ - "@repo/eslint-config/base" + "@xeol/eslint-config/base" ], - "ignorePatterns": ["**/*"] + "ignorePatterns": [ + "**/*" + ] }, - "prettier": "@repo/prettier-config" + "prettier": "@xeol/prettier-config" } diff --git a/scripts/src/eval.ts b/scripts/src/eval.ts index bf0a46f..c9b2910 100644 --- a/scripts/src/eval.ts +++ b/scripts/src/eval.ts @@ -3,10 +3,9 @@ import { exec } from "child_process"; import { existsSync, readFileSync } from "fs"; import { writeFile } from "fs/promises"; import { program } from "@commander-js/extra-typings"; +import { injectGitService, makeBumpgen } from "@xeol/bumpgen-core"; import { z } from "zod"; -import { injectGitService, makeBumpgen } from "@repo/bumpgen-core"; - export const PredictionSchema = z.object({ // the name of the model that generated the prediction modelName: z.string(), @@ -130,13 +129,23 @@ program if (errors.length === 0) break; const graph = bumpgen.graph.initialize(errors); - const temperature = Math.min(iterations > maxIterations / 2 ? 0.2 * Math.exp(0.15 * (iterations - maxIterations / 2)) : 0.2, 1); - console.log(`ITERATION ${iterations} of ${maxIterations} with temperation ${temperature}`); - + const temperature = Math.min( + iterations > maxIterations / 2 + ? 0.2 * Math.exp(0.15 * (iterations - maxIterations / 2)) + : 0.2, + 1, + ); + console.log( + `ITERATION ${iterations} of ${maxIterations} with temperation ${temperature}`, + ); + let iterationResult; do { - iterationResult = await bumpgen.graph.plan.execute(graph, temperature); + iterationResult = await bumpgen.graph.plan.execute( + graph, + temperature, + ); if (!iterationResult) break; } while (iterationResult); diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 023233d..51b07c5 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@repo/tsconfig/base.json", + "extends": "@xeol/tsconfig/base.json", "compilerOptions": { "outDir": "dist" }, diff --git a/tooling/eslint/package.json b/tooling/eslint/package.json index c3d8132..39310a6 100644 --- a/tooling/eslint/package.json +++ b/tooling/eslint/package.json @@ -1,5 +1,5 @@ { - "name": "@repo/eslint-config", + "name": "@xeol/eslint-config", "version": "0.2.0", "private": true, "license": "MIT", @@ -26,8 +26,8 @@ "eslint-plugin-react-hooks": "^4.6.0" }, "devDependencies": { - "@repo/prettier-config": "workspace:*", - "@repo/tsconfig": "workspace:*", + "@xeol/prettier-config": "workspace:*", + "@xeol/tsconfig": "workspace:*", "@types/eslint": "^8.56.2", "eslint": "^8.57.0", "prettier": "^3.1.1", @@ -39,5 +39,5 @@ "./base.js" ] }, - "prettier": "@repo/prettier-config" + "prettier": "@xeol/prettier-config" } diff --git a/tooling/eslint/tsconfig.json b/tooling/eslint/tsconfig.json index 649a851..881e85f 100644 --- a/tooling/eslint/tsconfig.json +++ b/tooling/eslint/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@repo/tsconfig/base.json", + "extends": "@xeol/tsconfig/base.json", "compilerOptions": { "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json" }, diff --git a/tooling/github/setup/action.yml b/tooling/github/setup/action.yml index 6d56b8d..8b61924 100644 --- a/tooling/github/setup/action.yml +++ b/tooling/github/setup/action.yml @@ -8,10 +8,11 @@ runs: - uses: actions/setup-node@v4 with: node-version: 21 + registry-url: "https://registry.npmjs.org" cache: "pnpm" - shell: bash run: pnpm add -g turbo - shell: bash - run: pnpm install \ No newline at end of file + run: pnpm install diff --git a/tooling/prettier/index.js b/tooling/prettier/index.js index 013b18a..a409d8c 100644 --- a/tooling/prettier/index.js +++ b/tooling/prettier/index.js @@ -5,9 +5,7 @@ import { fileURLToPath } from "url"; /** @type { PrettierConfig | SortImportsConfig } */ const config = { - plugins: [ - "@ianvs/prettier-plugin-sort-imports", - ], + plugins: ["@ianvs/prettier-plugin-sort-imports"], importOrder: [ "", "^(react/(.*)$)|^(react$)|^(react-native(.*)$)", @@ -15,7 +13,7 @@ const config = { "", "", "^@repo", - "^@repo/(.*)$", + "^@xeol/(.*)$", "", "^[.|..|~]", "^~/", diff --git a/tooling/prettier/package.json b/tooling/prettier/package.json index 46841a1..b6558e9 100644 --- a/tooling/prettier/package.json +++ b/tooling/prettier/package.json @@ -1,5 +1,5 @@ { - "name": "@repo/prettier-config", + "name": "@xeol/prettier-config", "private": true, "version": "0.1.0", "type": "module", @@ -16,8 +16,8 @@ "prettier": "^3.1.1" }, "devDependencies": { - "@repo/tsconfig": "workspace:*", + "@xeol/tsconfig": "workspace:*", "typescript": "^5.3.3" }, - "prettier": "@repo/prettier-config" + "prettier": "@xeol/prettier-config" } diff --git a/tooling/prettier/tsconfig.json b/tooling/prettier/tsconfig.json index 649a851..881e85f 100644 --- a/tooling/prettier/tsconfig.json +++ b/tooling/prettier/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@repo/tsconfig/base.json", + "extends": "@xeol/tsconfig/base.json", "compilerOptions": { "tsBuildInfoFile": "node_modules/.cache/tsbuildinfo.json" }, diff --git a/tooling/typescript/package.json b/tooling/typescript/package.json index 45dc2b6..9c08114 100644 --- a/tooling/typescript/package.json +++ b/tooling/typescript/package.json @@ -1,6 +1,8 @@ { - "name": "@repo/tsconfig", + "name": "@xeol/tsconfig", "private": true, "version": "0.1.0", - "files": ["base.json"] + "files": [ + "base.json" + ] } diff --git a/tsconfig.json b/tsconfig.json index 3586d28..87d0668 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,3 +1,3 @@ { - "extends": "@repo/tsconfig/base.json" + "extends": "@xeol/tsconfig/base.json" }