From 0b157ddd1bb12df42baa1525237271f1e85fb2e9 Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Thu, 24 Aug 2023 18:00:02 -0500 Subject: [PATCH 01/16] Changed ansi parser to use SAUCE width when available --- core/art.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/core/art.js b/core/art.js index 5e46591c..6a4da757 100644 --- a/core/art.js +++ b/core/art.js @@ -46,6 +46,16 @@ function getFontNameFromSAUCE(sauce) { } } +function getWidthFromSAUCE(sauce) { + if (sauce.Character) { + let sauceWidth = _.toNumber(sauce.Character.characterWidth); + if(!(_.isNaN(sauceWidth) && sauceWidth > 0)) { + return sauceWidth; + } + } + return null; +} + function sliceAtEOF(data, eofMarker) { let eof = data.length; const stopPos = Math.max(data.length - 256, 0); // 256 = 2 * sizeof(SAUCE) @@ -270,10 +280,18 @@ function display(client, art, options, cb) { } } + // Use width from SAUCE if available - if the width is less than the term width, + // we need to set that as the width for the parser so that wide terminals + // display correctly + let parseWidth = getWidthFromSAUCE(options.sauce); + if(_.isNil(parseWidth) || parseWidth > client.term.termWidth) { + parseWidth = client.term.termWidth; + } + const ansiParser = new aep.ANSIEscapeParser({ mciReplaceChar: options.mciReplaceChar, termHeight: client.term.termHeight, - termWidth: client.term.termWidth, + termWidth: parseWidth, trailingLF: options.trailingLF, startRow: options.startRow, }); From ccaaa71e2367176e8a481acb47e33c0dc0450398 Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Fri, 25 Aug 2023 14:24:47 -0500 Subject: [PATCH 02/16] Make the terminal go to new line if the width of the term is greater than the art width --- core/ansi_escape_parser.js | 21 ++++++++++++++------- core/art.js | 11 ++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/core/ansi_escape_parser.js b/core/ansi_escape_parser.js index 27d5490d..76dc15b5 100644 --- a/core/ansi_escape_parser.js +++ b/core/ansi_escape_parser.js @@ -37,6 +37,10 @@ function ANSIEscapeParser(options) { this.mciReplaceChar = miscUtil.valueWithDefault(options.mciReplaceChar, ''); this.termHeight = miscUtil.valueWithDefault(options.termHeight, 25); this.termWidth = miscUtil.valueWithDefault(options.termWidth, 80); + this.breakWidth = this.termWidth; + if(!(_.isNil(options.artWidth)) && options.artWidth > 0 && options.artWidth < this.breakWidth) { + this.breakWidth = options.artWidth; + } this.trailingLF = miscUtil.valueWithDefault(options.trailingLF, 'default'); this.row = Math.min(options?.startRow ?? 1, this.termHeight); @@ -90,8 +94,8 @@ function ANSIEscapeParser(options) { switch (charCode) { case CR: - self.emit('literal', text.slice(start, pos)); - start = pos; + self.emit('literal', text.slice(start, pos + 1)); + start = pos + 1; self.column = 1; @@ -105,8 +109,8 @@ function ANSIEscapeParser(options) { self.column = 1; } - self.emit('literal', text.slice(start, pos)); - start = pos; + self.emit('literal', text.slice(start, pos + 1)); + start = pos + 1; self.row += 1; @@ -114,13 +118,16 @@ function ANSIEscapeParser(options) { break; default: - if (self.column === self.termWidth) { + if (self.column === self.breakWidth) { self.emit('literal', text.slice(start, pos + 1)); start = pos + 1; + // If the art is terminal, then we need to force the terminal to go to the next line. + if(self.column < self.termWidth) { + self.emit('literal', '\r\n'); + } self.column = 1; self.row += 1; - self.positionUpdated(); } else { self.column += 1; @@ -135,7 +142,7 @@ function ANSIEscapeParser(options) { // // Finalize this chunk // - if (self.column > self.termWidth) { + if (self.column > self.breakWidth) { self.column = 1; self.row += 1; diff --git a/core/art.js b/core/art.js index 6a4da757..100f2404 100644 --- a/core/art.js +++ b/core/art.js @@ -280,18 +280,11 @@ function display(client, art, options, cb) { } } - // Use width from SAUCE if available - if the width is less than the term width, - // we need to set that as the width for the parser so that wide terminals - // display correctly - let parseWidth = getWidthFromSAUCE(options.sauce); - if(_.isNil(parseWidth) || parseWidth > client.term.termWidth) { - parseWidth = client.term.termWidth; - } - const ansiParser = new aep.ANSIEscapeParser({ mciReplaceChar: options.mciReplaceChar, termHeight: client.term.termHeight, - termWidth: parseWidth, + termWidth: client.term.termWidth, + artWidth: getWidthFromSAUCE(options.sauce), trailingLF: options.trailingLF, startRow: options.startRow, }); From 7d46607ddc0150adf962664e3bca5fe21b61b731 Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Fri, 25 Aug 2023 14:33:28 -0500 Subject: [PATCH 03/16] Updated the WHATSNEW to include info about the art change. --- WHATSNEW.md | 1 + 1 file changed, 1 insertion(+) diff --git a/WHATSNEW.md b/WHATSNEW.md index 060bf502..107bd533 100644 --- a/WHATSNEW.md +++ b/WHATSNEW.md @@ -9,6 +9,7 @@ This document attempts to track **major** changes and additions in ENiGMA½. For * Finally, the system will search for `index.html` and `index.htm` in that order, if another suitable route cannot be established. * CombatNet has shut down, so the module (`combatnet.js`) has been removed. * The Menu Flag `popParent` has been removed and `noHistory` has been updated to work as expected. In general things should "Just Work", but check your `menu.hjson` entries if you see menu stack issues. +* Art handling has been changed to respect the art width contained in SAUCE when present in the case where the terminal width is greater than the art width. This fixes art files that assume wrapping at 80 columns on wide (mostly new utf8) terminals. ## 0.0.13-beta * **Note for contributors**: ENiGMA has switched to [Prettier](https://prettier.io) for formatting/style. Please see [CONTRIBUTING](CONTRIBUTING.md) and the Prettier website for more information. From bf0bf830535c13aff64fbf556e54ad1f062d271f Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Fri, 25 Aug 2023 14:38:32 -0500 Subject: [PATCH 04/16] Small logic change to improve SAUCE handling --- core/art.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/art.js b/core/art.js index 100f2404..2261585f 100644 --- a/core/art.js +++ b/core/art.js @@ -49,7 +49,7 @@ function getFontNameFromSAUCE(sauce) { function getWidthFromSAUCE(sauce) { if (sauce.Character) { let sauceWidth = _.toNumber(sauce.Character.characterWidth); - if(!(_.isNaN(sauceWidth) && sauceWidth > 0)) { + if(!(_.isNaN(sauceWidth)) && sauceWidth > 0) { return sauceWidth; } } From 8758722b6b7b3ebc1956031ec9eefcd2c6c2c73b Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Fri, 25 Aug 2023 18:34:45 -0500 Subject: [PATCH 05/16] Fixed PR review comments --- core/ansi_escape_parser.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/ansi_escape_parser.js b/core/ansi_escape_parser.js index 76dc15b5..99411102 100644 --- a/core/ansi_escape_parser.js +++ b/core/ansi_escape_parser.js @@ -38,7 +38,9 @@ function ANSIEscapeParser(options) { this.termHeight = miscUtil.valueWithDefault(options.termHeight, 25); this.termWidth = miscUtil.valueWithDefault(options.termWidth, 80); this.breakWidth = this.termWidth; - if(!(_.isNil(options.artWidth)) && options.artWidth > 0 && options.artWidth < this.breakWidth) { + // toNumber takes care of null, undefined etc as well. + let artWidth = _.toNumber(options.artWidth); + if(!(_.isNaN(artWidth)) && artWidth > 0 && artWidth < this.breakWidth) { this.breakWidth = options.artWidth; } this.trailingLF = miscUtil.valueWithDefault(options.trailingLF, 'default'); @@ -122,7 +124,7 @@ function ANSIEscapeParser(options) { self.emit('literal', text.slice(start, pos + 1)); start = pos + 1; - // If the art is terminal, then we need to force the terminal to go to the next line. + // If we hit breakWidth before termWidth then we need to force the terminal to go to the next line. if(self.column < self.termWidth) { self.emit('literal', '\r\n'); } From adc2e1ba98805b193b1aa6790cf29cd9ef4dc049 Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Sat, 26 Aug 2023 10:37:12 -0500 Subject: [PATCH 06/16] Fixed Dockerfile to run on Windows --- docker/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index b53c72df..82815691 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -21,6 +21,7 @@ RUN apt-get update \ lhasa \ unrar-free \ p7zip-full \ + dos2unix \ && npm install -g pm2 \ && cd /enigma-bbs && npm install --only=production \ && pm2 start main.js \ @@ -37,6 +38,7 @@ RUN apt-get update \ # sexyz COPY docker/bin/sexyz /usr/local/bin +RUN dos2unix /enigma-bbs/docker/bin/docker-entrypoint.sh && apt-get remove dos2unix -y RUN chmod +x /enigma-bbs/docker/bin/docker-entrypoint.sh # enigma storage mounts From 1d00482b0283f3e9293f13506b01e7a3610da361 Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Sat, 26 Aug 2023 10:54:39 -0500 Subject: [PATCH 07/16] Updated node & added .dockerignore --- .dockerignore | 3 +++ docker/Dockerfile | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..960be9a0 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +package-lock.json +yarn.lock \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index 82815691..c09b7a5c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM node:14-buster-slim +FROM node:18-buster-slim LABEL maintainer="dave@force9.org" @@ -22,8 +22,9 @@ RUN apt-get update \ unrar-free \ p7zip-full \ dos2unix \ + && npm install -g npm@latest \ && npm install -g pm2 \ - && cd /enigma-bbs && npm install --only=production \ + && cd /enigma-bbs && npm install \ && pm2 start main.js \ && mkdir -p /enigma-bbs-pre/art \ && mkdir /enigma-bbs-pre/mods \ From 80dcc14a50a6cea293214b48af8337207ce470a5 Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Sat, 26 Aug 2023 11:05:39 -0500 Subject: [PATCH 08/16] Small doc change to add running custom container --- docs/_docs/installation/docker.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/_docs/installation/docker.md b/docs/_docs/installation/docker.md index a6959b81..f2f7affa 100644 --- a/docs/_docs/installation/docker.md +++ b/docs/_docs/installation/docker.md @@ -71,5 +71,9 @@ Customising the Docker image is easy! 1. Clone the ENiGMA-BBS source. 2. Build the image ```bash -docker build -f ./docker/Dockerfile . +docker build -t enigmabbs -f ./docker/Dockerfile . +``` +3. Run the image +```bash +docker run -it -p 8888:8888 --name "ENiGMABBS" -v "$(pwd)/config:/enigma-bbs/config" -v "$(pwd)/db:/enigma-bbs/db" -v "$(pwd)/logs:/enigma-bbs/logs" -v "$(pwd)/filebase:/enigma-bbs/filebase" -v "$(pwd)/art:/enigma-bbs/art" -v "$(pwd)/mods:/enigma-bbs/mods" -v "$(pwd)/mail:/mail" enigmabbs ``` From 13ae7789a5f857011c2480ec1ae06f0051353e1d Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Sat, 26 Aug 2023 20:03:48 -0500 Subject: [PATCH 09/16] No need to copy the ephemeral directories --- .dockerignore | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.dockerignore b/.dockerignore index 960be9a0..749db005 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,12 @@ node_modules package-lock.json -yarn.lock \ No newline at end of file +yarn.lock + +filebase +db +drop +file_base +logs +mail +docs/_site +docs/.sass-cache \ No newline at end of file From 5ba1ca14642cc70b1392779b9d1016ce37140220 Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Sun, 27 Aug 2023 12:25:36 -0500 Subject: [PATCH 10/16] Initial devcontainer setup --- .devcontainer/Dockerfile | 9 +++++++++ .devcontainer/devcontainer.json | 14 ++++++++++++++ .gitattributes | 10 ++++++++++ .gitignore | 3 +-- .vscode/launch.json | 17 +++++++++++++++++ 5 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .vscode/launch.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..b095a6df --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,9 @@ +FROM library/node:lts-bookworm + +ARG DEBIAN_FRONTEND=noninteractive +RUN apt update \ + && apt install -y --no-install-recommends sudo \ + && apt autoremove -y \ + && rm -rf /var/lib/apt/lists/* \ + && echo "node ALL=(ALL) NOPASSWD: ALL" >/etc/sudoers.d/node \ + && chmod 0440 /etc/sudoers.d/node diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..52828b2b --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,14 @@ +{ + "name": "Basic Node.js", + "build": { "dockerfile": "Dockerfile" }, +"remoteUser": "node", +"features": { + "ghcr.io/devcontainers/features/python:1": { + "installTools": true, + "version": "3.11" + }, + "ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {}, + "ghcr.io/jungaretti/features/ripgrep:1": {}, + "ghcr.io/warrenbuckley/codespace-features/sqlite:1": {} +} +} diff --git a/.gitattributes b/.gitattributes index b1892ede..5463d1aa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,3 +6,13 @@ *.TXT eol=crlf *.diz eol=crlf *.DIZ eol=crlf + +# Don't mess with shell script line endings +*.sh text eol=lf + +# Same thing for optutil.js which functions as a shell script +optutil.js text eol=lf + +# The devcontainer is also unix +.devcontainer/Dockerfile text eol=lf +.devcontainer/devcontainer.json text eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore index b55cbcfa..2d3facac 100644 --- a/.gitignore +++ b/.gitignore @@ -10,5 +10,4 @@ logs/ mail/ node_modules/ docs/_site/ -docs/.sass-cache/ -.vscode/ +docs/.sass-cache/ \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 00000000..c52eeffb --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "type": "node", + "request": "launch", + "name": "Launch Program", + "skipFiles": [ + "/**" + ], + "program": "${workspaceFolder}/main.js" + } + ] +} \ No newline at end of file From 97ae34a9713b7f3024e3308a09d59eaa60e7d3ed Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sun, 27 Aug 2023 17:31:35 -0600 Subject: [PATCH 11/16] Quick fix on SAUCE --- core/art.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/art.js b/core/art.js index 2261585f..2145f5ad 100644 --- a/core/art.js +++ b/core/art.js @@ -41,13 +41,13 @@ const SUPPORTED_ART_TYPES = { }; function getFontNameFromSAUCE(sauce) { - if (sauce.Character) { + if (sauce && sauce.Character) { return sauce.Character.fontName; } } function getWidthFromSAUCE(sauce) { - if (sauce.Character) { + if (sauce && sauce.Character) { let sauceWidth = _.toNumber(sauce.Character.characterWidth); if(!(_.isNaN(sauceWidth)) && sauceWidth > 0) { return sauceWidth; From 8a6506c475cb62ed4ff4c88ad8d69418beaa0a3f Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Sun, 27 Aug 2023 19:04:17 -0500 Subject: [PATCH 12/16] Additional changes needed to run --- .devcontainer/Dockerfile | 2 +- .devcontainer/devcontainer.json | 11 ++++++++--- .vscode/launch.json | 6 ++++++ .vscode/tasks.json | 25 +++++++++++++++++++++++++ docs/Gemfile | 1 + 5 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 .vscode/tasks.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b095a6df..fcb42c10 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,7 +2,7 @@ FROM library/node:lts-bookworm ARG DEBIAN_FRONTEND=noninteractive RUN apt update \ - && apt install -y --no-install-recommends sudo \ + && apt install -y --no-install-recommends sudo telnet \ && apt autoremove -y \ && rm -rf /var/lib/apt/lists/* \ && echo "node ALL=(ALL) NOPASSWD: ALL" >/etc/sudoers.d/node \ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 52828b2b..f6ab6d83 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,14 +1,19 @@ { "name": "Basic Node.js", "build": { "dockerfile": "Dockerfile" }, -"remoteUser": "node", +"remoteUser": "root", +"forwardPorts": [8888, 4000], +"postCreateCommand": "gem install jekyll bundler && /bin/rm -rf node_modules && npm install && cd docs && bundle install && cd ..", "features": { "ghcr.io/devcontainers/features/python:1": { "installTools": true, - "version": "3.11" + "version": "latest" }, "ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {}, "ghcr.io/jungaretti/features/ripgrep:1": {}, - "ghcr.io/warrenbuckley/codespace-features/sqlite:1": {} + "ghcr.io/warrenbuckley/codespace-features/sqlite:1": {}, + "ghcr.io/devcontainers/features/ruby:1": { + "version": "3.1" + } } } diff --git a/.vscode/launch.json b/.vscode/launch.json index c52eeffb..9b1822fd 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,6 +4,12 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ + { + "name": "Browse local Documentation - Chrome", + "request": "attach", + "type": "chrome", + "url": "http://localhost:4000/enigma-bbs/" + }, { "type": "node", "request": "launch", diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 00000000..c0880b20 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,25 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Start Jekyll (ENiGMA½ documentation server)", + "command": "cd docs && bundle exec jekyll serve", + "type": "shell" + }, + { + "label": "(re)build Jekyll bundles", + "command": "cd docs && bundle install", + "type": "shell" + }, + { + "label": "(re)build node modules", + "command": "/bin/rm -rf node_modules && npm install", + "type": "shell" + }, + { + "label": "ENiGMA½ new configuration", + "command": "./oputil.js config new", + "type": "shell" + } + ] +} \ No newline at end of file diff --git a/docs/Gemfile b/docs/Gemfile index ec96435d..ed87567f 100644 --- a/docs/Gemfile +++ b/docs/Gemfile @@ -30,3 +30,4 @@ end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] +gem "webrick" \ No newline at end of file From 5f0a03638e9195ea59830ac80e9cd04f8f0f97b7 Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Mon, 28 Aug 2023 13:08:54 -0500 Subject: [PATCH 13/16] Added some handy extensions and tasks --- .devcontainer/devcontainer.json | 5 +++++ .vscode/tasks.json | 1 + 2 files changed, 6 insertions(+) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f6ab6d83..57d83312 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -15,5 +15,10 @@ "ghcr.io/devcontainers/features/ruby:1": { "version": "3.1" } +}, +"customizations": { + "vscode": { + "extensions": ["ms-azuretools.vscode-docker","alexcvzz.vscode-sqlite","yzhang.markdown-all-in-one", "DavidAnson.vscode-markdownlint", "christian-kohler.npm-intellisense", "dbaeumer.vscode-eslint", "bierner.markdown-yaml-preamble"] + } } } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index c0880b20..8f033263 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,6 +4,7 @@ { "label": "Start Jekyll (ENiGMA½ documentation server)", "command": "cd docs && bundle exec jekyll serve", + "isBackground": true, "type": "shell" }, { From 602d693cafc5a55c43fb0e19ba63110e17184ffa Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Mon, 28 Aug 2023 13:10:38 -0500 Subject: [PATCH 14/16] Added additional local extensions --- .vscode/extensions.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 00000000..bfd63065 --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + "recommendations": [ + "ms-vscode-remote.remote-containers", + "laktak.hjson" + ] +} \ No newline at end of file From c2d7abc94e19ca48c90c42b8ea2e3da7dd51149d Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Mon, 28 Aug 2023 14:17:47 -0500 Subject: [PATCH 15/16] Removed browse task as it won't run without debugging --- .vscode/launch.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 9b1822fd..c52eeffb 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -4,12 +4,6 @@ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ - { - "name": "Browse local Documentation - Chrome", - "request": "attach", - "type": "chrome", - "url": "http://localhost:4000/enigma-bbs/" - }, { "type": "node", "request": "launch", From 1bd328452b86be7814eddbf667b9871e802f9981 Mon Sep 17 00:00:00 2001 From: Nathan Byrd Date: Mon, 28 Aug 2023 15:39:19 -0500 Subject: [PATCH 16/16] Added documentation for development setup --- docs/_config.yml | 1 + docs/_docs/installation/development.md | 38 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 docs/_docs/installation/development.md diff --git a/docs/_config.yml b/docs/_config.yml index 8520d124..34a77aa3 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -54,6 +54,7 @@ collections: - installation/network.md - installation/testing.md - installation/production.md + - installation/development.md - configuration/creating-config.md - configuration/sysop-setup.md - configuration/config-files.md diff --git a/docs/_docs/installation/development.md b/docs/_docs/installation/development.md new file mode 100644 index 00000000..ac27b528 --- /dev/null +++ b/docs/_docs/installation/development.md @@ -0,0 +1,38 @@ +--- +layout: page +title: Development Environment Setup +--- +_Note:_ This is only useful for people who are looking to contribute to the ENiGMA½ source base itself. Those that are just setting up a new BBS system do not need this section. + +The easiest way to get started with development on ENiGMA½ is via the pre-configured Visual Studio Code remote docker container environment. This setup will download and configure everything needed with minimal interaction. It also works cross-platform. + +* Install [Visual Studio Code](https://code.visualstudio.com/download) +* Install [Docker](https://docs.docker.com/engine/install/) +* Clone the [ENiGMA½](https://github.com/NuSkooler/enigma-bbs) repository. +* Choose "Open Folder" from Visual Studio Code and open the location where you cloned the repository. + +That's it! Visual Studio Code should prompt you for everything else that is needed, including some useful extensions for development. + +## Tasks + +Once it completes, there are a few tasks and run-configs that are useful. Open up the command pallete and search/choose "Tasks> Run Task". From there you can run the following tasks: + +### Start Jekyll (ENiGMA½ documentation server) + +This task will start the Jekyll server to perform local testing of changes to documentation. After running this task, open a browser to (http://localhost:4000/enigma-bbs/) to see the documentation. + +### (re)build Jekyll bundles + +When the image is created the Jekyll bundles are installed, so in general there shouldn't be much need to run this task. This is available however in case soemthing goes wrong or you are working on the Jekyll setup itself. + +### (re)build node modules + +Used to re-generate the node modules. Generally shouldn't be necessary unless something is broken or you are adding/changing versions of dependencies. + +### ENiGMA½ new configuration + +This task executes `oputil.js` in order to create a new BBS configuration (useful if you have just checked out the code and haven't setup any configuration yet.) + +## Run / Debug config + +There is also a default "Launch Program" config (hotkey access via F5 / Ctrl-Shift-D.) This will launch ENiGMA½. Once it has launched, access the system via telnet, port 8888 as usual. \ No newline at end of file