Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: midnight edition #314

Draft
wants to merge 37 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
4524c14
feat: add moonlight lua abstraction library
TorchedSammy Jul 19, 2024
e93ffda
docs: add readme for midnight edition
TorchedSammy Jul 19, 2024
43c467d
chore: upload midnight edition logo
TorchedSammy Jul 19, 2024
4e58979
docs: add more details
TorchedSammy Jul 19, 2024
cdd2272
chore: make codacy happy
TorchedSammy Jul 19, 2024
930a974
chore: make codacy happy (again)
TorchedSammy Jul 19, 2024
af67bbd
docs: link pr on readme
TorchedSammy Jul 19, 2024
56045ed
feat: implement bait loading
TorchedSammy Jul 20, 2024
e335ef5
feat: add userDir module
TorchedSammy Jul 20, 2024
a15b103
chore: update branch
TorchedSammy Jul 20, 2024
40a90c8
docs: remove moonlight edition promo
TorchedSammy Jul 20, 2024
a5f695e
feat: implement parts of fs
TorchedSammy Jul 20, 2024
57a65cb
feat: add moonlight to commander
TorchedSammy Jul 20, 2024
80e6ded
feat: rewrite hilbish.cwd for moonlight
TorchedSammy Jul 20, 2024
f37f5b7
refactor: rewrite terminal library with moonlight
TorchedSammy Jul 20, 2024
4d07f16
refactor: rewrite hilbish.prompt for moonlight
TorchedSammy Jul 20, 2024
0c90432
fix: initialize some modules
TorchedSammy Jul 20, 2024
69fcd8e
refactor: rewrite runner module for moonlight, add hilbish.runnerMode…
TorchedSammy Jul 20, 2024
4fdc99d
refactor: rewrite appendPath to use moonlight
TorchedSammy Jul 20, 2024
17a3e2c
refactor(bait): catch function
TorchedSammy Jul 20, 2024
1f9fd80
feat: begin initial port to c lua
TorchedSammy Jul 21, 2024
29ac92d
fix: int64/int mixup, missing imports
TorchedSammy Jul 21, 2024
983605a
ci: make builds between midnight and standard more distinct
TorchedSammy Jul 21, 2024
2eb1ea3
ci: add midnight edition on build name
TorchedSammy Jul 21, 2024
d6eb92f
fix: attempt some small fixes for loading modules
TorchedSammy Jul 26, 2024
094e795
fix: type typo (lol)
TorchedSammy Dec 21, 2024
3afd1c5
fix: attempt to implement more/fix go library loading
TorchedSammy Dec 22, 2024
0a0f2e2
fix: implement go lua library loading
TorchedSammy Dec 22, 2024
4105d7d
ci: run for midnight edition
TorchedSammy Dec 22, 2024
d9b177b
ci: remove midnight from on pr
TorchedSammy Dec 22, 2024
c3025b1
fix: keep table methods in sync with c lua
TorchedSammy Dec 22, 2024
004615b
fix: restore package.path setup
TorchedSammy Dec 22, 2024
287a983
feat: implement dofile on midnight
TorchedSammy Dec 22, 2024
7620660
chore: remove printing for hilbish global type
TorchedSammy Dec 22, 2024
40d3933
feat: add hilbish.midnightEdition
TorchedSammy Dec 22, 2024
7e0812e
feat: add midnight detection function
TorchedSammy Dec 22, 2024
95391d7
feat: add midnight edition info to version
TorchedSammy Dec 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ on:
push:
branches:
- master
- midnight-edition
pull_request:
branches:
- master

jobs:
build:
name: ${{ matrix.goos }}-${{ matrix.goarch }}
name: ${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.midnight == 'true' && ' (Midnight Edition)' || ''}}
runs-on: ubuntu-latest
strategy:
matrix:
midnight: [false, true]
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm64]
exclude:
Expand All @@ -33,11 +35,11 @@ jobs:
- name: Download Task
run: 'sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d'
- name: Build
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} ./bin/task
run: GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} ./bin/task ${{ matrix.midnight == 'true' && 'midnight' || ''}}
- uses: actions/upload-artifact@v4
if: matrix.goos == 'windows'
with:
name: hilbish-${{ matrix.goos }}-${{ matrix.goarch }}
name: hilbish${{ matrix.midnight == 'true' && '-midnight-edition' || ''}}-${{ matrix.goos }}-${{ matrix.goarch }}
path: |
hilbish.exe
LICENSE
Expand All @@ -51,7 +53,7 @@ jobs:
- uses: actions/upload-artifact@v4
if: matrix.goos != 'windows'
with:
name: hilbish-${{ matrix.goos }}-${{ matrix.goarch }}
name: hilbish${{ matrix.midnight == 'true' && '-midnight-edition' || ''}}-${{ matrix.goos }}-${{ matrix.goarch }}
path: |
hilbish
LICENSE
Expand Down
2 changes: 2 additions & 0 deletions .hilbishrc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ local function doNotifyPrompt()
end

doPrompt()
--[[

bait.catch('command.preexec', function()
running = true
Expand All @@ -47,3 +48,4 @@ end)
bait.catch('hilbish.notification', function(notif)
doNotifyPrompt()
end)
]]--
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
> [!TIP]
> Check out [Hilbish: Midnight Edition](https://github.com/Rosettea/Hilbish/tree/midnight-edition) if you want to use C Lua, LuaJIT or anything related!

<img src="./assets/hilbish-logo-and-text.png" width=512><br>
<img src="./assets/hilbish-logo-and-text-midnight-edition.png" width=512><br>
<blockquote>
🌓 The Moon-powered shell! A comfy and extensible shell for Lua fans! 🌺 ✨
</blockquote>
Expand All @@ -12,6 +9,27 @@
<a href="https://discord.gg/3PDdcQz"><img alt="Discord" src="https://img.shields.io/discord/732357621503229962?color=blue&style=flat-square"></a>
<br>

# Midnight Edition

> [!CAUTION]
> This is a **HEAVILY** WORK IN PROGRESS branch which makes a lot of internal changes.
Functionality **will** be missing if you use this branch,
and you may see crashes too. Tread lightly.

Build instructions and progress on Midnight Edition is tracked in this PR:
[#314](https://github.com/Rosettea/Hilbish/pull/314)

Hilbish: Midinight Edition is a version of Hilbish meant to be compatible with
the original C implementation of Lua by using a Go library binding. The end goal
is to offer Midnight Edition as a separate, "not as supported" build for users
that *really* want to access a certain library made for C Lua or want the
most performance with their Lua code.

**The standard edition, which is all native Go,
will always be more supported than Midnight Edition.**

# Back the original README

Hilbish is an extensible shell designed to be highly customizable.
It is configured in Lua and provides a good range of features.
It aims to be easy to use for anyone but powerful enough for
Expand Down Expand Up @@ -53,13 +71,13 @@ go get -d ./...

To build, run:
```
task
go-task
```

Or, if you want a stable branch, run these commands:
```
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
task build
go-task build
```

After you did all that, run `sudo task install` to install Hilbish globally.
Expand Down
8 changes: 8 additions & 0 deletions Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ vars:
LIBDIR: '{{default .libdir__ .LIBDIR}}'
goflags__: '-ldflags "-s -w -X main.dataDir={{.LIBDIR}}"'
GOFLAGS: '{{default .goflags__ .GOFLAGS}}'
lua__: 'lua'
LUA: '{{default .lua__ .LUA}}'

tasks:
default:
Expand All @@ -24,6 +26,12 @@ tasks:
vars:
GOFLAGS: '-ldflags "-s -w -X main.dataDir={{.LIBDIR}} -X main.gitCommit=$(git rev-parse --short HEAD) -X main.gitBranch=$(git rev-parse --abbrev-ref HEAD)"'

midnight:
cmds:
- go build -tags midnight,{{.LUA}} {{.GOFLAGS}}
vars:
GOFLAGS: '-ldflags "-X main.dataDir={{.LIBDIR}} -X main.gitCommit=$(git rev-parse --short HEAD) -X main.gitBranch=$(git rev-parse --abbrev-ref HEAD)"'

build:
cmds:
- go build {{.GOFLAGS}}
Expand Down
2 changes: 2 additions & 0 deletions aliases.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,12 @@ func (a *aliasModule) Resolve(cmdstr string) string {
func (a *aliasModule) Loader(rtm *rt.Runtime) *rt.Table {
// create a lua module with our functions
hshaliasesLua := map[string]util.LuaExport{
/*
"add": util.LuaExport{hlalias, 2, false},
"list": util.LuaExport{a.luaList, 0, false},
"del": util.LuaExport{a.luaDelete, 1, false},
"resolve": util.LuaExport{a.luaResolve, 1, false},
*/
}

mod := rt.NewTable()
Expand Down
Loading
Loading