Resolve frontend Qodana critical and high findings (#176)
Resolve recommended-profile Critical and High findings, update vulnerable dependencies, restore invoice queue E2E authentication setup, and clear the remaining frontend Qodana findings.
This commit is contained in:
+19
-9
@@ -245,21 +245,27 @@ function patchBuefyCssMediaQuery() {
|
||||
function releaseEntryManifest() {
|
||||
return {
|
||||
name: 'release-entry-manifest',
|
||||
generateBundle(_, bundle) {
|
||||
writeBundle(options, bundle) {
|
||||
const chunks = Object.values(bundle).filter((item) => item.type === 'chunk')
|
||||
const isMainModuleId = (moduleId) =>
|
||||
String(moduleId || '').replace(/\\/g, '/').endsWith('/src/main.js')
|
||||
const mainChunk = chunks.find((chunk) =>
|
||||
String(chunk.facadeModuleId || '').replace(/\\/g, '/').endsWith('/src/main.js')
|
||||
) || chunks.find((chunk) => chunk.name === 'main' && /^assets\/main-[\w-]+\.js$/.test(chunk.fileName))
|
||||
isMainModuleId(chunk.facadeModuleId) ||
|
||||
Array.from(chunk.moduleIds || []).some(isMainModuleId)
|
||||
) || chunks.find((chunk) => chunk.isEntry)
|
||||
if (!mainChunk) {
|
||||
this.warn('Could not find src/main.js chunk for release-entry.json')
|
||||
return
|
||||
}
|
||||
|
||||
const css = Array.from(mainChunk.viteMetadata?.importedCss || [])
|
||||
this.emitFile({
|
||||
type: 'asset',
|
||||
fileName: 'release-entry.json',
|
||||
source: JSON.stringify(
|
||||
const configuredOutputDirectory = options.dir || 'dist'
|
||||
const outputDirectory = path.isAbsolute(configuredOutputDirectory)
|
||||
? configuredOutputDirectory
|
||||
: fromProjectRoot(configuredOutputDirectory)
|
||||
fs.writeFileSync(
|
||||
path.join(outputDirectory, 'release-entry.json'),
|
||||
JSON.stringify(
|
||||
{
|
||||
entry: mainChunk.fileName,
|
||||
css
|
||||
@@ -267,7 +273,7 @@ function releaseEntryManifest() {
|
||||
null,
|
||||
2
|
||||
)
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -341,7 +347,11 @@ function releaseMetadataManifest() {
|
||||
? config.build.outDir
|
||||
: path.resolve(config.root, config.build.outDir)
|
||||
},
|
||||
closeBundle() {
|
||||
writeBundle(options) {
|
||||
const configuredOutputDirectory = options.dir || outputDirectory
|
||||
outputDirectory = path.isAbsolute(configuredOutputDirectory)
|
||||
? configuredOutputDirectory
|
||||
: fromProjectRoot(configuredOutputDirectory)
|
||||
const releaseEntryPath = path.join(outputDirectory, 'release-entry.json')
|
||||
const indexPath = path.join(outputDirectory, 'index.html')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user