"docs:api": "pnpm run --filter ./packages/docs -r docs:api"
},
"devDependencies": {
- "@rollup/plugin-alias": "^3.1.9",
- "@rollup/plugin-commonjs": "^22.0.2",
- "@rollup/plugin-node-resolve": "^13.3.0",
- "@rollup/plugin-replace": "^4.0.0",
- "@rollup/plugin-terser": "^0.2.1",
+ "@rollup/plugin-alias": "^5.0.0",
+ "@rollup/plugin-commonjs": "^24.1.0",
+ "@rollup/plugin-node-resolve": "^15.0.2",
+ "@rollup/plugin-replace": "^5.0.2",
+ "@rollup/plugin-terser": "^0.4.1",
"@types/lodash.kebabcase": "^4.1.7",
"@types/node": "^18.15.11",
- "@vitest/coverage-c8": "^0.29.8",
+ "@vitest/coverage-c8": "^0.30.1",
"@vue/compiler-sfc": "^3.2.47",
"@vue/server-renderer": "^3.2.47",
"c8": "^7.13.0",
"execa": "^6.1.0",
"expect": "^28.1.3",
"globby": "^12.2.0",
- "happy-dom": "^9.1.9",
+ "happy-dom": "^9.8.1",
"lint-staged": "^13.2.1",
"lodash.kebabcase": "^4.1.1",
"minimist": "^1.2.8",
"p-series": "^3.0.0",
"pascalcase": "^1.0.0",
"prettier": "^2.8.7",
- "rimraf": "^4.4.1",
- "rollup": "^2.79.1",
- "rollup-plugin-typescript2": "^0.32.1",
- "semver": "^7.3.8",
+ "rimraf": "^5.0.0",
+ "rollup": "^3.20.5",
+ "rollup-plugin-typescript2": "^0.34.1",
+ "semver": "^7.5.0",
"typedoc": "^0.23.28",
"typedoc-plugin-markdown": "^3.14.0",
"typescript": "^4.9.4",
- "vitest": "^0.29.8",
+ "vitest": "^0.30.1",
"vue": "^3.2.47",
"yorkie": "^2.0.0"
},
},
"dependencies": {
"@chenfengyuan/vue-countdown": "^2.1.0",
- "@vueuse/core": "^9.13.0",
+ "@vueuse/core": "^10.0.2",
"pinia": "workspace:^2.0.18",
- "vitepress": "1.0.0-alpha.65"
+ "vitepress": "1.0.0-alpha.72"
}
}
const path = require('path')
const TypeDoc = require('typedoc')
const { PageEvent } = TypeDoc
-const {
- prependYAML,
-} = require('typedoc-plugin-markdown/dist/utils/front-matter')
const fs = _fs.promises
)
async function serve() {
+ // TODO: in 0.24
+ // app.bootstrapWithPlugins(options)
app.bootstrap(options)
app.convertAndWatch(handleProject)
}
) {
await fs.rm(options.out, { recursive: true })
}
+ // TODO: same as above
app.bootstrap(options)
const project = app.convert()
return handleProject(project)
return false
}
}
+
+/**
+ * @typedef {Record<string, string | number | boolean>} FrontMatterVars
+ */
+
+/**
+ * Prepends YAML block to a string
+ * @param {string} contents - string to prepend to
+ * @param {FrontMattersVars} vars - object of required front matter variables
+ */
+function prependYAML(contents, vars) {
+ return contents
+ .replace(/^/, toYAML(vars) + '\n\n')
+ .replace(/[\r\n]{3,}/g, '\n\n')
+}
+
+/**
+ * Converts YAML object to a YAML string
+ * @param {FrontMatterVars} vars
+ */
+function toYAML(vars) {
+ const yaml = `---
+${Object.entries(vars)
+ .map(
+ ([key, value]) =>
+ `${key}: ${
+ typeof value === 'string' ? `"${escapeDoubleQuotes(value)}"` : value
+ }`
+ )
+ .join('\n')}
+---`
+ return yaml
+}
+
+/**
+ * Escapes double quotes in a string
+ * @param {string} str - string to escape
+ */
+function escapeDoubleQuotes(str) {
+ return str.replace(/"/g, '\\"')
+}
-import path from 'path'
+import { dirname, resolve } from 'node:path'
+import { fileURLToPath } from 'node:url'
import ts from 'rollup-plugin-typescript2'
import replace from '@rollup/plugin-replace'
-import resolve from '@rollup/plugin-node-resolve'
+import nodeResolve from '@rollup/plugin-node-resolve'
import commonjs from '@rollup/plugin-commonjs'
import terser from '@rollup/plugin-terser'
+const __filename = fileURLToPath(import.meta.url)
+const __dirname = dirname(__filename)
+
/** @type {import('rollup').RollupOptions[]} */
const config = ['pinia'].map(createConfig)
return {
external: ['vue'],
output: {
- file: path.resolve(__dirname, `./dist/${file}.js`),
+ file: resolve(__dirname, `./dist/${file}.js`),
format: 'es',
},
- input: path.resolve(__dirname, `./src/${file}.js`),
+ input: resolve(__dirname, `./src/${file}.js`),
plugins: [
replace({
preventAssignment: true,
}),
ts({
check: false,
- tsconfig: path.resolve(__dirname, '../../tsconfig.json'),
- cacheRoot: path.resolve(__dirname, '../../node_modules/.rts2_cache'),
+ tsconfig: resolve(__dirname, '../../tsconfig.json'),
+ cacheRoot: resolve(__dirname, '../../node_modules/.rts2_cache'),
tsconfigOverride: {
compilerOptions: {
sourceMap: false,
exclude: ['__tests__', 'test-dts'],
},
}),
- resolve(),
+ nodeResolve(),
commonjs(),
terser({
format: {