From b9c65486afef377bf6f26bafb1796623232b285d Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Tue, 7 Sep 2021 12:41:27 +0200 Subject: [PATCH] chore(docs): generate docs from @nuxt/kit schema --- docs/build.config.ts | 16 ---------------- docs/package.json | 7 ++++--- docs/scripts/gen-docs.ts | 2 +- docs/yarn.lock | 19 +++++++++++++++++++ 4 files changed, 24 insertions(+), 20 deletions(-) delete mode 100644 docs/build.config.ts diff --git a/docs/build.config.ts b/docs/build.config.ts deleted file mode 100644 index 8f24448a3e..0000000000 --- a/docs/build.config.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { resolve } from 'path' -import { defineBuildConfig } from 'unbuild' - -export default defineBuildConfig({ - entries: [ - { - input: resolve(__dirname, '../packages/kit/src/config/schema/index'), - outDir: 'schema', - name: 'config', - builder: 'untyped', - defaults: { - rootDir: '/project/' - } - } - ] -}) diff --git a/docs/package.json b/docs/package.json index 54cc5ad63d..d2d172e10f 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,10 +1,11 @@ { - "private": true, "name": "docs", + "private": true, "scripts": { "dev": "yarn gendocs && nuxt dev", "build": "yarn gendocs && nuxt generate --force-build", - "gendocs": "unbuild && jiti ./scripts/gen-docs.ts" + "build:ci": "yarn add @nuxt/kit@npm:@nuxt/kit-edge && yarn build", + "gendocs": "jiti ./scripts/gen-docs.ts" }, "devDependencies": { "@docus/app": "^1.1.3", @@ -12,13 +13,13 @@ "@docus/social-image": "^1.0.3", "@docus/theme": "^1.1.3", "@docus/twitter": "^1.0.4", + "@nuxt/kit": "link:../packages/kit", "@nuxt/typescript-build": "^2.1.0", "fs-extra": "^10.0.0", "jiti": "^1.11.0", "mkdirp": "^1.0.4", "rimraf": "^3.0.2", "scule": "^0.2.1", - "unbuild": "^0.4.2", "untyped": "^0.2.8", "upath": "^2.0.1" } diff --git a/docs/scripts/gen-docs.ts b/docs/scripts/gen-docs.ts index 3b40724612..287e006c49 100644 --- a/docs/scripts/gen-docs.ts +++ b/docs/scripts/gen-docs.ts @@ -111,7 +111,7 @@ async function generateDocs ({ outDir }) { await rm(outDir, { recursive: true }).catch(() => {}) await mkdirp(outDir) - const rootSchema = require('../schema/config.schema.json') as Schema + const rootSchema = require('@nuxt/kit/schema/config.schema.json') as Schema const keys = Object.keys(rootSchema.properties).sort() let ctor = 1 diff --git a/docs/yarn.lock b/docs/yarn.lock index 54ff214492..4bf89b90a2 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -1462,6 +1462,10 @@ untyped "^0.2.5" upath "^2.0.1" +"@nuxt/kit@link:../packages/kit": + version "0.0.0" + uid "" + "@nuxt/loading-screen@^2.0.4": version "2.0.4" resolved "https://registry.yarnpkg.com/@nuxt/loading-screen/-/loading-screen-2.0.4.tgz#756abd861f77c57001be4d21d47534723afb4f3a" @@ -5626,6 +5630,11 @@ hookable@^4.4.1: resolved "https://registry.yarnpkg.com/hookable/-/hookable-4.4.1.tgz#3d7154ac7e1f6f147e50fef583832f2645b9f04f" integrity sha512-KWjZM8C7IVT2qne5HTXjM6R6VnRfjfRlf/oCnHd+yFxoHO1DzOl6B9LzV/VqGQK/IrFewq+EG+ePVrE9Tpc3fg== +hookable@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/hookable/-/hookable-5.0.0.tgz#bac6f1d4b56e3f590f21cfe3f813731372c0c69f" + integrity sha512-IqoJ8oXCNTUtNfqwbUQvLd+6ebVXk5qqGpSMOe4BS514vd4bEEH+hd9lva48mbbbe9q4eFKmsOViTZkr7ludHg== + hsl-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/hsl-regex/-/hsl-regex-1.0.0.tgz#d49330c789ed819e276a4c0d272dffa30b18fe6e" @@ -10690,6 +10699,11 @@ ufo@^0.7.5, ufo@^0.7.7: resolved "https://registry.yarnpkg.com/ufo/-/ufo-0.7.7.tgz#0062f9e5e790819b0fb23ca24d7c63a4011c036a" integrity sha512-N25aY3HBkJBnahm+2l4JRBBrX5I+JPakF/tDHYDTjd3wUR7iFLdyiPhj8mBwBz21v728BKwM9L9tgBfCntgdlw== +ufo@^0.7.9: + version "0.7.9" + resolved "https://registry.yarnpkg.com/ufo/-/ufo-0.7.9.tgz#0268e3734b413c9ed6f3510201f42372821b875c" + integrity sha512-6t9LrLk3FhqTS+GW3IqlITtfRB5JAVr5MMNjpBECfK827W+Vh5Ilw/LhTcHWrt6b3hkeBvcbjx4Ti7QVFzmcww== + uglify-js@^3.5.1: version "3.14.1" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.1.tgz#e2cb9fe34db9cb4cf7e35d1d26dfea28e09a7d06" @@ -10750,6 +10764,11 @@ unctx@^1.0.1: resolved "https://registry.yarnpkg.com/unctx/-/unctx-1.0.1.tgz#e976394f22ab00ac4088d86ebfc639861ed3ec24" integrity sha512-LTxBg2tHfEFwpiIGIM7MOODR1hPiO0njHRIbb6fpxL6czd/rkaSeWoaLAVUDP8qDF1Xvq/wO3Eyp4B8yogiObA== +unctx@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unctx/-/unctx-1.0.2.tgz#d8d9c83a0965aa277f61058c94548fcee6861e48" + integrity sha512-qxRfnQZWJqkg180JeOCJEvtjj5/7wnWVqkNHln8muY5/z8kMWBFqikFBPwIPCQrZJ+jtaSWkVHJkuHUAXls6zw== + unfetch@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/unfetch/-/unfetch-4.2.0.tgz#7e21b0ef7d363d8d9af0fb929a5555f6ef97a3be"