@travetto/manifest
Advanced tools
Comparing version 4.0.1 to 4.0.2
{ | ||
"name": "@travetto/manifest", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"description": "Support for project indexing, manifesting, along with file watching", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -29,2 +29,13 @@ import fs from 'node:fs/promises'; | ||
const SUPPORT_FILE_MAP: Record<string, ManifestModuleRole> = { | ||
transformer: 'compile', | ||
compile: 'compile', | ||
test: 'test', | ||
doc: 'doc', | ||
pack: 'build', | ||
FILEld: 'build' | ||
}; | ||
const SUPPORT_FILE_RE = new RegExp(`^support[/](?<name>${Object.keys(SUPPORT_FILE_MAP).join('|')})[./]`); | ||
export class ManifestModuleUtil { | ||
@@ -125,5 +136,6 @@ | ||
static getFileRole(moduleFile: string): ManifestModuleRole | undefined { | ||
if (moduleFile.startsWith('support/transform')) { | ||
return 'compile'; | ||
} else if (moduleFile.startsWith('support/test/') || moduleFile.startsWith('test/')) { | ||
const matched = SUPPORT_FILE_MAP[moduleFile.match(SUPPORT_FILE_RE)?.groups?.name ?? '']; | ||
if (matched) { | ||
return matched; | ||
} else if (moduleFile.startsWith('test/')) { | ||
return 'test'; | ||
@@ -149,3 +161,3 @@ } else if (moduleFile.startsWith('doc/') || /^DOC[.]tsx?$/.test(moduleFile)) { | ||
return 'support/resources'; | ||
} else if (moduleFile.startsWith('support/transform')) { | ||
} else if (/^support\/transformer[./]/.test(moduleFile)) { | ||
return '$transformer'; | ||
@@ -152,0 +164,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
71814
1622