-
-## 📜 Features
-
-- Run a static scan on every JavaScript files and sort out warnings (unsafe-regex, unsafe-import etc) and the complete list of required expr and statements (files, node.js module, etc.).
-- Return complete composition for each packages (extensions, files, tarball size, etc).
-- Packages metadata from the npm registry API (number of releases, last publish date, maintainers etc).
-- Search for licenses files in the tarball and return the [SPDX](https://spdx.org/licenses/) expression conformance of each detected licenses.
-- Link vulnerabilities from the multiple sources like GitHub Advisory, Sonatype or Snyk using [Vulnera](https://github.com/NodeSecure/vulnera).
-- Add flags (emojis) to each packages versions to identify well known patterns and potential security threats easily.
-- First-class support of open source security initiatives like [OpenSSF Scorecard](https://github.com/ossf/scorecard).
-- Generate security report (PDF).
-
-## 🚧 Requirements
-
-- [Node.js](https://nodejs.org/en/) v24 or higher
+**NodeSecure** is a Node.js CLI (`nsecure`) that performs a static and deep analysis of a package's dependency tree: AST-based scanning for malicious or unsafe patterns, npm registry metadata, license conformance, vulnerability aggregation (GitHub Advisory, Sonatype, Snyk) and [OpenSSF Scorecard](https://github.com/ossf/scorecard), all rendered through an interactive dependency graph with a PDF report generator.
## 💃 Getting Started
```bash
$ npm install @nodesecure/cli -g
-```
-
-or
-
-```bash
-$ git clone https://github.com/NodeSecure/cli.git
-$ cd cli
-
-$ npm install
-# bundle/compile front-end assets
-$ npm run build
-$ npm link
-```
-
-Then the **nsecure** binary will be available in your terminal. Give a try with the popular [express](http://expressjs.com/) package. This will automatically open the webpage in your default system browser.
-```bash
$ nsecure auto express
```
-> [!TIP]
-> Setup an [npm token](https://github.com/NodeSecure/cli#private-packages--registry) to avoid hiting the maximum request limit of the npm registry API.
+This repository is a monorepo. The `@nodesecure/cli` package, along with its full feature list, command documentation, configuration and FAQ, lives in the [workspaces/cli](./workspaces/cli) workspace — head there for everything about installing and using the CLI.
-## 👀 Usage example
+## 📦 Workspaces
-```bash
-# Run a scan on the current working dir
-# Note: must have a package.json or node_modules directory
-$ nsecure cwd
-
-# Run a scan on a remote 'npm' package
-$ nsecure from mocha
-```
-
-Then a `nsecure-result.json` will be writted at the current CLI location. To open it on a web page just run
-
-```bash
-$ nsecure open
-```
+| name | package and link |
+| --- | --- |
+| cli | [@nodesecure/cli](./workspaces/cli) |
+| documentation-ui | [@nodesecure/documentation-ui](./workspaces/documentation-ui) |
+| vis-network | [@nodesecure/vis-network](./workspaces/vis-network) |
+| size-satisfies | [@nodesecure/size-satisfies](./workspaces/size-satisfies) |
+| server | [@nodesecure/server](./workspaces/server) |
+| cache | [@nodesecure/cache](./workspaces/cache) |
-### Command Documentation
+These packages are available in the Node Package Repository and can be easily installed with [npm](https://docs.npmjs.com/getting-started/what-is-npm) or [yarn](https://yarnpkg.com), for example:
-The CLI includes built-in documentation accessible with the --help option:
```bash
-$ nsecure --help
-$ nsecure --help
+$ npm i @nodesecure/documentation-ui
+# or
+$ yarn add @nodesecure/documentation-ui
```
-For complete details on each command, refer to the following documents:
-
-- [`cwd`](./docs/cli/cwd.md)
-- [`from`](./docs/cli/from.md)
-- [`auto`](./docs/cli/auto.md)
-- [`open`](./docs/cli/open.md)
-- [`verify`](./docs/cli/verify.md)
-- [`summary`](./docs/cli/summary.md)
-- [`scorecard`](./docs/cli/scorecard.md)
-- [`report`](./docs/cli/report.md)
-- [`lang`](./docs/cli/lang.md)
-- [`config create`](./docs/cli/config.md)
-- [`config`](./docs/cli/config.md)
-- [`cache`](./docs/cli/cache.md)
-- [`extract integrity`](./docs/cli/extract-integrity.md)
-- [`stats`](./docs/cli/stats.md)
-- [re-highlight](./docs/cli/re-highlight.md)
-
-Each link provides access to the full documentation for the command, including additional details, options, and usage examples.
+## 🙏 Contributing
-## Private registry / Verdaccio
+If you are a developer **looking to contribute** to the project, please first read our [CONTRIBUTING](./CONTRIBUTING.md) guide (Code of Conduct, first-contributor guide, Developer's Certificate of Origin, Discord).
-NodeSecure allow you to fetch stats on private npm packages by setting up a `NODE_SECURE_TOKEN` env variable (which must contains an [npm token](https://docs.npmjs.com/creating-and-viewing-authentication-tokens)).
-
-> [!TIP]
-> If you `npm link` the package by yourself you can create a `.env` file at the root of the project too.
-
-NodeSecure is capable to work behind a custom private npm registry too by searching the default registry URL in your local npm configuration.
+### Local Setup
```bash
-$ npm config get registry
-$ npm config set registry "http://your-registry/"
-```
-
-## API
-Our back-end scanner package is available [here](https://github.com/NodeSecure/scanner).
-
-## Flags legends
-
-Flags and emojis legends are documented [here](https://github.com/NodeSecure/flags/blob/main/FLAGS.md).
-
-## Search command
-
-Press `Cmd+K` (macOS) or `Ctrl+K` (Windows/Linux) from the network view to open the search command. It lets you filter the dependency graph using one or more criteria simultaneously.
-
-Type a package name directly to search, or prefix with a filter name followed by `:` to use a specific filter:
-
-- `package` — **default when no prefix is given**, matches by name.
-- `version` — semver range (e.g. `>=1.2.0`, `^2.0.0`).
-- `flag` — select from the list of flags present in the current tree.
-- `license` — SPDX identifier (e.g. `MIT`, `Apache-2.0`).
-- `author` — author name or email.
-- `ext` — file extension present in the package (e.g. `.js`, `.ts`).
-- `builtin` — Node.js core module used by the package (e.g. `fs`, `path`).
-- `size` — size range (see [size-satisfies](https://github.com/NodeSecure/size-satisfies#usage-example), e.g. `>50kb`, `10kb..200kb`).
-- `highlighted` — all highlighted packages by default.
-
-## FAQ
-
-### Why some nodes are red in the UI ?
-Nodes are highlighted in red when the project/package is flagged with 🔬 `hasMinifiedCode` or ⚠️ `hasWarnings`. You can deactivate specific warnings in the options if desired.
-
-### Why the package size is so different from Bundlephobia ?
-The back-end scanner will analyze the complete size of the npm tarball without any filters or specific optimizations. In contrast, Bundlephobia will bundle the package and remove most of the unnecessary files from the tarball, such as documentation and other non-essential items.
-
-### Why some packages don't have OSSF Scorecard ?
-See [Scorecard Public Data](https://github.com/ossf/scorecard#public-data):
-
-> [!NOTE]
-> We run a weekly Scorecard scan of the 1 million most critical open source projects judged by their direct dependencies and publish the results in a BigQuery public dataset.
-
-## Contributors guide
-
-If you are a developer **looking to contribute** to the project, you must first read the [CONTRIBUTING](./CONTRIBUTING.md) guide.
-
-If you have already cloned and installed the project locally with npm, you still need to build and bundle front-end assets using the npm `build` script:
+$ git clone https://github.com/NodeSecure/cli.git
+$ cd cli
-```bash
+$ npm install
+# bundle/compile front-end assets for every workspace
$ npm run build
```
> [!IMPORTANT]
-> Restart this command when modifying files in the public root folder
+> Restart `npm run build` when modifying files under a workspace's public/front-end assets folder.
Once you have finished your development, check that the tests (and linter) are still good by running the following script:
@@ -192,7 +82,7 @@ $ npm test
### Publishing package and SLSA
-The package is published on [NPM with provenance](https://docs.npmjs.com/generating-provenance-statements), ensuring that this project is compliant with [SLSA Level 3](https://slsa.dev/spec/v0.1/levels?ref=fossa.com) standards. The build and publication process is managed through the GitHub [npm-provenance.yml](https://github.com/NodeSecure/cli/blob/master/.github/workflows/npm-provenance.yml) workflow, which is automatically triggered upon the creation of a new release.
+The `@nodesecure/cli` package is published on [NPM with provenance](https://docs.npmjs.com/generating-provenance-statements), ensuring that this project is compliant with [SLSA Level 3](https://slsa.dev/spec/v0.1/levels?ref=fossa.com) standards. The build and publication process is managed through the GitHub [npm-provenance.yml](https://github.com/NodeSecure/cli/blob/master/.github/workflows/npm-provenance.yml) workflow, which is automatically triggered upon the creation of a new release.
To create a local version of the package using npm and Git, follow these commands:
@@ -202,26 +92,7 @@ $ git commit -am "chore: x.x.x"
$ git push origin master --tags
```
-These commands will increment the package version, commit the changes, and push them along with the tags to the repository
-
-## Workspaces
-
-Click on one of the links to access the documentation of the workspace:
-
-| name | package and link |
-| --- | --- |
-| documentation-ui | [@nodesecure/documentation-ui](./workspaces/documentation-ui) |
-| vis-network | [@nodesecure/vis-network](./workspaces/vis-network) |
-| size-satisfies | [@nodesecure/size-satisfies](./workspaces/size-satisfies) |
-| server | [@nodesecure/server](./workspaces/server) |
-| cache | [@nodesecure/cache](./workspaces/cache) |
-
-These packages are available in the Node Package Repository and can be easily installed with [npm](https://docs.npmjs.com/getting-started/what-is-npm) or [yarn](https://yarnpkg.com).
-```bash
-$ npm i @nodesecure/documentation-ui
-# or
-$ yarn add @nodesecure/documentation-ui
-```
+These commands will increment the package version, commit the changes, and push them along with the tags to the repository.
## Contributors ✨
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 7bb434ca..cec7a9f1 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -5,7 +5,7 @@ import jsdoc from "eslint-plugin-jsdoc";
export default [
...ESLintConfig,
{
- files: ["public/**/*.js"],
+ files: ["workspaces/cli/public/**/*.js"],
plugins: {
jsdoc
},
diff --git a/package.json b/package.json
index a1de86f1..a7d2035c 100644
--- a/package.json
+++ b/package.json
@@ -1,132 +1,35 @@
{
- "name": "@nodesecure/cli",
- "version": "3.1.0",
- "description": "Node.js security CLI",
- "main": "./bin/index.js",
- "bin": {
- "node-secure": "./bin/check-and-run.js",
- "nsecure": "./bin/check-and-run.js"
- },
- "type": "module",
- "engines": {
- "node": ">=24"
- },
- "scripts": {
- "lint": "eslint bin src test workspaces public",
- "lint:css": "stylelint \"**/*.css\" \"public/**/*.js\"",
- "lint-fix": "npm run lint -- --fix",
- "prepublishOnly": "rimraf ./dist && npm run build && pkg-ok",
- "dev": "npm run build:workspaces && node ./esbuild.dev.config.ts",
- "build": "npm run build:workspaces && npm run build:front",
- "build:front": "node ./esbuild.config.ts",
- "build:workspaces": "npm run build --ws --if-present",
- "test": "npm run test:cli && npm run lint && npm run lint:css",
- "test:cli": "node --no-warnings --test \"test/**/*.test.js\"",
- "test:e2e": "playwright test",
- "test:all": "npm run test --ws --if-present",
- "coverage": "c8 --reporter=lcov npm run test",
- "ci:publish": "changeset publish",
- "ci:version": "changeset version",
- "clean": "clear-ts-build"
- },
- "files": [
- "bin",
- "dist",
- "src",
- "public",
- "views",
- "i18n"
- ],
"workspaces": [
"workspaces/documentation-ui",
"workspaces/vis-network",
"workspaces/size-satisfies",
"workspaces/cache",
- "workspaces/server"
+ "workspaces/server",
+ "workspaces/cli"
],
- "repository": {
- "type": "git",
- "url": "git+https://github.com/NodeSecure/cli.git"
+ "scripts": {
+ "lint": "eslint workspaces",
+ "lint-fix": "npm run lint -- --fix",
+ "build": "npm run build --ws --if-present",
+ "test": "npm run lint && npm run test --ws --if-present",
+ "coverage": "c8 --reporter=lcov npm run test",
+ "ci:publish": "changeset publish",
+ "ci:version": "changeset version",
+ "clean": "clear-ts-build"
},
- "keywords": [
- "node",
- "nodejs",
- "security",
- "cli",
- "sast",
- "scanner",
- "static",
- "code",
- "analysis",
- "node_modules",
- "tree",
- "npm",
- "registry",
- "graph",
- "visualization",
- "dependencies"
- ],
"author": "GENTILHOMME Thomas ",
"license": "MIT",
- "bugs": {
- "url": "https://github.com/NodeSecure/cli/issues"
- },
- "homepage": "https://github.com/NodeSecure/cli#readme",
"devDependencies": {
"@changesets/changelog-github": "0.6.0",
"@changesets/cli": "2.30.0",
- "@nodesecure/size-satisfies": "^1.1.0",
- "@nodesecure/vis-network": "^1.4.0",
"@openally/config.eslint": "^2.4.2",
"@openally/config.typescript": "1.3.0",
- "@openally/httpie": "1.1.2",
- "@playwright/test": "^1.50.0",
- "@stylistic/stylelint-plugin": "5.1.0",
"@types/node": "25.5.2",
"c8": "11.0.0",
- "cross-env": "^10.1.0",
- "esbuild": "0.28.1",
"eslint-plugin-jsdoc": "62.9.0",
"pkg-ok": "^3.0.0",
- "postcss-lit": "1.4.1",
- "pretty-bytes": "^7.0.0",
"rimraf": "6.1.3",
- "stylelint": "17.6.0",
- "stylelint-config-standard": "40.0.0",
"typescript": "^6.0.2",
- "undici": "8.0.2",
"vite": "8.0.16"
- },
- "dependencies": {
- "@lit/task": "^1.0.3",
- "@nodesecure/cache": "1.0.0",
- "@nodesecure/documentation-ui": "^1.3.0",
- "@nodesecure/flags": "3.0.3",
- "@nodesecure/i18n": "4.1.0",
- "@nodesecure/js-x-ray": "15.1.0",
- "@nodesecure/licenses-conformance": "2.1.0",
- "@nodesecure/mama": "2.3.1",
- "@nodesecure/npm-registry-sdk": "4.5.2",
- "@nodesecure/ossf-scorecard-sdk": "4.0.1",
- "@nodesecure/rc": "5.6.0",
- "@nodesecure/report": "4.2.2",
- "@nodesecure/scanner": "10.12.0",
- "@nodesecure/server": "1.0.0",
- "@nodesecure/utils": "^2.2.0",
- "@nodesecure/vulnera": "3.1.0",
- "@openally/result": "^2.0.0",
- "@topcli/cliui": "^1.1.0",
- "@topcli/pretty-json": "^1.0.0",
- "@topcli/prompts": "^3.0.0",
- "@topcli/spinner": "4.2.1",
- "filenamify": "^7.0.0",
- "highlightjs-line-numbers.js": "^2.8.0",
- "ini": "^7.0.0",
- "json-diff-ts": "4.10.4",
- "lit": "^3.3.1",
- "ms": "^2.1.3",
- "open": "^11.0.0",
- "sade": "^1.8.1",
- "semver": "^7.6.3"
}
}
diff --git a/.stylelintrc.json b/workspaces/cli/.stylelintrc.json
similarity index 100%
rename from .stylelintrc.json
rename to workspaces/cli/.stylelintrc.json
diff --git a/workspaces/cli/README.md b/workspaces/cli/README.md
new file mode 100644
index 00000000..9a483b21
--- /dev/null
+++ b/workspaces/cli/README.md
@@ -0,0 +1,153 @@
+
+ 🐢 Node-Secure CLI 🚀
+
+
+
+ a Node.js CLI to deeply analyze the dependency tree of a given NPM package or Node.js local app
+
+
+
+
+
+
+## 📜 Features
+
+- Run a static scan on every JavaScript files and sort out warnings (unsafe-regex, unsafe-import etc) and the complete list of required expr and statements (files, node.js module, etc.).
+- Return complete composition for each packages (extensions, files, tarball size, etc).
+- Packages metadata from the npm registry API (number of releases, last publish date, maintainers etc).
+- Search for licenses files in the tarball and return the [SPDX](https://spdx.org/licenses/) expression conformance of each detected licenses.
+- Link vulnerabilities from the multiple sources like GitHub Advisory, Sonatype or Snyk using [Vulnera](https://github.com/NodeSecure/vulnera).
+- Add flags (emojis) to each packages versions to identify well known patterns and potential security threats easily.
+- First-class support of open source security initiatives like [OpenSSF Scorecard](https://github.com/ossf/scorecard).
+- Generate security report (PDF).
+
+## 🚧 Requirements
+
+- [Node.js](https://nodejs.org/en/) v24 or higher
+
+## 💃 Getting Started
+
+```bash
+$ npm install @nodesecure/cli -g
+```
+
+or, from source (this package lives in the [NodeSecure/cli](https://github.com/NodeSecure/cli) monorepo):
+
+```bash
+$ git clone https://github.com/NodeSecure/cli.git
+$ cd cli
+
+$ npm install
+# bundle/compile front-end assets for every workspace
+$ npm run build
+
+$ cd workspaces/cli
+$ npm link
+```
+
+Then the **nsecure** binary will be available in your terminal. Give a try with the popular [express](http://expressjs.com/) package. This will automatically open the webpage in your default system browser.
+```bash
+$ nsecure auto express
+```
+
+> [!TIP]
+> Setup an [npm token](https://github.com/NodeSecure/cli#private-packages--registry) to avoid hiting the maximum request limit of the npm registry API.
+
+## 👀 Usage example
+
+```bash
+# Run a scan on the current working dir
+# Note: must have a package.json or node_modules directory
+$ nsecure cwd
+
+# Run a scan on a remote 'npm' package
+$ nsecure from mocha
+```
+
+Then a `nsecure-result.json` will be writted at the current CLI location. To open it on a web page just run
+
+```bash
+$ nsecure open
+```
+
+### Command Documentation
+
+The CLI includes built-in documentation accessible with the --help option:
+```bash
+$ nsecure --help
+$ nsecure --help
+```
+
+For complete details on each command, refer to the following documents:
+
+- [`cwd`](./docs/cli/cwd.md)
+- [`from`](./docs/cli/from.md)
+- [`auto`](./docs/cli/auto.md)
+- [`open`](./docs/cli/open.md)
+- [`verify`](./docs/cli/verify.md)
+- [`summary`](./docs/cli/summary.md)
+- [`scorecard`](./docs/cli/scorecard.md)
+- [`report`](./docs/cli/report.md)
+- [`lang`](./docs/cli/lang.md)
+- [`config create`](./docs/cli/config.md)
+- [`config`](./docs/cli/config.md)
+- [`cache`](./docs/cli/cache.md)
+- [`extract integrity`](./docs/cli/extract-integrity.md)
+- [`stats`](./docs/cli/stats.md)
+- [re-highlight](./docs/cli/re-highlight.md)
+
+Each link provides access to the full documentation for the command, including additional details, options, and usage examples.
+
+## Private registry / Verdaccio
+
+NodeSecure allow you to fetch stats on private npm packages by setting up a `NODE_SECURE_TOKEN` env variable (which must contains an [npm token](https://docs.npmjs.com/creating-and-viewing-authentication-tokens)).
+
+> [!TIP]
+> If you `npm link` the package by yourself you can create a `.env` file at the root of the project too.
+
+NodeSecure is capable to work behind a custom private npm registry too by searching the default registry URL in your local npm configuration.
+
+```bash
+$ npm config get registry
+$ npm config set registry "http://your-registry/"
+```
+
+## API
+Our back-end scanner package is available [here](https://github.com/NodeSecure/scanner).
+
+## Flags legends
+
+Flags and emojis legends are documented [here](https://github.com/NodeSecure/flags/blob/main/FLAGS.md).
+
+## Search command
+
+Press `Cmd+K` (macOS) or `Ctrl+K` (Windows/Linux) from the network view to open the search command. It lets you filter the dependency graph using one or more criteria simultaneously.
+
+Type a package name directly to search, or prefix with a filter name followed by `:` to use a specific filter:
+
+- `package` — **default when no prefix is given**, matches by name.
+- `version` — semver range (e.g. `>=1.2.0`, `^2.0.0`).
+- `flag` — select from the list of flags present in the current tree.
+- `license` — SPDX identifier (e.g. `MIT`, `Apache-2.0`).
+- `author` — author name or email.
+- `ext` — file extension present in the package (e.g. `.js`, `.ts`).
+- `builtin` — Node.js core module used by the package (e.g. `fs`, `path`).
+- `size` — size range (see [size-satisfies](https://github.com/NodeSecure/size-satisfies#usage-example), e.g. `>50kb`, `10kb..200kb`).
+- `highlighted` — all highlighted packages by default.
+
+## FAQ
+
+### Why some nodes are red in the UI ?
+Nodes are highlighted in red when the project/package is flagged with 🔬 `hasMinifiedCode` or ⚠️ `hasWarnings`. You can deactivate specific warnings in the options if desired.
+
+### Why the package size is so different from Bundlephobia ?
+The back-end scanner will analyze the complete size of the npm tarball without any filters or specific optimizations. In contrast, Bundlephobia will bundle the package and remove most of the unnecessary files from the tarball, such as documentation and other non-essential items.
+
+### Why some packages don't have OSSF Scorecard ?
+See [Scorecard Public Data](https://github.com/ossf/scorecard#public-data):
+
+> [!NOTE]
+> We run a weekly Scorecard scan of the 1 million most critical open source projects judged by their direct dependencies and publish the results in a BigQuery public dataset.
+
+## License
+MIT
diff --git a/bin/check-and-run.js b/workspaces/cli/bin/check-and-run.js
similarity index 70%
rename from bin/check-and-run.js
rename to workspaces/cli/bin/check-and-run.js
index cc64a1b6..6a53e54c 100644
--- a/bin/check-and-run.js
+++ b/workspaces/cli/bin/check-and-run.js
@@ -8,7 +8,10 @@ const { default: packageJSON } = await import("../package.json", {
});
const currentVersion = process.versions.node;
-const requiredRange = packageJSON.engines.node;
+const requiredRange = packageJSON.engines?.node ?? null;
+if (requiredRange === null) {
+ throw new Error("Missing 'engines.node' field in package.json");
+}
if (!semver.satisfies(currentVersion, requiredRange)) {
console.error(
@@ -18,4 +21,6 @@ if (!semver.satisfies(currentVersion, requiredRange)) {
process.exit(1);
}
-await import("./index.js");
+await import(
+ "./index.js"
+);
diff --git a/bin/index.js b/workspaces/cli/bin/index.js
old mode 100755
new mode 100644
similarity index 94%
rename from bin/index.js
rename to workspaces/cli/bin/index.js
index b3154c38..57e1f1dc
--- a/bin/index.js
+++ b/workspaces/cli/bin/index.js
@@ -9,13 +9,13 @@ catch {
}
// Import Node.js Dependencies
-import { createRequire } from "node:module";
import path from "node:path";
// Import Third-party Dependencies
import * as i18n from "@nodesecure/i18n";
import { loadRegistryURLFromLocalSystem } from "@nodesecure/npm-registry-sdk";
import * as vulnera from "@nodesecure/vulnera";
+import { PayloadCache } from "@nodesecure/cache";
import sade from "sade";
import semver from "semver";
@@ -23,9 +23,9 @@ import semver from "semver";
import * as commands from "../src/commands/index.js";
import kleur from "../src/utils/styleText.js";
-// TODO: replace with await import() when available
-const require = createRequire(import.meta.url);
-const manifest = require("../package.json");
+const { default: manifest } = await import("../package.json", {
+ with: { type: "json" }
+});
await i18n.getLocalLang();
await i18n.extendFromSystemPath(
@@ -50,14 +50,16 @@ defaultScannerCommand("cwd", { strategy: vulnera.strategies.GITHUB_ADVISORY })
.option("-f, --full", i18n.getTokenSync("cli.commands.cwd.option_full"), false)
.action(async(options) => {
checkNodeSecureToken();
- await commands.scanner.cwd(options);
+ const cache = await loadCache();
+ await commands.scanner.cwd(options, cache);
});
defaultScannerCommand("from ")
.describe(i18n.getTokenSync("cli.commands.from.desc"))
.action(async(spec, options) => {
checkNodeSecureToken();
- await commands.scanner.from(spec, options);
+ const cache = await loadCache();
+ await commands.scanner.from(spec, options, cache);
});
defaultScannerCommand("auto [spec]", { includeOutput: false, strategy: vulnera.strategies.GITHUB_ADVISORY })
@@ -174,6 +176,13 @@ function defaultScannerCommand(name, options = {}) {
return cmd;
}
+async function loadCache() {
+ const cache = new PayloadCache();
+ await cache.load();
+
+ return cache;
+}
+
function checkNodeSecureToken() {
if (!process.env.NODE_SECURE_TOKEN) {
const varEnvName = kleur.yellow().bold("NODE_SECURE_TOKEN");
diff --git a/docs/cli/auto.md b/workspaces/cli/docs/cli/auto.md
similarity index 100%
rename from docs/cli/auto.md
rename to workspaces/cli/docs/cli/auto.md
diff --git a/docs/cli/cache.md b/workspaces/cli/docs/cli/cache.md
similarity index 100%
rename from docs/cli/cache.md
rename to workspaces/cli/docs/cli/cache.md
diff --git a/docs/cli/config.md b/workspaces/cli/docs/cli/config.md
similarity index 100%
rename from docs/cli/config.md
rename to workspaces/cli/docs/cli/config.md
diff --git a/docs/cli/cwd.md b/workspaces/cli/docs/cli/cwd.md
similarity index 100%
rename from docs/cli/cwd.md
rename to workspaces/cli/docs/cli/cwd.md
diff --git a/docs/cli/extract-integrity.md b/workspaces/cli/docs/cli/extract-integrity.md
similarity index 100%
rename from docs/cli/extract-integrity.md
rename to workspaces/cli/docs/cli/extract-integrity.md
diff --git a/docs/cli/from.md b/workspaces/cli/docs/cli/from.md
similarity index 100%
rename from docs/cli/from.md
rename to workspaces/cli/docs/cli/from.md
diff --git a/docs/cli/images/lang.PNG b/workspaces/cli/docs/cli/images/lang.PNG
similarity index 100%
rename from docs/cli/images/lang.PNG
rename to workspaces/cli/docs/cli/images/lang.PNG
diff --git a/docs/cli/images/scorecard.PNG b/workspaces/cli/docs/cli/images/scorecard.PNG
similarity index 100%
rename from docs/cli/images/scorecard.PNG
rename to workspaces/cli/docs/cli/images/scorecard.PNG
diff --git a/docs/cli/images/stats.PNG b/workspaces/cli/docs/cli/images/stats.PNG
similarity index 100%
rename from docs/cli/images/stats.PNG
rename to workspaces/cli/docs/cli/images/stats.PNG
diff --git a/docs/cli/images/summary.PNG b/workspaces/cli/docs/cli/images/summary.PNG
similarity index 100%
rename from docs/cli/images/summary.PNG
rename to workspaces/cli/docs/cli/images/summary.PNG
diff --git a/docs/cli/images/verify.PNG b/workspaces/cli/docs/cli/images/verify.PNG
similarity index 100%
rename from docs/cli/images/verify.PNG
rename to workspaces/cli/docs/cli/images/verify.PNG
diff --git a/docs/cli/lang.md b/workspaces/cli/docs/cli/lang.md
similarity index 100%
rename from docs/cli/lang.md
rename to workspaces/cli/docs/cli/lang.md
diff --git a/docs/cli/open.md b/workspaces/cli/docs/cli/open.md
similarity index 100%
rename from docs/cli/open.md
rename to workspaces/cli/docs/cli/open.md
diff --git a/docs/cli/re-highlight.md b/workspaces/cli/docs/cli/re-highlight.md
similarity index 100%
rename from docs/cli/re-highlight.md
rename to workspaces/cli/docs/cli/re-highlight.md
diff --git a/docs/cli/report.md b/workspaces/cli/docs/cli/report.md
similarity index 100%
rename from docs/cli/report.md
rename to workspaces/cli/docs/cli/report.md
diff --git a/docs/cli/scorecard.md b/workspaces/cli/docs/cli/scorecard.md
similarity index 100%
rename from docs/cli/scorecard.md
rename to workspaces/cli/docs/cli/scorecard.md
diff --git a/docs/cli/stats.md b/workspaces/cli/docs/cli/stats.md
similarity index 100%
rename from docs/cli/stats.md
rename to workspaces/cli/docs/cli/stats.md
diff --git a/docs/cli/summary.md b/workspaces/cli/docs/cli/summary.md
similarity index 100%
rename from docs/cli/summary.md
rename to workspaces/cli/docs/cli/summary.md
diff --git a/docs/cli/verify.md b/workspaces/cli/docs/cli/verify.md
similarity index 100%
rename from docs/cli/verify.md
rename to workspaces/cli/docs/cli/verify.md
diff --git a/docs/ui-preview.PNG b/workspaces/cli/docs/ui-preview.PNG
similarity index 100%
rename from docs/ui-preview.PNG
rename to workspaces/cli/docs/ui-preview.PNG
diff --git a/esbuild.common.ts b/workspaces/cli/esbuild.common.ts
similarity index 89%
rename from esbuild.common.ts
rename to workspaces/cli/esbuild.common.ts
index 7c34b5c7..0a47240c 100644
--- a/esbuild.common.ts
+++ b/workspaces/cli/esbuild.common.ts
@@ -11,7 +11,6 @@ import {
// CONSTANTS
export const PUBLIC_DIR = path.join(import.meta.dirname, "public");
export const OUTPUT_DIR = path.join(import.meta.dirname, "dist");
-export const NODE_MODULES_DIR = path.join(import.meta.dirname, "node_modules");
export const IMAGES_DIR = path.join(PUBLIC_DIR, "img");
export function getSharedBuildOptions(): esbuild.BuildOptions {
@@ -19,7 +18,6 @@ export function getSharedBuildOptions(): esbuild.BuildOptions {
entryPoints: [
path.join(PUBLIC_DIR, "main.js"),
path.join(PUBLIC_DIR, "main.css"),
- path.join(NODE_MODULES_DIR, "highlight.js", "styles", "github.css"),
...getBuildConfiguration().entryPoints
],
loader: {
diff --git a/esbuild.config.ts b/workspaces/cli/esbuild.config.ts
similarity index 100%
rename from esbuild.config.ts
rename to workspaces/cli/esbuild.config.ts
diff --git a/esbuild.dev.config.ts b/workspaces/cli/esbuild.dev.config.ts
similarity index 100%
rename from esbuild.dev.config.ts
rename to workspaces/cli/esbuild.dev.config.ts
diff --git a/i18n/arabic.js b/workspaces/cli/i18n/arabic.js
similarity index 100%
rename from i18n/arabic.js
rename to workspaces/cli/i18n/arabic.js
diff --git a/i18n/english.js b/workspaces/cli/i18n/english.js
similarity index 100%
rename from i18n/english.js
rename to workspaces/cli/i18n/english.js
diff --git a/i18n/french.js b/workspaces/cli/i18n/french.js
similarity index 100%
rename from i18n/french.js
rename to workspaces/cli/i18n/french.js
diff --git a/i18n/turkish.js b/workspaces/cli/i18n/turkish.js
similarity index 100%
rename from i18n/turkish.js
rename to workspaces/cli/i18n/turkish.js
diff --git a/workspaces/cli/package.json b/workspaces/cli/package.json
new file mode 100644
index 00000000..b0f34911
--- /dev/null
+++ b/workspaces/cli/package.json
@@ -0,0 +1,112 @@
+{
+ "name": "@nodesecure/cli",
+ "version": "3.1.0",
+ "description": "Node.js security CLI",
+ "main": "./bin/index.js",
+ "bin": {
+ "node-secure": "./bin/check-and-run.js",
+ "nsecure": "./bin/check-and-run.js"
+ },
+ "type": "module",
+ "engines": {
+ "node": ">=24"
+ },
+ "scripts": {
+ "prepublishOnly": "rimraf ./dist && npm run lint && npm run build && pkg-ok",
+ "dev": "node ./esbuild.dev.config.ts",
+ "build": "rimraf ./dist && node ./esbuild.config.ts",
+ "lint": "stylelint \"**/*.css\" \"public/**/*.js\"",
+ "test": "npm run lint && npm run test:cli",
+ "test:cli": "node --no-warnings --test \"test/**/*.test.js\"",
+ "test:e2e": "playwright test",
+ "coverage": "c8 --reporter=lcov npm run test"
+ },
+ "files": [
+ "bin",
+ "dist",
+ "src",
+ "public",
+ "views",
+ "i18n"
+ ],
+ "publishConfig": {
+ "registry": "https://registry.npmjs.org",
+ "access": "public",
+ "provenance": true
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/NodeSecure/cli",
+ "directory": "workspaces/cli"
+ },
+ "keywords": [
+ "node",
+ "nodejs",
+ "security",
+ "cli",
+ "sast",
+ "scanner",
+ "static",
+ "code",
+ "analysis",
+ "node_modules",
+ "tree",
+ "npm",
+ "registry",
+ "graph",
+ "visualization",
+ "dependencies"
+ ],
+ "author": "GENTILHOMME Thomas ",
+ "license": "MIT",
+ "bugs": {
+ "url": "https://github.com/NodeSecure/cli/issues"
+ },
+ "homepage": "https://github.com/NodeSecure/cli#readme",
+ "devDependencies": {
+ "@nodesecure/size-satisfies": "^1.1.0",
+ "@nodesecure/vis-network": "^1.4.0",
+ "@openally/httpie": "1.1.2",
+ "@playwright/test": "1.61.1",
+ "@stylistic/stylelint-plugin": "5.1.0",
+ "esbuild": "0.28.1",
+ "highlight.js": "11.11.1",
+ "postcss-lit": "1.4.1",
+ "pretty-bytes": "^7.0.0",
+ "stylelint": "17.6.0",
+ "stylelint-config-standard": "40.0.0",
+ "undici": "8.0.2"
+ },
+ "dependencies": {
+ "@lit/task": "^1.0.3",
+ "@nodesecure/cache": "1.0.0",
+ "@nodesecure/documentation-ui": "^1.3.0",
+ "@nodesecure/flags": "3.0.3",
+ "@nodesecure/i18n": "4.1.0",
+ "@nodesecure/js-x-ray": "15.1.0",
+ "@nodesecure/licenses-conformance": "2.1.0",
+ "@nodesecure/mama": "2.3.1",
+ "@nodesecure/npm-registry-sdk": "4.5.2",
+ "@nodesecure/ossf-scorecard-sdk": "4.0.1",
+ "@nodesecure/rc": "5.6.0",
+ "@nodesecure/report": "4.2.2",
+ "@nodesecure/scanner": "10.12.0",
+ "@nodesecure/server": "1.0.0",
+ "@nodesecure/utils": "^2.2.0",
+ "@nodesecure/vulnera": "3.1.0",
+ "@openally/result": "^2.0.0",
+ "@topcli/cliui": "^1.1.0",
+ "@topcli/pretty-json": "^1.0.0",
+ "@topcli/prompts": "^3.0.0",
+ "@topcli/spinner": "4.2.1",
+ "filenamify": "^7.0.0",
+ "highlightjs-line-numbers.js": "^2.8.0",
+ "ini": "^7.0.0",
+ "json-diff-ts": "4.10.4",
+ "lit": "^3.3.1",
+ "ms": "^2.1.3",
+ "open": "^11.0.0",
+ "sade": "^1.8.1",
+ "semver": "^7.6.3"
+ }
+}
diff --git a/playwright.config.js b/workspaces/cli/playwright.config.js
similarity index 100%
rename from playwright.config.js
rename to workspaces/cli/playwright.config.js
diff --git a/public/common/flags.js b/workspaces/cli/public/common/flags.js
similarity index 100%
rename from public/common/flags.js
rename to workspaces/cli/public/common/flags.js
diff --git a/public/common/scorecard.js b/workspaces/cli/public/common/scorecard.js
similarity index 100%
rename from public/common/scorecard.js
rename to workspaces/cli/public/common/scorecard.js
diff --git a/public/common/scrollbar-style.js b/workspaces/cli/public/common/scrollbar-style.js
similarity index 100%
rename from public/common/scrollbar-style.js
rename to workspaces/cli/public/common/scrollbar-style.js
diff --git a/public/common/utils.js b/workspaces/cli/public/common/utils.js
similarity index 100%
rename from public/common/utils.js
rename to workspaces/cli/public/common/utils.js
diff --git a/public/components/bundlephobia/bundlephobia.css b/workspaces/cli/public/components/bundlephobia/bundlephobia.css
similarity index 100%
rename from public/components/bundlephobia/bundlephobia.css
rename to workspaces/cli/public/components/bundlephobia/bundlephobia.css
diff --git a/public/components/bundlephobia/bundlephobia.js b/workspaces/cli/public/components/bundlephobia/bundlephobia.js
similarity index 100%
rename from public/components/bundlephobia/bundlephobia.js
rename to workspaces/cli/public/components/bundlephobia/bundlephobia.js
diff --git a/public/components/command-palette/command-palette-panels.js b/workspaces/cli/public/components/command-palette/command-palette-panels.js
similarity index 100%
rename from public/components/command-palette/command-palette-panels.js
rename to workspaces/cli/public/components/command-palette/command-palette-panels.js
diff --git a/public/components/command-palette/command-palette-styles.js b/workspaces/cli/public/components/command-palette/command-palette-styles.js
similarity index 100%
rename from public/components/command-palette/command-palette-styles.js
rename to workspaces/cli/public/components/command-palette/command-palette-styles.js
diff --git a/public/components/command-palette/command-palette.js b/workspaces/cli/public/components/command-palette/command-palette.js
similarity index 100%
rename from public/components/command-palette/command-palette.js
rename to workspaces/cli/public/components/command-palette/command-palette.js
diff --git a/public/components/command-palette/filters.js b/workspaces/cli/public/components/command-palette/filters.js
similarity index 100%
rename from public/components/command-palette/filters.js
rename to workspaces/cli/public/components/command-palette/filters.js
diff --git a/public/components/command-palette/search-chip.js b/workspaces/cli/public/components/command-palette/search-chip.js
similarity index 100%
rename from public/components/command-palette/search-chip.js
rename to workspaces/cli/public/components/command-palette/search-chip.js
diff --git a/public/components/expandable/expandable.css b/workspaces/cli/public/components/expandable/expandable.css
similarity index 100%
rename from public/components/expandable/expandable.css
rename to workspaces/cli/public/components/expandable/expandable.css
diff --git a/public/components/expandable/expandable.js b/workspaces/cli/public/components/expandable/expandable.js
similarity index 100%
rename from public/components/expandable/expandable.js
rename to workspaces/cli/public/components/expandable/expandable.js
diff --git a/public/components/file-box/file-box.css b/workspaces/cli/public/components/file-box/file-box.css
similarity index 100%
rename from public/components/file-box/file-box.css
rename to workspaces/cli/public/components/file-box/file-box.css
diff --git a/public/components/file-box/file-box.js b/workspaces/cli/public/components/file-box/file-box.js
similarity index 100%
rename from public/components/file-box/file-box.js
rename to workspaces/cli/public/components/file-box/file-box.js
diff --git a/public/components/gauge/gauge.js b/workspaces/cli/public/components/gauge/gauge.js
similarity index 100%
rename from public/components/gauge/gauge.js
rename to workspaces/cli/public/components/gauge/gauge.js
diff --git a/public/components/icon/icon.js b/workspaces/cli/public/components/icon/icon.js
similarity index 100%
rename from public/components/icon/icon.js
rename to workspaces/cli/public/components/icon/icon.js
diff --git a/public/components/items-list/items-list.js b/workspaces/cli/public/components/items-list/items-list.js
similarity index 100%
rename from public/components/items-list/items-list.js
rename to workspaces/cli/public/components/items-list/items-list.js
diff --git a/public/components/items-list/view-model.js b/workspaces/cli/public/components/items-list/view-model.js
similarity index 100%
rename from public/components/items-list/view-model.js
rename to workspaces/cli/public/components/items-list/view-model.js
diff --git a/public/components/legend/legend.js b/workspaces/cli/public/components/legend/legend.js
similarity index 96%
rename from public/components/legend/legend.js
rename to workspaces/cli/public/components/legend/legend.js
index 0a4d28f9..45bc28af 100644
--- a/public/components/legend/legend.js
+++ b/workspaces/cli/public/components/legend/legend.js
@@ -1,8 +1,8 @@
// Import Third-party Dependencies
import { LitElement, html, css, nothing } from "lit";
+import { COLORS } from "@nodesecure/vis-network";
// Import Internal Dependencies
-import { COLORS } from "../../../workspaces/vis-network/src/constants.js";
import { currentLang } from "../../common/utils.js";
class Legend extends LitElement {
diff --git a/public/components/locked-navigation/locked-navigation.js b/workspaces/cli/public/components/locked-navigation/locked-navigation.js
similarity index 100%
rename from public/components/locked-navigation/locked-navigation.js
rename to workspaces/cli/public/components/locked-navigation/locked-navigation.js
diff --git a/public/components/locker/locker.js b/workspaces/cli/public/components/locker/locker.js
similarity index 100%
rename from public/components/locker/locker.js
rename to workspaces/cli/public/components/locker/locker.js
diff --git a/public/components/navigation/navigation.css b/workspaces/cli/public/components/navigation/navigation.css
similarity index 100%
rename from public/components/navigation/navigation.css
rename to workspaces/cli/public/components/navigation/navigation.css
diff --git a/public/components/navigation/navigation.js b/workspaces/cli/public/components/navigation/navigation.js
similarity index 100%
rename from public/components/navigation/navigation.js
rename to workspaces/cli/public/components/navigation/navigation.js
diff --git a/public/components/network-breadcrumb/network-breadcrumb.js b/workspaces/cli/public/components/network-breadcrumb/network-breadcrumb.js
similarity index 100%
rename from public/components/network-breadcrumb/network-breadcrumb.js
rename to workspaces/cli/public/components/network-breadcrumb/network-breadcrumb.js
diff --git a/public/components/npm-avatar/npm-avatar.js b/workspaces/cli/public/components/npm-avatar/npm-avatar.js
similarity index 100%
rename from public/components/npm-avatar/npm-avatar.js
rename to workspaces/cli/public/components/npm-avatar/npm-avatar.js
diff --git a/public/components/package/header/header.css b/workspaces/cli/public/components/package/header/header.css
similarity index 100%
rename from public/components/package/header/header.css
rename to workspaces/cli/public/components/package/header/header.css
diff --git a/public/components/package/header/header.js b/workspaces/cli/public/components/package/header/header.js
similarity index 100%
rename from public/components/package/header/header.js
rename to workspaces/cli/public/components/package/header/header.js
diff --git a/public/components/package/package.css b/workspaces/cli/public/components/package/package.css
similarity index 100%
rename from public/components/package/package.css
rename to workspaces/cli/public/components/package/package.css
diff --git a/public/components/package/package.html b/workspaces/cli/public/components/package/package.html
similarity index 100%
rename from public/components/package/package.html
rename to workspaces/cli/public/components/package/package.html
diff --git a/public/components/package/package.js b/workspaces/cli/public/components/package/package.js
similarity index 100%
rename from public/components/package/package.js
rename to workspaces/cli/public/components/package/package.js
diff --git a/public/components/package/pannels/files/files.js b/workspaces/cli/public/components/package/pannels/files/files.js
similarity index 100%
rename from public/components/package/pannels/files/files.js
rename to workspaces/cli/public/components/package/pannels/files/files.js
diff --git a/public/components/package/pannels/index.js b/workspaces/cli/public/components/package/pannels/index.js
similarity index 100%
rename from public/components/package/pannels/index.js
rename to workspaces/cli/public/components/package/pannels/index.js
diff --git a/public/components/package/pannels/licenses/licenses.js b/workspaces/cli/public/components/package/pannels/licenses/licenses.js
similarity index 100%
rename from public/components/package/pannels/licenses/licenses.js
rename to workspaces/cli/public/components/package/pannels/licenses/licenses.js
diff --git a/public/components/package/pannels/licenses/view-model.js b/workspaces/cli/public/components/package/pannels/licenses/view-model.js
similarity index 100%
rename from public/components/package/pannels/licenses/view-model.js
rename to workspaces/cli/public/components/package/pannels/licenses/view-model.js
diff --git a/public/components/package/pannels/overview/overview.css b/workspaces/cli/public/components/package/pannels/overview/overview.css
similarity index 100%
rename from public/components/package/pannels/overview/overview.css
rename to workspaces/cli/public/components/package/pannels/overview/overview.css
diff --git a/public/components/package/pannels/overview/overview.js b/workspaces/cli/public/components/package/pannels/overview/overview.js
similarity index 100%
rename from public/components/package/pannels/overview/overview.js
rename to workspaces/cli/public/components/package/pannels/overview/overview.js
diff --git a/public/components/package/pannels/scorecard/scorecard.css b/workspaces/cli/public/components/package/pannels/scorecard/scorecard.css
similarity index 100%
rename from public/components/package/pannels/scorecard/scorecard.css
rename to workspaces/cli/public/components/package/pannels/scorecard/scorecard.css
diff --git a/public/components/package/pannels/scorecard/scorecard.js b/workspaces/cli/public/components/package/pannels/scorecard/scorecard.js
similarity index 100%
rename from public/components/package/pannels/scorecard/scorecard.js
rename to workspaces/cli/public/components/package/pannels/scorecard/scorecard.js
diff --git a/public/components/package/pannels/scripts/scripts.js b/workspaces/cli/public/components/package/pannels/scripts/scripts.js
similarity index 100%
rename from public/components/package/pannels/scripts/scripts.js
rename to workspaces/cli/public/components/package/pannels/scripts/scripts.js
diff --git a/public/components/package/pannels/vulnerabilities/vulnerabilities.js b/workspaces/cli/public/components/package/pannels/vulnerabilities/vulnerabilities.js
similarity index 100%
rename from public/components/package/pannels/vulnerabilities/vulnerabilities.js
rename to workspaces/cli/public/components/package/pannels/vulnerabilities/vulnerabilities.js
diff --git a/public/components/package/pannels/warnings/code-fetcher.js b/workspaces/cli/public/components/package/pannels/warnings/code-fetcher.js
similarity index 100%
rename from public/components/package/pannels/warnings/code-fetcher.js
rename to workspaces/cli/public/components/package/pannels/warnings/code-fetcher.js
diff --git a/public/components/package/pannels/warnings/warnings.css b/workspaces/cli/public/components/package/pannels/warnings/warnings.css
similarity index 100%
rename from public/components/package/pannels/warnings/warnings.css
rename to workspaces/cli/public/components/package/pannels/warnings/warnings.css
diff --git a/public/components/package/pannels/warnings/warnings.js b/workspaces/cli/public/components/package/pannels/warnings/warnings.js
similarity index 100%
rename from public/components/package/pannels/warnings/warnings.js
rename to workspaces/cli/public/components/package/pannels/warnings/warnings.js
diff --git a/public/components/popup/popup.html b/workspaces/cli/public/components/popup/popup.html
similarity index 100%
rename from public/components/popup/popup.html
rename to workspaces/cli/public/components/popup/popup.html
diff --git a/public/components/popup/popup.js b/workspaces/cli/public/components/popup/popup.js
similarity index 100%
rename from public/components/popup/popup.js
rename to workspaces/cli/public/components/popup/popup.js
diff --git a/public/components/root-selector/root-selector.js b/workspaces/cli/public/components/root-selector/root-selector.js
similarity index 100%
rename from public/components/root-selector/root-selector.js
rename to workspaces/cli/public/components/root-selector/root-selector.js
diff --git a/public/components/views/home/home.css b/workspaces/cli/public/components/views/home/home.css
similarity index 100%
rename from public/components/views/home/home.css
rename to workspaces/cli/public/components/views/home/home.css
diff --git a/public/components/views/home/home.html b/workspaces/cli/public/components/views/home/home.html
similarity index 100%
rename from public/components/views/home/home.html
rename to workspaces/cli/public/components/views/home/home.html
diff --git a/public/components/views/home/home.js b/workspaces/cli/public/components/views/home/home.js
similarity index 100%
rename from public/components/views/home/home.js
rename to workspaces/cli/public/components/views/home/home.js
diff --git a/public/components/views/home/maintainers/maintainers.js b/workspaces/cli/public/components/views/home/maintainers/maintainers.js
similarity index 100%
rename from public/components/views/home/maintainers/maintainers.js
rename to workspaces/cli/public/components/views/home/maintainers/maintainers.js
diff --git a/public/components/views/home/report/report.js b/workspaces/cli/public/components/views/home/report/report.js
similarity index 100%
rename from public/components/views/home/report/report.js
rename to workspaces/cli/public/components/views/home/report/report.js
diff --git a/public/components/views/network/network.css b/workspaces/cli/public/components/views/network/network.css
similarity index 100%
rename from public/components/views/network/network.css
rename to workspaces/cli/public/components/views/network/network.css
diff --git a/public/components/views/search/search-view-styles.js b/workspaces/cli/public/components/views/search/search-view-styles.js
similarity index 100%
rename from public/components/views/search/search-view-styles.js
rename to workspaces/cli/public/components/views/search/search-view-styles.js
diff --git a/public/components/views/search/search.js b/workspaces/cli/public/components/views/search/search.js
similarity index 100%
rename from public/components/views/search/search.js
rename to workspaces/cli/public/components/views/search/search.js
diff --git a/public/components/views/settings/settings.css b/workspaces/cli/public/components/views/settings/settings.css
similarity index 100%
rename from public/components/views/settings/settings.css
rename to workspaces/cli/public/components/views/settings/settings.css
diff --git a/public/components/views/settings/settings.js b/workspaces/cli/public/components/views/settings/settings.js
similarity index 99%
rename from public/components/views/settings/settings.js
rename to workspaces/cli/public/components/views/settings/settings.js
index 6b49122a..48394156 100644
--- a/public/components/views/settings/settings.js
+++ b/workspaces/cli/public/components/views/settings/settings.js
@@ -78,7 +78,7 @@ export class SettingsView extends LitElement {
}
:host .icon-keyboard {
- background: url("../../../img/keyboard-solid.svg");
+ background: url("keyboard-solid.svg");
background-position: 10% center;
background-repeat: no-repeat;
width: 34px;
diff --git a/public/components/views/tree/tree-card.js b/workspaces/cli/public/components/views/tree/tree-card.js
similarity index 100%
rename from public/components/views/tree/tree-card.js
rename to workspaces/cli/public/components/views/tree/tree-card.js
diff --git a/public/components/views/tree/tree-connectors.js b/workspaces/cli/public/components/views/tree/tree-connectors.js
similarity index 100%
rename from public/components/views/tree/tree-connectors.js
rename to workspaces/cli/public/components/views/tree/tree-connectors.js
diff --git a/public/components/views/tree/tree-layout.js b/workspaces/cli/public/components/views/tree/tree-layout.js
similarity index 100%
rename from public/components/views/tree/tree-layout.js
rename to workspaces/cli/public/components/views/tree/tree-layout.js
diff --git a/public/components/views/tree/tree-styles.js b/workspaces/cli/public/components/views/tree/tree-styles.js
similarity index 100%
rename from public/components/views/tree/tree-styles.js
rename to workspaces/cli/public/components/views/tree/tree-styles.js
diff --git a/public/components/views/tree/tree.js b/workspaces/cli/public/components/views/tree/tree.js
similarity index 99%
rename from public/components/views/tree/tree.js
rename to workspaces/cli/public/components/views/tree/tree.js
index d95c5fc0..0f2eb26f 100644
--- a/public/components/views/tree/tree.js
+++ b/workspaces/cli/public/components/views/tree/tree.js
@@ -16,7 +16,7 @@ import {
} from "./tree-layout.js";
import { renderCardContent } from "./tree-card.js";
import { drawConnectors } from "./tree-connectors.js";
-import "../../../components/root-selector/root-selector.js";
+import "../../root-selector/root-selector.js";
class TreeView extends LitElement {
static styles = treeStyles;
diff --git a/public/components/views/warnings/warnings.js b/workspaces/cli/public/components/views/warnings/warnings.js
similarity index 100%
rename from public/components/views/warnings/warnings.js
rename to workspaces/cli/public/components/views/warnings/warnings.js
diff --git a/public/components/wiki/wiki.css b/workspaces/cli/public/components/wiki/wiki.css
similarity index 100%
rename from public/components/wiki/wiki.css
rename to workspaces/cli/public/components/wiki/wiki.css
diff --git a/public/components/wiki/wiki.html b/workspaces/cli/public/components/wiki/wiki.html
similarity index 100%
rename from public/components/wiki/wiki.html
rename to workspaces/cli/public/components/wiki/wiki.html
diff --git a/public/components/wiki/wiki.js b/workspaces/cli/public/components/wiki/wiki.js
similarity index 100%
rename from public/components/wiki/wiki.js
rename to workspaces/cli/public/components/wiki/wiki.js
diff --git a/public/core/events.js b/workspaces/cli/public/core/events.js
similarity index 100%
rename from public/core/events.js
rename to workspaces/cli/public/core/events.js
diff --git a/public/core/i18n.js b/workspaces/cli/public/core/i18n.js
similarity index 100%
rename from public/core/i18n.js
rename to workspaces/cli/public/core/i18n.js
diff --git a/public/core/network-navigation.js b/workspaces/cli/public/core/network-navigation.js
similarity index 100%
rename from public/core/network-navigation.js
rename to workspaces/cli/public/core/network-navigation.js
diff --git a/public/css/animation.css b/workspaces/cli/public/css/animation.css
similarity index 100%
rename from public/css/animation.css
rename to workspaces/cli/public/css/animation.css
diff --git a/public/css/light.css b/workspaces/cli/public/css/light.css
similarity index 100%
rename from public/css/light.css
rename to workspaces/cli/public/css/light.css
diff --git a/public/css/reset.css b/workspaces/cli/public/css/reset.css
similarity index 100%
rename from public/css/reset.css
rename to workspaces/cli/public/css/reset.css
diff --git a/public/favicon.ico b/workspaces/cli/public/favicon.ico
similarity index 100%
rename from public/favicon.ico
rename to workspaces/cli/public/favicon.ico
diff --git a/public/font/fontello/config.json b/workspaces/cli/public/font/fontello/config.json
similarity index 100%
rename from public/font/fontello/config.json
rename to workspaces/cli/public/font/fontello/config.json
diff --git a/public/font/fontello/fontello.css b/workspaces/cli/public/font/fontello/fontello.css
similarity index 100%
rename from public/font/fontello/fontello.css
rename to workspaces/cli/public/font/fontello/fontello.css
diff --git a/public/font/fontello/fontello.eot b/workspaces/cli/public/font/fontello/fontello.eot
similarity index 100%
rename from public/font/fontello/fontello.eot
rename to workspaces/cli/public/font/fontello/fontello.eot
diff --git a/public/font/fontello/fontello.svg b/workspaces/cli/public/font/fontello/fontello.svg
similarity index 100%
rename from public/font/fontello/fontello.svg
rename to workspaces/cli/public/font/fontello/fontello.svg
diff --git a/public/font/fontello/fontello.ttf b/workspaces/cli/public/font/fontello/fontello.ttf
similarity index 100%
rename from public/font/fontello/fontello.ttf
rename to workspaces/cli/public/font/fontello/fontello.ttf
diff --git a/public/font/fontello/fontello.woff b/workspaces/cli/public/font/fontello/fontello.woff
similarity index 100%
rename from public/font/fontello/fontello.woff
rename to workspaces/cli/public/font/fontello/fontello.woff
diff --git a/public/font/fontello/fontello.woff2 b/workspaces/cli/public/font/fontello/fontello.woff2
similarity index 100%
rename from public/font/fontello/fontello.woff2
rename to workspaces/cli/public/font/fontello/fontello.woff2
diff --git a/public/font/mononoki/mononoki-Bold.woff b/workspaces/cli/public/font/mononoki/mononoki-Bold.woff
similarity index 100%
rename from public/font/mononoki/mononoki-Bold.woff
rename to workspaces/cli/public/font/mononoki/mononoki-Bold.woff
diff --git a/public/font/mononoki/mononoki-Italic.woff b/workspaces/cli/public/font/mononoki/mononoki-Italic.woff
similarity index 100%
rename from public/font/mononoki/mononoki-Italic.woff
rename to workspaces/cli/public/font/mononoki/mononoki-Italic.woff
diff --git a/public/font/mononoki/mononoki-Regular.woff b/workspaces/cli/public/font/mononoki/mononoki-Regular.woff
similarity index 100%
rename from public/font/mononoki/mononoki-Regular.woff
rename to workspaces/cli/public/font/mononoki/mononoki-Regular.woff
diff --git a/public/font/mononoki/mononoki.css b/workspaces/cli/public/font/mononoki/mononoki.css
similarity index 100%
rename from public/font/mononoki/mononoki.css
rename to workspaces/cli/public/font/mononoki/mononoki.css
diff --git a/public/font/roboto/Roboto-Bold.ttf b/workspaces/cli/public/font/roboto/Roboto-Bold.ttf
similarity index 100%
rename from public/font/roboto/Roboto-Bold.ttf
rename to workspaces/cli/public/font/roboto/Roboto-Bold.ttf
diff --git a/public/font/roboto/Roboto-BoldItalic.ttf b/workspaces/cli/public/font/roboto/Roboto-BoldItalic.ttf
similarity index 100%
rename from public/font/roboto/Roboto-BoldItalic.ttf
rename to workspaces/cli/public/font/roboto/Roboto-BoldItalic.ttf
diff --git a/public/font/roboto/Roboto-Italic.ttf b/workspaces/cli/public/font/roboto/Roboto-Italic.ttf
similarity index 100%
rename from public/font/roboto/Roboto-Italic.ttf
rename to workspaces/cli/public/font/roboto/Roboto-Italic.ttf
diff --git a/public/font/roboto/Roboto-Light.ttf b/workspaces/cli/public/font/roboto/Roboto-Light.ttf
similarity index 100%
rename from public/font/roboto/Roboto-Light.ttf
rename to workspaces/cli/public/font/roboto/Roboto-Light.ttf
diff --git a/public/font/roboto/Roboto-LightItalic.ttf b/workspaces/cli/public/font/roboto/Roboto-LightItalic.ttf
similarity index 100%
rename from public/font/roboto/Roboto-LightItalic.ttf
rename to workspaces/cli/public/font/roboto/Roboto-LightItalic.ttf
diff --git a/public/font/roboto/Roboto-Medium.ttf b/workspaces/cli/public/font/roboto/Roboto-Medium.ttf
similarity index 100%
rename from public/font/roboto/Roboto-Medium.ttf
rename to workspaces/cli/public/font/roboto/Roboto-Medium.ttf
diff --git a/public/font/roboto/Roboto-MediumItalic.ttf b/workspaces/cli/public/font/roboto/Roboto-MediumItalic.ttf
similarity index 100%
rename from public/font/roboto/Roboto-MediumItalic.ttf
rename to workspaces/cli/public/font/roboto/Roboto-MediumItalic.ttf
diff --git a/public/font/roboto/Roboto-Regular.ttf b/workspaces/cli/public/font/roboto/Roboto-Regular.ttf
similarity index 100%
rename from public/font/roboto/Roboto-Regular.ttf
rename to workspaces/cli/public/font/roboto/Roboto-Regular.ttf
diff --git a/public/font/roboto/roboto.css b/workspaces/cli/public/font/roboto/roboto.css
similarity index 100%
rename from public/font/roboto/roboto.css
rename to workspaces/cli/public/font/roboto/roboto.css
diff --git a/public/global.d.ts b/workspaces/cli/public/global.d.ts
similarity index 100%
rename from public/global.d.ts
rename to workspaces/cli/public/global.d.ts
diff --git a/public/img/arrow-right-solid.svg b/workspaces/cli/public/img/arrow-right-solid.svg
similarity index 100%
rename from public/img/arrow-right-solid.svg
rename to workspaces/cli/public/img/arrow-right-solid.svg
diff --git a/public/img/avatar-default.png b/workspaces/cli/public/img/avatar-default.png
similarity index 100%
rename from public/img/avatar-default.png
rename to workspaces/cli/public/img/avatar-default.png
diff --git a/public/img/ext-link.svg b/workspaces/cli/public/img/ext-link.svg
similarity index 100%
rename from public/img/ext-link.svg
rename to workspaces/cli/public/img/ext-link.svg
diff --git a/public/img/github-black.png b/workspaces/cli/public/img/github-black.png
similarity index 100%
rename from public/img/github-black.png
rename to workspaces/cli/public/img/github-black.png
diff --git a/public/img/github-mark.png b/workspaces/cli/public/img/github-mark.png
similarity index 100%
rename from public/img/github-mark.png
rename to workspaces/cli/public/img/github-mark.png
diff --git a/public/img/gitlab-logo.png b/workspaces/cli/public/img/gitlab-logo.png
similarity index 100%
rename from public/img/gitlab-logo.png
rename to workspaces/cli/public/img/gitlab-logo.png
diff --git a/public/img/keyboard-solid.svg b/workspaces/cli/public/img/keyboard-solid.svg
similarity index 100%
rename from public/img/keyboard-solid.svg
rename to workspaces/cli/public/img/keyboard-solid.svg
diff --git a/public/img/node.png b/workspaces/cli/public/img/node.png
similarity index 100%
rename from public/img/node.png
rename to workspaces/cli/public/img/node.png
diff --git a/public/img/npm-icon.svg b/workspaces/cli/public/img/npm-icon.svg
similarity index 100%
rename from public/img/npm-icon.svg
rename to workspaces/cli/public/img/npm-icon.svg
diff --git a/public/img/scorecard.png b/workspaces/cli/public/img/scorecard.png
similarity index 100%
rename from public/img/scorecard.png
rename to workspaces/cli/public/img/scorecard.png
diff --git a/public/img/snyk.png b/workspaces/cli/public/img/snyk.png
similarity index 100%
rename from public/img/snyk.png
rename to workspaces/cli/public/img/snyk.png
diff --git a/public/img/sonatype.png b/workspaces/cli/public/img/sonatype.png
similarity index 100%
rename from public/img/sonatype.png
rename to workspaces/cli/public/img/sonatype.png
diff --git a/public/jsconfig.json b/workspaces/cli/public/jsconfig.json
similarity index 100%
rename from public/jsconfig.json
rename to workspaces/cli/public/jsconfig.json
diff --git a/public/main.css b/workspaces/cli/public/main.css
similarity index 98%
rename from public/main.css
rename to workspaces/cli/public/main.css
index 95a87613..15522a6b 100644
--- a/public/main.css
+++ b/workspaces/cli/public/main.css
@@ -1,6 +1,7 @@
@import url("./css/reset.css");
@import url("./css/light.css");
@import url("./css/animation.css");
+@import url("highlight.js/styles/github.css");
@import url("./font/fontello/fontello.css");
@import url("./font/roboto/roboto.css");
@import url("./font/mononoki/mononoki.css");
diff --git a/public/main.js b/workspaces/cli/public/main.js
similarity index 100%
rename from public/main.js
rename to workspaces/cli/public/main.js
diff --git a/public/websocket.js b/workspaces/cli/public/websocket.js
similarity index 100%
rename from public/websocket.js
rename to workspaces/cli/public/websocket.js
diff --git a/src/commands/cache.js b/workspaces/cli/src/commands/cache.js
similarity index 100%
rename from src/commands/cache.js
rename to workspaces/cli/src/commands/cache.js
diff --git a/src/commands/config.js b/workspaces/cli/src/commands/config.js
similarity index 100%
rename from src/commands/config.js
rename to workspaces/cli/src/commands/config.js
diff --git a/src/commands/extract-integrity.js b/workspaces/cli/src/commands/extract-integrity.js
similarity index 100%
rename from src/commands/extract-integrity.js
rename to workspaces/cli/src/commands/extract-integrity.js
diff --git a/src/commands/http.js b/workspaces/cli/src/commands/http.js
similarity index 100%
rename from src/commands/http.js
rename to workspaces/cli/src/commands/http.js
diff --git a/src/commands/index.js b/workspaces/cli/src/commands/index.js
similarity index 100%
rename from src/commands/index.js
rename to workspaces/cli/src/commands/index.js
diff --git a/src/commands/lang.js b/workspaces/cli/src/commands/lang.js
similarity index 100%
rename from src/commands/lang.js
rename to workspaces/cli/src/commands/lang.js
diff --git a/src/commands/loggers/logger.js b/workspaces/cli/src/commands/loggers/logger.js
similarity index 100%
rename from src/commands/loggers/logger.js
rename to workspaces/cli/src/commands/loggers/logger.js
diff --git a/src/commands/parsers/contacts.js b/workspaces/cli/src/commands/parsers/contacts.js
similarity index 100%
rename from src/commands/parsers/contacts.js
rename to workspaces/cli/src/commands/parsers/contacts.js
diff --git a/src/commands/parsers/packages.js b/workspaces/cli/src/commands/parsers/packages.js
similarity index 100%
rename from src/commands/parsers/packages.js
rename to workspaces/cli/src/commands/parsers/packages.js
diff --git a/src/commands/re-highlight.js b/workspaces/cli/src/commands/re-highlight.js
similarity index 100%
rename from src/commands/re-highlight.js
rename to workspaces/cli/src/commands/re-highlight.js
diff --git a/src/commands/report.js b/workspaces/cli/src/commands/report.js
similarity index 100%
rename from src/commands/report.js
rename to workspaces/cli/src/commands/report.js
diff --git a/src/commands/scanner.js b/workspaces/cli/src/commands/scanner.js
similarity index 100%
rename from src/commands/scanner.js
rename to workspaces/cli/src/commands/scanner.js
diff --git a/src/commands/scorecard.js b/workspaces/cli/src/commands/scorecard.js
similarity index 100%
rename from src/commands/scorecard.js
rename to workspaces/cli/src/commands/scorecard.js
diff --git a/src/commands/stats.js b/workspaces/cli/src/commands/stats.js
similarity index 100%
rename from src/commands/stats.js
rename to workspaces/cli/src/commands/stats.js
diff --git a/src/commands/summary.js b/workspaces/cli/src/commands/summary.js
similarity index 100%
rename from src/commands/summary.js
rename to workspaces/cli/src/commands/summary.js
diff --git a/src/commands/verify.js b/workspaces/cli/src/commands/verify.js
similarity index 100%
rename from src/commands/verify.js
rename to workspaces/cli/src/commands/verify.js
diff --git a/src/utils/getScanFromFile.js b/workspaces/cli/src/utils/getScanFromFile.js
similarity index 100%
rename from src/utils/getScanFromFile.js
rename to workspaces/cli/src/utils/getScanFromFile.js
diff --git a/src/utils/styleText.js b/workspaces/cli/src/utils/styleText.js
similarity index 100%
rename from src/utils/styleText.js
rename to workspaces/cli/src/utils/styleText.js
diff --git a/test/commands/bin.test.js b/workspaces/cli/test/commands/bin.test.js
similarity index 100%
rename from test/commands/bin.test.js
rename to workspaces/cli/test/commands/bin.test.js
diff --git a/test/commands/cache.test.js b/workspaces/cli/test/commands/cache.test.js
similarity index 100%
rename from test/commands/cache.test.js
rename to workspaces/cli/test/commands/cache.test.js
diff --git a/test/commands/extract-integrity.test.js b/workspaces/cli/test/commands/extract-integrity.test.js
similarity index 100%
rename from test/commands/extract-integrity.test.js
rename to workspaces/cli/test/commands/extract-integrity.test.js
diff --git a/test/commands/parsers/contacts.test.js b/workspaces/cli/test/commands/parsers/contacts.test.js
similarity index 100%
rename from test/commands/parsers/contacts.test.js
rename to workspaces/cli/test/commands/parsers/contacts.test.js
diff --git a/test/commands/parsers/packages.test.js b/workspaces/cli/test/commands/parsers/packages.test.js
similarity index 100%
rename from test/commands/parsers/packages.test.js
rename to workspaces/cli/test/commands/parsers/packages.test.js
diff --git a/test/commands/re-highlight.test.js b/workspaces/cli/test/commands/re-highlight.test.js
similarity index 100%
rename from test/commands/re-highlight.test.js
rename to workspaces/cli/test/commands/re-highlight.test.js
diff --git a/test/commands/scorecard.test.js b/workspaces/cli/test/commands/scorecard.test.js
similarity index 100%
rename from test/commands/scorecard.test.js
rename to workspaces/cli/test/commands/scorecard.test.js
diff --git a/test/commands/stats.test.js b/workspaces/cli/test/commands/stats.test.js
similarity index 100%
rename from test/commands/stats.test.js
rename to workspaces/cli/test/commands/stats.test.js
diff --git a/test/commands/summary.test.js b/workspaces/cli/test/commands/summary.test.js
similarity index 100%
rename from test/commands/summary.test.js
rename to workspaces/cli/test/commands/summary.test.js
diff --git a/test/commands/verify.test.js b/workspaces/cli/test/commands/verify.test.js
similarity index 100%
rename from test/commands/verify.test.js
rename to workspaces/cli/test/commands/verify.test.js
diff --git a/test/e2e/command-palette.spec.js b/workspaces/cli/test/e2e/command-palette.spec.js
similarity index 100%
rename from test/e2e/command-palette.spec.js
rename to workspaces/cli/test/e2e/command-palette.spec.js
diff --git a/test/e2e/fixtures/nsecure-result.json b/workspaces/cli/test/e2e/fixtures/nsecure-result.json
similarity index 100%
rename from test/e2e/fixtures/nsecure-result.json
rename to workspaces/cli/test/e2e/fixtures/nsecure-result.json
diff --git a/test/e2e/global-teardown.js b/workspaces/cli/test/e2e/global-teardown.js
similarity index 100%
rename from test/e2e/global-teardown.js
rename to workspaces/cli/test/e2e/global-teardown.js
diff --git a/test/e2e/navigation.spec.js b/workspaces/cli/test/e2e/navigation.spec.js
similarity index 100%
rename from test/e2e/navigation.spec.js
rename to workspaces/cli/test/e2e/navigation.spec.js
diff --git a/test/e2e/settings.spec.js b/workspaces/cli/test/e2e/settings.spec.js
similarity index 100%
rename from test/e2e/settings.spec.js
rename to workspaces/cli/test/e2e/settings.spec.js
diff --git a/test/e2e/warnings.spec.js b/workspaces/cli/test/e2e/warnings.spec.js
similarity index 100%
rename from test/e2e/warnings.spec.js
rename to workspaces/cli/test/e2e/warnings.spec.js
diff --git a/test/fixtures/result-test1.json b/workspaces/cli/test/fixtures/result-test1.json
similarity index 100%
rename from test/fixtures/result-test1.json
rename to workspaces/cli/test/fixtures/result-test1.json
diff --git a/test/fixtures/result-test2.json b/workspaces/cli/test/fixtures/result-test2.json
similarity index 100%
rename from test/fixtures/result-test2.json
rename to workspaces/cli/test/fixtures/result-test2.json
diff --git a/test/fixtures/result-test3.json b/workspaces/cli/test/fixtures/result-test3.json
similarity index 100%
rename from test/fixtures/result-test3.json
rename to workspaces/cli/test/fixtures/result-test3.json
diff --git a/test/fixtures/result-test4.json b/workspaces/cli/test/fixtures/result-test4.json
similarity index 100%
rename from test/fixtures/result-test4.json
rename to workspaces/cli/test/fixtures/result-test4.json
diff --git a/test/fixtures/verifyExpectedStdout.js b/workspaces/cli/test/fixtures/verifyExpectedStdout.js
similarity index 100%
rename from test/fixtures/verifyExpectedStdout.js
rename to workspaces/cli/test/fixtures/verifyExpectedStdout.js
diff --git a/test/helpers/cliCommandRunner.js b/workspaces/cli/test/helpers/cliCommandRunner.js
similarity index 100%
rename from test/helpers/cliCommandRunner.js
rename to workspaces/cli/test/helpers/cliCommandRunner.js
diff --git a/test/helpers/utils.js b/workspaces/cli/test/helpers/utils.js
similarity index 100%
rename from test/helpers/utils.js
rename to workspaces/cli/test/helpers/utils.js
diff --git a/test/process/check-and-run.js b/workspaces/cli/test/process/check-and-run.js
similarity index 100%
rename from test/process/check-and-run.js
rename to workspaces/cli/test/process/check-and-run.js
diff --git a/test/process/extract-integrity/invalid-spec.js b/workspaces/cli/test/process/extract-integrity/invalid-spec.js
similarity index 100%
rename from test/process/extract-integrity/invalid-spec.js
rename to workspaces/cli/test/process/extract-integrity/invalid-spec.js
diff --git a/test/process/extract-integrity/missing-version.js b/workspaces/cli/test/process/extract-integrity/missing-version.js
similarity index 100%
rename from test/process/extract-integrity/missing-version.js
rename to workspaces/cli/test/process/extract-integrity/missing-version.js
diff --git a/test/process/extract-integrity/not-found.js b/workspaces/cli/test/process/extract-integrity/not-found.js
similarity index 100%
rename from test/process/extract-integrity/not-found.js
rename to workspaces/cli/test/process/extract-integrity/not-found.js
diff --git a/test/process/extract-integrity/valid-spec.js b/workspaces/cli/test/process/extract-integrity/valid-spec.js
similarity index 100%
rename from test/process/extract-integrity/valid-spec.js
rename to workspaces/cli/test/process/extract-integrity/valid-spec.js
diff --git a/test/process/scorecard.js b/workspaces/cli/test/process/scorecard.js
similarity index 100%
rename from test/process/scorecard.js
rename to workspaces/cli/test/process/scorecard.js
diff --git a/test/process/summary-zero-dependencies.js b/workspaces/cli/test/process/summary-zero-dependencies.js
similarity index 100%
rename from test/process/summary-zero-dependencies.js
rename to workspaces/cli/test/process/summary-zero-dependencies.js
diff --git a/test/process/summary.js b/workspaces/cli/test/process/summary.js
similarity index 100%
rename from test/process/summary.js
rename to workspaces/cli/test/process/summary.js
diff --git a/test/process/verify-json.js b/workspaces/cli/test/process/verify-json.js
similarity index 100%
rename from test/process/verify-json.js
rename to workspaces/cli/test/process/verify-json.js
diff --git a/test/process/verify-undefined.js b/workspaces/cli/test/process/verify-undefined.js
similarity index 100%
rename from test/process/verify-undefined.js
rename to workspaces/cli/test/process/verify-undefined.js
diff --git a/test/process/verify.js b/workspaces/cli/test/process/verify.js
similarity index 100%
rename from test/process/verify.js
rename to workspaces/cli/test/process/verify.js
diff --git a/test/ui/command-palette-filters.test.js b/workspaces/cli/test/ui/command-palette-filters.test.js
similarity index 100%
rename from test/ui/command-palette-filters.test.js
rename to workspaces/cli/test/ui/command-palette-filters.test.js
diff --git a/test/ui/items-list.test.js b/workspaces/cli/test/ui/items-list.test.js
similarity index 100%
rename from test/ui/items-list.test.js
rename to workspaces/cli/test/ui/items-list.test.js
diff --git a/test/ui/licenses.test.js b/workspaces/cli/test/ui/licenses.test.js
similarity index 100%
rename from test/ui/licenses.test.js
rename to workspaces/cli/test/ui/licenses.test.js
diff --git a/test/utils/styleText.test.js b/workspaces/cli/test/utils/styleText.test.js
similarity index 100%
rename from test/utils/styleText.test.js
rename to workspaces/cli/test/utils/styleText.test.js
diff --git a/workspaces/cli/tsconfig.json b/workspaces/cli/tsconfig.json
new file mode 100644
index 00000000..347f150e
--- /dev/null
+++ b/workspaces/cli/tsconfig.json
@@ -0,0 +1,11 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "types": ["node"],
+ "lib": ["dom", "dom.iterable", "ESNext"],
+ "composite": false,
+ "noEmit": true
+ },
+ "include": ["*.ts", "public/global.d.ts"],
+ "exclude": ["node_modules", "dist"]
+}
diff --git a/views/index.html b/workspaces/cli/views/index.html
similarity index 94%
rename from views/index.html
rename to workspaces/cli/views/index.html
index 6c7efe71..f67cb92c 100644
--- a/views/index.html
+++ b/workspaces/cli/views/index.html
@@ -6,12 +6,11 @@
-
-
-
+
+
-
+
NodeSecure
diff --git a/workspaces/server/test/httpServer.test.ts b/workspaces/server/test/httpServer.test.ts
index 55eaacba..cd58bd89 100644
--- a/workspaces/server/test/httpServer.test.ts
+++ b/workspaces/server/test/httpServer.test.ts
@@ -7,7 +7,13 @@ import assert from "node:assert";
import stream from "node:stream";
// Import Third-party Dependencies
-import { get, post, MockAgent, getGlobalDispatcher, setGlobalDispatcher } from "@openally/httpie";
+import {
+ get,
+ post,
+ MockAgent,
+ getGlobalDispatcher,
+ setGlobalDispatcher
+} from "@openally/httpie";
import * as i18n from "@nodesecure/i18n";
import * as flags from "@nodesecure/flags";
import enableDestroy from "server-destroy";
@@ -26,8 +32,8 @@ const JSON_PATH = path.join(import.meta.dirname, "fixtures", "httpServer.json");
const kGlobalDispatcher = getGlobalDispatcher();
const kMockAgent = new MockAgent();
const kBundlephobiaPool = kMockAgent.get("https://bundlephobia.com");
-const kProjectRootDir = path.join(import.meta.dirname, "..", "..", "..");
-const kComponentsDir = path.join(kProjectRootDir, "public", "components");
+const kCLIWorkspaceRootDir = path.join(import.meta.dirname, "..", "..", "cli");
+const kComponentsDir = path.join(kCLIWorkspaceRootDir, "public", "components");
describe("httpServer", () => {
let httpServer: Server;
@@ -35,11 +41,11 @@ describe("httpServer", () => {
before(async() => {
setGlobalDispatcher(kMockAgent);
await i18n.extendFromSystemPath(
- path.join(import.meta.dirname, "..", "..", "..", "i18n")
+ path.join(kCLIWorkspaceRootDir, "i18n")
);
({ httpServer } = await buildServer(JSON_PATH, {
- projectRootDir: kProjectRootDir,
+ projectRootDir: kCLIWorkspaceRootDir,
componentsDir: kComponentsDir,
reporter: async() => Buffer.from("fake-pdf-data"),
i18n: {
@@ -314,7 +320,7 @@ describe("httpServer without options", () => {
before(async() => {
({ httpServer } = await buildServer(JSON_PATH, {
- projectRootDir: kProjectRootDir,
+ projectRootDir: kCLIWorkspaceRootDir,
componentsDir: kComponentsDir,
i18n: {
english: {
@@ -346,11 +352,11 @@ describe("httpServer wsPort option", () => {
before(async() => {
await i18n.extendFromSystemPath(
- path.join(import.meta.dirname, "..", "..", "..", "i18n")
+ path.join(kCLIWorkspaceRootDir, "i18n")
);
({ httpServer } = await buildServer(JSON_PATH, {
- projectRootDir: kProjectRootDir,
+ projectRootDir: kCLIWorkspaceRootDir,
componentsDir: kComponentsDir,
reporter: async() => Buffer.from("fake-pdf-data"),
i18n: {
diff --git a/workspaces/vis-network/package.json b/workspaces/vis-network/package.json
index 462d6c42..636f346d 100644
--- a/workspaces/vis-network/package.json
+++ b/workspaces/vis-network/package.json
@@ -13,7 +13,7 @@
"lint": "eslint src test",
"lint:fix": "eslint --fix src test",
"test-only": "node --test \"test/*.test.ts\"",
- "test": "c8 npm run test",
+ "test": "c8 npm run test-only",
"example": "vite"
},
"publishConfig": {