@verdaccio/plugin-verifier 1.0.0-next-9.26 → 1.0.0-next-9.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # @verdaccio/plugin-verifier
2
2
 
3
+ ## 1.0.0-next-9.28
4
+
5
+ ### Patch Changes
6
+
7
+ - f3f8976: chore: replace \_\_dirname with import.meta.dirname
8
+ - 46f4ff5: chore(tools): set rolldown platform for plugin-verifier
9
+ - Updated dependencies [107c4d3]
10
+ - Updated dependencies [3724054]
11
+ - Updated dependencies [59f1350]
12
+ - Updated dependencies [f3f8976]
13
+ - Updated dependencies [89a7362]
14
+ - Updated dependencies [3724054]
15
+ - Updated dependencies [107c4d3]
16
+ - @verdaccio/logger@9.0.0-next-9.32
17
+ - @verdaccio/loaders@9.0.0-next-9.32
18
+ - @verdaccio/core@9.0.0-next-9.32
19
+
20
+ ## 1.0.0-next-9.27
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies [c2b5897]
25
+ - Updated dependencies [68ab0d4]
26
+ - Updated dependencies [c52b632]
27
+ - Updated dependencies [7054084]
28
+ - Updated dependencies [e3d3128]
29
+ - Updated dependencies [cf15239]
30
+ - @verdaccio/core@9.0.0-next-9.31
31
+ - @verdaccio/loaders@9.0.0-next-9.31
32
+ - @verdaccio/logger@9.0.0-next-9.31
33
+
3
34
  ## 1.0.0-next-9.26
4
35
 
5
36
  ### Patch Changes
package/build/cli.js CHANGED
@@ -10,5 +10,6 @@ var cli = new Cli({
10
10
  cli.register(VerifyCommand);
11
11
  cli.runExit(args, Cli.defaultContext);
12
12
  //#endregion
13
+ export {};
13
14
 
14
15
  //# sourceMappingURL=cli.js.map
@@ -9,7 +9,7 @@ let node_module = require("node:module");
9
9
  let node_url = require("node:url");
10
10
  //#region src/diagnostics.ts
11
11
  var debug$1 = (0, debug.default)("verdaccio:plugin:verifier:diagnostics");
12
- var requireModule = (0, node_module.createRequire)(typeof __filename !== "undefined" ? __filename : {}.url);
12
+ var requireModule = (0, node_module.createRequire)(__filename);
13
13
  function isValidExport(plugin) {
14
14
  return typeof plugin === "function" || typeof plugin?.default === "function";
15
15
  }
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostics.cjs","names":[],"sources":["../src/diagnostics.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { join, resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nimport { PLUGIN_PREFIX } from '@verdaccio/core';\n\nimport { getSanityCheck } from './sanity-checks';\nimport type { DiagnosticStep, VerifyPluginOptions } from './types';\n\nconst debug = buildDebug('verdaccio:plugin:verifier:diagnostics');\n\n// createRequire needs an absolute path; works in both ESM and CJS contexts\nconst requireModule = createRequire(\n typeof __filename !== 'undefined' ? __filename : import.meta.url\n);\n\nfunction isValidExport(plugin: any): boolean {\n return typeof plugin === 'function' || typeof plugin?.default === 'function';\n}\n\nfunction isES6(plugin: any): boolean {\n return plugin && typeof plugin === 'object' && 'default' in plugin;\n}\n\n/**\n * Resolve the ESM entry point for a directory-based plugin.\n * import() doesn't support directory imports, so we resolve via package.json.\n */\nexport function resolveEntryPoint(dirPath: string): string {\n const pkgPath = join(dirPath, 'package.json');\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n if (pkg.exports) {\n const dotExport = pkg.exports['.'];\n if (typeof dotExport === 'string') {\n return join(dirPath, dotExport);\n }\n if (dotExport?.import?.default) {\n return join(dirPath, dotExport.import.default);\n }\n if (dotExport?.import && typeof dotExport.import === 'string') {\n return join(dirPath, dotExport.import);\n }\n if (dotExport?.default) {\n return join(dirPath, dotExport.default);\n }\n }\n if (pkg.module) {\n return join(dirPath, pkg.module);\n }\n if (pkg.main) {\n return join(dirPath, pkg.main);\n }\n } catch {\n // fall through\n }\n }\n return join(dirPath, 'index.js');\n}\n\n/**\n * Try to load a module, falling back from require() to import() for ESM.\n * Handles CJS require(), ESM require() shim errors (bundlers), and\n * ERR_REQUIRE_ESM — always falls through to dynamic import() on any\n * require() failure.\n */\nasync function tryResolve(modulePath: string): Promise<{ module: any; error?: string }> {\n // Try require() first (fast path for CJS modules)\n try {\n return { module: requireModule(modulePath) };\n } catch (requireErr: any) {\n debug('require() failed for %o: %s — trying dynamic import', modulePath, requireErr.message);\n }\n\n // Fallback to dynamic import() for ESM modules\n try {\n let importPath = modulePath;\n if (existsSync(modulePath) && existsSync(join(modulePath, 'package.json'))) {\n importPath = resolveEntryPoint(modulePath);\n debug('resolved ESM entry point: %o', importPath);\n }\n const importUrl = importPath.startsWith('/') ? pathToFileURL(importPath).href : importPath;\n const mod = await import(importUrl);\n return { module: mod };\n } catch (importErr: any) {\n return { module: null, error: importErr.message };\n }\n}\n\n/**\n * Runs step-by-step diagnostics to identify exactly which phase of\n * plugin loading fails. This replicates the same resolution logic\n * as `asyncLoadPlugin` but tests each step independently.\n */\nexport async function runDiagnostics(options: VerifyPluginOptions): Promise<DiagnosticStep[]> {\n const {\n pluginPath,\n category,\n pluginConfig = {},\n sanityCheck: customSanityCheck,\n prefix = PLUGIN_PREFIX,\n pluginsFolder,\n } = options;\n\n const steps: DiagnosticStep[] = [];\n const isScoped = pluginPath.startsWith('@') && pluginPath.includes('/');\n const pluginName = isScoped ? pluginPath : `${prefix}-${pluginPath}`;\n\n debug('running diagnostics for %o (resolved name: %o)', pluginPath, pluginName);\n\n // --- Phase 1: Resolve ---\n let pluginModule: any = null;\n let resolvedFrom = '';\n\n // Try plugins folder first\n if (pluginsFolder) {\n const absFolder = resolve(pluginsFolder);\n const pluginDir = join(absFolder, pluginName);\n debug('checking plugins folder: %o', pluginDir);\n\n if (!existsSync(absFolder)) {\n steps.push({\n phase: 'resolve',\n pass: false,\n message: `Plugins folder does not exist: ${absFolder}`,\n });\n return steps;\n }\n\n if (!existsSync(pluginDir)) {\n debug('plugin directory not found: %o', pluginDir);\n steps.push({\n phase: 'resolve',\n pass: false,\n message: `Plugin directory not found: ${pluginDir} — expected a folder named \"${pluginName}\" inside \"${absFolder}\"`,\n });\n return steps;\n }\n\n const result = await tryResolve(pluginDir);\n if (result.module) {\n pluginModule = result.module;\n resolvedFrom = pluginDir;\n debug('resolved from plugins folder: %o', pluginDir);\n } else {\n const missingDep = parseMissingDependency(result.error ?? '', pluginDir);\n steps.push({\n phase: 'resolve',\n pass: false,\n message: missingDep\n ? `Plugin found at ${pluginDir} but has a missing dependency: ${missingDep}`\n : `Plugin found at ${pluginDir} but failed to load: ${result.error}`,\n });\n return steps;\n }\n }\n\n // Try node_modules if not found in plugins folder\n if (!pluginModule) {\n const result = await tryResolve(pluginName);\n if (result.module) {\n pluginModule = result.module;\n resolvedFrom = pluginName;\n debug('resolved from node_modules: %o', pluginName);\n } else {\n const missingDep = parseMissingDependency(result.error ?? '', pluginName);\n steps.push({\n phase: 'resolve',\n pass: false,\n message: missingDep\n ? `Package \"${pluginName}\" found but has a missing dependency: ${missingDep}`\n : `Package \"${pluginName}\" not found in node_modules — try: npm install ${pluginName}`,\n });\n return steps;\n }\n }\n\n steps.push({\n phase: 'resolve',\n pass: true,\n message: `Module resolved from ${resolvedFrom}`,\n });\n\n // --- Phase 2: Export validation ---\n if (!isValidExport(pluginModule)) {\n const exportKeys = pluginModule ? Object.keys(pluginModule).join(', ') : 'none';\n steps.push({\n phase: 'export',\n pass: false,\n message: `Module does not export a function or class (default export). Exported keys: [${exportKeys}]`,\n });\n return steps;\n }\n\n const moduleType = isES6(pluginModule) ? 'ES6 (default export)' : 'CommonJS (factory function)';\n steps.push({\n phase: 'export',\n pass: true,\n message: `Valid ${moduleType} plugin export detected`,\n });\n\n // --- Phase 3: Instantiation ---\n let instance: any;\n try {\n if (isES6(pluginModule)) {\n instance = new pluginModule.default(pluginConfig, { config: pluginConfig, logger: console });\n } else {\n instance = pluginModule(pluginConfig, { config: pluginConfig, logger: console });\n }\n } catch (err: any) {\n steps.push({\n phase: 'instantiate',\n pass: false,\n message: `Plugin threw during instantiation: ${err.message}`,\n });\n return steps;\n }\n\n if (!instance || (typeof instance !== 'object' && typeof instance !== 'function')) {\n steps.push({\n phase: 'instantiate',\n pass: false,\n message: `Plugin constructor/factory returned ${instance === null ? 'null' : typeof instance} instead of an object`,\n });\n return steps;\n }\n\n steps.push({\n phase: 'instantiate',\n pass: true,\n message: 'Plugin instantiated successfully',\n });\n\n // --- Phase 4: Sanity check ---\n const sanityCheck = customSanityCheck ?? getSanityCheck(category);\n const passed = sanityCheck(instance);\n\n if (!passed) {\n const methods = Object.getOwnPropertyNames(Object.getPrototypeOf(instance) ?? {})\n .filter((m) => m !== 'constructor')\n .concat(Object.keys(instance));\n const unique = [...new Set(methods)];\n\n steps.push({\n phase: 'sanity-check',\n pass: false,\n message: `Plugin does not implement the required methods for category \"${category}\". Available methods: [${unique.join(', ')}]`,\n });\n return steps;\n }\n\n steps.push({\n phase: 'sanity-check',\n pass: true,\n message: `Plugin passes sanity check for category \"${category}\"`,\n });\n\n return steps;\n}\n\n/**\n * When a MODULE_NOT_FOUND error is about a transitive dependency\n * (not the plugin itself), extract the missing module name.\n */\nfunction parseMissingDependency(message: string, pluginPath: string): string | null {\n const match = message.match(/Cannot find module '([^']+)'/);\n if (match && match[1] && !match[1].includes(pluginPath)) {\n return match[1];\n }\n return null;\n}\n"],"mappings":";;;;;;;;;;AAWA,IAAM,WAAA,GAAQ,MAAA,QAAA,CAAW,uCAAuC;AAGhE,IAAM,iBAAA,GAAgB,YAAA,cAAA,CACpB,OAAO,eAAe,cAAc,aAAA,CAAA,EAAyB,GAC/D;AAEA,SAAS,cAAc,QAAsB;CAC3C,OAAO,OAAO,WAAW,cAAc,OAAO,QAAQ,YAAY;AACpE;AAEA,SAAS,MAAM,QAAsB;CACnC,OAAO,UAAU,OAAO,WAAW,YAAY,aAAa;AAC9D;;;;;AAMA,SAAgB,kBAAkB,SAAyB;CACzD,MAAM,WAAA,GAAU,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P,MAAM;EACN,SAAS;CACX,CAAC;CAMD,IAAI,EAHgB,qBAAqB,sBAAA,eAAe,QAAQ,EAAA,CACrC,QAEtB,GAAQ;EACX,MAAM,UAAU,OAAO,oBAAoB,OAAO,eAAe,QAAQ,KAAK,CAAC,CAAC,CAAC,CAC9E,QAAQ,MAAM,MAAM,aAAa,CAAC,CAClC,OAAO,OAAO,KAAK,QAAQ,CAAC;EAC/B,MAAM,SAAS,CAAC,GAAG,IAAI,IAAI,OAAO,CAAC;EAEnC,MAAM,KAAK;GACT,OAAO;GACP,MAAM;GACN,SAAS,gEAAgE,SAAS,yBAAyB,OAAO,KAAK,IAAI,EAAE;EAC/H,CAAC;EACD,OAAO;CACT;CAEA,MAAM,KAAK;EACT,OAAO;EACP,MAAM;EACN,SAAS,4CAA4C,SAAS;CAChE,CAAC;CAED,OAAO;AACT;;;;;AAMA,SAAS,uBAAuB,SAAiB,YAAmC;CAClF,MAAM,QAAQ,QAAQ,MAAM,8BAA8B;CAC1D,IAAI,SAAS,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC,SAAS,UAAU,GACpD,OAAO,MAAM;CAEf,OAAO;AACT"}
1
+ {"version":3,"file":"diagnostics.cjs","names":[],"sources":["../src/diagnostics.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { join, resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nimport { PLUGIN_PREFIX } from '@verdaccio/core';\n\nimport { getSanityCheck } from './sanity-checks';\nimport type { DiagnosticStep, VerifyPluginOptions } from './types';\n\nconst debug = buildDebug('verdaccio:plugin:verifier:diagnostics');\n\nconst requireModule = createRequire(import.meta.filename);\n\nfunction isValidExport(plugin: any): boolean {\n return typeof plugin === 'function' || typeof plugin?.default === 'function';\n}\n\nfunction isES6(plugin: any): boolean {\n return plugin && typeof plugin === 'object' && 'default' in plugin;\n}\n\n/**\n * Resolve the ESM entry point for a directory-based plugin.\n * import() doesn't support directory imports, so we resolve via package.json.\n */\nexport function resolveEntryPoint(dirPath: string): string {\n const pkgPath = join(dirPath, 'package.json');\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n if (pkg.exports) {\n const dotExport = pkg.exports['.'];\n if (typeof dotExport === 'string') {\n return join(dirPath, dotExport);\n }\n if (dotExport?.import?.default) {\n return join(dirPath, dotExport.import.default);\n }\n if (dotExport?.import && typeof dotExport.import === 'string') {\n return join(dirPath, dotExport.import);\n }\n if (dotExport?.default) {\n return join(dirPath, dotExport.default);\n }\n }\n if (pkg.module) {\n return join(dirPath, pkg.module);\n }\n if (pkg.main) {\n return join(dirPath, pkg.main);\n }\n } catch {\n // fall through\n }\n }\n return join(dirPath, 'index.js');\n}\n\n/**\n * Try to load a module, falling back from require() to import() for ESM.\n * Handles CJS require(), ESM require() shim errors (bundlers), and\n * ERR_REQUIRE_ESM — always falls through to dynamic import() on any\n * require() failure.\n */\nasync function tryResolve(modulePath: string): Promise<{ module: any; error?: string }> {\n // Try require() first (fast path for CJS modules)\n try {\n return { module: requireModule(modulePath) };\n } catch (requireErr: any) {\n debug('require() failed for %o: %s — trying dynamic import', modulePath, requireErr.message);\n }\n\n // Fallback to dynamic import() for ESM modules\n try {\n let importPath = modulePath;\n if (existsSync(modulePath) && existsSync(join(modulePath, 'package.json'))) {\n importPath = resolveEntryPoint(modulePath);\n debug('resolved ESM entry point: %o', importPath);\n }\n const importUrl = importPath.startsWith('/') ? pathToFileURL(importPath).href : importPath;\n const mod = await import(importUrl);\n return { module: mod };\n } catch (importErr: any) {\n return { module: null, error: importErr.message };\n }\n}\n\n/**\n * Runs step-by-step diagnostics to identify exactly which phase of\n * plugin loading fails. This replicates the same resolution logic\n * as `asyncLoadPlugin` but tests each step independently.\n */\nexport async function runDiagnostics(options: VerifyPluginOptions): Promise<DiagnosticStep[]> {\n const {\n pluginPath,\n category,\n pluginConfig = {},\n sanityCheck: customSanityCheck,\n prefix = PLUGIN_PREFIX,\n pluginsFolder,\n } = options;\n\n const steps: DiagnosticStep[] = [];\n const isScoped = pluginPath.startsWith('@') && pluginPath.includes('/');\n const pluginName = isScoped ? pluginPath : `${prefix}-${pluginPath}`;\n\n debug('running diagnostics for %o (resolved name: %o)', pluginPath, pluginName);\n\n // --- Phase 1: Resolve ---\n let pluginModule: any = null;\n let resolvedFrom = '';\n\n // Try plugins folder first\n if (pluginsFolder) {\n const absFolder = resolve(pluginsFolder);\n const pluginDir = join(absFolder, pluginName);\n debug('checking plugins folder: %o', pluginDir);\n\n if (!existsSync(absFolder)) {\n steps.push({\n phase: 'resolve',\n pass: false,\n message: `Plugins folder does not exist: ${absFolder}`,\n });\n return steps;\n }\n\n if (!existsSync(pluginDir)) {\n debug('plugin directory not found: %o', pluginDir);\n steps.push({\n phase: 'resolve',\n pass: false,\n message: `Plugin directory not found: ${pluginDir} — expected a folder named \"${pluginName}\" inside \"${absFolder}\"`,\n });\n return steps;\n }\n\n const result = await tryResolve(pluginDir);\n if (result.module) {\n pluginModule = result.module;\n resolvedFrom = pluginDir;\n debug('resolved from plugins folder: %o', pluginDir);\n } else {\n const missingDep = parseMissingDependency(result.error ?? '', pluginDir);\n steps.push({\n phase: 'resolve',\n pass: false,\n message: missingDep\n ? `Plugin found at ${pluginDir} but has a missing dependency: ${missingDep}`\n : `Plugin found at ${pluginDir} but failed to load: ${result.error}`,\n });\n return steps;\n }\n }\n\n // Try node_modules if not found in plugins folder\n if (!pluginModule) {\n const result = await tryResolve(pluginName);\n if (result.module) {\n pluginModule = result.module;\n resolvedFrom = pluginName;\n debug('resolved from node_modules: %o', pluginName);\n } else {\n const missingDep = parseMissingDependency(result.error ?? '', pluginName);\n steps.push({\n phase: 'resolve',\n pass: false,\n message: missingDep\n ? `Package \"${pluginName}\" found but has a missing dependency: ${missingDep}`\n : `Package \"${pluginName}\" not found in node_modules — try: npm install ${pluginName}`,\n });\n return steps;\n }\n }\n\n steps.push({\n phase: 'resolve',\n pass: true,\n message: `Module resolved from ${resolvedFrom}`,\n });\n\n // --- Phase 2: Export validation ---\n if (!isValidExport(pluginModule)) {\n const exportKeys = pluginModule ? Object.keys(pluginModule).join(', ') : 'none';\n steps.push({\n phase: 'export',\n pass: false,\n message: `Module does not export a function or class (default export). Exported keys: [${exportKeys}]`,\n });\n return steps;\n }\n\n const moduleType = isES6(pluginModule) ? 'ES6 (default export)' : 'CommonJS (factory function)';\n steps.push({\n phase: 'export',\n pass: true,\n message: `Valid ${moduleType} plugin export detected`,\n });\n\n // --- Phase 3: Instantiation ---\n let instance: any;\n try {\n if (isES6(pluginModule)) {\n instance = new pluginModule.default(pluginConfig, { config: pluginConfig, logger: console });\n } else {\n instance = pluginModule(pluginConfig, { config: pluginConfig, logger: console });\n }\n } catch (err: any) {\n steps.push({\n phase: 'instantiate',\n pass: false,\n message: `Plugin threw during instantiation: ${err.message}`,\n });\n return steps;\n }\n\n if (!instance || (typeof instance !== 'object' && typeof instance !== 'function')) {\n steps.push({\n phase: 'instantiate',\n pass: false,\n message: `Plugin constructor/factory returned ${instance === null ? 'null' : typeof instance} instead of an object`,\n });\n return steps;\n }\n\n steps.push({\n phase: 'instantiate',\n pass: true,\n message: 'Plugin instantiated successfully',\n });\n\n // --- Phase 4: Sanity check ---\n const sanityCheck = customSanityCheck ?? getSanityCheck(category);\n const passed = sanityCheck(instance);\n\n if (!passed) {\n const methods = Object.getOwnPropertyNames(Object.getPrototypeOf(instance) ?? {})\n .filter((m) => m !== 'constructor')\n .concat(Object.keys(instance));\n const unique = [...new Set(methods)];\n\n steps.push({\n phase: 'sanity-check',\n pass: false,\n message: `Plugin does not implement the required methods for category \"${category}\". Available methods: [${unique.join(', ')}]`,\n });\n return steps;\n }\n\n steps.push({\n phase: 'sanity-check',\n pass: true,\n message: `Plugin passes sanity check for category \"${category}\"`,\n });\n\n return steps;\n}\n\n/**\n * When a MODULE_NOT_FOUND error is about a transitive dependency\n * (not the plugin itself), extract the missing module name.\n */\nfunction parseMissingDependency(message: string, pluginPath: string): string | null {\n const match = message.match(/Cannot find module '([^']+)'/);\n if (match && match[1] && !match[1].includes(pluginPath)) {\n return match[1];\n }\n return null;\n}\n"],"mappings":";;;;;;;;;;AAWA,IAAM,WAAA,GAAQ,MAAA,QAAA,CAAW,uCAAuC;AAEhE,IAAM,iBAAA,GAAgB,YAAA,cAAA,CAAA,UAAkC;AAExD,SAAS,cAAc,QAAsB;CAC3C,OAAO,OAAO,WAAW,cAAc,OAAO,QAAQ,YAAY;AACpE;AAEA,SAAS,MAAM,QAAsB;CACnC,OAAO,UAAU,OAAO,WAAW,YAAY,aAAa;AAC9D;;;;;AAMA,SAAgB,kBAAkB,SAAyB;CACzD,MAAM,WAAA,GAAU,UAAA,KAAA,CAAK,SAAS,cAAc;CAC5C,KAAA,GAAI,QAAA,WAAA,CAAW,OAAO,GACpB,IAAI;EACF,MAAM,MAAM,KAAK,OAAA,GAAM,QAAA,aAAA,CAAa,SAAS,OAAO,CAAC;EACrD,IAAI,IAAI,SAAS;GACf,MAAM,YAAY,IAAI,QAAQ;GAC9B,IAAI,OAAO,cAAc,UACvB,QAAA,GAAO,UAAA,KAAA,CAAK,SAAS,SAAS;GAEhC,IAAI,WAAW,QAAQ,SACrB,QAAA,GAAO,UAAA,KAAA,CAAK,SAAS,UAAU,OAAO,OAAO;GAE/C,IAAI,WAAW,UAAU,OAAO,UAAU,WAAW,UACnD,QAAA,GAAO,UAAA,KAAA,CAAK,SAAS,UAAU,MAAM;GAEvC,IAAI,WAAW,SACb,QAAA,GAAO,UAAA,KAAA,CAAK,SAAS,UAAU,OAAO;EAE1C;EACA,IAAI,IAAI,QACN,QAAA,GAAO,UAAA,KAAA,CAAK,SAAS,IAAI,MAAM;EAEjC,IAAI,IAAI,MACN,QAAA,GAAO,UAAA,KAAA,CAAK,SAAS,IAAI,IAAI;CAEjC,QAAQ,CAER;CAEF,QAAA,GAAO,UAAA,KAAA,CAAK,SAAS,UAAU;AACjC;;;;;;;AAQA,e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/diagnostics.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAiBnE;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA+BzD;AA+BD;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAoK5F"}
1
+ {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAcnE;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA+BzD;AA+BD;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAoK5F"}
@@ -1,13 +1,13 @@
1
1
  import { getSanityCheck } from "./sanity-checks.js";
2
+ import { createRequire } from "node:module";
2
3
  import buildDebug from "debug";
3
4
  import { join, resolve } from "node:path";
4
5
  import { PLUGIN_PREFIX } from "@verdaccio/core";
5
6
  import { existsSync, readFileSync } from "node:fs";
6
- import { createRequire } from "node:module";
7
7
  import { pathToFileURL } from "node:url";
8
8
  //#region src/diagnostics.ts
9
9
  var debug = buildDebug("verdaccio:plugin:verifier:diagnostics");
10
- var requireModule = createRequire(typeof __filename !== "undefined" ? __filename : import.meta.url);
10
+ var requireModule = createRequire(import.meta.filename);
11
11
  function isValidExport(plugin) {
12
12
  return typeof plugin === "function" || typeof plugin?.default === "function";
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostics.js","names":[],"sources":["../src/diagnostics.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { join, resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nimport { PLUGIN_PREFIX } from '@verdaccio/core';\n\nimport { getSanityCheck } from './sanity-checks';\nimport type { DiagnosticStep, VerifyPluginOptions } from './types';\n\nconst debug = buildDebug('verdaccio:plugin:verifier:diagnostics');\n\n// createRequire needs an absolute path; works in both ESM and CJS contexts\nconst requireModule = createRequire(\n typeof __filename !== 'undefined' ? __filename : import.meta.url\n);\n\nfunction isValidExport(plugin: any): boolean {\n return typeof plugin === 'function' || typeof plugin?.default === 'function';\n}\n\nfunction isES6(plugin: any): boolean {\n return plugin && typeof plugin === 'object' && 'default' in plugin;\n}\n\n/**\n * Resolve the ESM entry point for a directory-based plugin.\n * import() doesn't support directory imports, so we resolve via package.json.\n */\nexport function resolveEntryPoint(dirPath: string): string {\n const pkgPath = join(dirPath, 'package.json');\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n if (pkg.exports) {\n const dotExport = pkg.exports['.'];\n if (typeof dotExport === 'string') {\n return join(dirPath, dotExport);\n }\n if (dotExport?.import?.default) {\n return join(dirPath, dotExport.import.default);\n }\n if (dotExport?.import && typeof dotExport.import === 'string') {\n return join(dirPath, dotExport.import);\n }\n if (dotExport?.default) {\n return join(dirPath, dotExport.default);\n }\n }\n if (pkg.module) {\n return join(dirPath, pkg.module);\n }\n if (pkg.main) {\n return join(dirPath, pkg.main);\n }\n } catch {\n // fall through\n }\n }\n return join(dirPath, 'index.js');\n}\n\n/**\n * Try to load a module, falling back from require() to import() for ESM.\n * Handles CJS require(), ESM require() shim errors (bundlers), and\n * ERR_REQUIRE_ESM — always falls through to dynamic import() on any\n * require() failure.\n */\nasync function tryResolve(modulePath: string): Promise<{ module: any; error?: string }> {\n // Try require() first (fast path for CJS modules)\n try {\n return { module: requireModule(modulePath) };\n } catch (requireErr: any) {\n debug('require() failed for %o: %s — trying dynamic import', modulePath, requireErr.message);\n }\n\n // Fallback to dynamic import() for ESM modules\n try {\n let importPath = modulePath;\n if (existsSync(modulePath) && existsSync(join(modulePath, 'package.json'))) {\n importPath = resolveEntryPoint(modulePath);\n debug('resolved ESM entry point: %o', importPath);\n }\n const importUrl = importPath.startsWith('/') ? pathToFileURL(importPath).href : importPath;\n const mod = await import(importUrl);\n return { module: mod };\n } catch (importErr: any) {\n return { module: null, error: importErr.message };\n }\n}\n\n/**\n * Runs step-by-step diagnostics to identify exactly which phase of\n * plugin loading fails. This replicates the same resolution logic\n * as `asyncLoadPlugin` but tests each step independently.\n */\nexport async function runDiagnostics(options: VerifyPluginOptions): Promise<DiagnosticStep[]> {\n const {\n pluginPath,\n category,\n pluginConfig = {},\n sanityCheck: customSanityCheck,\n prefix = PLUGIN_PREFIX,\n pluginsFolder,\n } = options;\n\n const steps: DiagnosticStep[] = [];\n const isScoped = pluginPath.startsWith('@') && pluginPath.includes('/');\n const pluginName = isScoped ? pluginPath : `${prefix}-${pluginPath}`;\n\n debug('running diagnostics for %o (resolved name: %o)', pluginPath, pluginName);\n\n // --- Phase 1: Resolve ---\n let pluginModule: any = null;\n let resolvedFrom = '';\n\n // Try plugins folder first\n if (pluginsFolder) {\n const absFolder = resolve(pluginsFolder);\n const pluginDir = join(absFolder, pluginName);\n debug('checking plugins folder: %o', pluginDir);\n\n if (!existsSync(absFolder)) {\n steps.push({\n phase: 'resolve',\n pass: false,\n message: `Plugins folder does not exist: ${absFolder}`,\n });\n return steps;\n }\n\n if (!existsSync(pluginDir)) {\n debug('plugin directory not found: %o', pluginDir);\n steps.push({\n phase: 'resolve',\n pass: false,\n message: `Plugin directory not found: ${pluginDir} — expected a folder named \"${pluginName}\" inside \"${absFolder}\"`,\n });\n return steps;\n }\n\n const result = await tryResolve(pluginDir);\n if (result.module) {\n pluginModule = result.module;\n resolvedFrom = pluginDir;\n debug('resolved from plugins folder: %o', pluginDir);\n } else {\n const missingDep = parseMissingDependency(result.error ?? '', pluginDir);\n steps.push({\n phase: 'resolve',\n pass: false,\n message: missingDep\n ? `Plugin found at ${pluginDir} but has a missing dependency: ${missingDep}`\n : `Plugin found at ${pluginDir} but failed to load: ${result.error}`,\n });\n return steps;\n }\n }\n\n // Try node_modules if not found in plugins folder\n if (!pluginModule) {\n const result = await tryResolve(pluginName);\n if (result.module) {\n pluginModule = result.module;\n resolvedFrom = pluginName;\n debug('resolved from node_modules: %o', pluginName);\n } else {\n const missingDep = parseMissingDependency(result.error ?? '', pluginName);\n steps.push({\n phase: 'resolve',\n pass: false,\n message: missingDep\n ? `Package \"${pluginName}\" found but has a missing dependency: ${missingDep}`\n : `Package \"${pluginName}\" not found in node_modules — try: npm install ${pluginName}`,\n });\n return steps;\n }\n }\n\n steps.push({\n phase: 'resolve',\n pass: true,\n message: `Module resolved from ${resolvedFrom}`,\n });\n\n // --- Phase 2: Export validation ---\n if (!isValidExport(pluginModule)) {\n const exportKeys = pluginModule ? Object.keys(pluginModule).join(', ') : 'none';\n steps.push({\n phase: 'export',\n pass: false,\n message: `Module does not export a function or class (default export). Exported keys: [${exportKeys}]`,\n });\n return steps;\n }\n\n const moduleType = isES6(pluginModule) ? 'ES6 (default export)' : 'CommonJS (factory function)';\n steps.push({\n phase: 'export',\n pass: true,\n message: `Valid ${moduleType} plugin export detected`,\n });\n\n // --- Phase 3: Instantiation ---\n let instance: any;\n try {\n if (isES6(pluginModule)) {\n instance = new pluginModule.default(pluginConfig, { config: pluginConfig, logger: console });\n } else {\n instance = pluginModule(pluginConfig, { config: pluginConfig, logger: console });\n }\n } catch (err: any) {\n steps.push({\n phase: 'instantiate',\n pass: false,\n message: `Plugin threw during instantiation: ${err.message}`,\n });\n return steps;\n }\n\n if (!instance || (typeof instance !== 'object' && typeof instance !== 'function')) {\n steps.push({\n phase: 'instantiate',\n pass: false,\n message: `Plugin constructor/factory returned ${instance === null ? 'null' : typeof instance} instead of an object`,\n });\n return steps;\n }\n\n steps.push({\n phase: 'instantiate',\n pass: true,\n message: 'Plugin instantiated successfully',\n });\n\n // --- Phase 4: Sanity check ---\n const sanityCheck = customSanityCheck ?? getSanityCheck(category);\n const passed = sanityCheck(instance);\n\n if (!passed) {\n const methods = Object.getOwnPropertyNames(Object.getPrototypeOf(instance) ?? {})\n .filter((m) => m !== 'constructor')\n .concat(Object.keys(instance));\n const unique = [...new Set(methods)];\n\n steps.push({\n phase: 'sanity-check',\n pass: false,\n message: `Plugin does not implement the required methods for category \"${category}\". Available methods: [${unique.join(', ')}]`,\n });\n return steps;\n }\n\n steps.push({\n phase: 'sanity-check',\n pass: true,\n message: `Plugin passes sanity check for category \"${category}\"`,\n });\n\n return steps;\n}\n\n/**\n * When a MODULE_NOT_FOUND error is about a transitive dependency\n * (not the plugin itself), extract the missing module name.\n */\nfunction parseMissingDependency(message: string, pluginPath: string): string | null {\n const match = message.match(/Cannot find module '([^']+)'/);\n if (match && match[1] && !match[1].includes(pluginPath)) {\n return match[1];\n }\n return null;\n}\n"],"mappings":";;;;;;;;AAWA,IAAM,QAAQ,WAAW,uCAAuC;AAGhE,IAAM,gBAAgB,cACpB,OAAO,eAAe,cAAc,aAAa,YAAY,GAC/D;AAEA,SAAS,cAAc,QAAsB;CAC3C,OAAO,OAAO,WAAW,cAAc,OAAO,QAAQ,YAAY;AACpE;AAEA,SAAS,MAAM,QAAsB;CACnC,OAAO,UAAU,OAAO,WAAW,YAAY,aAAa;AAC9D;;;;;AAMA,SAAgB,kBAAkB,SAAyB;CACzD,MAAM,UAAU,KAAK,SAAS,cAAc;CAC5C,IAAI,WAAW,OAAO,GACpB,IAAI;EACF,MAAM,MAAM,KAAK,MAAM,aAAa,SAAS,OAAO,CAAC;EACrD,IAAI,IAAI,SAAS;GACf,MAAM,YAAY,IAAI,QAAQ;GAC9B,IAAI,OAAO,cAAc,UACvB,OAAO,KAAK,SAAS,SAAS;GAEhC,IAAI,WAAW,QAAQ,SACrB,OAAO,KAAK,SAAS,UAAU,OAAO,OAAO;GAE/C,IAAI,WAAW,UAAU,OAAO,UAAU,WAAW,UACnD,OAAO,KAAK,SAAS,UAAU,MAAM;GA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,OAAO;AACT"}
1
+ {"version":3,"file":"diagnostics.js","names":[],"sources":["../src/diagnostics.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport { existsSync, readFileSync } from 'node:fs';\nimport { createRequire } from 'node:module';\nimport { join, resolve } from 'node:path';\nimport { pathToFileURL } from 'node:url';\n\nimport { PLUGIN_PREFIX } from '@verdaccio/core';\n\nimport { getSanityCheck } from './sanity-checks';\nimport type { DiagnosticStep, VerifyPluginOptions } from './types';\n\nconst debug = buildDebug('verdaccio:plugin:verifier:diagnostics');\n\nconst requireModule = createRequire(import.meta.filename);\n\nfunction isValidExport(plugin: any): boolean {\n return typeof plugin === 'function' || typeof plugin?.default === 'function';\n}\n\nfunction isES6(plugin: any): boolean {\n return plugin && typeof plugin === 'object' && 'default' in plugin;\n}\n\n/**\n * Resolve the ESM entry point for a directory-based plugin.\n * import() doesn't support directory imports, so we resolve via package.json.\n */\nexport function resolveEntryPoint(dirPath: string): string {\n const pkgPath = join(dirPath, 'package.json');\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));\n if (pkg.exports) {\n const dotExport = pkg.exports['.'];\n if (typeof dotExport === 'string') {\n return join(dirPath, dotExport);\n }\n if (dotExport?.import?.default) {\n return join(dirPath, dotExport.import.default);\n }\n if (dotExport?.import && typeof dotExport.import === 'string') {\n return join(dirPath, dotExport.import);\n }\n if (dotExport?.default) {\n return join(dirPath, dotExport.default);\n }\n }\n if (pkg.module) {\n return join(dirPath, pkg.module);\n }\n if (pkg.main) {\n return join(dirPath, pkg.main);\n }\n } catch {\n // fall through\n }\n }\n return join(dirPath, 'index.js');\n}\n\n/**\n * Try to load a module, falling back from require() to import() for ESM.\n * Handles CJS require(), ESM require() shim errors (bundlers), and\n * ERR_REQUIRE_ESM — always falls through to dynamic import() on any\n * require() failure.\n */\nasync function tryResolve(modulePath: string): Promise<{ module: any; error?: string }> {\n // Try require() first (fast path for CJS modules)\n try {\n return { module: requireModule(modulePath) };\n } catch (requireErr: any) {\n debug('require() failed for %o: %s — trying dynamic import', modulePath, requireErr.message);\n }\n\n // Fallback to dynamic import() for ESM modules\n try {\n let importPath = modulePath;\n if (existsSync(modulePath) && existsSync(join(modulePath, 'package.json'))) {\n importPath = resolveEntryPoint(modulePath);\n debug('resolved ESM entry point: %o', importPath);\n }\n const importUrl = importPath.startsWith('/') ? pathToFileURL(importPath).href : importPath;\n const mod = await import(importUrl);\n return { module: mod };\n } catch (importErr: any) {\n return { module: null, error: importErr.message };\n }\n}\n\n/**\n * Runs step-by-step diagnostics to identify exactly which phase of\n * plugin loading fails. This replicates the same resolution logic\n * as `asyncLoadPlugin` but tests each step independently.\n */\nexport async function runDiagnostics(options: VerifyPluginOptions): Promise<DiagnosticStep[]> {\n const {\n pluginPath,\n category,\n pluginConfig = {},\n sanityCheck: customSanityCheck,\n prefix = PLUGIN_PREFIX,\n pluginsFolder,\n } = options;\n\n const steps: DiagnosticStep[] = [];\n const isScoped = pluginPath.startsWith('@') && pluginPath.includes('/');\n const pluginName = isScoped ? pluginPath : `${prefix}-${pluginPath}`;\n\n debug('running diagnostics for %o (resolved name: %o)', pluginPath, pluginName);\n\n // --- Phase 1: Resolve ---\n let pluginModule: any = null;\n let resolvedFrom = '';\n\n // Try plugins folder first\n if (pluginsFolder) {\n const absFolder = resolve(pluginsFolder);\n const pluginDir = join(absFolder, pluginName);\n debug('checking plugins folder: %o', pluginDir);\n\n if (!existsSync(absFolder)) {\n steps.push({\n phase: 'resolve',\n pass: false,\n message: `Plugins folder does not exist: ${absFolder}`,\n });\n return steps;\n }\n\n if (!existsSync(pluginDir)) {\n debug('plugin directory not found: %o', pluginDir);\n steps.push({\n phase: 'resolve',\n pass: false,\n message: `Plugin directory not found: ${pluginDir} — expected a folder named \"${pluginName}\" inside \"${absFolder}\"`,\n });\n return steps;\n }\n\n const result = await tryResolve(pluginDir);\n if (result.module) {\n pluginModule = result.module;\n resolvedFrom = pluginDir;\n debug('resolved from plugins folder: %o', pluginDir);\n } else {\n const missingDep = parseMissingDependency(result.error ?? '', pluginDir);\n steps.push({\n phase: 'resolve',\n pass: false,\n message: missingDep\n ? `Plugin found at ${pluginDir} but has a missing dependency: ${missingDep}`\n : `Plugin found at ${pluginDir} but failed to load: ${result.error}`,\n });\n return steps;\n }\n }\n\n // Try node_modules if not found in plugins folder\n if (!pluginModule) {\n const result = await tryResolve(pluginName);\n if (result.module) {\n pluginModule = result.module;\n resolvedFrom = pluginName;\n debug('resolved from node_modules: %o', pluginName);\n } else {\n const missingDep = parseMissingDependency(result.error ?? '', pluginName);\n steps.push({\n phase: 'resolve',\n pass: false,\n message: missingDep\n ? `Package \"${pluginName}\" found but has a missing dependency: ${missingDep}`\n : `Package \"${pluginName}\" not found in node_modules — try: npm install ${pluginName}`,\n });\n return steps;\n }\n }\n\n steps.push({\n phase: 'resolve',\n pass: true,\n message: `Module resolved from ${resolvedFrom}`,\n });\n\n // --- Phase 2: Export validation ---\n if (!isValidExport(pluginModule)) {\n const exportKeys = pluginModule ? Object.keys(pluginModule).join(', ') : 'none';\n steps.push({\n phase: 'export',\n pass: false,\n message: `Module does not export a function or class (default export). Exported keys: [${exportKeys}]`,\n });\n return steps;\n }\n\n const moduleType = isES6(pluginModule) ? 'ES6 (default export)' : 'CommonJS (factory function)';\n steps.push({\n phase: 'export',\n pass: true,\n message: `Valid ${moduleType} plugin export detected`,\n });\n\n // --- Phase 3: Instantiation ---\n let instance: any;\n try {\n if (isES6(pluginModule)) {\n instance = new pluginModule.default(pluginConfig, { config: pluginConfig, logger: console });\n } else {\n instance = pluginModule(pluginConfig, { config: pluginConfig, logger: console });\n }\n } catch (err: any) {\n steps.push({\n phase: 'instantiate',\n pass: false,\n message: `Plugin threw during instantiation: ${err.message}`,\n });\n return steps;\n }\n\n if (!instance || (typeof instance !== 'object' && typeof instance !== 'function')) {\n steps.push({\n phase: 'instantiate',\n pass: false,\n message: `Plugin constructor/factory returned ${instance === null ? 'null' : typeof instance} instead of an object`,\n });\n return steps;\n }\n\n steps.push({\n phase: 'instantiate',\n pass: true,\n message: 'Plugin instantiated successfully',\n });\n\n // --- Phase 4: Sanity check ---\n const sanityCheck = customSanityCheck ?? getSanityCheck(category);\n const passed = sanityCheck(instance);\n\n if (!passed) {\n const methods = Object.getOwnPropertyNames(Object.getPrototypeOf(instance) ?? {})\n .filter((m) => m !== 'constructor')\n .concat(Object.keys(instance));\n const unique = [...new Set(methods)];\n\n steps.push({\n phase: 'sanity-check',\n pass: false,\n message: `Plugin does not implement the required methods for category \"${category}\". Available methods: [${unique.join(', ')}]`,\n });\n return steps;\n }\n\n steps.push({\n phase: 'sanity-check',\n pass: true,\n message: `Plugin passes sanity check for category \"${category}\"`,\n });\n\n return steps;\n}\n\n/**\n * When a MODULE_NOT_FOUND error is about a transitive dependency\n * (not the plugin itself), extract the missing module name.\n */\nfunction parseMissingDependency(message: string, pluginPath: string): string | null {\n const match = message.match(/Cannot find module '([^']+)'/);\n if (match && match[1] && !match[1].includes(pluginPath)) {\n return match[1];\n }\n return null;\n}\n"],"mappings":";;;;;;;;AAWA,IAAM,QAAQ,WAAW,uCAAuC;AAEhE,IAAM,gBAAgB,cAAc,YAAY,QAAQ;AAExD,SAAS,cAAc,QAAsB;CAC3C,OAAO,OAAO,WAAW,cAAc,OAAO,QAAQ,YAAY;AACpE;AAEA,SAAS,MAAM,QAAsB;CACnC,OAAO,UAAU,OAAO,WAAW,YAAY,aAAa;AAC9D;;;;;AAMA,SAAgB,kBAAkB,SAAyB;CACzD,MAAM,UAAU,KAAK,SAAS,cAAc;CAC5C,IAAI,WAAW,OAAO,GACpB,IAAI;EACF,MAAM,MAAM,KAAK,MAAM,aAAa,SAAS,OAAO,CAAC;EACrD,IAAI,IAAI,SAAS;GACf,MAAM,YAAY,IAAI,QAAQ;GAC9B,IAAI,OAAO,cAAc,UACvB,OAAO,KAAK,SAAS,SAAS;GAEhC,IAAI,WAAW,QAAQ,SACrB,OAAO,KAAK,SAAS,UAAU,OAAO,OAAO;G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AI,SAAS,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC,SAAS,UAAU,GACpD,OAAO,MAAM;CAEf,OAAO;AACT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@verdaccio/plugin-verifier",
3
- "version": "1.0.0-next-9.26",
3
+ "version": "1.0.0-next-9.28",
4
4
  "description": "Tool to verify that a Verdaccio plugin can be loaded and passes sanity checks",
5
5
  "type": "module",
6
6
  "main": "./build/index.js",
@@ -33,16 +33,16 @@
33
33
  "node": ">=24"
34
34
  },
35
35
  "dependencies": {
36
- "@verdaccio/core": "9.0.0-next-9.30",
37
- "@verdaccio/loaders": "9.0.0-next-9.30",
38
- "@verdaccio/logger": "9.0.0-next-9.30",
36
+ "@verdaccio/core": "9.0.0-next-9.32",
37
+ "@verdaccio/loaders": "9.0.0-next-9.32",
38
+ "@verdaccio/logger": "9.0.0-next-9.32",
39
39
  "clipanion": "4.0.0-rc.4",
40
40
  "debug": "4.4.3"
41
41
  },
42
42
  "devDependencies": {
43
43
  "rimraf": "6.1.3",
44
- "vite": "8.2.1",
45
- "vitest": "4.1.10"
44
+ "vite": "8.2.2",
45
+ "vitest": "4.1.11"
46
46
  },
47
47
  "funding": {
48
48
  "type": "opencollective",