* chore: new experimental package `@xsai-ext/compat`
* chore(scripts): exclude private package
* fix(xsai): export shared
* feat(compat): add embed
* chore(compat): update embed
* feat(compat): add generate text
* fix(utils-stream): export types
* fix(compat/embed): export result types
* refactor(compat): unsupported types
* fix(compat): export core message type
* feat(compat): add stream text
* chore(compat): update types
* chore(compat): update version
* feat(compat): support prompt, system
* feat(compat): add {generate,stream}-object
* fix(compat): set stream object return type
* feat(compat): add unsupported utils
* fix(compat): improve convert tools
* chore: add mastra example
* fix(compat/generate-text): export result type
* fix(compat/stream-text): export result type
* chore(compat): mark as public
* docs: add compat
* docs: add verified version
* chore: remove mastra example
34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
/* eslint-disable @masknet/no-top-level */
|
|
import { findWorkspaceDir } from '@pnpm/find-workspace-dir'
|
|
import { glob, readFile, writeFile } from 'node:fs/promises'
|
|
import { resolve } from 'node:path'
|
|
import { cwd } from 'node:process'
|
|
|
|
const pages = []
|
|
|
|
const workspaceDir = await findWorkspaceDir(cwd())
|
|
|
|
const packagesExt = glob(`${workspaceDir}/packages-ext/**/package.json`)
|
|
|
|
for await (const pkg of packagesExt) {
|
|
const { name, private: priv } = JSON.parse(await readFile(pkg, 'utf8')) as { name: string, private?: boolean }
|
|
if (priv !== true)
|
|
pages.push(`[${name}](https://tsdocs.dev/search/docs/${name})`)
|
|
}
|
|
|
|
const packages = glob(`${workspaceDir}/packages/**/package.json`)
|
|
|
|
for await (const pkg of packages) {
|
|
const { name, private: priv } = JSON.parse(await readFile(pkg, 'utf8')) as { name: string, private?: boolean }
|
|
if (priv !== true)
|
|
pages.push(`[${name}](https://tsdocs.dev/search/docs/${name})`)
|
|
}
|
|
|
|
const json = JSON.stringify({
|
|
defaultOpen: false,
|
|
pages: pages.toReversed(),
|
|
title: 'Packages',
|
|
}, null, 2)
|
|
|
|
await writeFile(resolve(import.meta.dirname, '../content/docs/references/meta.json'), `${json}\n`)
|