mirror of
https://github.com/10h30/wordpress-export-to-markdown.git
synced 2026-06-05 15:09:59 +09:00
Merge pull request #135 from lonekorean/update-deps-2025-01
Update deps
This commit is contained in:
+2
-2
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"es6": true
|
||||
"es6": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"globals": {
|
||||
|
||||
Generated
+738
-680
File diff suppressed because it is too large
Load Diff
+9
-9
@@ -17,22 +17,22 @@
|
||||
"author": "Will Boyd <will@codersblock.com> (https://codersblock.com)",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 12.14.0"
|
||||
"node": ">= 18.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.7.1",
|
||||
"camelcase": "^6.0.0",
|
||||
"chalk": "^4.0.0",
|
||||
"commander": "^5.0.0",
|
||||
"inquirer": "^7.1.0",
|
||||
"luxon": "^3.4.4",
|
||||
"axios": "^1.7.9",
|
||||
"camelcase": "^6.3.0",
|
||||
"chalk": "^4.1.2",
|
||||
"commander": "^13.0.0",
|
||||
"inquirer": "^8.2.6",
|
||||
"luxon": "^3.5.0",
|
||||
"require-directory": "^2.1.1",
|
||||
"turndown": "^7.1.2",
|
||||
"turndown": "^7.2.0",
|
||||
"turndown-plugin-gfm": "^1.0.2",
|
||||
"xml2js": "^0.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^6.8.0"
|
||||
"eslint": "^8.57.1"
|
||||
},
|
||||
"bin": {
|
||||
"wordpress-export-to-markdown": "./index.js"
|
||||
|
||||
+1
-1
@@ -176,7 +176,7 @@ function populateFrontmatter(posts) {
|
||||
posts.forEach(post => {
|
||||
const frontmatter = {};
|
||||
settings.frontmatter_fields.forEach(field => {
|
||||
[key, alias] = field.split(':');
|
||||
const [key, alias] = field.split(':');
|
||||
|
||||
let frontmatterGetter = frontmatterGetters[key];
|
||||
if (!frontmatterGetter) {
|
||||
|
||||
+8
-9
@@ -80,10 +80,10 @@ const options = [
|
||||
async function getConfig(argv) {
|
||||
extendOptionsData();
|
||||
const unaliasedArgv = replaceAliases(argv);
|
||||
const program = parseCommandLine(unaliasedArgv);
|
||||
const opts = parseCommandLine(unaliasedArgv);
|
||||
|
||||
let answers;
|
||||
if (program.wizard) {
|
||||
if (opts.wizard) {
|
||||
console.log('\nStarting wizard...');
|
||||
const questions = options.map(option => ({
|
||||
when: option.name !== 'wizard' && !option.isProvided,
|
||||
@@ -102,7 +102,7 @@ async function getConfig(argv) {
|
||||
answers = {};
|
||||
}
|
||||
|
||||
const config = { ...program.opts(), ...answers };
|
||||
const config = { ...opts, ...answers };
|
||||
return config;
|
||||
}
|
||||
|
||||
@@ -158,13 +158,11 @@ function replaceAliases(argv) {
|
||||
|
||||
function parseCommandLine(argv) {
|
||||
// setup for help output
|
||||
commander
|
||||
commander.program
|
||||
.name('node index.js')
|
||||
.version('v' + package.version, '-v, --version', 'Display version number')
|
||||
.helpOption('-h, --help', 'See the thing you\'re looking at right now')
|
||||
.on('--help', () => {
|
||||
console.log('\nMore documentation is at https://github.com/lonekorean/wordpress-export-to-markdown');
|
||||
});
|
||||
.addHelpText('after', '\nMore documentation is at https://github.com/lonekorean/wordpress-export-to-markdown');
|
||||
|
||||
options.forEach(input => {
|
||||
const flag = '--' + input.name + ' <' + input.type + '>';
|
||||
@@ -174,10 +172,11 @@ function parseCommandLine(argv) {
|
||||
input.isProvided = true;
|
||||
return input.coerce(value);
|
||||
};
|
||||
commander.option(flag, input.description, coerce, input.default);
|
||||
commander.program.option(flag, input.description, coerce, input.default);
|
||||
});
|
||||
|
||||
return commander.parse(argv);
|
||||
commander.program.parse(argv);
|
||||
return commander.program.opts();
|
||||
}
|
||||
|
||||
function coerceBoolean(value) {
|
||||
|
||||
Reference in New Issue
Block a user