Skip to content

Commit

Permalink
updates dependencies and refactors source to ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
reverentgeek committed Nov 4, 2024
1 parent bb34982 commit 3878dcb
Show file tree
Hide file tree
Showing 23 changed files with 2,507 additions and 2,993 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.js

This file was deleted.

25 changes: 9 additions & 16 deletions bin/index.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,22 @@
#!/usr/bin/env node
"use strict";
import { execute } from "../src/cli.js";
import yargs from "yargs/yargs";
import { hideBin } from "yargs/helpers";

const yargs = require( "yargs" );
const cli = require( "../src/cli" );
const defaultPort = 8989;

const options = yargs
const config = yargs( hideBin( process.argv ) )
.usage( "Usage: $0 -f path/to/chordpro [-o path/to/file-or-folder]" )
.option( "f", { alias: "source", describe: "Path to file or folder of chordpro files to convert", type: "string", require: true } )
.option( "o", { alias: "out", describe: "Path to destination file. If none specified, the file will be saved in the same path as the chordpro file.", type: "string" } )
.option( "temp", { describe: "Specify path to temp folder for generating intermediate files.", type: "string" } )
.option( "html", { describe: "Save as HTML instead of PDF", type: "boolean" } )
.option( "columns", { describe: "Use two-column format", type: "boolean" } );
// .option( "wk", { describe: "Use wkhtmltopdf utility to convert to PDF (must be in your path)", type: "boolean" } );

const config = options.argv;
.option( "columns", { describe: "Use two-column format", type: "boolean" } )
.parse();

if ( isNaN( config.port ) ) {
config.port = defaultPort;
config.p = defaultPort;
}

cli.execute( config )
console.log( config );
execute( config )
.then( () => console.log( "finished" ) )
.catch( err => {
// options.showHelp();
console.log( err.message );
} );

12 changes: 12 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import rg from "eslint-config-reverentgeek";

export default [
...rg.configs[ "node-esm" ],
{
rules: {
"n/no-unpublished-import": [ "error", {
allowModules: [ "eslint-config-reverentgeek" ]
} ]
}
}
];
Loading

0 comments on commit 3878dcb

Please sign in to comment.