Лицензия, редактор, пульт и сборка
- Main: license service, IPC, router; закрытие окон; yauzl закрытие zip (EMFILE), zipRead тест - Editor: стабильный projectState без мигания, логотип и меню, строки UI, LayoutShell overlay - Control: ластик для всех типов эффектов, затухание/нарастание музыки при смене сцены - Сборка: vite, build/dev scripts, obfuscate-main и build-env скрипты с тестами; package.json Made-with: Cursor
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import { createRequire } from 'node:module';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import test from 'node:test';
|
||||
|
||||
import { obfuscateMainBundleFile } from './obfuscate-main.mjs';
|
||||
|
||||
void test('obfuscateMainBundleFile: CJS после обфускации исполняется (кроссплатформенно)', () => {
|
||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'dnd-obf-'));
|
||||
const filePath = path.join(dir, 'stub.cjs');
|
||||
fs.writeFileSync(filePath, 'exports.answer = 40 + 2;\n', 'utf8');
|
||||
|
||||
obfuscateMainBundleFile(filePath);
|
||||
|
||||
const out = fs.readFileSync(filePath, 'utf8');
|
||||
assert.ok(out.length > 0);
|
||||
assert.ok(!out.includes('exports.answer = 42'), 'исходный вид строки не должен сохраняться дословно');
|
||||
|
||||
const requireFromTest = createRequire(import.meta.url);
|
||||
assert.equal(requireFromTest(filePath).answer, 42);
|
||||
});
|
||||
Reference in New Issue
Block a user