mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-29 08:00:06 +00:00
style: format server and shared with prettier
A mechanical prettier --write over server/src, server/tests, server/scripts and shared/src with the workspaces' .prettierrc; nothing but layout and import order changes, and every file keeps the same set of imports. shared is formatted throughout and its format baseline is empty. The server baseline keeps the 35 files that Prettier would grow past their lint:size limit (they need a split first, which is not a formatting change), and the generated entity files stay as their generator writes them.
This commit is contained in:
@@ -2,10 +2,27 @@
|
||||
* Small pure helpers of the plugin module (#plugins): permission recognition and
|
||||
* the code/data path resolution (both the env-override and default branches).
|
||||
*/
|
||||
import { describe, it, expect, afterEach } from 'vitest';
|
||||
import { isKnownPermission, METHOD_PERMISSION, KNOWN_METHODS, HOOK_PERMISSION } from '../../../src/nest/plugins/protocol/envelope';
|
||||
import {
|
||||
pluginsCodeRoot,
|
||||
pluginsDataRoot,
|
||||
pluginCodeDir,
|
||||
pluginDataDir,
|
||||
pluginDbFile,
|
||||
resolveChildEntry,
|
||||
serverCodeRoot,
|
||||
pluginPermissionArgs,
|
||||
pluginRealCodeDir,
|
||||
ensurePluginModuleType,
|
||||
} from '../../../src/nest/plugins/paths';
|
||||
import {
|
||||
isKnownPermission,
|
||||
METHOD_PERMISSION,
|
||||
KNOWN_METHODS,
|
||||
HOOK_PERMISSION,
|
||||
} from '../../../src/nest/plugins/protocol/envelope';
|
||||
|
||||
import path from 'node:path';
|
||||
import { pluginsCodeRoot, pluginsDataRoot, pluginCodeDir, pluginDataDir, pluginDbFile, resolveChildEntry, serverCodeRoot, pluginPermissionArgs, pluginRealCodeDir, ensurePluginModuleType } from '../../../src/nest/plugins/paths';
|
||||
import { describe, it, expect, afterEach } from 'vitest';
|
||||
|
||||
afterEach(() => {
|
||||
delete process.env.TREK_PLUGINS_DIR;
|
||||
@@ -109,17 +126,7 @@ describe('paths', () => {
|
||||
* still matches the route and arrives here decoded.
|
||||
*/
|
||||
describe('plugin id containment', () => {
|
||||
const traversals = [
|
||||
'../../uploads',
|
||||
'../..',
|
||||
'..',
|
||||
'.',
|
||||
'a/b',
|
||||
'a\b',
|
||||
'C:\Windows',
|
||||
'.hidden',
|
||||
'',
|
||||
];
|
||||
const traversals = ['../../uploads', '../..', '..', '.', 'a/b', 'a\b', 'C:\Windows', '.hidden', ''];
|
||||
|
||||
it('refuses any id that could point outside its parent', () => {
|
||||
for (const id of traversals) {
|
||||
|
||||
Reference in New Issue
Block a user