REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.39 KB
Close
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/adminjs/lib/backend/bundler/generate-user-component-entry.js
Text
Base64
import * as path from 'path'; import slash from 'slash'; import AdminJS from '../../adminjs.js'; /** * Generates entry file for all UsersComponents. * Entry consists of 3 parts: * 1. Setup AdminJS.UserComponents map. * 2. List of all environmental variables passed to AdminJS in configuration option. * 3. Imports of user components defined by ComponentLoader. * * @param {AdminJS} admin * @param {String} entryPath path to folder where entry file is located * @return {String} content of an entry file * * @private */ const generateUserComponentEntry = (admin, entryPath) => { const { env = {} } = admin.options; admin.componentLoader.__unsafe_merge(AdminJS.__unsafe_staticComponentLoader); const components = admin.componentLoader.getComponents(); const absoluteEntryPath = path.resolve(entryPath); const setupPart = 'AdminJS.UserComponents = {}\n'; const envPart = Object.keys(env).map(envKey => `AdminJS.env.${envKey} = ${JSON.stringify(env[envKey])}\n`).join(''); const componentsPart = Object.keys(components || {}).map(componentId => { const componentUrl = path.relative(absoluteEntryPath, components[componentId]); return [`import ${componentId} from '${slash(componentUrl)}'`, `AdminJS.UserComponents.${componentId} = ${componentId}`].join('\n'); }).join('\n'); return setupPart + envPart + componentsPart; }; export default generateUserComponentEntry;
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 6
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
utils
DIR
-
drwxr-xr-x
2026-02-28 00:31:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
app.bundler.js
1.36 KB
lrw-r--r--
2026-02-28 00:31:14
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
components.bundler.js
1.72 KB
lrw-r--r--
2026-02-28 00:31:26
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
generate-user-component-entry.js
1.39 KB
lrw-r--r--
2026-02-28 00:31:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
generate-user-component-entry.spec.js
1.62 KB
lrw-r--r--
2026-02-28 00:31:34
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
globals.bundler.js
1.65 KB
lrw-r--r--
2026-02-28 00:31:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
382 B
lrw-r--r--
2026-02-28 00:31:40
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).