jose/tools/docs.postbump.js
Filip Skokan 357fe0b964 feat: Revised API, No dependencies, Browser Support, Promises
BREAKING CHANGE: Revised, Promise-based API
BREAKING CHANGE: No dependencies
BREAKING CHANGE: Browser support (using [Web Cryptography API](https://www.w3.org/TR/WebCryptoAPI/))
BREAKING CHANGE: Support for verification using a remote JWKS endpoint
BREAKING CHANGE: Experimental Node.js libuv thread pool based runtime (non-blocking 🎉)
2020-11-14 18:26:46 +01:00

30 lines
976 B
JavaScript
Executable file

require("./explode-exports");
const { execSync } = require("child_process");
const { readFileSync, writeFileSync } = require("fs");
const { version } = require("../package.json");
const { sync: glob } = require("glob");
const readme = readFileSync("docs/README.md");
const tagName = `v${version}`;
execSync('find docs -type d | grep "docs/" | xargs rm -r');
writeFileSync(
"node_modules/typedoc-plugin-markdown/dist/resources/partials/member.sources.hbs",
readFileSync("tools/member.sources.hbs")
);
writeFileSync(
"node_modules/typedoc-plugin-markdown/dist/resources/templates/reflection.hbs",
readFileSync("tools/reflection.hbs")
);
execSync(`npm run docs:generate -- --gitRevision ${tagName}`);
glob("docs/**/*.md").forEach((md) => {
writeFileSync(
md,
readFileSync(md)
.toString()
.replace(/```\n\/\//g, "```js\n//")
.replace(/undefined \\\| /g, '')
);
});
writeFileSync("docs/README.md", readme);
execSync("git add docs/**/*.md");