منبع منتشرشده
دانلود ZIP منبع
CH-J Tools
پوشهها و فایلهای یک نسخهٔ مشخص از برنامه را مرور کنید.
CH-J / Server Manager
406 فایل
core-20261024T135205Z-7c487d719de2
افزودهشده: · ساختهشده:
1
"use strict";3
// Navigation icons: one mapping by stable IDs for all sidebar modes and the plugin taskbar.4
const test = require("node:test");5
const assert = require("node:assert/strict");6
const fs = require("node:fs");7
const path = require("node:path");8
const icons = require("../src/renderer/vendor/lucide/icons");9
const { ICON_BY_KEY, FALLBACK, iconName } = require("../src/renderer/navIcons");10
const { PluginRegistry } = require("../src/main/plugins/pluginRegistry");12
test("every core view and bundled plugin has its own existing icon; unknown plugins fall back to puzzle", () => {13
const html = fs.readFileSync(path.join(__dirname, "../src/renderer/index.html"), "utf8");14
const views = [...html.matchAll(/class="nav-button[^"]*" data-view="([a-z]+)"/g)].map((match) => match[1]);15
assert.ok(views.length >= 7);16
const registry = new PluginRegistry(fs.mkdtempSync(path.join(require("node:os").tmpdir(), "chj-icons-")), null, { bundledRoot: path.join(__dirname, "../src/main/firstPartyPlugins") });17
const keys = [...views, ...registry.listInstalled().map((plugin) => `plugin:${plugin.id}`)];18
const names = keys.map((key) => iconName(key));19
for (const [index, key] of keys.entries()) {20
assert.notEqual(names[index], FALLBACK, `${key} has a specific icon`);21
assert.ok(icons[names[index]]?.length, `${names[index]} exists in the vendored set`);22
}23
assert.equal(new Set(names).size, names.length, "no two known modules share an icon");24
assert.equal(iconName("plugin:example.unknown"), "puzzle"); assert.ok(icons.puzzle.length);25
for (const name of Object.values(ICON_BY_KEY)) assert.ok(icons[name], `mapped icon ${name} is vendored`);26
assert.ok(fs.readFileSync(path.join(__dirname, "../src/renderer/vendor/lucide/LICENSE.txt"), "utf8").startsWith("ISC License"));27
});SHA-256
c26ada9bf7870bc06ba8acc661c9151fad41d60550343bac2d6bfcbc48707d7bCH-J Proprietary Software License 1.14 · کد منبع تحت CH-J Proprietary Software License 1.14 ارائه میشود. در دسترس بودن آن شرایط مجوز را تغییر نمیدهد و حق اضافهای اعطا نمیکند.
SHA-256 بایگانی
476ed8aef0f1e96a5acdf223127b6692acdf4492eeaf5d0816b6e2a634fbbda6