Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 79 additions & 79 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,79 +1,79 @@
{
"name": "@nodesecure/report",
"version": "4.1.1",
"description": "NodeSecure HTML & PDF graphic security report",
"main": "./dist/src/index.js",
"type": "module",
"bin": {
"nreport": "./dist/bin/index.js"
},
"exports": {
".": {
"import": "./dist/src/index.js"
}
},
"scripts": {
"build": "tsc && npm run build:views && npm run build:public",
"build:views": "rimraf dist/views && cp -r views dist/views",
"build:public": "rimraf dist/public && cp -r public dist/public",
"lint": "eslint src test bin scripts",
"test-only": "node --test-reporter=spec --test ./test/**/*.spec.ts",
"test": "c8 --all --src ./src -r html npm run test-only",
"test:e2e": "node --env-file-if-exists=.env --test-reporter=spec --test ./test/**/*.e2e-spec.ts",
"preview:light": "node --no-warnings ./scripts/preview.ts --theme light",
"preview:dark": "node --no-warnings ./scripts/preview.ts --theme dark",
"prepublishOnly": "npm run build"
},
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public",
"provenance": true
},
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/NodeSecure/report.git"
},
"keywords": [
"security",
"report",
"nodesecure",
"pdf",
"html",
"chart"
],
"author": "NodeSecure",
"license": "MIT",
"bugs": {
"url": "https://github.com/NodeSecure/report/issues"
},
"homepage": "https://github.com/NodeSecure/report#readme",
"dependencies": {
"@nodesecure/flags": "^3.0.3",
"@nodesecure/ossf-scorecard-sdk": "^3.2.1",
"@nodesecure/rc": "^5.0.0",
"@nodesecure/scanner": "^10.0.0",
"@nodesecure/utils": "^2.2.0",
"@openally/mutex": "^2.0.0",
"@topcli/spinner": "^4.0.0",
"esbuild": "^0.27.0",
"filenamify": "^7.0.0",
"puppeteer": "^24.10.1",
"sade": "^1.8.1",
"zup": "0.0.2"
},
"devDependencies": {
"@openally/config.eslint": "^2.1.0",
"@openally/config.typescript": "1.2.1",
"@types/node": "^25.0.0",
"c8": "^11.0.0",
"open": "^11.0.0",
"rimraf": "^6.0.1",
"typescript": "^5.7.2"
},
"engines": {
"node": ">=24"
}
}
{
"name": "@nodesecure/report",
"version": "4.1.1",
"description": "NodeSecure HTML & PDF graphic security report",
"main": "./dist/src/index.js",
"type": "module",
"bin": {
"nreport": "./dist/bin/index.js"
},
"exports": {
".": {
"import": "./dist/src/index.js"
}
},
"scripts": {
"build": "tsc && npm run build:views && npm run build:public",
"build:views": "rimraf dist/views && cp -r views dist/views",
"build:public": "rimraf dist/public && cp -r public dist/public",
"lint": "eslint src test bin scripts",
"test-only": "node --test-reporter=spec --test ./test/**/*.spec.ts",
"test": "c8 --all --src ./src -r html npm run test-only",
"test:e2e": "node --env-file-if-exists=.env --test-reporter=spec --test ./test/**/*.e2e-spec.ts",
"preview:light": "node --no-warnings ./scripts/preview.ts --theme light",
"preview:dark": "node --no-warnings ./scripts/preview.ts --theme dark",
"prepublishOnly": "npm run build"
},
"publishConfig": {
"registry": "https://registry.npmjs.org",
"access": "public",
"provenance": true
},
"files": [
"dist"
],
"repository": {
"type": "git",
"url": "git+https://github.com/NodeSecure/report.git"
},
"keywords": [
"security",
"report",
"nodesecure",
"pdf",
"html",
"chart"
],
"author": "NodeSecure",
"license": "MIT",
"bugs": {
"url": "https://github.com/NodeSecure/report/issues"
},
"homepage": "https://github.com/NodeSecure/report#readme",
"dependencies": {
"@nodesecure/flags": "^3.0.3",
"@nodesecure/ossf-scorecard-sdk": "^3.2.1",
"@nodesecure/rc": "^5.0.0",
"@nodesecure/scanner": "10.5.1",
"@nodesecure/utils": "^2.2.0",
"@openally/mutex": "^2.0.0",
"@topcli/spinner": "^4.0.0",
"esbuild": "^0.27.0",
"filenamify": "^7.0.0",
"puppeteer": "^24.10.1",
"sade": "^1.8.1",
"zup": "0.0.2"
},
"devDependencies": {
"@openally/config.eslint": "2.4.2",
"@openally/config.typescript": "1.2.1",
"@types/node": "^25.0.0",
"c8": "^11.0.0",
"open": "^11.0.0",
"rimraf": "^6.0.1",
"typescript": "^5.7.2"
},
"engines": {
"node": ">=24"
}
}
10 changes: 3 additions & 7 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
// Import Node.js Dependencies
import path from "node:path";
import { fileURLToPath } from "node:url";

// Import Third-party Dependencies
import * as rc from "@nodesecure/rc";

// CONSTANTS
const __dirname = path.dirname(fileURLToPath(import.meta.url));

export const DIRS = Object.freeze({
JSON: path.join(rc.homedir(), "json"),
CLONES: path.join(rc.homedir(), "clones"),
PUBLIC: path.join(__dirname, "..", "public"),
THEMES: path.join(__dirname, "..", "public", "css", "themes"),
VIEWS: path.join(__dirname, "..", "views"),
PUBLIC: path.join(import.meta.dirname, "..", "public"),
THEMES: path.join(import.meta.dirname, "..", "public", "css", "themes"),
VIEWS: path.join(import.meta.dirname, "..", "views"),
REPORTS: path.join(process.cwd(), "reports")
});
4 changes: 1 addition & 3 deletions test/commands/execute.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Import Node.js Dependencies
import { fileURLToPath } from "node:url";
import path from "node:path";
import fs from "node:fs/promises";
import { afterEach, describe, it } from "node:test";
Expand All @@ -11,8 +10,7 @@ import { filterProcessStdout } from "../helpers/reportCommandRunner.ts";
import * as CONSTANTS from "../../src/constants.ts";

// CONSTANTS
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const kProcessDir = path.join(__dirname, "../..");
const kProcessDir = path.join(import.meta.dirname, "../..");

describe("Report execute command", () => {
afterEach(async() => await fs.rm(CONSTANTS.DIRS.CLONES, {
Expand Down
4 changes: 1 addition & 3 deletions test/commands/initialize.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// Import Node.js Dependencies
import { fileURLToPath } from "node:url";
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
Expand All @@ -11,8 +10,7 @@ import { stripVTControlCharacters } from "node:util";
import { runProcess } from "../helpers/reportCommandRunner.ts";

// CONSTANTS
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const kBinDir = path.join(__dirname, "../..", "dist/bin/index.ts");
const kBinDir = path.join(import.meta.dirname, "../..", "dist/bin/index.ts");
const kProcessDir = os.tmpdir();
const kConfigFilePath = path.join(kProcessDir, ".nodesecurerc");

Expand Down
11 changes: 11 additions & 0 deletions test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"rootDir": "..",
"noEmit": true
},
"include": [
"../src",
"."
]
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": "@openally/config.typescript/esm-ts-next",
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
"types": ["node"]
},
"include": [
"src",
Expand Down
Loading