Skip to content

Commit 7a24e9e

Browse files
Merge pull request #78 from j-mie6/main
Release v0.2.0
2 parents 7f1f716 + 61b363c commit 7a24e9e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+875
-641
lines changed

.github/workflows/dill-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
- name: Rust cache
6767
uses: swatinem/rust-cache@v2
6868
with:
69-
workspaces: './src-tauri -> target'
69+
workspaces: './backend -> target'
7070

7171

7272
- name: Clean SBT caches and set env (Windows only)
@@ -99,5 +99,5 @@ jobs:
9999

100100
- name: Test backend
101101
run: |
102-
cd src-tauri
102+
cd backend
103103
cargo test

.github/workflows/dill-release.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- name: Rust cache
6161
uses: swatinem/rust-cache@v2
6262
with:
63-
workspaces: './src-tauri -> target'
63+
workspaces: './backend -> target'
6464

6565
- name: Clean SBT caches and set env (Windows only)
6666
if: matrix.platform == 'windows-latest'
@@ -107,37 +107,37 @@ jobs:
107107
uses: actions/upload-artifact@v4
108108
with:
109109
name: dill-${{ matrix.platform }}.exe
110-
path: ./src-tauri/target/release/dill.exe
110+
path: ./backend/target/release/dill.exe
111111
if-no-files-found: error
112112

113113
- name: Upload app executable (Linux)
114114
if: matrix.platform == 'ubuntu-latest'
115115
uses: actions/upload-artifact@v4
116116
with:
117117
name: dill-${{ matrix.platform }}
118-
path: ./src-tauri/target/release/dill
118+
path: ./backend/target/release/dill
119119
if-no-files-found: error
120120

121121
- name: Upload app executable (MacOS)
122122
if: matrix.platform == 'macos-latest'
123123
uses: actions/upload-artifact@v4
124124
with:
125125
name: dill-${{ matrix.platform }}
126-
path: ./src-tauri/target/universal-apple-darwin/release/dill
126+
path: ./backend/target/universal-apple-darwin/release/dill
127127
if-no-files-found: error
128128

129129
- name: Upload app bundles (Linux and Windows)
130130
if: matrix.platform == 'windows-latest' || matrix.platform == 'ubuntu-latest'
131131
uses: actions/upload-artifact@v4
132132
with:
133133
name: dill-bundles-${{ matrix.platform }}
134-
path: ./src-tauri/target/release/bundle/
134+
path: ./backend/target/release/bundle/
135135
if-no-files-found: error
136136

137137
- name: Upload app bundles (MacOS)
138138
if: matrix.platform == 'macos-latest'
139139
uses: actions/upload-artifact@v4
140140
with:
141141
name: dill-bundles-${{ matrix.platform }}
142-
path: ./src-tauri/target/universal-apple-darwin/release/bundle/
142+
path: ./backend/target/universal-apple-darwin/release/bundle/
143143
if-no-files-found: error

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ FROM rust:latest
66
WORKDIR /home
77
COPY ./project ./project
88
COPY ./public ./public
9-
COPY ./src ./src
10-
COPY ./src-tauri ./src-tauri
9+
COPY ./frontend ./frontend
10+
COPY ./backend ./backend
1111
COPY ./build.sbt ./build.sbt
1212
COPY ./index.html ./index.html
1313
COPY ./package-lock.json ./package-lock.json

README.md

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,80 +1,85 @@
1-
# Dill ![Github Workflow Status](https://img.shields.io/github/actions/workflow/status/j-mie6/parsley-debug-app/dill-ci.yml?branch=release) ![Github release](https://img.shields.io/github/v/release/j-mie6/parsley-debug-app) ![Github license](https://img.shields.io/github/license/j-mie6/parsley-debug-app)
1+
# Dill ![Github Workflow Status](https://img.shields.io/github/actions/workflow/status/j-mie6/parsley-debug-app/dill-ci.yml?branch=main) ![Github release](https://img.shields.io/github/v/release/j-mie6/parsley-debug-app) ![Github license](https://img.shields.io/github/license/j-mie6/parsley-debug-app)
22

33

44
## What is Dill?
55

6-
Dill (**Debugging Interactively in the Parsley Library**) is a cross-platform, visual, reactive and interactive debugger to be used with the _modern_ parser combinator library for Scala, [Parsley](https://github.com/j-mie6/parsley).
6+
`Dill` (**Debugging Interactively in the Parsley Library**) is a cross-platform, visual, interactive debugger to be used with the parser combinator library for Scala, [`Parsley`](https://github.com/j-mie6/parsley).
77

8-
## How do I install it?
98

10-
Dill is distributed as a binary executable and can be installed below according to your machine's operating system from the [releases](https://github.com/j-mie6/parsley-debug-app/releases/) page.
9+
## How do I install it?
1110

11+
`Dill` is distributed as a binary executable and can be installed below according to your machine's operating system from the [releases](https://github.com/j-mie6/parsley-debug-app/releases/) page.
1212
To build the `Dill` debugger on your own machine, go to [building](#building).
1313

14-
## Usage
1514

16-
You will first need to [install](#how-do-i-install-it) / [build](#building) the `Dill` debugging application onto your machine. Then once the application has started, you are ready to start sending it debug information from within `Parsley`.
15+
## Usage
1716

18-
First, ensure that your project has the `remote-view` project as a dependency (you will of course need to have the `Parsley` project as a dependency too).
17+
You will first need to [install](#how-do-i-install-it) / [build](#building) the `Dill` debugging application onto your machine. Then once the application has started, you are ready to start sending it debug information from within `Parsley`:
1918

20-
Then import the `DillRemoteView` object from `parsley.debug`.
19+
- First, ensure that your project has the `remote-view` project as a dependency (you will of course need to have the `Parsley` library as a dependency too).
20+
- Import the `DillRemoteView` object from `parsley.debug`.
21+
- Then on the parser which you would like to debug, attach the `DillRemoteView` object, before the parse step.
2122

22-
Then, on the parser which you would like to debug, attach the `DillRemoteView` object before the parse step.
23+
**`test.sc`**: the following `scala` script uses `Parsley 5.0.0-M12`
2324

24-
The following scala script uses `Parsley 5.0.0-M10`:
25+
```scala
2526

26-
`test.sc` :
27-
```scala
2827
//> using repository sonatype-s01:snapshots
2928

30-
//> using dep com.github.j-mie6::parsley:5.0.0-M10
31-
//> using dep com.github.j-mie6::parsley-debug:5.0.0-M10
32-
//> using dep com.github.j-mie6::parsley-debug-remote:0.1-a60d211-SNAPSHOT
29+
//> using dep com.github.j-mie6::parsley:5.0.0-M12
30+
//> using dep com.github.j-mie6::parsley-debug:5.0.0-M12
31+
//> using dep com.github.j-mie6::parsley-debug-remote::0.1-ac6943f-SNAPSHOT
32+
//> using options -experimental
3333

3434
import parsley.quick.*
3535
import parsley.syntax.character.{charLift, stringLift}
3636
import parsley.debug.combinator.*
3737
import parsley.debug.DillRemoteView
38+
import scala.annotation.experimental
39+
40+
/* Annotations to assign parser names to combinators */
41+
@experimental @parsley.debuggable
42+
object Parser {
43+
val hello: Parsley[Unit] = whitespaces ~> ('h' ~> ("ello" | "i")).void <~ whitespaces
44+
val subject: Parsley[Unit] = whitespaces ~> ("world" | "jamie").void <~ whitespaces
45+
val greeting: Parsley[Unit] = (hello ~> subject ~> "!" ~> eof)
46+
}
3847

39-
('h' ~> ("ello" | "i") ~> " world!" ~> eof).attach(DillRemoteView).parse("hello world!1")
48+
Parser.greeting.attach(DillRemoteView).parse("hello jamie!")
4049

4150
```
4251

4352
_To run this snippet, simply run_ `scala test.sc`.
4453

45-
You will then be able to view a representation of the abstract syntax tree generated by `Parsley`. To reload the tree from the backend, simply press the reload button in the tree view.
54+
You will then be able to view a representation of the abstract syntax tree generated by `Parsley`:
4655

47-
## Building
48-
The frontend of the application is written using ScalaJS, and uses the `sbt` build system, the frontend compiles down to a single `JavaScript` file located in `./static`. The backend uses the `Tauri` package to host the frontend, and the `Rocket` package to host a server to receive the tree from `Parsley`. We use `npm` to manage the various packages.
56+
![Debugging "hello jamie!"](readme/images/DillHelloJamie.png)
4957

50-
### To run the project, execute `sbt start`.
5158

52-
This will install the node packages required to build the project, build the front and backend, and then start the generated executable.
59+
## Building
5360

54-
To start the application in development mode, we use the sbt development server for the frontend, and the standard tauri development server.
61+
The frontend of the application is written using [`ScalaJS`](https://www.scala-js.org/) and [`Laminar`](https://laminar.dev/), and uses the `sbt` build system, the frontend compiles down to a single `JavaScript` file located in `./static`. The backend uses the [`Tauri`](https://v2.tauri.app/) package to host the frontend, and the [`Rocket`](https://rocket.rs/) package to host a server to receive the tree from `Parsley`. We use `npm` to manage the various packages.
5562

56-
### To run the project in development mode, execute
57-
- `sbt ~buildFrontend` to start the sbt development server.
58-
- `sbt buildBackendDev` in a different terminal to start the tauri development server.
63+
**To run the project, execute `sbt run`:**
5964

60-
_This will cause a quick-reload when any of the source files are modified._
65+
This will install the node packages required to build the project, build the front and backend, and then start the generated executable.
6166

62-
## Examples
67+
**To run the project in development mode, execute:**
68+
- `sbt ~buildFrontend` to start the sbt frontend development server.
69+
- `sbt runBackend` in a different terminal to start the [`Tauri`](https://v2.tauri.app/) app.
6370

64-
The following images are screenshots of two example parser trees.
71+
_This will cause a quick-reload when any of the source files are modified._
6572

66-
![Debugging "hi world!"](readme/images/DillHiWorld.png)
67-
![Debugging multiplication](readme/images/DillMultiplication.png)
6873

6974
## Bug Reports
7075

71-
If you encounter a bug when using Dill, try and minimise the example of the parser input that triggers the bug. If possible, make a self contained example: this will help to identify the issue without too much issue.
76+
If you encounter a bug when using `Dill`, please try to make a self contained example: this will help to identify the issue.
77+
Then, create a new [issue](https://github.com/j-mie6/parsley-debug-app/issues) - if possible, please include screenshots and a description of the bug.
7278

73-
Then, create a new [issue](https://github.com/j-mie6/parsley-debug-app/issues), including, if possible, screenshots and a description of the bug.
7479

7580
## How does it work?
7681

77-
- The `remote-view` backend for `parsley-debug` posts the debug tree from the parser to the Rocket HTTP server running within the `Dill` debugger.
78-
- The Rocket server transforms and passes off a representation of the debug tree to the tauri application in `Rust`.
79-
- The frontend then queries the tauri application for the debug tree.
80-
- Upon receipt of the tree, the frontend renders the tree on the screen.
82+
- The `remote-view` backend for `parsley-debug` posts the debug tree from the parser to the [`Rocket`](https://rocket.rs/) HTTP server running within the `Dill` debugger.
83+
- The [`Rocket`](https://rocket.rs/) server transforms and passes off a representation of the debug tree to the [`Tauri`](https://v2.tauri.app/) application in `Rust`.
84+
- The frontend then queries the [`Tauri`](https://v2.tauri.app/) application for the debug tree.
85+
- Upon receiving of the tree, the frontend renders the tree on the screen.
File renamed without changes.
Lines changed: 79 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ tauri = { version = "2.2.1", features = [] }
2525
tauri-plugin-log = "2.0.0-rc"
2626
rocket = { version = "0.5.1", features = ["json"] }
2727
mockall = "0.13.1"
28+
tauri-plugin-shell = "2"
File renamed without changes.
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"main"
77
],
88
"permissions": [
9-
"core:default"
9+
"core:default",
10+
"shell:default"
1011
]
11-
}
12+
}

0 commit comments

Comments
 (0)