@@ -12,7 +12,8 @@ import type { MainOptions } from '../util/create-options.ts';
1212import { getPackageNameFromModuleSpecifier } from '../util/modules.ts' ;
1313import { perfObserver } from '../util/Performance.ts' ;
1414import { findMatch } from '../util/regex.ts' ;
15- import { getShouldIgnoreHandler , getShouldIgnoreTagHandler } from '../util/tag.ts' ;
15+ import { getShouldIgnoreHandler , getShouldIgnoreTagHandler , isAlwaysIgnored } from '../util/tag.ts' ;
16+ import { INTERNAL_TAG } from '../constants.ts' ;
1617
1718interface AnalyzeOptions {
1819 analyzedFiles : Set < string > ;
@@ -97,10 +98,11 @@ export const analyze = async ({
9798 const importsForExport = file . importedBy ;
9899
99100 for ( const [ identifier , exportedItem ] of exportItems ) {
100- // Skip tagged exports
101- if ( shouldIgnore ( exportedItem . jsDocTags ) ) continue ;
101+ // Skip exports tagged @public / @beta / @alias entirely (no refs check)
102+ if ( isAlwaysIgnored ( exportedItem . jsDocTags ) ) continue ;
102103
103- const isIgnored = shouldIgnoreTags ( exportedItem . jsDocTags ) ;
104+ const isInternalProd = options . isProduction && exportedItem . jsDocTags . has ( INTERNAL_TAG ) ;
105+ const isIgnored = shouldIgnoreTags ( exportedItem . jsDocTags ) || isInternalProd ;
104106
105107 if ( importsForExport ) {
106108 const [ isReferenced , reExportingEntryFile ] = explorer . isReferenced ( filePath , identifier , {
@@ -112,7 +114,7 @@ export const analyze = async ({
112114 ( isReferenced || isReferencedInUsedExport ( exportedItem , filePath , isIncludeEntryExports ) )
113115 ) {
114116 for ( const tagName of exportedItem . jsDocTags ) {
115- if ( options . tags [ 1 ] . includes ( tagName ) ) {
117+ if ( options . tags [ 1 ] . includes ( tagName ) || ( isInternalProd && tagName === INTERNAL_TAG ) ) {
116118 collector . addTagHint ( { type : 'tag' , filePath, identifier, tagName } ) ;
117119 }
118120 }
@@ -233,7 +235,8 @@ export const analyze = async ({
233235 for ( const extImport of file . imports . external ) {
234236 const packageName = getPackageNameFromModuleSpecifier ( extImport . specifier ) ;
235237 const isHandled =
236- packageName && deputy . maybeAddReferencedExternalDependency ( ws , packageName , undefined , extImport . isTypeOnly ) ;
238+ packageName &&
239+ deputy . maybeAddReferencedExternalDependency ( ws , packageName , undefined , extImport . isTypeOnly ) ;
237240 if ( ! isHandled )
238241 collector . addIssue ( {
239242 type : 'unlisted' ,
0 commit comments