refactor: migrate to ES modules

This commit is contained in:
Jeff Williams 2023-02-28 20:12:24 -08:00
parent 32f6a41080
commit c04508f295
No known key found for this signature in database
158 changed files with 11886 additions and 10526 deletions

View File

@ -13,16 +13,17 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import { LicenseChecker } from 'js-green-licenses'; import path from 'node:path';
import { execa } from 'execa'; import { execa } from 'execa';
import path from 'path';
import { task } from 'hereby'; import { task } from 'hereby';
import { LicenseChecker } from 'js-green-licenses';
const BIN_DIR = 'node_modules/.bin'; const BIN_DIR = 'node_modules/.bin';
const JSDOC_BIN = 'packages/jsdoc/jsdoc.js'; const JSDOC_BIN = 'packages/jsdoc/jsdoc.js';
const NODE_BIN = process.execPath; const NODE_BIN = process.execPath;
const sourceGlob = ['*.js', '*.mjs', 'packages/**/*.js']; const sourceGlob = ['*.cjs', '*.js', 'packages/**/*/*.cjs', 'packages/**/*.js'];
function bin(name) { function bin(name) {
return path.join(BIN_DIR, name); return path.join(BIN_DIR, name);
@ -32,7 +33,7 @@ export const coverage = task({
name: 'coverage', name: 'coverage',
run: async () => { run: async () => {
await execa(bin('c8'), [ await execa(bin('c8'), [
'--exclude=Herebyfile.mjs', '--exclude=Herebyfile.js',
"--exclude='**/test{,s}/**'", "--exclude='**/test{,s}/**'",
'--reporter=html', '--reporter=html',
bin('hereby'), bin('hereby'),
@ -99,7 +100,7 @@ export const licenseCheck = task({
export const lint = task({ export const lint = task({
name: 'lint', name: 'lint',
run: async () => { run: async () => {
await execa(bin('eslint'), [...sourceGlob]); await execa(bin('eslint'), [...sourceGlob], { stdout: 'inherit', stderr: 'inherit' });
}, },
}); });

14731
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,6 +3,7 @@
"private": true, "private": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"devDependencies": { "devDependencies": {
"@babel/eslint-parser": "7.19.1",
"@jsdoc/ast": "^0.1.0", "@jsdoc/ast": "^0.1.0",
"@jsdoc/cli": "^0.2.10", "@jsdoc/cli": "^0.2.10",
"@jsdoc/core": "^0.4.5", "@jsdoc/core": "^0.4.5",
@ -20,9 +21,10 @@
"eslint": "^8.35.0", "eslint": "^8.35.0",
"eslint-config-prettier": "^8.6.0", "eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1", "eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^10.0.0",
"execa": "^7.0.0", "execa": "^7.0.0",
"hereby": "^1.8.0", "hereby": "^1.8.0",
"jasmine": "^3.99.0", "jasmine": "^4.5.0",
"jasmine-console-reporter": "^3.1.0", "jasmine-console-reporter": "^3.1.0",
"js-green-licenses": "^4.0.0", "js-green-licenses": "^4.0.0",
"klaw-sync": "^6.0.0", "klaw-sync": "^6.0.0",
@ -33,6 +35,7 @@
"prettier": "^2.8.4", "prettier": "^2.8.4",
"taffydb": "2.6.2" "taffydb": "2.6.2"
}, },
"type": "module",
"engines": { "engines": {
"node": ">=v18.12.0" "node": ">=v18.12.0"
}, },
@ -45,5 +48,8 @@
"license-headers": "node_modules/.bin/hereby license-headers", "license-headers": "node_modules/.bin/hereby license-headers",
"lint": "node_modules/.bin/hereby lint", "lint": "node_modules/.bin/hereby lint",
"test": "node_modules/.bin/hereby test" "test": "node_modules/.bin/hereby test"
},
"dependencies": {
"@babel/eslint-parser": "^7.19.1"
} }
} }

View File

@ -13,14 +13,10 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const { AstBuilder } = require('./lib/ast-builder'); import { AstBuilder } from './lib/ast-builder.js';
const astNode = require('./lib/ast-node'); import * as astNode from './lib/ast-node.js';
const { Syntax } = require('./lib/syntax'); import { Syntax } from './lib/syntax.js';
const { Walker } = require('./lib/walker'); import { Walker } from './lib/walker.js';
module.exports = { export { AstBuilder, astNode, Syntax, Walker };
AstBuilder, export default { AstBuilder, astNode, Syntax, Walker };
astNode,
Syntax,
Walker,
};

View File

@ -13,12 +13,12 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const _ = require('lodash'); import babelParser from '@babel/parser';
const babelParser = require('@babel/parser'); import { log } from '@jsdoc/util';
const { log } = require('@jsdoc/util'); import _ from 'lodash';
// Exported so we can use them in tests. // Exported so we can use them in tests.
const parserOptions = (exports.parserOptions = { export const parserOptions = {
allowAwaitOutsideFunction: true, allowAwaitOutsideFunction: true,
allowImportExportEverywhere: true, allowImportExportEverywhere: true,
allowReturnOutsideFunction: true, allowReturnOutsideFunction: true,
@ -60,7 +60,7 @@ const parserOptions = (exports.parserOptions = {
'throwExpressions', 'throwExpressions',
], ],
ranges: true, ranges: true,
}); };
function parse(source, filename, sourceType) { function parse(source, filename, sourceType) {
let ast; let ast;
@ -76,10 +76,9 @@ function parse(source, filename, sourceType) {
} }
// TODO: docs // TODO: docs
class AstBuilder { export class AstBuilder {
// TODO: docs // TODO: docs
static build(source, filename, sourceType) { static build(source, filename, sourceType) {
return parse(source, filename, sourceType); return parse(source, filename, sourceType);
} }
} }
exports.AstBuilder = AstBuilder;

View File

@ -14,10 +14,13 @@
limitations under the License. limitations under the License.
*/ */
// TODO: docs // TODO: docs
const _ = require('lodash'); import { name } from '@jsdoc/core';
const { cast } = require('@jsdoc/util'); import { cast } from '@jsdoc/util';
const { SCOPE } = require('@jsdoc/core').name; import _ from 'lodash';
const { Syntax } = require('./syntax');
import { Syntax } from './syntax.js';
const { SCOPE } = name;
// Counter for generating unique node IDs. // Counter for generating unique node IDs.
let uid = 100000000; let uid = 100000000;
@ -28,7 +31,7 @@ let uid = 100000000;
* @param {(Object|string)} node - The AST node to check, or the `type` property of a node. * @param {(Object|string)} node - The AST node to check, or the `type` property of a node.
* @return {boolean} Set to `true` if the node is a function or `false` in all other cases. * @return {boolean} Set to `true` if the node is a function or `false` in all other cases.
*/ */
const isFunction = (exports.isFunction = (node) => { export function isFunction(node) {
let type; let type;
if (!node) { if (!node) {
@ -47,7 +50,7 @@ const isFunction = (exports.isFunction = (node) => {
type === Syntax.MethodDefinition || type === Syntax.MethodDefinition ||
type === Syntax.ArrowFunctionExpression type === Syntax.ArrowFunctionExpression
); );
}); }
/** /**
* Check whether an AST node creates a new scope. * Check whether an AST node creates a new scope.
@ -55,18 +58,20 @@ const isFunction = (exports.isFunction = (node) => {
* @param {Object} node - The AST node to check. * @param {Object} node - The AST node to check.
* @return {Boolean} Set to `true` if the node creates a new scope, or `false` in all other cases. * @return {Boolean} Set to `true` if the node creates a new scope, or `false` in all other cases.
*/ */
exports.isScope = ( // TODO: handle blocks with "let" declarations
node // TODO: handle blocks with "let" declarations export function isScope(node) {
) => return (
Boolean(node) && Boolean(node) &&
typeof node === 'object' && typeof node === 'object' &&
(node.type === Syntax.CatchClause || (node.type === Syntax.CatchClause ||
node.type === Syntax.ClassDeclaration || node.type === Syntax.ClassDeclaration ||
node.type === Syntax.ClassExpression || node.type === Syntax.ClassExpression ||
isFunction(node)); isFunction(node))
);
}
// TODO: docs // TODO: docs
exports.addNodeProperties = (node) => { export function addNodeProperties(node) {
const newProperties = {}; const newProperties = {};
if (!node || typeof node !== 'object') { if (!node || typeof node !== 'object') {
@ -117,10 +122,10 @@ exports.addNodeProperties = (node) => {
Object.defineProperties(node, newProperties); Object.defineProperties(node, newProperties);
return node; return node;
}; }
// TODO: docs // TODO: docs
const nodeToValue = (exports.nodeToValue = (node) => { export function nodeToValue(node) {
let key; let key;
let parent; let parent;
let str; let str;
@ -326,13 +331,12 @@ const nodeToValue = (exports.nodeToValue = (node) => {
} }
return str; return str;
}); }
// backwards compatibility export { nodeToValue as nodeToString };
exports.nodeToString = nodeToValue;
// TODO: docs // TODO: docs
const getParamNames = (exports.getParamNames = (node) => { export function getParamNames(node) {
let params; let params;
if (!node || !node.params) { if (!node || !node.params) {
@ -342,26 +346,32 @@ const getParamNames = (exports.getParamNames = (node) => {
params = node.params.slice(); params = node.params.slice();
return params.map((param) => nodeToValue(param)); return params.map((param) => nodeToValue(param));
}); }
// TODO: docs // TODO: docs
const isAccessor = (exports.isAccessor = (node) => export function isAccessor(node) {
Boolean(node) && return (
typeof node === 'object' && Boolean(node) &&
(node.type === Syntax.Property || node.type === Syntax.MethodDefinition) && typeof node === 'object' &&
(node.kind === 'get' || node.kind === 'set')); (node.type === Syntax.Property || node.type === Syntax.MethodDefinition) &&
(node.kind === 'get' || node.kind === 'set')
);
}
// TODO: docs // TODO: docs
exports.isAssignment = (node) => export function isAssignment(node) {
Boolean(node) && return (
typeof node === 'object' && Boolean(node) &&
(node.type === Syntax.AssignmentExpression || node.type === Syntax.VariableDeclarator); typeof node === 'object' &&
(node.type === Syntax.AssignmentExpression || node.type === Syntax.VariableDeclarator)
);
}
// TODO: docs // TODO: docs
/** /**
* Retrieve information about the node, including its name and type. * Retrieve information about the node, including its name and type.
*/ */
exports.getInfo = (node) => { export function getInfo(node) {
const info = {}; const info = {};
switch (node.type) { switch (node.type) {
@ -572,4 +582,4 @@ exports.getInfo = (node) => {
} }
return info; return info;
}; }

View File

@ -14,7 +14,7 @@
limitations under the License. limitations under the License.
*/ */
// TODO: docs // TODO: docs
exports.Syntax = { export const Syntax = {
ArrayExpression: 'ArrayExpression', ArrayExpression: 'ArrayExpression',
ArrayPattern: 'ArrayPattern', ArrayPattern: 'ArrayPattern',
ArrowFunctionExpression: 'ArrowFunctionExpression', ArrowFunctionExpression: 'ArrowFunctionExpression',

View File

@ -16,9 +16,10 @@
/** /**
* Traversal utilities for ASTs that are compatible with the ESTree API. * Traversal utilities for ASTs that are compatible with the ESTree API.
*/ */
const astNode = require('./ast-node'); import { log } from '@jsdoc/util';
const { log } = require('@jsdoc/util');
const { Syntax } = require('./syntax'); import * as astNode from './ast-node.js';
import { Syntax } from './syntax.js';
// TODO: docs // TODO: docs
function getCurrentScope(scopes) { function getCurrentScope(scopes) {
@ -57,7 +58,7 @@ function leafNode(node, parent, state, cb) {}
/* eslint-enable no-empty-function, no-unused-vars */ /* eslint-enable no-empty-function, no-unused-vars */
// TODO: docs // TODO: docs
const walkers = (exports.walkers = {}); export const walkers = {};
walkers[Syntax.ArrayExpression] = (node, parent, state, cb) => { walkers[Syntax.ArrayExpression] = (node, parent, state, cb) => {
for (let element of node.elements) { for (let element of node.elements) {
@ -642,7 +643,7 @@ walkers[Syntax.YieldExpression] = (node, parent, state, cb) => {
/** /**
* A walker that can traverse an ESTree AST. * A walker that can traverse an ESTree AST.
*/ */
class Walker { export class Walker {
// TODO: docs // TODO: docs
constructor(walkerFuncs = walkers) { constructor(walkerFuncs = walkers) {
this._walkers = walkerFuncs; this._walkers = walkerFuncs;
@ -714,4 +715,3 @@ class Walker {
return ast; return ast;
} }
} }
exports.Walker = Walker;

View File

@ -21,6 +21,15 @@
"bugs": { "bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues" "url": "https://github.com/jsdoc/jsdoc/issues"
}, },
"type": "module",
"exports": {
".": {
"import": "./index.js"
},
"./lib/*": {
"import": "./lib/*"
}
},
"dependencies": { "dependencies": {
"@babel/parser": "^7.21.2", "@babel/parser": "^7.21.2",
"@jsdoc/core": "^0.4.6", "@jsdoc/core": "^0.4.6",

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const ast = require('../../index'); import ast from '../../index.js';
describe('@jsdoc/ast', () => { describe('@jsdoc/ast', () => {
it('is an object', () => { it('is an object', () => {
@ -21,34 +21,34 @@ describe('@jsdoc/ast', () => {
}); });
describe('AstBuilder', () => { describe('AstBuilder', () => {
it('is lib/ast-builder.AstBuilder', () => { it('is lib/ast-builder.AstBuilder', async () => {
const { AstBuilder } = require('../../lib/ast-builder'); const { AstBuilder } = await import('../../lib/ast-builder.js');
expect(ast.AstBuilder).toBe(AstBuilder); expect(ast.AstBuilder).toEqual(AstBuilder);
}); });
}); });
describe('astNode', () => { describe('astNode', () => {
it('is lib/ast-node', () => { it('is lib/ast-node', async () => {
const astNode = require('../../lib/ast-node'); const astNode = await import('../../lib/ast-node.js');
expect(ast.astNode).toBe(astNode); expect(ast.astNode).toEqual(astNode);
}); });
}); });
describe('Syntax', () => { describe('Syntax', () => {
it('is lib/syntax.Syntax', () => { it('is lib/syntax.Syntax', async () => {
const { Syntax } = require('../../lib/syntax'); const { Syntax } = await import('../../lib/syntax.js');
expect(ast.Syntax).toBe(Syntax); expect(ast.Syntax).toEqual(Syntax);
}); });
}); });
describe('Walker', () => { describe('Walker', () => {
it('is lib/walker.Walker', () => { it('is lib/walker.Walker', async () => {
const { Walker } = require('../../lib/walker'); const { Walker } = await import('../../lib/walker.js');
expect(ast.Walker).toBe(Walker); expect(ast.Walker).toEqual(Walker);
}); });
}); });
}); });

View File

@ -14,9 +14,9 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
describe('@jsdoc/ast/lib/ast-builder', () => { import * as astBuilder from '../../../lib/ast-builder.js';
const astBuilder = require('../../../lib/ast-builder');
describe('@jsdoc/ast/lib/ast-builder', () => {
it('is an object', () => { it('is an object', () => {
expect(astBuilder).toBeObject(); expect(astBuilder).toBeObject();
}); });
@ -50,7 +50,5 @@ describe('@jsdoc/ast/lib/ast-builder', () => {
}); });
}); });
xdescribe('parserOptions', () => { // TODO: parserOptions tests
// TODO: tests
});
}); });

View File

@ -13,12 +13,13 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
describe('@jsdoc/ast/lib/ast-node', () => { import babelParser from '@babel/parser';
const astNode = require('../../../lib/ast-node');
const babelParser = require('@babel/parser');
const { parserOptions } = require('../../../lib/ast-builder');
const { Syntax } = require('../../../lib/syntax');
import { parserOptions } from '../../../lib/ast-builder.js';
import * as astNode from '../../../lib/ast-node.js';
import { Syntax } from '../../../lib/syntax.js';
describe('@jsdoc/ast/lib/ast-node', () => {
function parse(str) { function parse(str) {
return babelParser.parse(str, parserOptions).program.body[0]; return babelParser.parse(str, parserOptions).program.body[0];
} }

View File

@ -13,9 +13,9 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
describe('@jsdoc/ast.Syntax', () => { import { Syntax } from '../../../lib/syntax.js';
const { Syntax } = require('../../../index');
describe('@jsdoc/ast.Syntax', () => {
it('is an object', () => { it('is an object', () => {
expect(Syntax).toBeObject(); expect(Syntax).toBeObject();
}); });

View File

@ -13,9 +13,10 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
describe('@jsdoc/ast/lib/walker', () => { import { Syntax } from '../../../lib/syntax.js';
const walker = require('../../../lib/walker'); import * as walker from '../../../lib/walker.js';
describe('@jsdoc/ast/lib/walker', () => {
it('is an object', () => { it('is an object', () => {
expect(walker).toBeObject(); expect(walker).toBeObject();
}); });
@ -29,8 +30,6 @@ describe('@jsdoc/ast/lib/walker', () => {
}); });
describe('walkers', () => { describe('walkers', () => {
const { Syntax } = require('../../../lib/syntax');
// TODO: tests for default functions // TODO: tests for default functions
it('has a function for each known node type', () => { it('has a function for each known node type', () => {
@ -40,7 +39,5 @@ describe('@jsdoc/ast/lib/walker', () => {
}); });
}); });
xdescribe('Walker', () => { // TODO: Walker tests
// TODO
});
}); });

View File

@ -13,6 +13,6 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const Engine = require('./lib/engine'); import engine from './lib/engine.js';
module.exports = Engine; export default engine;

View File

@ -13,13 +13,14 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const _ = require('lodash'); import { EventBus } from '@jsdoc/util';
const { EventBus } = require('@jsdoc/util'); import _ from 'lodash';
const flags = require('./flags'); import ow from 'ow';
const help = require('./help'); import yargs from 'yargs-parser';
const { LEVELS, Logger } = require('./logger');
const { default: ow } = require('ow'); import flags from './flags.js';
const yargs = require('yargs-parser'); import help from './help.js';
import { LEVELS, Logger } from './logger.js';
function validateChoice(flagInfo, choices, values) { function validateChoice(flagInfo, choices, values) {
let flagNames = flagInfo.alias ? `-${flagInfo.alias}/` : ''; let flagNames = flagInfo.alias ? `-${flagInfo.alias}/` : '';
@ -98,7 +99,7 @@ const { KNOWN_FLAGS, YARGS_FLAGS } = (() => {
* *
* @alias module:@jsdoc/cli * @alias module:@jsdoc/cli
*/ */
class Engine { export default class Engine {
/** /**
* Create an instance of the CLI engine. * Create an instance of the CLI engine.
* *
@ -240,5 +241,3 @@ class Engine {
} }
Engine.LOG_LEVELS = LEVELS; Engine.LOG_LEVELS = LEVELS;
module.exports = Engine;

View File

@ -13,8 +13,9 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const { cast } = require('@jsdoc/util'); import querystring from 'node:querystring';
const querystring = require('querystring');
import { cast } from '@jsdoc/util';
// TODO: Document the format of this object, then update the docs for `Engine`. // TODO: Document the format of this object, then update the docs for `Engine`.
/** /**
@ -22,7 +23,7 @@ const querystring = require('querystring');
* *
* @alias module:@jsdoc/cli/lib/flags * @alias module:@jsdoc/cli/lib/flags
*/ */
module.exports = { export default {
access: { access: {
alias: 'a', alias: 'a',
array: true, array: true,

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const flags = require('./flags'); import flags from './flags.js';
function padLeft(str, length) { function padLeft(str, length) {
return str.padStart(str.length + length); return str.padStart(str.length + length);
@ -109,7 +109,7 @@ function formatHelpInfo({ names, descriptions }, { maxLength }) {
* @return {string} The formatted help text. * @return {string} The formatted help text.
* @private * @private
*/ */
module.exports = ({ maxLength }) => { export default function help({ maxLength }) {
const flagInfo = { const flagInfo = {
names: [], names: [],
descriptions: [], descriptions: [],
@ -147,4 +147,4 @@ module.exports = ({ maxLength }) => {
}); });
return `${formatHelpInfo(flagInfo, { maxLength }).join('\n')}`; return `${formatHelpInfo(flagInfo, { maxLength }).join('\n')}`;
}; }

View File

@ -13,8 +13,8 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const _ = require('lodash'); import _ from 'lodash';
const { default: ow } = require('ow'); import ow from 'ow';
/** /**
* Logging levels for the JSDoc logger. The default logging level is * Logging levels for the JSDoc logger. The default logging level is
@ -24,7 +24,7 @@ const { default: ow } = require('ow');
* @enum * @enum
* @type {number} * @type {number}
*/ */
const LEVELS = { export const LEVELS = {
/** /**
* Do not log any messages. * Do not log any messages.
* *
@ -109,7 +109,7 @@ function addPrefix(level, args) {
return args; return args;
} }
class Logger { export class Logger {
constructor(opts) { constructor(opts) {
ow(opts, ow.object); ow(opts, ow.object);
// We validate `opts.level` in the setter, so no need to validate it here. // We validate `opts.level` in the setter, so no need to validate it here.
@ -169,8 +169,3 @@ class Logger {
this._level = level; this._level = level;
} }
} }
module.exports = {
LEVELS,
Logger,
};

View File

@ -9,8 +9,10 @@
"version": "0.2.11", "version": "0.2.11",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@jsdoc/core": "^0.4.6",
"@jsdoc/util": "^0.2.8",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"ow": "^0.28.2", "ow": "^1.1.1",
"strip-bom": "^4.0.0", "strip-bom": "^4.0.0",
"yargs-parser": "^21.1.1" "yargs-parser": "^21.1.1"
}, },
@ -18,10 +20,71 @@
"node": ">=v18.12.0" "node": ">=v18.12.0"
} }
}, },
"node_modules/@sindresorhus/is": { "node_modules/@babel/code-frame": {
"version": "4.2.0", "version": "7.18.6",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==", "integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
"dependencies": {
"@babel/highlight": "^7.18.6"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-validator-identifier": {
"version": "7.19.1",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
"integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/highlight": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
"integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
"dependencies": {
"@babel/helper-validator-identifier": "^7.18.6",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@jsdoc/core": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/@jsdoc/core/-/core-0.4.6.tgz",
"integrity": "sha512-i9clwgss2upkeejiYosLo2pUXJ47K2W82ppBjEnEW+hzN1Ob/QRSwxR6IRs/bxaenK2fT7W5Esq/LEpGKrNbpw==",
"dependencies": {
"bottlejs": "^2.0.1",
"cosmiconfig": "^7.1.0",
"escape-string-regexp": "^4.0.0",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0",
"strip-json-comments": "^3.1.1"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@jsdoc/util": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/@jsdoc/util/-/util-0.2.8.tgz",
"integrity": "sha512-Uqerf+cakeAbFC5JRA087v9ul+7Tu4xzTaSO9vW6i7b0+b8z6qT1rVmX/xrAfco9uyiQDSm68xm9ovR3C0HviA==",
"dependencies": {
"klaw-sync": "^6.0.0",
"lodash": "^4.17.21",
"ow": "^0.28.2"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@jsdoc/util/node_modules/@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==",
"engines": { "engines": {
"node": ">=10" "node": ">=10"
}, },
@ -29,7 +92,7 @@
"url": "https://github.com/sindresorhus/is?sponsor=1" "url": "https://github.com/sindresorhus/is?sponsor=1"
} }
}, },
"node_modules/callsites": { "node_modules/@jsdoc/util/node_modules/callsites": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
@ -37,7 +100,7 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/dot-prop": { "node_modules/@jsdoc/util/node_modules/dot-prop": {
"version": "6.0.1", "version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", "integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
@ -51,6 +114,182 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/@jsdoc/util/node_modules/ow": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz",
"integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==",
"dependencies": {
"@sindresorhus/is": "^4.2.0",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"vali-date": "^1.0.0"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/@sindresorhus/is": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz",
"integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw==",
"engines": {
"node": ">=14.16"
},
"funding": {
"url": "https://github.com/sindresorhus/is?sponsor=1"
}
},
"node_modules/@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
},
"node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dependencies": {
"color-convert": "^1.9.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/bottlejs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz",
"integrity": "sha512-50T0bzqeAqZ+//kgjdDxNu7UP8Je04isNPyHPwwOOPoeZmtVESkuF9nwkWEqSEd9Sw1yJ1oaoHBAMxe/wG4Zzg=="
},
"node_modules/callsites": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-4.0.0.tgz",
"integrity": "sha512-y3jRROutgpKdz5vzEhWM34TidDU8vkJppF8dszITeb1PQmSqV3DTxyV8G/lyO/DNvtE1YTedehmw9MPZsCBHxQ==",
"engines": {
"node": ">=12.20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dependencies": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/chalk/node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
},
"node_modules/cosmiconfig": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"dependencies": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/dot-prop": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-7.2.0.tgz",
"integrity": "sha512-Ol/IPXUARn9CSbkrdV4VJo7uCy1I3VuSiWCaFSg+8BdUOzF9n3jefIpcgAydvUZbTdEBZs2vEiTiS9m61ssiDA==",
"dependencies": {
"type-fest": "^2.11.2"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"dependencies": {
"is-arrayish": "^0.2.1"
}
},
"node_modules/escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/graceful-fs": {
"version": "4.2.10",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="
},
"node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"engines": {
"node": ">=4"
}
},
"node_modules/import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
"integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
"dependencies": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
},
"engines": {
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="
},
"node_modules/is-obj": { "node_modules/is-obj": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
@ -59,6 +298,29 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"node_modules/json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="
},
"node_modules/klaw-sync": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz",
"integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==",
"dependencies": {
"graceful-fs": "^4.1.11"
}
},
"node_modules/lines-and-columns": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="
},
"node_modules/lodash": { "node_modules/lodash": {
"version": "4.17.21", "version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
@ -70,23 +332,75 @@
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
}, },
"node_modules/ow": { "node_modules/ow": {
"version": "0.28.2", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz", "resolved": "https://registry.npmjs.org/ow/-/ow-1.1.1.tgz",
"integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==", "integrity": "sha512-sJBRCbS5vh1Jp9EOgwp1Ws3c16lJrUkJYlvWTYC03oyiYVwS/ns7lKRWow4w4XjDyTrA2pplQv4B2naWSR6yDA==",
"dependencies": { "dependencies": {
"@sindresorhus/is": "^4.2.0", "@sindresorhus/is": "^5.3.0",
"callsites": "^3.1.0", "callsites": "^4.0.0",
"dot-prop": "^6.0.1", "dot-prop": "^7.2.0",
"lodash.isequal": "^4.5.0", "lodash.isequal": "^4.5.0",
"vali-date": "^1.0.0" "vali-date": "^1.0.0"
}, },
"engines": { "engines": {
"node": ">=12" "node": ">=14.16"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"dependencies": {
"callsites": "^3.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/parent-module/node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/parse-json": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
"integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
"dependencies": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
"json-parse-even-better-errors": "^2.3.0",
"lines-and-columns": "^1.1.6"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"engines": {
"node": ">=8"
}
},
"node_modules/resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"engines": {
"node": ">=4"
}
},
"node_modules/strip-bom": { "node_modules/strip-bom": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
@ -95,6 +409,39 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/type-fest": {
"version": "2.19.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
"integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==",
"engines": {
"node": ">=12.20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/vali-date": { "node_modules/vali-date": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
@ -103,6 +450,14 @@
"node": ">=0.10.0" "node": ">=0.10.0"
} }
}, },
"node_modules/yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"engines": {
"node": ">= 6"
}
},
"node_modules/yargs-parser": { "node_modules/yargs-parser": {
"version": "21.1.1", "version": "21.1.1",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
@ -113,29 +468,227 @@
} }
}, },
"dependencies": { "dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
"integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
"requires": {
"@babel/highlight": "^7.18.6"
}
},
"@babel/helper-validator-identifier": {
"version": "7.19.1",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
"integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w=="
},
"@babel/highlight": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
"integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
"requires": {
"@babel/helper-validator-identifier": "^7.18.6",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
}
},
"@jsdoc/core": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/@jsdoc/core/-/core-0.4.6.tgz",
"integrity": "sha512-i9clwgss2upkeejiYosLo2pUXJ47K2W82ppBjEnEW+hzN1Ob/QRSwxR6IRs/bxaenK2fT7W5Esq/LEpGKrNbpw==",
"requires": {
"bottlejs": "^2.0.1",
"cosmiconfig": "^7.1.0",
"escape-string-regexp": "^4.0.0",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0",
"strip-json-comments": "^3.1.1"
}
},
"@jsdoc/util": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/@jsdoc/util/-/util-0.2.8.tgz",
"integrity": "sha512-Uqerf+cakeAbFC5JRA087v9ul+7Tu4xzTaSO9vW6i7b0+b8z6qT1rVmX/xrAfco9uyiQDSm68xm9ovR3C0HviA==",
"requires": {
"klaw-sync": "^6.0.0",
"lodash": "^4.17.21",
"ow": "^0.28.2"
},
"dependencies": {
"@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="
},
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
},
"dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
"requires": {
"is-obj": "^2.0.0"
}
},
"ow": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz",
"integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==",
"requires": {
"@sindresorhus/is": "^4.2.0",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"vali-date": "^1.0.0"
}
}
}
},
"@sindresorhus/is": { "@sindresorhus/is": {
"version": "4.2.0", "version": "5.3.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz",
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==" "integrity": "sha512-CX6t4SYQ37lzxicAqsBtxA3OseeoVrh9cSJ5PFYam0GksYlupRfy1A+Q4aYD3zvcfECLc0zO2u+ZnR2UYKvCrw=="
},
"@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
},
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"requires": {
"color-convert": "^1.9.0"
}
},
"bottlejs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz",
"integrity": "sha512-50T0bzqeAqZ+//kgjdDxNu7UP8Je04isNPyHPwwOOPoeZmtVESkuF9nwkWEqSEd9Sw1yJ1oaoHBAMxe/wG4Zzg=="
}, },
"callsites": { "callsites": {
"version": "3.1.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", "resolved": "https://registry.npmjs.org/callsites/-/callsites-4.0.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==" "integrity": "sha512-y3jRROutgpKdz5vzEhWM34TidDU8vkJppF8dszITeb1PQmSqV3DTxyV8G/lyO/DNvtE1YTedehmw9MPZsCBHxQ=="
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"dependencies": {
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="
}
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
},
"cosmiconfig": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"requires": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
}
}, },
"dot-prop": { "dot-prop": {
"version": "6.0.1", "version": "7.2.0",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-7.2.0.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==", "integrity": "sha512-Ol/IPXUARn9CSbkrdV4VJo7uCy1I3VuSiWCaFSg+8BdUOzF9n3jefIpcgAydvUZbTdEBZs2vEiTiS9m61ssiDA==",
"requires": { "requires": {
"is-obj": "^2.0.0" "type-fest": "^2.11.2"
} }
}, },
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"requires": {
"is-arrayish": "^0.2.1"
}
},
"escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="
},
"graceful-fs": {
"version": "4.2.10",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw=="
},
"import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
"integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
"requires": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
}
},
"is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="
},
"is-obj": { "is-obj": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="
}, },
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="
},
"klaw-sync": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz",
"integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==",
"requires": {
"graceful-fs": "^4.1.11"
}
},
"lines-and-columns": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="
},
"lodash": { "lodash": {
"version": "4.17.21", "version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
@ -147,27 +700,86 @@
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
}, },
"ow": { "ow": {
"version": "0.28.2", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz", "resolved": "https://registry.npmjs.org/ow/-/ow-1.1.1.tgz",
"integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==", "integrity": "sha512-sJBRCbS5vh1Jp9EOgwp1Ws3c16lJrUkJYlvWTYC03oyiYVwS/ns7lKRWow4w4XjDyTrA2pplQv4B2naWSR6yDA==",
"requires": { "requires": {
"@sindresorhus/is": "^4.2.0", "@sindresorhus/is": "^5.3.0",
"callsites": "^3.1.0", "callsites": "^4.0.0",
"dot-prop": "^6.0.1", "dot-prop": "^7.2.0",
"lodash.isequal": "^4.5.0", "lodash.isequal": "^4.5.0",
"vali-date": "^1.0.0" "vali-date": "^1.0.0"
} }
}, },
"parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"requires": {
"callsites": "^3.0.0"
},
"dependencies": {
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
}
}
},
"parse-json": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
"integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
"requires": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
"json-parse-even-better-errors": "^2.3.0",
"lines-and-columns": "^1.1.6"
}
},
"path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw=="
},
"resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
},
"strip-bom": { "strip-bom": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
"integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==" "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w=="
}, },
"strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"requires": {
"has-flag": "^3.0.0"
}
},
"type-fest": {
"version": "2.19.0",
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
"integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA=="
},
"vali-date": { "vali-date": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz", "resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=" "integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY="
}, },
"yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg=="
},
"yargs-parser": { "yargs-parser": {
"version": "21.1.1", "version": "21.1.1",
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",

View File

@ -21,11 +21,20 @@
"bugs": { "bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues" "url": "https://github.com/jsdoc/jsdoc/issues"
}, },
"type": "module",
"exports": {
".": {
"import": "./index.js"
},
"./lib/*": {
"import": "./lib/*"
}
},
"dependencies": { "dependencies": {
"@jsdoc/core": "^0.4.6", "@jsdoc/core": "^0.4.6",
"@jsdoc/util": "^0.2.8", "@jsdoc/util": "^0.2.8",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"ow": "^0.28.2", "ow": "^1.1.1",
"strip-bom": "^4.0.0", "strip-bom": "^4.0.0",
"yargs-parser": "^21.1.1" "yargs-parser": "^21.1.1"
}, },

View File

@ -13,12 +13,11 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const Engine = require('../../index'); import Engine from '../../index.js';
import engine from '../../lib/engine.js';
describe('@jsdoc/cli', () => { describe('@jsdoc/cli', () => {
it('is lib/engine', () => { it('is lib/engine', () => {
const engine = require('../../lib/engine'); expect(Engine).toEqual(engine);
expect(Engine).toBe(engine);
}); });
}); });

View File

@ -13,9 +13,9 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const RealEngine = require('../../../lib/engine'); import RealEngine from '../../../lib/engine.js';
const flags = require('../../../lib/flags'); import flags from '../../../lib/flags.js';
const { LEVELS } = require('../../../lib/logger'); import { LEVELS } from '../../../lib/logger.js';
const TYPE_ERROR = 'TypeError'; const TYPE_ERROR = 'TypeError';

View File

@ -13,8 +13,9 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const flags = require('../../../lib/flags'); import ow from 'ow';
const { default: ow } = require('ow');
import flags from '../../../lib/flags.js';
function validate(name, opts) { function validate(name, opts) {
name = `--${name}`; name = `--${name}`;

View File

@ -13,8 +13,9 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const { EventBus } = require('@jsdoc/util'); import { EventBus } from '@jsdoc/util';
const { LEVELS, Logger } = require('../../../lib/logger');
import { LEVELS, Logger } from '../../../lib/logger.js';
const ARGUMENT_ERROR = 'ArgumentError'; const ARGUMENT_ERROR = 'ArgumentError';
const TYPE_ERROR = 'TypeError'; const TYPE_ERROR = 'TypeError';

View File

@ -18,17 +18,11 @@
* *
* @module @jsdoc/core * @module @jsdoc/core
*/ */
import * as config from './lib/config.js';
import Dependencies from './lib/dependencies.js';
import env from './lib/env.js';
import * as name from './lib/name.js';
import * as plugins from './lib/plugins.js';
const config = require('./lib/config'); export { config, Dependencies, env, name, plugins };
const Dependencies = require('./lib/dependencies'); export default { config, Dependencies, env, name, plugins };
const env = require('./lib/env');
const name = require('./lib/name');
const plugins = require('./lib/plugins');
module.exports = {
config,
Dependencies,
env,
name,
plugins,
};

View File

@ -18,15 +18,14 @@
* *
* @alias module:@jsdoc/core.config * @alias module:@jsdoc/core.config
*/ */
import { cosmiconfigSync, defaultLoaders } from 'cosmiconfig';
const _ = require('lodash'); import _ from 'lodash';
const { cosmiconfigSync, defaultLoaders } = require('cosmiconfig'); import stripBom from 'strip-bom';
const stripBom = require('strip-bom'); import stripJsonComments from 'strip-json-comments';
const stripJsonComments = require('strip-json-comments');
const MODULE_NAME = 'jsdoc'; const MODULE_NAME = 'jsdoc';
const defaults = (exports.defaults = { export const defaults = {
// TODO(hegemonic): Integrate CLI options with other options. // TODO(hegemonic): Integrate CLI options with other options.
opts: { opts: {
destination: './out', destination: './out',
@ -77,7 +76,7 @@ const defaults = (exports.defaults = {
*/ */
monospaceLinks: false, monospaceLinks: false,
}, },
}); };
// TODO: Consider exporting this class. // TODO: Consider exporting this class.
class Config { class Config {
@ -114,7 +113,7 @@ const explorerSync = cosmiconfigSync(MODULE_NAME, {
], ],
}); });
exports.loadSync = (filepath) => { export function loadSync(filepath) {
let loaded; let loaded;
if (filepath) { if (filepath) {
@ -124,4 +123,4 @@ exports.loadSync = (filepath) => {
} }
return new Config(loaded.filepath, _.defaultsDeep({}, loaded.config, defaults)); return new Config(loaded.filepath, _.defaultsDeep({}, loaded.config, defaults));
}; }

View File

@ -13,15 +13,15 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const _ = require('lodash'); import Bottle from 'bottlejs';
const Bottle = require('bottlejs'); import _ from 'lodash';
/** /**
* Container for JSDoc classes, objects, and values that can be injected into other modules. * Container for JSDoc classes, objects, and values that can be injected into other modules.
* *
* @alias module:@jsdoc/core.deps * @alias module:@jsdoc/core.deps
*/ */
class Dependencies { export default class Dependencies {
constructor() { constructor() {
// This class provides a lightweight facade for the `bottlejs` package. // This class provides a lightweight facade for the `bottlejs` package.
this._bottle = new Bottle(); this._bottle = new Bottle();
@ -90,5 +90,3 @@ class Dependencies {
this._bottle.resetProviders(names); this._bottle.resetProviders(names);
} }
} }
module.exports = Dependencies;

View File

@ -19,7 +19,7 @@
* *
* @alias @jsdoc/core.env * @alias @jsdoc/core.env
*/ */
module.exports = { export default {
/** /**
* The times at which JSDoc started and finished. * The times at which JSDoc started and finished.
* *

View File

@ -18,8 +18,8 @@
* *
* @alias @jsdoc/core.name * @alias @jsdoc/core.name
*/ */
const _ = require('lodash'); import escape from 'escape-string-regexp';
const escape = require('escape-string-regexp'); import _ from 'lodash';
/** /**
* Longnames that have a special meaning in JSDoc. * Longnames that have a special meaning in JSDoc.
@ -28,7 +28,7 @@ const escape = require('escape-string-regexp');
* @static * @static
* @memberof module:jsdoc/name * @memberof module:jsdoc/name
*/ */
exports.LONGNAMES = { export const LONGNAMES = {
/** Longname used for doclets that do not have a longname, such as anonymous functions. */ /** Longname used for doclets that do not have a longname, such as anonymous functions. */
ANONYMOUS: '<anonymous>', ANONYMOUS: '<anonymous>',
/** Longname that represents global scope. */ /** Longname that represents global scope. */
@ -36,7 +36,7 @@ exports.LONGNAMES = {
}; };
// Module namespace prefix. // Module namespace prefix.
exports.MODULE_NAMESPACE = 'module:'; export const MODULE_NAMESPACE = 'module:';
/** /**
* Names and punctuation marks that identify doclet scopes. * Names and punctuation marks that identify doclet scopes.
@ -45,7 +45,7 @@ exports.MODULE_NAMESPACE = 'module:';
* @static * @static
* @memberof module:jsdoc/name * @memberof module:jsdoc/name
*/ */
const SCOPE = (exports.SCOPE = { export const SCOPE = {
NAMES: { NAMES: {
GLOBAL: 'global', GLOBAL: 'global',
INNER: 'inner', INNER: 'inner',
@ -57,16 +57,16 @@ const SCOPE = (exports.SCOPE = {
INSTANCE: '#', INSTANCE: '#',
STATIC: '.', STATIC: '.',
}, },
}); };
// Keys must be lowercase. // Keys must be lowercase.
const SCOPE_TO_PUNC = (exports.SCOPE_TO_PUNC = { export const SCOPE_TO_PUNC = {
inner: SCOPE.PUNC.INNER, inner: SCOPE.PUNC.INNER,
instance: SCOPE.PUNC.INSTANCE, instance: SCOPE.PUNC.INSTANCE,
static: SCOPE.PUNC.STATIC, static: SCOPE.PUNC.STATIC,
}); };
exports.PUNC_TO_SCOPE = _.invert(SCOPE_TO_PUNC); export const PUNC_TO_SCOPE = _.invert(SCOPE_TO_PUNC);
const SCOPE_PUNC = _.values(SCOPE.PUNC); const SCOPE_PUNC = _.values(SCOPE.PUNC);
const SCOPE_PUNC_STRING = `[${SCOPE_PUNC.join()}]`; const SCOPE_PUNC_STRING = `[${SCOPE_PUNC.join()}]`;
@ -90,11 +90,11 @@ const REGEXP_NAME_DESCRIPTION = new RegExp(`^(\\[[^\\]]+\\]|\\S+)${DESCRIPTION}`
* @returns {boolean} `true` if the name represents a complete longname that is a member of the * @returns {boolean} `true` if the name represents a complete longname that is a member of the
* parent; otherwise, `false`. * parent; otherwise, `false`.
*/ */
exports.nameIsLongname = (name, memberof) => { export function nameIsLongname(name, memberof) {
const regexp = new RegExp(`^${escape(memberof)}${SCOPE_PUNC_STRING}`); const regexp = new RegExp(`^${escape(memberof)}${SCOPE_PUNC_STRING}`);
return regexp.test(name); return regexp.test(name);
}; }
/** /**
* For names that identify a property of a prototype, replace the `prototype` portion of the name * For names that identify a property of a prototype, replace the `prototype` portion of the name
@ -104,14 +104,14 @@ exports.nameIsLongname = (name, memberof) => {
* @param {string} name - The name in which to change `prototype` to `#`. * @param {string} name - The name in which to change `prototype` to `#`.
* @returns {string} The updated name. * @returns {string} The updated name.
*/ */
const prototypeToPunc = (exports.prototypeToPunc = (name) => { export function prototypeToPunc(name) {
// Don't mangle symbols named `prototype`. // Don't mangle symbols named `prototype`.
if (name === 'prototype') { if (name === 'prototype') {
return name; return name;
} }
return name.replace(/(?:^|\.)prototype\.?/g, SCOPE.PUNC.INSTANCE); return name.replace(/(?:^|\.)prototype\.?/g, SCOPE.PUNC.INSTANCE);
}); }
/** /**
* Check whether a name begins with a character that identifies a scope. * Check whether a name begins with a character that identifies a scope.
@ -119,7 +119,7 @@ const prototypeToPunc = (exports.prototypeToPunc = (name) => {
* @param {string} name - The name to check. * @param {string} name - The name to check.
* @returns {boolean} `true` if the name begins with a scope character; otherwise, `false`. * @returns {boolean} `true` if the name begins with a scope character; otherwise, `false`.
*/ */
exports.hasLeadingScope = (name) => REGEXP_LEADING_SCOPE.test(name); export const hasLeadingScope = (name) => REGEXP_LEADING_SCOPE.test(name);
/** /**
* Check whether a name ends with a character that identifies a scope. * Check whether a name ends with a character that identifies a scope.
@ -127,7 +127,7 @@ exports.hasLeadingScope = (name) => REGEXP_LEADING_SCOPE.test(name);
* @param {string} name - The name to check. * @param {string} name - The name to check.
* @returns {boolean} `true` if the name ends with a scope character; otherwise, `false`. * @returns {boolean} `true` if the name ends with a scope character; otherwise, `false`.
*/ */
exports.hasTrailingScope = (name) => REGEXP_TRAILING_SCOPE.test(name); export const hasTrailingScope = (name) => REGEXP_TRAILING_SCOPE.test(name);
/** /**
* Get a symbol's basename, which is the first part of its full name before any punctuation (other * Get a symbol's basename, which is the first part of its full name before any punctuation (other
@ -141,16 +141,16 @@ exports.hasTrailingScope = (name) => REGEXP_TRAILING_SCOPE.test(name);
* @param {?string} [name] - The symbol's full name. * @param {?string} [name] - The symbol's full name.
* @returns {?string} The symbol's basename. * @returns {?string} The symbol's basename.
*/ */
exports.getBasename = (name) => { export function getBasename(name) {
if (!name) { if (!name) {
return null; return null;
} }
return name.replace(/^([$a-z_][$a-z_0-9]*).*?$/i, '$1'); return name.replace(/^([$a-z_][$a-z_0-9]*).*?$/i, '$1');
}; }
// TODO: docs // TODO: docs
exports.stripNamespace = (longname) => longname.replace(/^[a-zA-Z]+:/, ''); export const stripNamespace = (longname) => longname.replace(/^[a-zA-Z]+:/, '');
// TODO: docs // TODO: docs
function slice(longname, sliceChars, forcedMemberof) { function slice(longname, sliceChars, forcedMemberof) {
@ -242,7 +242,7 @@ function slice(longname, sliceChars, forcedMemberof) {
* @param {string} forcedMemberof * @param {string} forcedMemberof
* @returns {object} Representing the properties of the given name. * @returns {object} Representing the properties of the given name.
*/ */
exports.toParts = (longname, forcedMemberof) => slice(longname, null, forcedMemberof); export const toParts = (longname, forcedMemberof) => slice(longname, null, forcedMemberof);
// TODO: docs // TODO: docs
/** /**
@ -250,7 +250,7 @@ exports.toParts = (longname, forcedMemberof) => slice(longname, null, forcedMemb
* @param {string} ns The namespace to be applied. * @param {string} ns The namespace to be applied.
* @returns {string} The longname with the namespace applied. * @returns {string} The longname with the namespace applied.
*/ */
exports.applyNamespace = (longname, ns) => { export function applyNamespace(longname, ns) {
const nameParts = slice(longname); const nameParts = slice(longname);
const name = nameParts.name; const name = nameParts.name;
@ -261,7 +261,7 @@ exports.applyNamespace = (longname, ns) => {
} }
return longname; return longname;
}; }
/** /**
* Check whether a parent longname is an ancestor of a child longname. * Check whether a parent longname is an ancestor of a child longname.
@ -270,42 +270,43 @@ exports.applyNamespace = (longname, ns) => {
* @param {string} child - The child longname. * @param {string} child - The child longname.
* @return {boolean} `true` if the parent is an ancestor of the child; otherwise, `false`. * @return {boolean} `true` if the parent is an ancestor of the child; otherwise, `false`.
*/ */
exports.hasAncestor = (parent, child) => { export function hasAncestor(parent, child) {
let hasAncestor = false; let parentIsAncestor = false;
let memberof = child; let memberof = child;
if (!parent || !child) { if (!parent || !child) {
return hasAncestor; return parentIsAncestor;
} }
// Fast path for obvious non-ancestors. // Fast path for obvious non-ancestors.
if (child.indexOf(parent) !== 0) { if (child.indexOf(parent) !== 0) {
return hasAncestor; return parentIsAncestor;
} }
do { do {
memberof = slice(memberof).memberof; memberof = slice(memberof).memberof;
if (memberof === parent) { if (memberof === parent) {
hasAncestor = true; parentIsAncestor = true;
} }
} while (!hasAncestor && memberof); } while (!parentIsAncestor && memberof);
return hasAncestor; return parentIsAncestor;
}; }
// TODO: docs // TODO: docs
const fromParts = (exports.fromParts = ({ memberof, scope, name, variation }) => export function fromParts({ memberof, scope, name, variation }) {
[memberof || '', scope || '', name || '', variation ? `(${variation})` : ''].join('')); return [memberof || '', scope || '', name || '', variation ? `(${variation})` : ''].join('');
}
// TODO: docs // TODO: docs
exports.stripVariation = (name) => { export function stripVariation(name) {
const parts = slice(name); const parts = slice(name);
parts.variation = ''; parts.variation = '';
return fromParts(parts); return fromParts(parts);
}; }
function splitLongname(longname, options) { function splitLongname(longname, options) {
const chunks = []; const chunks = [];
@ -415,7 +416,7 @@ function splitLongname(longname, options) {
* longname. * longname.
* @return {Object} A tree with information about each longname in the format shown above. * @return {Object} A tree with information about each longname in the format shown above.
*/ */
exports.longnamesToTree = (longnames, doclets) => { export function longnamesToTree(longnames, doclets) {
const splitOptions = { includeVariation: false }; const splitOptions = { includeVariation: false };
const tree = {}; const tree = {};
@ -453,7 +454,7 @@ exports.longnamesToTree = (longnames, doclets) => {
}); });
return tree; return tree;
}; }
/** /**
* Split a string that starts with a name and ends with a description into its parts. Allows the * Split a string that starts with a name and ends with a description into its parts. Allows the
@ -494,10 +495,11 @@ function splitNameMatchingBrackets(nameDesc) {
return null; return null;
} }
nameDesc.substr(i).match(REGEXP_DESCRIPTION); nameDesc.substring(i).match(REGEXP_DESCRIPTION);
return { return {
name: buffer.join(''), name: buffer.join(''),
// TODO: Don't use global RegExp properties.
description: RegExp.$1, description: RegExp.$1,
}; };
} }
@ -507,7 +509,7 @@ function splitNameMatchingBrackets(nameDesc) {
* @param {string} str - The string that contains the name and description. * @param {string} str - The string that contains the name and description.
* @returns {object} An object with `name` and `description` properties. * @returns {object} An object with `name` and `description` properties.
*/ */
exports.splitNameAndDescription = (str) => { export function splitNameAndDescription(str) {
// Like: `name`, `[name]`, `name text`, `[name] text`, `name - text`, or `[name] - text`. // Like: `name`, `[name]`, `name text`, `[name] text`, `name - text`, or `[name] - text`.
// To ensure that we don't get confused by leading dashes in Markdown list items, the hyphen // To ensure that we don't get confused by leading dashes in Markdown list items, the hyphen
// must be on the same line as the name. // must be on the same line as the name.
@ -525,7 +527,8 @@ exports.splitNameAndDescription = (str) => {
str.match(REGEXP_NAME_DESCRIPTION); str.match(REGEXP_NAME_DESCRIPTION);
return { return {
// TODO: Don't use global RegExp properties.
name: RegExp.$1, name: RegExp.$1,
description: RegExp.$2, description: RegExp.$2,
}; };
}; }

View File

@ -23,12 +23,12 @@ function addHandlers(handlers, parser, deps) {
}); });
} }
exports.installPlugins = (plugins, parser, deps) => { export async function installPlugins(plugins, parser, deps) {
let dictionary; let dictionary;
let plugin; let plugin;
for (let pluginModule of plugins) { for (let pluginModule of plugins) {
plugin = require(pluginModule); plugin = await import(pluginModule); // eslint-disable-line no-await-in-loop
// allow user-defined plugins to... // allow user-defined plugins to...
// ...register event handlers // ...register event handlers
@ -47,4 +47,4 @@ exports.installPlugins = (plugins, parser, deps) => {
parser.addAstNodeVisitor(plugin.astNodeVisitor, deps); parser.addAstNodeVisitor(plugin.astNodeVisitor, deps);
} }
} }
}; }

View File

@ -10,11 +10,11 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"bottlejs": "^2.0.1", "bottlejs": "^2.0.1",
"cosmiconfig": "^7.1.0", "cosmiconfig": "^8.1.0",
"escape-string-regexp": "^4.0.0", "escape-string-regexp": "^5.0.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"strip-bom": "^4.0.0", "strip-bom": "^5.0.0",
"strip-json-comments": "^3.1.1" "strip-json-comments": "^5.0.0"
}, },
"engines": { "engines": {
"node": ">=v18.12.0" "node": ">=v18.12.0"
@ -52,11 +52,6 @@
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
},
"node_modules/ansi-styles": { "node_modules/ansi-styles": {
"version": "3.2.1", "version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
@ -68,6 +63,11 @@
"node": ">=4" "node": ">=4"
} }
}, },
"node_modules/argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
},
"node_modules/bottlejs": { "node_modules/bottlejs": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz", "resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz",
@ -116,18 +116,20 @@
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
}, },
"node_modules/cosmiconfig": { "node_modules/cosmiconfig": {
"version": "7.1.0", "version": "8.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", "integrity": "sha512-0tLZ9URlPGU7JsKq0DQOQ3FoRsYX8xDZ7xMiATQfaiGMz7EHowNkbU9u1coAOmnh9p/1ySpm0RB3JNWRXM5GCg==",
"dependencies": { "dependencies": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1", "import-fresh": "^3.2.1",
"js-yaml": "^4.1.0",
"parse-json": "^5.0.0", "parse-json": "^5.0.0",
"path-type": "^4.0.0", "path-type": "^4.0.0"
"yaml": "^1.10.0"
}, },
"engines": { "engines": {
"node": ">=10" "node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/d-fischer"
} }
}, },
"node_modules/error-ex": { "node_modules/error-ex": {
@ -139,11 +141,11 @@
} }
}, },
"node_modules/escape-string-regexp": { "node_modules/escape-string-regexp": {
"version": "4.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
"engines": { "engines": {
"node": ">=10" "node": ">=12"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
@ -182,6 +184,17 @@
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
}, },
"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==",
"dependencies": {
"argparse": "^2.0.1"
},
"bin": {
"js-yaml": "bin/js-yaml.js"
}
},
"node_modules/json-parse-even-better-errors": { "node_modules/json-parse-even-better-errors": {
"version": "2.3.1", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
@ -242,19 +255,22 @@
} }
}, },
"node_modules/strip-bom": { "node_modules/strip-bom": {
"version": "4.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-5.0.0.tgz",
"integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "integrity": "sha512-p+byADHF7SzEcVnLvc/r3uognM1hUhObuHXxJcgLCfD194XAkaLbjq3Wzb0N5G2tgIjH0dgT708Z51QxMeu60A==",
"engines": { "engines": {
"node": ">=8" "node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/strip-json-comments": { "node_modules/strip-json-comments": {
"version": "3.1.1", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.0.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "integrity": "sha512-V1LGY4UUo0jgwC+ELQ2BNWfPa17TIuwBLg+j1AA/9RPzKINl1lhxVEu2r+ZTTO8aetIsUzE5Qj6LMSBkoGYKKw==",
"engines": { "engines": {
"node": ">=8" "node": ">=14.16"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
@ -270,14 +286,6 @@
"engines": { "engines": {
"node": ">=4" "node": ">=4"
} }
},
"node_modules/yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"engines": {
"node": ">= 6"
}
} }
}, },
"dependencies": { "dependencies": {
@ -304,11 +312,6 @@
"js-tokens": "^4.0.0" "js-tokens": "^4.0.0"
} }
}, },
"@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA=="
},
"ansi-styles": { "ansi-styles": {
"version": "3.2.1", "version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
@ -317,6 +320,11 @@
"color-convert": "^1.9.0" "color-convert": "^1.9.0"
} }
}, },
"argparse": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
},
"bottlejs": { "bottlejs": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz", "resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz",
@ -358,15 +366,14 @@
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU="
}, },
"cosmiconfig": { "cosmiconfig": {
"version": "7.1.0", "version": "8.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", "integrity": "sha512-0tLZ9URlPGU7JsKq0DQOQ3FoRsYX8xDZ7xMiATQfaiGMz7EHowNkbU9u1coAOmnh9p/1ySpm0RB3JNWRXM5GCg==",
"requires": { "requires": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1", "import-fresh": "^3.2.1",
"js-yaml": "^4.1.0",
"parse-json": "^5.0.0", "parse-json": "^5.0.0",
"path-type": "^4.0.0", "path-type": "^4.0.0"
"yaml": "^1.10.0"
} }
}, },
"error-ex": { "error-ex": {
@ -378,9 +385,9 @@
} }
}, },
"escape-string-regexp": { "escape-string-regexp": {
"version": "4.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="
}, },
"has-flag": { "has-flag": {
"version": "3.0.0", "version": "3.0.0",
@ -406,6 +413,14 @@
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
}, },
"js-yaml": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"requires": {
"argparse": "^2.0.1"
}
},
"json-parse-even-better-errors": { "json-parse-even-better-errors": {
"version": "2.3.1", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
@ -451,14 +466,14 @@
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="
}, },
"strip-bom": { "strip-bom": {
"version": "4.0.0", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-5.0.0.tgz",
"integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==" "integrity": "sha512-p+byADHF7SzEcVnLvc/r3uognM1hUhObuHXxJcgLCfD194XAkaLbjq3Wzb0N5G2tgIjH0dgT708Z51QxMeu60A=="
}, },
"strip-json-comments": { "strip-json-comments": {
"version": "3.1.1", "version": "5.0.0",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-5.0.0.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" "integrity": "sha512-V1LGY4UUo0jgwC+ELQ2BNWfPa17TIuwBLg+j1AA/9RPzKINl1lhxVEu2r+ZTTO8aetIsUzE5Qj6LMSBkoGYKKw=="
}, },
"supports-color": { "supports-color": {
"version": "5.5.0", "version": "5.5.0",
@ -467,11 +482,6 @@
"requires": { "requires": {
"has-flag": "^3.0.0" "has-flag": "^3.0.0"
} }
},
"yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg=="
} }
} }
} }

View File

@ -21,13 +21,22 @@
"bugs": { "bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues" "url": "https://github.com/jsdoc/jsdoc/issues"
}, },
"type": "module",
"exports": {
".": {
"import": "./index.js"
},
"./lib/*": {
"import": "./lib/*"
}
},
"dependencies": { "dependencies": {
"bottlejs": "^2.0.1", "bottlejs": "^2.0.1",
"cosmiconfig": "^7.1.0", "cosmiconfig": "^8.1.0",
"escape-string-regexp": "^4.0.0", "escape-string-regexp": "^5.0.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"strip-bom": "^4.0.0", "strip-bom": "^5.0.0",
"strip-json-comments": "^3.1.1" "strip-json-comments": "^5.0.0"
}, },
"engines": { "engines": {
"node": ">=v18.12.0" "node": ">=v18.12.0"

View File

@ -13,20 +13,16 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const EventEmitter = require('events'); export const nodes = [];
class PluginTestAstVisitor extends EventEmitter { export function init() {
constructor() { nodes.length = 0;
super();
this.astNodeVisitor = {
visitNode: (node) => {
if (node.type === 'VariableDeclarator' && node.id.name === 'foo') {
this.emit('visitNode', node);
}
}
};
}
} }
module.exports = new PluginTestAstVisitor(); export const astNodeVisitor = {
visitNode: (node) => {
if (node.type === 'VariableDeclarator' && node.id.name === 'foo') {
nodes.push(node);
}
}
}

View File

@ -13,8 +13,6 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const EventEmitter = require('events');
const events = [ const events = [
'parseBegin', 'parseBegin',
'fileBegin', 'fileBegin',
@ -27,16 +25,14 @@ const events = [
'processingComplete', 'processingComplete',
]; ];
class PluginTestHandlers extends EventEmitter { export const eventCounts = {};
constructor() {
super();
this.handlers = events.reduce((h, eventName) => { export function init() {
h[eventName] = () => this.emit(eventName); events.forEach((eventName) => (eventCounts[eventName] = 0));
return h;
}, {});
}
} }
module.exports = new PluginTestHandlers(); export const handlers = events.reduce((h, eventName) => {
h[eventName] = () => eventCounts[eventName]++;
return h;
}, {});

View File

@ -13,28 +13,10 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const EventEmitter = require('events'); export function defineTags(dictionary) {
dictionary.defineTag('foo', {
const events = [ onTagged: (doclet) => {
'parseBegin', doclet.foo = true;
'fileBegin', },
'beforeParse', });
'jsdocCommentFound',
'symbolFound',
'newDoclet',
'fileComplete',
'parseComplete',
'processingComplete',
];
class PluginTestTags extends EventEmitter {
defineTags(dictionary) {
dictionary.defineTag('foo', {
onTagged: (doclet, tag) => {
doclet.foo = true;
},
});
}
} }
module.exports = new PluginTestTags();

View File

@ -13,19 +13,7 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const EventEmitter = require('events'); import EventEmitter from 'node:events';
const events = [
'parseBegin',
'fileBegin',
'beforeParse',
'jsdocCommentFound',
'symbolFound',
'newDoclet',
'fileComplete',
'parseComplete',
'processingComplete',
];
class PluginTestVisitors extends EventEmitter { class PluginTestVisitors extends EventEmitter {
constructor() { constructor() {
@ -37,4 +25,4 @@ class PluginTestVisitors extends EventEmitter {
} }
} }
module.exports = new PluginTestVisitors(); export default new PluginTestVisitors();

View File

@ -13,50 +13,41 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const core = require('../../index'); import core from '../../index.js';
import * as config from '../../lib/config.js';
import Dependencies from '../../lib/dependencies.js';
import env from '../../lib/env.js';
import * as name from '../../lib/name.js';
import * as plugins from '../../lib/plugins.js';
describe('@jsdoc/core', () => { describe('@jsdoc/core', () => {
it('is an object', () => {
expect(core).toBeObject();
});
describe('config', () => { describe('config', () => {
it('is lib/config', () => { it('is lib/config', () => {
const config = require('../../lib/config'); expect(core.config).toEqual(config);
expect(core.config).toBe(config);
}); });
}); });
describe('Dependencies', () => { describe('Dependencies', () => {
it('is lib/dependencies', () => { it('is lib/dependencies', () => {
const Dependencies = require('../../lib/dependencies'); expect(core.Dependencies).toEqual(Dependencies);
expect(core.Dependencies).toBe(Dependencies);
}); });
}); });
describe('env', () => { describe('env', () => {
it('is lib/env', () => { it('is lib/env', () => {
const env = require('../../lib/env'); expect(core.env).toEqual(env);
expect(core.env).toBe(env);
}); });
}); });
describe('name', () => { describe('name', () => {
it('is lib/name', () => { it('is lib/name', () => {
const name = require('../../lib/name'); expect(core.name).toEqual(name);
expect(core.name).toBe(name);
}); });
}); });
describe('plugins', () => { describe('plugins', () => {
it('is lib/plugins', () => { it('is lib/plugins', () => {
const plugins = require('../../lib/plugins'); expect(core.plugins).toEqual(plugins);
expect(core.plugins).toBe(plugins);
}); });
}); });
}); });

View File

@ -13,13 +13,17 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const mockFs = require('mock-fs'); import { defaultLoaders } from 'cosmiconfig';
const config = require('../../../lib/config'); import mockFs from 'mock-fs';
import * as config from '../../../lib/config.js'; // eslint-disable-line sort-imports
describe('@jsdoc/core/lib/config', () => { describe('@jsdoc/core/lib/config', () => {
// Explicitly require `yaml` before we run any tests. `cosmiconfig` tries to load `yaml` lazily, // Ensure that YAML parser is loaded before we run any tests. `cosmiconfig` tries to load it
// but that doesn't work when the file system is mocked. // lazily, but that doesn't work when the file system is mocked.
beforeAll(() => require('yaml')); beforeAll(() => {
defaultLoaders['.yaml']('fakefile.yaml', 'file: []');
});
afterEach(() => mockFs.restore()); afterEach(() => mockFs.restore());

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const Dependencies = require('../../../lib/dependencies'); import Dependencies from '../../../lib/dependencies.js';
describe('@jsdoc/core/lib/dependencies', () => { describe('@jsdoc/core/lib/dependencies', () => {
let container; let container;

View File

@ -13,9 +13,9 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
describe('@jsdoc/core.env', () => { import env from '../../../lib/env.js';
const { env } = require('../../../index');
describe('@jsdoc/core.env', () => {
it('exists', () => { it('exists', () => {
expect(env).toBeObject(); expect(env).toBeObject();
}); });

View File

@ -13,9 +13,9 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
describe('@jsdoc/core.name', () => { import * as name from '../../../lib/name.js';
const { name } = require('../../../index');
describe('@jsdoc/core.name', () => {
it('exists', () => { it('exists', () => {
expect(name).toBeObject(); expect(name).toBeObject();
}); });
@ -113,9 +113,7 @@ describe('@jsdoc/core.name', () => {
}); });
}); });
xdescribe('fromParts', () => { // TODO: fromParts tests
// TODO: tests
});
describe('getBasename', () => { describe('getBasename', () => {
it('returns null on empty input', () => { it('returns null on empty input', () => {
@ -187,19 +185,13 @@ describe('@jsdoc/core.name', () => {
}); });
}); });
xdescribe('longnamesToTree', () => { // TODO: longnamesToTree tests
// TODO: tests
});
// MODULE_NAMESPACE is just a string, so nothing to test. // MODULE_NAMESPACE is just a string, so nothing to test.
xdescribe('nameIsLongname', () => { // TODO: nameIsLongname tests
// TODO(hegemonic)
});
xdescribe('prototypeToPunc', () => { // TODO: prototypeToPunc tests
// TODO(hegemonic)
});
describe('PUNC_TO_SCOPE', () => { describe('PUNC_TO_SCOPE', () => {
it('has the same number of properties as SCOPE_TO_PUNC', () => { it('has the same number of properties as SCOPE_TO_PUNC', () => {

View File

@ -14,16 +14,18 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
describe('@jsdoc/core/lib/plugins', () => { import path from 'node:path';
const path = require('path');
const plugins = require('../../../lib/plugins');
import * as plugins from '../../../lib/plugins.js';
const __dirname = jsdoc.dirname(import.meta.url);
describe('@jsdoc/core/lib/plugins', () => {
it('has an `installPlugins` method', () => { it('has an `installPlugins` method', () => {
expect(plugins.installPlugins).toBeFunction(); expect(plugins.installPlugins).toBeFunction();
}); });
describe('installPlugins', () => { describe('installPlugins', () => {
let eventCounts;
let parser; let parser;
const events = [ const events = [
@ -38,24 +40,17 @@ describe('@jsdoc/core/lib/plugins', () => {
'processingComplete', 'processingComplete',
]; ];
function countEvents(emitter) {
events.forEach((eventName) => {
emitter.on(eventName, () => eventCounts[eventName]++);
});
}
beforeEach(() => { beforeEach(() => {
eventCounts = {};
events.forEach((eventName) => (eventCounts[eventName] = 0));
parser = jsdoc.createParser(); parser = jsdoc.createParser();
}); });
it('adds event handlers to the parser', () => { it('adds event handlers to the parser', async () => {
let pluginPath = path.resolve(__dirname, '../../fixtures/plugin-test-handlers.js'); let pluginPath = path.resolve(__dirname, '../../fixtures/plugin-test-handlers.js');
const plugin = require(pluginPath); const { eventCounts, init } = await import(pluginPath);
plugins.installPlugins([pluginPath], parser, jsdoc.deps); init();
countEvents(plugin);
await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
jsdoc.getDocSetFromFile( jsdoc.getDocSetFromFile(
path.resolve(__dirname, '../../fixtures/plugin-source-file.js'), path.resolve(__dirname, '../../fixtures/plugin-source-file.js'),
parser parser
@ -70,13 +65,13 @@ describe('@jsdoc/core/lib/plugins', () => {
}); });
}); });
it('adds AST node visitors to the parser', () => { it('adds AST node visitors to the parser', async () => {
const nodes = [];
let pluginPath = path.resolve(__dirname, '../../fixtures/plugin-test-ast-visitor.js'); let pluginPath = path.resolve(__dirname, '../../fixtures/plugin-test-ast-visitor.js');
const plugin = require(pluginPath); const { nodes, init } = await import(pluginPath);
plugins.installPlugins([pluginPath], parser, jsdoc.deps); init();
plugin.on('visitNode', (node) => nodes.push(node));
await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
jsdoc.getDocSetFromFile( jsdoc.getDocSetFromFile(
path.resolve(__dirname, '../../fixtures/plugin-source-file.js'), path.resolve(__dirname, '../../fixtures/plugin-source-file.js'),
parser parser
@ -86,11 +81,11 @@ describe('@jsdoc/core/lib/plugins', () => {
expect(nodes[0].init.value).toBe('bar'); expect(nodes[0].init.value).toBe('bar');
}); });
it('adds tags to the dictionary', () => { it('adds tags to the dictionary', async () => {
const doclets = []; const doclets = [];
let pluginPath = path.resolve(__dirname, '../../fixtures/plugin-test-tags.js'); let pluginPath = path.resolve(__dirname, '../../fixtures/plugin-test-tags.js');
plugins.installPlugins([pluginPath], parser, jsdoc.deps); await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
parser.on('newDoclet', (e) => { parser.on('newDoclet', (e) => {
if (e.doclet.longname === 'test') { if (e.doclet.longname === 'test') {
doclets.push(e.doclet); doclets.push(e.doclet);

View File

@ -13,17 +13,11 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const augment = require('./lib/augment'); import * as augment from './lib/augment.js';
const { combine: combineDoclets, Doclet } = require('./lib/doclet'); import { resolveBorrows } from './lib/borrow.js';
const { Package } = require('./lib/package'); import { combineDoclets, Doclet } from './lib/doclet.js';
const { resolveBorrows } = require('./lib/borrow'); import { Package } from './lib/package.js';
const schema = require('./lib/schema'); import * as schema from './lib/schema.js';
module.exports = { export { augment, combineDoclets, Doclet, Package, resolveBorrows, schema };
augment, export default { augment, combineDoclets, Doclet, Package, resolveBorrows, schema };
combineDoclets,
Doclet,
Package,
resolveBorrows,
schema,
};

View File

@ -16,10 +16,12 @@
/** /**
* Provides methods for augmenting the parse results based on their content. * Provides methods for augmenting the parse results based on their content.
*/ */
import { name } from '@jsdoc/core';
import _ from 'lodash';
const _ = require('lodash'); import { combineDoclets } from './doclet.js';
const { combine: combineDoclets } = require('./doclet');
const { fromParts, SCOPE, toParts } = require('@jsdoc/core').name; const { fromParts, SCOPE, toParts } = name;
function mapDependencies(index, propertyName) { function mapDependencies(index, propertyName) {
const dependencies = {}; const dependencies = {};
@ -550,9 +552,9 @@ function augment(doclets, propertyName, docletFinder, jsdocDeps) {
* @param {!Object} doclets.index - The doclet index. * @param {!Object} doclets.index - The doclet index.
* @return {void} * @return {void}
*/ */
exports.addInherited = (doclets) => { export function addInherited(doclets) {
augment(doclets, 'augments', getInheritedAdditions); augment(doclets, 'augments', getInheritedAdditions);
}; }
/** /**
* Add doclets to reflect mixins. When a symbol is mixed into a class, the class' version of the * Add doclets to reflect mixins. When a symbol is mixed into a class, the class' version of the
@ -569,9 +571,9 @@ exports.addInherited = (doclets) => {
* @param {!Object} doclets.index - The doclet index. * @param {!Object} doclets.index - The doclet index.
* @return {void} * @return {void}
*/ */
exports.addMixedIn = (doclets) => { export function addMixedIn(doclets) {
augment(doclets, 'mixes', getMixedInAdditions); augment(doclets, 'mixes', getMixedInAdditions);
}; }
/** /**
* Add and update doclets to reflect implementations of interfaces. * Add and update doclets to reflect implementations of interfaces.
@ -590,9 +592,9 @@ exports.addMixedIn = (doclets) => {
* @param {!Object} doclets.index - The doclet index. * @param {!Object} doclets.index - The doclet index.
* @return {void} * @return {void}
*/ */
exports.addImplemented = (doclets) => { export function addImplemented(doclets) {
augment(doclets, 'implements', getImplementedAdditions); augment(doclets, 'implements', getImplementedAdditions);
}; }
/** /**
* Add and update doclets to reflect all of the following: * Add and update doclets to reflect all of the following:
@ -605,10 +607,10 @@ exports.addImplemented = (doclets) => {
* *
* @return {void} * @return {void}
*/ */
exports.augmentAll = (doclets) => { export function augmentAll(doclets) {
exports.addMixedIn(doclets); addMixedIn(doclets);
exports.addImplemented(doclets); addImplemented(doclets);
exports.addInherited(doclets); addInherited(doclets);
// look for implemented doclets again, in case we inherited an interface // look for implemented doclets again, in case we inherited an interface
exports.addImplemented(doclets); addImplemented(doclets);
}; }

View File

@ -16,8 +16,10 @@
/** /**
* Functions that resolve `@borrows` tags in JSDoc comments. * Functions that resolve `@borrows` tags in JSDoc comments.
*/ */
const _ = require('lodash'); import { name } from '@jsdoc/core';
const { SCOPE } = require('@jsdoc/core').name; import _ from 'lodash';
const { SCOPE } = name;
function cloneBorrowedDoclets({ borrowed, longname }, doclets) { function cloneBorrowedDoclets({ borrowed, longname }, doclets) {
borrowed.forEach(({ from, as }) => { borrowed.forEach(({ from, as }) => {
@ -55,11 +57,11 @@ function cloneBorrowedDoclets({ borrowed, longname }, doclets) {
moving docs from the "borrowed" array and into the general docs, then moving docs from the "borrowed" array and into the general docs, then
deleting the "borrowed" array. deleting the "borrowed" array.
*/ */
exports.resolveBorrows = (doclets) => { export function resolveBorrows(doclets) {
for (let doclet of doclets.index.borrowed) { for (let doclet of doclets.index.borrowed) {
cloneBorrowedDoclets(doclet, doclets); cloneBorrowedDoclets(doclet, doclets);
delete doclet.borrowed; delete doclet.borrowed;
} }
doclets.index.borrowed = []; doclets.index.borrowed = [];
}; }

View File

@ -13,8 +13,13 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const _ = require('lodash'); import path from 'node:path';
const { isFunction } = require('@jsdoc/ast').astNode;
import { astNode, Syntax } from '@jsdoc/ast';
import { name as jsdocName } from '@jsdoc/core';
import { Tag } from '@jsdoc/tag';
import _ from 'lodash';
const { const {
applyNamespace, applyNamespace,
hasLeadingScope, hasLeadingScope,
@ -27,10 +32,8 @@ const {
SCOPE, SCOPE,
SCOPE_TO_PUNC, SCOPE_TO_PUNC,
toParts, toParts,
} = require('@jsdoc/core').name; } = jsdocName;
const path = require('path'); const { isFunction } = astNode;
const { Syntax } = require('@jsdoc/ast');
const { Tag } = require('@jsdoc/tag');
const DEFAULT_SCOPE = SCOPE.NAMES.STATIC; const DEFAULT_SCOPE = SCOPE.NAMES.STATIC;
@ -366,7 +369,7 @@ function copySpecificProperties(primary, secondary, target, include) {
* *
* @alias module:@jsdoc/doclet.Doclet * @alias module:@jsdoc/doclet.Doclet
*/ */
class Doclet { export class Doclet {
/** /**
* Create a doclet. * Create a doclet.
* *
@ -649,7 +652,6 @@ class Doclet {
} }
} }
} }
exports.Doclet = Doclet;
/** /**
* Combine two doclets into a new doclet. * Combine two doclets into a new doclet.
@ -660,8 +662,8 @@ exports.Doclet = Doclet;
* @returns {module:@jsdoc/doclet.Doclet} A new doclet that combines the primary and secondary * @returns {module:@jsdoc/doclet.Doclet} A new doclet that combines the primary and secondary
* doclets. * doclets.
*/ */
exports.combine = (primary, secondary) => { export function combineDoclets(primary, secondary) {
const copyMostPropertiesExclude = ['params', 'properties', 'undocumented']; const copyMostPropertiesExclude = ['dependencies', 'params', 'properties', 'undocumented'];
const copySpecificPropertiesInclude = ['params', 'properties']; const copySpecificPropertiesInclude = ['params', 'properties'];
const target = new Doclet('', null, secondary.dependencies); const target = new Doclet('', null, secondary.dependencies);
@ -672,4 +674,4 @@ exports.combine = (primary, secondary) => {
copySpecificProperties(primary, secondary, target, copySpecificPropertiesInclude); copySpecificProperties(primary, secondary, target, copySpecificPropertiesInclude);
return target; return target;
}; }

View File

@ -13,8 +13,8 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const { log } = require('@jsdoc/util'); import { log } from '@jsdoc/util';
const stripBom = require('strip-bom'); import stripBom from 'strip-bom';
/** /**
* Provides access to information about a JavaScript package. * Provides access to information about a JavaScript package.
@ -76,7 +76,7 @@ function getLicenses(packageInfo) {
* `package.json` file does not follow the npm specification, some properties of the `Package` * `package.json` file does not follow the npm specification, some properties of the `Package`
* object may not use the format documented here. * object may not use the format documented here.
*/ */
class Package { export class Package {
/** /**
* @param {string} json - The contents of the `package.json` file. * @param {string} json - The contents of the `package.json` file.
*/ */
@ -256,4 +256,3 @@ class Package {
} }
} }
} }
exports.Package = Package;

View File

@ -37,7 +37,7 @@ const STRING_SCHEMA = {
}; };
// information about the code associated with a doclet // information about the code associated with a doclet
const META_SCHEMA = (exports.META_SCHEMA = { export const META_SCHEMA = {
type: OBJECT, type: OBJECT,
additionalProperties: false, additionalProperties: false,
properties: { properties: {
@ -99,10 +99,10 @@ const META_SCHEMA = (exports.META_SCHEMA = {
type: OBJECT, type: OBJECT,
}, },
}, },
}); };
// type property containing type names // type property containing type names
const TYPE_PROPERTY_SCHEMA = (exports.TYPE_PROPERTY_SCHEMA = { export const TYPE_PROPERTY_SCHEMA = {
type: OBJECT, type: OBJECT,
additionalProperties: false, additionalProperties: false,
properties: { properties: {
@ -119,10 +119,10 @@ const TYPE_PROPERTY_SCHEMA = (exports.TYPE_PROPERTY_SCHEMA = {
additionalProperties: true, additionalProperties: true,
}, },
}, },
}); };
// enumeration properties // enumeration properties
const ENUM_PROPERTY_SCHEMA = (exports.ENUM_PROPERTY_SCHEMA = { export const ENUM_PROPERTY_SCHEMA = {
type: OBJECT, type: OBJECT,
additionalProperties: false, additionalProperties: false,
properties: { properties: {
@ -165,10 +165,10 @@ const ENUM_PROPERTY_SCHEMA = (exports.ENUM_PROPERTY_SCHEMA = {
type: BOOLEAN_OPTIONAL, type: BOOLEAN_OPTIONAL,
}, },
}, },
}); };
// function parameter, or object property defined with @property tag // function parameter, or object property defined with @property tag
const PARAM_SCHEMA = (exports.PARAM_SCHEMA = { export const PARAM_SCHEMA = {
type: OBJECT, type: OBJECT,
additionalProperties: false, additionalProperties: false,
properties: { properties: {
@ -197,9 +197,9 @@ const PARAM_SCHEMA = (exports.PARAM_SCHEMA = {
type: BOOLEAN_OPTIONAL, type: BOOLEAN_OPTIONAL,
}, },
}, },
}); };
const DOCLET_SCHEMA = (exports.DOCLET_SCHEMA = { export const DOCLET_SCHEMA = {
type: OBJECT, type: OBJECT,
additionalProperties: false, additionalProperties: false,
properties: { properties: {
@ -523,9 +523,9 @@ const DOCLET_SCHEMA = (exports.DOCLET_SCHEMA = {
items: PARAM_SCHEMA, items: PARAM_SCHEMA,
}, },
}, },
}); };
const CONTACT_INFO_SCHEMA = (exports.CONTACT_INFO_SCHEMA = { export const CONTACT_INFO_SCHEMA = {
type: OBJECT, type: OBJECT,
additionalProperties: false, additionalProperties: false,
properties: { properties: {
@ -540,9 +540,9 @@ const CONTACT_INFO_SCHEMA = (exports.CONTACT_INFO_SCHEMA = {
format: 'uri', format: 'uri',
}, },
}, },
}); };
const BUGS_SCHEMA = (exports.BUGS_SCHEMA = { export const BUGS_SCHEMA = {
type: OBJECT, type: OBJECT,
additionalProperties: false, additionalProperties: false,
properties: { properties: {
@ -554,9 +554,9 @@ const BUGS_SCHEMA = (exports.BUGS_SCHEMA = {
format: 'uri', format: 'uri',
}, },
}, },
}); };
const PACKAGE_SCHEMA = (exports.PACKAGE_SCHEMA = { export const PACKAGE_SCHEMA = {
type: OBJECT, type: OBJECT,
additionalProperties: false, additionalProperties: false,
properties: { properties: {
@ -652,9 +652,9 @@ const PACKAGE_SCHEMA = (exports.PACKAGE_SCHEMA = {
type: STRING, type: STRING,
}, },
}, },
}); };
exports.DOCLETS_SCHEMA = { export const DOCLETS_SCHEMA = {
type: ARRAY, type: ARRAY,
items: { items: {
anyOf: [DOCLET_SCHEMA, PACKAGE_SCHEMA], anyOf: [DOCLET_SCHEMA, PACKAGE_SCHEMA],

View File

@ -21,6 +21,15 @@
"bugs": { "bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues" "url": "https://github.com/jsdoc/jsdoc/issues"
}, },
"type": "module",
"exports": {
".": {
"import": "./index.js"
},
"./lib/*": {
"import": "./lib/*"
}
},
"dependencies": { "dependencies": {
"@jsdoc/ast": "^0.1.1", "@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6", "@jsdoc/core": "^0.4.6",

View File

@ -13,7 +13,12 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const doclet = require('../../index'); import doclet from '../../index.js';
import * as augment from '../../lib/augment.js';
import { resolveBorrows } from '../../lib/borrow.js';
import { combineDoclets, Doclet } from '../../lib/doclet.js';
import { Package } from '../../lib/package.js';
import * as schema from '../../lib/schema.js';
describe('@jsdoc/doclet', () => { describe('@jsdoc/doclet', () => {
it('is an object', () => { it('is an object', () => {
@ -22,49 +27,37 @@ describe('@jsdoc/doclet', () => {
describe('augment', () => { describe('augment', () => {
it('is lib/augment', () => { it('is lib/augment', () => {
const augment = require('../../lib/augment'); expect(doclet.augment).toEqual(augment);
expect(doclet.augment).toBe(augment);
}); });
}); });
describe('combineDoclets', () => { describe('combineDoclets', () => {
it('is lib/doclet.combine', () => { it('is lib/doclet.combineDoclets', () => {
const { combine } = require('../../lib/doclet'); expect(doclet.combineDoclets).toEqual(combineDoclets);
expect(doclet.combineDoclets).toBe(combine);
}); });
}); });
describe('Doclet', () => { describe('Doclet', () => {
it('is lib/doclet.Doclet', () => { it('is lib/doclet.Doclet', () => {
const { Doclet } = require('../../lib/doclet'); expect(doclet.Doclet).toEqual(Doclet);
expect(doclet.Doclet).toBe(Doclet);
}); });
}); });
describe('Package', () => { describe('Package', () => {
it('is lib/package.Package', () => { it('is lib/package.Package', () => {
const { Package } = require('../../lib/package'); expect(doclet.Package).toEqual(Package);
expect(doclet.Package).toBe(Package);
}); });
}); });
describe('resolveBorrows', () => { describe('resolveBorrows', () => {
it('is lib/borrow.resolveBorrows', () => { it('is lib/borrow.resolveBorrows', () => {
const { resolveBorrows } = require('../../lib/borrow'); expect(doclet.resolveBorrows).toEqual(resolveBorrows);
expect(doclet.resolveBorrows).toBe(resolveBorrows);
}); });
}); });
describe('schema', () => { describe('schema', () => {
it('is lib/schema', () => { it('is lib/schema', () => {
const schema = require('../../lib/schema'); expect(doclet.schema).toEqual(schema);
expect(doclet.schema).toBe(schema);
}); });
}); });
}); });

View File

@ -14,11 +14,10 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
import * as augment from '../../../lib/augment.js';
describe('@jsdoc/doclet/lib/augment', () => { describe('@jsdoc/doclet/lib/augment', () => {
// TODO: more tests // TODO: more tests
const augment = require('../../../lib/augment');
it('should exist', () => { it('should exist', () => {
expect(augment).toBeObject(); expect(augment).toBeObject();
}); });
@ -39,34 +38,13 @@ describe('@jsdoc/doclet/lib/augment', () => {
expect(augment.augmentAll).toBeFunction(); expect(augment.augmentAll).toBeFunction();
}); });
xdescribe('addImplemented', () => { // TODO: basic addImplemented tests (functionality is tested via @interface and @implements tags)
// TODO: add some basic tests (functionality is tested via @interface and @implements tags)
});
xdescribe('addInherited', () => { // TODO: basic addInherited tests (functionality is tested via @augments tag)
// TODO: add some basic tests (functionality is tested via @augments tag)
});
xdescribe('addMixedIn', () => { // TODO: basic addMixedIn tests (functionality is tested via documentation/mixes spec)
// TODO: add some basic tests (functionality is tested via documentation/mixes spec)
});
describe('augmentAll', () => { describe('augmentAll', () => {
it('should call all other methods that the module exports', () => {
const docSet = jsdoc.getDocSetFromFile('test/fixtures/mixintag2.js', null, null, false);
const methodNames = Object.keys(augment).filter((name) => name !== 'augmentAll');
methodNames.forEach((name) => {
spyOn(augment, name);
});
augment.augmentAll(docSet.doclets);
methodNames.forEach((name) => {
expect(augment[name]).toHaveBeenCalled();
});
});
it('should work when a class extends another class that implements an interface', () => { it('should work when a class extends another class that implements an interface', () => {
const docSet = jsdoc.getDocSetFromFile('test/fixtures/augmentall.js', null, null, false); const docSet = jsdoc.getDocSetFromFile('test/fixtures/augmentall.js', null, null, false);
let open; let open;

View File

@ -13,6 +13,4 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
xdescribe('@jsdoc/doclet/lib/borrow', () => { // TODO: Write tests
// TODO
});

View File

@ -14,19 +14,22 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
import { name } from '@jsdoc/core';
import _ from 'lodash';
import * as doclet from '../../../lib/doclet.js';
const { Doclet } = doclet;
const { SCOPE } = name;
describe('@jsdoc/doclet/lib/doclet', () => { describe('@jsdoc/doclet/lib/doclet', () => {
// TODO: more tests // TODO: more tests
const _ = require('lodash');
const doclet = require('../../../lib/doclet');
const Doclet = doclet.Doclet;
const { SCOPE } = require('@jsdoc/core').name;
it('exists', () => { it('exists', () => {
expect(doclet).toBeObject(); expect(doclet).toBeObject();
}); });
it('has a combine method', () => { it('has a combineDoclets method', () => {
expect(doclet.combine).toBeFunction(); expect(doclet.combineDoclets).toBeFunction();
}); });
it('has a Doclet class', () => { it('has a Doclet class', () => {
@ -242,7 +245,7 @@ describe('@jsdoc/doclet/lib/doclet', () => {
}); });
}); });
describe('combine', () => { describe('combineDoclets', () => {
it('overrides most properties of the secondary doclet', () => { it('overrides most properties of the secondary doclet', () => {
const primaryDoclet = new Doclet( const primaryDoclet = new Doclet(
'/** New and improved!\n@version 2.0.0 */', '/** New and improved!\n@version 2.0.0 */',
@ -250,7 +253,7 @@ describe('@jsdoc/doclet/lib/doclet', () => {
jsdoc.deps jsdoc.deps
); );
const secondaryDoclet = new Doclet('/** Hello!\n@version 1.0.0 */', null, jsdoc.deps); const secondaryDoclet = new Doclet('/** Hello!\n@version 1.0.0 */', null, jsdoc.deps);
const newDoclet = doclet.combine(primaryDoclet, secondaryDoclet); const newDoclet = doclet.combineDoclets(primaryDoclet, secondaryDoclet);
Object.getOwnPropertyNames(newDoclet).forEach((property) => { Object.getOwnPropertyNames(newDoclet).forEach((property) => {
expect(newDoclet[property]).toEqual(primaryDoclet[property]); expect(newDoclet[property]).toEqual(primaryDoclet[property]);
@ -260,7 +263,7 @@ describe('@jsdoc/doclet/lib/doclet', () => {
it('adds properties from the secondary doclet that are missing', () => { it('adds properties from the secondary doclet that are missing', () => {
const primaryDoclet = new Doclet('/** Hello!\n@version 2.0.0 */', null, jsdoc.deps); const primaryDoclet = new Doclet('/** Hello!\n@version 2.0.0 */', null, jsdoc.deps);
const secondaryDoclet = new Doclet('/** Hello! */', null, jsdoc.deps); const secondaryDoclet = new Doclet('/** Hello! */', null, jsdoc.deps);
const newDoclet = doclet.combine(primaryDoclet, secondaryDoclet); const newDoclet = doclet.combineDoclets(primaryDoclet, secondaryDoclet);
expect(newDoclet.version).toBe('2.0.0'); expect(newDoclet.version).toBe('2.0.0');
}); });
@ -277,7 +280,7 @@ describe('@jsdoc/doclet/lib/doclet', () => {
' */', ' */',
].join('\n'); ].join('\n');
const secondaryDoclet = new Doclet(secondaryComment, null, jsdoc.deps); const secondaryDoclet = new Doclet(secondaryComment, null, jsdoc.deps);
const newDoclet = doclet.combine(primaryDoclet, secondaryDoclet); const newDoclet = doclet.combineDoclets(primaryDoclet, secondaryDoclet);
properties.forEach((property) => { properties.forEach((property) => {
expect(newDoclet[property]).toEqual(secondaryDoclet[property]); expect(newDoclet[property]).toEqual(secondaryDoclet[property]);
@ -299,7 +302,7 @@ describe('@jsdoc/doclet/lib/doclet', () => {
' */', ' */',
].join('\n'); ].join('\n');
const secondaryDoclet = new Doclet(secondaryComment, null, jsdoc.deps); const secondaryDoclet = new Doclet(secondaryComment, null, jsdoc.deps);
const newDoclet = doclet.combine(primaryDoclet, secondaryDoclet); const newDoclet = doclet.combineDoclets(primaryDoclet, secondaryDoclet);
properties.forEach((property) => { properties.forEach((property) => {
expect(newDoclet[property]).toEqual(primaryDoclet[property]); expect(newDoclet[property]).toEqual(primaryDoclet[property]);

View File

@ -14,7 +14,8 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
const jsdocPackage = require('../../../lib/package'); import * as jsdocPackage from '../../../lib/package.js';
const { Package } = jsdocPackage; const { Package } = jsdocPackage;
describe('@jsdoc/doclet/lib/package', () => { describe('@jsdoc/doclet/lib/package', () => {

View File

@ -13,11 +13,11 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import * as schema from '../../../lib/schema.js';
describe('@jsdoc/doclet/lib/schema', () => { describe('@jsdoc/doclet/lib/schema', () => {
// We test the content of the schema in the `jsdoc` package, where we validate all of the parse // We test the content of the schema in the `jsdoc` package, where we validate all of the parse
// results that were created while running other tests. // results that were created while running other tests.
const schema = require('../../../lib/schema');
it('is an object', () => { it('is an object', () => {
expect(schema).toBeObject(); expect(schema).toBeObject();
}); });

View File

@ -20,10 +20,13 @@ module.exports = {
node: true, node: true,
}, },
parser: '@babel/eslint-parser',
parserOptions: { parserOptions: {
ecmaVersion: 'latest', ecmaVersion: 'latest',
requireConfigFile: false,
sourceType: 'module', sourceType: 'module',
}, },
plugins: ['simple-import-sort'],
rules: { rules: {
// Possible errors // Possible errors
@ -228,7 +231,7 @@ module.exports = {
'require-await': 'error', 'require-await': 'error',
'require-unicode-regexp': 'off', 'require-unicode-regexp': 'off',
'require-yield': 'error', 'require-yield': 'error',
'sort-imports': 'error', 'sort-imports': 'off', // We use https://github.com/lydell/eslint-plugin-simple-import-sort instead
'sort-keys': 'off', 'sort-keys': 'off',
'sort-vars': 'off', // TODO: enable? 'sort-vars': 'off', // TODO: enable?
'spaced-comment': ['error', 'always'], 'spaced-comment': ['error', 'always'],
@ -264,7 +267,7 @@ module.exports = {
'dot-location': ['error', 'property'], 'dot-location': ['error', 'property'],
'eol-last': 'error', 'eol-last': 'error',
'func-call-spacing': ['error', 'never'], 'func-call-spacing': ['error', 'never'],
'function-call-argument-newline:': 'off', 'function-call-argument-newline': 'off',
'function-paren-newline': 'off', 'function-paren-newline': 'off',
'generator-star-spacing': [ 'generator-star-spacing': [
'error', 'error',
@ -371,5 +374,9 @@ module.exports = {
'wrap-iife': ['error', 'inside'], 'wrap-iife': ['error', 'inside'],
'wrap-regex': 'off', 'wrap-regex': 'off',
'yield-star-spacing': ['error', 'before'], 'yield-star-spacing': ['error', 'before'],
// https://github.com/lydell/eslint-plugin-simple-import-sort
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
}, },
}; };

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,10 @@
"homepage": "https://github.com/jsdoc/jsdoc#readme", "homepage": "https://github.com/jsdoc/jsdoc#readme",
"license": "Apache-2.0", "license": "Apache-2.0",
"main": "index.js", "main": "index.js",
"dependencies": {
"@babel/eslint-parser": "^7.19.1",
"eslint-plugin-simple-import-sort": "^10.0.0"
},
"peerDependencies": { "peerDependencies": {
"eslint": ">= 8.35.0" "eslint": ">= 8.35.0"
}, },
@ -26,6 +30,7 @@
"bugs": { "bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues" "url": "https://github.com/jsdoc/jsdoc/issues"
}, },
"type": "commonjs",
"engines": { "engines": {
"node": ">=v18.12.0" "node": ">=v18.12.0"
}, },

View File

@ -13,13 +13,9 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const { createParser, Parser } = require('./lib/parser'); import * as handlers from './lib/handlers.js';
const handlers = require('./lib/handlers'); import { createParser, Parser } from './lib/parser.js';
const { Visitor } = require('./lib/visitor'); import { Visitor } from './lib/visitor.js';
module.exports = { export { createParser, handlers, Parser, Visitor };
createParser, export default { createParser, handlers, Parser, Visitor };
handlers,
Parser,
Visitor,
};

View File

@ -13,11 +13,13 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const { Doclet } = require('@jsdoc/doclet'); import { Syntax } from '@jsdoc/ast';
const escape = require('escape-string-regexp'); import { name } from '@jsdoc/core';
const { log } = require('@jsdoc/util'); import { Doclet } from '@jsdoc/doclet';
const { SCOPE } = require('@jsdoc/core').name; import { log } from '@jsdoc/util';
const { Syntax } = require('@jsdoc/ast'); import escape from 'escape-string-regexp';
const { SCOPE } = name;
let currentModule = null; let currentModule = null;
@ -330,7 +332,7 @@ function newSymbolDoclet(parser, docletSrc, e) {
* Attach these event handlers to a particular instance of a parser. * Attach these event handlers to a particular instance of a parser.
* @param parser * @param parser
*/ */
exports.attachTo = (parser) => { export function attachTo(parser) {
// Handle JSDoc "virtual comments" that include one of the following: // Handle JSDoc "virtual comments" that include one of the following:
// + A `@name` tag // + A `@name` tag
// + Another tag that accepts a name, such as `@function` // + Another tag that accepts a name, such as `@function`
@ -371,4 +373,4 @@ exports.attachTo = (parser) => {
parser.on('fileComplete', () => { parser.on('fileComplete', () => {
currentModule = null; currentModule = null;
}); });
}; }

View File

@ -13,13 +13,17 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const _ = require('lodash'); import EventEmitter from 'node:events';
const { AstBuilder, astNode, Syntax, Walker } = require('@jsdoc/ast'); import fs from 'node:fs';
const { EventEmitter } = require('events');
const fs = require('fs'); import { AstBuilder, astNode, Syntax, Walker } from '@jsdoc/ast';
const { log } = require('@jsdoc/util'); import { name } from '@jsdoc/core';
const { getBasename, LONGNAMES, SCOPE, toParts } = require('@jsdoc/core').name; import { log } from '@jsdoc/util';
const { Visitor } = require('./visitor'); import _ from 'lodash';
import { Visitor } from './visitor.js';
const { getBasename, LONGNAMES, SCOPE, toParts } = name;
// Prefix for JavaScript strings that were provided in lieu of a filename. // Prefix for JavaScript strings that were provided in lieu of a filename.
const SCHEMA = 'javascript:'; // eslint-disable-line no-script-url const SCHEMA = 'javascript:'; // eslint-disable-line no-script-url
@ -77,7 +81,7 @@ function definedInScope(doclet, basename) {
* @alias module:jsdoc/src/parser.Parser * @alias module:jsdoc/src/parser.Parser
* @extends module:events.EventEmitter * @extends module:events.EventEmitter
*/ */
class Parser extends EventEmitter { export class Parser extends EventEmitter {
// TODO: docs // TODO: docs
constructor(dependencies) { constructor(dependencies) {
super(); super();
@ -636,12 +640,11 @@ class Parser extends EventEmitter {
}); });
} }
} }
exports.Parser = Parser;
// TODO: docs // TODO: docs
exports.createParser = (deps) => { export function createParser(deps) {
return new Parser(deps); return new Parser(deps);
}; }
// TODO: document other events // TODO: document other events
/** /**

View File

@ -13,9 +13,11 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const { astNode, Syntax } = require('@jsdoc/ast'); import { astNode, Syntax } from '@jsdoc/ast';
const { combineDoclets } = require('@jsdoc/doclet'); import { name } from '@jsdoc/core';
const { getBasename, LONGNAMES } = require('@jsdoc/core').name; import { combineDoclets } from '@jsdoc/doclet';
const { getBasename, LONGNAMES } = name;
/** /**
* Get the raw comment string for a block comment node. * Get the raw comment string for a block comment node.
@ -725,7 +727,7 @@ function makeSymbolFoundEvent(node, parser, filename) {
} }
// TODO: docs // TODO: docs
class Visitor { export class Visitor {
// TODO: docs // TODO: docs
constructor() { constructor() {
this._parser = null; this._parser = null;
@ -850,4 +852,3 @@ class Visitor {
return true; return true;
} }
} }
exports.Visitor = Visitor;

View File

@ -28,5 +28,14 @@
}, },
"bugs": { "bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues" "url": "https://github.com/jsdoc/jsdoc/issues"
},
"type": "module",
"exports": {
".": {
"import": "./index.js"
},
"./lib/*": {
"import": "./lib/*"
}
} }
} }

View File

@ -13,7 +13,10 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const parse = require('../../index'); import parse from '../../index.js';
import * as handlers from '../../lib/handlers.js';
import { createParser, Parser } from '../../lib/parser.js';
import { Visitor } from '../../lib/visitor.js';
describe('@jsdoc/parse', () => { describe('@jsdoc/parse', () => {
it('is an object', () => { it('is an object', () => {
@ -22,33 +25,25 @@ describe('@jsdoc/parse', () => {
describe('createParser', () => { describe('createParser', () => {
it('is lib/parser.createParser', () => { it('is lib/parser.createParser', () => {
const { createParser } = require('../../lib/parser'); expect(parse.createParser).toEqual(createParser);
expect(parse.createParser).toBe(createParser);
}); });
}); });
describe('handlers', () => { describe('handlers', () => {
it('is lib/handlers', () => { it('is lib/handlers', () => {
const handlers = require('../../lib/handlers'); expect(parse.handlers).toEqual(handlers);
expect(parse.handlers).toBe(handlers);
}); });
}); });
describe('Parser', () => { describe('Parser', () => {
it('is lib/parser.Parser', () => { it('is lib/parser.Parser', () => {
const { Parser } = require('../../lib/parser'); expect(parse.Parser).toEqual(Parser);
expect(parse.Parser).toBe(Parser);
}); });
}); });
describe('Visitor', () => { describe('Visitor', () => {
it('is lib/visitor.Visitor', () => { it('is lib/visitor.Visitor', () => {
const { Visitor } = require('../../lib/visitor'); expect(parse.Visitor).toEqual(Visitor);
expect(parse.Visitor).toBe(Visitor);
}); });
}); });
}); });

View File

@ -14,9 +14,9 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
describe('@jsdoc/parse/lib/handlers', () => { import * as handlers from '../../../lib/handlers.js';
const handlers = require('../../../lib/handlers');
describe('@jsdoc/parse/lib/handlers', () => {
const testParser = jsdoc.createParser(); const testParser = jsdoc.createParser();
handlers.attachTo(testParser); handlers.attachTo(testParser);
@ -63,7 +63,5 @@ describe('@jsdoc/parse/lib/handlers', () => {
}); });
}); });
xdescribe('`symbolFound` handler', () => { // TODO: tests for `symbolFound` handler
// TODO
});
}); });

View File

@ -15,14 +15,18 @@
*/ */
/* eslint-disable no-script-url */ /* eslint-disable no-script-url */
/* global jsdoc */ /* global jsdoc */
describe('@jsdoc/parse/lib/parser', () => { import fs from 'node:fs';
const _ = require('lodash'); import path from 'node:path';
const { attachTo } = require('../../../lib/handlers');
const fs = require('fs');
const jsdocParser = require('../../../lib/parser');
const path = require('path');
const dirname = path.resolve(path.join(__dirname, '..', '..', '..')); import { Syntax, Walker } from '@jsdoc/ast';
import _ from 'lodash';
import { attachTo } from '../../../lib/handlers.js';
import * as jsdocParser from '../../../lib/parser.js';
import { Visitor } from '../../../lib/visitor.js';
describe('@jsdoc/parse/lib/parser', () => {
const dirname = path.resolve(path.join(jsdoc.dirname(import.meta.url), '..', '..', '..'));
it('is an object', () => { it('is an object', () => {
expect(jsdocParser).toBeObject(); expect(jsdocParser).toBeObject();
@ -75,16 +79,12 @@ describe('@jsdoc/parse/lib/parser', () => {
describe('visitor', () => { describe('visitor', () => {
it('contains an appropriate visitor by default', () => { it('contains an appropriate visitor by default', () => {
const { Visitor } = require('../../../lib/visitor');
expect(parser.visitor instanceof Visitor).toBeTrue(); expect(parser.visitor instanceof Visitor).toBeTrue();
}); });
}); });
describe('walker', () => { describe('walker', () => {
it('contains an appropriate walker by default', () => { it('contains an appropriate walker by default', () => {
const { Walker } = require('@jsdoc/ast');
expect(parser.walker instanceof Walker).toBeTrue(); expect(parser.walker instanceof Walker).toBeTrue();
}); });
}); });
@ -158,8 +158,6 @@ describe('@jsdoc/parse/lib/parser', () => {
}); });
it('calls AST node visitors', () => { it('calls AST node visitors', () => {
const { Syntax } = require('@jsdoc/ast');
let args; let args;
const sourceCode = ['javascript:/** foo */var foo;']; const sourceCode = ['javascript:/** foo */var foo;'];
const visitor = { const visitor = {

View File

@ -14,11 +14,11 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
import { Parser } from '../../../lib/parser.js';
import { Visitor } from '../../../lib/visitor.js';
describe('@jsdoc/parse/lib/visitor', () => { describe('@jsdoc/parse/lib/visitor', () => {
// TODO: more tests // TODO: more tests
const { Parser } = require('../../../lib/parser');
const { Visitor } = require('../../../lib/visitor');
const parser = new Parser(jsdoc.deps); const parser = new Parser(jsdoc.deps);
const visitor = new Visitor(); const visitor = new Visitor();

View File

@ -13,18 +13,20 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
/* eslint-disable spaced-comment */
/** /**
* Demonstrate how to modify the source code before the parser sees it. * Demonstrate how to modify the source code before the parser sees it.
* *
* @module @jsdoc/plugins/comment-convert * @module @jsdoc/plugins/comment-convert
*/ */
exports.handlers = { /* eslint-disable spaced-comment */
/** @alias module:@jsdoc/plugins/comment-convert.handlers */
export const handlers = {
/// ///
/// Convert ///-style comments into jsdoc comments. /// Convert ///-style comments into jsdoc comments.
/// @param e /// @param e
/// @param e.filename /// @param e.filename
/// @param e.source /// @param e.source
/// @memberof module:@jsdoc/plugins/comment-convert.handlers
/// ///
beforeParse(e) { beforeParse(e) {
e.source = e.source.replace(/(\n[ \t]*\/\/\/[^\n]*)+/g, ($) => { e.source = e.source.replace(/(\n[ \t]*\/\/\/[^\n]*)+/g, ($) => {

View File

@ -17,7 +17,7 @@
* Remove everything in a file except JSDoc-style comments. By enabling this plugin, you can * Remove everything in a file except JSDoc-style comments. By enabling this plugin, you can
* document source files that are not valid JavaScript, including source files for other languages. * document source files that are not valid JavaScript, including source files for other languages.
*/ */
exports.handlers = { export const handlers = {
beforeParse(e) { beforeParse(e) {
// a JSDoc comment looks like: /**[one or more chars]*/ // a JSDoc comment looks like: /**[one or more chars]*/
const comments = e.source.match(/\/\*\*[\s\S]+?\*\//g); const comments = e.source.match(/\/\*\*[\s\S]+?\*\//g);

View File

@ -16,7 +16,7 @@
/** /**
* Escape HTML tags in descriptions. * Escape HTML tags in descriptions.
*/ */
exports.handlers = { export const handlers = {
/** /**
* Translate HTML tags in descriptions into safe entities. Replaces <, & and newlines * Translate HTML tags in descriptions into safe entities. Replaces <, & and newlines
*/ */

View File

@ -16,7 +16,7 @@
/** /**
* Dump information about parser events to the console. * Dump information about parser events to the console.
*/ */
const _ = require('lodash'); import _ from 'lodash';
const EVENT_TYPES = [ const EVENT_TYPES = [
'parseBegin', 'parseBegin',
@ -104,10 +104,10 @@ function cleanse(e, config) {
return result; return result;
} }
exports.handlers = {}; const handlers = {};
EVENT_TYPES.forEach((eventType) => { EVENT_TYPES.forEach((eventType) => {
exports.handlers[eventType] = (e, deps) => { handlers[eventType] = (e, deps) => {
const config = deps.get('config').eventDumper; const config = deps.get('config').eventDumper;
if (shouldLog(eventType, config)) { if (shouldLog(eventType, config)) {
@ -122,3 +122,5 @@ EVENT_TYPES.forEach((eventType) => {
} }
}; };
}); });
export { handlers };

View File

@ -176,7 +176,7 @@ function ensureUniqueLongname(newDoclet) {
return doclets.newDoclet; return doclets.newDoclet;
} }
exports.handlers = { export const handlers = {
parseBegin() { parseBegin() {
functionDoclets = {}; functionDoclets = {};
}, },

View File

@ -1,877 +0,0 @@
{
"name": "@jsdoc/plugins",
"version": "0.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@jsdoc/plugins",
"version": "0.0.1",
"license": "Apache-2.0",
"dependencies": {
"@jsdoc/util": "^0.2.8"
},
"devDependencies": {
"@jsdoc/core": "^0.4.6",
"@jsdoc/parse": "^0.2.0"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@babel/code-frame": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
"integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
"dev": true,
"dependencies": {
"@babel/highlight": "^7.18.6"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-validator-identifier": {
"version": "7.19.1",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
"integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/highlight": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
"integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
"dev": true,
"dependencies": {
"@babel/helper-validator-identifier": "^7.18.6",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/parser": {
"version": "7.20.15",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.15.tgz",
"integrity": "sha512-DI4a1oZuf8wC+oAJA9RW6ga3Zbe8RZFt7kD9i4qAspz3I/yHet1VvC3DiSy/fsUvv5pvJuNPh0LPOdCcqinDPg==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
},
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/@jsdoc/ast": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@jsdoc/ast/-/ast-0.1.1.tgz",
"integrity": "sha512-jl9084i06mSqogutDFeV8CauUUB+7iWvTXNs/4cB2KCWMb+72hmXIcbu36GJzLQTe5UJk9CMcMbO6SPf/tFmSQ==",
"dev": true,
"dependencies": {
"@babel/parser": "^7.20.5",
"@jsdoc/core": "^0.4.6",
"@jsdoc/util": "^0.2.8",
"lodash": "^4.17.21"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@jsdoc/core": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/@jsdoc/core/-/core-0.4.6.tgz",
"integrity": "sha512-i9clwgss2upkeejiYosLo2pUXJ47K2W82ppBjEnEW+hzN1Ob/QRSwxR6IRs/bxaenK2fT7W5Esq/LEpGKrNbpw==",
"dev": true,
"dependencies": {
"bottlejs": "^2.0.1",
"cosmiconfig": "^7.1.0",
"escape-string-regexp": "^4.0.0",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0",
"strip-json-comments": "^3.1.1"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@jsdoc/doclet": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/@jsdoc/doclet/-/doclet-0.1.2.tgz",
"integrity": "sha512-uGgDPv5MRn/Q+lkifYB/g5mRsjSgr39wwmKrHcXbbqSqTNRkoseA+pcv4nqQ6tnt9MRSLqacA9XDK7Dl2hxPyQ==",
"dev": true,
"dependencies": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",
"@jsdoc/tag": "^0.1.6",
"@jsdoc/util": "^0.2.8",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0"
}
},
"node_modules/@jsdoc/parse": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@jsdoc/parse/-/parse-0.2.0.tgz",
"integrity": "sha512-6+epdgVNy0JZl8gRhaGvFq9QVt8rC7yZJsczJgOTUNvHIpgVDsbmV0f1gfcfaFx24slblDRLZyQIxQFIAtrvPg==",
"dev": true,
"dependencies": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",
"@jsdoc/doclet": "^0.1.2",
"@jsdoc/util": "^0.2.8",
"escape-string-regexp": "^4.0.0"
}
},
"node_modules/@jsdoc/tag": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/@jsdoc/tag/-/tag-0.1.6.tgz",
"integrity": "sha512-eYX1HOTzmhVvkez6MtDKy6A+v+EZkwA2vNvexzW3pIp4nXmQBav+0X2BR5VBAZMRqNIP5uKAsnNM0zxPZeW3eA==",
"dev": true,
"dependencies": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",
"@jsdoc/util": "^0.2.8",
"catharsis": "^0.9.0",
"common-path-prefix": "^3.0.0",
"lodash": "^4.17.21"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@jsdoc/util": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/@jsdoc/util/-/util-0.2.8.tgz",
"integrity": "sha512-Uqerf+cakeAbFC5JRA087v9ul+7Tu4xzTaSO9vW6i7b0+b8z6qT1rVmX/xrAfco9uyiQDSm68xm9ovR3C0HviA==",
"dependencies": {
"klaw-sync": "^6.0.0",
"lodash": "^4.17.21",
"ow": "^0.28.2"
},
"engines": {
"node": ">=v18.12.0"
}
},
"node_modules/@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sindresorhus/is?sponsor=1"
}
},
"node_modules/@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
"dev": true
},
"node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"dependencies": {
"color-convert": "^1.9.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/bottlejs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz",
"integrity": "sha512-50T0bzqeAqZ+//kgjdDxNu7UP8Je04isNPyHPwwOOPoeZmtVESkuF9nwkWEqSEd9Sw1yJ1oaoHBAMxe/wG4Zzg==",
"dev": true
},
"node_modules/callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
"engines": {
"node": ">=6"
}
},
"node_modules/catharsis": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz",
"integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==",
"dev": true,
"dependencies": {
"lodash": "^4.17.15"
},
"engines": {
"node": ">= 10"
}
},
"node_modules/chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"dependencies": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/chalk/node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"dev": true,
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
"node_modules/common-path-prefix": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz",
"integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==",
"dev": true
},
"node_modules/cosmiconfig": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"dev": true,
"dependencies": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
"dependencies": {
"is-obj": "^2.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"dev": true,
"dependencies": {
"is-arrayish": "^0.2.1"
}
},
"node_modules/escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true,
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/graceful-fs": {
"version": "4.2.10",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="
},
"node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
"integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
"dev": true,
"dependencies": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
},
"engines": {
"node": ">=6"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
"dev": true
},
"node_modules/is-obj": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
"engines": {
"node": ">=8"
}
},
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
"dev": true
},
"node_modules/json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
"dev": true
},
"node_modules/klaw-sync": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz",
"integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==",
"dependencies": {
"graceful-fs": "^4.1.11"
}
},
"node_modules/lines-and-columns": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
"dev": true
},
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"node_modules/lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ=="
},
"node_modules/ow": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz",
"integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==",
"dependencies": {
"@sindresorhus/is": "^4.2.0",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"vali-date": "^1.0.0"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"dev": true,
"dependencies": {
"callsites": "^3.0.0"
},
"engines": {
"node": ">=6"
}
},
"node_modules/parse-json": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
"integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
"json-parse-even-better-errors": "^2.3.0",
"lines-and-columns": "^1.1.6"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/strip-bom": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
"integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"dev": true,
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/vali-date": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
"integrity": "sha512-sgECfZthyaCKW10N0fm27cg8HYTFK5qMWgypqkXMQ4Wbl/zZKx7xZICgcoxIIE+WFAP/MBL2EFwC/YvLxw3Zeg==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"dev": true,
"engines": {
"node": ">= 6"
}
}
},
"dependencies": {
"@babel/code-frame": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz",
"integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==",
"dev": true,
"requires": {
"@babel/highlight": "^7.18.6"
}
},
"@babel/helper-validator-identifier": {
"version": "7.19.1",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
"integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
"dev": true
},
"@babel/highlight": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
"integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
"dev": true,
"requires": {
"@babel/helper-validator-identifier": "^7.18.6",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
}
},
"@babel/parser": {
"version": "7.20.15",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.20.15.tgz",
"integrity": "sha512-DI4a1oZuf8wC+oAJA9RW6ga3Zbe8RZFt7kD9i4qAspz3I/yHet1VvC3DiSy/fsUvv5pvJuNPh0LPOdCcqinDPg==",
"dev": true
},
"@jsdoc/ast": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@jsdoc/ast/-/ast-0.1.1.tgz",
"integrity": "sha512-jl9084i06mSqogutDFeV8CauUUB+7iWvTXNs/4cB2KCWMb+72hmXIcbu36GJzLQTe5UJk9CMcMbO6SPf/tFmSQ==",
"dev": true,
"requires": {
"@babel/parser": "^7.20.5",
"@jsdoc/core": "^0.4.6",
"@jsdoc/util": "^0.2.8",
"lodash": "^4.17.21"
}
},
"@jsdoc/core": {
"version": "0.4.6",
"resolved": "https://registry.npmjs.org/@jsdoc/core/-/core-0.4.6.tgz",
"integrity": "sha512-i9clwgss2upkeejiYosLo2pUXJ47K2W82ppBjEnEW+hzN1Ob/QRSwxR6IRs/bxaenK2fT7W5Esq/LEpGKrNbpw==",
"dev": true,
"requires": {
"bottlejs": "^2.0.1",
"cosmiconfig": "^7.1.0",
"escape-string-regexp": "^4.0.0",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0",
"strip-json-comments": "^3.1.1"
}
},
"@jsdoc/doclet": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/@jsdoc/doclet/-/doclet-0.1.2.tgz",
"integrity": "sha512-uGgDPv5MRn/Q+lkifYB/g5mRsjSgr39wwmKrHcXbbqSqTNRkoseA+pcv4nqQ6tnt9MRSLqacA9XDK7Dl2hxPyQ==",
"dev": true,
"requires": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",
"@jsdoc/tag": "^0.1.6",
"@jsdoc/util": "^0.2.8",
"lodash": "^4.17.21",
"strip-bom": "^4.0.0"
}
},
"@jsdoc/parse": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@jsdoc/parse/-/parse-0.2.0.tgz",
"integrity": "sha512-6+epdgVNy0JZl8gRhaGvFq9QVt8rC7yZJsczJgOTUNvHIpgVDsbmV0f1gfcfaFx24slblDRLZyQIxQFIAtrvPg==",
"dev": true,
"requires": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",
"@jsdoc/doclet": "^0.1.2",
"@jsdoc/util": "^0.2.8",
"escape-string-regexp": "^4.0.0"
}
},
"@jsdoc/tag": {
"version": "0.1.6",
"resolved": "https://registry.npmjs.org/@jsdoc/tag/-/tag-0.1.6.tgz",
"integrity": "sha512-eYX1HOTzmhVvkez6MtDKy6A+v+EZkwA2vNvexzW3pIp4nXmQBav+0X2BR5VBAZMRqNIP5uKAsnNM0zxPZeW3eA==",
"dev": true,
"requires": {
"@jsdoc/ast": "^0.1.1",
"@jsdoc/core": "^0.4.6",
"@jsdoc/util": "^0.2.8",
"catharsis": "^0.9.0",
"common-path-prefix": "^3.0.0",
"lodash": "^4.17.21"
}
},
"@jsdoc/util": {
"version": "0.2.8",
"resolved": "https://registry.npmjs.org/@jsdoc/util/-/util-0.2.8.tgz",
"integrity": "sha512-Uqerf+cakeAbFC5JRA087v9ul+7Tu4xzTaSO9vW6i7b0+b8z6qT1rVmX/xrAfco9uyiQDSm68xm9ovR3C0HviA==",
"requires": {
"klaw-sync": "^6.0.0",
"lodash": "^4.17.21",
"ow": "^0.28.2"
}
},
"@sindresorhus/is": {
"version": "4.6.0",
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz",
"integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw=="
},
"@types/parse-json": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",
"integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==",
"dev": true
},
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"bottlejs": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/bottlejs/-/bottlejs-2.0.1.tgz",
"integrity": "sha512-50T0bzqeAqZ+//kgjdDxNu7UP8Je04isNPyHPwwOOPoeZmtVESkuF9nwkWEqSEd9Sw1yJ1oaoHBAMxe/wG4Zzg==",
"dev": true
},
"callsites": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
},
"catharsis": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz",
"integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==",
"dev": true,
"requires": {
"lodash": "^4.17.15"
}
},
"chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"dependencies": {
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"dev": true
}
}
},
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
"common-path-prefix": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz",
"integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==",
"dev": true
},
"cosmiconfig": {
"version": "7.1.0",
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
"integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==",
"dev": true,
"requires": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
}
},
"dot-prop": {
"version": "6.0.1",
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
"requires": {
"is-obj": "^2.0.0"
}
},
"error-ex": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
"dev": true,
"requires": {
"is-arrayish": "^0.2.1"
}
},
"escape-string-regexp": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
"integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
"dev": true
},
"graceful-fs": {
"version": "4.2.10",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz",
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA=="
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"dev": true
},
"import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
"integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
"dev": true,
"requires": {
"parent-module": "^1.0.0",
"resolve-from": "^4.0.0"
}
},
"is-arrayish": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
"integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==",
"dev": true
},
"is-obj": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="
},
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
"dev": true
},
"json-parse-even-better-errors": {
"version": "2.3.1",
"resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz",
"integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==",
"dev": true
},
"klaw-sync": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/klaw-sync/-/klaw-sync-6.0.0.tgz",
"integrity": "sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==",
"requires": {
"graceful-fs": "^4.1.11"
}
},
"lines-and-columns": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz",
"integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==",
"dev": true
},
"lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"lodash.isequal": {
"version": "4.5.0",
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ=="
},
"ow": {
"version": "0.28.2",
"resolved": "https://registry.npmjs.org/ow/-/ow-0.28.2.tgz",
"integrity": "sha512-dD4UpyBh/9m4X2NVjA+73/ZPBRF+uF4zIMFvvQsabMiEK8x41L3rQ8EENOi35kyyoaJwNxEeJcP6Fj1H4U409Q==",
"requires": {
"@sindresorhus/is": "^4.2.0",
"callsites": "^3.1.0",
"dot-prop": "^6.0.1",
"lodash.isequal": "^4.5.0",
"vali-date": "^1.0.0"
}
},
"parent-module": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
"integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
"dev": true,
"requires": {
"callsites": "^3.0.0"
}
},
"parse-json": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
"integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==",
"dev": true,
"requires": {
"@babel/code-frame": "^7.0.0",
"error-ex": "^1.3.1",
"json-parse-even-better-errors": "^2.3.0",
"lines-and-columns": "^1.1.6"
}
},
"path-type": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",
"integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",
"dev": true
},
"resolve-from": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
"integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
"dev": true
},
"strip-bom": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz",
"integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==",
"dev": true
},
"strip-json-comments": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz",
"integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==",
"dev": true
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
},
"vali-date": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
"integrity": "sha512-sgECfZthyaCKW10N0fm27cg8HYTFK5qMWgypqkXMQ4Wbl/zZKx7xZICgcoxIIE+WFAP/MBL2EFwC/YvLxw3Zeg=="
},
"yaml": {
"version": "1.10.2",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz",
"integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==",
"dev": true
}
}
}

View File

@ -21,6 +21,12 @@
"bugs": { "bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues" "url": "https://github.com/jsdoc/jsdoc/issues"
}, },
"type": "module",
"exports": {
"./*": {
"import": "./*"
}
},
"engines": { "engines": {
"node": ">=v18.12.0" "node": ">=v18.12.0"
}, },

View File

@ -16,10 +16,10 @@
/** /**
* Adds support for reusable partial jsdoc files. * Adds support for reusable partial jsdoc files.
*/ */
const fs = require('fs'); import fs from 'node:fs';
const path = require('path'); import path from 'node:path';
exports.handlers = { export const handlers = {
/** /**
* Include a partial jsdoc * Include a partial jsdoc
* *

View File

@ -15,14 +15,17 @@
*/ */
/** /**
* Strips the rails template tags from a js.erb file * Strips the rails template tags from a js.erb file
* @module @jsdoc/plugins/railsTemplate
*/ */
exports.handlers = { /** @alias module:@jsdoc/plugins/railsTemplate.handlers */
export const handlers = {
/** /**
* Remove rails tags from the source input (e.g. <% foo bar %>) * Remove rails tags from the source input (e.g. <% foo bar %>)
* *
* @param e * @param e
* @param e.filename * @param e.filename
* @param e.source * @param e.source
* @alias module:@jsdoc/plugins/railsTemplate.handlers.beforeParse
*/ */
beforeParse(e) { beforeParse(e) {
if (e.filename.match(/\.erb$/)) { if (e.filename.match(/\.erb$/)) {

View File

@ -13,9 +13,9 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const { log } = require('@jsdoc/util'); import { log } from '@jsdoc/util';
exports.handlers = { export const handlers = {
/** /**
* Support @source tag. Expected value like: * Support @source tag. Expected value like:
* *

View File

@ -16,7 +16,7 @@
/** /**
* This plugin creates a summary tag, if missing, from the first sentence in the description. * This plugin creates a summary tag, if missing, from the first sentence in the description.
*/ */
exports.handlers = { export const handlers = {
/** /**
* Autogenerate summaries, if missing, from the description, if present. * Autogenerate summaries, if missing, from the description, if present.
*/ */

View File

@ -14,17 +14,20 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
import path from 'node:path';
import { plugins } from '@jsdoc/core';
describe('comment-convert plugin', () => { describe('comment-convert plugin', () => {
const path = require('path'); const __dirname = jsdoc.dirname(import.meta.url);
const { plugins } = require('@jsdoc/core');
let docSet; let docSet;
const parser = jsdoc.createParser(); const parser = jsdoc.createParser();
const pluginPath = path.join(__dirname, '../../comment-convert.js'); const pluginPath = path.join(__dirname, '../../comment-convert.js');
plugins.installPlugins([pluginPath], parser, jsdoc.deps); beforeAll(async () => {
docSet = jsdoc.getDocSetFromFile(pluginPath, parser); await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(pluginPath, parser);
});
it('converts ///-style comments into jsdoc comments', () => { it('converts ///-style comments into jsdoc comments', () => {
const doclet = docSet.getByLongname( const doclet = docSet.getByLongname(

View File

@ -14,16 +14,20 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
describe('escape-html plugin', () => { import path from 'node:path';
const path = require('path');
const { plugins } = require('@jsdoc/core');
import { plugins } from '@jsdoc/core';
describe('escape-html plugin', () => {
const __dirname = jsdoc.dirname(import.meta.url);
let docSet; let docSet;
const parser = jsdoc.createParser(); const parser = jsdoc.createParser();
const pluginPath = path.join(__dirname, '../../escape-html.js'); const pluginPath = path.join(__dirname, '../../escape-html.js');
plugins.installPlugins([pluginPath], parser, jsdoc.deps); beforeAll(async () => {
docSet = jsdoc.getDocSetFromFile(pluginPath, parser); await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(pluginPath, parser);
});
it('escapes `&`, `<`, and newlines in doclet descriptions', () => { it('escapes `&`, `<`, and newlines in doclet descriptions', () => {
const doclet = docSet.getByLongname('handlers.newDoclet')[0]; const doclet = docSet.getByLongname('handlers.newDoclet')[0];

View File

@ -14,20 +14,25 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
describe('overload-helper plugin', () => { import path from 'node:path';
const path = require('path');
const { plugins } = require('@jsdoc/core');
import { plugins } from '@jsdoc/core';
describe('overload-helper plugin', () => {
const __dirname = jsdoc.dirname(import.meta.url);
let docSet; let docSet;
const parser = jsdoc.createParser(); const parser = jsdoc.createParser();
let plugin;
const pluginPath = path.join(__dirname, '../../overload-helper.js'); const pluginPath = path.join(__dirname, '../../overload-helper.js');
const plugin = require(pluginPath);
plugins.installPlugins([pluginPath], parser, jsdoc.deps); beforeAll(async () => {
docSet = jsdoc.getDocSetFromFile( plugin = await import(pluginPath);
path.resolve(__dirname, '../fixtures/overload-helper.js'), await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
parser docSet = jsdoc.getDocSetFromFile(
); path.resolve(__dirname, '../fixtures/overload-helper.js'),
parser
);
});
it('has a `handlers` object', () => { it('has a `handlers` object', () => {
expect(plugin.handlers).toBeDefined(); expect(plugin.handlers).toBeDefined();

View File

@ -14,16 +14,20 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
describe('rails-template plugin', () => { import path from 'node:path';
const { handlers } = require('@jsdoc/parse');
const path = require('path');
const { plugins } = require('@jsdoc/core');
import { plugins } from '@jsdoc/core';
import { handlers } from '@jsdoc/parse';
describe('rails-template plugin', () => {
const __dirname = jsdoc.dirname(import.meta.url);
const parser = jsdoc.createParser(); const parser = jsdoc.createParser();
const pluginPath = path.join(__dirname, '../../rails-template.js'); const pluginPath = path.join(__dirname, '../../rails-template.js');
plugins.installPlugins([pluginPath], parser, jsdoc.deps); beforeAll(async () => {
handlers.attachTo(parser); await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
handlers.attachTo(parser);
});
it('removes <% %> rails template tags from the source of *.erb files', () => { it('removes <% %> rails template tags from the source of *.erb files', () => {
const docSet = parser.parse([path.resolve(__dirname, '../fixtures/rails-template.js.erb')]); const docSet = parser.parse([path.resolve(__dirname, '../fixtures/rails-template.js.erb')]);

View File

@ -14,16 +14,20 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
describe('source-tag plugin', () => { import path from 'node:path';
const path = require('path');
const { plugins } = require('@jsdoc/core');
import { plugins } from '@jsdoc/core';
describe('source-tag plugin', () => {
const __dirname = jsdoc.dirname(import.meta.url);
let docSet; let docSet;
const parser = jsdoc.createParser(); const parser = jsdoc.createParser();
const pluginPath = path.join(__dirname, '../../source-tag.js'); const pluginPath = path.join(__dirname, '../../source-tag.js');
plugins.installPlugins([pluginPath], parser, jsdoc.deps); beforeAll(async () => {
docSet = jsdoc.getDocSetFromFile(pluginPath, parser); await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(pluginPath, parser);
});
it("should set the lineno and filename of the doclet's meta property", () => { it("should set the lineno and filename of the doclet's meta property", () => {
const doclet = docSet.getByLongname('handlers.newDoclet')[0]; const doclet = docSet.getByLongname('handlers.newDoclet')[0];

View File

@ -13,7 +13,7 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const summarize = require('../../summarize'); import * as summarize from '../../summarize.js';
describe('summarize', () => { describe('summarize', () => {
it('should export handlers', () => { it('should export handlers', () => {

View File

@ -14,16 +14,20 @@
limitations under the License. limitations under the License.
*/ */
/* global jsdoc */ /* global jsdoc */
describe('underscore plugin', () => { import path from 'node:path';
const path = require('path');
const { plugins } = require('@jsdoc/core');
import { plugins } from '@jsdoc/core';
describe('underscore plugin', () => {
const __dirname = jsdoc.dirname(import.meta.url);
let docSet; let docSet;
const parser = jsdoc.createParser(); const parser = jsdoc.createParser();
const pluginPath = path.resolve(__dirname, '../../underscore.js'); const pluginPath = path.resolve(__dirname, '../../underscore.js');
plugins.installPlugins([pluginPath], parser, jsdoc.deps); beforeAll(async () => {
docSet = jsdoc.getDocSetFromFile(path.resolve(__dirname, '../fixtures/underscore.js'), parser); await plugins.installPlugins([pluginPath], parser, jsdoc.deps);
docSet = jsdoc.getDocSetFromFile(path.resolve(__dirname, '../fixtures/underscore.js'), parser);
});
it('should not mark normal, public properties as private', () => { it('should not mark normal, public properties as private', () => {
// Base line tests // Base line tests

View File

@ -19,7 +19,7 @@
* automatically hides them. * automatically hides them.
*/ */
exports.handlers = { export const handlers = {
newDoclet({ doclet }) { newDoclet({ doclet }) {
// Ignore comment blocks for all symbols that begin with underscore // Ignore comment blocks for all symbols that begin with underscore
if (doclet.name.charAt(0) === '_' || doclet.name.substr(0, 6) === 'this._') { if (doclet.name.charAt(0) === '_' || doclet.name.substr(0, 6) === 'this._') {

View File

@ -27,5 +27,6 @@
}, },
"bugs": { "bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues" "url": "https://github.com/jsdoc/jsdoc/issues"
} },
"type": "commonjs"
} }

View File

@ -21,6 +21,7 @@
"bugs": { "bugs": {
"url": "https://github.com/jsdoc/jsdoc/issues" "url": "https://github.com/jsdoc/jsdoc/issues"
}, },
"type": "commonjs",
"dependencies": { "dependencies": {
"lodash": "^4.17.21" "lodash": "^4.17.21"
}, },

View File

@ -13,18 +13,12 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const definitions = require('./lib/definitions'); import definitions from './lib/definitions/index.js';
const { Dictionary } = require('./lib/dictionary'); import { Dictionary } from './lib/dictionary.js';
const inline = require('./lib/inline'); import * as inline from './lib/inline.js';
const { Tag } = require('./lib/tag'); import { Tag } from './lib/tag.js';
const type = require('./lib/type'); import * as type from './lib/type.js';
const { validate } = require('./lib/validator'); import { validate } from './lib/validator.js';
module.exports = { export { definitions, Dictionary, inline, Tag, type, validate };
definitions, export default { definitions, Dictionary, inline, Tag, type, validate };
Dictionary,
inline,
Tag,
type,
validate,
};

View File

@ -14,8 +14,9 @@
limitations under the License. limitations under the License.
*/ */
// Tag dictionary for Google Closure Compiler. // Tag dictionary for Google Closure Compiler.
const core = require('./core');
const util = require('./util'); import { tags as core } from './core.js';
import * as util from './util.js';
const NOOP_TAG = { const NOOP_TAG = {
onTagged: () => { onTagged: () => {
@ -23,175 +24,139 @@ const NOOP_TAG = {
}, },
}; };
exports.const = { export const tags = {
canHaveType: true, const: {
onTagged(doclet, tag) { canHaveType: true,
doclet.kind = 'constant'; onTagged(doclet, tag) {
util.setDocletTypeToValueType(doclet, tag); doclet.kind = 'constant';
util.setDocletTypeToValueType(doclet, tag);
},
// Closure Compiler only
synonyms: ['define'],
},
constructor: util.cloneTagDef(core.class),
deprecated: util.cloneTagDef(core.deprecated),
// Closure Compiler only
dict: NOOP_TAG,
enum: util.cloneTagDef(core.enum),
// Closure Compiler only
export: NOOP_TAG,
extends: util.cloneTagDef(core.augments),
// Closure Compiler only
externs: NOOP_TAG,
fileoverview: {
onTagged(doclet, tag) {
util.setNameToFile(doclet);
doclet.kind = 'file';
util.setDocletDescriptionToValue(doclet, tag);
doclet.preserveName = true;
},
},
final: util.cloneTagDef(core.readonly),
implements: util.cloneTagDef(core.implements),
// Closure Compiler only
implicitcast: NOOP_TAG,
inheritdoc: util.cloneTagDef(core.inheritdoc),
interface: util.cloneTagDef(core.interface, {
canHaveName: false,
mustNotHaveValue: true,
// Closure Compiler only
synonyms: ['record'],
}),
lends: util.cloneTagDef(core.lends),
license: util.cloneTagDef(core.license),
modifies: util.cloneTagDef(core.modifies),
// Closure Compiler only
noalias: NOOP_TAG,
// Closure Compiler only
nocollapse: NOOP_TAG,
// Closure Compiler only
nocompile: NOOP_TAG,
// Closure Compiler only
nosideeffects: {
onTagged(doclet) {
doclet.modifies = [];
},
}, },
// Closure Compiler only // Closure Compiler only
synonyms: ['define'], override: {
}; mustNotHaveValue: true,
onTagged(doclet) {
exports.constructor = util.cloneTagDef(core.class); doclet.override = true;
},
exports.deprecated = util.cloneTagDef(core.deprecated);
// Closure Compiler only
exports.dict = NOOP_TAG;
exports.enum = util.cloneTagDef(core.enum);
// Closure Compiler only
exports.export = NOOP_TAG;
exports.extends = util.cloneTagDef(core.augments);
// Closure Compiler only
exports.externs = NOOP_TAG;
exports.fileoverview = {
onTagged(doclet, tag) {
util.setNameToFile(doclet);
doclet.kind = 'file';
util.setDocletDescriptionToValue(doclet, tag);
doclet.preserveName = true;
}, },
}; package: {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'package';
exports.final = util.cloneTagDef(core.readonly); if (tag.value && tag.value.type) {
util.setDocletTypeToValueType(doclet, tag);
exports.implements = util.cloneTagDef(core.implements); }
},
// Closure Compiler only },
exports.implicitcast = NOOP_TAG; param: util.cloneTagDef(core.param),
exports.inheritdoc = util.cloneTagDef(core.inheritdoc);
exports.interface = util.cloneTagDef(core.interface, {
canHaveName: false,
mustNotHaveValue: true,
// Closure Compiler only // Closure Compiler only
synonyms: ['record'], polymer: NOOP_TAG,
}); // Closure Compiler only
polymerBehavior: NOOP_TAG,
// Closure Compiler only
preserve: util.cloneTagDef(core.license),
private: {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'private';
exports.lends = util.cloneTagDef(core.lends); if (tag.value && tag.value.type) {
util.setDocletTypeToValueType(doclet, tag);
exports.license = util.cloneTagDef(core.license); }
},
exports.modifies = util.cloneTagDef(core.modifies);
// Closure Compiler only
exports.noalias = NOOP_TAG;
// Closure Compiler only
exports.nocollapse = NOOP_TAG;
// Closure Compiler only
exports.nocompile = NOOP_TAG;
// Closure Compiler only
exports.nosideeffects = {
onTagged(doclet) {
doclet.modifies = [];
}, },
}; protected: {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'protected';
// Closure Compiler only if (tag.value && tag.value.type) {
exports.override = { util.setDocletTypeToValueType(doclet, tag);
mustNotHaveValue: true, }
onTagged(doclet) { },
doclet.override = true;
}, },
}; public: {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'public';
exports.package = { if (tag.value && tag.value.type) {
canHaveType: true, util.setDocletTypeToValueType(doclet, tag);
onTagged(doclet, tag) { }
doclet.access = 'package'; },
},
if (tag.value && tag.value.type) { return: util.cloneTagDef(core.returns),
// Closure Compiler only
struct: NOOP_TAG,
// Closure Compiler only
suppress: NOOP_TAG,
// Closure Compiler only
template: NOOP_TAG,
this: {
canHaveType: true,
onTagged(doclet, tag) {
doclet.this = util.combineTypes(tag);
},
},
throws: util.cloneTagDef(core.throws),
type: util.cloneTagDef(core.type, {
mustNotHaveDescription: false,
}),
typedef: {
canHaveType: true,
onTagged(doclet, tag) {
util.setDocletKindToTitle(doclet, tag);
util.setDocletTypeToValueType(doclet, tag); util.setDocletTypeToValueType(doclet, tag);
} },
}, },
// Closure Compiler only
unrestricted: NOOP_TAG,
}; };
exports.param = util.cloneTagDef(core.param);
// Closure Compiler only
exports.polymer = NOOP_TAG;
// Closure Compiler only
exports.polymerBehavior = NOOP_TAG;
// Closure Compiler only
exports.preserve = util.cloneTagDef(core.license);
exports.private = {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'private';
if (tag.value && tag.value.type) {
util.setDocletTypeToValueType(doclet, tag);
}
},
};
exports.protected = {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'protected';
if (tag.value && tag.value.type) {
util.setDocletTypeToValueType(doclet, tag);
}
},
};
exports.public = {
canHaveType: true,
onTagged(doclet, tag) {
doclet.access = 'public';
if (tag.value && tag.value.type) {
util.setDocletTypeToValueType(doclet, tag);
}
},
};
exports.return = util.cloneTagDef(core.returns);
// Closure Compiler only
exports.struct = NOOP_TAG;
// Closure Compiler only
exports.suppress = NOOP_TAG;
// Closure Compiler only
exports.template = NOOP_TAG;
exports.this = {
canHaveType: true,
onTagged(doclet, tag) {
doclet.this = util.combineTypes(tag);
},
};
exports.throws = util.cloneTagDef(core.throws);
exports.type = util.cloneTagDef(core.type, {
mustNotHaveDescription: false,
});
exports.typedef = {
canHaveType: true,
onTagged(doclet, tag) {
util.setDocletKindToTitle(doclet, tag);
util.setDocletTypeToValueType(doclet, tag);
},
};
// Closure Compiler only
exports.unrestricted = NOOP_TAG;

File diff suppressed because it is too large Load Diff

View File

@ -13,14 +13,10 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const closure = require('./closure'); import { tags as closure } from './closure.js';
const core = require('./core'); import { tags as core } from './core.js';
const internal = require('./internal'); import { tags as internal } from './internal.js';
const jsdoc = require('./jsdoc'); import { tags as jsdoc } from './jsdoc.js';
module.exports = { export { closure, core, internal, jsdoc };
closure, export default { closure, core, internal, jsdoc };
core,
internal,
jsdoc,
};

View File

@ -14,50 +14,47 @@
limitations under the License. limitations under the License.
*/ */
// Tags that JSDoc uses internally, and that must always be defined. // Tags that JSDoc uses internally, and that must always be defined.
export const tags = {
// Special separator tag indicating that multiple doclets should be generated for the same comment. // Special separator tag indicating that multiple doclets should be generated for the same
// Used internally (and by some JSDoc users, although it's not officially supported). // comment. Used internally (and by some JSDoc users, although it's not officially supported).
// //
// In the following example, the parser will replace `//**` with an `@also` tag: // In the following example, the parser will replace `//**` with an `@also` tag:
// /** // /**
// * Foo. // * Foo.
// *//** // *//**
// * Foo with a param. // * Foo with a param.
// * @param {string} bar // * @param {string} bar
// */ // */
// function foo(bar) {} // function foo(bar) {}
exports.also = { also: {
onTagged() { onTagged() {
// Let the parser handle it. We define the tag here to avoid "not a known tag" errors. // Let the parser handle it. We define the tag here to avoid "not a known tag" errors.
}, },
}; },
description: {
exports.description = { mustHaveValue: true,
mustHaveValue: true, onTagged: (doclet, { value }) => {
onTagged: (doclet, { value }) => { doclet.description = value;
doclet.description = value; },
}, synonyms: ['desc'],
synonyms: ['desc'], },
}; kind: {
mustHaveValue: true,
exports.kind = { onTagged: (doclet, { value }) => {
mustHaveValue: true, doclet.kind = value;
onTagged: (doclet, { value }) => { },
doclet.kind = value; },
}, name: {
}; mustHaveValue: true,
onTagged: (doclet, { value }) => {
exports.name = { doclet.name = value;
mustHaveValue: true, },
onTagged: (doclet, { value }) => { },
doclet.name = value; undocumented: {
}, mustNotHaveValue: true,
}; onTagged(doclet) {
doclet.undocumented = true;
exports.undocumented = { doclet.comment = '';
mustNotHaveValue: true, },
onTagged(doclet) {
doclet.undocumented = true;
doclet.comment = '';
}, },
}; };

View File

@ -13,6 +13,4 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const core = require('./core'); export { tags } from './core.js';
module.exports = core;

View File

@ -13,23 +13,25 @@
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
const _ = require('lodash'); import path from 'node:path';
const { applyNamespace } = require('@jsdoc/core').name;
const commonPathPrefix = require('common-path-prefix'); import { name } from '@jsdoc/core';
const { log } = require('@jsdoc/util'); import { log } from '@jsdoc/util';
const { parse: parseTagType } = require('../type'); import commonPathPrefix from 'common-path-prefix';
const path = require('path'); import _ from 'lodash';
import { parse as parseTagType } from '../type.js';
// Clone a tag definition, excluding synonyms. // Clone a tag definition, excluding synonyms.
exports.cloneTagDef = (tagDef, extras) => { export function cloneTagDef(tagDef, extras) {
const newTagDef = _.cloneDeep(tagDef); const newTagDef = _.cloneDeep(tagDef);
delete newTagDef.synonyms; delete newTagDef.synonyms;
return extras ? _.extend(newTagDef, extras) : newTagDef; return extras ? _.extend(newTagDef, extras) : newTagDef;
}; }
const getSourcePaths = (exports.getSourcePaths = (env) => { export function getSourcePaths(env) {
const sourcePaths = env.sourceFiles.slice() || []; const sourcePaths = env.sourceFiles.slice() || [];
if (env.opts._) { if (env.opts._) {
@ -43,7 +45,7 @@ const getSourcePaths = (exports.getSourcePaths = (env) => {
} }
return sourcePaths; return sourcePaths;
}); }
function filepathMinusPrefix(filepath, env) { function filepathMinusPrefix(filepath, env) {
let commonPrefix; let commonPrefix;
@ -68,19 +70,19 @@ function filepathMinusPrefix(filepath, env) {
return result; return result;
} }
exports.setDocletKindToTitle = (doclet, { title }) => { export function setDocletKindToTitle(doclet, { title }) {
doclet.addTag('kind', title); doclet.addTag('kind', title);
}; }
exports.setDocletScopeToTitle = (doclet, { title }) => { export function setDocletScopeToTitle(doclet, { title }) {
try { try {
doclet.setScope(title); doclet.setScope(title);
} catch (e) { } catch (e) {
log.error(e.message); log.error(e.message);
} }
}; }
exports.setDocletNameToValue = (doclet, { value, text }) => { export function setDocletNameToValue(doclet, { value, text }) {
if (value && value.description) { if (value && value.description) {
// as in a long tag // as in a long tag
doclet.addTag('name', value.description); doclet.addTag('name', value.description);
@ -88,21 +90,21 @@ exports.setDocletNameToValue = (doclet, { value, text }) => {
// or a short tag // or a short tag
doclet.addTag('name', text); doclet.addTag('name', text);
} }
}; }
exports.setDocletNameToValueName = (doclet, { value }) => { export function setDocletNameToValueName(doclet, { value }) {
if (value && value.name) { if (value && value.name) {
doclet.addTag('name', value.name); doclet.addTag('name', value.name);
} }
}; }
exports.setDocletDescriptionToValue = (doclet, { value }) => { export function setDocletDescriptionToValue(doclet, { value }) {
if (value) { if (value) {
doclet.addTag('description', value); doclet.addTag('description', value);
} }
}; }
exports.setDocletTypeToValueType = (doclet, { value }) => { export function setDocletTypeToValueType(doclet, { value }) {
if (value && value.type) { if (value && value.type) {
// Add the type names and other type properties (such as `optional`). // Add the type names and other type properties (such as `optional`).
// Don't overwrite existing properties. // Don't overwrite existing properties.
@ -112,9 +114,9 @@ exports.setDocletTypeToValueType = (doclet, { value }) => {
} }
}); });
} }
}; }
exports.setNameToFile = (doclet) => { export function setNameToFile(doclet) {
let docletName; let docletName;
if (doclet.meta.filename) { if (doclet.meta.filename) {
@ -122,29 +124,29 @@ exports.setNameToFile = (doclet) => {
filepathMinusPrefix(doclet.meta.path, doclet.dependencies.get('env')) + doclet.meta.filename; filepathMinusPrefix(doclet.meta.path, doclet.dependencies.get('env')) + doclet.meta.filename;
doclet.addTag('name', docletName); doclet.addTag('name', docletName);
} }
}; }
exports.setDocletMemberof = (doclet, { value }) => { export function setDocletMemberof(doclet, { value }) {
if (value && value !== '<global>') { if (value && value !== '<global>') {
doclet.setMemberof(value); doclet.setMemberof(value);
} }
}; }
exports.applyNamespaceToTag = (docletOrNs, tag) => { export function applyNamespaceToTag(docletOrNs, tag) {
if (typeof docletOrNs === 'string') { if (typeof docletOrNs === 'string') {
// ns // ns
tag.value = applyNamespace(tag.value, docletOrNs); tag.value = name.applyNamespace(tag.value, docletOrNs);
} else { } else {
// doclet // doclet
if (!docletOrNs.name) { if (!docletOrNs.name) {
return; // error? return; // error?
} }
docletOrNs.longname = applyNamespace(docletOrNs.name, tag.title); docletOrNs.longname = name.applyNamespace(docletOrNs.name, tag.title);
} }
}; }
exports.setDocletNameToFilename = (doclet) => { export function setDocletNameToFilename(doclet) {
let docletName = ''; let docletName = '';
if (doclet.meta.path) { if (doclet.meta.path) {
@ -154,15 +156,15 @@ exports.setDocletNameToFilename = (doclet) => {
docletName += doclet.meta.filename.replace(/\.js$/i, ''); docletName += doclet.meta.filename.replace(/\.js$/i, '');
doclet.name = docletName; doclet.name = docletName;
}; }
exports.parseTypeText = (text) => { export function parseTypeText(text) {
const tagType = parseTagType(text, false, true); const tagType = parseTagType(text, false, true);
return tagType.typeExpression || text; return tagType.typeExpression || text;
}; }
exports.parseBorrows = (doclet, { text }) => { export function parseBorrows(doclet, { text }) {
const m = /^([\s\S]+?)(?:\s+as\s+([\s\S]+))?$/.exec(text); const m = /^([\s\S]+?)(?:\s+as\s+([\s\S]+))?$/.exec(text);
if (m) { if (m) {
@ -181,9 +183,9 @@ exports.parseBorrows = (doclet, { text }) => {
} else { } else {
return {}; return {};
} }
}; }
exports.firstWordOf = (string) => { export function firstWordOf(string) {
const m = /^(\S+)/.exec(string); const m = /^(\S+)/.exec(string);
if (m) { if (m) {
@ -191,9 +193,9 @@ exports.firstWordOf = (string) => {
} else { } else {
return ''; return '';
} }
}; }
exports.combineTypes = ({ value }) => { export function combineTypes({ value }) {
let combined; let combined;
if (value && value.type) { if (value && value.type) {
@ -205,4 +207,4 @@ exports.combineTypes = ({ value }) => {
} }
return combined; return combined;
}; }

View File

@ -14,8 +14,9 @@
limitations under the License. limitations under the License.
*/ */
/** @module @jsdoc/tag/lib/dictionary */ /** @module @jsdoc/tag/lib/dictionary */
const definitions = require('./definitions'); import { log } from '@jsdoc/util';
const { log } = require('@jsdoc/util');
import definitions from './definitions/index.js';
const DEFINITIONS = { const DEFINITIONS = {
closure: 'closure', closure: 'closure',
@ -48,10 +49,7 @@ class TagDefinition {
} }
} }
/** export class Dictionary {
* @memberof module:jsdoc/tag/dictionary
*/
class Dictionary {
constructor() { constructor() {
// TODO: Consider adding internal tags in the constructor, ideally as fallbacks that aren't // TODO: Consider adding internal tags in the constructor, ideally as fallbacks that aren't
// used to confirm whether a tag is defined/valid, rather than requiring every set of tag // used to confirm whether a tag is defined/valid, rather than requiring every set of tag
@ -182,5 +180,3 @@ class Dictionary {
return canonicalName; return canonicalName;
} }
} }
exports.Dictionary = Dictionary;

View File

@ -73,7 +73,9 @@ function regExpFactory(tagName = '\\S+', prefix = '', suffix = '') {
* @returns {boolean} Set to `true` if the string is a valid inline tag or `false` in all other * @returns {boolean} Set to `true` if the string is a valid inline tag or `false` in all other
* cases. * cases.
*/ */
exports.isInlineTag = (string, tagName) => regExpFactory(tagName, '^', '$').test(string); export function isInlineTag(string, tagName) {
return regExpFactory(tagName, '^', '$').test(string);
}
/** /**
* Replace all instances of multiple inline tags with other text. * Replace all instances of multiple inline tags with other text.
@ -85,7 +87,7 @@ exports.isInlineTag = (string, tagName) => regExpFactory(tagName, '^', '$').test
* @return {module:@jsdoc/tag.inline.InlineTagResult} The updated string, as well as information * @return {module:@jsdoc/tag.inline.InlineTagResult} The updated string, as well as information
* about the inline tags that were found. * about the inline tags that were found.
*/ */
const replaceInlineTags = (exports.replaceInlineTags = (string, replacers) => { export function replaceInlineTags(string, replacers) {
const tagInfo = []; const tagInfo = [];
function replaceMatch(replacer, tag, match, text) { function replaceMatch(replacer, tag, match, text) {
@ -121,7 +123,7 @@ const replaceInlineTags = (exports.replaceInlineTags = (string, replacers) => {
tags: tagInfo, tags: tagInfo,
newString: string.trim(), newString: string.trim(),
}; };
}); }
/** /**
* Replace all instances of an inline tag with other text. * Replace all instances of an inline tag with other text.
@ -133,13 +135,13 @@ const replaceInlineTags = (exports.replaceInlineTags = (string, replacers) => {
* @return {module:@jsdoc/tag.inline.InlineTagResult} The updated string, as well as information * @return {module:@jsdoc/tag.inline.InlineTagResult} The updated string, as well as information
* about the inline tags that were found. * about the inline tags that were found.
*/ */
const replaceInlineTag = (exports.replaceInlineTag = (string, tag, replacer) => { export function replaceInlineTag(string, tag, replacer) {
const replacers = {}; const replacers = {};
replacers[tag] = replacer; replacers[tag] = replacer;
return replaceInlineTags(string, replacers); return replaceInlineTags(string, replacers);
}); }
/** /**
* Extract inline tags from a string, replacing them with an empty string. * Extract inline tags from a string, replacing them with an empty string.
@ -149,5 +151,6 @@ const replaceInlineTag = (exports.replaceInlineTag = (string, tag, replacer) =>
* @return {module:@jsdoc/tag.inline.InlineTagResult} The updated string, as well as information * @return {module:@jsdoc/tag.inline.InlineTagResult} The updated string, as well as information
* about the inline tags that were found. * about the inline tags that were found.
*/ */
exports.extractInlineTag = (string, tag) => export function extractInlineTag(string, tag) {
replaceInlineTag(string, tag, (str, { completeTag }) => str.replace(completeTag, '')); return replaceInlineTag(string, tag, (str, { completeTag }) => str.replace(completeTag, ''));
}

Some files were not shown because too many files have changed in this diff Show More