diff --git a/tests/test-elog/.gitignore b/tests/test-elog/.gitignore index 23f9dae8..2e841818 100644 --- a/tests/test-elog/.gitignore +++ b/tests/test-elog/.gitignore @@ -1,3 +1,3 @@ -docs -image -elog.cache.json +docs* +images* +elog.cache*.json diff --git a/tests/test-elog/elog.config-muti.ts b/tests/test-elog/elog.config-muti.ts new file mode 100644 index 00000000..cd9c2fa7 --- /dev/null +++ b/tests/test-elog/elog.config-muti.ts @@ -0,0 +1,63 @@ +import { defineConfig } from '@elogx-test/elog'; +import fromYuque from '@elogx-test/plugin-from-yuque'; +import toLocal from '@elogx-test/plugin-to-local'; +import imageLocal from '@elogx-test/plugin-image-local'; + +export default defineConfig([ + { + from: fromYuque({ + pwd: { + username: process.env.YUQUE_USERNAME, + password: process.env.YUQUE_PWD, + login: process.env.YUQUE_LOGIN, + repo: process.env.YUQUE_REPO, + onlyPublic: false, + linebreak: false, + cacheFilePath: 'elog.cache1.json', + }, + }), + to: [ + toLocal({ + outputDir: './docs1', + deployByStructure: true, + filename: 'title', + frontMatter: { enable: true }, + }), + ], + plugins: [ + imageLocal({ + outputDir: './images1', + // prefixKey: '../../images', + pathFollowDoc: { enable: true, docOutputDir: './docs1' }, + }), + ], + }, + { + from: fromYuque({ + pwd: { + username: process.env.YUQUE_USERNAME, + password: process.env.YUQUE_PWD, + login: process.env.YUQUE_LOGIN, + repo: process.env.YUQUE_REPO, + onlyPublic: false, + linebreak: false, + cacheFilePath: 'elog.cache2.json', + }, + }), + to: [ + toLocal({ + outputDir: './docs2', + deployByStructure: true, + filename: 'title', + frontMatter: { enable: true }, + }), + ], + plugins: [ + imageLocal({ + outputDir: './images2', + // prefixKey: '../../images', + pathFollowDoc: { enable: true, docOutputDir: './docs2' }, + }), + ], + }, +]); diff --git a/tests/test-elog/elog.config.ts b/tests/test-elog/elog.config.ts index df36902b..e2b33f7d 100644 --- a/tests/test-elog/elog.config.ts +++ b/tests/test-elog/elog.config.ts @@ -1,6 +1,7 @@ import { defineConfig } from '@elogx-test/elog'; import fromYuque from '@elogx-test/plugin-from-yuque'; import toLocal from '@elogx-test/plugin-to-local'; +import imageLocal from '@elogx-test/plugin-image-local'; export default defineConfig({ from: fromYuque({ @@ -26,5 +27,18 @@ export default defineConfig({ filename: 'title', frontMatter: { enable: true }, }), + toLocal({ + outputDir: './docs-new', + deployByStructure: true, + filename: 'title', + frontMatter: { enable: true }, + }), + ], + plugins: [ + imageLocal({ + outputDir: './images', + prefixKey: '../../images', + // pathFollowDoc: { enable: true, docOutputDir: './docs' }, + }), ], }); diff --git a/tests/test-elog/package.json b/tests/test-elog/package.json index 48dcb436..8aee9550 100644 --- a/tests/test-elog/package.json +++ b/tests/test-elog/package.json @@ -8,6 +8,7 @@ "elog:init-templ": "elog init --template yuque-local", "elog:init": "elog init", "elog:sync": "elog sync --env .elog.env", + "elog:sync-muti": "elog sync --env .elog.env --config elog.config-muti.ts --cache elog.cache-muti.json ", "elog:version": "elog --version", "elog": "elog" }, diff --git a/tests/test-elog/tsconfig.json b/tests/test-elog/tsconfig.json index cbfc4e6a..55f96561 100644 --- a/tests/test-elog/tsconfig.json +++ b/tests/test-elog/tsconfig.json @@ -5,7 +5,7 @@ "module": "ESNext", "moduleResolution": "Bundler", "strict": true, - "declaration": true, + "declaration": false, "noImplicitOverride": true, "noUnusedLocals": true, "esModuleInterop": true,