@mudlet/mudlet-web 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +338 -0
- package/README.md +150 -0
- package/dist-lib/App.d.ts +1 -0
- package/dist-lib/MudletWebApp.d.ts +11 -0
- package/dist-lib/ProfileSession.d.ts +15 -0
- package/dist-lib/assets/mapParser.worker-t-3rd1zR.js +9 -0
- package/dist-lib/branding.d.ts +213 -0
- package/dist-lib/core/EventBus.d.ts +29 -0
- package/dist-lib/db/sqliteClient.d.ts +25 -0
- package/dist-lib/hooks/useEngines.d.ts +12 -0
- package/dist-lib/hooks/useMudSession.d.ts +10 -0
- package/dist-lib/hooks/useOutput.d.ts +17 -0
- package/dist-lib/hooks/useViewportMode.d.ts +14 -0
- package/dist-lib/import/applyMudletProfile.d.ts +57 -0
- package/dist-lib/import/collectProfileExport.d.ts +16 -0
- package/dist-lib/import/defaultPackages.d.ts +81 -0
- package/dist-lib/import/defaults/mudlet-mapper.xml +13023 -0
- package/dist-lib/import/defaults/run-lua-code.mpackage +0 -0
- package/dist-lib/import/mudletHost.d.ts +67 -0
- package/dist-lib/import/mudletLink.d.ts +34 -0
- package/dist-lib/import/mudletProfileExport.d.ts +49 -0
- package/dist-lib/import/mudletProfileImport.d.ts +71 -0
- package/dist-lib/import/mudletVariables.d.ts +49 -0
- package/dist-lib/import/mudletWriteback.d.ts +12 -0
- package/dist-lib/import/mudletXmlExport.d.ts +16 -0
- package/dist-lib/import/mudletXmlImport.d.ts +21 -0
- package/dist-lib/import/packageInstaller.d.ts +72 -0
- package/dist-lib/import/packageRepository.d.ts +54 -0
- package/dist-lib/import/remotePackageInstall.d.ts +52 -0
- package/dist-lib/index.d.ts +30 -0
- package/dist-lib/index.js +42307 -0
- package/dist-lib/logging/SessionLogger.d.ts +41 -0
- package/dist-lib/main.d.ts +2 -0
- package/dist-lib/map/MapSelectionOverlay.d.ts +15 -0
- package/dist-lib/map/MapStore.d.ts +1067 -0
- package/dist-lib/map/MudixMapReader.d.ts +90 -0
- package/dist-lib/map/MudletHighlightOverlay.d.ts +18 -0
- package/dist-lib/map/mapImageExport.d.ts +26 -0
- package/dist-lib/map/mapParser.worker.d.ts +1 -0
- package/dist-lib/map/mapParserClient.d.ts +35 -0
- package/dist-lib/map/pathfinding.d.ts +52 -0
- package/dist-lib/map/xmlMapImport.d.ts +28 -0
- package/dist-lib/mud/MudSession.d.ts +236 -0
- package/dist-lib/mud/PatternEngine.d.ts +28 -0
- package/dist-lib/mud/aliases/AliasEngine.d.ts +15 -0
- package/dist-lib/mud/connection/LineAssembler.d.ts +84 -0
- package/dist-lib/mud/connection/MudClient.d.ts +268 -0
- package/dist-lib/mud/connection/PingTracker.d.ts +28 -0
- package/dist-lib/mud/connection/TelnetNegotiator.d.ts +188 -0
- package/dist-lib/mud/connection/telnetDebug.d.ts +54 -0
- package/dist-lib/mud/events.d.ts +160 -0
- package/dist-lib/mud/keybindings/KeyEngine.d.ts +36 -0
- package/dist-lib/mud/keybindings/browserReservedKeys.d.ts +45 -0
- package/dist-lib/mud/keybindings/qtKeys.d.ts +33 -0
- package/dist-lib/mud/protocol/charset.d.ts +105 -0
- package/dist-lib/mud/protocol/constants.d.ts +116 -0
- package/dist-lib/mud/protocol/echo.d.ts +63 -0
- package/dist-lib/mud/protocol/gmcp.d.ts +28 -0
- package/dist-lib/mud/protocol/index.d.ts +11 -0
- package/dist-lib/mud/protocol/mccp.d.ts +18 -0
- package/dist-lib/mud/protocol/mnes.d.ts +83 -0
- package/dist-lib/mud/protocol/msdp.d.ts +19 -0
- package/dist-lib/mud/protocol/msp.d.ts +47 -0
- package/dist-lib/mud/protocol/mssp.d.ts +25 -0
- package/dist-lib/mud/protocol/mxp.d.ts +188 -0
- package/dist-lib/mud/protocol/naws.d.ts +7 -0
- package/dist-lib/mud/replay/ReplayPlayer.d.ts +31 -0
- package/dist-lib/mud/replay/ReplayRecorder.d.ts +18 -0
- package/dist-lib/mud/replay/replayFormat.d.ts +49 -0
- package/dist-lib/mud/text/Console.d.ts +183 -0
- package/dist-lib/mud/text/FormatState.d.ts +256 -0
- package/dist-lib/mud/text/ansiEscapes.d.ts +88 -0
- package/dist-lib/mud/text/cellRender.d.ts +21 -0
- package/dist-lib/mud/text/colorParsers.d.ts +54 -0
- package/dist-lib/mud/text/colors.d.ts +31 -0
- package/dist-lib/mud/text/controlCharacterMode.d.ts +13 -0
- package/dist-lib/mud/text/controlChars.d.ts +31 -0
- package/dist-lib/mud/text/hyperlinkConfig.d.ts +164 -0
- package/dist-lib/mud/text/hyperlinkVisibility.d.ts +37 -0
- package/dist-lib/mud/text/oscLinkManager.d.ts +35 -0
- package/dist-lib/mud/text/wcwidth.d.ts +44 -0
- package/dist-lib/mud/text/xterm256.d.ts +2 -0
- package/dist-lib/mud/timers/TimerEngine.d.ts +61 -0
- package/dist-lib/mud/triggers/ChunkProcessor.d.ts +11 -0
- package/dist-lib/mud/triggers/TriggerEngine.d.ts +188 -0
- package/dist-lib/mud/triggers/pcre/Pcre2.d.ts +26 -0
- package/dist-lib/scripting/EngineHost.d.ts +152 -0
- package/dist-lib/scripting/GlobalEventChannel.d.ts +36 -0
- package/dist-lib/scripting/IScriptingRuntime.d.ts +95 -0
- package/dist-lib/scripting/MapOpenNotifier.d.ts +19 -0
- package/dist-lib/scripting/ScriptingAPI.d.ts +1691 -0
- package/dist-lib/scripting/ScriptingEngine.d.ts +806 -0
- package/dist-lib/scripting/StopwatchManager.d.ts +94 -0
- package/dist-lib/scripting/heldModifiers.d.ts +3 -0
- package/dist-lib/scripting/http/HttpService.d.ts +23 -0
- package/dist-lib/scripting/lua/LuaRuntime.d.ts +190 -0
- package/dist-lib/scripting/lua/bindings/automation.d.ts +10 -0
- package/dist-lib/scripting/lua/bindings/commandLine.d.ts +11 -0
- package/dist-lib/scripting/lua/bindings/context.d.ts +87 -0
- package/dist-lib/scripting/lua/bindings/cursor.d.ts +10 -0
- package/dist-lib/scripting/lua/bindings/diagnostics.d.ts +9 -0
- package/dist-lib/scripting/lua/bindings/map.d.ts +14 -0
- package/dist-lib/scripting/lua/bindings/media.d.ts +24 -0
- package/dist-lib/scripting/lua/bindings/output.d.ts +10 -0
- package/dist-lib/scripting/lua/bindings/packages.d.ts +10 -0
- package/dist-lib/scripting/lua/bindings/session.d.ts +16 -0
- package/dist-lib/scripting/lua/bindings/textEdit.d.ts +9 -0
- package/dist-lib/scripting/lua/bindings/userWindows.d.ts +11 -0
- package/dist-lib/scripting/lua/bindings/window.d.ts +10 -0
- package/dist-lib/scripting/lua/imageSize.d.ts +4 -0
- package/dist-lib/scripting/lua/luaCompletions.d.ts +9 -0
- package/dist-lib/scripting/lua/mudlet-lua/generic-mapper/generic_mapper.mpackage +0 -0
- package/dist-lib/scripting/lua/rex.d.ts +3 -0
- package/dist-lib/scripting/lua/sqlRowEncoder.d.ts +1 -0
- package/dist-lib/scripting/lua/yajl.d.ts +11 -0
- package/dist-lib/scripting/profilesPresence.d.ts +50 -0
- package/dist-lib/scripting/vfs/ProfileVFS.d.ts +62 -0
- package/dist-lib/scripting/vfs/cssRewrite.d.ts +21 -0
- package/dist-lib/scripting/vfs/folderHandleStore.d.ts +16 -0
- package/dist-lib/scripting/vfs/folderSync.d.ts +59 -0
- package/dist-lib/scripting/vfs/htmlRewrite.d.ts +26 -0
- package/dist-lib/scripting/vfs/vfsBridge.d.ts +16 -0
- package/dist-lib/services/cloudflare.d.ts +54 -0
- package/dist-lib/storage/appStore.d.ts +132 -0
- package/dist-lib/storage/crossTabSync.d.ts +3 -0
- package/dist-lib/storage/debouncedStorage.d.ts +18 -0
- package/dist-lib/storage/hooks.d.ts +17 -0
- package/dist-lib/storage/index.d.ts +4 -0
- package/dist-lib/storage/logExport.d.ts +32 -0
- package/dist-lib/storage/logStorage.d.ts +45 -0
- package/dist-lib/storage/mapStorage.d.ts +2 -0
- package/dist-lib/storage/profileVfsData.d.ts +47 -0
- package/dist-lib/storage/schema.d.ts +638 -0
- package/dist-lib/styles.css +2 -0
- package/dist-lib/ui/AboutModal.d.ts +8 -0
- package/dist-lib/ui/BrandLoginFields.d.ts +25 -0
- package/dist-lib/ui/BrandLoginScreen.d.ts +11 -0
- package/dist-lib/ui/CharLoginModal.d.ts +32 -0
- package/dist-lib/ui/CmdLineMenuRegistry.d.ts +27 -0
- package/dist-lib/ui/CodeEditorPreview.d.ts +19 -0
- package/dist-lib/ui/CommandBar.d.ts +17 -0
- package/dist-lib/ui/ConnectionFormModal.d.ts +13 -0
- package/dist-lib/ui/ConnectionGrid.d.ts +18 -0
- package/dist-lib/ui/ConnectionScreen.d.ts +14 -0
- package/dist-lib/ui/FileBrowserModal.d.ts +20 -0
- package/dist-lib/ui/FilePickerModal.d.ts +21 -0
- package/dist-lib/ui/FolderPermissionScreen.d.ts +16 -0
- package/dist-lib/ui/JsonPreview.d.ts +15 -0
- package/dist-lib/ui/LogBrowserModal.d.ts +7 -0
- package/dist-lib/ui/MapEditorModal.d.ts +9 -0
- package/dist-lib/ui/MarkdownPreview.d.ts +15 -0
- package/dist-lib/ui/MergeConflictModal.d.ts +17 -0
- package/dist-lib/ui/ModuleResolveModal.d.ts +22 -0
- package/dist-lib/ui/MouseEventRegistry.d.ts +31 -0
- package/dist-lib/ui/ProfileBusyScreen.d.ts +12 -0
- package/dist-lib/ui/ProfileExportModal.d.ts +7 -0
- package/dist-lib/ui/ProxyInfoModal.d.ts +6 -0
- package/dist-lib/ui/ProxyWhyModal.d.ts +6 -0
- package/dist-lib/ui/ProxyWizardModal.d.ts +6 -0
- package/dist-lib/ui/QuickOpenPalette.d.ts +8 -0
- package/dist-lib/ui/ResizableModal.d.ts +17 -0
- package/dist-lib/ui/ScriptingDocsModal.d.ts +12 -0
- package/dist-lib/ui/SettingsModal.d.ts +9 -0
- package/dist-lib/ui/Toolbar.d.ts +29 -0
- package/dist-lib/ui/bufferWords.d.ts +38 -0
- package/dist-lib/ui/buttons/ButtonsBar.d.ts +21 -0
- package/dist-lib/ui/cmdline/CommandLineManager.d.ts +97 -0
- package/dist-lib/ui/cmdline/CommandLineOverlay.d.ts +8 -0
- package/dist-lib/ui/codemirror/theme.d.ts +5 -0
- package/dist-lib/ui/commandHistory.d.ts +31 -0
- package/dist-lib/ui/components/Button.d.ts +9 -0
- package/dist-lib/ui/components/ConfirmDialog.d.ts +29 -0
- package/dist-lib/ui/components/ContextMenu.d.ts +9 -0
- package/dist-lib/ui/components/FontPicker.d.ts +9 -0
- package/dist-lib/ui/components/FormField.d.ts +16 -0
- package/dist-lib/ui/components/HelpTip.d.ts +7 -0
- package/dist-lib/ui/components/Input.d.ts +6 -0
- package/dist-lib/ui/components/Toggle.d.ts +10 -0
- package/dist-lib/ui/components/index.d.ts +9 -0
- package/dist-lib/ui/components/useModalFocus.d.ts +18 -0
- package/dist-lib/ui/labels/LabelManager.d.ts +220 -0
- package/dist-lib/ui/labels/LabelOverlay.d.ts +9 -0
- package/dist-lib/ui/labels/backgroundImageSize.d.ts +10 -0
- package/dist-lib/ui/labels/cursorShapes.d.ts +6 -0
- package/dist-lib/ui/labels/gifMovie.d.ts +100 -0
- package/dist-lib/ui/labels/qtCss.d.ts +57 -0
- package/dist-lib/ui/layout/ContentLayout.d.ts +19 -0
- package/dist-lib/ui/layout/DockArea.d.ts +14 -0
- package/dist-lib/ui/layout/DockedPanel.d.ts +13 -0
- package/dist-lib/ui/layout/FloatingWindowLayer.d.ts +10 -0
- package/dist-lib/ui/layout/MobileLayout.d.ts +22 -0
- package/dist-lib/ui/layout/PopoutWindow.d.ts +35 -0
- package/dist-lib/ui/layout/ScriptWindow.d.ts +29 -0
- package/dist-lib/ui/layout/SplitGroupPanel.d.ts +17 -0
- package/dist-lib/ui/layout/TabGroupPanel.d.ts +12 -0
- package/dist-lib/ui/layout/WindowContextMenu.d.ts +11 -0
- package/dist-lib/ui/layout/dockDetect.d.ts +26 -0
- package/dist-lib/ui/layout/overlayLayerOrder.d.ts +71 -0
- package/dist-lib/ui/markdown.d.ts +1 -0
- package/dist-lib/ui/output/CaretReviewPanel.d.ts +22 -0
- package/dist-lib/ui/output/OutputArea.d.ts +9 -0
- package/dist-lib/ui/output/OutputContextMenu.d.ts +23 -0
- package/dist-lib/ui/output/OutputRenderer.d.ts +64 -0
- package/dist-lib/ui/output/ScreenReaderLog.d.ts +23 -0
- package/dist-lib/ui/output/StickyOutputPanel.d.ts +28 -0
- package/dist-lib/ui/output/backgroundImageStyle.d.ts +17 -0
- package/dist-lib/ui/output/caretMode.d.ts +40 -0
- package/dist-lib/ui/output/linkNavigation.d.ts +29 -0
- package/dist-lib/ui/output/osc8Menu.d.ts +16 -0
- package/dist-lib/ui/output/outputCopy.d.ts +15 -0
- package/dist-lib/ui/preventPinchZoom.d.ts +1 -0
- package/dist-lib/ui/scrollbox/ScrollBoxManager.d.ts +62 -0
- package/dist-lib/ui/scrollbox/ScrollBoxOverlay.d.ts +25 -0
- package/dist-lib/ui/sound/SoundManager.d.ts +149 -0
- package/dist-lib/ui/sound/closedCaption.d.ts +37 -0
- package/dist-lib/ui/textedit/TextEditManager.d.ts +56 -0
- package/dist-lib/ui/tts/TtsManager.d.ts +68 -0
- package/dist-lib/ui/useBrandLogin.d.ts +19 -0
- package/dist-lib/ui/useCommandHistory.d.ts +7 -0
- package/dist-lib/ui/video/VideoManager.d.ts +56 -0
- package/dist-lib/ui/windows/ScriptEditorModal.d.ts +13 -0
- package/dist-lib/ui/windows/WindowManager.d.ts +694 -0
- package/dist-lib/ui/windows/panels/HtmlPanel.d.ts +27 -0
- package/dist-lib/ui/windows/panels/LuaEditor.d.ts +14 -0
- package/dist-lib/ui/windows/panels/MapPanel.d.ts +8 -0
- package/dist-lib/ui/windows/panels/PackageRepositoryModal.d.ts +18 -0
- package/dist-lib/ui/windows/panels/ScriptEditorPanel.d.ts +24 -0
- package/dist-lib/ui/windows/panels/ScriptSearch.d.ts +12 -0
- package/dist-lib/ui/windows/panels/TextPanel.d.ts +35 -0
- package/dist-lib/ui/windows/panels/VariablesView.d.ts +21 -0
- package/dist-lib/ui/windows/panels/VfsModulePickerModal.d.ts +8 -0
- package/dist-lib/ui/windows/panels/WindowCmdLine.d.ts +23 -0
- package/dist-lib/ui/windows/types.d.ts +145 -0
- package/dist-lib/utils/documentTitle.d.ts +33 -0
- package/dist-lib/utils/fontLoader.d.ts +52 -0
- package/dist-lib/utils/profileLock.d.ts +26 -0
- package/dist-lib/utils/sessionCredentials.d.ts +16 -0
- package/dist-lib/version.d.ts +39 -0
- package/dist-lib/vfs-sw.js +131 -0
- package/dist-lib/vite.d.ts +2 -0
- package/dist-lib/vite.js +154 -0
- package/package.json +93 -0
package/dist-lib/vite.js
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { nodePolyfills } from 'vite-plugin-node-polyfills';
|
|
6
|
+
/**
|
|
7
|
+
* The `@mudlet/mudlet-web/vite` companion plugin. The library leaves all of its
|
|
8
|
+
* heavyweight dependencies external, so the consumer's Vite processes them —
|
|
9
|
+
* and needs the same handling the app build has: the pcre2 WASM file
|
|
10
|
+
* at the site root, node polyfills on the main thread and in workers, and the
|
|
11
|
+
* VFS service worker emitted into the output. One plugin call supplies all of
|
|
12
|
+
* it:
|
|
13
|
+
*
|
|
14
|
+
* import mudletWeb from '@mudlet/mudlet-web/vite';
|
|
15
|
+
* export default defineConfig({ plugins: [mudletWeb(), react()] });
|
|
16
|
+
*
|
|
17
|
+
* Mudlet Web's own vite.config.ts uses this plugin too (imported from source), so
|
|
18
|
+
* the app build and consumer builds can't drift apart.
|
|
19
|
+
*/
|
|
20
|
+
const require = createRequire(import.meta.url);
|
|
21
|
+
const POLYFILLS = ['buffer', 'stream', 'events', 'util'];
|
|
22
|
+
/** vfs-sw.js ships next to the compiled plugin in dist-lib (consumers) and in
|
|
23
|
+
* public/ when running from the mudix repo itself (source import). */
|
|
24
|
+
function resolveVfsSwPath() {
|
|
25
|
+
for (const rel of ['./vfs-sw.js', '../public/vfs-sw.js']) {
|
|
26
|
+
const p = fileURLToPath(new URL(rel, import.meta.url));
|
|
27
|
+
if (existsSync(p))
|
|
28
|
+
return p;
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
/** Serves libpcre2.wasm at the root URL in dev (where emscripten looks for it
|
|
33
|
+
* when document.currentScript is null) and emits it to the build output.
|
|
34
|
+
* Resolved from wherever pcre2-wasm-universal lives relative to mudix. */
|
|
35
|
+
function pcre2WasmPlugin() {
|
|
36
|
+
// The wasm file isn't in the package's exports map — resolve the exported
|
|
37
|
+
// ./libpcre2 entry (dist/libpcre2.js) and take its sibling.
|
|
38
|
+
const wasmPath = join(dirname(require.resolve('pcre2-wasm-universal/libpcre2')), 'libpcre2.wasm');
|
|
39
|
+
return {
|
|
40
|
+
name: 'mudix:pcre2-wasm',
|
|
41
|
+
configureServer(server) {
|
|
42
|
+
server.middlewares.use((req, res, next) => {
|
|
43
|
+
if (req.url === '/libpcre2.wasm') {
|
|
44
|
+
res.setHeader('Content-Type', 'application/wasm');
|
|
45
|
+
res.end(readFileSync(wasmPath));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
next();
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
generateBundle() {
|
|
52
|
+
this.emitFile({
|
|
53
|
+
type: 'asset',
|
|
54
|
+
fileName: 'libpcre2.wasm',
|
|
55
|
+
source: readFileSync(wasmPath),
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** Serves/emits the VFS service worker at the site root so
|
|
61
|
+
* `registerVfsServiceWorker()` (called by MudletWebApp) finds it. Skipped when
|
|
62
|
+
* the consumer already ships its own copy in public/ — as the standalone
|
|
63
|
+
* mudix app does. */
|
|
64
|
+
function vfsServiceWorkerPlugin() {
|
|
65
|
+
const swPath = resolveVfsSwPath();
|
|
66
|
+
let skip = false;
|
|
67
|
+
return {
|
|
68
|
+
name: 'mudix:vfs-sw',
|
|
69
|
+
configResolved(config) {
|
|
70
|
+
skip = !swPath || (!!config.publicDir && existsSync(join(config.publicDir, 'vfs-sw.js')));
|
|
71
|
+
},
|
|
72
|
+
configureServer(server) {
|
|
73
|
+
server.middlewares.use((req, res, next) => {
|
|
74
|
+
if (!skip && swPath && req.url?.split('?')[0] === '/vfs-sw.js') {
|
|
75
|
+
res.setHeader('Content-Type', 'text/javascript');
|
|
76
|
+
res.end(readFileSync(swPath));
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
next();
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
generateBundle() {
|
|
83
|
+
if (skip || !swPath)
|
|
84
|
+
return;
|
|
85
|
+
this.emitFile({
|
|
86
|
+
type: 'asset',
|
|
87
|
+
fileName: 'vfs-sw.js',
|
|
88
|
+
source: readFileSync(swPath, 'utf8'),
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
export default function mudix() {
|
|
94
|
+
return [
|
|
95
|
+
{
|
|
96
|
+
name: 'mudix:config',
|
|
97
|
+
config: () => ({
|
|
98
|
+
optimizeDeps: {
|
|
99
|
+
// 'mudix': the library entry carries relative `?url` asset
|
|
100
|
+
// imports (external in the lib build); the dep optimizer's
|
|
101
|
+
// scanner treats the query as part of a filesystem path and
|
|
102
|
+
// dies on Windows (os error 123). Excluded, mudix is served
|
|
103
|
+
// through Vite's transform pipeline in dev, where `?url`
|
|
104
|
+
// works. Harmless in mudix's own repo (not a dep there).
|
|
105
|
+
exclude: ['pcre2-wasm-universal', '@mudlet/mudlet-web'],
|
|
106
|
+
// CJS deps reached from the excluded mudix entry must be
|
|
107
|
+
// pre-bundled explicitly (Vite doesn't interop CJS served
|
|
108
|
+
// raw). Extend this list if dev mode reports "does not
|
|
109
|
+
// provide an export named ..." for another dependency.
|
|
110
|
+
//
|
|
111
|
+
// 'mudlet-map-editor' stands for its whole subtree rather
|
|
112
|
+
// than the individual CJS leaves: the editor pulls in
|
|
113
|
+
// react-i18next, whose own deps (use-sync-external-store,
|
|
114
|
+
// html-parse-stringify > void-elements) are CJS, and which
|
|
115
|
+
// of them trips first depends on evaluation order. Listing
|
|
116
|
+
// the editor pre-bundles the lot in one go — and mirrors
|
|
117
|
+
// mudix's own dev server, where the scanner finds the
|
|
118
|
+
// `import('mudlet-map-editor')` in MapEditorModal and
|
|
119
|
+
// pre-bundles it anyway. Bare package names only, no
|
|
120
|
+
// subpaths: `mudlet-map-renderer/bigmap` and friends only
|
|
121
|
+
// exist in newer versions, and an unresolvable `include`
|
|
122
|
+
// entry is a hard dev-server startup failure.
|
|
123
|
+
include: [
|
|
124
|
+
'eventemitter3',
|
|
125
|
+
'wasmoon-lua5.1',
|
|
126
|
+
'@zenfs/core > readable-stream',
|
|
127
|
+
'mudlet-map-editor',
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
// Workers don't inherit `plugins`; re-declare nodePolyfills so
|
|
131
|
+
// the map parser worker (Buffer) gets the same shim it gets on
|
|
132
|
+
// the main thread.
|
|
133
|
+
worker: {
|
|
134
|
+
format: 'es',
|
|
135
|
+
plugins: () => [nodePolyfills({ include: POLYFILLS })],
|
|
136
|
+
},
|
|
137
|
+
build: {
|
|
138
|
+
rollupOptions: {
|
|
139
|
+
onwarn(warning, defaultHandler) {
|
|
140
|
+
if (warning.code === 'COMMONJS_VARIABLE_IN_ESM' &&
|
|
141
|
+
warning.id?.includes('pcre2-wasm-universal')) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
defaultHandler(warning);
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
}),
|
|
149
|
+
},
|
|
150
|
+
nodePolyfills({ include: POLYFILLS }),
|
|
151
|
+
pcre2WasmPlugin(),
|
|
152
|
+
vfsServiceWorkerPlugin(),
|
|
153
|
+
];
|
|
154
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mudlet/mudlet-web",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Mudlet Web — Mudlet in the browser, usable standalone or as a library for branded builds",
|
|
6
|
+
"license": "GPL-2.0-or-later",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"mud",
|
|
9
|
+
"mudlet",
|
|
10
|
+
"mud-client",
|
|
11
|
+
"telnet",
|
|
12
|
+
"lua",
|
|
13
|
+
"game"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/Mudlet/mudlet-web",
|
|
16
|
+
"repository": {
|
|
17
|
+
"url": "git+https://github.com/Mudlet/mudlet-web.git"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist-lib/index.d.ts",
|
|
25
|
+
"import": "./dist-lib/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./vite": {
|
|
28
|
+
"types": "./dist-lib/vite.d.ts",
|
|
29
|
+
"import": "./dist-lib/vite.js"
|
|
30
|
+
},
|
|
31
|
+
"./styles.css": "./dist-lib/styles.css"
|
|
32
|
+
},
|
|
33
|
+
"main": "./dist-lib/index.js",
|
|
34
|
+
"types": "./dist-lib/index.d.ts",
|
|
35
|
+
"files": [
|
|
36
|
+
"dist-lib"
|
|
37
|
+
],
|
|
38
|
+
"scripts": {
|
|
39
|
+
"dev": "vite",
|
|
40
|
+
"build": "tsc && vite build",
|
|
41
|
+
"build:lib": "vite build --config vite.lib.config.ts && tsc -p tsconfig.lib.json && tsc -p tsconfig.vite-plugin.json && node scripts/copy-lib-assets.mjs",
|
|
42
|
+
"prepublishOnly": "yarn build:lib",
|
|
43
|
+
"preview": "vite preview",
|
|
44
|
+
"typecheck": "tsc -p tsconfig.test.json",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"test:watch": "vitest",
|
|
47
|
+
"dev:busted": "vite --mode busted --port 5174 --strictPort",
|
|
48
|
+
"pretest:e2e": "npm run gen:busted-manifest",
|
|
49
|
+
"test:e2e": "playwright test",
|
|
50
|
+
"gen:busted-manifest": "playwright test -c playwright.manifest.config.ts",
|
|
51
|
+
"sync:mudlet-specs": "node scripts/sync-mudlet-specs.mjs"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@codemirror/autocomplete": "^6.20.1",
|
|
55
|
+
"@codemirror/commands": "^6.10.3",
|
|
56
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
57
|
+
"@codemirror/language": "^6.12.3",
|
|
58
|
+
"@codemirror/legacy-modes": "^6.5.2",
|
|
59
|
+
"@codemirror/state": "^6.6.0",
|
|
60
|
+
"@codemirror/theme-one-dark": "^6.1.3",
|
|
61
|
+
"@codemirror/view": "^6.41.1",
|
|
62
|
+
"@sqlite.org/sqlite-wasm": "^3.53.0-build1",
|
|
63
|
+
"@types/dompurify": "^3.0.5",
|
|
64
|
+
"@zenfs/core": "^2.5.6",
|
|
65
|
+
"@zenfs/dom": "^1.2.9",
|
|
66
|
+
"dompurify": "^3.4.12",
|
|
67
|
+
"fflate": "^0.8.2",
|
|
68
|
+
"lucide-react": "^1.14.0",
|
|
69
|
+
"marked": "^18.0.4",
|
|
70
|
+
"mudlet-map-binary-reader": "^1.2.0",
|
|
71
|
+
"mudlet-map-editor": "^1.3.1",
|
|
72
|
+
"mudlet-map-renderer": "^2.6.1",
|
|
73
|
+
"pako": "^2.1.0",
|
|
74
|
+
"pcre2-wasm-universal": "^1.0.0",
|
|
75
|
+
"react": "^19.2.0",
|
|
76
|
+
"react-dom": "^19.2.0",
|
|
77
|
+
"vite-plugin-node-polyfills": "^0.26.0",
|
|
78
|
+
"wasmoon-lua5.1": "^1.18.10",
|
|
79
|
+
"zustand": "^5.0.12"
|
|
80
|
+
},
|
|
81
|
+
"devDependencies": {
|
|
82
|
+
"@playwright/test": "^1.61.1",
|
|
83
|
+
"@types/node": "^25.6.0",
|
|
84
|
+
"@types/pako": "^2.0.0",
|
|
85
|
+
"@types/react": "^19.2.0",
|
|
86
|
+
"@types/react-dom": "^19.2.0",
|
|
87
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
88
|
+
"happy-dom": "^20.9.0",
|
|
89
|
+
"typescript": "^5.0.0",
|
|
90
|
+
"vite": "8.0.16",
|
|
91
|
+
"vitest": "^4.1.7"
|
|
92
|
+
}
|
|
93
|
+
}
|