Skip to content

Commit

Permalink
test: test elog
Browse files Browse the repository at this point in the history
  • Loading branch information
LetTTGACO committed Apr 7, 2024
1 parent 6d9e0c4 commit 197f8b0
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/test-elog/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
docs
image
elog.cache.json
docs*
images*
elog.cache*.json
63 changes: 63 additions & 0 deletions tests/test-elog/elog.config-muti.ts
Original file line number Diff line number Diff line change
@@ -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' },
}),
],
},
]);
14 changes: 14 additions & 0 deletions tests/test-elog/elog.config.ts
Original file line number Diff line number Diff line change
@@ -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({
Expand All @@ -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' },
}),
],
});
1 change: 1 addition & 0 deletions tests/test-elog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
2 changes: 1 addition & 1 deletion tests/test-elog/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"module": "ESNext",
"moduleResolution": "Bundler",
"strict": true,
"declaration": true,
"declaration": false,
"noImplicitOverride": true,
"noUnusedLocals": true,
"esModuleInterop": true,
Expand Down

0 comments on commit 197f8b0

Please sign in to comment.