From fac26f2faf2d45ec107402372378e24b9ee556fc Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 09:04:20 +0000 Subject: [PATCH 01/40] Add changesets action without publishing --- .github/workflows/release.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..c47f68c82b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Release + +on: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v5 + + - name: Setup Node.js 24 + uses: actions/setup-node@v6 + with: + node-version: 24 + cache: 'yarn' + + - name: Install Dependencies + run: yarn + + - name: Create Release Pull Request + uses: changesets/action@v1 From ca508be226c7141e7d9bdc668b5f202accadcf3a Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 11:47:24 +0000 Subject: [PATCH 02/40] Change grafast build process to new centralized build --- grafast/grafast/package.json | 12 +-- grafast/grafast/scripts/build-npm.mjs | 33 ------- scripts/build-core.mjs | 71 -------------- scripts/build-core.mts | 129 ++++++++++++++++++++++++++ 4 files changed, 135 insertions(+), 110 deletions(-) delete mode 100755 grafast/grafast/scripts/build-npm.mjs delete mode 100644 scripts/build-core.mjs create mode 100644 scripts/build-core.mts diff --git a/grafast/grafast/package.json b/grafast/grafast/package.json index 66933dc094..fab2838983 100644 --- a/grafast/grafast/package.json +++ b/grafast/grafast/package.json @@ -28,10 +28,11 @@ }, "scripts": { "codegen": "cd __tests__/dcc && node --experimental-strip-types ../../../../node_modules/.bin/graphql-codegen", - "test": "yarn codegen && yarn test:mocha && yarn test:bundle", - "test:bundle": "node --experimental-strip-types scripts/testbundle.mts", - "test:mocha": "tsc -b tsconfig.test.json && NODE_ENV=test GRAPHILE_ENV=test mocha '**/__tests__/**/*-test.ts'", - "build": "zx scripts/build-npm.mjs", + "test": "yarn codegen && yarn test-mocha && yarn test-bundle", + "test-bundle": "node --experimental-strip-types scripts/testbundle.mts", + "test-mocha": "tsc -b tsconfig.test.json && NODE_ENV=test GRAPHILE_ENV=test mocha '**/__tests__/**/*-test.ts'", + "build-release": "node ../../scripts/build-core.mts", + "prepack": "tsc -b", "postpack": "echo 'FORBIDDEN' && exit 1", "md": "spec-md CRYSTAL_FLOW.md > CRYSTAL_FLOW.html" }, @@ -84,8 +85,7 @@ }, "files": [ "fwd", - "dist", - "browser" + "dist" ], "devDependencies": { "@graphql-codegen/cli": "^6.1.0", diff --git a/grafast/grafast/scripts/build-npm.mjs b/grafast/grafast/scripts/build-npm.mjs deleted file mode 100755 index a586e9dd8b..0000000000 --- a/grafast/grafast/scripts/build-npm.mjs +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env zx - -/* global $, cd */ - -import "zx/globals"; - -import { - /* esmHack, */ transformPackageJson, -} from "../../../scripts/build-core.mjs"; - -cd(__dirname + "/.."); -await $`rm -Rf tsconfig.tsbuildinfo dist release`; -await $`tsc -b`; -await $`find dist -type d -exec mkdir -p release/{} \\;`; -await $`find dist -type f -name '*.js' -exec cp {} release/{} \\;`; -await $`find dist -type f -name '*.d.ts' -exec cp {} release/{} \\;`; -await $`find fwd -type d -exec mkdir -p release/{} \\;`; -await $`find fwd -type f -name '*.js' -exec cp {} release/{} \\;`; -await $`find fwd -type f -name '*.d.ts' -exec cp {} release/{} \\;`; -await $`cp src/.npmignore release/dist/.npmignore`; -await $`cp LICENSE.md release/LICENSE.md`; -await $`cp README.md release/README.md`; - -await transformPackageJson( - __dirname + "/../package.json", - __dirname + "/../release/package.json", -); - -// TODO: force GRAPHILE_ENV="production" and eliminate all related dead branches - -//await esmHack(__dirname + "/../release/dist/index.js"); -//await esmHack(__dirname + "/../release/dist/envelop.js"); -//await esmHack(__dirname + "/../release/dist/mermaid.js"); diff --git a/scripts/build-core.mjs b/scripts/build-core.mjs deleted file mode 100644 index c1081bd429..0000000000 --- a/scripts/build-core.mjs +++ /dev/null @@ -1,71 +0,0 @@ -import fsp from "node:fs/promises"; -import path from "node:path"; -import { fileURLToPath } from "node:url"; - -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); - -export async function transformPackageJson(sourceFilePath, targetFilePath) { - const packageJson = require(sourceFilePath); - const newJson = { ...packageJson }; - delete newJson.scripts; - delete newJson.devDependencies; - delete newJson.publishConfig.directory; - - for (const key in newJson) { - if ( - key.endsWith("ependencies") && - typeof newJson[key] === "object" && - newJson[key] !== null - ) { - const deps = { ...newJson[key] }; - newJson[key] = deps; - // Transform `workspace:` dependencies - for (const moduleName in deps) { - const version = deps[moduleName]; - if (typeof version === "string" && version.startsWith("workspace:")) { - const range = version.substring(10); - if (range.length !== 1) { - throw new Error(`Don't understand '${version}'`); - } - // Find the package's version - const packageJson = JSON.parse( - await fsp.readFile( - `${__dirname}/../node_modules/${moduleName}/package.json`, - "utf8", - ), - ); - deps[moduleName] = `${range}${packageJson.version}`; - console.log(moduleName, deps[moduleName]); - } - } - } - } - - await fsp.writeFile(targetFilePath, JSON.stringify(newJson, null, 2)); -} - -export async function esmHack(codePath) { - const pkg = require(codePath); - const code = await fsp.readFile(codePath, "utf8"); - - await fsp.writeFile( - codePath, - `\ -// Convince Node to allow ESM named imports -${Object.keys(pkg) - .map( - (varName) => - `${ - varName.match(/^[_a-zA-Z$][_a-zA-Z$0-9]*$/) - ? `exports.${varName}` - : `exports[${JSON.stringify(varName)}]` - } = null /* placeholder */;`, - ) - .join("\n")} - -// Bundled module -${code} -`, - ); -} diff --git a/scripts/build-core.mts b/scripts/build-core.mts new file mode 100644 index 0000000000..dccbd8ecd4 --- /dev/null +++ b/scripts/build-core.mts @@ -0,0 +1,129 @@ +/* global $, cd */ + +import "zx/globals"; + +import { existsSync } from "node:fs"; +import fsp, { mkdir, readFile, stat } from "node:fs/promises"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +async function transformPackageJson(packageJson: any, targetFilePath: string) { + const newJson = JSON.parse(JSON.stringify(packageJson)); + delete newJson.scripts; + delete newJson.devDependencies; + delete newJson.publishConfig.directory; + + for (const key in newJson) { + if ( + key.endsWith("ependencies") && + typeof newJson[key] === "object" && + newJson[key] !== null + ) { + const deps = { ...newJson[key] }; + newJson[key] = deps; + // Transform `workspace:` dependencies + for (const moduleName in deps) { + const version = deps[moduleName]; + if (typeof version === "string" && version.startsWith("workspace:")) { + const range = version.substring(10); + if (range.length !== 1) { + throw new Error(`Don't understand '${version}'`); + } + // Find the package's version + const packageJson = JSON.parse( + await fsp.readFile( + `${__dirname}/../node_modules/${moduleName}/package.json`, + "utf8", + ), + ); + deps[moduleName] = `${range}${packageJson.version}`; + console.log( + `packageJson.${key}[${JSON.stringify(moduleName)}] went from ${version} to ${deps[moduleName]}`, + ); + } + } + } + } + + await fsp.writeFile(targetFilePath, JSON.stringify(newJson, null, 2)); +} + +export async function esmHack(codePath: string) { + const pkg = require(codePath); + const code = await fsp.readFile(codePath, "utf8"); + + await fsp.writeFile( + codePath, + `\ +// Convince Node to allow ESM named imports +${Object.keys(pkg) + .map( + (varName) => + `${ + varName.match(/^[_a-zA-Z$][_a-zA-Z$0-9]*$/) + ? `exports.${varName}` + : `exports[${JSON.stringify(varName)}]` + } = null /* placeholder */;`, + ) + .join("\n")} + +// Bundled module +${code} +`, + ); +} + +export async function build() { + const packagePath = process.cwd(); + const packageJson = JSON.parse( + await readFile(`${packagePath}/package.json`, "utf8"), + ); + + const { private: isPrivate, publishConfig, name } = packageJson; + if (isPrivate) { + throw new Error(`Can't build private package`); + } + if (!publishConfig) { + throw new Error( + `Module ${name} not set up for publishing (no \`publishConfig\`)`, + ); + } + if (!publishConfig.directory) { + throw new Error(`Module ${name} not has no release directory configured`); + } + if (publishConfig.directory !== "release") { + throw new Error( + `Module ${name} must have release directory 'release' (found: ${publishConfig.directory})`, + ); + } + + await $`rm -Rf tsconfig*.tsbuildinfo dist release`; + await $`yarn prepack`; + await mkdir("release"); + for (const f of packageJson.files) { + const stats = await stat(f); + if (stats.isDirectory()) { + await $`cp -a ${f} ${`release/${f}`}`; + } else { + await $`cp ${f} ${`release/${f}`}`; + } + } + if (existsSync(`${packagePath}/src/.npmignore`)) { + await $`cp src/.npmignore release/dist/.npmignore`; + } + await $`cp LICENSE.md README.md release/`; + + await transformPackageJson( + packageJson, + `${packagePath}/release/package.json`, + ); + + // TODO: force GRAPHILE_ENV="production" and eliminate all related dead branches +} + +if (import.meta.main) { + await build(); +} From d1e08edd443be4a2a990beaf9cc7a8a939fa9947 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 12:19:29 +0000 Subject: [PATCH 03/40] Rename --- scripts/{build-core.mts => build-release.mts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scripts/{build-core.mts => build-release.mts} (100%) diff --git a/scripts/build-core.mts b/scripts/build-release.mts similarity index 100% rename from scripts/build-core.mts rename to scripts/build-release.mts From e195427830683ff4539e6c1128f7a96cd7516698 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 12:20:52 +0000 Subject: [PATCH 04/40] Give all public packages a build-release command and publishConfig --- grafast/codegen-plugin/package.json | 2 ++ grafast/dataplan-json/package.json | 5 +++++ grafast/dataplan-pg/package.json | 5 +++++ grafast/grafast/package.json | 6 +++--- grafast/grafserv-persisted/package.json | 7 ++++++- grafast/grafserv/package.json | 7 ++++++- grafast/ruru-components/package.json | 5 +++++ grafast/ruru-types/package.json | 5 +++++ grafast/ruru/package.json | 5 +++++ graphile-build/graphile-build-pg/package.json | 5 +++++ graphile-build/graphile-build/package.json | 5 +++++ graphile-build/graphile-simplify-inflection/package.json | 2 ++ graphile-build/graphile-utils/package.json | 7 ++++++- postgraphile/pgl/package.json | 5 +++++ postgraphile/postgraphile/package.json | 5 +++++ utils/eslint-plugin-graphile-export/package.json | 5 +++++ utils/graphile-config/package.json | 5 +++++ utils/graphile-export/package.json | 5 +++++ utils/graphile/package.json | 5 +++++ utils/jest-serializer-graphql-schema/package.json | 7 ++++++- utils/jest-serializer-simple/package.json | 7 ++++++- utils/lru/package.json | 5 +++++ utils/pg-introspection/package.json | 5 +++++ utils/pg-sql2/package.json | 5 +++++ utils/tamedevil/package.json | 5 +++++ 25 files changed, 122 insertions(+), 8 deletions(-) diff --git a/grafast/codegen-plugin/package.json b/grafast/codegen-plugin/package.json index 39f4562dac..923b931064 100644 --- a/grafast/codegen-plugin/package.json +++ b/grafast/codegen-plugin/package.json @@ -3,6 +3,7 @@ "version": "1.0.0-rc.4", "description": "A GraphQL code generator plugin for Grafast schemas", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "prepack": "tsc -b" }, "exports": { @@ -37,6 +38,7 @@ "dist" ], "publishConfig": { + "directory": "release", "access": "public" }, "dependencies": { diff --git a/grafast/dataplan-json/package.json b/grafast/dataplan-json/package.json index 430357fc24..fdc0075604 100644 --- a/grafast/dataplan-json/package.json +++ b/grafast/dataplan-json/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "prepack": "tsc -b" }, "repository": { @@ -43,5 +44,9 @@ "jest": "^30.2.0", "jest-serializer-simple": "workspace:^", "typescript": "^5.9.3" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/grafast/dataplan-pg/package.json b/grafast/dataplan-pg/package.json index 7e70f04504..420a788b65 100644 --- a/grafast/dataplan-pg/package.json +++ b/grafast/dataplan-pg/package.json @@ -23,6 +23,7 @@ } }, "scripts": { + "build-release": "node ../../scripts/build-release.mts", "codegen": "yarn graphql-codegen -c codegen-examples-smallExample.ts", "update-schema": "ts-node ./src/examples/exampleSchema.ts", "test": "GRAPHILE_ENV=test jest", @@ -114,5 +115,9 @@ "webpack-cli": "^6.0.1", "webpack-node-externals": "^3.0.0", "zx": "^8.8.5" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/grafast/grafast/package.json b/grafast/grafast/package.json index fab2838983..d9f835f05a 100644 --- a/grafast/grafast/package.json +++ b/grafast/grafast/package.json @@ -27,11 +27,11 @@ } }, "scripts": { + "build-release": "node ../../scripts/build-release.mts", "codegen": "cd __tests__/dcc && node --experimental-strip-types ../../../../node_modules/.bin/graphql-codegen", "test": "yarn codegen && yarn test-mocha && yarn test-bundle", "test-bundle": "node --experimental-strip-types scripts/testbundle.mts", "test-mocha": "tsc -b tsconfig.test.json && NODE_ENV=test GRAPHILE_ENV=test mocha '**/__tests__/**/*-test.ts'", - "build-release": "node ../../scripts/build-core.mts", "prepack": "tsc -b", "postpack": "echo 'FORBIDDEN' && exit 1", "md": "spec-md CRYSTAL_FLOW.md > CRYSTAL_FLOW.html" @@ -114,7 +114,7 @@ "zx": "^8.8.5" }, "publishConfig": { - "access": "public", - "directory": "release" + "directory": "release", + "access": "public" } } diff --git a/grafast/grafserv-persisted/package.json b/grafast/grafserv-persisted/package.json index c76f2d9fbf..eb5619e8c9 100644 --- a/grafast/grafserv-persisted/package.json +++ b/grafast/grafserv-persisted/package.json @@ -12,6 +12,7 @@ } }, "scripts": { + "build-release": "node ../../scripts/build-release.mts", "prepack": "tsc -b", "test": "true" }, @@ -70,5 +71,9 @@ "files": [ "dist", "index.js" - ] + ], + "publishConfig": { + "directory": "release", + "access": "public" + } } diff --git a/grafast/grafserv/package.json b/grafast/grafserv/package.json index 3c4a6440f6..623c0c99db 100644 --- a/grafast/grafserv/package.json +++ b/grafast/grafserv/package.json @@ -76,6 +76,7 @@ } }, "scripts": { + "build-release": "node ../../scripts/build-release.mts", "prepack": "tsc -b", "test": "jest", "posttest": "yarn playwright install chromium && node --experimental-strip-types scripts/smoke-examples.mts" @@ -171,5 +172,9 @@ "dist", "fwd", "index.js" - ] + ], + "publishConfig": { + "directory": "release", + "access": "public" + } } diff --git a/grafast/ruru-components/package.json b/grafast/ruru-components/package.json index 294497fe82..3163d6df7b 100644 --- a/grafast/ruru-components/package.json +++ b/grafast/ruru-components/package.json @@ -16,6 +16,7 @@ } }, "scripts": { + "build-release": "node ../../scripts/build-release.mts", "prepack": "tsc -b" }, "repository": { @@ -78,5 +79,9 @@ "jest": "^30.2.0", "nodemon": "^3.1.11", "typescript": "^5.9.3" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/grafast/ruru-types/package.json b/grafast/ruru-types/package.json index 3fcc227267..900d6daaa2 100644 --- a/grafast/ruru-types/package.json +++ b/grafast/ruru-types/package.json @@ -12,6 +12,7 @@ } }, "scripts": { + "build-release": "node ../../scripts/build-release.mts", "prepack": "tsc -b" }, "repository": { @@ -58,5 +59,9 @@ "react": "^18 || ^19", "react-dom": "^18 || ^19", "typescript": "^5.9.3" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/grafast/ruru/package.json b/grafast/ruru/package.json index 226335e2de..bcfa8eb331 100644 --- a/grafast/ruru/package.json +++ b/grafast/ruru/package.json @@ -28,6 +28,7 @@ } }, "scripts": { + "build-release": "node ../../scripts/build-release.mts", "webpack": "node --loader ts-node/esm \"$(yarn bin webpack-cli)\" --config webpack.config.mts", "watch": "yarn webpack --watch --mode=development", "make-ruru-html": "node --experimental-strip-types scripts/make-ruru-html.mts", @@ -98,5 +99,9 @@ "webpack": "^5.103.0", "webpack-bundle-analyzer": "^4.10.2", "webpack-cli": "^6.0.1" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/graphile-build/graphile-build-pg/package.json b/graphile-build/graphile-build-pg/package.json index 7a8f5e7063..65ce6d0e55 100644 --- a/graphile-build/graphile-build-pg/package.json +++ b/graphile-build/graphile-build-pg/package.json @@ -37,6 +37,7 @@ } }, "scripts": { + "build-release": "node ../../scripts/build-release.mts", "test": "jest", "prepack": "tsc -b && cp src/.npmignore dist/.npmignore" }, @@ -120,5 +121,9 @@ "ts-node": "^10.9.2", "typescript": "^5.9.3", "ws": "^8.18.3" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/graphile-build/graphile-build/package.json b/graphile-build/graphile-build/package.json index 75a867016e..bb5c4f4131 100644 --- a/graphile-build/graphile-build/package.json +++ b/graphile-build/graphile-build/package.json @@ -12,6 +12,7 @@ } }, "scripts": { + "build-release": "node ../../scripts/build-release.mts", "prepack": "tsc -b && cp src/.npmignore dist/.npmignore" }, "repository": { @@ -71,5 +72,9 @@ "jest": "^30.2.0", "ts-node": "^10.9.2", "typescript": "^5.9.3" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/graphile-build/graphile-simplify-inflection/package.json b/graphile-build/graphile-simplify-inflection/package.json index ac84a6f1e7..4cfe502649 100644 --- a/graphile-build/graphile-simplify-inflection/package.json +++ b/graphile-build/graphile-simplify-inflection/package.json @@ -4,6 +4,7 @@ "description": "Simplifies the graphile-build/graphile-build-pg inflection to trim the `ByFooIdAndBarId` from relations, etc", "main": "dist/index.js", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "prepack": "tsc -b", "test": "node test.js" }, @@ -37,6 +38,7 @@ "typescript": "^5.9.3" }, "publishConfig": { + "directory": "release", "access": "public" } } diff --git a/graphile-build/graphile-utils/package.json b/graphile-build/graphile-utils/package.json index edddb5ab02..76903eb7c6 100644 --- a/graphile-build/graphile-utils/package.json +++ b/graphile-build/graphile-utils/package.json @@ -12,6 +12,7 @@ } }, "scripts": { + "build-release": "node ../../scripts/build-release.mts", "test": "jest", "prepack": "tsc -b tsconfig.build.json" }, @@ -77,5 +78,9 @@ "files": [ "dist", "index.js" - ] + ], + "publishConfig": { + "directory": "release", + "access": "public" + } } diff --git a/postgraphile/pgl/package.json b/postgraphile/pgl/package.json index cec2a20523..bd3a79c39c 100644 --- a/postgraphile/pgl/package.json +++ b/postgraphile/pgl/package.json @@ -207,6 +207,7 @@ }, "bin": "./dist/cli-run.js", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "prepack": "tsc -b tsconfig.build.json" }, "repository": { @@ -275,5 +276,9 @@ "nodemon": "^3.1.11", "ts-node": "^10.9.2", "typescript": "^5.9.3" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/postgraphile/postgraphile/package.json b/postgraphile/postgraphile/package.json index 05f4218c6a..56648d9c7a 100644 --- a/postgraphile/postgraphile/package.json +++ b/postgraphile/postgraphile/package.json @@ -223,6 +223,7 @@ }, "bin": "./dist/cli-run.js", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "test": "yarn test:jest && UPDATE_SNAPSHOTS=\"\" yarn test:schema-exports && UPDATE_SNAPSHOTS=\"\" yarn test:operations-exports", "test:jest": "jest", "test:schema-exports": "node scripts/test-schema-exports.mjs", @@ -317,5 +318,9 @@ "nodemon": "^3.1.11", "ts-node": "^10.9.2", "typescript": "^5.9.3" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/utils/eslint-plugin-graphile-export/package.json b/utils/eslint-plugin-graphile-export/package.json index 5a4ed7883e..91095656ad 100644 --- a/utils/eslint-plugin-graphile-export/package.json +++ b/utils/eslint-plugin-graphile-export/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "prepack": "tsc -b" }, "repository": { @@ -45,5 +46,9 @@ "jest": "^30.2.0", "ts-node": "^10.9.2", "typescript": "^5.9.3" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/utils/graphile-config/package.json b/utils/graphile-config/package.json index e7f338fcf8..9f9da2e92c 100644 --- a/utils/graphile-config/package.json +++ b/utils/graphile-config/package.json @@ -20,6 +20,7 @@ } }, "scripts": { + "build-release": "node ../../scripts/build-release.mts", "test": "mocha '__tests__/**/*.test.ts'", "prepack": "tsc -b" }, @@ -62,5 +63,9 @@ "mocha": "^11.7.5", "ts-node": "^10.9.2", "typescript": "^5.9.3" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/utils/graphile-export/package.json b/utils/graphile-export/package.json index e3c5ed0a31..61ff309f0a 100644 --- a/utils/graphile-export/package.json +++ b/utils/graphile-export/package.json @@ -16,6 +16,7 @@ } }, "scripts": { + "build-release": "node ../../scripts/build-release.mts", "prepack": "tsc -b" }, "repository": { @@ -76,5 +77,9 @@ "jest": "^30.2.0", "ts-node": "^10.9.2", "typescript": "^5.9.3" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/utils/graphile/package.json b/utils/graphile/package.json index 0ac630e734..488bbf30d6 100644 --- a/utils/graphile/package.json +++ b/utils/graphile/package.json @@ -6,6 +6,7 @@ "bin": "dist/cli-run.js", "types": "dist/index.d.ts", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "test": "true", "prepack": "tsc -b" }, @@ -56,5 +57,9 @@ "@types/node": "^22.19.1", "jest": "^30.2.0", "ts-node": "^10.9.2" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/utils/jest-serializer-graphql-schema/package.json b/utils/jest-serializer-graphql-schema/package.json index ad9b847567..dc6f2f7040 100644 --- a/utils/jest-serializer-graphql-schema/package.json +++ b/utils/jest-serializer-graphql-schema/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "test": "jest", "prepack": "tsc -b", "watch": "tsc -b --watch" @@ -41,5 +42,9 @@ }, "files": [ "dist" - ] + ], + "publishConfig": { + "directory": "release", + "access": "public" + } } diff --git a/utils/jest-serializer-simple/package.json b/utils/jest-serializer-simple/package.json index 916fb010dd..c5b2b3524e 100644 --- a/utils/jest-serializer-simple/package.json +++ b/utils/jest-serializer-simple/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "prepack": "tsc -b", "watch": "tsc -b --watch" }, @@ -40,5 +41,9 @@ }, "files": [ "dist" - ] + ], + "publishConfig": { + "directory": "release", + "access": "public" + } } diff --git a/utils/lru/package.json b/utils/lru/package.json index daf56817fe..495be7626b 100644 --- a/utils/lru/package.json +++ b/utils/lru/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "test": "jest", "prepack": "tsc -b" }, @@ -38,5 +39,9 @@ "jest": "^30.2.0", "ts-node": "^10.9.2", "typescript": "^5.9.3" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/utils/pg-introspection/package.json b/utils/pg-introspection/package.json index c630c046b0..3b636ce505 100644 --- a/utils/pg-introspection/package.json +++ b/utils/pg-introspection/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "test": "node --experimental-strip-types --test", "prepack": "tsc -b" }, @@ -46,5 +47,9 @@ ], "engines": { "node": ">=22" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/utils/pg-sql2/package.json b/utils/pg-sql2/package.json index f9dbee6f76..c9c2199931 100644 --- a/utils/pg-sql2/package.json +++ b/utils/pg-sql2/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "pretest": "node dist/index.js", "test": "jest", "posttest": "yarn test:docs", @@ -52,5 +53,9 @@ ], "engines": { "node": ">=22" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } diff --git a/utils/tamedevil/package.json b/utils/tamedevil/package.json index 9e9321ab68..c9ca44229f 100644 --- a/utils/tamedevil/package.json +++ b/utils/tamedevil/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { + "build-release": "node ../../scripts/build-release.mts", "pretest": "node dist/index.js", "test": "jest", "posttest": "yarn test:docs", @@ -52,5 +53,9 @@ ], "engines": { "node": ">=22" + }, + "publishConfig": { + "directory": "release", + "access": "public" } } From a336613b009f070a24b2ac39fb89fd978fc0938e Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 12:21:43 +0000 Subject: [PATCH 05/40] Remove colon from command and add new workspaces build release command --- .changeset/commit.js | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.changeset/commit.js b/.changeset/commit.js index 44cd337161..d13983dae9 100644 --- a/.changeset/commit.js +++ b/.changeset/commit.js @@ -1,7 +1,7 @@ /* * This file exists so that `yarn changeset` auto-commits, but * `yarn changeset version` does not - we want you to run - * `yarn changeset:version` instead (which will commit). + * `yarn changeset-version` instead (which will commit). */ const commit = require("@changesets/cli/commit"); diff --git a/package.json b/package.json index db25981b09..a45bdc60a4 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "watch": "BUILD_MODE=development yarn build && tsc -b --watch", "clean": "( jest --clearCache || true ) && ( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,bundle,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} postgraphile/postgraphile/.tests_tmp/ grafast/ruru/static grafast/ruru/src/bundleCode.ts grafast/ruru/src/bundleMeta.ts || true )", "tsc:watch:clean": "( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} || true ) && tsc -b --watch", - "changeset:version": "yarn changeset version && node scripts/postversion.mjs", + "workspaces-build-release": "yarn workspaces foreach --topological --all run build-release", + "changeset-version": "yarn changeset version && node scripts/postversion.mjs", "w": "yarn workspace", "postgraphile": "cd postgraphile/postgraphile && node dist/cli-run.js", "website:grafast": "cd grafast/website && yarn start", From bc0e4bb120d8532aad61f6a5e68eca2205c5df8c Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 12:23:59 +0000 Subject: [PATCH 06/40] codegen plugin has no fwd --- grafast/codegen-plugin/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/grafast/codegen-plugin/package.json b/grafast/codegen-plugin/package.json index 923b931064..44f70e9c8a 100644 --- a/grafast/codegen-plugin/package.json +++ b/grafast/codegen-plugin/package.json @@ -34,7 +34,6 @@ "node": ">=22" }, "files": [ - "fwd", "dist" ], "publishConfig": { From 868c12100ce0c7d5d8602f6f72f100d8aeba93f2 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 12:25:35 +0000 Subject: [PATCH 07/40] Add missing LICENSE.md files --- grafast/dataplan-json/LICENSE.md | 20 ++++++++++++++++++++ grafast/dataplan-pg/LICENSE.md | 20 ++++++++++++++++++++ grafast/grafserv-persisted/LICENSE.md | 20 ++++++++++++++++++++ grafast/grafserv/LICENSE.md | 20 ++++++++++++++++++++ graphile-build/graphile-utils/LICENSE.md | 20 ++++++++++++++++++++ utils/jest-serializer-simple/LICENSE.md | 20 ++++++++++++++++++++ 6 files changed, 120 insertions(+) create mode 100644 grafast/dataplan-json/LICENSE.md create mode 100644 grafast/dataplan-pg/LICENSE.md create mode 100644 grafast/grafserv-persisted/LICENSE.md create mode 100644 grafast/grafserv/LICENSE.md create mode 100644 graphile-build/graphile-utils/LICENSE.md create mode 100644 utils/jest-serializer-simple/LICENSE.md diff --git a/grafast/dataplan-json/LICENSE.md b/grafast/dataplan-json/LICENSE.md new file mode 100644 index 0000000000..77f2094460 --- /dev/null +++ b/grafast/dataplan-json/LICENSE.md @@ -0,0 +1,20 @@ +# The MIT License (MIT) + +Copyright © 2026 Benjie Gillam + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/grafast/dataplan-pg/LICENSE.md b/grafast/dataplan-pg/LICENSE.md new file mode 100644 index 0000000000..77f2094460 --- /dev/null +++ b/grafast/dataplan-pg/LICENSE.md @@ -0,0 +1,20 @@ +# The MIT License (MIT) + +Copyright © 2026 Benjie Gillam + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/grafast/grafserv-persisted/LICENSE.md b/grafast/grafserv-persisted/LICENSE.md new file mode 100644 index 0000000000..77f2094460 --- /dev/null +++ b/grafast/grafserv-persisted/LICENSE.md @@ -0,0 +1,20 @@ +# The MIT License (MIT) + +Copyright © 2026 Benjie Gillam + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/grafast/grafserv/LICENSE.md b/grafast/grafserv/LICENSE.md new file mode 100644 index 0000000000..77f2094460 --- /dev/null +++ b/grafast/grafserv/LICENSE.md @@ -0,0 +1,20 @@ +# The MIT License (MIT) + +Copyright © 2026 Benjie Gillam + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/graphile-build/graphile-utils/LICENSE.md b/graphile-build/graphile-utils/LICENSE.md new file mode 100644 index 0000000000..77f2094460 --- /dev/null +++ b/graphile-build/graphile-utils/LICENSE.md @@ -0,0 +1,20 @@ +# The MIT License (MIT) + +Copyright © 2026 Benjie Gillam + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/utils/jest-serializer-simple/LICENSE.md b/utils/jest-serializer-simple/LICENSE.md new file mode 100644 index 0000000000..77f2094460 --- /dev/null +++ b/utils/jest-serializer-simple/LICENSE.md @@ -0,0 +1,20 @@ +# The MIT License (MIT) + +Copyright © 2026 Benjie Gillam + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. From 325b94cb1b230c6d74c79c2ea2477e4aca33bf27 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 12:27:51 +0000 Subject: [PATCH 08/40] No such thing as index.js --- grafast/bench/package.json | 3 +-- grafast/grafserv-persisted/package.json | 3 +-- grafast/grafserv/package.json | 3 +-- grafast/ruru-components/package.json | 1 - graphile-build/graphile-build-pg/package.json | 3 +-- graphile-build/graphile-build/package.json | 3 +-- graphile-build/graphile-utils/package.json | 3 +-- postgraphile/pgl/package.json | 3 +-- postgraphile/postgraphile/package.json | 3 +-- 9 files changed, 8 insertions(+), 17 deletions(-) diff --git a/grafast/bench/package.json b/grafast/bench/package.json index 85f01bf19b..e81a0270c2 100644 --- a/grafast/bench/package.json +++ b/grafast/bench/package.json @@ -44,7 +44,6 @@ "typescript": "^5.9.3" }, "files": [ - "dist", - "index.js" + "dist" ] } diff --git a/grafast/grafserv-persisted/package.json b/grafast/grafserv-persisted/package.json index eb5619e8c9..154c9fe4fb 100644 --- a/grafast/grafserv-persisted/package.json +++ b/grafast/grafserv-persisted/package.json @@ -69,8 +69,7 @@ "typescript": "^5.9.3" }, "files": [ - "dist", - "index.js" + "dist" ], "publishConfig": { "directory": "release", diff --git a/grafast/grafserv/package.json b/grafast/grafserv/package.json index 623c0c99db..fd6a077fbd 100644 --- a/grafast/grafserv/package.json +++ b/grafast/grafserv/package.json @@ -170,8 +170,7 @@ }, "files": [ "dist", - "fwd", - "index.js" + "fwd" ], "publishConfig": { "directory": "release", diff --git a/grafast/ruru-components/package.json b/grafast/ruru-components/package.json index 3163d6df7b..d579546994 100644 --- a/grafast/ruru-components/package.json +++ b/grafast/ruru-components/package.json @@ -65,7 +65,6 @@ }, "files": [ "dist", - "index.js", "ruru.css" ], "devDependencies": { diff --git a/graphile-build/graphile-build-pg/package.json b/graphile-build/graphile-build-pg/package.json index 65ce6d0e55..b427a8b157 100644 --- a/graphile-build/graphile-build-pg/package.json +++ b/graphile-build/graphile-build-pg/package.json @@ -94,8 +94,7 @@ }, "files": [ "dist", - "fwd", - "index.js" + "fwd" ], "devDependencies": { "@envelop/core": "^5.3.0", diff --git a/graphile-build/graphile-build/package.json b/graphile-build/graphile-build/package.json index bb5c4f4131..9adb684fd3 100644 --- a/graphile-build/graphile-build/package.json +++ b/graphile-build/graphile-build/package.json @@ -60,8 +60,7 @@ "graphql": "^16.9.0" }, "files": [ - "dist", - "index.js" + "dist" ], "devDependencies": { "@types/debug": "^4.1.12", diff --git a/graphile-build/graphile-utils/package.json b/graphile-build/graphile-utils/package.json index 76903eb7c6..b9757d883a 100644 --- a/graphile-build/graphile-utils/package.json +++ b/graphile-build/graphile-utils/package.json @@ -76,8 +76,7 @@ "typescript": "^5.9.3" }, "files": [ - "dist", - "index.js" + "dist" ], "publishConfig": { "directory": "release", diff --git a/postgraphile/pgl/package.json b/postgraphile/pgl/package.json index bd3a79c39c..f8e46f8d22 100644 --- a/postgraphile/pgl/package.json +++ b/postgraphile/pgl/package.json @@ -263,8 +263,7 @@ }, "files": [ "dist", - "fwd", - "index.js" + "fwd" ], "devDependencies": { "@types/debug": "^4.1.12", diff --git a/postgraphile/postgraphile/package.json b/postgraphile/postgraphile/package.json index 56648d9c7a..d428ebc947 100644 --- a/postgraphile/postgraphile/package.json +++ b/postgraphile/postgraphile/package.json @@ -303,8 +303,7 @@ }, "files": [ "dist", - "fwd", - "index.js" + "fwd" ], "devDependencies": { "@types/debug": "^4.1.12", From fdaa0b1e35830e7bb58a11fd5e30000bea47fd4a Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 12:39:23 +0000 Subject: [PATCH 09/40] Manage peerDep ranges --- scripts/build-release.mts | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/scripts/build-release.mts b/scripts/build-release.mts index dccbd8ecd4..0d7b4e9db1 100644 --- a/scripts/build-release.mts +++ b/scripts/build-release.mts @@ -29,17 +29,32 @@ async function transformPackageJson(packageJson: any, targetFilePath: string) { const version = deps[moduleName]; if (typeof version === "string" && version.startsWith("workspace:")) { const range = version.substring(10); - if (range.length !== 1) { - throw new Error(`Don't understand '${version}'`); + if (range.length > 1) { + if (key !== "peerDependencies") { + throw new Error( + `${key} should typically not use explicit version range, otherwise changes may not be reflected accurately ${newJson.name}[${key}][${moduleName}] = ${version}`, + ); + } + deps[moduleName] = `${range}`; + } else { + if (key === "peerDependencies") { + if (newJson.dependencies?.[moduleName]) { + // This is okay; we're peer-depending _and_ regular depending. + } else { + throw new Error( + `${key} should use explicit version range, otherwise lots of unnecessary bumping may occur from changesets. ${newJson.name}[${key}][${moduleName}] = ${version}`, + ); + } + } + // Find the package's version + const packageJson = JSON.parse( + await fsp.readFile( + `${__dirname}/../node_modules/${moduleName}/package.json`, + "utf8", + ), + ); + deps[moduleName] = `${range}${packageJson.version}`; } - // Find the package's version - const packageJson = JSON.parse( - await fsp.readFile( - `${__dirname}/../node_modules/${moduleName}/package.json`, - "utf8", - ), - ); - deps[moduleName] = `${range}${packageJson.version}`; console.log( `packageJson.${key}[${JSON.stringify(moduleName)}] went from ${version} to ${deps[moduleName]}`, ); From b1f0a8b0b2e8ede1996ce6bd4940f44e5082389e Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 12:52:54 +0000 Subject: [PATCH 10/40] Explicit peerDependencies ranges --- grafast/dataplan-json/package.json | 2 +- grafast/dataplan-pg/package.json | 2 +- grafast/grafserv-persisted/package.json | 6 +++--- grafast/grafserv/package.json | 2 +- grafast/ruru/package.json | 2 +- graphile-build/graphile-build-pg/package.json | 12 ++++++------ graphile-build/graphile-build/package.json | 4 ++-- graphile-build/graphile-utils/package.json | 12 ++++++------ utils/graphile-export/package.json | 2 +- utils/graphile/package.json | 6 +++--- 10 files changed, 25 insertions(+), 25 deletions(-) diff --git a/grafast/dataplan-json/package.json b/grafast/dataplan-json/package.json index fdc0075604..0621cd1a6f 100644 --- a/grafast/dataplan-json/package.json +++ b/grafast/dataplan-json/package.json @@ -34,7 +34,7 @@ "node": ">=22" }, "peerDependencies": { - "grafast": "workspace:^" + "grafast": "workspace:^1.0.0-rc.8" }, "files": [ "dist" diff --git a/grafast/dataplan-pg/package.json b/grafast/dataplan-pg/package.json index 420a788b65..0c0e89223d 100644 --- a/grafast/dataplan-pg/package.json +++ b/grafast/dataplan-pg/package.json @@ -74,7 +74,7 @@ "peerDependencies": { "@dataplan/json": "workspace:^", "grafast": "workspace:^", - "graphile-config": "workspace:^", + "graphile-config": "workspace:^1.0.0-rc.5", "graphql": "^16.9.0", "pg": "^8.7.1", "pg-sql2": "workspace:^" diff --git a/grafast/grafserv-persisted/package.json b/grafast/grafserv-persisted/package.json index 154c9fe4fb..19707101e2 100644 --- a/grafast/grafserv-persisted/package.json +++ b/grafast/grafserv-persisted/package.json @@ -47,9 +47,9 @@ "node": ">=22" }, "peerDependencies": { - "grafast": "workspace:^", - "grafserv": "workspace:^", - "graphile-config": "workspace:^", + "grafast": "workspace:^1.0.0-rc.8", + "grafserv": "workspace:^1.0.0-rc.6", + "graphile-config": "workspace:^1.0.0-rc.5", "graphql": "^16.9.0" }, "peerDependenciesMeta": { diff --git a/grafast/grafserv/package.json b/grafast/grafserv/package.json index fd6a077fbd..b73174bd22 100644 --- a/grafast/grafserv/package.json +++ b/grafast/grafserv/package.json @@ -114,7 +114,7 @@ "peerDependencies": { "@envelop/core": "^5.0.0", "@whatwg-node/server": "^0.9.64", - "grafast": "workspace:^", + "grafast": "workspace:^1.0.0-rc.8", "graphile-config": "workspace:^", "graphql": "^16.9.0", "h3": "^1.13.0", diff --git a/grafast/ruru/package.json b/grafast/ruru/package.json index bcfa8eb331..7fa152f5ed 100644 --- a/grafast/ruru/package.json +++ b/grafast/ruru/package.json @@ -63,7 +63,7 @@ "node": ">=22" }, "peerDependencies": { - "graphile-config": "workspace:^", + "graphile-config": "workspace:^1.0.0-rc.5", "graphql": "^16.9.0", "react": "^18 || ^19", "react-dom": "^18 || ^19" diff --git a/graphile-build/graphile-build-pg/package.json b/graphile-build/graphile-build-pg/package.json index b427a8b157..97cb2541df 100644 --- a/graphile-build/graphile-build-pg/package.json +++ b/graphile-build/graphile-build-pg/package.json @@ -75,14 +75,14 @@ "tslib": "^2.8.1" }, "peerDependencies": { - "@dataplan/pg": "workspace:^", - "grafast": "workspace:^", - "graphile-build": "workspace:^", - "graphile-config": "workspace:^", + "@dataplan/pg": "workspace:^1.0.0-rc.7", + "grafast": "workspace:^1.0.0-rc.8", + "graphile-build": "workspace:^5.0.0-rc.5", + "graphile-config": "workspace:^1.0.0-rc.5", "graphql": "^16.9.0", "pg": "^8.7.1", - "pg-sql2": "workspace:^", - "tamedevil": "workspace:^" + "pg-sql2": "workspace:^5.0.0-rc.4", + "tamedevil": "workspace:^0.1.0-rc.5" }, "peerDependenciesMeta": { "pg": { diff --git a/graphile-build/graphile-build/package.json b/graphile-build/graphile-build/package.json index 9adb684fd3..cf03da5834 100644 --- a/graphile-build/graphile-build/package.json +++ b/graphile-build/graphile-build/package.json @@ -55,8 +55,8 @@ "node": ">=22" }, "peerDependencies": { - "grafast": "workspace:^", - "graphile-config": "workspace:^", + "grafast": "workspace:^1.0.0-rc.8", + "graphile-config": "workspace:^1.0.0-rc.5", "graphql": "^16.9.0" }, "files": [ diff --git a/graphile-build/graphile-utils/package.json b/graphile-build/graphile-utils/package.json index b9757d883a..f251e90ae6 100644 --- a/graphile-build/graphile-utils/package.json +++ b/graphile-build/graphile-utils/package.json @@ -46,13 +46,13 @@ "node": ">=22" }, "peerDependencies": { - "@dataplan/pg": "workspace:^", - "grafast": "workspace:^", - "graphile-build": "workspace:^", - "graphile-build-pg": "workspace:^", - "graphile-config": "workspace:^", + "@dataplan/pg": "workspace:^1.0.0-rc.7", + "grafast": "workspace:^1.0.0-rc.8", + "graphile-build": "workspace:^5.0.0-rc.5", + "graphile-build-pg": "workspace:^5.0.0-rc.7", + "graphile-config": "workspace:^1.0.0-rc.5", "graphql": "^16.9.0", - "tamedevil": "workspace:^" + "tamedevil": "workspace:^0.1.0-rc.5" }, "peerDependenciesMeta": { "graphile-build-pg": { diff --git a/utils/graphile-export/package.json b/utils/graphile-export/package.json index 61ff309f0a..7f2fd61853 100644 --- a/utils/graphile-export/package.json +++ b/utils/graphile-export/package.json @@ -55,7 +55,7 @@ }, "peerDependencies": { "eslint": "^8.48.0 || ^9.26.0", - "grafast": "workspace:^", + "grafast": "workspace:^1.0.0-rc.8", "pg-sql2": "workspace:^5.0.0-rc.4" }, "peerDependenciesMeta": { diff --git a/utils/graphile/package.json b/utils/graphile/package.json index 488bbf30d6..1330de3970 100644 --- a/utils/graphile/package.json +++ b/utils/graphile/package.json @@ -40,9 +40,9 @@ "typescript": "^5.9.3" }, "peerDependencies": { - "graphile-build": "workspace:^", - "graphile-config": "workspace:^", - "postgraphile": "workspace:^" + "graphile-build": "workspace:^5.0.0-rc.5", + "graphile-config": "workspace:^1.0.0-rc.5", + "postgraphile": "workspace:^5.0.0-rc.9" }, "peerDependenciesMeta": { "graphile-build": { From 787d9c6bb4698aaa5b3f23d6336501bb268e03ae Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 13:02:21 +0000 Subject: [PATCH 11/40] Use development order --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a45bdc60a4..c2e834a15f 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "watch": "BUILD_MODE=development yarn build && tsc -b --watch", "clean": "( jest --clearCache || true ) && ( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,bundle,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} postgraphile/postgraphile/.tests_tmp/ grafast/ruru/static grafast/ruru/src/bundleCode.ts grafast/ruru/src/bundleMeta.ts || true )", "tsc:watch:clean": "( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} || true ) && tsc -b --watch", - "workspaces-build-release": "yarn workspaces foreach --topological --all run build-release", + "workspaces-build-release": "yarn workspaces foreach --topological-dev --all run build-release", "changeset-version": "yarn changeset version && node scripts/postversion.mjs", "w": "yarn workspace", "postgraphile": "cd postgraphile/postgraphile && node dist/cli-run.js", From 518010c79e1166c0cec9e20997e7ba9b9705c8db Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 13:12:41 +0000 Subject: [PATCH 12/40] Break the cycle --- graphile-build/graphile-utils/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphile-build/graphile-utils/package.json b/graphile-build/graphile-utils/package.json index f251e90ae6..a1f763b2ea 100644 --- a/graphile-build/graphile-utils/package.json +++ b/graphile-build/graphile-utils/package.json @@ -70,7 +70,7 @@ "jest": "^30.2.0", "jest-serializer-graphql-schema": "workspace:^", "nodemon": "^3.1.11", - "postgraphile": "workspace:^", + "pg-sql2": "workspace:^", "tamedevil": "workspace:^", "ts-node": "^10.9.2", "typescript": "^5.9.3" From 5b35bdc86daa8a7a55d4af6b0a1a9e4b018c18aa Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 13:12:53 +0000 Subject: [PATCH 13/40] x yarn --- yarn.lock | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/yarn.lock b/yarn.lock index c1aac5749b..78d3278694 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2807,7 +2807,7 @@ __metadata: tslib: "npm:^2.8.1" typescript: "npm:^5.9.3" peerDependencies: - grafast: "workspace:^" + grafast: "workspace:^1.0.0-rc.8" languageName: unknown linkType: soft @@ -2854,7 +2854,7 @@ __metadata: peerDependencies: "@dataplan/json": "workspace:^" grafast: "workspace:^" - graphile-config: "workspace:^" + graphile-config: "workspace:^1.0.0-rc.5" graphql: ^16.9.0 pg: ^8.7.1 pg-sql2: "workspace:^" @@ -3993,9 +3993,9 @@ __metadata: tslib: "npm:^2.8.1" typescript: "npm:^5.9.3" peerDependencies: - grafast: "workspace:^" - grafserv: "workspace:^" - graphile-config: "workspace:^" + grafast: "workspace:^1.0.0-rc.8" + grafserv: "workspace:^1.0.0-rc.6" + graphile-config: "workspace:^1.0.0-rc.5" graphql: ^16.9.0 peerDependenciesMeta: graphile-config: @@ -14682,7 +14682,7 @@ __metadata: peerDependencies: "@envelop/core": ^5.0.0 "@whatwg-node/server": ^0.9.64 - grafast: "workspace:^" + grafast: "workspace:^1.0.0-rc.8" graphile-config: "workspace:^" graphql: ^16.9.0 h3: ^1.13.0 @@ -14744,14 +14744,14 @@ __metadata: typescript: "npm:^5.9.3" ws: "npm:^8.18.3" peerDependencies: - "@dataplan/pg": "workspace:^" - grafast: "workspace:^" - graphile-build: "workspace:^" - graphile-config: "workspace:^" + "@dataplan/pg": "workspace:^1.0.0-rc.7" + grafast: "workspace:^1.0.0-rc.8" + graphile-build: "workspace:^5.0.0-rc.5" + graphile-config: "workspace:^1.0.0-rc.5" graphql: ^16.9.0 pg: ^8.7.1 - pg-sql2: "workspace:^" - tamedevil: "workspace:^" + pg-sql2: "workspace:^5.0.0-rc.4" + tamedevil: "workspace:^0.1.0-rc.5" peerDependenciesMeta: pg: optional: true @@ -14783,8 +14783,8 @@ __metadata: tslib: "npm:^2.8.1" typescript: "npm:^5.9.3" peerDependencies: - grafast: "workspace:^" - graphile-config: "workspace:^" + grafast: "workspace:^1.0.0-rc.8" + graphile-config: "workspace:^1.0.0-rc.5" graphql: ^16.9.0 languageName: unknown linkType: soft @@ -14832,7 +14832,7 @@ __metadata: typescript: "npm:^5.9.3" peerDependencies: eslint: ^8.48.0 || ^9.26.0 - grafast: "workspace:^" + grafast: "workspace:^1.0.0-rc.8" pg-sql2: "workspace:^5.0.0-rc.4" peerDependenciesMeta: eslint: @@ -14858,19 +14858,19 @@ __metadata: jest-serializer-graphql-schema: "workspace:^" json5: "npm:^2.2.3" nodemon: "npm:^3.1.11" - postgraphile: "workspace:^" + pg-sql2: "workspace:^" tamedevil: "workspace:^" ts-node: "npm:^10.9.2" tslib: "npm:^2.8.1" typescript: "npm:^5.9.3" peerDependencies: - "@dataplan/pg": "workspace:^" - grafast: "workspace:^" - graphile-build: "workspace:^" - graphile-build-pg: "workspace:^" - graphile-config: "workspace:^" + "@dataplan/pg": "workspace:^1.0.0-rc.7" + grafast: "workspace:^1.0.0-rc.8" + graphile-build: "workspace:^5.0.0-rc.5" + graphile-build-pg: "workspace:^5.0.0-rc.7" + graphile-config: "workspace:^1.0.0-rc.5" graphql: ^16.9.0 - tamedevil: "workspace:^" + tamedevil: "workspace:^0.1.0-rc.5" peerDependenciesMeta: graphile-build-pg: optional: true @@ -14892,9 +14892,9 @@ __metadata: tslib: "npm:^2.8.1" typescript: "npm:^5.9.3" peerDependencies: - graphile-build: "workspace:^" - graphile-config: "workspace:^" - postgraphile: "workspace:^" + graphile-build: "workspace:^5.0.0-rc.5" + graphile-config: "workspace:^1.0.0-rc.5" + postgraphile: "workspace:^5.0.0-rc.9" peerDependenciesMeta: graphile-build: optional: true @@ -23279,7 +23279,7 @@ __metadata: webpack-cli: "npm:^6.0.1" yargs: "npm:^17.7.2" peerDependencies: - graphile-config: "workspace:^" + graphile-config: "workspace:^1.0.0-rc.5" graphql: ^16.9.0 react: ^18 || ^19 react-dom: ^18 || ^19 From b67fa8585247f24d155a676d5e7e97c0b8d69c1f Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 13:29:52 +0000 Subject: [PATCH 14/40] Standardize packing for all packages --- pack.sh | 225 +++++++++++--------------------------------------------- 1 file changed, 41 insertions(+), 184 deletions(-) diff --git a/pack.sh b/pack.sh index 12064f58d9..384820a3f0 100755 --- a/pack.sh +++ b/pack.sh @@ -5,190 +5,47 @@ rm -rf builds/ mkdir builds/ yarn clean - -# @graphile/lru -cd utils/lru -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/graphile__lru.tgz -cd - - -# tamedevil -cd utils/tamedevil -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/tamedevil.tgz -cd - - -# graphile-config -cd utils/graphile-config -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/graphile-config.tgz -cd - - -#grafast -cd grafast/grafast -yarn build -cp -a ../../.yarn ../../.yarnrc.yml release -rm -Rf /tmp/grafast-build -mv release /tmp/grafast-build -# Build in temp folder -cd /tmp/grafast-build -rm -f *.tgz -yarn pack -o package.tgz -cd - -# Grab package -mv /tmp/grafast-build/package.tgz ../../builds/grafast.tgz -rm -Rf /tmp/grafast-build -cd ../.. - -# ruru-types -cd grafast/ruru-types -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/ruru-types.tgz -cd - - -# ruru-components -cd grafast/ruru-components -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/ruru-components.tgz -cd - - -# ruru -cd grafast/ruru -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/ruru.tgz -cd - - -#grafserv -cd grafast/grafserv -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/grafserv.tgz -cd - - -#@dataplan/json -cd grafast/dataplan-json -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/dataplan__json.tgz -cd - - -#eslint-plugin-graphile-export -cd utils/eslint-plugin-graphile-export -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/eslint-plugin-graphile-export.tgz -cd - - -#graphile-export -cd utils/graphile-export -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/graphile-export.tgz -cd - - -#jest-serializer-graphql-schema -cd utils/jest-serializer-graphql-schema -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/jest-serializer-graphql-schema.tgz -cd - - -#jest-serializer-simple -cd utils/jest-serializer-simple -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/jest-serializer-simple.tgz -cd - - -#graphile-build -cd graphile-build/graphile-build -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/graphile-build.tgz -cd - - -#pg-introspection -cd utils/pg-introspection -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/pg-introspection.tgz -cd - - -#pg-sql2 -cd utils/pg-sql2 -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/pg-sql2.tgz -cd - - -#@dataplan/pg # NEEDS CUSTOM RELEASE -cd grafast/dataplan-pg -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/dataplan__pg.tgz -cd ../.. - -#graphile-build-pg -cd graphile-build/graphile-build-pg/ -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/graphile-build-pg.tgz -cd - - -#graphile-utils -cd graphile-build/graphile-utils -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/graphile-utils.tgz -cd - - -#postgraphile -cd postgraphile/postgraphile/ -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/postgraphile.tgz -cd - - -#pgl -cd postgraphile/pgl/ -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/pgl.tgz -cd - - -# @graphile/simplify-inflection -cd graphile-build/graphile-simplify-inflection -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/graphile__simplify-inflection.tgz -cd - - -# @grafserv/persisted -cd grafast/grafserv-persisted -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/grafserv__persisted.tgz -cd - - -# graphile -cd utils/graphile -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/graphile.tgz -cd - - -# graphql-codegen-grafast -cd grafast/codegen-plugin -rm -f *.tgz -yarn pack -o package.tgz -mv package.tgz ../../builds/graphql-codegen-grafast.tgz -cd - +yarn workspaces-build-release + +pack_pkg() { + local repoDir="$1" + local outputBasename="$2" + local repoRoot="$(pwd)" + + # sub-shell means no need to `cd -` + ( + cd "${repoDir}/release" || return 1 + rm package.tgz + yarn pack -o package.tgz + mv package.tgz "${repoRoot}/builds/${outputBasename}.tgz" + ) +} + +pack_pkg utils/lru graphile__lru +pack_pkg utils/tamedevil tamedevil +pack_pkg utils/graphile-config graphile-config +pack_pkg grafast/grafast +pack_pkg grafast/ruru-types ruru-types +pack_pkg grafast/ruru-components ruru-components +pack_pkg grafast/ruru ruru +pack_pkg grafast/grafserv grafserv +pack_pkg grafast/dataplan-json dataplan__json +pack_pkg utils/eslint-plugin-graphile-export eslint-plugin-graphile-export +pack_pkg utils/graphile-export graphile-export +pack_pkg utils/jest-serializer-graphql-schema jest-serializer-graphql-schema +pack_pkg utils/jest-serializer-simple jest-serializer-simple +pack_pkg graphile-build/graphile-build graphile-build +pack_pkg utils/pg-introspection pg-introspection +pack_pkg utils/pg-sql2 pg-sql2 +pack_pkg grafast/dataplan-pg dataplan__pg +pack_pkg graphile-build/graphile-build-pg/ graphile-build-pg +pack_pkg graphile-build/graphile-utils graphile-utils +pack_pkg postgraphile/postgraphile/ postgraphile +pack_pkg postgraphile/pgl/ pgl +pack_pkg graphile-build/graphile-simplify-inflection graphile__simplify-inflection +pack_pkg grafast/grafserv-persisted grafserv__persisted +pack_pkg utils/graphile graphile +pack_pkg grafast/codegen-plugin graphql-codegen-grafast echo "All packages packed into 'builds/'" echo "Now publish them with './publish.sh'" From 0017387e16669c90ea8966449d7333bdf906afc2 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 13:43:56 +0000 Subject: [PATCH 15/40] Rename prepack to build and build-release to prepack --- grafast/codegen-plugin/package.json | 4 ++-- grafast/dataplan-json/package.json | 4 ++-- grafast/dataplan-pg/package.json | 4 ++-- grafast/grafast/package.json | 4 ++-- grafast/grafserv-persisted/package.json | 4 ++-- grafast/grafserv/package.json | 4 ++-- grafast/ruru-components/package.json | 4 ++-- grafast/ruru-types/package.json | 4 ++-- grafast/ruru/package.json | 4 ++-- graphile-build/graphile-build-pg/package.json | 4 ++-- graphile-build/graphile-build/package.json | 4 ++-- graphile-build/graphile-simplify-inflection/package.json | 4 ++-- graphile-build/graphile-utils/package.json | 4 ++-- postgraphile/pgl/package.json | 4 ++-- postgraphile/postgraphile/package.json | 4 ++-- utils/eslint-plugin-graphile-export/package.json | 4 ++-- utils/graphile-config/package.json | 4 ++-- utils/graphile-export/package.json | 4 ++-- utils/graphile/package.json | 4 ++-- utils/jest-serializer-graphql-schema/package.json | 4 ++-- utils/jest-serializer-simple/package.json | 4 ++-- utils/lru/package.json | 4 ++-- utils/pg-introspection/package.json | 4 ++-- utils/pg-sql2/package.json | 4 ++-- utils/tamedevil/package.json | 4 ++-- 25 files changed, 50 insertions(+), 50 deletions(-) diff --git a/grafast/codegen-plugin/package.json b/grafast/codegen-plugin/package.json index 44f70e9c8a..ca63a343b1 100644 --- a/grafast/codegen-plugin/package.json +++ b/grafast/codegen-plugin/package.json @@ -3,8 +3,8 @@ "version": "1.0.0-rc.4", "description": "A GraphQL code generator plugin for Grafast schemas", "scripts": { - "build-release": "node ../../scripts/build-release.mts", - "prepack": "tsc -b" + "prepack": "node ../../scripts/build-release.mts", + "build": "tsc -b" }, "exports": { ".": { diff --git a/grafast/dataplan-json/package.json b/grafast/dataplan-json/package.json index 0621cd1a6f..c99dd1e5bb 100644 --- a/grafast/dataplan-json/package.json +++ b/grafast/dataplan-json/package.json @@ -5,8 +5,8 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build-release": "node ../../scripts/build-release.mts", - "prepack": "tsc -b" + "prepack": "node ../../scripts/build-release.mts", + "build": "tsc -b" }, "repository": { "type": "git", diff --git a/grafast/dataplan-pg/package.json b/grafast/dataplan-pg/package.json index 0c0e89223d..ab9c21b804 100644 --- a/grafast/dataplan-pg/package.json +++ b/grafast/dataplan-pg/package.json @@ -23,14 +23,14 @@ } }, "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "codegen": "yarn graphql-codegen -c codegen-examples-smallExample.ts", "update-schema": "ts-node ./src/examples/exampleSchema.ts", "test": "GRAPHILE_ENV=test jest", "posttest": "yarn test:exportSchema:graphql-js && yarn test:exportSchema:typeDefs", "test:exportSchema:graphql-js": "ts-node ./scripts/exportExampleSchema.ts graphql-js && node ./scripts/runExampleSchema.mjs", "test:exportSchema:typeDefs": "ts-node ./scripts/exportExampleSchema.ts typeDefs && node ./scripts/runExampleSchema.mjs", - "prepack": "yarn codegen && tsc -b && cp src/.npmignore dist/.npmignore", + "build": "yarn codegen && tsc -b && cp src/.npmignore dist/.npmignore", "serve:example": "GRAPHILE_ENV=development NODE_ENV=development yarn nodemon --watch serve-example-schema.js --watch dist --watch ../grafast/dist/ -x 'node --inspect --enable-source-maps serve-example-schema.js'" }, "repository": { diff --git a/grafast/grafast/package.json b/grafast/grafast/package.json index d9f835f05a..e3393cb805 100644 --- a/grafast/grafast/package.json +++ b/grafast/grafast/package.json @@ -27,12 +27,12 @@ } }, "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "codegen": "cd __tests__/dcc && node --experimental-strip-types ../../../../node_modules/.bin/graphql-codegen", "test": "yarn codegen && yarn test-mocha && yarn test-bundle", "test-bundle": "node --experimental-strip-types scripts/testbundle.mts", "test-mocha": "tsc -b tsconfig.test.json && NODE_ENV=test GRAPHILE_ENV=test mocha '**/__tests__/**/*-test.ts'", - "prepack": "tsc -b", + "build": "tsc -b", "postpack": "echo 'FORBIDDEN' && exit 1", "md": "spec-md CRYSTAL_FLOW.md > CRYSTAL_FLOW.html" }, diff --git a/grafast/grafserv-persisted/package.json b/grafast/grafserv-persisted/package.json index 19707101e2..6b5d2bb507 100644 --- a/grafast/grafserv-persisted/package.json +++ b/grafast/grafserv-persisted/package.json @@ -12,8 +12,8 @@ } }, "scripts": { - "build-release": "node ../../scripts/build-release.mts", - "prepack": "tsc -b", + "prepack": "node ../../scripts/build-release.mts", + "build": "tsc -b", "test": "true" }, "repository": { diff --git a/grafast/grafserv/package.json b/grafast/grafserv/package.json index b73174bd22..95fa8590a4 100644 --- a/grafast/grafserv/package.json +++ b/grafast/grafserv/package.json @@ -76,8 +76,8 @@ } }, "scripts": { - "build-release": "node ../../scripts/build-release.mts", - "prepack": "tsc -b", + "prepack": "node ../../scripts/build-release.mts", + "build": "tsc -b", "test": "jest", "posttest": "yarn playwright install chromium && node --experimental-strip-types scripts/smoke-examples.mts" }, diff --git a/grafast/ruru-components/package.json b/grafast/ruru-components/package.json index d579546994..dbc0f08e50 100644 --- a/grafast/ruru-components/package.json +++ b/grafast/ruru-components/package.json @@ -16,8 +16,8 @@ } }, "scripts": { - "build-release": "node ../../scripts/build-release.mts", - "prepack": "tsc -b" + "prepack": "node ../../scripts/build-release.mts", + "build": "tsc -b" }, "repository": { "type": "git", diff --git a/grafast/ruru-types/package.json b/grafast/ruru-types/package.json index 900d6daaa2..02868db4d8 100644 --- a/grafast/ruru-types/package.json +++ b/grafast/ruru-types/package.json @@ -12,8 +12,8 @@ } }, "scripts": { - "build-release": "node ../../scripts/build-release.mts", - "prepack": "tsc -b" + "prepack": "node ../../scripts/build-release.mts", + "build": "tsc -b" }, "repository": { "type": "git", diff --git a/grafast/ruru/package.json b/grafast/ruru/package.json index 7fa152f5ed..8749009c27 100644 --- a/grafast/ruru/package.json +++ b/grafast/ruru/package.json @@ -28,11 +28,11 @@ } }, "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "webpack": "node --loader ts-node/esm \"$(yarn bin webpack-cli)\" --config webpack.config.mts", "watch": "yarn webpack --watch --mode=development", "make-ruru-html": "node --experimental-strip-types scripts/make-ruru-html.mts", - "prepack": "rm -Rf dist static tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo && yarn webpack --mode=${BUILD_MODE:-production} && tsc -b tsconfig.build.json && cp src/.npmignore dist/ && chmod +x dist/cli-run.js && yarn make-ruru-html" + "build": "rm -Rf dist static tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo && yarn webpack --mode=${BUILD_MODE:-production} && tsc -b tsconfig.build.json && cp src/.npmignore dist/ && chmod +x dist/cli-run.js && yarn make-ruru-html" }, "repository": { "type": "git", diff --git a/graphile-build/graphile-build-pg/package.json b/graphile-build/graphile-build-pg/package.json index 97cb2541df..cf27c6e908 100644 --- a/graphile-build/graphile-build-pg/package.json +++ b/graphile-build/graphile-build-pg/package.json @@ -37,9 +37,9 @@ } }, "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "test": "jest", - "prepack": "tsc -b && cp src/.npmignore dist/.npmignore" + "build": "tsc -b && cp src/.npmignore dist/.npmignore" }, "repository": { "type": "git", diff --git a/graphile-build/graphile-build/package.json b/graphile-build/graphile-build/package.json index cf03da5834..6807ffcbc6 100644 --- a/graphile-build/graphile-build/package.json +++ b/graphile-build/graphile-build/package.json @@ -12,8 +12,8 @@ } }, "scripts": { - "build-release": "node ../../scripts/build-release.mts", - "prepack": "tsc -b && cp src/.npmignore dist/.npmignore" + "prepack": "node ../../scripts/build-release.mts", + "build": "tsc -b && cp src/.npmignore dist/.npmignore" }, "repository": { "type": "git", diff --git a/graphile-build/graphile-simplify-inflection/package.json b/graphile-build/graphile-simplify-inflection/package.json index 4cfe502649..0e63085454 100644 --- a/graphile-build/graphile-simplify-inflection/package.json +++ b/graphile-build/graphile-simplify-inflection/package.json @@ -4,8 +4,8 @@ "description": "Simplifies the graphile-build/graphile-build-pg inflection to trim the `ByFooIdAndBarId` from relations, etc", "main": "dist/index.js", "scripts": { - "build-release": "node ../../scripts/build-release.mts", - "prepack": "tsc -b", + "prepack": "node ../../scripts/build-release.mts", + "build": "tsc -b", "test": "node test.js" }, "repository": { diff --git a/graphile-build/graphile-utils/package.json b/graphile-build/graphile-utils/package.json index a1f763b2ea..efdc4d171a 100644 --- a/graphile-build/graphile-utils/package.json +++ b/graphile-build/graphile-utils/package.json @@ -12,9 +12,9 @@ } }, "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "test": "jest", - "prepack": "tsc -b tsconfig.build.json" + "build": "tsc -b tsconfig.build.json" }, "repository": { "type": "git", diff --git a/postgraphile/pgl/package.json b/postgraphile/pgl/package.json index f8e46f8d22..58bcd49e88 100644 --- a/postgraphile/pgl/package.json +++ b/postgraphile/pgl/package.json @@ -207,8 +207,8 @@ }, "bin": "./dist/cli-run.js", "scripts": { - "build-release": "node ../../scripts/build-release.mts", - "prepack": "tsc -b tsconfig.build.json" + "prepack": "node ../../scripts/build-release.mts", + "build": "tsc -b tsconfig.build.json" }, "repository": { "type": "git", diff --git a/postgraphile/postgraphile/package.json b/postgraphile/postgraphile/package.json index d428ebc947..7a6861d228 100644 --- a/postgraphile/postgraphile/package.json +++ b/postgraphile/postgraphile/package.json @@ -223,7 +223,7 @@ }, "bin": "./dist/cli-run.js", "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "test": "yarn test:jest && UPDATE_SNAPSHOTS=\"\" yarn test:schema-exports && UPDATE_SNAPSHOTS=\"\" yarn test:operations-exports", "test:jest": "jest", "test:schema-exports": "node scripts/test-schema-exports.mjs", @@ -231,7 +231,7 @@ "//test:operations-exports": "yarn test:operations-exports:typeDefs && yarn test:operations-exports:graphql-js", "test:operations-exports:typeDefs": "EXPORT_SCHEMA=typeDefs jest __tests__/queries __tests__/mutations", "test:operations-exports:graphql-js": "EXPORT_SCHEMA=graphql-js jest __tests__/queries __tests__/mutations", - "prepack": "tsc -b tsconfig.build.json" + "build": "tsc -b tsconfig.build.json" }, "repository": { "type": "git", diff --git a/utils/eslint-plugin-graphile-export/package.json b/utils/eslint-plugin-graphile-export/package.json index 91095656ad..efa73ae468 100644 --- a/utils/eslint-plugin-graphile-export/package.json +++ b/utils/eslint-plugin-graphile-export/package.json @@ -5,8 +5,8 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build-release": "node ../../scripts/build-release.mts", - "prepack": "tsc -b" + "prepack": "node ../../scripts/build-release.mts", + "build": "tsc -b" }, "repository": { "type": "git", diff --git a/utils/graphile-config/package.json b/utils/graphile-config/package.json index 9f9da2e92c..36ad5bb0fe 100644 --- a/utils/graphile-config/package.json +++ b/utils/graphile-config/package.json @@ -20,9 +20,9 @@ } }, "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "test": "mocha '__tests__/**/*.test.ts'", - "prepack": "tsc -b" + "build": "tsc -b" }, "repository": { "type": "git", diff --git a/utils/graphile-export/package.json b/utils/graphile-export/package.json index 7f2fd61853..0c960d2582 100644 --- a/utils/graphile-export/package.json +++ b/utils/graphile-export/package.json @@ -16,8 +16,8 @@ } }, "scripts": { - "build-release": "node ../../scripts/build-release.mts", - "prepack": "tsc -b" + "prepack": "node ../../scripts/build-release.mts", + "build": "tsc -b" }, "repository": { "type": "git", diff --git a/utils/graphile/package.json b/utils/graphile/package.json index 1330de3970..91af733a9f 100644 --- a/utils/graphile/package.json +++ b/utils/graphile/package.json @@ -6,9 +6,9 @@ "bin": "dist/cli-run.js", "types": "dist/index.d.ts", "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "test": "true", - "prepack": "tsc -b" + "build": "tsc -b" }, "repository": { "type": "git", diff --git a/utils/jest-serializer-graphql-schema/package.json b/utils/jest-serializer-graphql-schema/package.json index dc6f2f7040..4deaaa6207 100644 --- a/utils/jest-serializer-graphql-schema/package.json +++ b/utils/jest-serializer-graphql-schema/package.json @@ -5,9 +5,9 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "test": "jest", - "prepack": "tsc -b", + "build": "tsc -b", "watch": "tsc -b --watch" }, "repository": { diff --git a/utils/jest-serializer-simple/package.json b/utils/jest-serializer-simple/package.json index c5b2b3524e..f9af7b7b3d 100644 --- a/utils/jest-serializer-simple/package.json +++ b/utils/jest-serializer-simple/package.json @@ -5,8 +5,8 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build-release": "node ../../scripts/build-release.mts", - "prepack": "tsc -b", + "prepack": "node ../../scripts/build-release.mts", + "build": "tsc -b", "watch": "tsc -b --watch" }, "repository": { diff --git a/utils/lru/package.json b/utils/lru/package.json index 495be7626b..e99cb78262 100644 --- a/utils/lru/package.json +++ b/utils/lru/package.json @@ -5,9 +5,9 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "test": "jest", - "prepack": "tsc -b" + "build": "tsc -b" }, "repository": { "type": "git", diff --git a/utils/pg-introspection/package.json b/utils/pg-introspection/package.json index 3b636ce505..aff52c97c4 100644 --- a/utils/pg-introspection/package.json +++ b/utils/pg-introspection/package.json @@ -5,9 +5,9 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "test": "node --experimental-strip-types --test", - "prepack": "tsc -b" + "build": "tsc -b" }, "repository": { "type": "git", diff --git a/utils/pg-sql2/package.json b/utils/pg-sql2/package.json index c9c2199931..1197c8a196 100644 --- a/utils/pg-sql2/package.json +++ b/utils/pg-sql2/package.json @@ -5,12 +5,12 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "pretest": "node dist/index.js", "test": "jest", "posttest": "yarn test:docs", "test:docs": "markdown-doctest", - "prepack": "tsc -b" + "build": "tsc -b" }, "repository": { "type": "git", diff --git a/utils/tamedevil/package.json b/utils/tamedevil/package.json index c9ca44229f..9972169aab 100644 --- a/utils/tamedevil/package.json +++ b/utils/tamedevil/package.json @@ -5,12 +5,12 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build-release": "node ../../scripts/build-release.mts", + "prepack": "node ../../scripts/build-release.mts", "pretest": "node dist/index.js", "test": "jest", "posttest": "yarn test:docs", "test:docs": "markdown-doctest", - "prepack": "tsc -b" + "build": "tsc -b" }, "repository": { "type": "git", From c2a3aa262c779f9201017cb371bcd2a12b5d7c16 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 13:50:59 +0000 Subject: [PATCH 16/40] Update scripts to reflect new build process --- .github/workflows/lint.yml | 5 +---- .github/workflows/test-base.yml | 3 --- graphile-build/graphile-utils/README.md | 2 +- pack.sh | 2 +- package.json | 12 +++++------- release | 21 --------------------- scripts/build-release.mts | 2 +- scripts/prepack-all | 8 -------- utils/lds/package.json | 2 +- 9 files changed, 10 insertions(+), 47 deletions(-) delete mode 100755 release delete mode 100755 scripts/prepack-all diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4fe364c619..d79751ca9a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -28,9 +28,6 @@ jobs: - name: "Build" run: yarn build - - name: "Prepack" - run: yarn workspaces foreach --parallel --topological --all run prepack - - name: "Lint Code" run: yarn eslint . @@ -73,7 +70,7 @@ jobs: - run: yarn --immutable - name: "Build Code" - run: yarn build && yarn prepack:all + run: yarn build - name: "Run depcheck script" run: node scripts/benjies-depcheck.mjs diff --git a/.github/workflows/test-base.yml b/.github/workflows/test-base.yml index d78c0a46d0..94b1d539a2 100644 --- a/.github/workflows/test-base.yml +++ b/.github/workflows/test-base.yml @@ -84,8 +84,5 @@ jobs: - name: "Build" run: yarn build - - name: "Prepack" - run: yarn workspaces foreach --verbose --parallel --topological --recursive --from '${{ inputs.package }}' run prepack - - name: "Test Project" run: yarn run pretest && yarn workspaces foreach --verbose --parallel --worktree --jobs 2 --from '${{ inputs.package }}' run ${{ inputs.testcommand }} diff --git a/graphile-build/graphile-utils/README.md b/graphile-build/graphile-utils/README.md index 5d7704fade..473c372b77 100644 --- a/graphile-build/graphile-utils/README.md +++ b/graphile-build/graphile-utils/README.md @@ -152,6 +152,6 @@ Make sure you first follow the instructions in the then run the test with the following commands: ```bash -yarn prepack +yarn build yarn test ``` diff --git a/pack.sh b/pack.sh index 384820a3f0..52db869bc1 100755 --- a/pack.sh +++ b/pack.sh @@ -5,7 +5,7 @@ rm -rf builds/ mkdir builds/ yarn clean -yarn workspaces-build-release +yarn build pack_pkg() { local repoDir="$1" diff --git a/package.json b/package.json index c2e834a15f..bb823728a3 100644 --- a/package.json +++ b/package.json @@ -2,17 +2,15 @@ "private": true, "scripts": { "fwd:update": "node ./scripts/fwd.mjs", - "check": "yarn clean && yarn lint && yarn prepack:all && yarn test", + "check": "yarn clean && yarn lint && yarn build && yarn test", "lint:fix": "yarn run eslint --fix . && yarn prettier:fix", - "pretest": "tsc -b && ./scripts/pretest && yarn workspaces foreach --all --topological run pretest", - "test": "NODE_ENV=test yarn workspaces foreach --all --topological run test", - "posttest": "NODE_ENV=test yarn workspaces foreach --all --topological run posttest && node scripts/benjies-depcheck.mjs", - "prepack:all": "scripts/prepack-all", - "build": "yarn && yarn workspace ruru-components prepack && yarn workspace ruru prepack && tsc -b", + "pretest": "tsc -b && ./scripts/pretest && yarn workspaces foreach --all --topological-dev run pretest", + "test": "NODE_ENV=test yarn workspaces foreach --all --topological-dev run test", + "posttest": "NODE_ENV=test yarn workspaces foreach --all --topological-dev run posttest && node scripts/benjies-depcheck.mjs", + "build": "yarn && yarn workspace ruru-components build && yarn workspace ruru build && tsc -b && yarn workspaces foreach --parallel --topological-dev --all --exclude '.' --exclude 'ruru' --exclude 'ruru-components' run build", "watch": "BUILD_MODE=development yarn build && tsc -b --watch", "clean": "( jest --clearCache || true ) && ( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,bundle,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} postgraphile/postgraphile/.tests_tmp/ grafast/ruru/static grafast/ruru/src/bundleCode.ts grafast/ruru/src/bundleMeta.ts || true )", "tsc:watch:clean": "( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} || true ) && tsc -b --watch", - "workspaces-build-release": "yarn workspaces foreach --topological-dev --all run build-release", "changeset-version": "yarn changeset version && node scripts/postversion.mjs", "w": "yarn workspace", "postgraphile": "cd postgraphile/postgraphile && node dist/cli-run.js", diff --git a/release b/release deleted file mode 100755 index a1d6b9ea05..0000000000 --- a/release +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -e -echo "CLEANING BUILT FILES" -yarn clean -echo "PREPACKING" -yarn prepack:all -echo "TEST" -yarn test - -TAG="${1:-next}" - -# Only shift if there's something to shift -if [ "x$1" != "x" ]; then shift; fi; - -echo 'NEED A PUBLISH COMMAND!' -exit 1 -# npx lerna publish --exact --npm-tag="$TAG" "$@" -yarn run changelog -git add CHANGELOG.md -git commit -m"chore: update CHANGELOG" -git push && git push --tags diff --git a/scripts/build-release.mts b/scripts/build-release.mts index 0d7b4e9db1..1890cf9698 100644 --- a/scripts/build-release.mts +++ b/scripts/build-release.mts @@ -116,7 +116,7 @@ export async function build() { } await $`rm -Rf tsconfig*.tsbuildinfo dist release`; - await $`yarn prepack`; + await $`yarn build`; await mkdir("release"); for (const f of packageJson.files) { const stats = await stat(f); diff --git a/scripts/prepack-all b/scripts/prepack-all deleted file mode 100755 index b77ad8096d..0000000000 --- a/scripts/prepack-all +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -e - -# Build everything in the relevant order according to TypeScript project references -yarn build - -# Now run `prepack` on each package (slightly parallelised) -yarn workspaces foreach --parallel --topological --all run prepack diff --git a/utils/lds/package.json b/utils/lds/package.json index 860ccdd02d..95a78a7298 100644 --- a/utils/lds/package.json +++ b/utils/lds/package.json @@ -6,7 +6,7 @@ "private": true, "scripts": { "//test": "jest -i", - "prepack": "tsc -b" + "build": "tsc -b" }, "bin": { "graphile-lds": "./dist/cli.js" From facf300febd37d0532bf4e153a9246fae32c6970 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 13:55:45 +0000 Subject: [PATCH 17/40] Handle some minor issues --- pack.sh | 2 +- scripts/build-release.mts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pack.sh b/pack.sh index 52db869bc1..58ee63a8dd 100755 --- a/pack.sh +++ b/pack.sh @@ -15,7 +15,7 @@ pack_pkg() { # sub-shell means no need to `cd -` ( cd "${repoDir}/release" || return 1 - rm package.tgz + rm -f package.tgz yarn pack -o package.tgz mv package.tgz "${repoRoot}/builds/${outputBasename}.tgz" ) diff --git a/scripts/build-release.mts b/scripts/build-release.mts index 1890cf9698..e5e47f16f7 100644 --- a/scripts/build-release.mts +++ b/scripts/build-release.mts @@ -136,6 +136,9 @@ export async function build() { `${packagePath}/release/package.json`, ); + // Force yarn to treat this as it's own project, so `yarn pack` doesn't complain + await $`touch release/yarn.lock`; + // TODO: force GRAPHILE_ENV="production" and eliminate all related dead branches } From d21bd4a935794deeeac948eaa7d339e3f675e567 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 13:57:18 +0000 Subject: [PATCH 18/40] Copy .npmignore --- scripts/build-release.mts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/build-release.mts b/scripts/build-release.mts index e5e47f16f7..27f4b05e40 100644 --- a/scripts/build-release.mts +++ b/scripts/build-release.mts @@ -126,6 +126,9 @@ export async function build() { await $`cp ${f} ${`release/${f}`}`; } } + if (existsSync(`${packagePath}/.npmignore`)) { + await $`cp .npmignore release/.npmignore`; + } if (existsSync(`${packagePath}/src/.npmignore`)) { await $`cp src/.npmignore release/dist/.npmignore`; } From 6a095317d30b3a879c44b1a617cb211615fd519d Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 14:00:18 +0000 Subject: [PATCH 19/40] Clearer variable names --- pack.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pack.sh b/pack.sh index 58ee63a8dd..9374f2d10d 100755 --- a/pack.sh +++ b/pack.sh @@ -8,13 +8,13 @@ yarn clean yarn build pack_pkg() { - local repoDir="$1" - local outputBasename="$2" local repoRoot="$(pwd)" + local packageDir="$1" + local outputBasename="$2" # sub-shell means no need to `cd -` ( - cd "${repoDir}/release" || return 1 + cd "${packageDir}/release" || return 1 rm -f package.tgz yarn pack -o package.tgz mv package.tgz "${repoRoot}/builds/${outputBasename}.tgz" From 574269cc061e858a2294d21a6a46e79b6b48f3c9 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 14:13:51 +0000 Subject: [PATCH 20/40] build-package only builds essential packages (not websites) --- grafast/codegen-plugin/package.json | 1 + grafast/dataplan-json/package.json | 1 + grafast/dataplan-pg/package.json | 1 + grafast/grafast/package.json | 1 + grafast/grafserv-persisted/package.json | 1 + grafast/grafserv/package.json | 1 + grafast/ruru-components/package.json | 1 + grafast/ruru-types/package.json | 1 + grafast/ruru/package.json | 1 + graphile-build/graphile-build-pg/package.json | 1 + graphile-build/graphile-build/package.json | 1 + graphile-build/graphile-simplify-inflection/package.json | 1 + graphile-build/graphile-utils/package.json | 1 + package.json | 2 +- postgraphile/pgl/package.json | 1 + postgraphile/postgraphile/package.json | 1 + utils/eslint-plugin-graphile-export/package.json | 1 + utils/graphile-config/package.json | 1 + utils/graphile-export/package.json | 1 + utils/graphile/package.json | 1 + utils/jest-serializer-graphql-schema/package.json | 1 + utils/jest-serializer-simple/package.json | 1 + utils/lru/package.json | 1 + utils/pg-introspection/package.json | 1 + utils/pg-sql2/package.json | 1 + utils/tamedevil/package.json | 1 + 26 files changed, 26 insertions(+), 1 deletion(-) diff --git a/grafast/codegen-plugin/package.json b/grafast/codegen-plugin/package.json index ca63a343b1..b3b81905b2 100644 --- a/grafast/codegen-plugin/package.json +++ b/grafast/codegen-plugin/package.json @@ -4,6 +4,7 @@ "description": "A GraphQL code generator plugin for Grafast schemas", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "build": "tsc -b" }, "exports": { diff --git a/grafast/dataplan-json/package.json b/grafast/dataplan-json/package.json index c99dd1e5bb..dd22c0c638 100644 --- a/grafast/dataplan-json/package.json +++ b/grafast/dataplan-json/package.json @@ -6,6 +6,7 @@ "types": "dist/index.d.ts", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "build": "tsc -b" }, "repository": { diff --git a/grafast/dataplan-pg/package.json b/grafast/dataplan-pg/package.json index ab9c21b804..8a4e3e9d00 100644 --- a/grafast/dataplan-pg/package.json +++ b/grafast/dataplan-pg/package.json @@ -24,6 +24,7 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "codegen": "yarn graphql-codegen -c codegen-examples-smallExample.ts", "update-schema": "ts-node ./src/examples/exampleSchema.ts", "test": "GRAPHILE_ENV=test jest", diff --git a/grafast/grafast/package.json b/grafast/grafast/package.json index e3393cb805..bcdf99c4e2 100644 --- a/grafast/grafast/package.json +++ b/grafast/grafast/package.json @@ -28,6 +28,7 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "codegen": "cd __tests__/dcc && node --experimental-strip-types ../../../../node_modules/.bin/graphql-codegen", "test": "yarn codegen && yarn test-mocha && yarn test-bundle", "test-bundle": "node --experimental-strip-types scripts/testbundle.mts", diff --git a/grafast/grafserv-persisted/package.json b/grafast/grafserv-persisted/package.json index 6b5d2bb507..da3c08be94 100644 --- a/grafast/grafserv-persisted/package.json +++ b/grafast/grafserv-persisted/package.json @@ -13,6 +13,7 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "build": "tsc -b", "test": "true" }, diff --git a/grafast/grafserv/package.json b/grafast/grafserv/package.json index 95fa8590a4..2ec8eaa669 100644 --- a/grafast/grafserv/package.json +++ b/grafast/grafserv/package.json @@ -77,6 +77,7 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "build": "tsc -b", "test": "jest", "posttest": "yarn playwright install chromium && node --experimental-strip-types scripts/smoke-examples.mts" diff --git a/grafast/ruru-components/package.json b/grafast/ruru-components/package.json index dbc0f08e50..afd290032f 100644 --- a/grafast/ruru-components/package.json +++ b/grafast/ruru-components/package.json @@ -17,6 +17,7 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "build": "tsc -b" }, "repository": { diff --git a/grafast/ruru-types/package.json b/grafast/ruru-types/package.json index 02868db4d8..06b7dcbf6e 100644 --- a/grafast/ruru-types/package.json +++ b/grafast/ruru-types/package.json @@ -13,6 +13,7 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "build": "tsc -b" }, "repository": { diff --git a/grafast/ruru/package.json b/grafast/ruru/package.json index 8749009c27..9dc5b27f84 100644 --- a/grafast/ruru/package.json +++ b/grafast/ruru/package.json @@ -29,6 +29,7 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "webpack": "node --loader ts-node/esm \"$(yarn bin webpack-cli)\" --config webpack.config.mts", "watch": "yarn webpack --watch --mode=development", "make-ruru-html": "node --experimental-strip-types scripts/make-ruru-html.mts", diff --git a/graphile-build/graphile-build-pg/package.json b/graphile-build/graphile-build-pg/package.json index cf27c6e908..20a23d523f 100644 --- a/graphile-build/graphile-build-pg/package.json +++ b/graphile-build/graphile-build-pg/package.json @@ -38,6 +38,7 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "test": "jest", "build": "tsc -b && cp src/.npmignore dist/.npmignore" }, diff --git a/graphile-build/graphile-build/package.json b/graphile-build/graphile-build/package.json index 6807ffcbc6..47b513048f 100644 --- a/graphile-build/graphile-build/package.json +++ b/graphile-build/graphile-build/package.json @@ -13,6 +13,7 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "build": "tsc -b && cp src/.npmignore dist/.npmignore" }, "repository": { diff --git a/graphile-build/graphile-simplify-inflection/package.json b/graphile-build/graphile-simplify-inflection/package.json index 0e63085454..44affa9e93 100644 --- a/graphile-build/graphile-simplify-inflection/package.json +++ b/graphile-build/graphile-simplify-inflection/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "build": "tsc -b", "test": "node test.js" }, diff --git a/graphile-build/graphile-utils/package.json b/graphile-build/graphile-utils/package.json index efdc4d171a..8815a46701 100644 --- a/graphile-build/graphile-utils/package.json +++ b/graphile-build/graphile-utils/package.json @@ -13,6 +13,7 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "test": "jest", "build": "tsc -b tsconfig.build.json" }, diff --git a/package.json b/package.json index bb823728a3..3eacdecc05 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "pretest": "tsc -b && ./scripts/pretest && yarn workspaces foreach --all --topological-dev run pretest", "test": "NODE_ENV=test yarn workspaces foreach --all --topological-dev run test", "posttest": "NODE_ENV=test yarn workspaces foreach --all --topological-dev run posttest && node scripts/benjies-depcheck.mjs", - "build": "yarn && yarn workspace ruru-components build && yarn workspace ruru build && tsc -b && yarn workspaces foreach --parallel --topological-dev --all --exclude '.' --exclude 'ruru' --exclude 'ruru-components' run build", + "build": "yarn && yarn workspace ruru-components build-package && yarn workspace ruru build-package && tsc -b && yarn workspaces foreach --parallel --topological-dev --all --exclude '.' --exclude 'ruru' --exclude 'ruru-components' run build-package", "watch": "BUILD_MODE=development yarn build && tsc -b --watch", "clean": "( jest --clearCache || true ) && ( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,bundle,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} postgraphile/postgraphile/.tests_tmp/ grafast/ruru/static grafast/ruru/src/bundleCode.ts grafast/ruru/src/bundleMeta.ts || true )", "tsc:watch:clean": "( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} || true ) && tsc -b --watch", diff --git a/postgraphile/pgl/package.json b/postgraphile/pgl/package.json index 58bcd49e88..228c9d227c 100644 --- a/postgraphile/pgl/package.json +++ b/postgraphile/pgl/package.json @@ -208,6 +208,7 @@ "bin": "./dist/cli-run.js", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "build": "tsc -b tsconfig.build.json" }, "repository": { diff --git a/postgraphile/postgraphile/package.json b/postgraphile/postgraphile/package.json index 7a6861d228..08496e9b6e 100644 --- a/postgraphile/postgraphile/package.json +++ b/postgraphile/postgraphile/package.json @@ -224,6 +224,7 @@ "bin": "./dist/cli-run.js", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "test": "yarn test:jest && UPDATE_SNAPSHOTS=\"\" yarn test:schema-exports && UPDATE_SNAPSHOTS=\"\" yarn test:operations-exports", "test:jest": "jest", "test:schema-exports": "node scripts/test-schema-exports.mjs", diff --git a/utils/eslint-plugin-graphile-export/package.json b/utils/eslint-plugin-graphile-export/package.json index efa73ae468..b40948b6dd 100644 --- a/utils/eslint-plugin-graphile-export/package.json +++ b/utils/eslint-plugin-graphile-export/package.json @@ -6,6 +6,7 @@ "types": "dist/index.d.ts", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "build": "tsc -b" }, "repository": { diff --git a/utils/graphile-config/package.json b/utils/graphile-config/package.json index 36ad5bb0fe..41d636b2c2 100644 --- a/utils/graphile-config/package.json +++ b/utils/graphile-config/package.json @@ -21,6 +21,7 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "test": "mocha '__tests__/**/*.test.ts'", "build": "tsc -b" }, diff --git a/utils/graphile-export/package.json b/utils/graphile-export/package.json index 0c960d2582..5ca6e0e18a 100644 --- a/utils/graphile-export/package.json +++ b/utils/graphile-export/package.json @@ -17,6 +17,7 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "build": "tsc -b" }, "repository": { diff --git a/utils/graphile/package.json b/utils/graphile/package.json index 91af733a9f..16c635c961 100644 --- a/utils/graphile/package.json +++ b/utils/graphile/package.json @@ -7,6 +7,7 @@ "types": "dist/index.d.ts", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "test": "true", "build": "tsc -b" }, diff --git a/utils/jest-serializer-graphql-schema/package.json b/utils/jest-serializer-graphql-schema/package.json index 4deaaa6207..5ae81c8561 100644 --- a/utils/jest-serializer-graphql-schema/package.json +++ b/utils/jest-serializer-graphql-schema/package.json @@ -6,6 +6,7 @@ "types": "dist/index.d.ts", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "test": "jest", "build": "tsc -b", "watch": "tsc -b --watch" diff --git a/utils/jest-serializer-simple/package.json b/utils/jest-serializer-simple/package.json index f9af7b7b3d..eb8d5988cf 100644 --- a/utils/jest-serializer-simple/package.json +++ b/utils/jest-serializer-simple/package.json @@ -6,6 +6,7 @@ "types": "dist/index.d.ts", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "build": "tsc -b", "watch": "tsc -b --watch" }, diff --git a/utils/lru/package.json b/utils/lru/package.json index e99cb78262..a92d117571 100644 --- a/utils/lru/package.json +++ b/utils/lru/package.json @@ -6,6 +6,7 @@ "types": "dist/index.d.ts", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "test": "jest", "build": "tsc -b" }, diff --git a/utils/pg-introspection/package.json b/utils/pg-introspection/package.json index aff52c97c4..c36bd32d8d 100644 --- a/utils/pg-introspection/package.json +++ b/utils/pg-introspection/package.json @@ -6,6 +6,7 @@ "types": "dist/index.d.ts", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "test": "node --experimental-strip-types --test", "build": "tsc -b" }, diff --git a/utils/pg-sql2/package.json b/utils/pg-sql2/package.json index 1197c8a196..c6343ed53d 100644 --- a/utils/pg-sql2/package.json +++ b/utils/pg-sql2/package.json @@ -6,6 +6,7 @@ "types": "dist/index.d.ts", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "pretest": "node dist/index.js", "test": "jest", "posttest": "yarn test:docs", diff --git a/utils/tamedevil/package.json b/utils/tamedevil/package.json index 9972169aab..d462b8617f 100644 --- a/utils/tamedevil/package.json +++ b/utils/tamedevil/package.json @@ -6,6 +6,7 @@ "types": "dist/index.d.ts", "scripts": { "prepack": "node ../../scripts/build-release.mts", + "build-package": "yarn build", "pretest": "node dist/index.js", "test": "jest", "posttest": "yarn test:docs", From 2add17efef4d393726b1fe1c802e27885351bad8 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 14:16:18 +0000 Subject: [PATCH 21/40] Each package does its own prepack --- pack.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pack.sh b/pack.sh index 9374f2d10d..05d9b16fa8 100755 --- a/pack.sh +++ b/pack.sh @@ -5,7 +5,6 @@ rm -rf builds/ mkdir builds/ yarn clean -yarn build pack_pkg() { local repoRoot="$(pwd)" @@ -14,7 +13,7 @@ pack_pkg() { # sub-shell means no need to `cd -` ( - cd "${packageDir}/release" || return 1 + cd "${packageDir}" rm -f package.tgz yarn pack -o package.tgz mv package.tgz "${repoRoot}/builds/${outputBasename}.tgz" From b3855f1a78f862c7ab3f3f1d2171f69afce453af Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 14:25:48 +0000 Subject: [PATCH 22/40] Don't forbid postpack --- grafast/grafast/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/grafast/grafast/package.json b/grafast/grafast/package.json index bcdf99c4e2..aa7f2ea049 100644 --- a/grafast/grafast/package.json +++ b/grafast/grafast/package.json @@ -34,7 +34,6 @@ "test-bundle": "node --experimental-strip-types scripts/testbundle.mts", "test-mocha": "tsc -b tsconfig.test.json && NODE_ENV=test GRAPHILE_ENV=test mocha '**/__tests__/**/*-test.ts'", "build": "tsc -b", - "postpack": "echo 'FORBIDDEN' && exit 1", "md": "spec-md CRYSTAL_FLOW.md > CRYSTAL_FLOW.html" }, "repository": { From e784e6968d4e34dd6c61aa17ef91e2bb253187fa Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 14:28:58 +0000 Subject: [PATCH 23/40] Run prepack --- pack.sh | 3 ++- package.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pack.sh b/pack.sh index 05d9b16fa8..eb1c365230 100755 --- a/pack.sh +++ b/pack.sh @@ -5,6 +5,7 @@ rm -rf builds/ mkdir builds/ yarn clean +yarn workspaces foreach --parallel --topological-dev --all run prepack pack_pkg() { local repoRoot="$(pwd)" @@ -13,7 +14,7 @@ pack_pkg() { # sub-shell means no need to `cd -` ( - cd "${packageDir}" + cd "${packageDir}/release" rm -f package.tgz yarn pack -o package.tgz mv package.tgz "${repoRoot}/builds/${outputBasename}.tgz" diff --git a/package.json b/package.json index 3eacdecc05..e5caf1db1f 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "pretest": "tsc -b && ./scripts/pretest && yarn workspaces foreach --all --topological-dev run pretest", "test": "NODE_ENV=test yarn workspaces foreach --all --topological-dev run test", "posttest": "NODE_ENV=test yarn workspaces foreach --all --topological-dev run posttest && node scripts/benjies-depcheck.mjs", - "build": "yarn && yarn workspace ruru-components build-package && yarn workspace ruru build-package && tsc -b && yarn workspaces foreach --parallel --topological-dev --all --exclude '.' --exclude 'ruru' --exclude 'ruru-components' run build-package", + "build-init": "yarn && yarn workspace ruru-components build-package && yarn workspace ruru build-package && tsc -b", + "build": "yarn build-init && yarn workspaces foreach --parallel --topological-dev --all --exclude '.' --exclude 'ruru' --exclude 'ruru-components' run build-package", "watch": "BUILD_MODE=development yarn build && tsc -b --watch", "clean": "( jest --clearCache || true ) && ( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,bundle,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} postgraphile/postgraphile/.tests_tmp/ grafast/ruru/static grafast/ruru/src/bundleCode.ts grafast/ruru/src/bundleMeta.ts || true )", "tsc:watch:clean": "( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} || true ) && tsc -b --watch", From f702fd10da17de5374639f486b5308075478a98d Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 14:32:03 +0000 Subject: [PATCH 24/40] Fix dev topography to match tsconfig.json --- utils/graphile/package.json | 1 + yarn.lock | 1 + 2 files changed, 2 insertions(+) diff --git a/utils/graphile/package.json b/utils/graphile/package.json index 16c635c961..6a21b99dcf 100644 --- a/utils/graphile/package.json +++ b/utils/graphile/package.json @@ -57,6 +57,7 @@ "@types/jest": "^30.0.0", "@types/node": "^22.19.1", "jest": "^30.2.0", + "postgraphile": "workspace:^", "ts-node": "^10.9.2" }, "publishConfig": { diff --git a/yarn.lock b/yarn.lock index 78d3278694..60aefc2066 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14887,6 +14887,7 @@ __metadata: chalk: "npm:^4.1.2" graphile-config: "workspace:^" jest: "npm:^30.2.0" + postgraphile: "workspace:^" source-map-js: "npm:^1.2.1" ts-node: "npm:^10.9.2" tslib: "npm:^2.8.1" From 82234db7253a5dd87502a9a037730f19d1c4936e Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 14:41:11 +0000 Subject: [PATCH 25/40] Remove 'graphile' as devdep to break cycle; replace with npm script --- grafast/grafast/package.json | 2 +- grafast/grafserv/package.json | 2 +- postgraphile/postgraphile/package.json | 2 +- yarn.lock | 5 +---- 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/grafast/grafast/package.json b/grafast/grafast/package.json index aa7f2ea049..6d7dda3af0 100644 --- a/grafast/grafast/package.json +++ b/grafast/grafast/package.json @@ -29,6 +29,7 @@ "scripts": { "prepack": "node ../../scripts/build-release.mts", "build-package": "yarn build", + "graphile": "node ../../utils/graphile/dist/cli-run.js", "codegen": "cd __tests__/dcc && node --experimental-strip-types ../../../../node_modules/.bin/graphql-codegen", "test": "yarn codegen && yarn test-mocha && yarn test-bundle", "test-bundle": "node --experimental-strip-types scripts/testbundle.mts", @@ -98,7 +99,6 @@ "@types/node": "^22.19.1", "@types/nodemon": "^3.1.1", "chai": "^5.3.3", - "graphile": "workspace:^", "graphql": "^16.9.0", "jest": "^30.2.0", "lodash": "^4.17.23", diff --git a/grafast/grafserv/package.json b/grafast/grafserv/package.json index 2ec8eaa669..272bfa792b 100644 --- a/grafast/grafserv/package.json +++ b/grafast/grafserv/package.json @@ -78,6 +78,7 @@ "scripts": { "prepack": "node ../../scripts/build-release.mts", "build-package": "yarn build", + "graphile": "node ../../utils/graphile/dist/cli-run.js", "build": "tsc -b", "test": "jest", "posttest": "yarn playwright install chromium && node --experimental-strip-types scripts/smoke-examples.mts" @@ -154,7 +155,6 @@ "express": "^4.21.2", "fastify": "^4.29.1 || ^5.0.0", "grafast": "workspace:^", - "graphile": "workspace:^", "graphql": "^16.9.0", "graphql-http": "^1.22.4", "h3": "^1.15.5", diff --git a/postgraphile/postgraphile/package.json b/postgraphile/postgraphile/package.json index 08496e9b6e..6a2bfad03f 100644 --- a/postgraphile/postgraphile/package.json +++ b/postgraphile/postgraphile/package.json @@ -225,6 +225,7 @@ "scripts": { "prepack": "node ../../scripts/build-release.mts", "build-package": "yarn build", + "graphile": "node ../../utils/graphile/dist/cli-run.js", "test": "yarn test:jest && UPDATE_SNAPSHOTS=\"\" yarn test:schema-exports && UPDATE_SNAPSHOTS=\"\" yarn test:operations-exports", "test:jest": "jest", "test:schema-exports": "node scripts/test-schema-exports.mjs", @@ -312,7 +313,6 @@ "@types/jest": "^30.0.0", "@types/jsonwebtoken": "^9.0.10", "@types/nodemon": "^3.1.1", - "graphile": "workspace:^", "graphile-export": "workspace:^", "jest": "^30.2.0", "nodemon": "^3.1.11", diff --git a/yarn.lock b/yarn.lock index 60aefc2066..31d1575004 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14614,7 +14614,6 @@ __metadata: chalk: "npm:^4.1.2" debug: "npm:^4.4.3" eventemitter3: "npm:^5.0.1" - graphile: "workspace:^" graphile-config: "workspace:^" graphql: "npm:^16.9.0" iterall: "npm:^1.3.0" @@ -14661,7 +14660,6 @@ __metadata: express: "npm:^4.21.2" fastify: "npm:^4.29.1 || ^5.0.0" grafast: "workspace:^" - graphile: "workspace:^" graphile-config: "workspace:^" graphql: "npm:^16.9.0" graphql-http: "npm:^1.22.4" @@ -14877,7 +14875,7 @@ __metadata: languageName: unknown linkType: soft -"graphile@workspace:^, graphile@workspace:utils/graphile": +"graphile@workspace:utils/graphile": version: 0.0.0-use.local resolution: "graphile@workspace:utils/graphile" dependencies: @@ -21782,7 +21780,6 @@ __metadata: debug: "npm:^4.4.3" grafast: "workspace:^" grafserv: "workspace:^" - graphile: "workspace:^" graphile-build: "workspace:^" graphile-build-pg: "workspace:^" graphile-config: "workspace:^" From f8433e9258a386b88beeb4ca6e5783fc523f17d4 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 14:59:34 +0000 Subject: [PATCH 26/40] Catch bug in pack_pkg --- pack.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pack.sh b/pack.sh index eb1c365230..2956675475 100755 --- a/pack.sh +++ b/pack.sh @@ -11,6 +11,14 @@ pack_pkg() { local repoRoot="$(pwd)" local packageDir="$1" local outputBasename="$2" + if [ "$packageDir" == "" ]; then + echo "INVALID pack_pkg CALL! $1 $2" + exit 1 + fi + if [ "$outputBasename" == "" ]; then + echo "INVALID pack_pkg CALL! $1 $2" + exit 1 + fi # sub-shell means no need to `cd -` ( @@ -24,7 +32,7 @@ pack_pkg() { pack_pkg utils/lru graphile__lru pack_pkg utils/tamedevil tamedevil pack_pkg utils/graphile-config graphile-config -pack_pkg grafast/grafast +pack_pkg grafast/grafast grafast pack_pkg grafast/ruru-types ruru-types pack_pkg grafast/ruru-components ruru-components pack_pkg grafast/ruru ruru From add45dacde536bc9b9be8236469fdfaf5cfe3925 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 15:47:37 +0000 Subject: [PATCH 27/40] Also bundle changelog --- scripts/build-release.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-release.mts b/scripts/build-release.mts index 27f4b05e40..bd2d85cbe8 100644 --- a/scripts/build-release.mts +++ b/scripts/build-release.mts @@ -132,7 +132,7 @@ export async function build() { if (existsSync(`${packagePath}/src/.npmignore`)) { await $`cp src/.npmignore release/dist/.npmignore`; } - await $`cp LICENSE.md README.md release/`; + await $`cp LICENSE.md README.md CHANGELOG.md release/`; await transformPackageJson( packageJson, From cff500acdd464dbc4339d9621a1a6f995fd0c6af Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 15:51:14 +0000 Subject: [PATCH 28/40] Tidy up publishConfig unless it's being useful --- scripts/build-release.mts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/build-release.mts b/scripts/build-release.mts index bd2d85cbe8..3432b4c655 100644 --- a/scripts/build-release.mts +++ b/scripts/build-release.mts @@ -15,6 +15,12 @@ async function transformPackageJson(packageJson: any, targetFilePath: string) { delete newJson.scripts; delete newJson.devDependencies; delete newJson.publishConfig.directory; + if (!newJson.name.startsWith("@")) { + delete newJson.publishConfig.access; + } + if (Object.keys(newJson.publishConfig).length === 0) { + delete newJson.publishConfig; + } for (const key in newJson) { if ( From 931898df48427288b87259488be8b5c766415e8e Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 16:11:10 +0000 Subject: [PATCH 29/40] Prepack command, also used by GitHub actions for changeset publish --- .github/workflows/release.yml | 6 +++++- pack.sh | 2 +- package.json | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c47f68c82b..6e239498b8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,5 +24,9 @@ jobs: - name: Install Dependencies run: yarn - - name: Create Release Pull Request + - name: Create Release Pull Request or Publish to npm + id: changesets uses: changesets/action@v1 + with: + version: yarn changeset-version + publish: yarn changeset-publish diff --git a/pack.sh b/pack.sh index 2956675475..bea55312d9 100755 --- a/pack.sh +++ b/pack.sh @@ -5,7 +5,7 @@ rm -rf builds/ mkdir builds/ yarn clean -yarn workspaces foreach --parallel --topological-dev --all run prepack +yarn workspaces-prepack pack_pkg() { local repoRoot="$(pwd)" diff --git a/package.json b/package.json index e5caf1db1f..e0f74a8b2f 100644 --- a/package.json +++ b/package.json @@ -10,9 +10,11 @@ "build-init": "yarn && yarn workspace ruru-components build-package && yarn workspace ruru build-package && tsc -b", "build": "yarn build-init && yarn workspaces foreach --parallel --topological-dev --all --exclude '.' --exclude 'ruru' --exclude 'ruru-components' run build-package", "watch": "BUILD_MODE=development yarn build && tsc -b --watch", + "workspaces-prepack": "yarn workspaces foreach --parallel --topological-dev --all run prepack", "clean": "( jest --clearCache || true ) && ( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,bundle,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} postgraphile/postgraphile/.tests_tmp/ grafast/ruru/static grafast/ruru/src/bundleCode.ts grafast/ruru/src/bundleMeta.ts || true )", "tsc:watch:clean": "( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} || true ) && tsc -b --watch", "changeset-version": "yarn changeset version && node scripts/postversion.mjs", + "changeset-publish": "yarn workspaces-prepack && changeset publish", "w": "yarn workspace", "postgraphile": "cd postgraphile/postgraphile && node dist/cli-run.js", "website:grafast": "cd grafast/website && yarn start", From 5182cd069d1c4b7b993223134b656f02a7110792 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 16:23:03 +0000 Subject: [PATCH 30/40] Avoid https://github.com/changesets/changesets/issues/1011 --- .changeset/config.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.changeset/config.json b/.changeset/config.json index 450466b87d..faa21af736 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,5 +1,8 @@ { "$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json", + "___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": { + "onlyUpdatePeerDependentsWhenOutOfRange": true + }, "changelog": [ "@changesets/changelog-github", { From d21fa8318fc7df3fe473eff7f8e120d8c479e2e8 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 16:33:15 +0000 Subject: [PATCH 31/40] Factor Ruru into version script --- scripts/postversion.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/postversion.mjs b/scripts/postversion.mjs index f98f604f82..e9d00bea7b 100644 --- a/scripts/postversion.mjs +++ b/scripts/postversion.mjs @@ -55,6 +55,10 @@ releasedPackages.sort(); await $`yarn`; await $`git add yarn.lock`; +// 3b. Rebuild Ruru HTML +await $`yarn workspace ruru run make-ruru-html`; +await $`git add grafast/website/static/myruru/index.html`; + // 4. Commit changes (including `.changeset/pre.json`) with helpful commit message await $`git add ${toCommit}`; const commitMessage = `\ From 8728feb99713b9d7d257a356cbea27730fffc61a Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 16:38:19 +0000 Subject: [PATCH 32/40] Via postversion --- grafast/ruru/package.json | 1 + package.json | 1 + scripts/postversion.mjs | 4 ---- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/grafast/ruru/package.json b/grafast/ruru/package.json index 9dc5b27f84..67848b4473 100644 --- a/grafast/ruru/package.json +++ b/grafast/ruru/package.json @@ -33,6 +33,7 @@ "webpack": "node --loader ts-node/esm \"$(yarn bin webpack-cli)\" --config webpack.config.mts", "watch": "yarn webpack --watch --mode=development", "make-ruru-html": "node --experimental-strip-types scripts/make-ruru-html.mts", + "postversion": "tsc -b tsconfig.build.json && yarn run make-ruru-html && git add ../website/static/myruru/index.html", "build": "rm -Rf dist static tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo && yarn webpack --mode=${BUILD_MODE:-production} && tsc -b tsconfig.build.json && cp src/.npmignore dist/ && chmod +x dist/cli-run.js && yarn make-ruru-html" }, "repository": { diff --git a/package.json b/package.json index e0f74a8b2f..dab6898c42 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "build": "yarn build-init && yarn workspaces foreach --parallel --topological-dev --all --exclude '.' --exclude 'ruru' --exclude 'ruru-components' run build-package", "watch": "BUILD_MODE=development yarn build && tsc -b --watch", "workspaces-prepack": "yarn workspaces foreach --parallel --topological-dev --all run prepack", + "workspaces-postversion": "yarn workspaces foreach --parallel --topological-dev --all run postversion", "clean": "( jest --clearCache || true ) && ( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,bundle,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} postgraphile/postgraphile/.tests_tmp/ grafast/ruru/static grafast/ruru/src/bundleCode.ts grafast/ruru/src/bundleMeta.ts || true )", "tsc:watch:clean": "( rm -Rf {utils,grafast,graphile-build,postgraphile}/*/{dist,tsconfig.tsbuildinfo,tsconfig.*.tsbuildinfo} || true ) && tsc -b --watch", "changeset-version": "yarn changeset version && node scripts/postversion.mjs", diff --git a/scripts/postversion.mjs b/scripts/postversion.mjs index e9d00bea7b..f98f604f82 100644 --- a/scripts/postversion.mjs +++ b/scripts/postversion.mjs @@ -55,10 +55,6 @@ releasedPackages.sort(); await $`yarn`; await $`git add yarn.lock`; -// 3b. Rebuild Ruru HTML -await $`yarn workspace ruru run make-ruru-html`; -await $`git add grafast/website/static/myruru/index.html`; - // 4. Commit changes (including `.changeset/pre.json`) with helpful commit message await $`git add ${toCommit}`; const commitMessage = `\ From 7c24b7341f9152f20679f47fc3080a4f2009bf24 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 17:08:43 +0000 Subject: [PATCH 33/40] lint ignore release --- .lintignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.lintignore b/.lintignore index 30e19e967a..8ebcc1ad9a 100644 --- a/.lintignore +++ b/.lintignore @@ -23,6 +23,7 @@ node_modules/ /graphile-build/graphile-build-pg/exported-schema-for-webpack.mjs /graphile-build/graphile-build-pg/schema-export-output.mjs /graphile-build/graphile-build-pg/temp.mjs +/*/*/release/ **/__tests__/**/*.1.graphql **/__tests__/**/*.json5 **/__tests__/**/*.mermaid From 6eee565c72c0a8639bbb69de288af777149f5694 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 17:11:31 +0000 Subject: [PATCH 34/40] Lint --- scripts/build-release.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-release.mts b/scripts/build-release.mts index 3432b4c655..b3a448d02d 100644 --- a/scripts/build-release.mts +++ b/scripts/build-release.mts @@ -1,4 +1,4 @@ -/* global $, cd */ +/* global $ */ import "zx/globals"; From c538b22d653ce1b9aab75f2662cf6a6c32d24c72 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Mon, 9 Mar 2026 17:11:39 +0000 Subject: [PATCH 35/40] Remove unused esmHack --- scripts/build-release.mts | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/scripts/build-release.mts b/scripts/build-release.mts index b3a448d02d..fe37a7031f 100644 --- a/scripts/build-release.mts +++ b/scripts/build-release.mts @@ -72,31 +72,6 @@ async function transformPackageJson(packageJson: any, targetFilePath: string) { await fsp.writeFile(targetFilePath, JSON.stringify(newJson, null, 2)); } -export async function esmHack(codePath: string) { - const pkg = require(codePath); - const code = await fsp.readFile(codePath, "utf8"); - - await fsp.writeFile( - codePath, - `\ -// Convince Node to allow ESM named imports -${Object.keys(pkg) - .map( - (varName) => - `${ - varName.match(/^[_a-zA-Z$][_a-zA-Z$0-9]*$/) - ? `exports.${varName}` - : `exports[${JSON.stringify(varName)}]` - } = null /* placeholder */;`, - ) - .join("\n")} - -// Bundled module -${code} -`, - ); -} - export async function build() { const packagePath = process.cwd(); const packageJson = JSON.parse( From 1f954b18a04b95fd71a53798e5cd512b1a971340 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 10 Mar 2026 10:06:26 +0000 Subject: [PATCH 36/40] Lint --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6e239498b8..67d584a86e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: uses: actions/setup-node@v6 with: node-version: 24 - cache: 'yarn' + cache: "yarn" - name: Install Dependencies run: yarn From 2a509dc3dd0f9f3b0aa547258822456da7efb116 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 10 Mar 2026 10:14:16 +0000 Subject: [PATCH 37/40] Use the build-package command --- scripts/build-release.mts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-release.mts b/scripts/build-release.mts index fe37a7031f..d90015bdcd 100644 --- a/scripts/build-release.mts +++ b/scripts/build-release.mts @@ -97,7 +97,7 @@ export async function build() { } await $`rm -Rf tsconfig*.tsbuildinfo dist release`; - await $`yarn build`; + await $`yarn build-package`; await mkdir("release"); for (const f of packageJson.files) { const stats = await stat(f); From 7dee6324faa7f920f0ce808c949ad409654ba308 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 10 Mar 2026 10:33:10 +0000 Subject: [PATCH 38/40] Move removal to build-package --- grafast/ruru/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/grafast/ruru/package.json b/grafast/ruru/package.json index 67848b4473..fdae84c00a 100644 --- a/grafast/ruru/package.json +++ b/grafast/ruru/package.json @@ -29,12 +29,12 @@ }, "scripts": { "prepack": "node ../../scripts/build-release.mts", - "build-package": "yarn build", + "build-package": "rm -Rf dist static tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo && yarn build", "webpack": "node --loader ts-node/esm \"$(yarn bin webpack-cli)\" --config webpack.config.mts", "watch": "yarn webpack --watch --mode=development", "make-ruru-html": "node --experimental-strip-types scripts/make-ruru-html.mts", "postversion": "tsc -b tsconfig.build.json && yarn run make-ruru-html && git add ../website/static/myruru/index.html", - "build": "rm -Rf dist static tsconfig.tsbuildinfo tsconfig.build.tsbuildinfo && yarn webpack --mode=${BUILD_MODE:-production} && tsc -b tsconfig.build.json && cp src/.npmignore dist/ && chmod +x dist/cli-run.js && yarn make-ruru-html" + "build": "yarn webpack --mode=${BUILD_MODE:-production} && tsc -b tsconfig.build.json && cp src/.npmignore dist/ && chmod +x dist/cli-run.js && yarn make-ruru-html" }, "repository": { "type": "git", From 04705a8ac81051637b4df0fe79fe530079034b65 Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 10 Mar 2026 11:25:48 +0000 Subject: [PATCH 39/40] Add details of new package requirements --- CONTRIBUTING.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2a9d40f13d..d88aa5f66e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -270,3 +270,29 @@ have access to. - `Object.values(obj)` is better than `Object.keys(obj).map(k => obj[k])`. - `arr.find(...)` is better than `arr.filter(...)[0]` - use `async`/`await` - [it's fast!](https://v8.dev/blog/fast-async) + +## New packages + +If your package is internal, name it `@localrepo/*` (replacing `*` with a name), +and be sure to set `private: true` in `package.json`. Otherwise... + +We use trusted publishing via CI and have particular setup to make this work; +any new package should follow the conventions of existing packages, but in +particular: + +- package.json `scripts.prepack` must be set and include + `node ../../scripts/build-release.mts`; this script will call + `yarn build-package`, and thus: +- package.json `scripts.build-package` must be set; typically it will simply be + `yarn build` but if there's any tidyup or extra commands needed for publishing + that aren't needed for regular development, they would go here +- package.json `scripts.build` will typically be `tsc -b` +- package.json `publishConfig` must be present and have value + `{access: "public", directory: "release"}` +- package.json `files` should be used, and will typically be `["dist"]` +- package.json `peerDependencies` with `workspace:` spec should use an explicit + range (e.g. `workspace:^5.0.0-rc.8`) +- package.json `dependencies` and `devDependencies` with `workspace:` should use + an implicit range (typically `workspace:^`) +- `README.md` must be present +- `LICENSE.md` must be present From c476e774fafe0a26b622061ff220b070965e061d Mon Sep 17 00:00:00 2001 From: Benjie Gillam Date: Tue, 10 Mar 2026 11:31:47 +0000 Subject: [PATCH 40/40] Remove extraneous slashes --- pack.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pack.sh b/pack.sh index bea55312d9..6b84551a59 100755 --- a/pack.sh +++ b/pack.sh @@ -46,10 +46,10 @@ pack_pkg graphile-build/graphile-build graphile-build pack_pkg utils/pg-introspection pg-introspection pack_pkg utils/pg-sql2 pg-sql2 pack_pkg grafast/dataplan-pg dataplan__pg -pack_pkg graphile-build/graphile-build-pg/ graphile-build-pg +pack_pkg graphile-build/graphile-build-pg graphile-build-pg pack_pkg graphile-build/graphile-utils graphile-utils -pack_pkg postgraphile/postgraphile/ postgraphile -pack_pkg postgraphile/pgl/ pgl +pack_pkg postgraphile/postgraphile postgraphile +pack_pkg postgraphile/pgl pgl pack_pkg graphile-build/graphile-simplify-inflection graphile__simplify-inflection pack_pkg grafast/grafserv-persisted grafserv__persisted pack_pkg utils/graphile graphile