fix: prep for publish

This commit is contained in:
orion 2024-06-10 11:40:57 -05:00
parent f9894f8889
commit c9cdb9f60b
Signed by: orion
GPG Key ID: 6D4165AE4C928719
3 changed files with 42 additions and 0 deletions

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# url-immutable
Type-safe immutable bindings to the `URL` web / node api.

34
bun/prepare.js Normal file
View File

@ -0,0 +1,34 @@
import { readFile, writeFile } from "fs/promises";
import { execSync } from "child_process";
let ver = process.argv[2];
if (!ver) {
console.error(`tag required: bun bun/prepare.js v1.0.0`);
process.exit(1);
} else if (!/v\d+\.\d+\.\d+/.test(ver)) {
console.error(`invalid tag: ${ver}`);
process.exit(1);
}
ver = (/\d+\.\d+\.\d+/.exec(ver) || [])[0] || "";
const pkg = await readFile("./package.json", "utf8");
const pkgnew = pkg.replace(/"version": ".+"/, `"version": "v${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\/purescript-url-immutable\/.+?\//g,
`/packages/purescript-url-immutable/${ver}/`,
);
await writeFile("./README.md", readmenew);
execSync(`git add spago.yaml package.json README.md`);
execSync(`git commit -m 'chore: prepare v${ver}'`);
execSync(`git tag v${ver}`);
execSync(`git push --tags`);
execSync(`git push --mirror github-mirror`);

View File

@ -2,6 +2,12 @@ package:
build:
strict: true
pedanticPackages: true
publish:
version: '0.0.0'
license: 'GPL-3.0-or-later'
location:
githubOwner: 'cakekindel'
githubRepo: 'purescript-url-immutable'
name: url-immutable
test:
main: Test.Main