diff --git a/cmds/clean/all.js b/cmds/clean/all.js index b8bcb90b..531de095 100644 --- a/cmds/clean/all.js +++ b/cmds/clean/all.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['all', 'everything']; -exports.desc = 'Do all cleaning tasks'; +import { e_call } from '../../src/util.js'; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'clean/all'); +export const command = ['all', 'everything']; +export const desc = 'Do all cleaning tasks'; + +export const handler = async (argv) => { + await e_call(argv, 'clean/all'); }; diff --git a/cmds/clean/autoloads.js b/cmds/clean/autoloads.js index 4a9dd766..1719e48e 100644 --- a/cmds/clean/autoloads.js +++ b/cmds/clean/autoloads.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['autoloads']; -exports.desc = 'Remove the generated autoloads file'; +import { e_call } from '../../src/util.js'; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'clean/autoloads', argv.dest); +export const command = ['autoloads']; +export const desc = 'Remove the generated autoloads file'; + +export const handler = async (argv) => { + await e_call(argv, 'clean/autoloads', argv.dest); }; diff --git a/cmds/clean/dist.js b/cmds/clean/dist.js index dc23a6c9..59428e25 100644 --- a/cmds/clean/dist.js +++ b/cmds/clean/dist.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['dist [destination]', 'distribution [destination]']; -exports.desc = 'Delete the dist directory where the build output is stored'; -exports.builder = yargs => yargs +import { e_call } from '../../src/util.js'; + +export const command = ['dist [destination]', 'distribution [destination]']; +export const desc = 'Delete the dist directory where the build output is stored'; +export const builder = yargs => yargs .positional( 'destination', { description: 'destination path/folder to clean up', @@ -27,6 +29,6 @@ exports.builder = yargs => yargs type: 'string', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'clean/dist', argv.dest); +export const handler = async (argv) => { + await e_call(argv, 'clean/dist', argv.dest); }; diff --git a/cmds/clean/elc.js b/cmds/clean/elc.js index 4c8efaf3..d1a12db9 100644 --- a/cmds/clean/elc.js +++ b/cmds/clean/elc.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['elc']; -exports.desc = 'Remove byte compiled files generated by eask compile'; +import { e_call } from '../../src/util.js'; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'clean/elc'); +export const command = ['elc']; +export const desc = 'Remove byte compiled files generated by eask compile'; + +export const handler = async (argv) => { + await e_call(argv, 'clean/elc'); }; diff --git a/cmds/clean/log-file.js b/cmds/clean/log-file.js index 9b3ba74d..07bb2191 100644 --- a/cmds/clean/log-file.js +++ b/cmds/clean/log-file.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['log-file']; -exports.desc = 'Remove all generated log files'; +import { e_call } from '../../src/util.js'; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'clean/log-file'); +export const command = ['log-file']; +export const desc = 'Remove all generated log files'; + +export const handler = async (argv) => { + await e_call(argv, 'clean/log-file'); }; diff --git a/cmds/clean/pkg-file.js b/cmds/clean/pkg-file.js index 88b50357..9f4ef233 100644 --- a/cmds/clean/pkg-file.js +++ b/cmds/clean/pkg-file.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['pkg-file']; -exports.desc = 'Remove the generated pkg-file'; +import { e_call } from '../../src/util.js'; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'clean/pkg-file'); +export const command = ['pkg-file']; +export const desc = 'Remove the generated pkg-file'; + +export const handler = async (argv) => { + await e_call(argv, 'clean/pkg-file'); }; diff --git a/cmds/clean/workspace.js b/cmds/clean/workspace.js index c7027af3..377991f7 100644 --- a/cmds/clean/workspace.js +++ b/cmds/clean/workspace.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['workspace', '.eask']; -exports.desc = 'Clean up the .eask directory'; +import { e_call } from '../../src/util.js'; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'clean/workspace'); +export const command = ['workspace', '.eask']; +export const desc = 'Clean up the .eask directory'; + +export const handler = async (argv) => { + await e_call(argv, 'clean/workspace'); }; diff --git a/cmds/core/analyze.js b/cmds/core/analyze.js index 6209a42b..b49c6aea 100644 --- a/cmds/core/analyze.js +++ b/cmds/core/analyze.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['analyze [files..]']; -exports.desc = 'Run Eask checker'; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, def_flag } from '../../src/util.js'; + +export const command = ['analyze [files..]']; +export const desc = 'Run Eask checker'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'specify Eask-files for checker to lint', @@ -39,9 +42,9 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/analyze' - , argv.files - , UTIL.def_flag(argv.json, '--json') - , UTIL.def_flag(argv.output, '--output', argv.output)); +export const handler = async (argv) => { + await e_call(argv, 'core/analyze' + , argv.files + , def_flag(argv.json, '--json') + , def_flag(argv.output, '--output', argv.output)); }; diff --git a/cmds/core/archives.js b/cmds/core/archives.js index 3f20e2d5..0ee92b08 100644 --- a/cmds/core/archives.js +++ b/cmds/core/archives.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['archives', 'sources']; -exports.desc = 'List out all package archives'; +import { e_call } from '../../src/util.js'; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/archives'); +export const command = ['archives', 'sources']; +export const desc = 'List out all package archives'; + +export const handler = async (argv) => { + await e_call(argv, 'core/archives'); }; diff --git a/cmds/core/bump.js b/cmds/core/bump.js index 156f6797..834e9f32 100644 --- a/cmds/core/bump.js +++ b/cmds/core/bump.js @@ -17,16 +17,18 @@ "use strict"; -exports.command = ['bump [levels..]']; -exports.desc = UTIL.hide_cmd('Bump version for your project'); -exports.builder = yargs => yargs +import { e_call, hide_cmd } from '../../src/util.js'; + +export const command = ['bump [levels..]']; +export const desc = hide_cmd('Bump version for your project'); +export const builder = yargs => yargs .positional( '[levels..]', { description: "version level to bump; accept `major', `minor' or `patch'", type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/bump' - , argv.levels); +export const handler = async (argv) => { + await e_call(argv, 'core/bump' + , argv.levels); }; diff --git a/cmds/core/cat.js b/cmds/core/cat.js index 52d0cb47..20ed1036 100644 --- a/cmds/core/cat.js +++ b/cmds/core/cat.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['cat ', 'type ']; -exports.desc = UTIL.hide_cmd('View filename(s)'); -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, hide_cmd, def_flag } from '../../src/util.js'; + +export const command = ['cat ', 'type ']; +export const desc = hide_cmd('View filename(s)'); +export const builder = yargs => yargs .positional( '', { description: 'patterns you want to search (wildcard)', @@ -35,8 +38,8 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/cat' - , argv.patterns - , UTIL.def_flag(argv.number, '--number')); +export const handler = async (argv) => { + await e_call(argv, 'core/cat' + , argv.patterns + , def_flag(argv.number, '--number')); }; diff --git a/cmds/core/clean.js b/cmds/core/clean.js index 36e9cfd8..2aa4a952 100644 --- a/cmds/core/clean.js +++ b/cmds/core/clean.js @@ -17,17 +17,22 @@ "use strict"; -exports.command = ['clean ']; -exports.desc = 'Delete various files produced during building'; -exports.builder = function (yargs) { - yargs.usage(`${exports.desc} +import path from 'path'; +import { cmd_count } from '../../src/util.js'; + +const __dirname = import.meta.dirname; + +export const command = ['clean ']; +export const desc = 'Delete various files produced during building'; +export const builder = function (yargs) { + yargs.usage(`${desc} Usage: eask clean [options..]`) - .commandDir('../clean/') + .commandDir(path.join(__dirname, '../clean/')) .demandCommand(); /* XXX: Configure only in the menu. */ - if (UTIL.cmd_count() == 1) { + if (cmd_count() == 1) { yargs.positional( '', { description: 'type of the cleaning task', @@ -35,4 +40,4 @@ Usage: eask clean [options..]`) } } -exports.handler = async (argv) => { }; +export const handler = async (argv) => { }; diff --git a/cmds/core/compile.js b/cmds/core/compile.js index 4ffa3326..d388fcc1 100644 --- a/cmds/core/compile.js +++ b/cmds/core/compile.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['compile [names..]']; -exports.desc = "Byte-compile `.el' files"; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, def_flag } from '../../src/util.js'; + +export const command = ['compile [names..]']; +export const desc = "Byte-compile `.el' files"; +export const builder = yargs => yargs .positional( '[names..]', { description: 'specify files to byte-compile', @@ -33,8 +36,8 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/compile' +export const handler = async (argv) => { + await e_call(argv, 'core/compile' , argv.names - , UTIL.def_flag(argv.clean, '--clean')); + , def_flag(argv.clean, '--clean')); }; diff --git a/cmds/core/concat.js b/cmds/core/concat.js index f6d164ed..a2318b27 100644 --- a/cmds/core/concat.js +++ b/cmds/core/concat.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['concat [names..]', 'concatenate [names..]']; -exports.desc = UTIL.hide_cmd('Concatenate elisp files'); -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, hide_cmd, def_flag } from '../../src/util.js'; + +export const command = ['concat [names..]', 'concatenate [names..]']; +export const desc = hide_cmd('Concatenate elisp files'); +export const builder = yargs => yargs .positional( '[names..]', { description: 'specify files to concatenate', @@ -41,9 +44,9 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/concat' - , argv.names - , UTIL.def_flag(argv.dest, '--dest', argv.dest) - , UTIL.def_flag(argv.output, '--output', argv.output)); +export const handler = async (argv) => { + await e_call(argv, 'core/concat' + , argv.names + , def_flag(argv.dest, '--dest', argv.dest) + , def_flag(argv.output, '--output', argv.output)); }; diff --git a/cmds/core/create.js b/cmds/core/create.js index c91b3d4e..4a4526cc 100644 --- a/cmds/core/create.js +++ b/cmds/core/create.js @@ -17,17 +17,22 @@ "use strict"; -exports.command = ['create ']; -exports.desc = 'Create a new elisp project'; -exports.builder = function (yargs) { - yargs.usage(`${exports.desc} +import path from 'path'; +import { cmd_count } from '../../src/util.js'; + +const __dirname = import.meta.dirname; + +export const command = ['create ']; +export const desc = 'Create a new elisp project'; +export const builder = function (yargs) { + yargs.usage(`${desc} Usage: eask create [options..]`) - .commandDir('../create/') + .commandDir(path.join(__dirname, '../create/')) .demandCommand(); /* XXX: Configure only in the menu. */ - if (UTIL.cmd_count() == 1) { + if (cmd_count() == 1) { yargs.positional( '', { description: 'type of the creation', @@ -35,4 +40,4 @@ Usage: eask create [options..]`) } } -exports.handler = async (argv) => { }; +export const handler = async (argv) => { }; diff --git a/cmds/core/docker.js b/cmds/core/docker.js index 0ab6552e..80c5ce49 100644 --- a/cmds/core/docker.js +++ b/cmds/core/docker.js @@ -17,12 +17,13 @@ "use strict"; -const path = require('path'); -const child_process = require("child_process"); +import path from 'path'; +import child_process from "child_process"; +import { which, cli_args, slash } from '../../src/util.js'; -exports.command = ['docker [args..]']; -exports.desc = 'Launch specified Emacs version in a Docker container'; -exports.builder = async (yargs) => { +export const command = ['docker [args..]']; +export const desc = 'Launch specified Emacs version in a Docker container'; +export const builder = async (yargs) => { yargs.help(false); yargs.version(false); yargs.getOptions().narg = []; @@ -33,8 +34,8 @@ exports.builder = async (yargs) => { }); }; -exports.handler = async (argv) => { - if (!UTIL.which('docker')) { +export const handler = async (argv) => { + if (!which('docker')) { console.warn("Docker is not installed (cannot find `docker' executable)"); return; } @@ -67,7 +68,7 @@ exports.handler = async (argv) => { let cmd = default_cmd.concat(rest); - let proc = child_process.spawn(UTIL.cli_args(cmd), { stdio: 'inherit', shell: true }); + let proc = child_process.spawn(cli_args(cmd), { stdio: 'inherit', shell: true }); proc.on('close', function (code) { if (code == 0) return; @@ -80,7 +81,7 @@ exports.handler = async (argv) => { * @param { String } path - Path to convert. */ function convert_path(path) { - return UTIL.slash(path).replaceAll(':', ''); + return slash(path).replaceAll(':', ''); } /** diff --git a/cmds/core/docs.js b/cmds/core/docs.js index 7bb2b9bf..bec1f7c2 100644 --- a/cmds/core/docs.js +++ b/cmds/core/docs.js @@ -17,17 +17,22 @@ "use strict"; -exports.command = ['docs ', 'doc ']; -exports.desc = 'Build documentation'; -exports.builder = function (yargs) { - yargs.usage(`${exports.desc} +import path from 'path'; +import { cmd_count } from '../../src/util.js'; + +const __dirname = import.meta.dirname; + +export const command = ['docs ', 'doc ']; +export const desc = 'Build documentation'; +export const builder = function (yargs) { + yargs.usage(`${desc} Usage: eask docs [options..]`) - .commandDir('../docs/') + .commandDir(path.join(__dirname, '../docs/')) .demandCommand(); /* XXX: Configure only in the menu. */ - if (UTIL.cmd_count() == 1) { + if (cmd_count() == 1) { yargs.positional( '', { description: 'type of the generator', @@ -35,4 +40,4 @@ Usage: eask docs [options..]`) } } -exports.handler = async (argv) => { }; +export const handler = async (argv) => { }; diff --git a/cmds/core/emacs.js b/cmds/core/emacs.js index 53f350be..bd8777ae 100644 --- a/cmds/core/emacs.js +++ b/cmds/core/emacs.js @@ -17,26 +17,28 @@ "use strict"; -const child_process = require("child_process"); +import child_process from "child_process"; +import { EASK_EMACS } from '../../src/env.js'; +import { el_script, setup_env, cli_args, take_after } from '../../src/util.js'; -exports.command = ['emacs [args..]']; -exports.desc = 'Execute emacs with the appropriate environment'; -exports.builder = async (yargs) => { +export const command = ['emacs [args..]']; +export const desc = 'Execute emacs with the appropriate environment'; +export const builder = async (yargs) => { yargs.help(false); yargs.version(false); yargs.getOptions().narg = []; yargs.strict(false); }; -exports.handler = async (argv) => { - let s_path = UTIL.el_script('core/emacs'); +export const handler = async (argv) => { + let s_path = el_script('core/emacs'); let default_cmd = [EASK_EMACS, '-Q', '-l', s_path]; - let rest = UTIL.take_after(process.argv, EASK_EMACS); + let rest = take_after(process.argv, EASK_EMACS); let cmd = default_cmd.concat(rest); - UTIL.setup_env(); - let proc = child_process.spawn(UTIL.cli_args(cmd), { stdio: 'inherit', shell: true }); + setup_env(); + let proc = child_process.spawn(cli_args(cmd), { stdio: 'inherit', shell: true }); proc.on('close', function (code) { if (code == 0) return; diff --git a/cmds/core/eval.js b/cmds/core/eval.js index 82e394b8..e10ada6c 100644 --- a/cmds/core/eval.js +++ b/cmds/core/eval.js @@ -17,20 +17,22 @@ "use strict"; -const fs = require('fs'); -const child_process = require("child_process"); +import fs from 'fs'; +import child_process from "child_process"; +import { EASK_HOMEDIR } from "../../src/env.js"; +import { e_call, cli_args } from '../../src/util.js'; -exports.command = ['eval [form]']; -exports.desc = 'Evaluate lisp form with a proper PATH'; -exports.builder = yargs => yargs +export const command = ['eval [form]']; +export const desc = 'Evaluate lisp form with a proper PATH'; +export const builder = yargs => yargs .positional( '[form]', { description: 'lisp form', type: 'string', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/eval', argv.form); +export const handler = async (argv) => { + await e_call(argv, 'core/eval', argv.form); if (!fs.existsSync(EASK_HOMEDIR)) { return; @@ -53,7 +55,7 @@ exports.handler = async (argv) => { let cmd = ['emacs', '--batch', '--eval', argv.form]; - let proc = child_process.spawn(UTIL.cli_args(cmd), { stdio: 'inherit', shell: true }); + let proc = child_process.spawn(cli_args(cmd), { stdio: 'inherit', shell: true }); proc.on('close', function (code) { if (code == 0) return; diff --git a/cmds/core/exec-path.js b/cmds/core/exec-path.js index e6e28fec..4967ec8f 100644 --- a/cmds/core/exec-path.js +++ b/cmds/core/exec-path.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['path [patterns..]', 'exec-path [patterns..]']; -exports.desc = 'Print the PATH (exec-path) from workspace'; -exports.builder = yargs => yargs +import { e_call } from '../../src/util.js'; + +export const command = ['path [patterns..]', 'exec-path [patterns..]']; +export const desc = 'Print the PATH (exec-path) from workspace'; +export const builder = yargs => yargs .positional( '[patterns..]', { description: 'patterns you want to search (regex)', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/exec-path', argv.patterns); +export const handler = async (argv) => { + await e_call(argv, 'core/exec-path', argv.patterns); }; diff --git a/cmds/core/exec.js b/cmds/core/exec.js index f791d14a..e4bfee7f 100644 --- a/cmds/core/exec.js +++ b/cmds/core/exec.js @@ -17,22 +17,24 @@ "use strict"; -const fs = require('fs'); -const child_process = require("child_process"); - -exports.command = ['exec [args..]']; -exports.desc = 'Execute command with correct environment PATH set up'; -exports.builder = async (yargs) => { +import fs from 'fs'; +import child_process from "child_process"; +import { EASK_HOMEDIR } from "../../src/env.js"; +import { e_call, cli_args, take_after } from '../../src/util.js'; + +export const command = ['exec [args..]']; +export const desc = 'Execute command with correct environment PATH set up'; +export const builder = async (yargs) => { yargs.help(false); yargs.version(false); yargs.getOptions().narg = []; yargs.strict(false); }; -exports.handler = async (argv) => { - let cmd = UTIL.take_after(process.argv, 'exec'); +export const handler = async (argv) => { + let cmd = take_after(process.argv, 'exec'); - await UTIL.e_call(argv, 'core/exec', '--', cmd); + await e_call(argv, 'core/exec', '--', cmd); if (cmd.length == 0) { return; @@ -52,7 +54,7 @@ exports.handler = async (argv) => { process.env.PATH = fs.readFileSync(epf, 'utf8'); process.env.EMACSLOADPATH = fs.readFileSync(lpf, 'utf8'); - let proc = child_process.spawn(UTIL.cli_args(cmd), { stdio: 'inherit', shell: true }); + let proc = child_process.spawn(cli_args(cmd), { stdio: 'inherit', shell: true }); proc.on('close', function (code) { if (code == 0) return; diff --git a/cmds/core/files.js b/cmds/core/files.js index 8a34ea46..1a7219a8 100644 --- a/cmds/core/files.js +++ b/cmds/core/files.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['files [patterns..]']; -exports.desc = 'Print all package files'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['files [patterns..]']; +export const desc = 'Print all package files'; +export const builder = yargs => yargs .positional( '[patterns..]', { description: 'patterns you want to search (wildcard)', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/files', argv.patterns); +export const handler = async (argv) => { + await e_call(argv, 'core/files', argv.patterns); }; diff --git a/cmds/core/format.js b/cmds/core/format.js index 99cf8792..61a91a42 100644 --- a/cmds/core/format.js +++ b/cmds/core/format.js @@ -17,17 +17,22 @@ "use strict"; -exports.command = ['format ', 'fmt ']; -exports.desc = 'Run formatters'; -exports.builder = function (yargs) { - yargs.usage(`${exports.desc} +import path from 'path'; +import { cmd_count } from '../../src/util.js'; + +const __dirname = import.meta.dirname; + +export const command = ['format ', 'fmt ']; +export const desc = 'Run formatters'; +export const builder = function (yargs) { + yargs.usage(`${desc} Usage: eask format [options..]`) - .commandDir('../format/') + .commandDir(path.join(__dirname, '../format/')) .demandCommand(); /* XXX: Configure only in the menu. */ - if (UTIL.cmd_count() == 1) { + if (cmd_count() == 1) { yargs.positional( '', { description: 'type of the formatter', @@ -35,4 +40,4 @@ Usage: eask format [options..]`) } } -exports.handler = async (argv) => { }; +export const handler = async (argv) => { }; diff --git a/cmds/core/generate.js b/cmds/core/generate.js index e3e0025f..9e1ec3cb 100644 --- a/cmds/core/generate.js +++ b/cmds/core/generate.js @@ -17,17 +17,22 @@ "use strict"; -exports.command = ['generate ']; -exports.desc = 'Generate files that are used for the development'; -exports.builder = function (yargs) { - yargs.usage(`${exports.desc} +import path from 'path'; +import { cmd_count } from '../../src/util.js'; + +const __dirname = import.meta.dirname; + +export const command = ['generate ']; +export const desc = 'Generate files that are used for the development'; +export const builder = function (yargs) { + yargs.usage(`${desc} Usage: eask generate [options..]`) - .commandDir('../generate/') + .commandDir(path.join(__dirname, '../generate/')) .demandCommand(); /* XXX: Configure only in the menu. */ - if (UTIL.cmd_count() == 1) { + if (cmd_count() == 1) { yargs.positional( '', { description: 'type of the file', @@ -35,4 +40,4 @@ Usage: eask generate [options..]`) } } -exports.handler = async (argv) => { }; +export const handler = async (argv) => { }; diff --git a/cmds/core/info.js b/cmds/core/info.js index d5886d2d..61b8cf55 100644 --- a/cmds/core/info.js +++ b/cmds/core/info.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['info']; -exports.desc = 'Display information about the current package'; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/info'); +export const command = ['info']; +export const desc = 'Display information about the current package'; + +export const handler = async (argv) => { + await e_call(argv, 'core/info'); }; diff --git a/cmds/core/init.js b/cmds/core/init.js index 9045c58a..0aa88525 100644 --- a/cmds/core/init.js +++ b/cmds/core/init.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['init [files..]']; -exports.desc = 'Initialize project to use Eask'; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, def_flag } from "../../src/util.js"; + +export const command = ['init [files..]']; +export const desc = 'Initialize project to use Eask'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'files to use with `--from` flag', @@ -34,15 +37,15 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { +export const handler = async (argv) => { if (argv.from) { switch (argv.from) { case 'cask': case 'eldev': case 'keg': case 'source': - await UTIL.e_call(argv, 'init/' + argv.from - , UTIL.def_flag(argv.from, '--from', argv.from) + await e_call(argv, 'init/' + argv.from + , def_flag(argv.from, '--from', argv.from) , argv.files); break; default: @@ -50,6 +53,6 @@ exports.handler = async (argv) => { break; } } else { - await UTIL.e_call(argv, 'core/init'); + await e_call(argv, 'core/init'); } }; diff --git a/cmds/core/install-deps.js b/cmds/core/install-deps.js index 1172f2a3..271ce652 100644 --- a/cmds/core/install-deps.js +++ b/cmds/core/install-deps.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['install-deps', 'install-dependencies', 'prepare']; -exports.desc = 'Automatically install package dependencies'; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, def_flag } from "../../src/util.js"; + +export const command = ['install-deps', 'install-dependencies', 'prepare']; +export const desc = 'Automatically install package dependencies'; +export const builder = yargs => yargs .options({ 'development': { description: 'also install development dependencies', @@ -29,7 +32,7 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/install-deps' - , UTIL.def_flag(argv.development, '--dev')); +export const handler = async (argv) => { + await e_call(argv, 'core/install-deps' + , def_flag(argv.development, '--dev')); }; diff --git a/cmds/core/install-file.js b/cmds/core/install-file.js index 303c8204..e5204bd7 100644 --- a/cmds/core/install-file.js +++ b/cmds/core/install-file.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['install-file [files..]']; -exports.desc = 'Install packages from files, .tar files, or directories'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['install-file [files..]']; +export const desc = 'Install packages from files, .tar files, or directories'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'files to install as packages', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/install-file', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'core/install-file', argv.files); }; diff --git a/cmds/core/install-vc.js b/cmds/core/install-vc.js index d7a1df67..f9734c80 100644 --- a/cmds/core/install-vc.js +++ b/cmds/core/install-vc.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['install-vc [specs..]']; -exports.desc = 'Fetch and install packages directly via version control'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['install-vc [specs..]']; +export const desc = 'Fetch and install packages directly via version control'; +export const builder = yargs => yargs .positional( '[specs..]', { description: 'vc specification to install as packages', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/install-vc', argv.specs); +export const handler = async (argv) => { + await e_call(argv, 'core/install-vc', argv.specs); }; diff --git a/cmds/core/install.js b/cmds/core/install.js index 27799baf..91b8f664 100644 --- a/cmds/core/install.js +++ b/cmds/core/install.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['install [names..]']; -exports.desc = 'Install packages from archives or install from the workspace'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['install [names..]']; +export const desc = 'Install packages from archives or install from the workspace'; +export const builder = yargs => yargs .positional( '[names..]', { description: 'packages to install', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/install', argv.names); +export const handler = async (argv) => { + await e_call(argv, 'core/install', argv.names); }; diff --git a/cmds/core/keywords.js b/cmds/core/keywords.js index 32a1431d..9c55fb71 100644 --- a/cmds/core/keywords.js +++ b/cmds/core/keywords.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['keywords']; -exports.desc = 'Display the available keywords for use in the header section'; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/keywords'); +export const command = ['keywords']; +export const desc = 'Display the available keywords for use in the header section'; + +export const handler = async (argv) => { + await e_call(argv, 'core/keywords'); }; diff --git a/cmds/core/link.js b/cmds/core/link.js index 37a429fe..66cbab74 100644 --- a/cmds/core/link.js +++ b/cmds/core/link.js @@ -17,17 +17,22 @@ "use strict"; -exports.command = ['link ']; -exports.desc = 'Manage links'; -exports.builder = function (yargs) { - yargs.usage(`${exports.desc} +import path from 'path'; +import { cmd_count } from '../../src/util.js'; + +const __dirname = import.meta.dirname; + +export const command = ['link ']; +export const desc = 'Manage links'; +export const builder = function (yargs) { + yargs.usage(`${desc} Usage: eask link [options..]`) - .commandDir('../link/') + .commandDir(path.join(__dirname, '../link/')) .demandCommand(); /* XXX: Configure only in the menu. */ - if (UTIL.cmd_count() == 1) { + if (cmd_count() == 1) { yargs.positional( '', { description: 'type of link action', @@ -35,4 +40,4 @@ Usage: eask link [options..]`) } } -exports.handler = async (argv) => { }; +export const handler = async (argv) => { }; diff --git a/cmds/core/lint.js b/cmds/core/lint.js index 6772d13a..4ee38fd2 100644 --- a/cmds/core/lint.js +++ b/cmds/core/lint.js @@ -17,17 +17,22 @@ "use strict"; -exports.command = ['lint ']; -exports.desc = 'Run linters'; -exports.builder = function (yargs) { - yargs.usage(`${exports.desc} +import path from 'path'; +import { cmd_count } from '../../src/util.js'; + +const __dirname = import.meta.dirname; + +export const command = ['lint ']; +export const desc = 'Run linters'; +export const builder = function (yargs) { + yargs.usage(`${desc} Usage: eask lint [options..]`) - .commandDir('../lint/') + .commandDir(path.join(__dirname, '../lint/')) .demandCommand(); /* XXX: Configure only in the menu. */ - if (UTIL.cmd_count() == 1) { + if (cmd_count() == 1) { yargs.positional( '', { description: 'type of the linter', @@ -35,4 +40,4 @@ Usage: eask lint [options..]`) } } -exports.handler = async (argv) => { }; +export const handler = async (argv) => { }; diff --git a/cmds/core/list.js b/cmds/core/list.js index b98429b9..cdd93f77 100644 --- a/cmds/core/list.js +++ b/cmds/core/list.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['list']; -exports.desc = 'List all installed packages in dependency tree form'; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, def_flag } from "../../src/util.js"; + +export const command = ['list']; +export const desc = 'List all installed packages in dependency tree form'; +export const builder = yargs => yargs .options({ 'depth': { description: 'dependency depth level to print', @@ -29,7 +32,7 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/list' - , UTIL.def_flag(argv.depth, '--depth', argv.depth)); +export const handler = async (argv) => { + await e_call(argv, 'core/list' + , def_flag(argv.depth, '--depth', argv.depth)); }; diff --git a/cmds/core/load-path.js b/cmds/core/load-path.js index fe21eefa..8746d0b5 100644 --- a/cmds/core/load-path.js +++ b/cmds/core/load-path.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['load-path [patterns..]']; -exports.desc = 'Print the load-path from workspace'; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call } from "../../src/util.js"; + +export const command = ['load-path [patterns..]']; +export const desc = 'Print the load-path from workspace'; +export const builder = yargs => yargs .positional( '[patterns..]', { description: 'patterns you want to search (regex)', @@ -28,6 +31,6 @@ exports.builder = yargs => yargs group: TITLE_CMD_OPTION, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/load-path', argv.patterns); +export const handler = async (argv) => { + await e_call(argv, 'core/load-path', argv.patterns); }; diff --git a/cmds/core/load.js b/cmds/core/load.js index 8d7f2950..1fd8db29 100644 --- a/cmds/core/load.js +++ b/cmds/core/load.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['load [files..]']; -exports.desc = 'Load elisp files'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['load [files..]']; +export const desc = 'Load elisp files'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'files to load', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/load', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'core/load', argv.files); }; diff --git a/cmds/core/loc.js b/cmds/core/loc.js index 1badbb2b..02b500b0 100644 --- a/cmds/core/loc.js +++ b/cmds/core/loc.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['loc [files..]']; -exports.desc = UTIL.hide_cmd('Print LOC information'); -exports.builder = yargs => yargs +import { e_call, hide_cmd } from "../../src/util.js"; + +export const command = ['loc [files..]']; +export const desc = hide_cmd('Print LOC information'); +export const builder = yargs => yargs .positional( '[files..]', { description: 'files to print LOC information', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/loc', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'core/loc', argv.files); }; diff --git a/cmds/core/outdated.js b/cmds/core/outdated.js index 4d403cba..3aa7809a 100644 --- a/cmds/core/outdated.js +++ b/cmds/core/outdated.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['outdated']; -exports.desc = 'Show all outdated dependencies'; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call } from "../../src/util.js"; + +export const command = ['outdated']; +export const desc = 'Show all outdated dependencies'; +export const builder = yargs => yargs .options({ 'depth': { description: 'dependency depth level to print', @@ -29,6 +32,6 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/outdated'); +export const handler = async (argv) => { + await e_call(argv, 'core/outdated'); }; diff --git a/cmds/core/package-directory.js b/cmds/core/package-directory.js index 5f805678..1ca2f62d 100644 --- a/cmds/core/package-directory.js +++ b/cmds/core/package-directory.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['package-directory']; -exports.desc = 'Print the path to package directory'; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/package-directory'); +export const command = ['package-directory']; +export const desc = 'Print the path to package directory'; + +export const handler = async (argv) => { + await e_call(argv, 'core/package-directory'); }; diff --git a/cmds/core/package.js b/cmds/core/package.js index b787cb45..a654cef6 100644 --- a/cmds/core/package.js +++ b/cmds/core/package.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['package [destination]', 'pack [destination]']; -exports.desc = 'Build a package artifact, and put it into the given destination'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['package [destination]', 'pack [destination]']; +export const desc = 'Build a package artifact, and put it into the given destination'; +export const builder = yargs => yargs .positional( 'destination', { description: 'destination path/folder', @@ -27,6 +29,6 @@ exports.builder = yargs => yargs type: 'string', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/package', argv.dest); +export const handler = async (argv) => { + await e_call(argv, 'core/package', argv.dest); }; diff --git a/cmds/core/recipe.js b/cmds/core/recipe.js index cab4691e..1b1059ad 100644 --- a/cmds/core/recipe.js +++ b/cmds/core/recipe.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['recipe']; -exports.desc = 'Suggest a recipe format'; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/recipe'); +export const command = ['recipe']; +export const desc = 'Suggest a recipe format'; + +export const handler = async (argv) => { + await e_call(argv, 'core/recipe'); }; diff --git a/cmds/core/recompile.js b/cmds/core/recompile.js index b820616b..1be56fa8 100644 --- a/cmds/core/recompile.js +++ b/cmds/core/recompile.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['recompile [names..]']; -exports.desc = "Byte-recompile `.el' files"; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, def_flag } from "../../src/util.js"; + +export const command = ['recompile [names..]']; +export const desc = "Byte-recompile `.el' files"; +export const builder = yargs => yargs .positional( '[names..]', { description: 'specify files to byte-compile', @@ -33,8 +36,8 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/recompile' - , argv.names - , UTIL.def_flag(argv.clean, '--clean')); +export const handler = async (argv) => { + await e_call(argv, 'core/recompile' + , argv.names + , def_flag(argv.clean, '--clean')); }; diff --git a/cmds/core/refresh.js b/cmds/core/refresh.js index e6867d95..912b6521 100644 --- a/cmds/core/refresh.js +++ b/cmds/core/refresh.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['refresh']; -exports.desc = 'Download descriptions of all configured package archives'; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/refresh'); +export const command = ['refresh']; +export const desc = 'Download descriptions of all configured package archives'; + +export const handler = async (argv) => { + await e_call(argv, 'core/refresh'); }; diff --git a/cmds/core/reinstall.js b/cmds/core/reinstall.js index f50ffdb0..8cfcecbc 100644 --- a/cmds/core/reinstall.js +++ b/cmds/core/reinstall.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['reinstall [names..]']; -exports.desc = 'Reinstall packages from archives'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['reinstall [names..]']; +export const desc = 'Reinstall packages from archives'; +export const builder = yargs => yargs .positional( '[names..]', { description: 'packages to reinstall', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/reinstall', argv.names); +export const handler = async (argv) => { + await e_call(argv, 'core/reinstall', argv.names); }; diff --git a/cmds/core/repl.js b/cmds/core/repl.js index e76f12d4..305a9660 100644 --- a/cmds/core/repl.js +++ b/cmds/core/repl.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['repl', 'ielm']; -exports.desc = UTIL.hide_cmd('Start an Elisp REPL'); +import { e_call, hide_cmd } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/repl'); +export const command = ['repl', 'ielm']; +export const desc = hide_cmd('Start an Elisp REPL'); + +export const handler = async (argv) => { + await e_call(argv, 'core/repl'); }; diff --git a/cmds/core/run.js b/cmds/core/run.js index cff20ebf..59003a52 100644 --- a/cmds/core/run.js +++ b/cmds/core/run.js @@ -17,17 +17,22 @@ "use strict"; -exports.command = ['run ']; -exports.desc = 'Run custom tasks'; -exports.builder = function (yargs) { - yargs.usage(`${exports.desc} +import path from 'path'; +import { cmd_count } from '../../src/util.js'; + +const __dirname = import.meta.dirname; + +export const command = ['run ']; +export const desc = 'Run custom tasks'; +export const builder = function (yargs) { + yargs.usage(`${desc} Usage: eask run [options..]`) - .commandDir('../run/') + .commandDir(path.join(__dirname, '../run/')) .demandCommand(); /* XXX: Configure only in the menu. */ - if (UTIL.cmd_count() == 1) { + if (cmd_count() == 1) { yargs.positional( '', { description: 'type of the execution', @@ -35,4 +40,4 @@ Usage: eask run [options..]`) } } -exports.handler = async (argv) => { }; +export const handler = async (argv) => { }; diff --git a/cmds/core/search.js b/cmds/core/search.js index 85d395d8..6a070c3f 100644 --- a/cmds/core/search.js +++ b/cmds/core/search.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['search [queries..]']; -exports.desc = 'Search packages from archives'; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, def_flag } from "../../src/util.js"; + +export const command = ['search [queries..]']; +export const desc = 'Search packages from archives'; +export const builder = yargs => yargs .positional( '[queries..]', { description: 'queries to search packages', @@ -34,7 +37,7 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/search', argv.queries - , UTIL.def_flag(argv.depth, '--depth', argv.depth)); +export const handler = async (argv) => { + await e_call(argv, 'core/search', argv.queries + , def_flag(argv.depth, '--depth', argv.depth)); }; diff --git a/cmds/core/source.js b/cmds/core/source.js index ea168e6b..3196f394 100644 --- a/cmds/core/source.js +++ b/cmds/core/source.js @@ -17,17 +17,22 @@ "use strict"; -exports.command = ['source ']; -exports.desc = UTIL.hide_cmd('Manage sources'); -exports.builder = function (yargs) { - yargs.usage(`${exports.desc} +import path from 'path'; +import { cmd_count, hide_cmd } from "../../src/util.js"; + +const __dirname = import.meta.dirname; + +export const command = ['source ']; +export const desc = hide_cmd('Manage sources'); +export const builder = function (yargs) { + yargs.usage(`${desc} Usage: eask source [options..]`) - .commandDir('../source/') + .commandDir(path.join(__dirname, '../source/')) .demandCommand(); /* XXX: Configure only in the menu. */ - if (UTIL.cmd_count() == 1) { + if (cmd_count() == 1) { yargs.positional( '', { description: 'type of the control', @@ -35,4 +40,4 @@ Usage: eask source [options..]`) } } -exports.handler = async (argv) => {}; +export const handler = async (argv) => {}; diff --git a/cmds/core/status.js b/cmds/core/status.js index 758188af..16e463fe 100644 --- a/cmds/core/status.js +++ b/cmds/core/status.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['status']; -exports.desc = 'Show the workspace status'; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/status'); +export const command = ['status']; +export const desc = 'Show the workspace status'; + +export const handler = async (argv) => { + await e_call(argv, 'core/status'); }; diff --git a/cmds/core/test.js b/cmds/core/test.js index 59f63f48..0a88ac3d 100644 --- a/cmds/core/test.js +++ b/cmds/core/test.js @@ -17,17 +17,22 @@ "use strict"; -exports.command = ['test ']; -exports.desc = "Run regression/unit tests"; -exports.builder = function (yargs) { - yargs.usage(`${exports.desc} +import path from 'path'; +import { cmd_count } from "../../src/util.js"; + +const __dirname = import.meta.dirname; + +export const command = ['test ']; +export const desc = "Run regression/unit tests"; +export const builder = function (yargs) { + yargs.usage(`${desc} Usage: eask test [options..]`) - .commandDir('../test/') + .commandDir(path.join(__dirname, '../test/')) .demandCommand(); /* XXX: Configure only in the menu. */ - if (UTIL.cmd_count() == 1) { + if (cmd_count() == 1) { yargs.positional( '', { description: 'type of the test framework', @@ -35,4 +40,4 @@ Usage: eask test [options..]`) } } -exports.handler = async (argv) => { }; +export const handler = async (argv) => { }; diff --git a/cmds/core/uninstall.js b/cmds/core/uninstall.js index 441aa8c6..07adcb02 100644 --- a/cmds/core/uninstall.js +++ b/cmds/core/uninstall.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['uninstall [names..]', 'delete [names..]']; -exports.desc = 'Uninstall packages from archives'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['uninstall [names..]', 'delete [names..]']; +export const desc = 'Uninstall packages from archives'; +export const builder = yargs => yargs .positional( '[names..]', { description: 'packages to uninstall', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/uninstall', argv.names); +export const handler = async (argv) => { + await e_call(argv, 'core/uninstall', argv.names); }; diff --git a/cmds/core/upgrade.js b/cmds/core/upgrade.js index ebf73928..a07876b7 100644 --- a/cmds/core/upgrade.js +++ b/cmds/core/upgrade.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['upgrade [names..]']; -exports.desc = 'Upgrade packages from archives'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['upgrade [names..]']; +export const desc = 'Upgrade packages from archives'; +export const builder = yargs => yargs .positional( '[names..]', { description: 'packages to upgrade', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/upgrade', argv.names); +export const handler = async (argv) => { + await e_call(argv, 'core/upgrade', argv.names); }; diff --git a/cmds/create/el-project.js b/cmds/create/el-project.js index d9e6b138..4c031078 100644 --- a/cmds/create/el-project.js +++ b/cmds/create/el-project.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['el-project']; -exports.desc = 'Create a new project with `el-project`'; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'create/el-project'); +export const command = ['el-project']; +export const desc = 'Create a new project with `el-project`'; + +export const handler = async (argv) => { + await e_call(argv, 'create/el-project'); }; diff --git a/cmds/create/elpa.js b/cmds/create/elpa.js index 43ac6371..69f4eeba 100644 --- a/cmds/create/elpa.js +++ b/cmds/create/elpa.js @@ -17,11 +17,12 @@ "use strict"; -const child_process = require('child_process'); +import child_process from 'child_process'; +import { e_call } from "../../src/util.js"; -exports.command = ['elpa ']; -exports.desc = 'Create a new ELPA using github-elpa'; -exports.builder = yargs => yargs +export const command = ['elpa ']; +export const desc = 'Create a new ELPA using github-elpa'; +export const builder = yargs => yargs .positional( '', { description: 'new ELPA name', @@ -30,7 +31,7 @@ exports.builder = yargs => yargs const TEMPLATE_URL = 'https://github.com/emacs-eask/template-elpa'; -exports.handler = async (argv) => { +export const handler = async (argv) => { const project_name = argv.name; let proc = child_process.spawn('git', ['clone', TEMPLATE_URL, project_name], @@ -61,6 +62,6 @@ exports.handler = async (argv) => { /* Operations after _cloned */ async function _cloned(argv) { console.warn('Initialize the Eask-file for your project...'); - await UTIL.e_call(argv, 'core/init'); - await UTIL.e_call(argv, 'create/elpa'); + await e_call(argv, 'core/init'); + await e_call(argv, 'create/elpa'); } diff --git a/cmds/create/package.js b/cmds/create/package.js index 24a1194b..c1d30c00 100644 --- a/cmds/create/package.js +++ b/cmds/create/package.js @@ -17,11 +17,12 @@ "use strict"; -const child_process = require('child_process'); +import child_process from 'child_process'; +import { e_call } from "../../src/util.js"; -exports.command = ['package ', 'pkg ']; -exports.desc = 'Create a new package'; -exports.builder = yargs => yargs +export const command = ['package ', 'pkg ']; +export const desc = 'Create a new package'; +export const builder = yargs => yargs .positional( '', { description: 'new package name', @@ -30,7 +31,7 @@ exports.builder = yargs => yargs const TEMPLATE_URL = 'https://github.com/emacs-eask/template-elisp'; -exports.handler = async (argv) => { +export const handler = async (argv) => { const project_name = argv.name; let proc = child_process.spawn('git', ['clone', TEMPLATE_URL, project_name], @@ -59,6 +60,6 @@ exports.handler = async (argv) => { /* Operations after _cloned */ async function _cloned(argv) { console.warn('Initialize the Eask-file for your project...'); - await UTIL.e_call(argv, 'core/init'); - await UTIL.e_call(argv, 'create/package'); + await e_call(argv, 'core/init'); + await e_call(argv, 'create/package'); } diff --git a/cmds/docs/el2org.js b/cmds/docs/el2org.js index a072cb6f..a22a5a76 100644 --- a/cmds/docs/el2org.js +++ b/cmds/docs/el2org.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['el2org [names..]', ]; -exports.desc = 'Build documentation with el2org'; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, def_flag } from "../../src/util.js"; + +export const command = ['el2org [names..]', ]; +export const desc = 'Build documentation with el2org'; +export const builder = yargs => yargs .positional( '[names..]', { description: 'specify source files to scan', @@ -35,8 +38,8 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'docs/el2org' - , argv.names - , UTIL.def_flag(argv.dest, '--dest', argv.dest)); +export const handler = async (argv) => { + await e_call(argv, 'docs/el2org' + , argv.names + , def_flag(argv.dest, '--dest', argv.dest)); }; diff --git a/cmds/format/elfmt.js b/cmds/format/elfmt.js index bd2e2028..3ede2d3d 100644 --- a/cmds/format/elfmt.js +++ b/cmds/format/elfmt.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['elfmt [files..]']; -exports.desc = 'Reformat Elisp source with elfmt'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['elfmt [files..]']; +export const desc = 'Reformat Elisp source with elfmt'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'specify files to do elfmt', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'format/elfmt', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'format/elfmt', argv.files); }; diff --git a/cmds/format/elisp-autofmt.js b/cmds/format/elisp-autofmt.js index 85f30766..025ec406 100644 --- a/cmds/format/elisp-autofmt.js +++ b/cmds/format/elisp-autofmt.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['elisp-autofmt [files..]']; -exports.desc = 'Reformat Elisp source with elisp-autofmt'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['elisp-autofmt [files..]']; +export const desc = 'Reformat Elisp source with elisp-autofmt'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'specify files to do elisp-autofmt', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'format/elisp-autofmt', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'format/elisp-autofmt', argv.files); }; diff --git a/cmds/generate/autoloads.js b/cmds/generate/autoloads.js index 391fd222..2601712e 100644 --- a/cmds/generate/autoloads.js +++ b/cmds/generate/autoloads.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['autoloads']; -exports.desc = 'Generate the autoloads file'; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/autoloads'); +export const command = ['autoloads']; +export const desc = 'Generate the autoloads file'; + +export const handler = async (argv) => { + await e_call(argv, 'generate/autoloads'); }; diff --git a/cmds/generate/ignore.js b/cmds/generate/ignore.js index 80f5fea8..70f50a68 100644 --- a/cmds/generate/ignore.js +++ b/cmds/generate/ignore.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['ignore ']; -exports.desc = 'Generate an ignore file using .gitignore templates'; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, def_flag } from "../../src/util.js"; + +export const command = ['ignore ']; +export const desc = 'Generate an ignore file using .gitignore templates'; +export const builder = yargs => yargs .positional( '', { description: 'name of the ignore template', @@ -34,8 +37,8 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/ignore' - , argv.name - , UTIL.def_flag(argv.output, '--output', argv.output)); +export const handler = async (argv) => { + await e_call(argv, 'generate/ignore' + , argv.name + , def_flag(argv.output, '--output', argv.output)); }; diff --git a/cmds/generate/license.js b/cmds/generate/license.js index 7499d6bc..b8eabc5b 100644 --- a/cmds/generate/license.js +++ b/cmds/generate/license.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['license ']; -exports.desc = 'Generate the LICENSE file'; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, def_flag } from "../../src/util.js"; + +export const command = ['license ']; +export const desc = 'Generate the LICENSE file'; +export const builder = yargs => yargs .positional( '', { description: 'name of the license', @@ -34,8 +37,8 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/license' - , argv.name - , UTIL.def_flag(argv.output, '--output', argv.output)); +export const handler = async (argv) => { + await e_call(argv, 'generate/license' + , argv.name + , def_flag(argv.output, '--output', argv.output)); }; diff --git a/cmds/generate/pkg-file.js b/cmds/generate/pkg-file.js index ad08de0e..59ede3e6 100644 --- a/cmds/generate/pkg-file.js +++ b/cmds/generate/pkg-file.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['pkg-file', 'pkg', 'pkg-el']; -exports.desc = 'Generate the pkg file'; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/pkg-file'); +export const command = ['pkg-file', 'pkg', 'pkg-el']; +export const desc = 'Generate the pkg file'; + +export const handler = async (argv) => { + await e_call(argv, 'generate/pkg-file'); }; diff --git a/cmds/generate/recipe.js b/cmds/generate/recipe.js index db1a057f..c2d0917e 100644 --- a/cmds/generate/recipe.js +++ b/cmds/generate/recipe.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['recipe [destination]']; -exports.desc = 'Generate the recipe file'; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call, def_flag } from "../../src/util.js"; + +export const command = ['recipe [destination]']; +export const desc = 'Generate the recipe file'; +export const builder = yargs => yargs .positional( 'destination', { description: 'destination path/folder', @@ -35,8 +38,8 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/recipe' - , argv.dest - , UTIL.def_flag(argv.yes, '--yes')); +export const handler = async (argv) => { + await e_call(argv, 'generate/recipe' + , argv.dest + , def_flag(argv.yes, '--yes')); }; diff --git a/cmds/generate/test.js b/cmds/generate/test.js index c27ceea8..41dd6f67 100644 --- a/cmds/generate/test.js +++ b/cmds/generate/test.js @@ -17,17 +17,22 @@ "use strict"; -exports.command = ['test ']; -exports.desc = 'Generate test files based on the testing framework'; -exports.builder = function (yargs) { - yargs.usage(`${exports.desc} +import path from 'path'; +import { cmd_count } from "../../src/util.js"; + +const __dirname = import.meta.dirname; + +export const command = ['test ']; +export const desc = 'Generate test files based on the testing framework'; +export const builder = function (yargs) { + yargs.usage(`${desc} Usage: eask generate test [options..]`) - .commandDir('./test/') + .commandDir(path.join(__dirname, './test/')) .demandCommand(); /* XXX: Configure only in the menu. */ - if (UTIL.cmd_count() == 2) { + if (cmd_count() == 2) { yargs.positional( '', { description: 'type of the testing framework', @@ -35,4 +40,4 @@ Usage: eask generate test [options..]`) } } -exports.handler = async (argv) => { }; +export const handler = async (argv) => { }; diff --git a/cmds/generate/test/buttercup.js b/cmds/generate/test/buttercup.js index a5641fc3..8d975e60 100644 --- a/cmds/generate/test/buttercup.js +++ b/cmds/generate/test/buttercup.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['buttercup']; -exports.desc = 'Create a new Buttercup setup for the project'; +import { e_call } from "../../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/test/buttercup', argv.file); +export const command = ['buttercup']; +export const desc = 'Create a new Buttercup setup for the project'; + +export const handler = async (argv) => { + await e_call(argv, 'generate/test/buttercup', argv.file); }; diff --git a/cmds/generate/test/ecukes.js b/cmds/generate/test/ecukes.js index 74c7406d..96ce5503 100644 --- a/cmds/generate/test/ecukes.js +++ b/cmds/generate/test/ecukes.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['ecukes']; -exports.desc = 'Create a new Ecukes setup for the project'; +import { e_call } from "../../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/test/ecukes', argv.file); +export const command = ['ecukes']; +export const desc = 'Create a new Ecukes setup for the project'; + +export const handler = async (argv) => { + await e_call(argv, 'generate/test/ecukes', argv.file); }; diff --git a/cmds/generate/test/ert-runner.js b/cmds/generate/test/ert-runner.js index 22eb7b41..3c3ada6d 100644 --- a/cmds/generate/test/ert-runner.js +++ b/cmds/generate/test/ert-runner.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['ert-runner [names..]']; -exports.desc = 'Create a new test project for the ert-runner'; -exports.builder = yargs => yargs +import { e_call } from "../../../src/util.js"; + +export const command = ['ert-runner [names..]']; +export const desc = 'Create a new test project for the ert-runner'; +export const builder = yargs => yargs .positional( '[names..]', { description: 'specify test names', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/test/ert-runner', argv.names); +export const handler = async (argv) => { + await e_call(argv, 'generate/test/ert-runner', argv.names); }; diff --git a/cmds/generate/test/ert.js b/cmds/generate/test/ert.js index c0854e62..3a78aa7a 100644 --- a/cmds/generate/test/ert.js +++ b/cmds/generate/test/ert.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['ert [names..]']; -exports.desc = 'Create a new test project for the ert tests'; -exports.builder = yargs => yargs +import { e_call } from "../../../src/util.js"; + +export const command = ['ert [names..]']; +export const desc = 'Create a new test project for the ert tests'; +export const builder = yargs => yargs .positional( '[names..]', { description: 'specify test names', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/test/ert', argv.names); +export const handler = async (argv) => { + await e_call(argv, 'generate/test/ert', argv.names); }; diff --git a/cmds/generate/workflow.js b/cmds/generate/workflow.js index 3f219741..7cd7306a 100644 --- a/cmds/generate/workflow.js +++ b/cmds/generate/workflow.js @@ -17,17 +17,22 @@ "use strict"; -exports.command = ['workflow ']; -exports.desc = 'Generate yaml files for CI/CD'; -exports.builder = function (yargs) { - yargs.usage(`${exports.desc} +import path from 'path'; +import { cmd_count } from "../../src/util.js"; + +const __dirname = import.meta.dirname; + +export const command = ['workflow ']; +export const desc = 'Generate yaml files for CI/CD'; +export const builder = function (yargs) { + yargs.usage(`${desc} Usage: eask generate workflow [options..]`) - .commandDir('./workflow/') + .commandDir(path.join(__dirname, './workflow/')) .demandCommand(); /* XXX: Configure only in the menu. */ - if (UTIL.cmd_count() == 2) { + if (cmd_count() == 2) { yargs.positional( '', { description: 'type of the workflow', @@ -35,4 +40,4 @@ Usage: eask generate workflow [options..]`) } } -exports.handler = async (argv) => { }; +export const handler = async (argv) => { }; diff --git a/cmds/generate/workflow/circle-ci.js b/cmds/generate/workflow/circle-ci.js index 737c6e9a..68f9581f 100644 --- a/cmds/generate/workflow/circle-ci.js +++ b/cmds/generate/workflow/circle-ci.js @@ -17,16 +17,18 @@ "use strict"; -exports.command = ['circle-ci [file]']; -exports.desc = 'Generate the CircleCI workflow yaml file'; -exports.builder = yargs => yargs +import { e_call } from "../../../src/util.js"; + +export const command = ['circle-ci [file]']; +export const desc = 'Generate the CircleCI workflow yaml file'; +export const builder = yargs => yargs .positional( '[file]', { description: 'name of the test file; the default is `config.yml`', type: 'string', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/workflow/circle-ci', argv.file); +export const handler = async (argv) => { + await e_call(argv, 'generate/workflow/circle-ci', argv.file); }; diff --git a/cmds/generate/workflow/github.js b/cmds/generate/workflow/github.js index 041331e2..72c339fe 100644 --- a/cmds/generate/workflow/github.js +++ b/cmds/generate/workflow/github.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['github [file]', 'github-actions [file]', 'gha [file]']; -exports.desc = 'Generate the GitHub Actions workflow yaml file'; -exports.builder = yargs => yargs +import { e_call } from "../../../src/util.js"; + +export const command = ['github [file]', 'github-actions [file]', 'gha [file]']; +export const desc = 'Generate the GitHub Actions workflow yaml file'; +export const builder = yargs => yargs .positional( '[file]', { description: 'name of the test file; the default is `test.yml`', type: 'string', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/workflow/github', argv.file); +export const handler = async (argv) => { + await e_call(argv, 'generate/workflow/github', argv.file); }; diff --git a/cmds/generate/workflow/gitlab.js b/cmds/generate/workflow/gitlab.js index c797c4dd..99bff076 100644 --- a/cmds/generate/workflow/gitlab.js +++ b/cmds/generate/workflow/gitlab.js @@ -17,16 +17,18 @@ "use strict"; -exports.command = ['gitlab [file]', 'gitlab-runner [file]']; -exports.desc = 'Generate the GitLab Runner workflow yaml file'; -exports.builder = yargs => yargs +import { e_call } from "../../../src/util.js"; + +export const command = ['gitlab [file]', 'gitlab-runner [file]']; +export const desc = 'Generate the GitLab Runner workflow yaml file'; +export const builder = yargs => yargs .positional( '[file]', { description: 'name of the test file; the default is `.gitlab-ci.yml`', type: 'string', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/workflow/gitlab', argv.file); +export const handler = async (argv) => { + await e_call(argv, 'generate/workflow/gitlab', argv.file); }; diff --git a/cmds/generate/workflow/travis-ci.js b/cmds/generate/workflow/travis-ci.js index 8d8cadf4..e1f189a7 100644 --- a/cmds/generate/workflow/travis-ci.js +++ b/cmds/generate/workflow/travis-ci.js @@ -17,16 +17,18 @@ "use strict"; -exports.command = ['travis-ci [file]']; -exports.desc = 'Generate the Travis CI workflow yaml file'; -exports.builder = yargs => yargs +import { e_call } from "../../../src/util.js"; + +export const command = ['travis-ci [file]']; +export const desc = 'Generate the Travis CI workflow yaml file'; +export const builder = yargs => yargs .positional( '[file]', { description: 'name of the test file; the default is `.travis.yml`', type: 'string', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'generate/workflow/travis-ci', argv.file); +export const handler = async (argv) => { + await e_call(argv, 'generate/workflow/travis-ci', argv.file); }; diff --git a/cmds/link/add.js b/cmds/link/add.js index 95451dc2..8718aa7b 100644 --- a/cmds/link/add.js +++ b/cmds/link/add.js @@ -17,9 +17,12 @@ "use strict"; -exports.command = ['add ']; -exports.desc = 'Link a local package'; -exports.builder = yargs => yargs +import { TITLE_CMD_OPTION } from "../../src/env.js"; +import { e_call } from "../../src/util.js"; + +export const command = ['add ']; +export const desc = 'Link a local package'; +export const builder = yargs => yargs .positional( '', { description: 'name of the link', @@ -39,6 +42,6 @@ exports.builder = yargs => yargs }, }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'link/add', argv.name, argv.path); +export const handler = async (argv) => { + await e_call(argv, 'link/add', argv.name, argv.path); }; diff --git a/cmds/link/delete.js b/cmds/link/delete.js index e00d63f7..a38110fd 100644 --- a/cmds/link/delete.js +++ b/cmds/link/delete.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['delete [names..]', 'remove [names..]']; -exports.desc = 'Delete locally linked packages'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['delete [names..]', 'remove [names..]']; +export const desc = 'Delete locally linked packages'; +export const builder = yargs => yargs .positional( '[names..]', { description: 'name of the link, accept array', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'link/delete', argv.names); +export const handler = async (argv) => { + await e_call(argv, 'link/delete', argv.names); }; diff --git a/cmds/link/list.js b/cmds/link/list.js index 96a18349..e69a8c1b 100644 --- a/cmds/link/list.js +++ b/cmds/link/list.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['list']; -exports.desc = 'List all project links'; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'link/list'); +export const command = ['list']; +export const desc = 'List all project links'; + +export const handler = async (argv) => { + await e_call(argv, 'link/list'); }; diff --git a/cmds/lint/checkdoc.js b/cmds/lint/checkdoc.js index d6aa4d7f..a661ca41 100644 --- a/cmds/lint/checkdoc.js +++ b/cmds/lint/checkdoc.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['checkdoc [files..]']; -exports.desc = 'Run checkdoc'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['checkdoc [files..]']; +export const desc = 'Run checkdoc'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'files you want checkdoc to run on', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'lint/checkdoc', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'lint/checkdoc', argv.files); }; diff --git a/cmds/lint/declare.js b/cmds/lint/declare.js index 0ff67261..b1ffc041 100644 --- a/cmds/lint/declare.js +++ b/cmds/lint/declare.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['declare [files..]']; -exports.desc = 'Run check-declare'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['declare [files..]']; +export const desc = 'Run check-declare'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'files you want check-declare to run on', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'lint/declare', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'lint/declare', argv.files); }; diff --git a/cmds/lint/elint.js b/cmds/lint/elint.js index 1c317961..43568344 100644 --- a/cmds/lint/elint.js +++ b/cmds/lint/elint.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['elint [files..]']; -exports.desc = 'Run elint'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['elint [files..]']; +export const desc = 'Run elint'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'files you want elint to run on', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'lint/elint', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'lint/elint', argv.files); }; diff --git a/cmds/lint/elisp-lint.js b/cmds/lint/elisp-lint.js index d5340d0d..7c43f94d 100644 --- a/cmds/lint/elisp-lint.js +++ b/cmds/lint/elisp-lint.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['elisp-lint [files..]']; -exports.desc = 'Run elisp-lint'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['elisp-lint [files..]']; +export const desc = 'Run elisp-lint'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'files you want elisp-lint to run on', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'lint/elisp-lint', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'lint/elisp-lint', argv.files); }; diff --git a/cmds/lint/elsa.js b/cmds/lint/elsa.js index b5d98df5..e611f492 100644 --- a/cmds/lint/elsa.js +++ b/cmds/lint/elsa.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['elsa [files..]']; -exports.desc = 'Run elsa'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['elsa [files..]']; +export const desc = 'Run elsa'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'files you want elsa to run on', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'lint/elsa', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'lint/elsa', argv.files); }; diff --git a/cmds/lint/indent.js b/cmds/lint/indent.js index 08b05d53..64f4ff08 100644 --- a/cmds/lint/indent.js +++ b/cmds/lint/indent.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['indent [files..]']; -exports.desc = 'Run indent-lint'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['indent [files..]']; +export const desc = 'Run indent-lint'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'files you want indent-lint to run on', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'lint/indent', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'lint/indent', argv.files); }; diff --git a/cmds/lint/keywords.js b/cmds/lint/keywords.js index 55e0c8c4..5e8a1769 100644 --- a/cmds/lint/keywords.js +++ b/cmds/lint/keywords.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['keywords']; -exports.desc = `Run keywords checker (built-in)`; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'lint/keywords'); +export const command = ['keywords']; +export const desc = `Run keywords checker (built-in)`; + +export const handler = async (argv) => { + await e_call(argv, 'lint/keywords'); }; diff --git a/cmds/lint/license.js b/cmds/lint/license.js index 200a32bd..68b567fc 100644 --- a/cmds/lint/license.js +++ b/cmds/lint/license.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['license']; -exports.desc = `Run license check`; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'lint/license'); +export const command = ['license']; +export const desc = `Run license check`; + +export const handler = async (argv) => { + await e_call(argv, 'lint/license'); }; diff --git a/cmds/lint/org.js b/cmds/lint/org.js index 81da3d0c..c39d28bd 100644 --- a/cmds/lint/org.js +++ b/cmds/lint/org.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['org [files..]']; -exports.desc = `Run org-lint on Org files`; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['org [files..]']; +export const desc = `Run org-lint on Org files`; +export const builder = yargs => yargs .positional( '[files..]', { description: 'files you want org-lint to run on', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'lint/org', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'lint/org', argv.files); }; diff --git a/cmds/lint/package.js b/cmds/lint/package.js index d0a67fe8..9bb5fc75 100644 --- a/cmds/lint/package.js +++ b/cmds/lint/package.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['package [files..]']; -exports.desc = 'Run package-lint'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['package [files..]']; +export const desc = 'Run package-lint'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'specify files to do package lint', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'lint/package', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'lint/package', argv.files); }; diff --git a/cmds/lint/regexps.js b/cmds/lint/regexps.js index e22f01d5..c20ac74d 100644 --- a/cmds/lint/regexps.js +++ b/cmds/lint/regexps.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['regexps [files..]', 'relint [files..]']; -exports.desc = 'Run relint'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['regexps [files..]', 'relint [files..]']; +export const desc = 'Run relint'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'files you want relint to run on', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'lint/regexps', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'lint/regexps', argv.files); }; diff --git a/cmds/run/command.js b/cmds/run/command.js index 3c40b003..aed8500c 100644 --- a/cmds/run/command.js +++ b/cmds/run/command.js @@ -17,16 +17,18 @@ "use strict"; -exports.command = ['command [names..]', 'cmd [names..]']; -exports.desc = 'Run elisp commands named [names..]'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['command [names..]', 'cmd [names..]']; +export const desc = 'Run elisp commands named [names..]'; +export const builder = yargs => yargs .positional( '[names..]', { description: 'list of function commands to execute', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'run/command' - , argv.names); +export const handler = async (argv) => { + await e_call(argv, 'run/command' + , argv.names); }; diff --git a/cmds/run/script.js b/cmds/run/script.js index b378e87c..8aab052e 100644 --- a/cmds/run/script.js +++ b/cmds/run/script.js @@ -17,20 +17,22 @@ "use strict"; -const fs = require('fs'); -const child_process = require("child_process"); - -exports.command = ['script [names..]']; -exports.desc = 'Run script named [names..]'; -exports.builder = yargs => yargs +import fs from "fs"; +import child_process from "child_process"; +import { IS_PKG, EASK_HOMEDIR } from "../../src/env.js"; +import { e_call } from "../../src/util.js"; + +export const command = ['script [names..]']; +export const desc = 'Run script named [names..]'; +export const builder = yargs => yargs .positional( '[names..]', { description: 'specify scripts to run', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'run/script', argv.names); +export const handler = async (argv) => { + await e_call(argv, 'run/script', argv.names); if (!fs.existsSync(EASK_HOMEDIR)) { return; diff --git a/cmds/source/add.js b/cmds/source/add.js index 08104e9b..4064e9a5 100644 --- a/cmds/source/add.js +++ b/cmds/source/add.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['add [url]']; -exports.desc = 'Add an archive source'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['add [url]']; +export const desc = 'Add an archive source'; +export const builder = yargs => yargs .positional( '', { description: 'name of the archive', @@ -31,6 +33,6 @@ exports.builder = yargs => yargs type: 'string', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'source/add', argv.name, argv.url); +export const handler = async (argv) => { + await e_call(argv, 'source/add', argv.name, argv.url); }; diff --git a/cmds/source/delete.js b/cmds/source/delete.js index 4a0817b3..f20f7bac 100644 --- a/cmds/source/delete.js +++ b/cmds/source/delete.js @@ -17,16 +17,18 @@ "use strict"; -exports.command = ['delete ', 'remove ']; -exports.desc = 'Remove an archive source'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['delete ', 'remove ']; +export const desc = 'Remove an archive source'; +export const builder = yargs => yargs .positional( '', { description: 'name of the archive', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'source/delete', argv.name); +export const handler = async (argv) => { + await e_call(argv, 'source/delete', argv.name); }; diff --git a/cmds/source/list.js b/cmds/source/list.js index bf4ac20b..7365b2de 100644 --- a/cmds/source/list.js +++ b/cmds/source/list.js @@ -17,10 +17,12 @@ "use strict"; -exports.command = ['list']; -exports.desc = 'List all source information'; +import { e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'source/list'); +export const command = ['list']; +export const desc = 'List all source information'; + +export const handler = async (argv) => { + await e_call(argv, 'source/list'); }; diff --git a/cmds/test/activate.js b/cmds/test/activate.js index ac28c871..53c965ad 100644 --- a/cmds/test/activate.js +++ b/cmds/test/activate.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['activate [files..]']; -exports.desc = 'Activate package; use to test package activation'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['activate [files..]']; +export const desc = 'Activate package; use to test package activation'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'files to load after package activation', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'test/activate', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'test/activate', argv.files); }; diff --git a/cmds/test/buttercup.js b/cmds/test/buttercup.js index 7386c5f4..87f5465d 100644 --- a/cmds/test/buttercup.js +++ b/cmds/test/buttercup.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['buttercup [directories..]']; -exports.desc = 'Run buttercup tests'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['buttercup [directories..]']; +export const desc = 'Run buttercup tests'; +export const builder = yargs => yargs .positional( '[directories..]', { description: 'directories containing buttercup tests, must be children of the current directory', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'test/buttercup', argv.directories); +export const handler = async (argv) => { + await e_call(argv, 'test/buttercup', argv.directories); }; diff --git a/cmds/test/ecukes.js b/cmds/test/ecukes.js index f3b1a1bc..cad00cac 100644 --- a/cmds/test/ecukes.js +++ b/cmds/test/ecukes.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['ecukes [files..]']; -exports.desc = 'Run ecukes tests'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['ecukes [files..]']; +export const desc = 'Run ecukes tests'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'specify feature files to do ecukes tests', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'test/ecukes', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'test/ecukes', argv.files); }; diff --git a/cmds/test/ert-runner.js b/cmds/test/ert-runner.js index 633f86b5..ff9996fe 100644 --- a/cmds/test/ert-runner.js +++ b/cmds/test/ert-runner.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['ert-runner [files..]']; -exports.desc = 'Run ert tests using ert-runner'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['ert-runner [files..]']; +export const desc = 'Run ert tests using ert-runner'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'specify files to do ert tests', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'test/ert-runner', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'test/ert-runner', argv.files); }; diff --git a/cmds/test/ert.js b/cmds/test/ert.js index ee7f7809..19c70f0e 100644 --- a/cmds/test/ert.js +++ b/cmds/test/ert.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['ert [files..]']; -exports.desc = 'Run ert tests'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['ert [files..]']; +export const desc = 'Run ert tests'; +export const builder = yargs => yargs .positional( '[files..]', { description: 'specify files to do ert tests', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'test/ert', argv.files); +export const handler = async (argv) => { + await e_call(argv, 'test/ert', argv.files); }; diff --git a/cmds/test/melpazoid.js b/cmds/test/melpazoid.js index d517d2d8..22e837c8 100644 --- a/cmds/test/melpazoid.js +++ b/cmds/test/melpazoid.js @@ -17,15 +17,17 @@ "use strict"; -exports.command = ['melpazoid [directories..]']; -exports.desc = 'Run melpazoid tests'; -exports.builder = yargs => yargs +import { e_call } from "../../src/util.js"; + +export const command = ['melpazoid [directories..]']; +export const desc = 'Run melpazoid tests'; +export const builder = yargs => yargs .positional( '[directories..]', { description: 'specify directories to do melpazoid tests', type: 'array', }); -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'test/melpazoid', argv.directories); +export const handler = async (argv) => { + await e_call(argv, 'test/melpazoid', argv.directories); }; diff --git a/cmds/util/locate.js b/cmds/util/locate.js index 4aae2738..d78cc7c5 100644 --- a/cmds/util/locate.js +++ b/cmds/util/locate.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['locate']; -exports.desc = 'Show the location where Eask is installed'; +import { plugin_dir } from "../../src/util.js"; -exports.handler = async (argv) => { - console.log(UTIL.plugin_dir()); +export const command = ['locate']; +export const desc = 'Show the location where Eask is installed'; + +export const handler = async (argv) => { + console.log(plugin_dir()); }; diff --git a/cmds/util/root.js b/cmds/util/root.js index 088f62ad..b1b0c3ee 100644 --- a/cmds/util/root.js +++ b/cmds/util/root.js @@ -17,9 +17,11 @@ "use strict"; -exports.command = ['root']; -exports.desc = UTIL.hide_cmd('Display the effective installation directory of your Emacs packages'); +import { hide_cmd, e_call } from "../../src/util.js"; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'util/root'); +export const command = ['root']; +export const desc = hide_cmd('Display the effective installation directory of your Emacs packages'); + +export const handler = async (argv) => { + await e_call(argv, 'util/root'); }; diff --git a/cmds/util/upgrade-eask.js b/cmds/util/upgrade-eask.js index f907a64e..fe83b765 100644 --- a/cmds/util/upgrade-eask.js +++ b/cmds/util/upgrade-eask.js @@ -17,13 +17,14 @@ "use strict"; -const child_process = require("child_process"); +import child_process from "child_process"; +import { plugin_dir } from "../../src/util.js"; -exports.command = ['upgrade-eask', 'upgrade-self']; -exports.desc = 'Upgrade Eask itself'; +export const command = ['upgrade-eask', 'upgrade-self']; +export const desc = 'Upgrade Eask itself'; -exports.handler = async (argv) => { - process.chdir(UTIL.plugin_dir()); +export const handler = async (argv) => { + process.chdir(plugin_dir()); let proc = child_process.spawn('git', ['pull'], { stdio: 'inherit' }); // You would just need to register the error event, or else it can't print diff --git a/docs/content/Contributing/Codebase-Overview/_index.en.md b/docs/content/Contributing/Codebase-Overview/_index.en.md index 7ad8ecd9..69df3ae1 100644 --- a/docs/content/Contributing/Codebase-Overview/_index.en.md +++ b/docs/content/Contributing/Codebase-Overview/_index.en.md @@ -28,21 +28,20 @@ to feed the Emacs session. Let's look at the file `cmds/core/archives.js`: ```js -exports.command = ['archives', 'sources']; // alias to sources -exports.desc = 'List out all package archives'; +export const command = ['archives', 'sources']; // alias to sources +export const desc = 'List out all package archives'; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/archives'); +export const handler = async (argv) => { + await e_call(argv, 'core/archives'); }; ``` This is a standard yargs command file, which contains all the information we need to pass it to the Emacs session. -- **exports.command** is the argument pattern, but it also accepts alias (array) -- **exports.desc** is the command description -- **exports.handler** is an asynchronous function that handles command execution -- **UTIL** is a global variable that points to the `src/util.js` module. +- **export const command** is the argument pattern, but it also accepts alias (array) +- **export const desc** is the command description +- **export const handler** is an asynchronous function that handles command execution - **`'core/archives'`** is the elisp file under **lisp** folder (without `.el` extension). `eask` is a JavaScript file that holds all our global options. @@ -65,7 +64,7 @@ yargs ... ``` -For **local** options, please use `exports.builder` and specify under its +For **local** options, please use `export const builder` and specify under its command file. See diff --git a/docs/content/Contributing/Codebase-Overview/_index.zh-tw.md b/docs/content/Contributing/Codebase-Overview/_index.zh-tw.md index 8cf699ff..9f75f3c5 100644 --- a/docs/content/Contributing/Codebase-Overview/_index.zh-tw.md +++ b/docs/content/Contributing/Codebase-Overview/_index.zh-tw.md @@ -21,20 +21,19 @@ yargs 命令文件是用 JavaScript 編寫的,位於 **cmds** 文件夾下。 讓我們看一下文件 `cmds/core/archives.js` : ```js -exports.command = ['archives', 'sources']; // 來源的別名 -exports.desc = 'List out all package archives'; +export const command = ['archives', 'sources']; // 來源的別名 +export const desc = 'List out all package archives'; -exports.handler = async (argv) => { - await UTIL.e_call(argv, 'core/archives'); +export const handler = async (argv) => { + await e_call(argv, 'core/archives'); }; ``` 這是一個標準的 yargs 命令文件,裡麵包含了我們所有的信息需要將它傳遞給 Emacs session。 -- **exports.command** 是參數模式,但它也接受別名(數組) -- **exports.desc** 是命令說明 -- **exports.handler** 是處理命令執行的異步函數 -- **UTIL** 是指向 `src/util.js` 模塊的全局變量。 +- **export const command** 是參數模式,但它也接受別名(數組) +- **export const desc** 是命令說明 +- **export const handler** 是處理命令執行的異步函數 - **`'core/archives'`** 是 **lisp** 文件夾下的 elisp 文件(沒有 .el 擴展名)。 `eask` 是一個包含我們所有全局選項的 JavaScript 文件。 @@ -57,7 +56,7 @@ yargs ... ``` -對於 **local** 選項,請使用 `exports.builder` 並在其下指定命令文件。 +對於 **local** 選項,請使用 `export const builder` 並在其下指定命令文件。 看 [yargs/docs/advanced.md](https://github.com/yargs/yargs/blob/main/docs/advanced.md), diff --git a/eask.js b/eask.js index 1bfc0731..13acce1b 100644 --- a/eask.js +++ b/eask.js @@ -1,7 +1,13 @@ #!/usr/bin/env node -const env = require('./src/env'); -const yargs = require('yargs'); +import path from 'path'; +import yargs from 'yargs/yargs'; +import { hideBin } from 'yargs/helpers'; +import { TITLE_PROXY_OPTION } from './src/env.js'; + +const __dirname = import.meta.dirname; + +const handler = yargs(hideBin(process.argv)); const usage = `eask is the main command, used to manage your Emacs dependencies @@ -13,15 +19,15 @@ const epilogue = `For more information, find the manual at https://emacs-eask.gi const version = `0.12.10`; -yargs +handler .usage(usage) .scriptName('') .epilogue(epilogue) - .commandDir('cmds/core/') - .commandDir('cmds/util/') + .commandDir(path.join(__dirname, './cmds/core/')) + .commandDir(path.join(__dirname, './cmds/util/')) .command({ command: '*', - handler() { yargs.showHelp(); } + handler() { handler.showHelp(); } }) .version('version', 'output version information and exit', version) .help('help', 'show usage instructions') @@ -127,5 +133,5 @@ yargs .strict() .demandCommand() .showHelpOnFail(true) - .wrap(yargs.terminalWidth()) + .wrap(handler.terminalWidth()) .argv; diff --git a/package-lock.json b/package-lock.json index 51a4a7bd..e4967f51 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,13 +10,13 @@ "license": "GPL-3.0-or-later", "dependencies": { "which": "^6.0.0", - "yargs": "^17.0.0" + "yargs": "^18.0.0" }, "bin": { "eask": "eask.js" }, "devDependencies": { - "@yao-pkg/pkg": "^6.0.0", + "@yao-pkg/pkg": "^6.16.0", "cross-env": "^10.1.0", "jest": "^30.3.0", "semver-compare": "^1.0.0" @@ -579,6 +579,448 @@ "dev": true, "license": "MIT" }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz", + "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz", + "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz", + "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz", + "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz", + "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz", + "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz", + "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz", + "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz", + "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz", + "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz", + "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz", + "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz", + "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz", + "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz", + "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz", + "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz", + "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz", + "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz", + "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz", + "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz", + "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz", + "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz", + "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz", + "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz", + "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz", + "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1148,6 +1590,16 @@ "url": "https://opencollective.com/pkgr" } }, + "node_modules/@roberts_lando/vfs": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@roberts_lando/vfs/-/vfs-0.3.2.tgz", + "integrity": "sha512-whXj9v78S4n3t0RvoTGj8vui27VVtK/oy8YfBL+gDWdlfRFkKpPjry+U8p+3XM++5rAIpXEtXcTUgUAEHZVoFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 22" + } + }, "node_modules/@sinclair/typebox": { "version": "0.34.48", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.34.48.tgz", @@ -1569,25 +2021,30 @@ ] }, "node_modules/@yao-pkg/pkg": { - "version": "6.12.0", - "resolved": "https://registry.npmjs.org/@yao-pkg/pkg/-/pkg-6.12.0.tgz", - "integrity": "sha512-yXdr5XTnEUm+AuBWPvMdv1z6dCcuKLUPYGZKPwb0pS8YE+P/Jspb47QjutcjfA31tIkGU6JTsOhlGxDxrO/A2w==", + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/@yao-pkg/pkg/-/pkg-6.16.0.tgz", + "integrity": "sha512-CtKZ/8Qll3++kXiYiWuuixOw2M5u20f3I0/VhhxTCILCad25PRwOmYbTw/nNHtVCAv8fcQMHW9uDbKuo0O2c7w==", "dev": true, "license": "MIT", "dependencies": { "@babel/generator": "^7.23.0", "@babel/parser": "^7.23.0", + "@babel/traverse": "^7.23.0", "@babel/types": "^7.23.0", - "@yao-pkg/pkg-fetch": "3.5.32", - "into-stream": "^6.0.0", + "@roberts_lando/vfs": "^0.3.2", + "@yao-pkg/pkg-fetch": "3.5.33", + "esbuild": "^0.27.3", + "into-stream": "^9.1.0", "minimist": "^1.2.6", "multistream": "^4.1.0", "picocolors": "^1.1.0", "picomatch": "^4.0.2", + "postject": "^1.0.0-alpha.6", "prebuild-install": "^7.1.1", "resolve": "^1.22.10", + "resolve.exports": "^2.0.3", "stream-meter": "^1.0.4", - "tar": "^7.4.3", + "tar": "^7.5.7", "tinyglobby": "^0.2.11", "unzipper": "^0.12.3" }, @@ -1595,13 +2052,13 @@ "pkg": "lib-es5/bin.js" }, "engines": { - "node": ">=18.0.0" + "node": ">=22.0.0" } }, "node_modules/@yao-pkg/pkg-fetch": { - "version": "3.5.32", - "resolved": "https://registry.npmjs.org/@yao-pkg/pkg-fetch/-/pkg-fetch-3.5.32.tgz", - "integrity": "sha512-hS8zzze5VVyVAciZoNX4q3ZmCdn0gi34P2SElk4PFbzkA4LPs7qBJ3LhUKb4d4KGw1HVkFJJOMgGomH7cMqQ5Q==", + "version": "3.5.33", + "resolved": "https://registry.npmjs.org/@yao-pkg/pkg-fetch/-/pkg-fetch-3.5.33.tgz", + "integrity": "sha512-j2UoH+eP4VobfovQg1gkWwDoB4O/tv8rlLnEjUEEHuWXJ5eBLNUIrobMSEp773/2pgUJUfqqPUFIhS1pN8OZuQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1617,10 +2074,22 @@ "pkg-fetch": "lib-es5/bin.js" } }, + "node_modules/@yao-pkg/pkg-fetch/node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, "node_modules/@yao-pkg/pkg-fetch/node_modules/tar-fs": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.1.tgz", - "integrity": "sha512-LZA0oaPOc2fVo82Txf3gw+AkEd38szODlptMYejQUhndHMLQ9M059uXR+AfS7DNo0NpINvSqDsvyaCrBVkptWg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.1.2.tgz", + "integrity": "sha512-QGxxTxxyleAdyM3kpFs14ymbYmNFrfY+pHj7Z8FgtbZ7w2//VAgLMac7sT6nRpIHjppXO2AwwEOg0bPFVRcmXw==", "dev": true, "license": "MIT", "dependencies": { @@ -1633,17 +2102,36 @@ } }, "node_modules/@yao-pkg/pkg-fetch/node_modules/tar-stream": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", - "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.8.tgz", + "integrity": "sha512-U6QpVRyCGHva435KoNWy9PRoi2IFYCgtEhq9nmrPPpbRacPs9IH4aJ3gbrFC8dPcXvdSZ4XXfXT5Fshbp2MtlQ==", "dev": true, "license": "MIT", "dependencies": { "b4a": "^1.6.4", + "bare-fs": "^4.5.5", "fast-fifo": "^1.2.0", "streamx": "^2.15.0" } }, + "node_modules/@yao-pkg/pkg-fetch/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, "node_modules/@yao-pkg/pkg-fetch/node_modules/yargs": { "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", @@ -1706,6 +2194,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, "engines": { "node": ">=8" } @@ -1714,6 +2203,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -1739,9 +2229,9 @@ } }, "node_modules/anymatch/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", "dev": true, "license": "MIT", "engines": { @@ -1762,9 +2252,9 @@ } }, "node_modules/b4a": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.7.3.tgz", - "integrity": "sha512-5Q2mfq2WfGuFp3uS//0s6baOJLMoVduPYVeNmDYxu5OUA1/cBfvr2RIS7vi62LdNj/urk1hfmj867I3qt6uZ7Q==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.8.0.tgz", + "integrity": "sha512-qRuSmNSkGQaHwNbM7J78Wwy+ghLEYF1zNrSeMxj4Kgw6y33O3mXcQ6Ie9fRvfU/YnxWkOchPXbaLb73TkIsfdg==", "dev": true, "license": "Apache-2.0", "peerDependencies": { @@ -1898,12 +2388,11 @@ } }, "node_modules/bare-fs": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.2.tgz", - "integrity": "sha512-veTnRzkb6aPHOvSKIOy60KzURfBdUflr5VReI+NSaPL6xf+XLdONQgZgpYvUuZLVQ8dCqxpBAudaOM1+KpAUxw==", + "version": "4.7.1", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.7.1.tgz", + "integrity": "sha512-WDRsyVN52eAx/lBamKD6uyw8H4228h/x0sGGGegOamM2cd7Pag88GfMQalobXI+HaEUxpCkbKQUDOQqt9wawRw==", "dev": true, "license": "Apache-2.0", - "optional": true, "dependencies": { "bare-events": "^2.5.4", "bare-path": "^3.0.0", @@ -1924,12 +2413,11 @@ } }, "node_modules/bare-os": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.6.2.tgz", - "integrity": "sha512-T+V1+1srU2qYNBmJCXZkUY5vQ0B4FSlL3QDROnKQYOqeiQR8UbjNHlPa+TIbM4cuidiN9GaTaOZgSEgsvPbh5A==", + "version": "3.8.7", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.8.7.tgz", + "integrity": "sha512-G4Gr1UsGeEy2qtDTZwL7JFLo2wapUarz7iTMcYcMFdS89AIQuBoyjgXZz0Utv7uHs3xA9LckhVbeBi8lEQrC+w==", "dev": true, "license": "Apache-2.0", - "optional": true, "engines": { "bare": ">=1.14.0" } @@ -1940,26 +2428,29 @@ "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==", "dev": true, "license": "Apache-2.0", - "optional": true, "dependencies": { "bare-os": "^3.0.1" } }, "node_modules/bare-stream": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.7.0.tgz", - "integrity": "sha512-oyXQNicV1y8nc2aKffH+BUHFRXmx6VrPzlnaEvMhram0nPBrKcEdcyBg5r08D0i8VxngHFAiVyn1QKXpSG0B8A==", + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.13.0.tgz", + "integrity": "sha512-3zAJRZMDFGjdn+RVnNpF9kuELw+0Fl3lpndM4NcEOhb9zwtSo/deETfuIwMSE5BXanA0FrN1qVjffGwAg2Y7EA==", "dev": true, "license": "Apache-2.0", - "optional": true, "dependencies": { - "streamx": "^2.21.0" + "streamx": "^2.25.0", + "teex": "^1.0.1" }, "peerDependencies": { + "bare-abort-controller": "*", "bare-buffer": "*", "bare-events": "*" }, "peerDependenciesMeta": { + "bare-abort-controller": { + "optional": true + }, "bare-buffer": { "optional": true }, @@ -1969,12 +2460,11 @@ } }, "node_modules/bare-url": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.3.2.tgz", - "integrity": "sha512-ZMq4gd9ngV5aTMa5p9+UfY0b3skwhHELaDkhEHetMdX0LRkW9kzaym4oo/Eh+Ghm0CCDuMTsRIGM/ytUc1ZYmw==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.4.1.tgz", + "integrity": "sha512-fZapLWNB25gS+etK27NV9KgBNXgo2yeYHuj+OyPblQd6GYAE3JVy6aKxszMV5jhGGFwraXQKA5fldvf3lMyEqw==", "dev": true, "license": "Apache-2.0", - "optional": true, "dependencies": { "bare-path": "^3.0.0" } @@ -2045,9 +2535,9 @@ "license": "MIT" }, "node_modules/brace-expansion": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", - "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.0.tgz", + "integrity": "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==", "dev": true, "license": "MIT", "dependencies": { @@ -2227,14 +2717,67 @@ "license": "MIT" }, "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dev": true, + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-9.0.1.tgz", + "integrity": "sha512-k7ndgKhwoQveBL+/1tqGJYNz097I7WOvwbmmU2AR5+magtbjPWQTS1C5vzGkBC8Ym8UWRzfKUzUUqFLypY4Q+w==", + "license": "ISC", + "dependencies": { + "string-width": "^7.2.0", + "strip-ansi": "^7.1.0", + "wrap-ansi": "^9.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/cliui/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT" + }, + "node_modules/cliui/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "license": "MIT", "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/co": { @@ -2259,6 +2802,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -2269,7 +2813,18 @@ "node_modules/color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/commander": { + "version": "9.5.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz", + "integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || >=14" + } }, "node_modules/concat-map": { "version": "0.0.1", @@ -2473,7 +3028,8 @@ "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true }, "node_modules/end-of-stream": { "version": "1.4.4", @@ -2494,6 +3050,48 @@ "is-arrayish": "^0.2.1" } }, + "node_modules/esbuild": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", + "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.7", + "@esbuild/android-arm": "0.27.7", + "@esbuild/android-arm64": "0.27.7", + "@esbuild/android-x64": "0.27.7", + "@esbuild/darwin-arm64": "0.27.7", + "@esbuild/darwin-x64": "0.27.7", + "@esbuild/freebsd-arm64": "0.27.7", + "@esbuild/freebsd-x64": "0.27.7", + "@esbuild/linux-arm": "0.27.7", + "@esbuild/linux-arm64": "0.27.7", + "@esbuild/linux-ia32": "0.27.7", + "@esbuild/linux-loong64": "0.27.7", + "@esbuild/linux-mips64el": "0.27.7", + "@esbuild/linux-ppc64": "0.27.7", + "@esbuild/linux-riscv64": "0.27.7", + "@esbuild/linux-s390x": "0.27.7", + "@esbuild/linux-x64": "0.27.7", + "@esbuild/netbsd-arm64": "0.27.7", + "@esbuild/netbsd-x64": "0.27.7", + "@esbuild/openbsd-arm64": "0.27.7", + "@esbuild/openbsd-x64": "0.27.7", + "@esbuild/openharmony-arm64": "0.27.7", + "@esbuild/sunos-x64": "0.27.7", + "@esbuild/win32-arm64": "0.27.7", + "@esbuild/win32-ia32": "0.27.7", + "@esbuild/win32-x64": "0.27.7" + } + }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -2660,16 +3258,6 @@ "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/from2": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", - "integrity": "sha512-OMcX/4IC/uqEPVgGeyfN22LJk6AZrMkRZHxcHBMBvHScDGgwTm2GT2Wkgtocyd3JfZffjj2kYUDXXII0Fk9W0g==", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "^2.0.0" - } - }, "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -2741,6 +3329,18 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-east-asian-width": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.5.0.tgz", + "integrity": "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -2928,16 +3528,13 @@ "dev": true }, "node_modules/into-stream": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-6.0.0.tgz", - "integrity": "sha512-XHbaOAvP+uFKUFsOgoNPRjLkwB+I22JFPFe5OjTkQ0nwgj6+pSjb4NmB6VMxaPshLiOf+zcpOCBQuLwC1KHhZA==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/into-stream/-/into-stream-9.1.0.tgz", + "integrity": "sha512-DRsRnQrbzdFjaQ1oe4C6/EIUymIOEix1qROEJTF9dbMq+M4Zrm6VaLp6SD/B9IsiEjPZuBSnWWFN+udajugdWA==", "dev": true, - "dependencies": { - "from2": "^2.3.0", - "p-is-promise": "^3.0.0" - }, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=20" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -2970,6 +3567,7 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, "engines": { "node": ">=8" } @@ -3205,6 +3803,68 @@ } } }, + "node_modules/jest-cli/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-cli/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/jest-cli/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/jest-cli/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/jest-config": { "version": "30.3.0", "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-30.3.0.tgz", @@ -4082,15 +4742,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/p-is-promise": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-3.0.0.tgz", - "integrity": "sha512-Wo8VsW4IRQSKVXsJCn7TomUaVtyfjVDn3nUP7kE967BQk0CwFpdbZs0X0uk5sW9mkBa9eNM7hCMaG93WUAwxYQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -4240,9 +4891,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", "engines": { @@ -4275,6 +4926,22 @@ "node": ">=8" } }, + "node_modules/postject": { + "version": "1.0.0-alpha.6", + "resolved": "https://registry.npmjs.org/postject/-/postject-1.0.0-alpha.6.tgz", + "integrity": "sha512-b9Eb8h2eVqNE8edvKdwqkrY6O7kAwmI8kcnBv1NScolYJbo59XUF0noFq+lxbC1yN20bmC0WBEbDC5H/7ASb0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "commander": "^9.4.0" + }, + "bin": { + "postject": "dist/cli.js" + }, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/prebuild-install": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.1.tgz", @@ -4413,6 +5080,8 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", "engines": { "node": ">=0.10.0" } @@ -4461,6 +5130,16 @@ "node": ">=8" } }, + "node_modules/resolve.exports": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -4629,9 +5308,9 @@ } }, "node_modules/streamx": { - "version": "2.23.0", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.23.0.tgz", - "integrity": "sha512-kn+e44esVfn2Fa/O0CPFcex27fjIL6MkVae0Mm6q+E6f0hWv578YCERbv+4m02cjxvDsPKLnmxral/rR6lBMAg==", + "version": "2.25.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.25.0.tgz", + "integrity": "sha512-0nQuG6jf1w+wddNEEXCF4nTg3LtufWINB5eFEN+5TNZW7KWJp6x87+JFL43vaAUPyCfH1wID+mNVyW6OHtFamg==", "dev": true, "license": "MIT", "dependencies": { @@ -4667,6 +5346,7 @@ "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -4696,6 +5376,7 @@ "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { "ansi-regex": "^5.0.1" }, @@ -4788,9 +5469,9 @@ } }, "node_modules/tar": { - "version": "7.5.9", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.9.tgz", - "integrity": "sha512-BTLcK0xsDh2+PUe9F6c2TlRp4zOOBMTkoQHQIWSIzI0R7KG46uEwq4OPk2W7bZcprBMsuaeFsqwYr7pjh6CuHg==", + "version": "7.5.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.13.tgz", + "integrity": "sha512-tOG/7GyXpFevhXVh8jOPJrmtRpOTsYqUIkVdVooZYJS/z8WhfQUX8RJILmeuJNinGAMSu1veBr4asSHFt5/hng==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -4857,6 +5538,16 @@ "node": ">=18" } }, + "node_modules/teex": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz", + "integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "streamx": "^2.12.5" + } + }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -4873,9 +5564,9 @@ } }, "node_modules/test-exclude/node_modules/brace-expansion": { - "version": "1.1.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", - "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.14.tgz", + "integrity": "sha512-MWPGfDxnyzKU7rNOW9SP/c50vi3xrmrua/+6hfPbCS2ABNWfx24vPidzvC7krjU/RTo235sV776ymlsMtGKj8g==", "dev": true, "license": "MIT", "dependencies": { @@ -4919,9 +5610,9 @@ } }, "node_modules/text-decoder": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.3.tgz", - "integrity": "sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.7.tgz", + "integrity": "sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -5182,16 +5873,17 @@ } }, "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz", + "integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==", + "license": "MIT", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "ansi-styles": "^6.2.1", + "string-width": "^7.0.0", + "strip-ansi": "^7.1.0" }, "engines": { - "node": ">=10" + "node": ">=18" }, "funding": { "url": "https://github.com/chalk/wrap-ansi?sponsor=1" @@ -5216,6 +5908,68 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT" + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -5255,43 +6009,79 @@ } }, "node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-18.0.0.tgz", + "integrity": "sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==", "license": "MIT", "dependencies": { - "cliui": "^8.0.1", + "cliui": "^9.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", + "string-width": "^7.2.0", "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" + "yargs-parser": "^22.0.0" }, "engines": { - "node": ">=12" + "node": "^20.19.0 || ^22.12.0 || >=23" } }, "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "license": "ISC", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "node_modules/yargs/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "license": "MIT", "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, - "node_modules/yargs/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "license": "ISC", + "node_modules/yargs/node_modules/emoji-regex": { + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz", + "integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==", + "license": "MIT" + }, + "node_modules/yargs/node_modules/string-width": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz", + "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==", + "license": "MIT", "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" + "emoji-regex": "^10.3.0", + "get-east-asian-width": "^1.0.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" }, "engines": { "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, "node_modules/yocto-queue": { diff --git a/package.json b/package.json index 6a4c49fe..38d055c3 100644 --- a/package.json +++ b/package.json @@ -2,11 +2,12 @@ "name": "@emacs-eask/cli", "version": "0.12.10", "description": "A set of command-line tools to build Emacs packages", + "type": "module", "main": "eask.js", "scripts": { - "test-unsafe": "cross-env ALLOW_UNSAFE=1 jest", - "test-debug": "cross-env DEBUG=1 jest", - "test": "jest", + "test-unsafe": "cross-env NODE_OPTIONS=--experimental-vm-modules ALLOW_UNSAFE=1 jest", + "test-debug": "cross-env NODE_OPTIONS=--experimental-vm-modules DEBUG=1 jest", + "test": "cross-env NODE_OPTIONS=--experimental-vm-modules jest", "test-reset": "rm -rf ./test/jest/.eask ./test/jest/*/.eask; git restore ./test/jest/*/", "pkg-all": "pkg package.json", "pkg-linux-arm64": "pkg package.json -t node*-linuxstatic-arm64 --output dist/eask --public", @@ -33,10 +34,10 @@ "license": "GPL-3.0-or-later", "dependencies": { "which": "^6.0.0", - "yargs": "^17.0.0" + "yargs": "^18.0.0" }, "devDependencies": { - "@yao-pkg/pkg": "^6.0.0", + "@yao-pkg/pkg": "^6.16.0", "cross-env": "^10.1.0", "jest": "^30.3.0", "semver-compare": "^1.0.0" diff --git a/src/env.js b/src/env.js index 9f29fdac..048da7f8 100644 --- a/src/env.js +++ b/src/env.js @@ -17,30 +17,29 @@ "use strict"; -const os = require('os'); -const path = require('path'); +import os from 'os'; +import path from 'path'; -global.UTIL = require('./util'); -global.IS_PKG = path.basename(process.execPath).startsWith('eask'); +export const IS_PKG = path.basename(process.execPath).startsWith('eask'); /* Environment PATH */ -global.EASK_HOMEDIR = os.homedir().replace(/\\/g, '/') + '/.eask/'; +export const EASK_HOMEDIR = os.homedir().replace(/\\/g, '/') + '/.eask/'; -global.EASK_EMACS = process.env.EMACS || process.env.EASK_EMACS || "emacs"; +export const EASK_EMACS = process.env.EMACS || process.env.EASK_EMACS || "emacs"; process.env.EMACS = EASK_EMACS; // Set back the value. /* Titles */ -global.TITLE_CMD_OPTION = 'Command Options:'; -global.TITLE_PROXY_OPTION = 'Proxy Options:'; +export const TITLE_CMD_OPTION = 'Command Options:'; +export const TITLE_PROXY_OPTION = 'Proxy Options:'; /* Exit Code * * This must match with the variable `eask--exit-code` in * the file `lisp/_prepare.el`. */ -global.EXIT_SUCCESS = 0; -global.EXIT_FAILURE = 1; -global.EXIT_MISUSE = 2; +export const EXIT_SUCCESS = 0; +export const EXIT_FAILURE = 1; +export const EXIT_MISUSE = 2; /* CI */ -global.GITHUB_ACTIONS = (process.env.GITHUB_WORKSPACE !== undefined); +export const GITHUB_ACTIONS = (process.env.GITHUB_WORKSPACE !== undefined); diff --git a/src/util.js b/src/util.js index cf562c54..b983ba78 100644 --- a/src/util.js +++ b/src/util.js @@ -17,23 +17,27 @@ "use strict"; -const path = require('path'); -const child_process = require("child_process"); +import path from 'path'; +import child_process from 'child_process'; +import _which from 'which'; +import { IS_PKG, EASK_EMACS, EASK_HOMEDIR, GITHUB_ACTIONS, EXIT_FAILURE } from './env.js'; + +const __dirname = import.meta.dirname; /** * Check to see if a program is installed and exists on the path. * @param { String } command - Program name. * @return Return path or null if not found. */ -function which(command) { - return require('which').sync(command, { nothrow: true }); +export function which(command) { + return _which.sync(command, { nothrow: true }); } /** * Convert Windows backslash paths to slash paths: `foo\\bar` -> `foo/bar` * @see https://github.com/sindresorhus/slash */ -function slash(path) { +export function slash(path) { const isExtendedLengthPath = path.startsWith('\\\\?\\'); if (isExtendedLengthPath) { return path; @@ -46,14 +50,14 @@ function slash(path) { * @param { String } str - String to escape string. * @return Escaped string. */ -function escape_str(str) { +export function escape_str(str) { return str.replaceAll('\"', '\\"'); } /** * Return arguments after matching string. */ -function take_after(arr, str) { +export function take_after(arr, str) { let index = arr.indexOf(str); if (index === -1) return arr; @@ -75,7 +79,7 @@ function _rest_args() { * @see https://github.com/emacs-eask/cli/issues/128 * @param { Array } argv - Argument vector. */ -function cli_args(argv) { +export function cli_args(argv) { let result = ''; let first = true; argv.forEach(function (element) { @@ -102,7 +106,7 @@ function _remove_undefined(arr) { } /* Return plugin directory */ -function plugin_dir() { +export function plugin_dir() { let root = (IS_PKG) ? process.execPath : __dirname; return path.join(root, '..'); } @@ -112,7 +116,7 @@ function plugin_dir() { * @param { boolean } arg - argument receive from yargs. * @param { string } name - the flag representation in alias. */ -function def_flag(arg, name, val = undefined) { +export function def_flag(arg, name, val = undefined) { if (arg === undefined) return undefined; if (val === undefined) @@ -134,7 +138,7 @@ function _invocation() { /** * Setup the environment variables so Emacs could receive them. */ -function setup_env() { +export function setup_env() { /* Home Directory */ process.env.EASK_INVOCATION = _invocation(); process.env.EASK_HOMEDIR = EASK_HOMEDIR; @@ -208,7 +212,7 @@ function _check_argv(argv) { * Form elisp script path. * @param { string } name - Name of the script without extension. */ -function el_script(name) { +export function el_script(name) { let _script = 'lisp/' + name + '.el'; let _path = path.join(plugin_dir(), _script); return _path; @@ -233,7 +237,7 @@ function _environment_name (argv) { * @param { string } script - name of the script from `../lisp` * @param { string } args - the rest of the arguments */ -async function e_call(argv, script, ...args) { +export async function e_call(argv, script, ...args) { if (!which(EASK_EMACS)) { console.warn("Emacs is not installed (cannot find `" + EASK_EMACS + "' executable)"); return; @@ -283,7 +287,7 @@ async function e_call(argv, script, ...args) { * Get the command count, not including options. * @return Return a size of the command array. */ -function cmd_count() { +export function cmd_count() { let args = process.argv.slice(2); args = args.filter(elm => { return !elm.startsWith('-'); }); return args.length; @@ -295,28 +299,9 @@ function cmd_count() { * @param { integer } level - used to compare with command count. * @return Return a string to show command, else we return false. */ -function hide_cmd(description, level = 1) { +export function hide_cmd(description, level = 1) { if ((process.argv.includes('--show-hidden')) || level <= cmd_count()) // When display in submenu! return description; return false; } - - -/* - * Module Exports - */ -module.exports.which = which; -module.exports.slash = slash; - -module.exports.escape_str = escape_str; -module.exports.take_after = take_after; -module.exports.cli_args = cli_args; -module.exports.plugin_dir = plugin_dir; -module.exports.def_flag = def_flag; -module.exports.setup_env = setup_env; -module.exports.el_script = el_script; -module.exports.e_call = e_call; - -module.exports.hide_cmd = hide_cmd; -module.exports.cmd_count = cmd_count; diff --git a/test/jest/analyze.test.js b/test/jest/analyze.test.js index 1054be49..744ad036 100644 --- a/test/jest/analyze.test.js +++ b/test/jest/analyze.test.js @@ -1,4 +1,4 @@ -const { TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; /** * Clean output and attempt to parse as JSON. diff --git a/test/jest/compile.test.js b/test/jest/compile.test.js index 53cdfee7..7d793e8d 100644 --- a/test/jest/compile.test.js +++ b/test/jest/compile.test.js @@ -1,4 +1,4 @@ -const { TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("compile", () => { const ctx = new TestContext("./test/jest/compile"); diff --git a/test/jest/config.test.js b/test/jest/config.test.js index 432f2bc3..f5b61aa0 100644 --- a/test/jest/config.test.js +++ b/test/jest/config.test.js @@ -1,7 +1,7 @@ -const { testUnsafe, TestContext } = require("./helpers"); -const fs = require("node:fs/promises"); -const path = require("node:path"); -const process = require("node:process"); +import fs from "node:fs/promises"; +import path from "node:path"; +import process from "node:process"; +import { testUnsafe, TestContext } from "./helpers.js"; describe("config param", () => { const ctx = new TestContext(); diff --git a/test/jest/docker.test.js b/test/jest/docker.test.js index 4e0eff8e..1423d55f 100644 --- a/test/jest/docker.test.js +++ b/test/jest/docker.test.js @@ -1,4 +1,4 @@ -const { TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("docker", () => { const ctx = new TestContext("./test/jest/docker"); diff --git a/test/jest/emacs.test.js b/test/jest/emacs.test.js index d35d9252..a6781a90 100644 --- a/test/jest/emacs.test.js +++ b/test/jest/emacs.test.js @@ -1,4 +1,4 @@ -const { TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("emacs", () => { const ctx = new TestContext("./test/jest/empty"); diff --git a/test/jest/exec.test.js b/test/jest/exec.test.js index 6df6915f..d7764d30 100644 --- a/test/jest/exec.test.js +++ b/test/jest/exec.test.js @@ -1,4 +1,4 @@ -const { emacsVersion, TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("exec", () => { const ctx = new TestContext("./test/jest/exec"); diff --git a/test/jest/exit-status.test.js b/test/jest/exit-status.test.js index f028d0af..86951d04 100644 --- a/test/jest/exit-status.test.js +++ b/test/jest/exit-status.test.js @@ -1,4 +1,4 @@ -const { TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("exit-status", () => { const ctx = new TestContext("./test/jest/empty"); diff --git a/test/jest/global.test.js b/test/jest/global.test.js index e24f54f5..f857a149 100644 --- a/test/jest/global.test.js +++ b/test/jest/global.test.js @@ -1,8 +1,7 @@ -const fs = require("node:fs/promises"); -const path = require("node:path"); -const process = require("node:process"); - -const { testUnsafe, TestContext } = require("./helpers"); +import fs from "node:fs/promises"; +import path from 'node:path'; +import process from "node:process"; +import { testUnsafe, TestContext } from "./helpers.js"; describe("global", () => { // global => install to ~/.eask diff --git a/test/jest/helpers.js b/test/jest/helpers.js index df0b3d7d..485cd185 100644 --- a/test/jest/helpers.js +++ b/test/jest/helpers.js @@ -1,10 +1,9 @@ -const util = require("node:util"); -const exec = util.promisify(require("node:child_process").exec); -const fs = require("node:fs/promises"); -const path = require("node:path"); +import util from 'node:util'; +import { exec as execCallback } from 'node:child_process'; +import fs from 'node:fs/promises'; +import path from 'node:path'; -// Load the environment. -const env = require('../../src/env'); +export const exec = util.promisify(execCallback); /* * This file uses JsDoc syntax. @@ -19,7 +18,7 @@ const env = require('../../src/env'); * @param {function({ fail: function }): void | function(): PromiseLike.} fn * @param {number} [timeout] */ -function testUnsafe(name, fn, timeout) { +export function testUnsafe(name, fn, timeout) { if (process.env.ALLOW_UNSAFE) { return test(name, fn, timeout); } else { @@ -32,7 +31,7 @@ function testUnsafe(name, fn, timeout) { * This is used in TestContext to limit `exec`. * @returns {number} */ -function getTimeout() { +export function getTimeout() { // parseInt returns NaN if it fails // TIMEOUT <= 0 will be ignored too return Number.parseInt(process.env.TIMEOUT) || 25000; @@ -43,7 +42,7 @@ function getTimeout() { * You can compare lexicographically, e.g. if ((await emacsVersion()) > "27") { ... } * @returns {Promise.} emacs version string. */ -async function emacsVersion() { +export async function emacsVersion() { const text = await exec("emacs --version"); const version = text.stdout.match("Emacs ([^ ]+)")?.[1]; if (!version) { @@ -62,7 +61,7 @@ async function stripAnsi(s) { } /** Provides transformations on output of node.exec(). */ -class CommandOutput { +export class CommandOutput { constructor(output, cwd) { this.stderr = output.stderr; this.stdout = output.stdout; @@ -142,7 +141,7 @@ class CommandOutput { } } -class TestContext { +export class TestContext { /** * @param {string} cwd Current Working Directory, used for all commands. */ @@ -251,11 +250,3 @@ class TestContext { return new CommandOutput(e, this.cwd); } } - -module.exports = { - testUnsafe, - emacsVersion, - TestContext, - getTimeout, - CommandOutput, -}; diff --git a/test/jest/helpers.test.js b/test/jest/helpers.test.js index 888017a7..037ae21a 100644 --- a/test/jest/helpers.test.js +++ b/test/jest/helpers.test.js @@ -1,5 +1,5 @@ -const { CommandOutput } = require("./helpers"); -const path = require("node:path"); +import path from 'node:path'; +import { CommandOutput } from "./helpers.js"; describe("CommandOutput", () => { describe("sanitizeString", () => { diff --git a/test/jest/install.test.js b/test/jest/install.test.js index 43c0832a..067632ce 100644 --- a/test/jest/install.test.js +++ b/test/jest/install.test.js @@ -1,5 +1,5 @@ -const cmp = require('semver-compare'); -const { emacsVersion, TestContext } = require("./helpers"); +import cmp from 'semver-compare'; +import { emacsVersion, TestContext } from "./helpers.js"; describe("install and uninstall", () => { describe("in ./install", () => { diff --git a/test/jest/link.test.js b/test/jest/link.test.js index 04633991..5cf7d114 100644 --- a/test/jest/link.test.js +++ b/test/jest/link.test.js @@ -1,4 +1,4 @@ -const { TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("link", () => { describe("in ./link", () => { diff --git a/test/jest/lint.test.js b/test/jest/lint.test.js index aeed67b5..7c12e04d 100644 --- a/test/jest/lint.test.js +++ b/test/jest/lint.test.js @@ -1,4 +1,4 @@ -const { TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("lint", () => { const ctx = new TestContext("./test/jest/lint"); diff --git a/test/jest/local.test.js b/test/jest/local.test.js index 8c3d505b..33f74494 100644 --- a/test/jest/local.test.js +++ b/test/jest/local.test.js @@ -4,8 +4,8 @@ // Notice, below we clone a random package (repo) that uses Eask as the // dependencies management tool. -const cmp = require('semver-compare'); -const { emacsVersion, TestContext } = require("./helpers"); +import cmp from 'semver-compare'; +import { emacsVersion, TestContext } from "./helpers.js"; describe("local", () => { const cwd = "./test/jest/local"; diff --git a/test/jest/local/Eask b/test/jest/local/Eask index 10dde27f..a4ace4bc 100644 --- a/test/jest/local/Eask +++ b/test/jest/local/Eask @@ -1,7 +1,7 @@ ;; -*- mode: eask; lexical-binding: t -*- (package "mini.pkg.1" - "12.12.13" + "13.13.14" "Minimal test package") (website-url "https://github.com/emacs-eask/cli/tree/master/test/fixtures/mini.pkg.1") diff --git a/test/jest/local/mini.pkg.1.el b/test/jest/local/mini.pkg.1.el index 8ca0c23c..a8927b01 100644 --- a/test/jest/local/mini.pkg.1.el +++ b/test/jest/local/mini.pkg.1.el @@ -5,7 +5,7 @@ ;; Author: Shen, Jen-Chieh ;; URL: https://github.com/emacs-eask/cli/tree/master/test/fixtures/mini.pkg.1 -;; Version: 12.12.13 +;; Version: 13.13.14 ;; Package-Requires: ((emacs "24.3") (s "1.12.0") (fringe-helper "1.0.1")) ;; Keywords: test local diff --git a/test/jest/options.test.js b/test/jest/options.test.js index e44181ce..66e9de06 100644 --- a/test/jest/options.test.js +++ b/test/jest/options.test.js @@ -1,4 +1,5 @@ -const { TestContext } = require("./helpers"); +import { EXIT_FAILURE } from "../../src/env.js"; +import { TestContext } from "./helpers.js"; describe("options", () => { const ctx = new TestContext("./test/jest/options"); diff --git a/test/jest/outdated-upgrade.test.js b/test/jest/outdated-upgrade.test.js index 6ca117c4..51150da5 100644 --- a/test/jest/outdated-upgrade.test.js +++ b/test/jest/outdated-upgrade.test.js @@ -1,4 +1,4 @@ -const { emacsVersion, TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("outdated and upgrade", () => { const ctx = new TestContext("./test/jest/outdated-upgrade"); diff --git a/test/jest/search.test.js b/test/jest/search.test.js index b1a158e9..a8ac1688 100644 --- a/test/jest/search.test.js +++ b/test/jest/search.test.js @@ -1,4 +1,4 @@ -const { TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("search", () => { const cwd = "./test/jest/search"; diff --git a/test/jest/test-buttercup.test.js b/test/jest/test-buttercup.test.js index 7b7293de..fbb1bf27 100644 --- a/test/jest/test-buttercup.test.js +++ b/test/jest/test-buttercup.test.js @@ -1,4 +1,4 @@ -const { TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("buttercup", () => { const ctx = new TestContext("./test/jest/buttercup"); diff --git a/test/jest/test-ecukes.test.js b/test/jest/test-ecukes.test.js index 4a525b2f..e133152d 100644 --- a/test/jest/test-ecukes.test.js +++ b/test/jest/test-ecukes.test.js @@ -1,4 +1,4 @@ -const { TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("test_ecukes", () => { const ctx = new TestContext("./test/jest/ecukes"); diff --git a/test/jest/test-ert-runner.test.js b/test/jest/test-ert-runner.test.js index c40486b0..78c45d19 100644 --- a/test/jest/test-ert-runner.test.js +++ b/test/jest/test-ert-runner.test.js @@ -1,4 +1,4 @@ -const { TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("test ert-runner", () => { const ctx = new TestContext("./test/jest/ert-runner"); diff --git a/test/jest/test-ert.test.js b/test/jest/test-ert.test.js index c44a8697..b404b488 100644 --- a/test/jest/test-ert.test.js +++ b/test/jest/test-ert.test.js @@ -1,4 +1,4 @@ -const { TestContext } = require("./helpers"); +import { TestContext } from "./helpers.js"; describe("test-ert", () => { const ctx = new TestContext("./test/jest/ert"); diff --git a/test/jest/upgrade-eask.test.js b/test/jest/upgrade-eask.test.js index 10c2b9a8..2a97e53a 100644 --- a/test/jest/upgrade-eask.test.js +++ b/test/jest/upgrade-eask.test.js @@ -1,4 +1,4 @@ -const { testUnsafe, TestContext } = require("./helpers"); +import { testUnsafe, TestContext } from "./helpers.js"; describe("upgrade-eask", () => { const ctx = new TestContext();