More docs

This commit is contained in:
Aria Minaei 2021-10-06 12:49:04 +02:00
parent 59090320ea
commit 3ed7e6bf6c
5 changed files with 202 additions and 72 deletions

View file

@ -1,6 +1,11 @@
/**
* This script generates API documentation files in the target folder.
* Usage: `$ yarn build:api-docs <path>` creates the .md files in <path>.
* Example: `$ yarn build:api-docs path/to/theatre-docs/docs/api/`
*
* Usually <path> is https://github.com/AriaMinaei/theatre-docs/tree/main/docs/api
*/
import path from 'path'
import {readFileSync, writeFileSync} from 'fs'
import {keyBy} from 'lodash-es'
import {parse as parseJsonC} from 'jsonc-parser'
;(async function () {
// better quote function from https://github.com/google/zx/pull/167

40
scripts/build.mjs Normal file
View file

@ -0,0 +1,40 @@
/**
* Builds all the packages for production
*/
const packagesToBuild = [
'theatre',
'@theatre/dataverse',
'@theatre/react',
'@theatre/browser-bundles',
'@theatre/r3f',
]
;(async function () {
// better quote function from https://github.com/google/zx/pull/167
$.quote = function quote(arg) {
if (/^[a-z0-9/_.-]+$/i.test(arg)) {
return arg
}
return (
`$'` +
arg
.replace(/\\/g, '\\\\')
.replace(/'/g, "\\'")
.replace(/\f/g, '\\f')
.replace(/\n/g, '\\n')
.replace(/\r/g, '\\r')
.replace(/\t/g, '\\t')
.replace(/\v/g, '\\v')
.replace(/\0/g, '\\0') +
`'`
)
}
await Promise.all([
$`yarn run buid:ts`,
...packagesToBuild.map(
(workspace) => $`yarn workspace ${workspace} run build`,
),
])
})()