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
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
release:
types:
- published

permissions:
contents: read
id-token: write

jobs:
release:
name: Release

runs-on: ubuntu-latest

steps:
- name: Checkout Repo
uses: actions/checkout@v5

- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.2.21

- name: Set package version
env:
VERSION: ${{ github.ref_name }}
run: |
echo $(jq --arg v "${{ env.VERSION }}" '(.version) = $v' package.json) > package.json

- name: Install Dependencies
run: bun install --frozen-lockfile

Comment on lines +33 to +35
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Build explicitly before publish (don’t rely on lifecycle)

To avoid CLI/lifecycle discrepancies, run the build step explicitly.

       - name: Install Dependencies
         run: bun install --frozen-lockfile

+      - name: Build dist
+        run: bun run build
+
       - name: Publish
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Install Dependencies
run: bun install --frozen-lockfile
- name: Build dist
run: bun run build
- name: Publish
🤖 Prompt for AI Agents
.github/workflows/release.yml lines 33-35: the workflow currently only installs
dependencies and relies on package lifecycle to build before publishing; add an
explicit build step after installing (e.g., run: bun build or the project's
build command) so the artifact is produced deterministically before publish, and
ensure the build command runs before any publish/publish-related steps in the
job.

- name: Publish
env:
NPM_CONFIG_TOKEN: ${{ secrets.NPM_TOKEN }}
TAG: ${{ github.event.release.prerelease && 'canary' || 'latest' }}
run: bun publish --tag=${{ env.TAG }}
90 changes: 65 additions & 25 deletions bun.lock

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

3 changes: 3 additions & 0 deletions eslint.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ import globals from 'globals'
import tseslint from 'typescript-eslint'

export default defineConfig([
{
ignores: ['dist/**/*'],
},
{
languageOptions: {
globals: globals.browser,
Expand Down
44 changes: 35 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
{
"name": "@daxserver/validation-schema-codegen",
"version": "0.1.0",
"description": "Codegen for validation schemas",
"private": true,
"main": "src/index.ts",
"module": "src/index.ts",
"version": "dev",
"description": "Code generator for validation schemas for Typebox",
"keywords": [
"typebox",
"codegenerator",
"validation"
],
"author": {
"name": "Srihari Thalla",
"email": "daxserver@icloud.com"
},
"type": "module",
"main": "dist/index.js",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"files": [
"dist"
],
"private": false,
"publishConfig": {
"access": "public",
"provenance": true,
"tag": "latest"
},
Comment on lines +28 to +32
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Provenance + Bun publish: verify support

publishConfig.provenance: true requires provenance-aware publish. Please confirm bun publish supports npm provenance for your version; otherwise use npm publish --provenance.


🌐 Web query:

Does "bun publish" support npm provenance attestations equivalently to "npm publish --provenance" as of Bun 1.2.21?

💡 Result:

Short answer: No.

Evidence:

  • Bun's publish docs (current CLI docs) don't mention a --provenance flag or NPM_CONFIG_PROVENANCE support for bun publish. [2]
  • There is an open GitHub issue requesting implementation of a bun publish --provenance feature (issue #15601), indicating it was not implemented at the time of that issue. [1]
  • npm documents how third‑party publishers can enable provenance (NPM_CONFIG_PROVENANCE, publishConfig, or calling npm publish --provenance). Bun's docs do not list those compatibility workarounds. [3]

If you want, I can check the exact bun 1.2.21 release notes or test a local bun 1.2.21 install to confirm behavior.


Remove publishConfig.provenance or switch to npm publish --provenance
Bun CLI (v1.2.21) does not support npm provenance attestations via bun publish (no --provenance flag) (bun.com, github.com) Use npm publish --provenance or drop the provenance field to enable attestations.

🤖 Prompt for AI Agents
In package.json around lines 28 to 32, the publishConfig currently includes
"provenance": true which Bun CLI does not support; either remove the
"provenance" property from publishConfig to allow bun publish to work, or keep
it but document and switch your publishing step to use npm (npm publish
--provenance) instead of bun so the provenance attestation can be produced;
update package.json accordingly (remove the field) or update CI/release scripts
to invoke npm publish --provenance and leave a comment in package.json
explaining the choice.

"dependencies": {
"graphology": "^0.26.0",
"graphology-dag": "^0.4.1",
Expand All @@ -29,15 +53,17 @@
"prettier": "^3.6.2",
"prettier-plugin-organize-imports": "^4.2.0",
"ts-morph": "^26.0.0",
"typescript-eslint": "^8.41.0",
"wikibase-sdk": "^10.2.3"
"tsc-alias": "^1.8.16",
"typescript-eslint": "^8.41.0"
},
"peerDependencies": {
"typescript": "~5.9.2"
},
"scripts": {
"build": "tsc --project tsconfig.build.json && tsc-alias -p tsconfig.build.json",
"format": "prettier --cache --write .",
"typecheck": "tsc --noEmit",
"lint": "eslint"
"lint": "eslint",
"prepublishOnly": "bun run build",
"typecheck": "tsc --noEmit"
}
}
26 changes: 26 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "dist",
"rootDir": "src",
"moduleResolution": "node",
"module": "ESNext",
"target": "ES2022",
"allowImportingTsExtensions": false,
"verbatimModuleSyntax": false
},
"include": [
"src/**/*"
],
"exclude": [
"tests/**/*",
"**/*.test.ts",
"**/*.spec.ts",
"dist",
"node_modules"
]
}