From 5710ab1dbe00c2de504a8b0620625229de7ff109 Mon Sep 17 00:00:00 2001 From: Ward Cunningham Date: Sat, 13 Sep 2025 11:21:24 -0700 Subject: [PATCH 01/17] revise optional chaining --- client/plugmatic.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/client/plugmatic.js b/client/plugmatic.js index ac34881..678adfc 100644 --- a/client/plugmatic.js +++ b/client/plugmatic.js @@ -2,7 +2,6 @@ * decaffeinate suggestions: * DS102: Remove unnecessary code created because of implicit returns - * DS103: Rewrite code to no longer use __guard__, or convert again using --optional-chaining * DS201: Simplify complex destructure assignments * DS205: Consider reworking code to avoid use of IIFEs * DS207: Consider shorter variations of null checks @@ -119,7 +118,7 @@ const emit = function ($item, item) { const months = plugin.birth ? ((Date.now() - plugin.birth) / 1000 / 3600 / 24 / 31.5).toFixed(0) : '' const status = function () { const installed = plugin.package != null ? plugin.package.version : undefined - const published = __guard__(pub(name).npm, x => x.version) + const published = pub(name).npm?.version return traffic(installed, published) } @@ -143,7 +142,7 @@ const emit = function ($item, item) { case 'installed': return ` ${(plugin.package != null ? plugin.package.version : undefined) || ''}` case 'published': - return ` ${__guard__(pub(name).npm, x => x.version) || ''}` + return ` ${pub(name).npm?.version || ''}` } })(), ) @@ -427,8 +426,4 @@ if (typeof window !== 'undefined' && window !== null) { } if (typeof module !== 'undefined' && module !== null) { module.exports = { parse } -} - -function __guard__(value, transform) { - return typeof value !== 'undefined' && value !== null ? transform(value) : undefined -} +} \ No newline at end of file From b4d771d849abfe709f948cf2c5dc0af15d454843 Mon Sep 17 00:00:00 2001 From: Ward Cunningham Date: Sun, 14 Sep 2025 15:12:15 -0700 Subject: [PATCH 02/17] extract render as module --- client/plugmatic.js | 305 +------------------------------------------- client/render.js | 297 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 303 insertions(+), 299 deletions(-) create mode 100644 client/render.js diff --git a/client/plugmatic.js b/client/plugmatic.js index 678adfc..87e7333 100644 --- a/client/plugmatic.js +++ b/client/plugmatic.js @@ -8,55 +8,7 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md */ -const traffic = function (installed, published) { - const color = { - gray: '#ccc', - red: '#f55', - yellow: '#fb0', - green: '#0e0', - } - - if (installed != null && published != null) { - if (installed === published) { - return color.green - } else { - return color.yellow - } - } else { - if (published != null) { - return color.red - } else { - return color.gray - } - } -} - -const escape = text => text.replace(/&/g, '&').replace(//g, '>') - -const expand = function (string) { - const stashed = [] - const stash = function (text) { - const here = stashed.length - stashed.push(text) - return `〖${here}〗` - } - const unstash = (match, digits) => stashed[+digits] - const internal = function (match, name) { - const slug = wiki.asSlug(name) - const styling = name === name.trim() ? 'internal' : 'internal spaced' - if (slug.length) { - return stash( - `${escape(name)}`, - ) - } else { - return match - } - } - const external = (match, href, protocol) => - stash(`"${escape(href)}"`) - string = string.replace(/〖(\d+)〗/g, '〖 $1 〗').replace(/\[\[([^\]]+)\]\]/gi, internal).replace(/"((http|https|ftp):.*?)"/gi, external) - return escape(string).replace(/〖(\d+)〗/g, unstash) -} +import {render} from './render.js' const parse = function (text) { const result = { columns: [], plugins: [] } @@ -102,263 +54,18 @@ const parse = function (text) { const emit = function ($item, item) { const markup = parse(item.text) - let dialog = null $item.append(`\

loading plugin details

\ `) - const render = function (data) { - let column = 'installed' - const pub = name => data.publish.find(obj => obj.plugin === name) - - const format = function (markup, plugin, dependencies) { - const name = plugin.plugin - const months = plugin.birth ? ((Date.now() - plugin.birth) / 1000 / 3600 / 24 / 31.5).toFixed(0) : '' - const status = function () { - const installed = plugin.package != null ? plugin.package.version : undefined - const published = pub(name).npm?.version - return traffic(installed, published) - } - - const result = [``] - for (column of markup.columns) { - result.push( - (() => { - switch (column) { - case 'status': - return `◉` - case 'name': - return ` ${name}` - case 'menu': - return ` ${(plugin.factory != null ? plugin.factory.category : undefined) || ''}` - case 'pages': - return `${(plugin.pages != null ? plugin.pages.length : undefined) || ''}` - case 'service': - return `${months}` - case 'bundled': - return ` ${dependencies['wiki-plugin-' + name] || ''}` - case 'installed': - return ` ${(plugin.package != null ? plugin.package.version : undefined) || ''}` - case 'published': - return ` ${pub(name).npm?.version || ''}` - } - })(), - ) - } - return result.join('\n') - } - - const report = function (markup, plugins, dependencies) { - let plugin - const retrieve = function (name) { - for (plugin of plugins) { - if (plugin.plugin === name) { - return plugin - } - } - return { plugin: name } - } - const inventory = markup.plugins.length > 0 ? markup.plugins.map(retrieve) : plugins - const head = (() => { - const result1 = [] - for (column of markup.columns) { - result1.push(`${column}`) - } - return result1 - })().join('\n') - const result = (() => { - const result2 = [] - for (let index = 0; index < inventory.length; index++) { - plugin = inventory[index] - result2.push(format(markup, plugin, dependencies)) - } - return result2 - })().join('\n') - return `
\ -

${window.location.host}

\ - ${head} ${result}
\ - \ -
` - } - - const installer = function (row, npm) { - let version - if (npm == null) { - return `

can't find wiki-plugin-${row.plugin} in npmjs.com

` - } - const $row = $item.find(`table [data-name=${row.plugin}]`) - const installed = function (update) { - const index = data.install.indexOf(row) - data.install[index] = row = update.row - $row.find('[title=status]').css('color', traffic(update.installed, npm.version)) - $row.find('[title=menu]').text((row.factory != null ? row.factory.category : undefined) || '') - $row.find('[title=pages]').text((row.pages != null ? row.pages.length : undefined) || '') - $row.find('[title=service]').text('0') - $row.find('[title=installed]').text((row.package != null ? row.package.version : undefined) || '') - return $item.find('button.restart').removeAttr('disabled').show() - } - - window.plugins.plugmatic.install = function (version) { - $.ajax({ - type: 'POST', - url: '/plugin/plugmatic/install', - data: JSON.stringify({ version, plugin: row.plugin }), - contentType: 'application/json; charset=utf-8', - dataType: 'json', - success: installed, - error: trouble, - }) - // http://stackoverflow.com/questions/2933826/how-to-close-jquery-dialog-within-the-dialog - $row.find('[title=status]').css('color', 'white') - return dialog.close() - } - - const array = function (obj) { - if (typeof obj === 'string') { - return [obj] - } else { - return obj - } - } - const choice = function (version) { - const button = () => `` - return ` ${version} ${version === (row.package != null ? row.package.version : undefined) ? 'installed' : button()}` - } - const choices = (() => { - const result = [] - for (version of array(npm.versions).reverse()) { - result.push(choice(version)) - } - return result - })() - return `

${npm.description}

Choose a version to install.

${choices.join('\n')}` - } - - const detail = function (name, done) { - const row = data.install.find(obj => obj.plugin === name) - const text = function (obj) { - if (!obj) { - return '' - } - return expand(obj).replace(/\n/g, '
') - } - const struct = function (obj) { - if (!obj) { - return '' - } - return `
${expand(JSON.stringify(obj, null, '  '))}
` - } - const pages = obj => `

${obj.title}
${expand(obj.synopsis)}

` - const birth = function (obj) { - if (obj) { - return new Date(obj).toString() - } else { - return 'built-in' - } - } - const npmjs = more => $.getJSON(`/plugin/plugmatic/view/${name}`, more) - switch (column) { - case 'status': - return npmjs(npm => done(installer(row, npm))) - case 'name': - return done(text(row.authors)) - case 'menu': - return done(struct(row.factory)) - case 'pages': - return done(row.pages.map(pages).join('')) - case 'service': - return done(birth(row.birth)) - case 'bundled': - return done(struct(data.bundle.data.dependencies)) - case 'installed': - return done(struct(row.package)) - case 'published': - return done(struct(pub(name).npm || '')) - default: - return done('unexpected column') - } - } - - const showdetail = function (e) { - const $parent = $(e.target).parent() - const name = $parent.data('name') - return detail(name, function (html) { - console.log(column, name, $item, item) - if (column === 'status') { - // show dialog - $item.find('dialog').remove() - $item.append(`\ - - ${html} -\ -`) - dialog = $item.find('dialog')[0] - console.log('dialog', dialog) - return dialog.showModal() - } else { - // wiki.dialog "#{name} plugin #{column}", html || '' - const pageKey = $item.parents('.page').data('key') - const context = wiki.lineup.atKey(pageKey).getContext() - const plugmaticDialog = window.open('/plugins/plugmatic/dialog/#', 'plugmatic', 'popup,height=600,width=800') - if (plugmaticDialog.location.pathname !== '/plugins/plugmatic/dialog/') { - return plugmaticDialog.addEventListener('load', event => - plugmaticDialog.postMessage( - { column, title: `${name} plugin ${column}`, body: html || '', pageKey, context }, - window.origin, - ), - ) - } else { - return plugmaticDialog.postMessage( - { column, title: `${name} plugin ${column}`, body: html || '', pageKey, context }, - window.origin, - ) - } - } - }) - } - - const more = function (e) { - if (e.shiftKey) { - return showdetail(e) - } - } - - const bright = function (e) { - more(e) - return $(e.currentTarget).css('background-color', '#f8f8f8') - } - const normal = e => $(e.currentTarget).css('background-color', '#eee') - - $item.find('p').html(report(markup, data.install, data.bundle.data.dependencies)) - $item.find('.row').on({ - mouseenter: bright, - mouseleave: normal, - }) - $item.find('p td').on('click', function (e) { - column = $(e.target).attr('title') - return showdetail(e) - }) - return $item - .find('button.restart') - .hide() - .on('click', function (e) { - $item.find('button.restart').attr('disabled', 'disabled') - return $.ajax({ - type: 'POST', - url: '/plugin/plugmatic/restart', - success() {}, - // poll for restart complete, then ... - // $item.find('button.restart').hide() - error: trouble, - }) - }) - } - var trouble = xhr => $item.find('p').html((xhr.responseJSON != null ? xhr.responseJSON.error : undefined) || 'server error') + const renderproxy = data => + render(data,$item,markup,trouble) + if (markup.plugins.length) { return $.ajax({ type: 'POST', @@ -366,14 +73,14 @@ const emit = function ($item, item) { data: JSON.stringify(markup), contentType: 'application/json; charset=utf-8', dataType: 'json', - success: render, + success: renderproxy, error: trouble, }) } else { return $.ajax({ url: '/plugin/plugmatic/plugins', dataType: 'json', - success: render, + success: renderproxy, error: trouble, }) } diff --git a/client/render.js b/client/render.js new file mode 100644 index 0000000..aeabd2c --- /dev/null +++ b/client/render.js @@ -0,0 +1,297 @@ + const escape = text => text.replace(/&/g, '&').replace(//g, '>') + + const expand = function (string) { + const stashed = [] + const stash = function (text) { + const here = stashed.length + stashed.push(text) + return `〖${here}〗` + } + const unstash = (match, digits) => stashed[+digits] + const internal = function (match, name) { + const slug = wiki.asSlug(name) + const styling = name === name.trim() ? 'internal' : 'internal spaced' + if (slug.length) { + return stash( + `${escape(name)}`, + ) + } else { + return match + } + } + const external = (match, href, protocol) => + stash(`"${escape(href)}"`) + string = string.replace(/〖(\d+)〗/g, '〖 $1 〗').replace(/\[\[([^\]]+)\]\]/gi, internal).replace(/"((http|https|ftp):.*?)"/gi, external) + return escape(string).replace(/〖(\d+)〗/g, unstash) + } + const traffic = function (installed, published) { + const color = { + gray: '#ccc', + red: '#f55', + yellow: '#fb0', + green: '#0e0', + } + + if (installed != null && published != null) { + if (installed === published) { + return color.green + } else { + return color.yellow + } + } else { + if (published != null) { + return color.red + } else { + return color.gray + } + } + } + + var dialog + + export const render = function (data,$item,markup,trouble) { + let column = 'installed' + const pub = name => data.publish.find(obj => obj.plugin === name) + + const format = function (markup, plugin, dependencies) { + const name = plugin.plugin + const months = plugin.birth ? ((Date.now() - plugin.birth) / 1000 / 3600 / 24 / 31.5).toFixed(0) : '' + const status = function () { + const installed = plugin.package != null ? plugin.package.version : undefined + const published = pub(name).npm?.version + return traffic(installed, published) + } + + const result = [``] + for (column of markup.columns) { + result.push( + (() => { + switch (column) { + case 'status': + return `
◉` + case 'name': + return ` ${name}` + case 'menu': + return ` ${(plugin.factory != null ? plugin.factory.category : undefined) || ''}` + case 'pages': + return `${(plugin.pages != null ? plugin.pages.length : undefined) || ''}` + case 'service': + return `${months}` + case 'bundled': + return ` ${dependencies['wiki-plugin-' + name] || ''}` + case 'installed': + return ` ${(plugin.package != null ? plugin.package.version : undefined) || ''}` + case 'published': + return ` ${pub(name).npm?.version || ''}` + } + })(), + ) + } + return result.join('\n') + } + + const report = function (markup, plugins, dependencies) { + let plugin + const retrieve = function (name) { + for (plugin of plugins) { + if (plugin.plugin === name) { + return plugin + } + } + return { plugin: name } + } + const inventory = markup.plugins.length > 0 ? markup.plugins.map(retrieve) : plugins + const head = (() => { + const result1 = [] + for (column of markup.columns) { + result1.push(`${column}`) + } + return result1 + })().join('\n') + const result = (() => { + const result2 = [] + for (let index = 0; index < inventory.length; index++) { + plugin = inventory[index] + result2.push(format(markup, plugin, dependencies)) + } + return result2 + })().join('\n') + return `
\ +

${window.location.host}

\ + ${head} ${result}
\ + \ +
` + } + + const installer = function (row, npm) { + let version + if (npm == null) { + return `

can't find wiki-plugin-${row.plugin} in npmjs.com

` + } + const $row = $item.find(`table [data-name=${row.plugin}]`) + const installed = function (update) { + const index = data.install.indexOf(row) + data.install[index] = row = update.row + $row.find('[title=status]').css('color', traffic(update.installed, npm.version)) + $row.find('[title=menu]').text((row.factory != null ? row.factory.category : undefined) || '') + $row.find('[title=pages]').text((row.pages != null ? row.pages.length : undefined) || '') + $row.find('[title=service]').text('0') + $row.find('[title=installed]').text((row.package != null ? row.package.version : undefined) || '') + return $item.find('button.restart').removeAttr('disabled').show() + } + + window.plugins.plugmatic.install = function (version) { + $.ajax({ + type: 'POST', + url: '/plugin/plugmatic/install', + data: JSON.stringify({ version, plugin: row.plugin }), + contentType: 'application/json; charset=utf-8', + dataType: 'json', + success: installed, + error: trouble, + }) + // http://stackoverflow.com/questions/2933826/how-to-close-jquery-dialog-within-the-dialog + $row.find('[title=status]').css('color', 'white') + return dialog.close() + } + + const array = function (obj) { + if (typeof obj === 'string') { + return [obj] + } else { + return obj + } + } + const choice = function (version) { + const button = () => `` + return `
${version} ${version === (row.package != null ? row.package.version : undefined) ? 'installed' : button()}` + } + const choices = (() => { + const result = [] + for (version of array(npm.versions).reverse()) { + result.push(choice(version)) + } + return result + })() + return `

${npm.description}

Choose a version to install.

${choices.join('\n')}` + } + + const detail = function (name, done) { + const row = data.install.find(obj => obj.plugin === name) + const text = function (obj) { + if (!obj) { + return '' + } + return expand(obj).replace(/\n/g, '
') + } + const struct = function (obj) { + if (!obj) { + return '' + } + return `
${expand(JSON.stringify(obj, null, '  '))}
` + } + const pages = obj => `

${obj.title}
${expand(obj.synopsis)}

` + const birth = function (obj) { + if (obj) { + return new Date(obj).toString() + } else { + return 'built-in' + } + } + const npmjs = more => $.getJSON(`/plugin/plugmatic/view/${name}`, more) + switch (column) { + case 'status': + return npmjs(npm => done(installer(row, npm))) + case 'name': + return done(text(row.authors)) + case 'menu': + return done(struct(row.factory)) + case 'pages': + return done(row.pages.map(pages).join('')) + case 'service': + return done(birth(row.birth)) + case 'bundled': + return done(struct(data.bundle.data.dependencies)) + case 'installed': + return done(struct(row.package)) + case 'published': + return done(struct(pub(name).npm || '')) + default: + return done('unexpected column') + } + } + + const showdetail = function (e) { + const $parent = $(e.target).parent() + const name = $parent.data('name') + return detail(name, function (html) { + // console.log(column, name, $item, item) + if (column === 'status') { + // show dialog + $item.find('dialog').remove() + $item.append(`\ + + ${html} +\ +`) + dialog = $item.find('dialog')[0] + console.log('dialog', dialog) + return dialog.showModal() + } else { + // wiki.dialog "#{name} plugin #{column}", html || '' + const pageKey = $item.parents('.page').data('key') + const context = wiki.lineup.atKey(pageKey).getContext() + const plugmaticDialog = window.open('/plugins/plugmatic/dialog/#', 'plugmatic', 'popup,height=600,width=800') + if (plugmaticDialog.location.pathname !== '/plugins/plugmatic/dialog/') { + return plugmaticDialog.addEventListener('load', event => + plugmaticDialog.postMessage( + { column, title: `${name} plugin ${column}`, body: html || '', pageKey, context }, + window.origin, + ), + ) + } else { + return plugmaticDialog.postMessage( + { column, title: `${name} plugin ${column}`, body: html || '', pageKey, context }, + window.origin, + ) + } + } + }) + } + + const more = function (e) { + if (e.shiftKey) { + return showdetail(e) + } + } + + const bright = function (e) { + more(e) + return $(e.currentTarget).css('background-color', '#f8f8f8') + } + const normal = e => $(e.currentTarget).css('background-color', '#eee') + + $item.find('p').html(report(markup, data.install, data.bundle.data.dependencies)) + $item.find('.row').on({ + mouseenter: bright, + mouseleave: normal, + }) + $item.find('p td').on('click', function (e) { + column = $(e.target).attr('title') + return showdetail(e) + }) + return $item + .find('button.restart') + .hide() + .on('click', function (e) { + $item.find('button.restart').attr('disabled', 'disabled') + return $.ajax({ + type: 'POST', + url: '/plugin/plugmatic/restart', + success() {}, + // poll for restart complete, then ... + // $item.find('button.restart').hide() + error: trouble, + }) + }) + } From 06a24f464edc9a75cbfe3675dd0875384043970c Mon Sep 17 00:00:00 2001 From: Ward Cunningham Date: Sun, 14 Sep 2025 15:54:59 -0700 Subject: [PATCH 03/17] stub for BROWSE option --- client/browse.js | 7 +++++ client/plugmatic.js | 16 +++++++++-- pages/browse-all-plugins | 60 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 3 deletions(-) create mode 100644 client/browse.js create mode 100644 pages/browse-all-plugins diff --git a/client/browse.js b/client/browse.js new file mode 100644 index 0000000..d23055c --- /dev/null +++ b/client/browse.js @@ -0,0 +1,7 @@ +export function browse (data,$item) { + const install = data.install + const result = $item.get(0).querySelector('p') + const categories = ['format','data','other','system', 'option'] + const system = ['activity','changes','factory','flagmatic','journalmatic','future','image','paragraph','present','recycler','reference','register'] + result.innerHTML = "hello world" +} \ No newline at end of file diff --git a/client/plugmatic.js b/client/plugmatic.js index 87e7333..98ed36b 100644 --- a/client/plugmatic.js +++ b/client/plugmatic.js @@ -9,9 +9,10 @@ */ import {render} from './render.js' +import {browse} from './browse.js' const parse = function (text) { - const result = { columns: [], plugins: [] } + const result = { columns: [], plugins: [], features: [] } const lines = (text || '').split(/\n+/) for (var line of lines) { var m @@ -39,6 +40,11 @@ const parse = function (text) { if (line.match(/\bPUBLISHED\b/)) { result.columns.push('published') } + + if (line.match(/\bBROWSE\b/)) { + result.features.push('browse') + } + if ((m = line.match(/^wiki-plugin-(\w+)$/))) { result.plugins.push(m[1]) } @@ -63,8 +69,12 @@ const emit = function ($item, item) { var trouble = xhr => $item.find('p').html((xhr.responseJSON != null ? xhr.responseJSON.error : undefined) || 'server error') - const renderproxy = data => - render(data,$item,markup,trouble) + const renderproxy = data => { + if(markup.features.includes('browse')) + browse(data,$item) + else + render(data,$item,markup,trouble) + } if (markup.plugins.length) { return $.ajax({ diff --git a/pages/browse-all-plugins b/pages/browse-all-plugins new file mode 100644 index 0000000..06c9ab0 --- /dev/null +++ b/pages/browse-all-plugins @@ -0,0 +1,60 @@ +{ + "title": "Browse All Plugins", + "story": [ + { + "type": "paragraph", + "id": "66904721316f5a0f", + "text": "We enlarge on the information offered by the Factory plugin, the item that becomes the kind of item one desires." + }, + { + "type": "plugmatic", + "id": "4f707c7b35500df5", + "text": "BROWSE" + } + ], + "journal": [ + { + "type": "create", + "item": { + "title": "Browse All Plugins", + "story": [] + }, + "date": 1757699966887 + }, + { + "item": { + "type": "paragraph", + "id": "66904721316f5a0f", + "text": "We enlarge on the information offered by the Factory plugin, the item that becomes the kind of item one desires." + }, + "id": "66904721316f5a0f", + "type": "add", + "date": 1757700037250 + }, + { + "type": "fork", + "date": 1757890109877 + }, + { + "item": { + "type": "plugmatic", + "id": "4f707c7b35500df5", + "text": "BROWSE" + }, + "id": "4f707c7b35500df5", + "type": "add", + "after": "66904721316f5a0f", + "date": 1757890112075 + }, + { + "type": "edit", + "id": "4f707c7b35500df5", + "item": { + "type": "plugmatic", + "id": "4f707c7b35500df5", + "text": "BROWSE" + }, + "date": 1757890123194 + } + ] +} \ No newline at end of file From ad773b6b2c1e0fab8611bc881dcf9294283f2fdc Mon Sep 17 00:00:00 2001 From: Ward Cunningham Date: Sun, 14 Sep 2025 18:38:02 -0700 Subject: [PATCH 04/17] all of browse except linking; now in hamburger menu --- client/browse.js | 66 +++++++++++++++++++++++++++++++++++++++++++++++- factory.json | 3 ++- 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/client/browse.js b/client/browse.js index d23055c..73819bc 100644 --- a/client/browse.js +++ b/client/browse.js @@ -3,5 +3,69 @@ export function browse (data,$item) { const result = $item.get(0).querySelector('p') const categories = ['format','data','other','system', 'option'] const system = ['activity','changes','factory','flagmatic','journalmatic','future','image','paragraph','present','recycler','reference','register'] - result.innerHTML = "hello world" + + result.innerHTML = categories.map(category => ` +

${category}

+ ${install + .filter(plugin => { + const have = plugin.factory?.category + if (system.includes(plugin.plugin)) return (category == 'system') + return (category == (have||'option')) + }) + .map(format) + .join("\n")}` + ) + + function format(plugin) { + return ` +
+ + ${plugin.plugin} — ${plugin.factory?.title??'missing'} + + ${details(plugin)} +
+ ` + } + + function details(plugin) { + function escape(markup) { + return markup + .replaceAll(/&/g, '&') + .replaceAll(//g, '>') + .replaceAll(/\[\[(.*?)\]\]/g, '$1') + .replaceAll(/\[.*? (.*?)\]/g, '$1') + } + const html = (plugin.pages||[]).map(page => ` +

+ ${page.title} — ${escape(page.synopsis??'')} +

+ `).join("\n") + const report = { + author: plugin?.package.author, + contributors: plugin?.package.contributors, + version: plugin?.package.version, + repository: plugin?.package.repository + } + return ` +
+ ${html} +
more ... +
${JSON.stringify(report,null,2)}
+
+
` + } + + for (const anchor of result.querySelectorAll('a')) { + anchor.addEventListener('click',event => { + event.preventDefault() + const target = event.target + const type = target.innerText.trim() + const slug = target.dataset?.slug ? + target.dataset.slug : + `about-${type}-plugin` + // frame.link(slug,event.shiftKey) + console.log({slug,shift:event.shiftKey}) + }) + } } \ No newline at end of file diff --git a/factory.json b/factory.json index 157cb17..3c93f9e 100644 --- a/factory.json +++ b/factory.json @@ -1,5 +1,6 @@ { "name": "Plugmatic", "title": "Plugmatic Plugin", - "category": "other" + "category": "other", + "pages": ["Browse All Plugins"] } From 452a0b9b8b4993692dec4d228a96b5e9991ba129 Mon Sep 17 00:00:00 2001 From: Ward Cunningham Date: Mon, 15 Sep 2025 10:28:30 -0700 Subject: [PATCH 05/17] complete doInternalLink --- client/browse.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/browse.js b/client/browse.js index 73819bc..4b3b00f 100644 --- a/client/browse.js +++ b/client/browse.js @@ -64,8 +64,8 @@ export function browse (data,$item) { const slug = target.dataset?.slug ? target.dataset.slug : `about-${type}-plugin` - // frame.link(slug,event.shiftKey) - console.log({slug,shift:event.shiftKey}) + const $page = event.shiftKey ? null : $(target.closest('.page')) + wiki.doInternalLink(slug, $page) }) } } \ No newline at end of file From 918a77cedbdd7ea56819aea94f6265d30a4e8889 Mon Sep 17 00:00:00 2001 From: Ward Cunningham Date: Mon, 15 Sep 2025 10:35:30 -0700 Subject: [PATCH 06/17] prettier formated --- client/browse.js | 54 +++-- client/plugmatic.js | 12 +- client/render.js | 513 ++++++++++++++++++++++---------------------- 3 files changed, 298 insertions(+), 281 deletions(-) diff --git a/client/browse.js b/client/browse.js index 4b3b00f..c68d4f3 100644 --- a/client/browse.js +++ b/client/browse.js @@ -1,26 +1,40 @@ -export function browse (data,$item) { +export function browse(data, $item) { const install = data.install const result = $item.get(0).querySelector('p') - const categories = ['format','data','other','system', 'option'] - const system = ['activity','changes','factory','flagmatic','journalmatic','future','image','paragraph','present','recycler','reference','register'] + const categories = ['format', 'data', 'other', 'system', 'option'] + const system = [ + 'activity', + 'changes', + 'factory', + 'flagmatic', + 'journalmatic', + 'future', + 'image', + 'paragraph', + 'present', + 'recycler', + 'reference', + 'register', + ] - result.innerHTML = categories.map(category => ` + result.innerHTML = categories.map( + category => `

${category}

${install .filter(plugin => { const have = plugin.factory?.category - if (system.includes(plugin.plugin)) return (category == 'system') - return (category == (have||'option')) + if (system.includes(plugin.plugin)) return category == 'system' + return category == (have || 'option') }) .map(format) - .join("\n")}` - ) + .join('\n')}`, + ) function format(plugin) { return `
- ${plugin.plugin} — ${plugin.factory?.title??'missing'} + ${plugin.plugin} — ${plugin.factory?.title ?? 'missing'} ${details(plugin)}
@@ -36,36 +50,38 @@ export function browse (data,$item) { .replaceAll(/\[\[(.*?)\]\]/g, '$1') .replaceAll(/\[.*? (.*?)\]/g, '$1') } - const html = (plugin.pages||[]).map(page => ` + const html = (plugin.pages || []) + .map( + page => `

- ${page.title} — ${escape(page.synopsis??'')} + ${page.title} — ${escape(page.synopsis ?? '')}

- `).join("\n") + `, + ) + .join('\n') const report = { author: plugin?.package.author, contributors: plugin?.package.contributors, version: plugin?.package.version, - repository: plugin?.package.repository + repository: plugin?.package.repository, } return `
${html}
more ... -
${JSON.stringify(report,null,2)}
+
${JSON.stringify(report, null, 2)}

` } for (const anchor of result.querySelectorAll('a')) { - anchor.addEventListener('click',event => { + anchor.addEventListener('click', event => { event.preventDefault() const target = event.target const type = target.innerText.trim() - const slug = target.dataset?.slug ? - target.dataset.slug : - `about-${type}-plugin` + const slug = target.dataset?.slug ? target.dataset.slug : `about-${type}-plugin` const $page = event.shiftKey ? null : $(target.closest('.page')) wiki.doInternalLink(slug, $page) }) } -} \ No newline at end of file +} diff --git a/client/plugmatic.js b/client/plugmatic.js index 98ed36b..623e55f 100644 --- a/client/plugmatic.js +++ b/client/plugmatic.js @@ -8,8 +8,8 @@ * Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md */ -import {render} from './render.js' -import {browse} from './browse.js' +import { render } from './render.js' +import { browse } from './browse.js' const parse = function (text) { const result = { columns: [], plugins: [], features: [] } @@ -70,10 +70,8 @@ const emit = function ($item, item) { $item.find('p').html((xhr.responseJSON != null ? xhr.responseJSON.error : undefined) || 'server error') const renderproxy = data => { - if(markup.features.includes('browse')) - browse(data,$item) - else - render(data,$item,markup,trouble) + if (markup.features.includes('browse')) browse(data, $item) + else render(data, $item, markup, trouble) } if (markup.plugins.length) { @@ -143,4 +141,4 @@ if (typeof window !== 'undefined' && window !== null) { } if (typeof module !== 'undefined' && module !== null) { module.exports = { parse } -} \ No newline at end of file +} diff --git a/client/render.js b/client/render.js index aeabd2c..ba3c2cc 100644 --- a/client/render.js +++ b/client/render.js @@ -1,297 +1,300 @@ - const escape = text => text.replace(/&/g, '&').replace(//g, '>') +const escape = text => text.replace(/&/g, '&').replace(//g, '>') - const expand = function (string) { - const stashed = [] - const stash = function (text) { - const here = stashed.length - stashed.push(text) - return `〖${here}〗` - } - const unstash = (match, digits) => stashed[+digits] - const internal = function (match, name) { - const slug = wiki.asSlug(name) - const styling = name === name.trim() ? 'internal' : 'internal spaced' - if (slug.length) { - return stash( - `${escape(name)}`, - ) - } else { - return match - } - } - const external = (match, href, protocol) => - stash(`"${escape(href)}"`) - string = string.replace(/〖(\d+)〗/g, '〖 $1 〗').replace(/\[\[([^\]]+)\]\]/gi, internal).replace(/"((http|https|ftp):.*?)"/gi, external) - return escape(string).replace(/〖(\d+)〗/g, unstash) +const expand = function (string) { + const stashed = [] + const stash = function (text) { + const here = stashed.length + stashed.push(text) + return `〖${here}〗` } - const traffic = function (installed, published) { - const color = { - gray: '#ccc', - red: '#f55', - yellow: '#fb0', - green: '#0e0', + const unstash = (match, digits) => stashed[+digits] + const internal = function (match, name) { + const slug = wiki.asSlug(name) + const styling = name === name.trim() ? 'internal' : 'internal spaced' + if (slug.length) { + return stash( + `${escape(name)}`, + ) + } else { + return match } + } + const external = (match, href, protocol) => + stash(`"${escape(href)}"`) + string = string + .replace(/〖(\d+)〗/g, '〖 $1 〗') + .replace(/\[\[([^\]]+)\]\]/gi, internal) + .replace(/"((http|https|ftp):.*?)"/gi, external) + return escape(string).replace(/〖(\d+)〗/g, unstash) +} +const traffic = function (installed, published) { + const color = { + gray: '#ccc', + red: '#f55', + yellow: '#fb0', + green: '#0e0', + } - if (installed != null && published != null) { - if (installed === published) { - return color.green - } else { - return color.yellow - } + if (installed != null && published != null) { + if (installed === published) { + return color.green } else { - if (published != null) { - return color.red - } else { - return color.gray - } + return color.yellow + } + } else { + if (published != null) { + return color.red + } else { + return color.gray } } +} - var dialog +var dialog - export const render = function (data,$item,markup,trouble) { - let column = 'installed' - const pub = name => data.publish.find(obj => obj.plugin === name) +export const render = function (data, $item, markup, trouble) { + let column = 'installed' + const pub = name => data.publish.find(obj => obj.plugin === name) - const format = function (markup, plugin, dependencies) { - const name = plugin.plugin - const months = plugin.birth ? ((Date.now() - plugin.birth) / 1000 / 3600 / 24 / 31.5).toFixed(0) : '' - const status = function () { - const installed = plugin.package != null ? plugin.package.version : undefined - const published = pub(name).npm?.version - return traffic(installed, published) - } - - const result = [`
`] - for (column of markup.columns) { - result.push( - (() => { - switch (column) { - case 'status': - return ``] + for (column of markup.columns) { + result.push( + (() => { + switch (column) { + case 'status': + return `
◉` - case 'name': - return ` ${name}` - case 'menu': - return ` ${(plugin.factory != null ? plugin.factory.category : undefined) || ''}` - case 'pages': - return `${(plugin.pages != null ? plugin.pages.length : undefined) || ''}` - case 'service': - return `${months}` - case 'bundled': - return ` ${dependencies['wiki-plugin-' + name] || ''}` - case 'installed': - return ` ${(plugin.package != null ? plugin.package.version : undefined) || ''}` - case 'published': - return ` ${pub(name).npm?.version || ''}` - } - })(), - ) - } - return result.join('\n') + const format = function (markup, plugin, dependencies) { + const name = plugin.plugin + const months = plugin.birth ? ((Date.now() - plugin.birth) / 1000 / 3600 / 24 / 31.5).toFixed(0) : '' + const status = function () { + const installed = plugin.package != null ? plugin.package.version : undefined + const published = pub(name).npm?.version + return traffic(installed, published) } - const report = function (markup, plugins, dependencies) { - let plugin - const retrieve = function (name) { - for (plugin of plugins) { - if (plugin.plugin === name) { - return plugin + const result = [`
◉` + case 'name': + return ` ${name}` + case 'menu': + return ` ${(plugin.factory != null ? plugin.factory.category : undefined) || ''}` + case 'pages': + return `${(plugin.pages != null ? plugin.pages.length : undefined) || ''}` + case 'service': + return `${months}` + case 'bundled': + return ` ${dependencies['wiki-plugin-' + name] || ''}` + case 'installed': + return ` ${(plugin.package != null ? plugin.package.version : undefined) || ''}` + case 'published': + return ` ${pub(name).npm?.version || ''}` } + })(), + ) + } + return result.join('\n') + } + + const report = function (markup, plugins, dependencies) { + let plugin + const retrieve = function (name) { + for (plugin of plugins) { + if (plugin.plugin === name) { + return plugin } - return { plugin: name } } - const inventory = markup.plugins.length > 0 ? markup.plugins.map(retrieve) : plugins - const head = (() => { - const result1 = [] - for (column of markup.columns) { - result1.push(`${column}`) - } - return result1 - })().join('\n') - const result = (() => { - const result2 = [] - for (let index = 0; index < inventory.length; index++) { - plugin = inventory[index] - result2.push(format(markup, plugin, dependencies)) - } - return result2 - })().join('\n') - return `
\ + return { plugin: name } + } + const inventory = markup.plugins.length > 0 ? markup.plugins.map(retrieve) : plugins + const head = (() => { + const result1 = [] + for (column of markup.columns) { + result1.push(`
${column}`) + } + return result1 + })().join('\n') + const result = (() => { + const result2 = [] + for (let index = 0; index < inventory.length; index++) { + plugin = inventory[index] + result2.push(format(markup, plugin, dependencies)) + } + return result2 + })().join('\n') + return `
\

${window.location.host}

\ ${head} ${result}
\ \
` - } + } - const installer = function (row, npm) { - let version - if (npm == null) { - return `

can't find wiki-plugin-${row.plugin} in npmjs.com

` - } - const $row = $item.find(`table [data-name=${row.plugin}]`) - const installed = function (update) { - const index = data.install.indexOf(row) - data.install[index] = row = update.row - $row.find('[title=status]').css('color', traffic(update.installed, npm.version)) - $row.find('[title=menu]').text((row.factory != null ? row.factory.category : undefined) || '') - $row.find('[title=pages]').text((row.pages != null ? row.pages.length : undefined) || '') - $row.find('[title=service]').text('0') - $row.find('[title=installed]').text((row.package != null ? row.package.version : undefined) || '') - return $item.find('button.restart').removeAttr('disabled').show() - } + const installer = function (row, npm) { + let version + if (npm == null) { + return `

can't find wiki-plugin-${row.plugin} in npmjs.com

` + } + const $row = $item.find(`table [data-name=${row.plugin}]`) + const installed = function (update) { + const index = data.install.indexOf(row) + data.install[index] = row = update.row + $row.find('[title=status]').css('color', traffic(update.installed, npm.version)) + $row.find('[title=menu]').text((row.factory != null ? row.factory.category : undefined) || '') + $row.find('[title=pages]').text((row.pages != null ? row.pages.length : undefined) || '') + $row.find('[title=service]').text('0') + $row.find('[title=installed]').text((row.package != null ? row.package.version : undefined) || '') + return $item.find('button.restart').removeAttr('disabled').show() + } - window.plugins.plugmatic.install = function (version) { - $.ajax({ - type: 'POST', - url: '/plugin/plugmatic/install', - data: JSON.stringify({ version, plugin: row.plugin }), - contentType: 'application/json; charset=utf-8', - dataType: 'json', - success: installed, - error: trouble, - }) - // http://stackoverflow.com/questions/2933826/how-to-close-jquery-dialog-within-the-dialog - $row.find('[title=status]').css('color', 'white') - return dialog.close() - } + window.plugins.plugmatic.install = function (version) { + $.ajax({ + type: 'POST', + url: '/plugin/plugmatic/install', + data: JSON.stringify({ version, plugin: row.plugin }), + contentType: 'application/json; charset=utf-8', + dataType: 'json', + success: installed, + error: trouble, + }) + // http://stackoverflow.com/questions/2933826/how-to-close-jquery-dialog-within-the-dialog + $row.find('[title=status]').css('color', 'white') + return dialog.close() + } - const array = function (obj) { - if (typeof obj === 'string') { - return [obj] - } else { - return obj - } - } - const choice = function (version) { - const button = () => `` - return `
${version} ${version === (row.package != null ? row.package.version : undefined) ? 'installed' : button()}` + const array = function (obj) { + if (typeof obj === 'string') { + return [obj] + } else { + return obj } - const choices = (() => { - const result = [] - for (version of array(npm.versions).reverse()) { - result.push(choice(version)) - } - return result - })() - return `

${npm.description}

Choose a version to install.

${choices.join('\n')}` } - - const detail = function (name, done) { - const row = data.install.find(obj => obj.plugin === name) - const text = function (obj) { - if (!obj) { - return '' - } - return expand(obj).replace(/\n/g, '
') + const choice = function (version) { + const button = () => `` + return `
${version} ${version === (row.package != null ? row.package.version : undefined) ? 'installed' : button()}` + } + const choices = (() => { + const result = [] + for (version of array(npm.versions).reverse()) { + result.push(choice(version)) } - const struct = function (obj) { - if (!obj) { - return '' - } - return `
${expand(JSON.stringify(obj, null, '  '))}
` + return result + })() + return `

${npm.description}

Choose a version to install.

${choices.join('\n')}` + } + + const detail = function (name, done) { + const row = data.install.find(obj => obj.plugin === name) + const text = function (obj) { + if (!obj) { + return '' } - const pages = obj => `

${obj.title}
${expand(obj.synopsis)}

` - const birth = function (obj) { - if (obj) { - return new Date(obj).toString() - } else { - return 'built-in' - } + return expand(obj).replace(/\n/g, '
') + } + const struct = function (obj) { + if (!obj) { + return '' } - const npmjs = more => $.getJSON(`/plugin/plugmatic/view/${name}`, more) - switch (column) { - case 'status': - return npmjs(npm => done(installer(row, npm))) - case 'name': - return done(text(row.authors)) - case 'menu': - return done(struct(row.factory)) - case 'pages': - return done(row.pages.map(pages).join('')) - case 'service': - return done(birth(row.birth)) - case 'bundled': - return done(struct(data.bundle.data.dependencies)) - case 'installed': - return done(struct(row.package)) - case 'published': - return done(struct(pub(name).npm || '')) - default: - return done('unexpected column') + return `
${expand(JSON.stringify(obj, null, '  '))}
` + } + const pages = obj => `

${obj.title}
${expand(obj.synopsis)}

` + const birth = function (obj) { + if (obj) { + return new Date(obj).toString() + } else { + return 'built-in' } } + const npmjs = more => $.getJSON(`/plugin/plugmatic/view/${name}`, more) + switch (column) { + case 'status': + return npmjs(npm => done(installer(row, npm))) + case 'name': + return done(text(row.authors)) + case 'menu': + return done(struct(row.factory)) + case 'pages': + return done(row.pages.map(pages).join('')) + case 'service': + return done(birth(row.birth)) + case 'bundled': + return done(struct(data.bundle.data.dependencies)) + case 'installed': + return done(struct(row.package)) + case 'published': + return done(struct(pub(name).npm || '')) + default: + return done('unexpected column') + } + } - const showdetail = function (e) { - const $parent = $(e.target).parent() - const name = $parent.data('name') - return detail(name, function (html) { - // console.log(column, name, $item, item) - if (column === 'status') { - // show dialog - $item.find('dialog').remove() - $item.append(`\ + const showdetail = function (e) { + const $parent = $(e.target).parent() + const name = $parent.data('name') + return detail(name, function (html) { + // console.log(column, name, $item, item) + if (column === 'status') { + // show dialog + $item.find('dialog').remove() + $item.append(`\ ${html} \ `) - dialog = $item.find('dialog')[0] - console.log('dialog', dialog) - return dialog.showModal() - } else { - // wiki.dialog "#{name} plugin #{column}", html || '' - const pageKey = $item.parents('.page').data('key') - const context = wiki.lineup.atKey(pageKey).getContext() - const plugmaticDialog = window.open('/plugins/plugmatic/dialog/#', 'plugmatic', 'popup,height=600,width=800') - if (plugmaticDialog.location.pathname !== '/plugins/plugmatic/dialog/') { - return plugmaticDialog.addEventListener('load', event => - plugmaticDialog.postMessage( - { column, title: `${name} plugin ${column}`, body: html || '', pageKey, context }, - window.origin, - ), - ) - } else { - return plugmaticDialog.postMessage( + dialog = $item.find('dialog')[0] + console.log('dialog', dialog) + return dialog.showModal() + } else { + // wiki.dialog "#{name} plugin #{column}", html || '' + const pageKey = $item.parents('.page').data('key') + const context = wiki.lineup.atKey(pageKey).getContext() + const plugmaticDialog = window.open('/plugins/plugmatic/dialog/#', 'plugmatic', 'popup,height=600,width=800') + if (plugmaticDialog.location.pathname !== '/plugins/plugmatic/dialog/') { + return plugmaticDialog.addEventListener('load', event => + plugmaticDialog.postMessage( { column, title: `${name} plugin ${column}`, body: html || '', pageKey, context }, window.origin, - ) - } + ), + ) + } else { + return plugmaticDialog.postMessage( + { column, title: `${name} plugin ${column}`, body: html || '', pageKey, context }, + window.origin, + ) } - }) - } - - const more = function (e) { - if (e.shiftKey) { - return showdetail(e) } - } + }) + } - const bright = function (e) { - more(e) - return $(e.currentTarget).css('background-color', '#f8f8f8') + const more = function (e) { + if (e.shiftKey) { + return showdetail(e) } - const normal = e => $(e.currentTarget).css('background-color', '#eee') + } - $item.find('p').html(report(markup, data.install, data.bundle.data.dependencies)) - $item.find('.row').on({ - mouseenter: bright, - mouseleave: normal, - }) - $item.find('p td').on('click', function (e) { - column = $(e.target).attr('title') - return showdetail(e) - }) - return $item - .find('button.restart') - .hide() - .on('click', function (e) { - $item.find('button.restart').attr('disabled', 'disabled') - return $.ajax({ - type: 'POST', - url: '/plugin/plugmatic/restart', - success() {}, - // poll for restart complete, then ... - // $item.find('button.restart').hide() - error: trouble, - }) - }) + const bright = function (e) { + more(e) + return $(e.currentTarget).css('background-color', '#f8f8f8') } + const normal = e => $(e.currentTarget).css('background-color', '#eee') + + $item.find('p').html(report(markup, data.install, data.bundle.data.dependencies)) + $item.find('.row').on({ + mouseenter: bright, + mouseleave: normal, + }) + $item.find('p td').on('click', function (e) { + column = $(e.target).attr('title') + return showdetail(e) + }) + return $item + .find('button.restart') + .hide() + .on('click', function (e) { + $item.find('button.restart').attr('disabled', 'disabled') + return $.ajax({ + type: 'POST', + url: '/plugin/plugmatic/restart', + success() {}, + // poll for restart complete, then ... + // $item.find('button.restart').hide() + error: trouble, + }) + }) +} From 27cdddb6d918b2beba51ecca9ff3e69979987b5f Mon Sep 17 00:00:00 2001 From: Ward Cunningham Date: Mon, 15 Sep 2025 14:45:06 -0700 Subject: [PATCH 07/17] ajax now fetch in plugmatic.js --- client/plugmatic.js | 37 +++++++++++++++---------------------- client/render.js | 4 +++- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/client/plugmatic.js b/client/plugmatic.js index 623e55f..bfb4fe9 100644 --- a/client/plugmatic.js +++ b/client/plugmatic.js @@ -58,7 +58,7 @@ const parse = function (text) { return result } -const emit = function ($item, item) { +const emit = async function ($item, item) { const markup = parse(item.text) $item.append(`\

@@ -66,31 +66,24 @@ const emit = function ($item, item) {

\ `) - var trouble = xhr => - $item.find('p').html((xhr.responseJSON != null ? xhr.responseJSON.error : undefined) || 'server error') - const renderproxy = data => { if (markup.features.includes('browse')) browse(data, $item) - else render(data, $item, markup, trouble) + else render(data, $item, markup) } - if (markup.plugins.length) { - return $.ajax({ - type: 'POST', - url: '/plugin/plugmatic/plugins', - data: JSON.stringify(markup), - contentType: 'application/json; charset=utf-8', - dataType: 'json', - success: renderproxy, - error: trouble, - }) - } else { - return $.ajax({ - url: '/plugin/plugmatic/plugins', - dataType: 'json', - success: renderproxy, - error: trouble, - }) + try { + if (markup.plugins.length) { + const options = { + method: 'POST', + body: JSON.stringify(markup), + headers: { 'Content-Type': 'application/json' }, + } + renderproxy(await fetch('/plugin/plugmatic/plugins', options).then(res => res.json())) + } else { + renderproxy(await fetch('/plugin/plugmatic/plugins').then(res => res.json())) + } + } catch (err) { + $item.find('p').html('server error') } } diff --git a/client/render.js b/client/render.js index ba3c2cc..60a3290 100644 --- a/client/render.js +++ b/client/render.js @@ -52,9 +52,11 @@ const traffic = function (installed, published) { var dialog -export const render = function (data, $item, markup, trouble) { +export const render = function (data, $item, markup) { let column = 'installed' const pub = name => data.publish.find(obj => obj.plugin === name) + const trouble = xhr => + $item.find('p').html((xhr.responseJSON != null ? xhr.responseJSON.error : undefined) || 'server error') const format = function (markup, plugin, dependencies) { const name = plugin.plugin From 50be154941b73a9c9819cec67601d60976a1a694 Mon Sep 17 00:00:00 2001 From: Ward Cunningham Date: Mon, 15 Sep 2025 18:03:57 -0700 Subject: [PATCH 08/17] ajax now fetch in render.js --- client/render.js | 49 ++++++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/client/render.js b/client/render.js index 60a3290..fb117a2 100644 --- a/client/render.js +++ b/client/render.js @@ -55,9 +55,6 @@ var dialog export const render = function (data, $item, markup) { let column = 'installed' const pub = name => data.publish.find(obj => obj.plugin === name) - const trouble = xhr => - $item.find('p').html((xhr.responseJSON != null ? xhr.responseJSON.error : undefined) || 'server error') - const format = function (markup, plugin, dependencies) { const name = plugin.plugin const months = plugin.birth ? ((Date.now() - plugin.birth) / 1000 / 3600 / 24 / 31.5).toFixed(0) : '' @@ -142,22 +139,23 @@ export const render = function (data, $item, markup) { $row.find('[title=pages]').text((row.pages != null ? row.pages.length : undefined) || '') $row.find('[title=service]').text('0') $row.find('[title=installed]').text((row.package != null ? row.package.version : undefined) || '') - return $item.find('button.restart').removeAttr('disabled').show() + $item.find('button.restart').removeAttr('disabled').show() } - window.plugins.plugmatic.install = function (version) { - $.ajax({ - type: 'POST', - url: '/plugin/plugmatic/install', - data: JSON.stringify({ version, plugin: row.plugin }), - contentType: 'application/json; charset=utf-8', - dataType: 'json', - success: installed, - error: trouble, - }) - // http://stackoverflow.com/questions/2933826/how-to-close-jquery-dialog-within-the-dialog - $row.find('[title=status]').css('color', 'white') - return dialog.close() + window.plugins.plugmatic.install = async function (version) { + try { + const options = { + method: 'POST', + body: JSON.stringify({ version, plugin: row.plugin }), + headers: { 'Content-Type': 'application/json' }, + } + const update = await fetch('/plugin/plugmatic/install', options).then(res => res.json()) + installed(update) + $row.find('[title=status]').css('color', 'white') + dialog.close() + } catch (err) { + $item.find('p').html('server error') + } } const array = function (obj) { @@ -285,18 +283,15 @@ export const render = function (data, $item, markup) { column = $(e.target).attr('title') return showdetail(e) }) - return $item + $item .find('button.restart') .hide() - .on('click', function (e) { + .on('click', event => { $item.find('button.restart').attr('disabled', 'disabled') - return $.ajax({ - type: 'POST', - url: '/plugin/plugmatic/restart', - success() {}, - // poll for restart complete, then ... - // $item.find('button.restart').hide() - error: trouble, - }) + try { + fetch('/plugin/plugmatic/restart', { method: 'POST' }) + } catch (err) { + $item.find('p').html('server error') + } }) } From 506e6019985651edfcda0ceb2e04d2164b453314 Mon Sep 17 00:00:00 2001 From: Ward Cunningham Date: Mon, 15 Sep 2025 18:28:10 -0700 Subject: [PATCH 09/17] update about page with BROWSE option --- pages/about-plugmatic-plugin | 63 +++++++++++++++++++++++++++++++++--- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/pages/about-plugmatic-plugin b/pages/about-plugmatic-plugin index 689750a..bb4c698 100644 --- a/pages/about-plugmatic-plugin +++ b/pages/about-plugmatic-plugin @@ -6,6 +6,11 @@ "id": "2f538303a2750c3b", "text": "This plugin queries the origin server for information about installed plugins. Server administrators can install new or updated existing plugins from included inventories." }, + { + "type": "paragraph", + "id": "725d380d0f4119c6", + "text": "See [[Browse All Plugins]] also in the hamburger (☰) menu." + }, { "type": "plugmatic", "id": "aa516c1dac55e70b", @@ -73,13 +78,13 @@ }, { "type": "paragraph", - "id": "05248b5013cd7a8c", - "text": "Click on any of these columns to bring up a dialog of related information. Press shift and hover over any row to refresh the dialog with information for a different plugin." + "id": "698979e7fd5fce6e", + "text": "If no columns are requested a default list will be provided. Both STATUS and PUBLISHED require slow queries of npm so these are avoided except when specific plugins are inventoried." }, { "type": "paragraph", - "id": "698979e7fd5fce6e", - "text": "If no columns are requested a default list will be provided. Both STATUS and PUBLISHED require slow queries of npm so these are avoided except when specific plugins are inventoried." + "id": "332c5da9a77f5fb4", + "text": "Say BROWSE to show the about page browsing menu." } ], "journal": [ @@ -432,6 +437,54 @@ }, "after": "856d733cdab8fd8e", "date": 1489361231850 + }, + { + "type": "add", + "id": "725d380d0f4119c6", + "item": { + "type": "paragraph", + "id": "725d380d0f4119c6", + "text": "See [[Browse All Plugins]] also in the hamburger (☰) menu." + }, + "after": "2f538303a2750c3b", + "date": 1757985654595 + }, + { + "type": "edit", + "id": "725d380d0f4119c6", + "item": { + "type": "paragraph", + "id": "725d380d0f4119c6", + "text": "See [[Browse All Plugins]] also in the hamburger (☰) menu." + }, + "date": 1757985692110 + }, + { + "type": "edit", + "id": "725d380d0f4119c6", + "item": { + "type": "paragraph", + "id": "725d380d0f4119c6", + "text": "See [[Browse All Plugins]] also in the hamburger (☰) menu." + }, + "date": 1757985708220 + }, + { + "type": "remove", + "id": "05248b5013cd7a8c", + "date": 1757985783896 + }, + { + "type": "add", + "id": "332c5da9a77f5fb4", + "item": { + "type": "paragraph", + "id": "332c5da9a77f5fb4", + "text": "Say BROWSE to show the about page browsing menu." + }, + "after": "698979e7fd5fce6e", + "date": 1757985875186 } - ] + ], + "plugin": "plugmatic" } \ No newline at end of file From 829e0ab2f9596bf1f90216698dc3bd3fde343555 Mon Sep 17 00:00:00 2001 From: Paul Rodwell Date: Wed, 17 Sep 2025 10:23:29 +0100 Subject: [PATCH 10/17] Move client files into source directory --- {client => src/client}/browse.js | 0 {client => src/client}/plugmatic.js | 0 {client => src/client}/render.js | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {client => src/client}/browse.js (100%) rename {client => src/client}/plugmatic.js (100%) rename {client => src/client}/render.js (100%) diff --git a/client/browse.js b/src/client/browse.js similarity index 100% rename from client/browse.js rename to src/client/browse.js diff --git a/client/plugmatic.js b/src/client/plugmatic.js similarity index 100% rename from client/plugmatic.js rename to src/client/plugmatic.js diff --git a/client/render.js b/src/client/render.js similarity index 100% rename from client/render.js rename to src/client/render.js From ca8ff7b7c44897994ae2b352fd57386f16977c0c Mon Sep 17 00:00:00 2001 From: Paul Rodwell Date: Wed, 17 Sep 2025 11:13:15 +0100 Subject: [PATCH 11/17] change .mjs to .js - as now a module --- eslint.config.mjs => eslint.config.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename eslint.config.mjs => eslint.config.js (100%) diff --git a/eslint.config.mjs b/eslint.config.js similarity index 100% rename from eslint.config.mjs rename to eslint.config.js From e3d83a598f275398ddb8d34072c61840818bb14b Mon Sep 17 00:00:00 2001 From: Paul Rodwell Date: Wed, 17 Sep 2025 11:14:31 +0100 Subject: [PATCH 12/17] add build step, and convert to module. --- .github/workflows/test.yml | 28 +++ .gitignore | 4 + .npmignore | 8 + .vscode/extensions.json | 3 + .vscode/settings.json | 7 + .zed/settings.json | 7 + package-lock.json | 487 ++++++++++++++++++++++++++++++++++++- package.json | 8 +- scripts/build-client.js | 22 ++ src/client/plugmatic.js | 14 +- test/test.js | 4 +- 11 files changed, 583 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/test.yml create mode 100644 .vscode/extensions.json create mode 100644 .vscode/settings.json create mode 100644 .zed/settings.json create mode 100644 scripts/build-client.js diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..9917d4d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + # Releases https://github.com/nodejs/release#release-schedule + node-version: + - 18.x # Maintenance + - 20.x # Maintenance + - 22.x # Active + + steps: + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm test diff --git a/.gitignore b/.gitignore index 38d8759..d142d37 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +client/plugmatic.js +client/plugmatic.js.map +coverage +meta-client.json node_modules npm-debug.log status diff --git a/.npmignore b/.npmignore index 7fea0fa..52d2568 100644 --- a/.npmignore +++ b/.npmignore @@ -1,2 +1,10 @@ +scripts +src test status +meta-client.json +eslint.config.js +.github +.prettier* +.vscode +.zed diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..d7df89c --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"] +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..02db64b --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + }, + "editor.defaultFormatter": "esbenp.prettier-vscode", + "editor.formatOnSave": true +} diff --git a/.zed/settings.json b/.zed/settings.json new file mode 100644 index 0000000..8cbcf3c --- /dev/null +++ b/.zed/settings.json @@ -0,0 +1,7 @@ +// Folder-specific settings +// +// For a full list of overridable settings, and general information on folder-specific settings, +// see the documentation: https://zed.dev/docs/configuring-zed#settings-files +{ + "format_on_save": "on" +} diff --git a/package-lock.json b/package-lock.json index ddf1c55..84876d0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,11 +15,12 @@ }, "devDependencies": { "@eslint/js": "^9.21.0", + "esbuild": "^0.25.9", "eslint": "^9.21.0", "expect.js": "^0.3.1", "globals": "^16.0.0", "grunt-git-authors": "^3.2.0", - "mocha": "^10.2.0", + "mocha": "^10.8.2", "prettier": "^3.5.2" }, "engines": { @@ -51,6 +52,490 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "license": "MIT" }, + "node_modules/esbuild": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.9.tgz", + "integrity": "sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.9", + "@esbuild/android-arm": "0.25.9", + "@esbuild/android-arm64": "0.25.9", + "@esbuild/android-x64": "0.25.9", + "@esbuild/darwin-arm64": "0.25.9", + "@esbuild/darwin-x64": "0.25.9", + "@esbuild/freebsd-arm64": "0.25.9", + "@esbuild/freebsd-x64": "0.25.9", + "@esbuild/linux-arm": "0.25.9", + "@esbuild/linux-arm64": "0.25.9", + "@esbuild/linux-ia32": "0.25.9", + "@esbuild/linux-loong64": "0.25.9", + "@esbuild/linux-mips64el": "0.25.9", + "@esbuild/linux-ppc64": "0.25.9", + "@esbuild/linux-riscv64": "0.25.9", + "@esbuild/linux-s390x": "0.25.9", + "@esbuild/linux-x64": "0.25.9", + "@esbuild/netbsd-arm64": "0.25.9", + "@esbuild/netbsd-x64": "0.25.9", + "@esbuild/openbsd-arm64": "0.25.9", + "@esbuild/openbsd-x64": "0.25.9", + "@esbuild/openharmony-arm64": "0.25.9", + "@esbuild/sunos-x64": "0.25.9", + "@esbuild/win32-arm64": "0.25.9", + "@esbuild/win32-ia32": "0.25.9", + "@esbuild/win32-x64": "0.25.9" + } + }, + "node_modules/esbuild/node_modules/@esbuild/aix-ppc64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.9.tgz", + "integrity": "sha512-OaGtL73Jck6pBKjNIe24BnFE6agGl+6KxDtTfHhy1HmhthfKouEcOhqpSL64K4/0WCtbKFLOdzD/44cJ4k9opA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/android-arm": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.9.tgz", + "integrity": "sha512-5WNI1DaMtxQ7t7B6xa572XMXpHAaI/9Hnhk8lcxF4zVN4xstUgTlvuGDorBguKEnZO70qwEcLpfifMLoxiPqHQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/android-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.9.tgz", + "integrity": "sha512-IDrddSmpSv51ftWslJMvl3Q2ZT98fUSL2/rlUXuVqRXHCs5EUF1/f+jbjF5+NG9UffUDMCiTyh8iec7u8RlTLg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/android-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.9.tgz", + "integrity": "sha512-I853iMZ1hWZdNllhVZKm34f4wErd4lMyeV7BLzEExGEIZYsOzqDWDf+y082izYUE8gtJnYHdeDpN/6tUdwvfiw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/darwin-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.9.tgz", + "integrity": "sha512-XIpIDMAjOELi/9PB30vEbVMs3GV1v2zkkPnuyRRURbhqjyzIINwj+nbQATh4H9GxUgH1kFsEyQMxwiLFKUS6Rg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/darwin-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.9.tgz", + "integrity": "sha512-jhHfBzjYTA1IQu8VyrjCX4ApJDnH+ez+IYVEoJHeqJm9VhG9Dh2BYaJritkYK3vMaXrf7Ogr/0MQ8/MeIefsPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.9.tgz", + "integrity": "sha512-z93DmbnY6fX9+KdD4Ue/H6sYs+bhFQJNCPZsi4XWJoYblUqT06MQUdBCpcSfuiN72AbqeBFu5LVQTjfXDE2A6Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/freebsd-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.9.tgz", + "integrity": "sha512-mrKX6H/vOyo5v71YfXWJxLVxgy1kyt1MQaD8wZJgJfG4gq4DpQGpgTB74e5yBeQdyMTbgxp0YtNj7NuHN0PoZg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-arm": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.9.tgz", + "integrity": "sha512-HBU2Xv78SMgaydBmdor38lg8YDnFKSARg1Q6AT0/y2ezUAKiZvc211RDFHlEZRFNRVhcMamiToo7bDx3VEOYQw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.9.tgz", + "integrity": "sha512-BlB7bIcLT3G26urh5Dmse7fiLmLXnRlopw4s8DalgZ8ef79Jj4aUcYbk90g8iCa2467HX8SAIidbL7gsqXHdRw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-ia32": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.9.tgz", + "integrity": "sha512-e7S3MOJPZGp2QW6AK6+Ly81rC7oOSerQ+P8L0ta4FhVi+/j/v2yZzx5CqqDaWjtPFfYz21Vi1S0auHrap3Ma3A==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-loong64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.9.tgz", + "integrity": "sha512-Sbe10Bnn0oUAB2AalYztvGcK+o6YFFA/9829PhOCUS9vkJElXGdphz0A3DbMdP8gmKkqPmPcMJmJOrI3VYB1JQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-mips64el": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.9.tgz", + "integrity": "sha512-YcM5br0mVyZw2jcQeLIkhWtKPeVfAerES5PvOzaDxVtIyZ2NUBZKNLjC5z3/fUlDgT6w89VsxP2qzNipOaaDyA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-ppc64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.9.tgz", + "integrity": "sha512-++0HQvasdo20JytyDpFvQtNrEsAgNG2CY1CLMwGXfFTKGBGQT3bOeLSYE2l1fYdvML5KUuwn9Z8L1EWe2tzs1w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-riscv64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.9.tgz", + "integrity": "sha512-uNIBa279Y3fkjV+2cUjx36xkx7eSjb8IvnL01eXUKXez/CBHNRw5ekCGMPM0BcmqBxBcdgUWuUXmVWwm4CH9kg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-s390x": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.9.tgz", + "integrity": "sha512-Mfiphvp3MjC/lctb+7D287Xw1DGzqJPb/J2aHHcHxflUo+8tmN/6d4k6I2yFR7BVo5/g7x2Monq4+Yew0EHRIA==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/linux-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.9.tgz", + "integrity": "sha512-iSwByxzRe48YVkmpbgoxVzn76BXjlYFXC7NvLYq+b+kDjyyk30J0JY47DIn8z1MO3K0oSl9fZoRmZPQI4Hklzg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.9.tgz", + "integrity": "sha512-9jNJl6FqaUG+COdQMjSCGW4QiMHH88xWbvZ+kRVblZsWrkXlABuGdFJ1E9L7HK+T0Yqd4akKNa/lO0+jDxQD4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/netbsd-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.9.tgz", + "integrity": "sha512-RLLdkflmqRG8KanPGOU7Rpg829ZHu8nFy5Pqdi9U01VYtG9Y0zOG6Vr2z4/S+/3zIyOxiK6cCeYNWOFR9QP87g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.9.tgz", + "integrity": "sha512-YaFBlPGeDasft5IIM+CQAhJAqS3St3nJzDEgsgFixcfZeyGPCd6eJBWzke5piZuZ7CtL656eOSYKk4Ls2C0FRQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/openbsd-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.9.tgz", + "integrity": "sha512-1MkgTCuvMGWuqVtAvkpkXFmtL8XhWy+j4jaSO2wxfJtilVCi0ZE37b8uOdMItIHz4I6z1bWWtEX4CJwcKYLcuA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.9.tgz", + "integrity": "sha512-4Xd0xNiMVXKh6Fa7HEJQbrpP3m3DDn43jKxMjxLLRjWnRsfxjORYJlXPO4JNcXtOyfajXorRKY9NkOpTHptErg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/sunos-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.9.tgz", + "integrity": "sha512-WjH4s6hzo00nNezhp3wFIAfmGZ8U7KtrJNlFMRKxiI9mxEK1scOMAaa9i4crUtu+tBr+0IN6JCuAcSBJZfnphw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/win32-arm64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.9.tgz", + "integrity": "sha512-mGFrVJHmZiRqmP8xFOc6b84/7xa5y5YvR1x8djzXpJBSv/UsNK6aqec+6JDjConTgvvQefdGhFDAs2DLAds6gQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/win32-ia32": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.9.tgz", + "integrity": "sha512-b33gLVU2k11nVx1OhX3C8QQP6UHQK4ZtN56oFWvVXvz2VkDoe6fbG8TOgHFxEvqeqohmRnIHe5A1+HADk4OQww==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/esbuild/node_modules/@esbuild/win32-x64": { + "version": "0.25.9", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.9.tgz", + "integrity": "sha512-PPOl1mi6lpLNQxnGoyAfschAodRFYXJ+9fs6WHXz7CSWKbOqiMZsubC+BQsVKuul+3vKLuwTHsS2c2y9EoKwxQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, "node_modules/eslint": { "version": "9.22.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.22.0.tgz", diff --git a/package.json b/package.json index ebd1e3d..826b82d 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,9 @@ "Nick Niemeir " ], "scripts": { - "build": "eslint; mocha", + "build": "npm run clean; eslint; mocha; node scripts/build-client.js", + "clean": "rm client/plugmatic.js client/plugmatic.js.map", + "lint": "eslint", "test": "mocha", "prettier:format": "prettier --write './**/*.js'", "prettier:check": "prettier --check ./**/*.js", @@ -28,11 +30,12 @@ }, "devDependencies": { "@eslint/js": "^9.21.0", + "esbuild": "^0.25.9", "eslint": "^9.21.0", "expect.js": "^0.3.1", "globals": "^16.0.0", "grunt-git-authors": "^3.2.0", - "mocha": "^10.2.0", + "mocha": "^10.8.2", "prettier": "^3.5.2" }, "license": "MIT", @@ -46,6 +49,7 @@ "engines": { "node": ">=0.10" }, + "type": "module", "dependencies": { "async": "^2.1.4", "glob": "^7.1.4", diff --git a/scripts/build-client.js b/scripts/build-client.js new file mode 100644 index 0000000..b9eb6d9 --- /dev/null +++ b/scripts/build-client.js @@ -0,0 +1,22 @@ +import * as esbuild from 'esbuild' +import fs from 'node:fs/promises' +import packJSON from '../package.json' with { type: 'json' } + +const version = packJSON.version +const now = new Date() + +let results = await esbuild.build({ + entryPoints: ['src/client/plugmatic.js'], + bundle: true, + banner: { + js: `/* wiki-plugin-plugmatic - ${version} - ${now.toUTCString()} */`, + }, + minify: true, + sourcemap: true, + logLevel: 'info', + metafile: true, + outfile: 'client/plugmatic.js', +}) + +await fs.writeFile('meta-client.json', JSON.stringify(results.metafile)) +console.log("\n esbuild metadata written to 'meta-client.json'.") diff --git a/src/client/plugmatic.js b/src/client/plugmatic.js index bfb4fe9..7cf28de 100644 --- a/src/client/plugmatic.js +++ b/src/client/plugmatic.js @@ -129,9 +129,15 @@ if (typeof window !== 'undefined' && window !== null) { } } -if (typeof window !== 'undefined' && window !== null) { +// if (typeof window !== 'undefined' && window !== null) { +// window.plugins.plugmatic = { emit, bind } +// } +// if (typeof module !== 'undefined' && module !== null) { +// module.exports = { parse } +// } + +if (typeof window !== 'undefined') { window.plugins.plugmatic = { emit, bind } } -if (typeof module !== 'undefined' && module !== null) { - module.exports = { parse } -} + +export const plugmatic = typeof window == 'undefined' ? { parse } : undefined diff --git a/test/test.js b/test/test.js index a921c92..b09a314 100644 --- a/test/test.js +++ b/test/test.js @@ -6,8 +6,8 @@ // build time tests for plugmatic plugin // see http://mochajs.org/ -const plugmatic = require('../client/plugmatic') -const expect = require('expect.js') +import { plugmatic } from '../src/client/plugmatic.js' +import expect from 'expect.js' describe('plugmatic plugin', function () { // we default to less columns when there is lots to do From 2a93ee55abf5c4738758557992a878cd031ab665 Mon Sep 17 00:00:00 2001 From: Paul Rodwell Date: Wed, 17 Sep 2025 11:18:53 +0100 Subject: [PATCH 13/17] Update devDependencies Updates ESLint and related dependencies to latest versions. The other dependencies need looking at, and either updating or replacing with native code. --- package-lock.json | 972 ++++++++++++++++++++++++++++------------------ package.json | 2 +- 2 files changed, 605 insertions(+), 369 deletions(-) diff --git a/package-lock.json b/package-lock.json index 84876d0..cc381d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "expect.js": "^0.3.1", "globals": "^16.0.0", "grunt-git-authors": "^3.2.0", - "mocha": "^10.8.2", + "mocha": "^11.7.2", "prettier": "^3.5.2" }, "engines": { @@ -28,13 +28,16 @@ } }, "node_modules/@eslint/js": { - "version": "9.22.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.22.0.tgz", - "integrity": "sha512-vLFajx9o8d1/oL2ZkpMYbkLv8nDB6yaIwFNt7nI4+I80U/z03SxmfOMsLbvWr3p7C+Wnoh//aOu2pQW8cS0HCQ==", + "version": "9.35.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.35.0.tgz", + "integrity": "sha512-30iXE9whjlILfWobBkNerJo+TXYsgVM5ERQwMcMKCHckHflCmf7wXDAHlARoWnh0s1U72WqlbeyE7iAcCzuCPw==", "dev": true, "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" } }, "node_modules/async": { @@ -537,20 +540,20 @@ } }, "node_modules/eslint": { - "version": "9.22.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.22.0.tgz", - "integrity": "sha512-9V/QURhsRN40xuHXWjV64yvrzMjcz7ZyNoF2jJFmy9j/SLk0u1OLSZgXi28MrXjymnjEGSR80WCdab3RGMDveQ==", + "version": "9.35.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.35.0.tgz", + "integrity": "sha512-QePbBFMJFjgmlE+cXAlbHZbHpdFVS2E/6vzCy7aKlebddvl1vadiC4JFV5u/wqTkNUwEV8WrQi257jf5f06hrg==", "dev": true, "license": "MIT", "dependencies": { - "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.1", - "@eslint/config-array": "^0.19.2", - "@eslint/config-helpers": "^0.1.0", - "@eslint/core": "^0.12.0", - "@eslint/eslintrc": "^3.3.0", - "@eslint/js": "9.22.0", - "@eslint/plugin-kit": "^0.2.7", + "@eslint/config-array": "^0.21.0", + "@eslint/config-helpers": "^0.3.1", + "@eslint/core": "^0.15.2", + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "9.35.0", + "@eslint/plugin-kit": "^0.3.5", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", @@ -561,9 +564,9 @@ "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^8.3.0", - "eslint-visitor-keys": "^4.2.0", - "espree": "^10.3.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -598,9 +601,9 @@ } }, "node_modules/eslint/node_modules/@eslint-community/eslint-utils": { - "version": "4.5.1", - "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.5.1.tgz", - "integrity": "sha512-soEIOALTfTK6EjmKMMoLugwaP0rzkad90iIWd1hMO9ARkSAyjfMfkRRhLvD5qH7vvM0Cg72pieUfR6yh6XxC4w==", + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.0.tgz", + "integrity": "sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==", "dev": true, "license": "MIT", "dependencies": { @@ -640,9 +643,9 @@ } }, "node_modules/eslint/node_modules/@eslint/config-array": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz", - "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==", + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz", + "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -655,9 +658,9 @@ } }, "node_modules/eslint/node_modules/@eslint/config-helpers": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.1.0.tgz", - "integrity": "sha512-kLrdPDJE1ckPo94kmPPf9Hfd0DU0Jw6oKYrhe+pwSC0iTUInmTa+w6fw8sGgcfkFJGNdWOUeOaDM4quW4a7OkA==", + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz", + "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==", "dev": true, "license": "Apache-2.0", "engines": { @@ -665,9 +668,9 @@ } }, "node_modules/eslint/node_modules/@eslint/core": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.12.0.tgz", - "integrity": "sha512-cmrR6pytBuSMTaBweKoGMwu3EiHiEC+DoyupPmlZ0HxBJBtIxwe+j/E4XPIKNx+Q74c8lXKPwYawBf5glsTkHg==", + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz", + "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==", "dev": true, "license": "Apache-2.0", "dependencies": { @@ -678,9 +681,9 @@ } }, "node_modules/eslint/node_modules/@eslint/eslintrc": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.0.tgz", - "integrity": "sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz", + "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==", "dev": true, "license": "MIT", "dependencies": { @@ -712,13 +715,13 @@ } }, "node_modules/eslint/node_modules/@eslint/plugin-kit": { - "version": "0.2.7", - "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.7.tgz", - "integrity": "sha512-JubJ5B2pJ4k4yGxaNLdbjrnk9d/iDz6/q8wOilpIowd6PJPgaxCuHBnBszq7Ce2TyMrywm5r4PnKm6V3iiZF+g==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz", + "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==", "dev": true, "license": "Apache-2.0", "dependencies": { - "@eslint/core": "^0.12.0", + "@eslint/core": "^0.15.2", "levn": "^0.4.1" }, "engines": { @@ -736,33 +739,19 @@ } }, "node_modules/eslint/node_modules/@humanfs/node": { - "version": "0.16.6", - "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz", - "integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==", + "version": "0.16.7", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.7.tgz", + "integrity": "sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==", "dev": true, "license": "Apache-2.0", "dependencies": { "@humanfs/core": "^0.19.1", - "@humanwhocodes/retry": "^0.3.0" + "@humanwhocodes/retry": "^0.4.0" }, "engines": { "node": ">=18.18.0" } }, - "node_modules/eslint/node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz", - "integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=18.18" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, "node_modules/eslint/node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", @@ -778,9 +767,9 @@ } }, "node_modules/eslint/node_modules/@humanwhocodes/retry": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.2.tgz", - "integrity": "sha512-xeO57FpIu4p1Ri3Jq/EXq4ClRm86dVF2z/+kvFnyqVYRavTZmaFaUBbWCOuuTh0o/g7DSsk6kc2vrS4Vl5oPOQ==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -792,9 +781,9 @@ } }, "node_modules/eslint/node_modules/@types/estree": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", - "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.8.tgz", + "integrity": "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==", "dev": true, "license": "MIT" }, @@ -806,9 +795,9 @@ "license": "MIT" }, "node_modules/eslint/node_modules/acorn": { - "version": "8.14.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.1.tgz", - "integrity": "sha512-OvQ/2pUDKmgfCg++xsTX1wGxfTaszcHVcTctW4UJB4hibJx2HXxxO5UmVgyjMa+ZDsiaf5wWLXYpRWMmBI0QHg==", + "version": "8.15.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.15.0.tgz", + "integrity": "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==", "dev": true, "license": "MIT", "bin": { @@ -876,9 +865,9 @@ "license": "MIT" }, "node_modules/eslint/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "dev": true, "license": "MIT", "dependencies": { @@ -956,9 +945,9 @@ } }, "node_modules/eslint/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, "license": "MIT", "dependencies": { @@ -994,9 +983,9 @@ } }, "node_modules/eslint/node_modules/eslint-scope": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.3.0.tgz", - "integrity": "sha512-pUNxi75F8MJ/GdeKtVLSbYg4ZI34J6C0C7sbL4YOp2exGwen7ZsuBqKzUhXd0qMQ362yET3z+uPwKeg/0C2XCQ==", + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -1011,9 +1000,9 @@ } }, "node_modules/eslint/node_modules/eslint-visitor-keys": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz", - "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", "dev": true, "license": "Apache-2.0", "engines": { @@ -1024,15 +1013,15 @@ } }, "node_modules/eslint/node_modules/espree": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz", - "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", "dev": true, "license": "BSD-2-Clause", "dependencies": { - "acorn": "^8.14.0", + "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^4.2.0" + "eslint-visitor-keys": "^4.2.1" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -1628,9 +1617,9 @@ "license": "MIT" }, "node_modules/glob/node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", "license": "MIT", "dependencies": { "balanced-match": "^1.0.0", @@ -1703,9 +1692,9 @@ "license": "ISC" }, "node_modules/globals": { - "version": "16.0.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-16.0.0.tgz", - "integrity": "sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==", + "version": "16.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-16.4.0.tgz", + "integrity": "sha512-ob/2LcVVaVGCYN+r14cnwnoDPUufjiYgSqRhiFD0Q1iI4Odora5RE8Iv1D24hAz5oMophRGkGz+yuvQmmUMnMw==", "dev": true, "license": "MIT", "engines": { @@ -1747,31 +1736,31 @@ "optional": true }, "node_modules/mocha": { - "version": "10.8.2", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.8.2.tgz", - "integrity": "sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==", + "version": "11.7.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.2.tgz", + "integrity": "sha512-lkqVJPmqqG/w5jmmFtiRvtA2jkDyNVUcefFJKb2uyX4dekk8Okgqop3cgbFiaIvj8uCRJVTP5x9dfxGyXm2jvQ==", "dev": true, "license": "MIT", "dependencies": { - "ansi-colors": "^4.1.3", "browser-stdout": "^1.3.1", - "chokidar": "^3.5.3", + "chokidar": "^4.0.1", "debug": "^4.3.5", - "diff": "^5.2.0", + "diff": "^7.0.0", "escape-string-regexp": "^4.0.0", "find-up": "^5.0.0", - "glob": "^8.1.0", + "glob": "^10.4.5", "he": "^1.2.0", "js-yaml": "^4.1.0", "log-symbols": "^4.1.0", - "minimatch": "^5.1.6", + "minimatch": "^9.0.5", "ms": "^2.1.3", + "picocolors": "^1.1.1", "serialize-javascript": "^6.0.2", "strip-json-comments": "^3.1.1", "supports-color": "^8.1.1", - "workerpool": "^6.5.1", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.9", + "workerpool": "^9.2.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1", "yargs-unparser": "^2.0.0" }, "bin": { @@ -1779,27 +1768,49 @@ "mocha": "bin/mocha.js" }, "engines": { - "node": ">= 14.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/mocha/node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" } }, - "node_modules/mocha/node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "node_modules/mocha/node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", "dev": true, "license": "MIT", + "optional": true, "engines": { - "node": ">=6" + "node": ">=14" } }, "node_modules/mocha/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", "dev": true, "license": "MIT", "engines": { - "node": ">=8" + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" } }, "node_modules/mocha/node_modules/ansi-styles": { @@ -1818,20 +1829,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/mocha/node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dev": true, - "license": "ISC", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, "node_modules/mocha/node_modules/argparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", @@ -1846,42 +1843,16 @@ "dev": true, "license": "MIT" }, - "node_modules/mocha/node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/mocha/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", "dev": true, "license": "MIT", "dependencies": { "balanced-match": "^1.0.0" } }, - "node_modules/mocha/node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dev": true, - "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/mocha/node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -1933,40 +1904,97 @@ } }, "node_modules/mocha/node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", "dev": true, "license": "MIT", "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "readdirp": "^4.0.1" }, "engines": { - "node": ">= 8.10.0" + "node": ">= 14.16.0" }, "funding": { "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" } }, "node_modules/mocha/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==", + "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.0", + "strip-ansi": "^6.0.1", "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/mocha/node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/cliui/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==", + "dev": true, + "license": "MIT" + }, + "node_modules/mocha/node_modules/cliui/node_modules/string-width": { + "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, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/cliui/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/mocha/node_modules/color-convert": { @@ -1989,10 +2017,25 @@ "dev": true, "license": "MIT" }, + "node_modules/mocha/node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/mocha/node_modules/debug": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", - "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dev": true, "license": "MIT", "dependencies": { @@ -2021,19 +2064,26 @@ } }, "node_modules/mocha/node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-7.0.0.tgz", + "integrity": "sha512-PJWHUb1RFevKCwaFA9RlG5tCd+FO5iRh9A8HEtkmBH2Li03iJriB6m6JIN4rGz3K3JLawI7/veA1xzRKP6ISBw==", "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, + "node_modules/mocha/node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, "node_modules/mocha/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==", + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", "dev": true, "license": "MIT" }, @@ -2060,19 +2110,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mocha/node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dev": true, - "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/mocha/node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -2100,26 +2137,21 @@ "flat": "cli.js" } }, - "node_modules/mocha/node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true, - "license": "ISC" - }, - "node_modules/mocha/node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "node_modules/mocha/node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "dev": true, - "hasInstallScript": true, - "license": "MIT", - "optional": true, - "os": [ - "darwin" - ], + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, "node_modules/mocha/node_modules/get-caller-file": { @@ -2133,39 +2165,26 @@ } }, "node_modules/mocha/node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" }, - "engines": { - "node": ">=12" + "bin": { + "glob": "dist/esm/bin.mjs" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mocha/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "license": "ISC", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/mocha/node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2186,48 +2205,6 @@ "he": "bin/he" } }, - "node_modules/mocha/node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dev": true, - "license": "ISC", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/mocha/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true, - "license": "ISC" - }, - "node_modules/mocha/node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, - "license": "MIT", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/mocha/node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/mocha/node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -2238,29 +2215,6 @@ "node": ">=8" } }, - "node_modules/mocha/node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mocha/node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, "node_modules/mocha/node_modules/is-plain-obj": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", @@ -2284,12 +2238,35 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/mocha/node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "node_modules/mocha/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "dev": true, - "license": "MIT", + "license": "ISC" + }, + "node_modules/mocha/node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/mocha/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -2330,17 +2307,37 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/mocha/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, "node_modules/mocha/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "license": "ISC", "dependencies": { "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=10" + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=16 || 14 >=14.17" } }, "node_modules/mocha/node_modules/ms": { @@ -2350,26 +2347,6 @@ "dev": true, "license": "MIT" }, - "node_modules/mocha/node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/mocha/node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "license": "ISC", - "dependencies": { - "wrappy": "1" - } - }, "node_modules/mocha/node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -2402,6 +2379,13 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/mocha/node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/mocha/node_modules/path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", @@ -2412,19 +2396,40 @@ "node": ">=8" } }, - "node_modules/mocha/node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "node_modules/mocha/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true, "license": "MIT", "engines": { - "node": ">=8.6" + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" }, "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/mocha/node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, "node_modules/mocha/node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -2436,16 +2441,17 @@ } }, "node_modules/mocha/node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", "dev": true, "license": "MIT", - "dependencies": { - "picomatch": "^2.2.1" - }, "engines": { - "node": ">=8.10.0" + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" } }, "node_modules/mocha/node_modules/require-directory": { @@ -2489,7 +2495,62 @@ "randombytes": "^2.1.0" } }, + "node_modules/mocha/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/mocha/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/string-width-cjs": { + "name": "string-width", "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", @@ -2504,7 +2565,54 @@ "node": ">=8" } }, + "node_modules/mocha/node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/string-width-cjs/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==", + "dev": true, + "license": "MIT" + }, + "node_modules/mocha/node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/mocha/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/mocha/node_modules/strip-ansi-cjs": { + "name": "strip-ansi", "version": "6.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", @@ -2517,6 +2625,16 @@ "node": ">=8" } }, + "node_modules/mocha/node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/mocha/node_modules/strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", @@ -2546,27 +2664,49 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/mocha/node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "node_modules/mocha/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, - "license": "MIT", + "license": "ISC", "dependencies": { - "is-number": "^7.0.0" + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" }, "engines": { - "node": ">=8.0" + "node": ">= 8" } }, "node_modules/mocha/node_modules/workerpool": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", - "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "version": "9.3.4", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-9.3.4.tgz", + "integrity": "sha512-TmPRQYYSAnnDiEB0P/Ytip7bFGvqnSU6I2BcuSw7Hx+JSg/DsUi5ebYfc8GYaSdpuvOcEs6dXxPurOYpe9QFwg==", "dev": true, "license": "Apache-2.0" }, "node_modules/mocha/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/mocha/node_modules/wrap-ansi-cjs": { + "name": "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==", @@ -2584,12 +2724,63 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/mocha/node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "node_modules/mocha/node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, - "license": "ISC" + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/wrap-ansi-cjs/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==", + "dev": true, + "license": "MIT" + }, + "node_modules/mocha/node_modules/wrap-ansi-cjs/node_modules/string-width": { + "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, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/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==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } }, "node_modules/mocha/node_modules/y18n": { "version": "5.0.8", @@ -2602,32 +2793,32 @@ } }, "node_modules/mocha/node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "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": "^7.0.2", + "cliui": "^8.0.1", "escalade": "^3.1.1", "get-caller-file": "^2.0.5", "require-directory": "^2.1.1", - "string-width": "^4.2.0", + "string-width": "^4.2.3", "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "yargs-parser": "^21.1.1" }, "engines": { - "node": ">=10" + "node": ">=12" } }, "node_modules/mocha/node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "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": ">=10" + "node": ">=12" } }, "node_modules/mocha/node_modules/yargs-unparser": { @@ -2646,6 +2837,51 @@ "node": ">=10" } }, + "node_modules/mocha/node_modules/yargs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/yargs/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==", + "dev": true, + "license": "MIT" + }, + "node_modules/mocha/node_modules/yargs/node_modules/string-width": { + "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, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/mocha/node_modules/yocto-queue": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", @@ -2660,9 +2896,9 @@ } }, "node_modules/prettier": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.5.3.tgz", - "integrity": "sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz", + "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==", "dev": true, "license": "MIT", "bin": { diff --git a/package.json b/package.json index 826b82d..a598396 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "expect.js": "^0.3.1", "globals": "^16.0.0", "grunt-git-authors": "^3.2.0", - "mocha": "^10.8.2", + "mocha": "^11.7.2", "prettier": "^3.5.2" }, "license": "MIT", From 3f6c23bdd27b695e5adc8d997425dad0ef3aa317 Mon Sep 17 00:00:00 2001 From: Paul Rodwell Date: Wed, 17 Sep 2025 11:49:50 +0100 Subject: [PATCH 14/17] Remember to switch from CommonJS to module imports. Update dependencies to version that can be loaded using import. --- package-lock.json | 533 +++++++++++++++++++++++++++++++++++++++------- package.json | 6 +- server/server.js | 14 +- 3 files changed, 464 insertions(+), 89 deletions(-) diff --git a/package-lock.json b/package-lock.json index cc381d1..d021f68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,9 +9,9 @@ "version": "1.4.0", "license": "MIT", "dependencies": { - "async": "^2.1.4", - "glob": "^7.1.4", - "jsonfile": "^2.4.0" + "async": "^3.2.6", + "glob": "^11.0.3", + "jsonfile": "^6.2.0" }, "devDependencies": { "@eslint/js": "^9.21.0", @@ -41,18 +41,9 @@ } }, "node_modules/async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "license": "MIT", - "dependencies": { - "lodash": "^4.17.14" - } - }, - "node_modules/async/node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", "license": "MIT" }, "node_modules/esbuild": { @@ -1590,106 +1581,478 @@ "dev": true }, "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "deprecated": "Glob versions prior to v9 are no longer supported", + "version": "11.0.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.0.3.tgz", + "integrity": "sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA==", "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "foreground-child": "^3.3.1", + "jackspeak": "^4.1.1", + "minimatch": "^10.0.3", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" }, "engines": { - "node": "*" + "node": "20 || >=22" }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/glob/node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "node_modules/glob/node_modules/@isaacs/balanced-match": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@isaacs/balanced-match/-/balanced-match-4.0.1.tgz", + "integrity": "sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==", + "license": "MIT", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/glob/node_modules/@isaacs/brace-expansion": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@isaacs/brace-expansion/-/brace-expansion-5.0.0.tgz", + "integrity": "sha512-ZT55BDLV0yv0RBm2czMiZ+SqCGO7AvmOM3G/w2xhVPH+te0aKgFjmBvGlL1dH+ql2tgGO3MVrbb3jCKyvpgnxA==", + "license": "MIT", + "dependencies": { + "@isaacs/balanced-match": "^4.0.1" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/glob/node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/glob/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/glob/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/glob/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/glob/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==", "license": "MIT" }, - "node_modules/glob/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==", + "node_modules/glob/node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" } }, - "node_modules/glob/node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "node_modules/glob/node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "license": "MIT" }, - "node_modules/glob/node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "license": "ISC" + "node_modules/glob/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "license": "MIT" }, - "node_modules/glob/node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "node_modules/glob/node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", "license": "ISC", "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/is-fullwidth-code-point": { + "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==", + "license": "MIT", + "engines": { + "node": ">=8" } }, - "node_modules/glob/node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "node_modules/glob/node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", "license": "ISC" }, + "node_modules/glob/node_modules/jackspeak": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.1.1.tgz", + "integrity": "sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ==", + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/lru-cache": { + "version": "11.2.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.2.1.tgz", + "integrity": "sha512-r8LA6i4LP4EeWOhqBaZZjDWwehd1xUJPCJd9Sv300H0ZmcUER4+JPh7bqqZeqs1o5pgtgvXm+d9UGrB5zZGDiQ==", + "license": "ISC", + "engines": { + "node": "20 || >=22" + } + }, "node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.0.3.tgz", + "integrity": "sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw==", "license": "ISC", "dependencies": { - "brace-expansion": "^1.1.7" + "@isaacs/brace-expansion": "^5.0.0" }, "engines": { - "node": "*" + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/glob/node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "node_modules/glob/node_modules/minipass": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", "license": "ISC", - "dependencies": { - "wrappy": "1" + "engines": { + "node": ">=16 || 14 >=14.17" } }, - "node_modules/glob/node_modules/path-is-absolute": { + "node_modules/glob/node_modules/package-json-from-dist": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "license": "BlueOak-1.0.0" + }, + "node_modules/glob/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/glob/node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "license": "ISC" + "node_modules/glob/node_modules/path-scurry": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.0.tgz", + "integrity": "sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==", + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/glob/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/glob/node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/glob/node_modules/string-width-cjs": { + "name": "string-width", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/glob/node_modules/string-width-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/glob/node_modules/string-width-cjs/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==", + "license": "MIT" + }, + "node_modules/glob/node_modules/string-width-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/glob/node_modules/strip-ansi": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.2.tgz", + "integrity": "sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/glob/node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/glob/node_modules/strip-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/glob/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/glob/node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/glob/node_modules/wrap-ansi-cjs": { + "name": "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==", + "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/glob/node_modules/wrap-ansi-cjs/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/glob/node_modules/wrap-ansi-cjs/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/glob/node_modules/wrap-ansi-cjs/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==", + "license": "MIT" + }, + "node_modules/glob/node_modules/wrap-ansi-cjs/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/glob/node_modules/wrap-ansi-cjs/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } }, "node_modules/globals": { "version": "16.4.0", @@ -1720,10 +2083,13 @@ "dev": true }, "node_modules/jsonfile": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", - "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.0.tgz", + "integrity": "sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==", "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, "optionalDependencies": { "graceful-fs": "^4.1.6" } @@ -1735,6 +2101,15 @@ "license": "ISC", "optional": true }, + "node_modules/jsonfile/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/mocha": { "version": "11.7.2", "resolved": "https://registry.npmjs.org/mocha/-/mocha-11.7.2.tgz", diff --git a/package.json b/package.json index a598396..2b43891 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,8 @@ }, "type": "module", "dependencies": { - "async": "^2.1.4", - "glob": "^7.1.4", - "jsonfile": "^2.4.0" + "async": "^3.2.6", + "glob": "^11.0.3", + "jsonfile": "^6.2.0" } } diff --git a/server/server.js b/server/server.js index 527bb3e..0fc363d 100644 --- a/server/server.js +++ b/server/server.js @@ -7,12 +7,12 @@ // plugmatic plugin, server-side component // These handlers are launched with the wiki server. -const fs = require('fs') -const glob = require('glob') -const asyncLib = require('async') -const jsonfile = require('jsonfile') -const https = require('https') -const { execFile } = require('child_process') +import * as fs from 'node:fs' +import { glob } from 'glob' +import * as asyncLib from 'async' +import jsonfile from 'jsonfile' +import https from 'node:https' +import { execFile } from 'node:child_process' const github = function (path, done) { const options = { @@ -263,4 +263,4 @@ const startServer = function (params) { }) } -module.exports = { startServer } +export { startServer } From ef7f56d413b39e56a1a4359efe0905939deeddfe Mon Sep 17 00:00:00 2001 From: Paul Rodwell Date: Wed, 17 Sep 2025 12:07:46 +0100 Subject: [PATCH 15/17] Refactor glob callbacks to use promises instead --- server/server.js | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/server/server.js b/server/server.js index 0fc363d..f3c9036 100644 --- a/server/server.js +++ b/server/server.js @@ -103,17 +103,18 @@ const startServer = function (params) { } const plugmap = done => - glob('wiki-plugin-*', { cwd: argv.packageDir }, function (err, files) { - if (err) { + glob('wiki-plugin-*', { cwd: argv.packageDir }) + .then(files => { + return asyncLib.map(files || [], info, function (err, install) { + if (err) { + return done(err, null) + } + return done(null, install) + }) + }) + .catch(err => { return done(err, null) - } - return asyncLib.map(files || [], info, function (err, install) { - if (err) { - return done(err, null) - } - return done(null, install) }) - }) const view = function (plugin, done) { if (/^\w+$/.test(plugin)) { @@ -188,17 +189,18 @@ const startServer = function (params) { ) app.get(route('plugins'), (req, res) => - glob('wiki-plugin-*', { cwd: argv.packageDir }, function (err, files) { - if (err) { - return res.e(err) - } - return asyncLib.map(files || [], info, function (err, install) { - if (err) { - return res.e(err) - } - return res.json({ install, bundle }) + glob('wiki-plugin-*', { cwd: argv.packageDir }) + .then(files => { + return asyncLib.map(files || [], info, function (err, install) { + if (err) { + return res.e(err) + } + return res.json({ install, bundle }) + }) }) - }), + .catch(err => { + return res.e(err) + }), ) app.post(route('plugins'), function (req, res) { From c1c0a74cc3da856630947a265e9f549545d41853 Mon Sep 17 00:00:00 2001 From: Ward Cunningham Date: Wed, 17 Sep 2025 08:04:19 -0700 Subject: [PATCH 16/17] 1.4.1-0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index d021f68..db02ae2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wiki-plugin-plugmatic", - "version": "1.4.0", + "version": "1.4.1-0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wiki-plugin-plugmatic", - "version": "1.4.0", + "version": "1.4.1-0", "license": "MIT", "dependencies": { "async": "^3.2.6", diff --git a/package.json b/package.json index 2b43891..3a4a28b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wiki-plugin-plugmatic", - "version": "1.4.0", + "version": "1.4.1-0", "description": "Federated Wiki - Plugmatic Plugin", "keywords": [ "plugmatic", From 9e4f5d928688a70c29b8ce854c4c312af00f8561 Mon Sep 17 00:00:00 2001 From: Ward Cunningham Date: Wed, 17 Sep 2025 08:05:46 -0700 Subject: [PATCH 17/17] 1.5.0-0 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index db02ae2..be4d301 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wiki-plugin-plugmatic", - "version": "1.4.1-0", + "version": "1.5.0-0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wiki-plugin-plugmatic", - "version": "1.4.1-0", + "version": "1.5.0-0", "license": "MIT", "dependencies": { "async": "^3.2.6", diff --git a/package.json b/package.json index 3a4a28b..09825c1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wiki-plugin-plugmatic", - "version": "1.4.1-0", + "version": "1.5.0-0", "description": "Federated Wiki - Plugmatic Plugin", "keywords": [ "plugmatic",