From dee8b85b84d6fe7209598b77ca6246567c7c297f Mon Sep 17 00:00:00 2001 From: Orion Kindel Date: Wed, 3 Apr 2024 16:37:27 -0500 Subject: [PATCH] fix: make publishing easier --- README.md | 90 +++++++++++++++++++++++++------------------------- bun/prepare.js | 25 ++++++++++++++ spago.yaml | 2 +- 3 files changed, 71 insertions(+), 46 deletions(-) create mode 100644 bun/prepare.js diff --git a/README.md b/README.md index 5c4c0f1..47e4eba 100644 --- a/README.md +++ b/README.md @@ -255,59 +255,59 @@ the api of [`node-postgres`]: - release clients with [`Pool.release`] or [`Pool.destroy`] - release with [`Pool.end`] -[`Pool`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Pool#t:Pool -[`Config`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Pool#t:Config -[`Pool.make`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Pool#v:make -[`Pool.end`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Pool#v:end -[`Pool.connect`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Pool#v:connect -[`Pool.destroy`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Pool#v:destroy -[`Pool.release`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Pool#v:release +[`Pool`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Pool#t:Pool +[`Config`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Pool#t:Config +[`Pool.make`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Pool#v:make +[`Pool.end`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Pool#v:end +[`Pool.connect`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Pool#v:connect +[`Pool.destroy`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Pool#v:destroy +[`Pool.release`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Pool#v:release -[`Client`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Client#t:Client -[`Client.end`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Client#v:end -[`Client.make`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Client#v:make -[`Client.connected`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Client#v:connected -[`Client.query`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Client#v:query -[`Client.queryRaw`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Client#v:queryRaw -[`Client.exec`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Effect.Aff.Postgres.Client#v:exec +[`Client`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Client#t:Client +[`Client.end`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Client#v:end +[`Client.make`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Client#v:make +[`Client.connected`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Client#v:connected +[`Client.query`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Client#v:query +[`Client.queryRaw`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Client#v:queryRaw +[`Client.exec`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Effect.Aff.Postgres.Client#v:exec -[`Range`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Range#t:Range -[`Range.gt`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Range#v:gt -[`Range.gte`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Range#v:gte -[`Range.lt`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Range#v:lt -[`Range.lte`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Range#v:lte +[`Range`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Range#t:Range +[`Range.gt`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Range#v:gt +[`Range.gte`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Range#v:gte +[`Range.lt`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Range#v:lt +[`Range.lte`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Range#v:lte -[`Raw`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Raw#t:Raw -[`Null`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Raw#t:Null +[`Raw`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Raw#t:Raw +[`Null`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Raw#t:Null -[`Serialize`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres#t:Serialize -[`Deserialize`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres#t:Deserialize -[`Rep`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres#t:Rep -[`modifyPgTypes`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres#v:modifyPgTypes +[`Serialize`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres#t:Serialize +[`Deserialize`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres#t:Deserialize +[`Rep`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres#t:Rep +[`modifyPgTypes`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres#v:modifyPgTypes -[`Result`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Result#t:Result -[`FromRow`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Result#t:FromRow -[`FromRows`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Result#t:FromRows +[`Result`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Result#t:Result +[`FromRow`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Result#t:FromRow +[`FromRows`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Result#t:FromRows -[`Query`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Query#t:Query -[`AsQuery`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Query#t:AsQuery +[`Query`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Query#t:Query +[`AsQuery`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Query#t:AsQuery -[`Query.Builder`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Query.Builder#t:Builder -[`Query.Builder.param`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Query.Builder#v:param -[`Query.Builder.build`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Data.Postgres.Query.Builder#v:build +[`Query.Builder`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Query.Builder#t:Builder +[`Query.Builder.param`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Query.Builder#v:param +[`Query.Builder.build`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Data.Postgres.Query.Builder#v:build -[`MonadCursor`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Control.Monad.Postgres#t:MonadCursor -[`MonadSession`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Control.Monad.Postgres#t:MonadSession -[`CursorT`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Control.Monad.Postgres#t:CursorT -[`SessionT`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Control.Monad.Postgres#t:SessionT -[`PostgresT`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Control.Monad.Postgres#t:PostgresT -[`cursor`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Control.Monad.Postgres#v:cursor -[`session`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Control.Monad.Postgres#v:session -[`transaction`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Control.Monad.Postgres#v:transaction -[`runPostgres`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Control.Monad.Postgres#v:runPostgres -[`query`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Control.Monad.Postgres#v:query -[`exec`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Control.Monad.Postgres#v:exec -[`exec_`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.2/docs/Control.Monad.Postgres#v:exec_ +[`MonadCursor`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Control.Monad.Postgres#t:MonadCursor +[`MonadSession`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Control.Monad.Postgres#t:MonadSession +[`CursorT`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Control.Monad.Postgres#t:CursorT +[`SessionT`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Control.Monad.Postgres#t:SessionT +[`PostgresT`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Control.Monad.Postgres#t:PostgresT +[`cursor`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Control.Monad.Postgres#v:cursor +[`session`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Control.Monad.Postgres#v:session +[`transaction`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Control.Monad.Postgres#v:transaction +[`runPostgres`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Control.Monad.Postgres#v:runPostgres +[`query`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Control.Monad.Postgres#v:query +[`exec`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Control.Monad.Postgres#v:exec +[`exec_`]: https://pursuit.purescript.org/packages/purescript-postgresql/1.0.3/docs/Control.Monad.Postgres#v:exec_ [`node-postgres`]: https://node-postgres.com/ [`pg-types`]: https://github.com/brianc/node-pg-types/ diff --git a/bun/prepare.js b/bun/prepare.js new file mode 100644 index 0000000..1ac93cd --- /dev/null +++ b/bun/prepare.js @@ -0,0 +1,25 @@ +import {readFile, writeFile} from 'fs/promises' +import {execSync} from 'child_process' + +const ver = process.argv[2] +if (!ver) { + console.error(`tag required: bun bun/prepare.js v1.0.0`) +} else if (!/v\d+\.\d+\.\d+/.test(ver)) { + console.error(`invalid tag: ${ver}`) +} + +const pkg = await readFile('./package.json', 'utf8') +const pkgnew = pkg.replace(/"version": ".+"/, `"version": "${ver}"`) +await writeFile('./package.json', pkgnew) + +const spago = await readFile('./spago.yaml', 'utf8') +const spagonew = spago.replace(/version: .+/, `version: '${ver}'`) +await writeFile('./spago.yaml', spagonew) + +const readme = await readFile('./README.md', 'utf8') +const readmenew = readme.replace(/packages\/postgresql\/.+?\//g, `/packages/postgresql/${ver}/`) +await writeFile('./README.md', readmenew) + +execSync(`git tag ${ver}`) +execSync(`git push --tags`) +execSync(`git push --mirror github-mirror`) diff --git a/spago.yaml b/spago.yaml index 4c6d63f..b562f8a 100644 --- a/spago.yaml +++ b/spago.yaml @@ -1,7 +1,7 @@ package: name: postgresql publish: - version: '1.0.2' + version: '1.0.3' license: 'GPL-3.0-or-later' location: githubOwner: 'cakekindel'