From afa87af01c79a9baa539f2992d32154d2a4739bd Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 14 Feb 2026 14:46:37 -0800 Subject: task: delete vanilla js prototype\n\n- Removed vanilla/ directory and web/dist/vanilla directory\n- Updated Makefile, Dockerfile, and CI workflow to remove vanilla references\n- Cleaned up web/web.go to remove vanilla embed and routes\n- Verified build and tests pass\n\nCloses NK-2tcnmq --- .../istanbul-reports/lib/html-spa/index.js | 176 --------------------- 1 file changed, 176 deletions(-) delete mode 100644 vanilla/node_modules/istanbul-reports/lib/html-spa/index.js (limited to 'vanilla/node_modules/istanbul-reports/lib/html-spa/index.js') diff --git a/vanilla/node_modules/istanbul-reports/lib/html-spa/index.js b/vanilla/node_modules/istanbul-reports/lib/html-spa/index.js deleted file mode 100644 index 4ce9d7e..0000000 --- a/vanilla/node_modules/istanbul-reports/lib/html-spa/index.js +++ /dev/null @@ -1,176 +0,0 @@ -'use strict'; -/* - Copyright 2012-2015, Yahoo Inc. - Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. - */ -const fs = require('fs'); -const path = require('path'); -const { ReportBase } = require('istanbul-lib-report'); -const HtmlReport = require('../html'); - -const standardLinkMapper = { - getPath(node) { - if (typeof node === 'string') { - return node; - } - let filePath = node.getQualifiedName(); - if (node.isSummary()) { - if (filePath !== '') { - filePath += '/index.html'; - } else { - filePath = 'index.html'; - } - } else { - filePath += '.html'; - } - return filePath; - }, - - relativePath(source, target) { - const targetPath = this.getPath(target); - const sourcePath = path.dirname(this.getPath(source)); - return path.relative(sourcePath, targetPath); - }, - - assetPath(node, name) { - return this.relativePath(this.getPath(node), name); - } -}; - -class HtmlSpaReport extends ReportBase { - constructor(opts = {}) { - super({ - // force the summarizer to nested for html-spa - summarizer: 'nested' - }); - - this.verbose = opts.verbose || false; - this.linkMapper = opts.linkMapper || standardLinkMapper; - this.subdir = opts.subdir || ''; - this.date = Date(); - this.skipEmpty = opts.skipEmpty; - this.htmlReport = new HtmlReport(opts); - this.htmlReport.getBreadcrumbHtml = function() { - return 'Back'; - }; - - this.metricsToShow = opts.metricsToShow || [ - 'lines', - 'branches', - 'functions' - ]; - } - - getWriter(context) { - if (!this.subdir) { - return context.writer; - } - return context.writer.writerForDir(this.subdir); - } - - onStart(root, context) { - this.htmlReport.onStart(root, context); - - const writer = this.getWriter(context); - const srcDir = path.resolve(__dirname, './assets'); - fs.readdirSync(srcDir).forEach(f => { - const resolvedSource = path.resolve(srcDir, f); - const resolvedDestination = '.'; - const stat = fs.statSync(resolvedSource); - let dest; - - if (stat.isFile()) { - dest = resolvedDestination + '/' + f; - if (this.verbose) { - console.log('Write asset: ' + dest); - } - writer.copyFile(resolvedSource, dest); - } - }); - } - - onDetail(node, context) { - this.htmlReport.onDetail(node, context); - } - - getMetric(metric, type, context) { - const isEmpty = metric.total === 0; - return { - total: metric.total, - covered: metric.covered, - skipped: metric.skipped, - missed: metric.total - metric.covered, - pct: isEmpty ? 0 : metric.pct, - classForPercent: isEmpty - ? 'empty' - : context.classForPercent(type, metric.pct) - }; - } - - toDataStructure(node, context) { - const coverageSummary = node.getCoverageSummary(); - const metrics = { - statements: this.getMetric( - coverageSummary.statements, - 'statements', - context - ), - branches: this.getMetric( - coverageSummary.branches, - 'branches', - context - ), - functions: this.getMetric( - coverageSummary.functions, - 'functions', - context - ), - lines: this.getMetric(coverageSummary.lines, 'lines', context) - }; - - return { - file: node.getRelativeName(), - isEmpty: coverageSummary.isEmpty(), - metrics, - children: - node.isSummary() && - node - .getChildren() - .map(child => this.toDataStructure(child, context)) - }; - } - - onEnd(rootNode, context) { - const data = this.toDataStructure(rootNode, context); - - const cw = this.getWriter(context).writeFile( - this.linkMapper.getPath(rootNode) - ); - - cw.write( - ` - - - - - - -
- - - - ` - ); - cw.close(); - } -} - -module.exports = HtmlSpaReport; -- cgit v1.2.3