diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml index ab497fb1..d740af61 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -8,7 +8,7 @@ body: attributes: label: Plugin description: What plugin are you encountering a problem with ? - options: ["@knodes/typedoc-plugin-code-blocks", "@knodes/typedoc-plugin-pages", "@knodes/typedoc-pluginutils", Unspecified] # !FORMAT options: [${...plugins}, Unspecified] + options: ["@knodes/typedoc-pluginutils", "@knodes/typedoc-plugin-pages", "@knodes/typedoc-plugin-code-blocks", Unspecified] # !FORMAT options: [${...plugins}, Unspecified] validations: required: true - type: input diff --git a/.github/ISSUE_TEMPLATE/feature-request.yaml b/.github/ISSUE_TEMPLATE/feature-request.yaml index 5900c62d..c7210ec8 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yaml +++ b/.github/ISSUE_TEMPLATE/feature-request.yaml @@ -8,7 +8,7 @@ body: attributes: label: Plugin description: What plugin is concerned ? - options: ["@knodes/typedoc-plugin-code-blocks", "@knodes/typedoc-plugin-pages", "@knodes/typedoc-pluginutils", Unspecified] # !FORMAT options: [${...plugins}, Unspecified] + options: ["@knodes/typedoc-pluginutils", "@knodes/typedoc-plugin-pages", "@knodes/typedoc-plugin-code-blocks", Unspecified] # !FORMAT options: [${...plugins}, Unspecified] validations: required: true - type: textarea diff --git a/package.json b/package.json index 906cd237..1fb2a7e8 100644 --- a/package.json +++ b/package.json @@ -64,10 +64,10 @@ "@commitlint/cli": "^17.0.2", "@commitlint/config-conventional": "^17.0.2", "@knodes/eslint-config": "^1.6.5", - "@knodes/typedoc-plugin-code-blocks": "file:./packages/plugin-code-blocks", - "@knodes/typedoc-plugin-pages": "file:./packages/plugin-pages", - "@knodes/typedoc-plugintestbed": "file:./packages/plugintestbed", - "@knodes/typedoc-pluginutils": "file:./packages/pluginutils", + "@knodes/typedoc-plugin-code-blocks": "file:packages/plugin-code-blocks", + "@knodes/typedoc-plugin-pages": "file:packages/plugin-pages", + "@knodes/typedoc-plugintestbed": "file:packages/plugintestbed", + "@knodes/typedoc-pluginutils": "file:packages/pluginutils", "@testing-library/jest-dom": "^5.16.4", "@types/concurrently": "^7.0.0", "@types/diff": "^5.0.2", diff --git a/packages/pluginutils/package.json b/packages/pluginutils/package.json index ee8999a9..d41f37a5 100644 --- a/packages/pluginutils/package.json +++ b/packages/pluginutils/package.json @@ -24,7 +24,6 @@ "utils" ], "main": "dist/index.js", - "types": "dist/index.d.ts", "exports": { ".": { "default": "./dist/index.js", @@ -46,6 +45,7 @@ "prepublishOnly": "npm run build:clean && npm run build", "test": "jest --config jest.config.js" }, + "types": "dist/index.d.ts", "dependencies": { "lodash": "^4.17.21", "fastest-levenshtein": "^1.0.16", diff --git a/tools/sync-proto-modules/issue-template.js b/tools/sync-proto-modules/issue-template.js index 9d77b7d0..71b51194 100644 --- a/tools/sync-proto-modules/issue-template.js +++ b/tools/sync-proto-modules/issue-template.js @@ -1,9 +1,10 @@ const { readFile } = require( 'fs/promises' ); +const { glob } = require( 'glob' ); const { minVersion } = require( 'semver' ); const { syncFile, postProcessYaml } = require( './utils' ); -const { resolveRoot, globAsync } = require( '../utils' ); +const { resolveRoot } = require( '../utils' ); const DIR = resolveRoot( './.github/ISSUE_TEMPLATE' ); /** @@ -12,7 +13,7 @@ const DIR = resolveRoot( './.github/ISSUE_TEMPLATE' ); */ module.exports.issueTemplate = async checkOnly => ( { tearDown: async ( _, projects ) => { - await Promise.all( ( await globAsync( '*.yaml', { cwd: DIR } ) ).map( async f => { + await Promise.all( ( await glob( '*.yaml', { cwd: DIR } ) ).map( async f => { const path = resolveRoot( DIR, f ); const yaml = await readFile( path, 'utf-8' ); const yamlFormatted = postProcessYaml( yaml, { diff --git a/tools/sync-proto-modules/readme.js b/tools/sync-proto-modules/readme.js index 33f46637..9093401e 100644 --- a/tools/sync-proto-modules/readme.js +++ b/tools/sync-proto-modules/readme.js @@ -1,7 +1,7 @@ const { yellow } = require( 'chalk' ); +const { glob } = require( 'glob' ); const { tryReadFile, getDocsUrl, readProjectPackageJson, syncFile } = require( './utils' ); -const { globAsync } = require( '../utils' ); class Readme { constructor( checkOnly ){ @@ -10,7 +10,7 @@ class Readme { } async run( _proto, { path: projectPath } ){ - const readmeFiles = await globAsync( `${projectPath}/@(readme|README).@(md|MD)` ); + const readmeFiles = await glob( `${projectPath}/@(readme|README).@(md|MD)` ); if( readmeFiles.length > 1 ){ throw new Error( 'Multiple README files' ); } diff --git a/tools/sync-proto-modules/sync-fs.js b/tools/sync-proto-modules/sync-fs.js index 2cdb469c..93e64eec 100644 --- a/tools/sync-proto-modules/sync-fs.js +++ b/tools/sync-proto-modules/sync-fs.js @@ -5,10 +5,10 @@ const { readFile, mkdir, access, copyFile, unlink, writeFile } = require( 'fs/pr const { resolve, join } = require( 'path' ); const { bold } = require( 'chalk' ); +const { glob } = require( 'glob' ); const { memoize, partition, isString } = require( 'lodash' ); const { tryReadFile } = require( './utils' ); -const { globAsync } = require( '../utils' ); const checksum = async file => createHash( 'md5' ) .update( ( await readFile( file, 'utf-8' ) ).replace( /\r?\n/g, '\n' ), 'utf-8' ) @@ -37,7 +37,7 @@ const readCache = memoize( async () => { } ); const protoFs = memoize( async ( proto, handlers ) => { - const filesDirs = ( await globAsync( '**', { cwd: proto, ignore: [ '**/node_modules/**' ], mark: true, dot: true } ) ) + const filesDirs = ( await glob( '**', { cwd: proto, ignore: [ '**/node_modules/**' ], mark: true, dot: true } ) ) .filter( fd => !( handlers.some( h => h.handleFile?.( fd ) ?? false ) ) ); const [ dirs, files ] = partition( filesDirs, p => p.endsWith( '/' ) ); return { dirs, files }; diff --git a/tools/typedoc-patcher.js b/tools/typedoc-patcher.js index b242987a..1b062841 100644 --- a/tools/typedoc-patcher.js +++ b/tools/typedoc-patcher.js @@ -4,9 +4,10 @@ const { readFile, access, open } = require( 'fs/promises' ); const { resolve, dirname, relative } = require( 'path' ); const { red, bold, green } = require( 'chalk' ); +const { glob } = require( 'glob' ); const { memoize } = require( 'lodash' ); -const { spawn, globAsync, createStash, commonPath, selectProjects, captureStream, getStagedFiles } = require( './utils' ); +const { spawn, createStash, commonPath, selectProjects, captureStream, getStagedFiles } = require( './utils' ); const getPatchName = f => `${f}.patch`; const assertWritable = memoize( async filePath => { @@ -87,7 +88,7 @@ const generatePattern = () => { if( stash ){ await createStash( 'typedoc-patcher: diff' ); } - const generatedFiles = await globAsync( pattern, { ignore: [ '**/dist/**', '**/node_modules/**', getPatchName( generatedPattern ) ] } ); + const generatedFiles = await glob( pattern, { ignore: [ '**/dist/**', '**/node_modules/**', getPatchName( generatedPattern ) ] } ); if( generatedFiles.length === 0 ) { console.log( 'No patches generated.' ); return; @@ -121,7 +122,7 @@ const generatePattern = () => { if( stash ){ await createStash( 'typedoc-patcher: apply' ); } - const patchFiles = await globAsync( getPatchName( pattern ), { ignore: [ '**/dist/**', '**/node_modules/**' ] } ); + const patchFiles = await glob( getPatchName( pattern ), { ignore: [ '**/dist/**', '**/node_modules/**' ] } ); if( patchFiles.length === 0 ) { console.log( 'No patches applied.' ); return; diff --git a/tools/utils.js b/tools/utils.js index 04090455..d8a99cf0 100644 --- a/tools/utils.js +++ b/tools/utils.js @@ -7,9 +7,6 @@ const glob = require( 'glob' ); const { once, isArray, omitBy, isNil } = require( 'lodash' ); const { normalizePath } = require( 'typedoc' ); -const globAsync = promisify( glob ); -module.exports.globAsync = globAsync; - const exec = promisify( _exec ); module.exports.exec = exec;