From e4d784b0f6eebcfbe71970610d708721d498ba3b Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 00:25:00 +0000 Subject: [PATCH 01/13] =?UTF-8?q?=F0=9F=A4=96=20update=20dev=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 12 +++++++++--- .vscode/tasks.json | 2 +- build.sh | 4 ++-- init_devcontainer.sh | 25 +++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 6 deletions(-) create mode 100755 init_devcontainer.sh diff --git a/.vscode/settings.json b/.vscode/settings.json index be504a1..f3a6de7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,5 @@ { - "autobuild": true, + // "autobuild": true, "Lua.diagnostics.globals": [ "colors", "colours", @@ -26,6 +26,12 @@ "turtle", "vector", "window", - "mekanismEnergyHelper" - ] + "mekanismEnergyHelper", + "require" + ], + "triggerTaskOnSave.tasks": { + "build": [ + "src/telem/**/*.lua" + ] + } } \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 08af515..83764e5 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -10,7 +10,7 @@ "presentation": { "close": true, "focus": false, - "reveal": "silent", + "reveal": "always", "panel": "shared" } } diff --git a/build.sh b/build.sh index 5430bbd..d2eeec4 100755 --- a/build.sh +++ b/build.sh @@ -27,8 +27,8 @@ cd $workdir echo 'squishing...' mkdir -p dist/release -luamin -f dist/telem.lua > dist/release/tail.telem.min.lua -luamin -f dist/vendor.lua > dist/release/tail.vendor.min.lua +~/.yarn/bin/luamin -f dist/telem.lua > dist/release/tail.telem.min.lua +~/.yarn/bin/luamin -f dist/vendor.lua > dist/release/tail.vendor.min.lua echo 'writing header...' awk 'NR>=1 && NR<=4' dist/telem.lua > dist/release/telem.min.lua diff --git a/init_devcontainer.sh b/init_devcontainer.sh new file mode 100755 index 0000000..b6daf0f --- /dev/null +++ b/init_devcontainer.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# set up workspace +mkdir .luatmp +cd .luatmp + +# install lua +# sudo apt update +sudo apt install lua5.3 liblua5.3-dev + +# install luarocks +wget https://luarocks.org/releases/luarocks-3.11.1.tar.gz +tar zxpf luarocks-3.11.1.tar.gz +cd luarocks-3.11.1 +./configure && make && sudo make install + +# install luacc +sudo luarocks install luacc + +# remove workspace +cd ../.. +rm -rf .luatmp + +# install luamin +yarn global add luamin \ No newline at end of file From 7a6aa6bf345340d26cc6acd1142cdaf566ad31f8 Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 01:41:14 +0000 Subject: [PATCH 02/13] =?UTF-8?q?=F0=9F=93=A6=20add=20output=20state=20cac?= =?UTF-8?q?hing=20for=20#45?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/telem/lib/Backplane.lua | 76 +++++++++++++++++++ src/telem/lib/OutputAdapter.lua | 8 ++ .../lib/output/basalt/GraphOutputAdapter.lua | 45 +++++++++++ .../output/plotter/ChartLineOutputAdapter.lua | 18 +++++ 4 files changed, 147 insertions(+) diff --git a/src/telem/lib/Backplane.lua b/src/telem/lib/Backplane.lua index 2e14dda..9b0fe3d 100644 --- a/src/telem/lib/Backplane.lua +++ b/src/telem/lib/Backplane.lua @@ -10,6 +10,11 @@ Backplane.type = 'Backplane' function Backplane:constructor () self.debugState = false + + self.loaded = false + self.cacheState = false + self.lastCache = 0 + self.cacheRate = 1 self.inputs = {} self.outputs = {} @@ -93,6 +98,33 @@ function Backplane:cycle() self:dlog('Backplane:cycle :: ' .. os.date()) self:dlog('Backplane:cycle :: cycle START !') + -- load output states + if not self.loaded and self.cacheState then + self:dlog('Backplane:cycle :: loading state...') + + local inf = fs.open('/.telem/state', 'r') + + if inf then + local cache = textutils.unserialize(inf.readAll()) or {} + inf.close() + + for k, v in pairs(cache) do + local output = self.outputs[k] + + if output and output.loadState then + self:dlog('Backplane:cycle :: - ' .. k) + + local results = {pcall(output.loadState, output, v)} + + if not table.remove(results, 1) then + t.log('loadState fault for "' .. k .. '":') + t.pprint(table.remove(results, 1)) + end + end + end + end + end + self:dlog('Backplane:cycle :: reading inputs...') -- read inputs @@ -131,8 +163,42 @@ function Backplane:cycle() self:dlog('Backplane:cycle :: saving state...') + self:dlog('Backplane:cycle :: - Backplane') self.collection = metrics + -- cache output states + if self.cacheState then + local time = os.epoch('utc') + + if self.lastCache + self.cacheRate * 1000 <= time then + local cache = {} + + for _, key in pairs(self.outputKeys) do + local output = self.outputs[key] + + if output.getState then + self:dlog('Backplane:cycle :: - ' .. key) + + local results = {pcall(output.getState, output)} + + if not table.remove(results, 1) then + t.log('getState fault for "' .. key .. '":') + t.pprint(table.remove(results, 1)) + end + + cache[key] = table.remove(results, 1) + end + end + + fs.makeDir('/.telem') + local outf = fs.open('/.telem/state', 'w') + outf.write(textutils.serialize(cache, { compact = true })) + outf.flush() + + self.lastCache = time + end + end + self:dlog('Backplane:cycle :: writing outputs...') -- write outputs @@ -149,6 +215,10 @@ function Backplane:cycle() end end + if not self.loaded then + self.loaded = true + end + self:dlog('Backplane:cycle :: cycle END !') return self @@ -201,6 +271,12 @@ function Backplane:updateLayouts() self:dlog('Backplane:updateLayouts :: Layouts updated') end +function Backplane:cache(cache) + self.cacheState = cache and true or false + + return self +end + function Backplane:debug(debug) self.debugState = debug and true or false diff --git a/src/telem/lib/OutputAdapter.lua b/src/telem/lib/OutputAdapter.lua index 28a4e0d..3798f15 100644 --- a/src/telem/lib/OutputAdapter.lua +++ b/src/telem/lib/OutputAdapter.lua @@ -51,6 +51,14 @@ function OutputAdapter:addComponentByPeripheralType (type) self.components[key] = tempComponent end +function OutputAdapter:getState () + t.err(self.type .. ' has not implemented getState()') +end + +function OutputAdapter:loadState (state) + t.err(self.type .. ' has not implemented loadState()') +end + function OutputAdapter:write (metrics) t.err(self.type .. ' has not implemented write()') end diff --git a/src/telem/lib/output/basalt/GraphOutputAdapter.lua b/src/telem/lib/output/basalt/GraphOutputAdapter.lua index 40a8170..8d4b463 100644 --- a/src/telem/lib/output/basalt/GraphOutputAdapter.lua +++ b/src/telem/lib/output/basalt/GraphOutputAdapter.lua @@ -135,4 +135,49 @@ function GraphOutputAdapter:write (collection) return self end +function GraphOutputAdapter:getState () + local graphdata = {} + + for k,v in ipairs(self.graphdata) do + graphdata[k] = v + end + + return { + graphdata = graphdata, + tick = self.tick + } +end + +function GraphOutputAdapter:loadState (state) + self.graphdata = state.graphdata + self.tick = state.tick + + local newmin, newmax = graphtrackrange(self) + + if newmin == newmax then + newmin = newmin - 1 + newmax = newmax + 1 + end + + self.graph:setMinValue(newmin):setMaxValue(newmax) + + for _,v in ipairs(self.graphdata) do + self.graph:addDataPoint(v) + + if self.tick == self.SCALE_TICK then + self.graphscale:addDataPoint(100) + self.tick = 1 + else + self.graphscale:addDataPoint(50) + self.tick = self.tick + 1 + end + end + + self.label:setFontSize(2) + self.label:setText(t.shortnum(self.graphdata[#self.graphdata])) + + self.labelmax:setText(t.shortnum(newmax)) + self.labelmin:setText(t.shortnum(newmin)) +end + return GraphOutputAdapter \ No newline at end of file diff --git a/src/telem/lib/output/plotter/ChartLineOutputAdapter.lua b/src/telem/lib/output/plotter/ChartLineOutputAdapter.lua index c73ba77..1b3b08b 100644 --- a/src/telem/lib/output/plotter/ChartLineOutputAdapter.lua +++ b/src/telem/lib/output/plotter/ChartLineOutputAdapter.lua @@ -89,6 +89,24 @@ function ChartLineOutputAdapter:write (collection) return self end +function ChartLineOutputAdapter:getState () + local plotData = {} + + for k,v in ipairs(self.plotData) do + plotData[k] = v + end + + return { + plotData = plotData, + gridOffsetX = self.gridOffsetX + } +end + +function ChartLineOutputAdapter:loadState (state) + self.plotData = state.plotData + self.gridOffsetX = state.gridOffsetX +end + function ChartLineOutputAdapter:render () local dataw = #{self.plotData} From b8d60c686f472f1aa7ec010e5b053b30d192098a Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 02:22:43 +0000 Subject: [PATCH 03/13] =?UTF-8?q?=F0=9F=93=A6=20add=20cacheable=20to=20Out?= =?UTF-8?q?putAdapter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/telem/lib/Backplane.lua | 4 ++-- src/telem/lib/OutputAdapter.lua | 8 ++++++++ src/telem/lib/output/basalt/GraphOutputAdapter.lua | 2 ++ src/telem/lib/output/plotter/ChartLineOutputAdapter.lua | 2 ++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/telem/lib/Backplane.lua b/src/telem/lib/Backplane.lua index 9b0fe3d..272c45f 100644 --- a/src/telem/lib/Backplane.lua +++ b/src/telem/lib/Backplane.lua @@ -111,7 +111,7 @@ function Backplane:cycle() for k, v in pairs(cache) do local output = self.outputs[k] - if output and output.loadState then + if output and output.isCacheable then self:dlog('Backplane:cycle :: - ' .. k) local results = {pcall(output.loadState, output, v)} @@ -176,7 +176,7 @@ function Backplane:cycle() for _, key in pairs(self.outputKeys) do local output = self.outputs[key] - if output.getState then + if output.isCacheable then self:dlog('Backplane:cycle :: - ' .. key) local results = {pcall(output.getState, output)} diff --git a/src/telem/lib/OutputAdapter.lua b/src/telem/lib/OutputAdapter.lua index 3798f15..fd86b83 100644 --- a/src/telem/lib/OutputAdapter.lua +++ b/src/telem/lib/OutputAdapter.lua @@ -11,6 +11,8 @@ function OutputAdapter:constructor() self.asyncCycleHandler = nil + self.isCacheable = false + -- boot components self:setBoot(function () self.components = {} @@ -51,6 +53,12 @@ function OutputAdapter:addComponentByPeripheralType (type) self.components[key] = tempComponent end +function OutputAdapter:cacheable () + self.isCacheable = true + + return self +end + function OutputAdapter:getState () t.err(self.type .. ' has not implemented getState()') end diff --git a/src/telem/lib/output/basalt/GraphOutputAdapter.lua b/src/telem/lib/output/basalt/GraphOutputAdapter.lua index 8d4b463..f92aee1 100644 --- a/src/telem/lib/output/basalt/GraphOutputAdapter.lua +++ b/src/telem/lib/output/basalt/GraphOutputAdapter.lua @@ -25,6 +25,8 @@ end function GraphOutputAdapter:constructor (frame, filter, bg, fg, maxEntries) self:super('constructor') + self:cacheable() + self.bBaseFrame = assert(frame, 'Frame is required') self.filter = assert(filter, 'Filter is required') diff --git a/src/telem/lib/output/plotter/ChartLineOutputAdapter.lua b/src/telem/lib/output/plotter/ChartLineOutputAdapter.lua index 1b3b08b..ac1bb9d 100644 --- a/src/telem/lib/output/plotter/ChartLineOutputAdapter.lua +++ b/src/telem/lib/output/plotter/ChartLineOutputAdapter.lua @@ -15,6 +15,8 @@ ChartLineOutputAdapter.X_TICK = 10 function ChartLineOutputAdapter:constructor (win, filter, bg, fg, maxEntries) self:super('constructor') + self:cacheable() + self.win = assert(win, 'Window is required') self.filter = assert(filter, 'Filter is required') From 1802ac7011c2b3a6fa2ecc91b98451ee40cc0a4a Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 02:25:34 +0000 Subject: [PATCH 04/13] =?UTF-8?q?=F0=9F=93=A6=20do=20not=20return=20from?= =?UTF-8?q?=20cacheable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/telem/lib/OutputAdapter.lua | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/telem/lib/OutputAdapter.lua b/src/telem/lib/OutputAdapter.lua index fd86b83..5393cb6 100644 --- a/src/telem/lib/OutputAdapter.lua +++ b/src/telem/lib/OutputAdapter.lua @@ -55,8 +55,6 @@ end function OutputAdapter:cacheable () self.isCacheable = true - - return self end function OutputAdapter:getState () From 54a0ca47b2d76abf7744622e050904ca282e736c Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 02:53:13 +0000 Subject: [PATCH 05/13] =?UTF-8?q?=F0=9F=93=A6=20update=20docs=20and=20bump?= =?UTF-8?q?=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/reference/Backplane.md | 8 ++++++ docs/reference/InputAdapter.md | 10 +++---- docs/reference/OutputAdapter.md | 40 +++++++++++++++++++++++---- docs/reference/output/ChartLine.md | 4 +++ docs/reference/output/basalt/Graph.md | 4 +++ src/telem/init.lua | 4 +-- 6 files changed, 57 insertions(+), 13 deletions(-) diff --git a/docs/reference/Backplane.md b/docs/reference/Backplane.md index d08f865..3489075 100644 --- a/docs/reference/Backplane.md +++ b/docs/reference/Backplane.md @@ -151,6 +151,14 @@ Backplane:debug (state: boolean) Set internal debug state. When `state` is `true`, Backplane will write verbose information to the terminal during a cycle. When `state` is `false`, Backplane will only write adapter faults to the terminal. Any adapters added *after* calling `debug()` will also have their debug state set to the same value. +### `cache` + +```lua +Backplane:cache (state: boolean) +``` + +Set output cache state. When `state` is `true`, Backplane will save the data history of cacheable output adapters to the filesystem at regular intervals. If the program or computer halts and restarts, the cache will be loaded and the output adapters will be re-initialized with the cached data. An output adapter must call `self:cacheable()`, as well as implement `getState()` and `loadState()`, to be cacheable. + ## Usage ```lua diff --git a/docs/reference/InputAdapter.md b/docs/reference/InputAdapter.md index f49a0d8..d1bb5ce 100644 --- a/docs/reference/InputAdapter.md +++ b/docs/reference/InputAdapter.md @@ -84,10 +84,10 @@ self.components = { } ``` -### `read` +### `read` -Reads all assigned components. +```lua +InputAdapter:read (): MetricCollection +``` -::: danger -Because InputAdapter is an abstract class, calling this method on InputAdapter or on an incomplete implementation of InputAdapter will throw an error. -::: \ No newline at end of file +Reads data from implementation-defined sources into a [MetricCollection](MetricCollection) and returns it. \ No newline at end of file diff --git a/docs/reference/OutputAdapter.md b/docs/reference/OutputAdapter.md index 740f7d6..f5c2a10 100644 --- a/docs/reference/OutputAdapter.md +++ b/docs/reference/OutputAdapter.md @@ -4,7 +4,7 @@ outline: deep # OutputAdapter -OutputAdapter is an [abstract](https://en.wikipedia.org/wiki/Abstract_type) class that functions as a metric consumer. Typically, an OutputAdapter implementation will accept one or more parameters to its constructor method. These properties define what data sources and/or peripherals it should query when `read()` is called. +OutputAdapter is an [abstract](https://en.wikipedia.org/wiki/Abstract_type) class that functions as a metric consumer. Typically, an OutputAdapter implementation will accept one or more parameters to its constructor method. These properties define what targets and/or peripherals it should interact with when `write()` is called. ## Properties @@ -77,14 +77,42 @@ self.components = { } ``` -## `write` +### `write` ```lua OutputAdapter:write (metrics: MetricCollection) ``` -Writes provided [MetricCollection](MetricCollection) to all assigned components. Specific behavior is implementation-dependent. +Writes provided [MetricCollection](MetricCollection) to implementation-defined targets. This will be called by the [Backplane](Backplane) during a cycle. -::: danger -Because OutputAdapter is an abstract class, calling this method on InputAdapter or on an incomplete implementation of InputAdapter will throw an error. -::: \ No newline at end of file +### `debug` + +```lua +OutputAdapter:debug (state: boolean) +``` + +Set internal debug state. When `state` is `true`, OutputAdapter will write verbose information to the terminal. + +### `cacheable` + +```lua +OutputAdapter:cacheable () +``` + +Flag this OutputAdapter implementation as cacheable. This will notify the Backplane to call `getState()` and `loadState()` on this adapter when needed. + +### `getState` + +```lua +OutputAdapter:getState (): table +``` + +Returns a serializable version of the OutputAdapter's internal state. + +### `loadState` + +```lua +OutputAdapter:loadState (state: table) +``` + +Loads a previously saved state into the OutputAdapter. \ No newline at end of file diff --git a/docs/reference/output/ChartLine.md b/docs/reference/output/ChartLine.md index b29d627..1073c31 100644 --- a/docs/reference/output/ChartLine.md +++ b/docs/reference/output/ChartLine.md @@ -14,6 +14,10 @@ telem.output.plotter.chartLine ( ) ``` +::: tip +This adapter is [cacheable](/reference/Backplane#cache). +::: + Search the available metrics using the syntax defined in [`find`](/reference/MetricCollection#find) and output a line chart to a specified window. If a matching metric is found, the metric value is pushed to the chart buffer. The X axis (horizontal value) represents the number of data points recorded, and has a default width of `50`, which can be overridden by passing `maxEntries` in the constructor. The Y axis (vertical) represents the value of the metric over time. Once the fixed width of the graph is reached, the oldest values will be dropped from the buffer when new values are added. The minimum and maximum range of the Y axis is determined by the minimum and maximum metric values in the graph buffer. The background of the widget and all labels will be `bg`, and the graph/text color will be `fg`. diff --git a/docs/reference/output/basalt/Graph.md b/docs/reference/output/basalt/Graph.md index 6404a8e..e48640a 100644 --- a/docs/reference/output/basalt/Graph.md +++ b/docs/reference/output/basalt/Graph.md @@ -18,6 +18,10 @@ telem.output.basalt.graph ( Requires **[Basalt 1.7+](https://basalt.madefor.cc/)**. This is **not** included in the installer's dependencies due to size. ::: +::: tip +This adapter is [cacheable](/reference/Backplane#cache). +::: + Search the available metrics using the syntax defined in [`find`](/reference/MetricCollection#find) and output a graph to a specified [Basalt container](https://basalt.madefor.cc/#/objects/Container). If a matching metric is found, the metric value is pushed to the graph buffer. The X axis (horizontal value) represents the number of data points recorded, and has a default width of `50`, which can be overridden by passing `maxEntries` in the constructor. The Y axis (vertical) represents the value of the metric over time. Once the fixed width of the graph is reached, the oldest values will be dropped from the buffer when new values are added. The minimum and maximum range of the Y axis is determined by the minimum and maximum metric values in the graph buffer. The background of the widget and all labels will be `bg`, and the graph/text color will be `fg`. diff --git a/src/telem/init.lua b/src/telem/init.lua index e45bb4a..dd1da6b 100644 --- a/src/telem/init.lua +++ b/src/telem/init.lua @@ -1,9 +1,9 @@ -- Telem by cyberbit -- MIT License --- Version 0.5.3 +-- Version 0.6.0 local _Telem = { - _VERSION = '0.5.3', + _VERSION = '0.6.0', util = require 'telem.lib.util', input = require 'telem.lib.input', output = require 'telem.lib.output', From 55a275edcdd3e575ca06b3ab0ee29b6e80e9ae78 Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 02:59:07 +0000 Subject: [PATCH 06/13] =?UTF-8?q?=F0=9F=A4=96=20update=20GH=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- init_devcontainer.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8bba60d..54845f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: run: luarocks install luacc - name: Install luamin - run: npm install -g https://github.com/cyberbit/luamin + run: yarn add -G https://github.com/cyberbit/luamin - name: Build run: ./build.sh diff --git a/init_devcontainer.sh b/init_devcontainer.sh index b6daf0f..5b80f8f 100755 --- a/init_devcontainer.sh +++ b/init_devcontainer.sh @@ -22,4 +22,4 @@ cd ../.. rm -rf .luatmp # install luamin -yarn global add luamin \ No newline at end of file +yarn global add https://github.com/cyberbit/luamin \ No newline at end of file From e58295d7ed716a9fe512fe6f14f04de29c5d9be8 Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 03:03:55 +0000 Subject: [PATCH 07/13] =?UTF-8?q?=F0=9F=93=A6=20oops=20part=201?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 54845f9..53f2437 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: run: luarocks install luacc - name: Install luamin - run: yarn add -G https://github.com/cyberbit/luamin + run: yarn global add https://github.com/cyberbit/luamin - name: Build run: ./build.sh From 90d176c2cfd86b4fb85d2693c144facc7ed433ca Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 03:08:54 +0000 Subject: [PATCH 08/13] =?UTF-8?q?=F0=9F=93=A6=20oops=20part=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53f2437..7811958 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: run: luarocks install luacc - name: Install luamin - run: yarn global add https://github.com/cyberbit/luamin + run: sudo yarn global add https://github.com/cyberbit/luamin - name: Build run: ./build.sh From 86a5936c1ac09fde9aa0ceb82c04866ebe8ee37f Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 03:17:00 +0000 Subject: [PATCH 09/13] =?UTF-8?q?=F0=9F=93=A6=20oops=20part=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7811958..2617158 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: run: luarocks install luacc - name: Install luamin - run: sudo yarn global add https://github.com/cyberbit/luamin + run: sudo yarn --verbose global add https://github.com/cyberbit/luamin - name: Build run: ./build.sh From c8597e8f56f5b4261a9f768aead5a333f5f43824 Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 03:20:53 +0000 Subject: [PATCH 10/13] =?UTF-8?q?=F0=9F=93=A6=20oops=20part=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2617158..49a3041 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,9 @@ jobs: - name: Install luamin run: sudo yarn --verbose global add https://github.com/cyberbit/luamin + - name: Find bin dir + run: yarn global bin + - name: Build run: ./build.sh From b685ce4fd39ee4f2e0e62003bac9b204a740a0dd Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 03:25:12 +0000 Subject: [PATCH 11/13] =?UTF-8?q?=F0=9F=93=A6=20oops=20part=205?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 +++- build.sh | 4 ++-- init_devcontainer.sh | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49a3041..6759c0f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,9 @@ jobs: run: sudo yarn --verbose global add https://github.com/cyberbit/luamin - name: Find bin dir - run: yarn global bin + run: | + yarn global bin + ll $(yarn global bin) - name: Build run: ./build.sh diff --git a/build.sh b/build.sh index d2eeec4..5430bbd 100755 --- a/build.sh +++ b/build.sh @@ -27,8 +27,8 @@ cd $workdir echo 'squishing...' mkdir -p dist/release -~/.yarn/bin/luamin -f dist/telem.lua > dist/release/tail.telem.min.lua -~/.yarn/bin/luamin -f dist/vendor.lua > dist/release/tail.vendor.min.lua +luamin -f dist/telem.lua > dist/release/tail.telem.min.lua +luamin -f dist/vendor.lua > dist/release/tail.vendor.min.lua echo 'writing header...' awk 'NR>=1 && NR<=4' dist/telem.lua > dist/release/telem.min.lua diff --git a/init_devcontainer.sh b/init_devcontainer.sh index 5b80f8f..14958bc 100755 --- a/init_devcontainer.sh +++ b/init_devcontainer.sh @@ -22,4 +22,4 @@ cd ../.. rm -rf .luatmp # install luamin -yarn global add https://github.com/cyberbit/luamin \ No newline at end of file +sudo yarn global add https://github.com/cyberbit/luamin \ No newline at end of file From 6f9309de511af93603514eba1f03b823ba9d6205 Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 03:26:05 +0000 Subject: [PATCH 12/13] =?UTF-8?q?=F0=9F=93=A6=20oops=20part=205.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6759c0f..6fba132 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: - name: Find bin dir run: | yarn global bin - ll $(yarn global bin) + ls $(yarn global bin) - name: Build run: ./build.sh From 50778d2a664a7fdd8aa6670079209f9f0977e810 Mon Sep 17 00:00:00 2001 From: cyberbit Date: Wed, 5 Jun 2024 03:28:13 +0000 Subject: [PATCH 13/13] =?UTF-8?q?=F0=9F=93=A6=20oops=20part=206?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6fba132..7811958 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,12 +37,7 @@ jobs: run: luarocks install luacc - name: Install luamin - run: sudo yarn --verbose global add https://github.com/cyberbit/luamin - - - name: Find bin dir - run: | - yarn global bin - ls $(yarn global bin) + run: sudo yarn global add https://github.com/cyberbit/luamin - name: Build run: ./build.sh