Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
1b16d25
add lezer grammars for mlog, mindcode and schemacode
JeanJPNM Jan 28, 2026
4ce5146
allow empty format placeholders
JeanJPNM Jan 28, 2026
85485a2
functional compilation API calls
JeanJPNM Jan 29, 2026
ed586b4
respect users theme preferences
JeanJPNM Jan 29, 2026
76a8e85
fix broken backend
JeanJPNM Jan 29, 2026
abd2dfa
move old controllers to /legacy
JeanJPNM Jan 29, 2026
602965c
update deploy workflow
JeanJPNM Jan 29, 2026
a082cda
remove use of deprecated $app/stores
JeanJPNM Jan 29, 2026
5809758
use frontend-maven-plugin
JeanJPNM Jan 29, 2026
db4b923
use a static jar name
JeanJPNM Jan 29, 2026
5f23b20
add a debug logger to the compiler
JeanJPNM Jan 29, 2026
b59372f
Revert "add a debug logger to the compiler"
JeanJPNM Jan 29, 2026
356f896
use System.err.println for production debugging
JeanJPNM Jan 29, 2026
411d95c
print to System.out instead
JeanJPNM Jan 29, 2026
639a471
add copy button
JeanJPNM Jan 30, 2026
5f70c17
enable noUnusedLocalds in tsconfig
JeanJPNM Jan 30, 2026
c2a6ed4
use themes from @fsegurai/codemirror-themes
JeanJPNM Jan 30, 2026
e0f910a
remove webapp/frontend from the slug
JeanJPNM Jan 31, 2026
361127a
use a more specific .slugignore
JeanJPNM Jan 31, 2026
1106f18
fix highlighting issues on the mlog and mindcode languages
JeanJPNM Jan 31, 2026
af0f391
stop preserving editor selection state when setting its value
JeanJPNM Jan 31, 2026
3232b47
delete frontend folder after building on heroku
JeanJPNM Jan 31, 2026
5811bc1
delete other folders and everything that's not the fat jar in the tar…
JeanJPNM Jan 31, 2026
4a0456a
clean files on the verify phase
JeanJPNM Jan 31, 2026
d715231
add an include to force the compiler to package
JeanJPNM Jan 31, 2026
6b3b143
only delete compiler/target
JeanJPNM Jan 31, 2026
49ef85c
back to deleting all of compiler
cardillan Feb 1, 2026
22f2fae
add support for running decompiled mlog/schematics
JeanJPNM Feb 7, 2026
10eeb23
fix highlighting of semicolon on mlog
JeanJPNM Feb 7, 2026
cdd19a1
crude support for multiple run outputs
JeanJPNM Feb 7, 2026
a24d35e
make mlog line numbers start at zero
JeanJPNM Feb 7, 2026
85b553a
special highlighting for mlog global variables
JeanJPNM Feb 7, 2026
a36750d
special highlighting for mindcode builtin variables
JeanJPNM Feb 7, 2026
d50eade
add support for mindcode specific float syntax in mlog blocks
JeanJPNM Feb 7, 2026
cc5ad7d
clean output editors when requesting server processing
JeanJPNM Feb 7, 2026
fef21dc
compile samples on selection
JeanJPNM Feb 7, 2026
7c7cd9c
show a loading spinner when requesting server processing
JeanJPNM Feb 7, 2026
857842f
obscure output editors during server processing
JeanJPNM Feb 7, 2026
7412577
add missing jump to position handler
JeanJPNM Feb 7, 2026
497cd54
disable editors when first loading the source code
JeanJPNM Feb 8, 2026
d35bf6a
first attempt at at the redesign
JeanJPNM Feb 8, 2026
53cab51
add code folding for schemacode text blocks
JeanJPNM Feb 10, 2026
bfb3cb0
use tabs to wrap both editors
JeanJPNM Feb 10, 2026
c47a083
move the fallback page to 200.html
JeanJPNM Feb 12, 2026
a863ecd
prevent output textarea from resizing
JeanJPNM Feb 12, 2026
bf5ddb6
use a custom web config to support routes without the .html extension
JeanJPNM Feb 13, 2026
1e5d3b8
add an error page
JeanJPNM Feb 13, 2026
bfce525
use anchors inside the tool select
JeanJPNM Feb 13, 2026
a865d66
rewrite editor action buttons
JeanJPNM Feb 13, 2026
729621b
add titles to all pages
JeanJPNM Feb 13, 2026
5b21a40
put source id in the editor's history
JeanJPNM Feb 23, 2026
4e97f9e
have samples in a defined order
JeanJPNM Feb 24, 2026
4de54f1
handle individual target processors
JeanJPNM Feb 25, 2026
41fa62c
fix range operator precedence
JeanJPNM Feb 25, 2026
24564f1
support loop and implicit labels
JeanJPNM Feb 25, 2026
0f8b3e9
use lucide's chevrons on the fold gutters
JeanJPNM Feb 25, 2026
52cd2b8
fix target picker
JeanJPNM Feb 25, 2026
8792853
avoid saving sample sources in the database
JeanJPNM Feb 25, 2026
0fee012
enable line wrapping in all editors
JeanJPNM Feb 25, 2026
eaef3de
fix mindcode language configuration
JeanJPNM Feb 26, 2026
db55097
make OutputEditorStore better match the input store's behavior
JeanJPNM Feb 26, 2026
5192956
add MlogWatcher v0.3 integration
JeanJPNM Feb 26, 2026
cfec863
remove unused class from copy button
JeanJPNM Feb 26, 2026
bbfcafd
add a setting to control line wrapping
JeanJPNM Feb 26, 2026
de127f6
prevent impossible compiler targets
JeanJPNM Feb 26, 2026
354e90b
fix mlog block folding
JeanJPNM Feb 26, 2026
112a62a
fix declare directive grammar rule
JeanJPNM Feb 26, 2026
64cebec
handle mindcode comments (//) in embedded mlog
JeanJPNM Feb 26, 2026
f491cbb
always enable line wrapping for encoded schematic editors
JeanJPNM Feb 26, 2026
9a46582
remove unecessary uses of `any`
JeanJPNM Feb 27, 2026
64d1ce8
make output panel visible when triggering compilation
JeanJPNM Feb 27, 2026
faeeb47
put the compiler messages in the same tab as the processor outputs
JeanJPNM Feb 27, 2026
8187edd
move settings button to the navigation bar
JeanJPNM Feb 27, 2026
349b259
fix editor id sync issues
JeanJPNM Mar 1, 2026
7519d37
add tests for the lezer grammars
JeanJPNM Mar 3, 2026
cb1846b
move the editor actions to the tab bars
JeanJPNM Mar 3, 2026
1004ffc
update usage of Target in ApiController
JeanJPNM Mar 3, 2026
9dcee27
add engine constraints to package.json
JeanJPNM Mar 4, 2026
fb2df1f
remove unecessary overflow handling on textarea
JeanJPNM Mar 4, 2026
8e8301a
remove svelte favicon
JeanJPNM Mar 4, 2026
23eedef
only add fold gutters to the input editor
JeanJPNM Mar 4, 2026
001487d
remove old backend code
JeanJPNM Mar 4, 2026
dfe24b8
remove temporary test files
JeanJPNM Mar 4, 2026
d640727
allow skipping building the frontend
JeanJPNM Mar 4, 2026
f93b016
add development documentation
JeanJPNM Mar 4, 2026
88c98b2
enable fold gutters on a per language basis
JeanJPNM Mar 4, 2026
b3d905c
restore fold gutters on all editors
JeanJPNM Mar 4, 2026
0d4f455
remove processor type from the default compiler target
JeanJPNM Mar 4, 2026
9251255
remove debug print calls from the compiler
JeanJPNM Mar 4, 2026
53af4c1
update frontend dependencies
JeanJPNM Mar 5, 2026
f423272
fix title of webapp/README.md
JeanJPNM Mar 5, 2026
6716c5a
fix schemacode samples being saved on the database
JeanJPNM Mar 5, 2026
1bb4330
add missing item-transport sample to the mindcode samples
JeanJPNM Mar 5, 2026
85ae0ec
use specific output code tab titles
JeanJPNM Mar 5, 2026
40b3313
select the output of the first processor by default (when possible)
JeanJPNM Mar 5, 2026
39519ec
show the output tab when pressing "x and run"
JeanJPNM Mar 5, 2026
0c070a3
add missing sample loading from schematics page
JeanJPNM Mar 5, 2026
aa5a8e2
ensure the page info cards have consistent styles
JeanJPNM Mar 5, 2026
4fafb0c
make the iinfo cards collapsible and save their state locally
JeanJPNM Mar 6, 2026
5db92ae
fix mlog watcher socket url
JeanJPNM Mar 6, 2026
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
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
*node_modules*
**/target
.git
.idea
*.iml
test-output
4 changes: 4 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ jobs:
with:
java-version: 22
distribution: temurin
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22

# Use preinstalled PostgreSQL
- name: Start PostgreSQL on Ubuntu
Expand Down
5 changes: 5 additions & 0 deletions .slugignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
webapp/frontend/node_modules
webapp/frontend/.svelte-kit
webapp/frontend/README.md
webapp/frontend/components.json
webapp/frontend/eslint.config.json
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ FROM eclipse-temurin:22

WORKDIR /srv

ARG SKIP_FRONTEND=false

RUN apt update && apt -y install maven

COPY pom.xml pom.xml
Expand All @@ -17,13 +19,13 @@ RUN mvn dependency:go-offline

COPY . .

ENV SPRING_DATASOURCE_URL jdbc:postgresql://mindcode-db/mindcode_development
ENV SPRING_DATASOURCE_URL jdbc:postgresql://mindcode-db:5432/mindcode_development
ENV SPRING_DATASOURCE_USERNAME postgres
ENV SPRING_DATASOURCE_PASSWORD pg_password

# Skip tests because postgres is only available at runtime
RUN mvn install -Dmaven.test.skip
RUN mvn clean package -Dmaven.test.skip -DskipFrontend=${SKIP_FRONTEND}

EXPOSE 8080

CMD java -classpath `find webapp -type f -name '*.jar' | tr '\n' ':'` info.teksol.mindcode.webapp.WebappApplication
CMD java -jar webapp/target/mindcode-webapp.jar
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: java -Dserver.port=${PORT} -classpath $( find webapp -type f -name '*.jar' | tr '\n' ':' ) info.teksol.mindcode.webapp.WebappApplication
web: java -Dserver.port=${PORT} -jar webapp/target/mindcode-webapp.jar
11 changes: 10 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
services:

mindcode-db:
image: postgres:17
restart: on-failure
Expand All @@ -11,16 +10,26 @@ services:
- mindcode-postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
networks:
- mindcode-net

mindcode-web:
build:
context: .
args:
SKIP_FRONTEND: ${SKIP_FRONTEND:-false}

depends_on:
- mindcode-db
ports:
- "127.0.0.1:8080:8080"
networks:
- mindcode-net

volumes:
mindcode-postgres-data:
driver: local

networks:
mindcode-net:
driver: bridge
5 changes: 5 additions & 0 deletions samples/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Contains the samples used by the webapp.

The json files contain additional information about the samples, such as
whether they should be executed by default and the order in which they should
appear to the user.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public static Map<String, Sample> loadMindcodeSamples() {
"relaxed:many-thorium",
"heal-damaged-building",
"mining-drone",
"item-transport",
"upgrade-conveyors",
"run:sum-of-primes"
);
Expand Down
42 changes: 42 additions & 0 deletions samples/src/main/resources/samples/mindcode.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"filename": "control-multiple-units.mnd",
"title": "Controlling units",
"runnable": false
},
{
"filename": "one-thorium.mnd",
"title": "Controlling a block",
"runnable": false
},
{
"filename": "many-thorium.mnd",
"title": "Controlling many blocks",
"runnable": false
},
{
"filename": "heal-damaged-building.mnd",
"title": "Healing buildings",
"runnable": false
},
{
"filename": "mining-drone.mnd",
"title": "Mining drone",
"runnable": false
},
{
"filename": "item-transport.mnd",
"title": "Item Transport",
"runnable": false
},
{
"filename": "upgrade-conveyors.mnd",
"title": "Upgrade conveyors",
"runnable": false
},
{
"filename": "sum-of-primes.mnd",
"title": "Sum of primes",
"runnable": true
}
]
52 changes: 52 additions & 0 deletions samples/src/main/resources/samples/schematics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[
{
"filename": "detector.sdf",
"title": "Property Detector",
"runnable": false
},
{
"filename": "healing-center.sdf",
"title": "Healing Center",
"runnable": false
},
{
"filename": "on-off-switch.sdf",
"title": "On/Off Switch",
"runnable": false
},
{
"filename": "regulator.sdf",
"title": "Regulator",
"runnable": false
},
{
"filename": "overdrive-dome-supply.sdf",
"title": "Overdrive Dome Supply",
"runnable": false
},
{
"filename": "worker-recall-station.sdf",
"title": "Unit Recall Station",
"runnable": false
},
{
"filename": "scrap-to-metaglass-2.sdf",
"title": "Scrap to Metaglass",
"runnable": false
},
{
"filename": "item-transport.sdf",
"title": "Item Transport",
"runnable": false
},
{
"filename": "payload-hub.sdf",
"title": "Payload Hub",
"runnable": false
},
{
"filename": "mandelbrot-generator.sdf",
"title": "Mandelbrot Generator",
"runnable": false
}
]
2 changes: 2 additions & 0 deletions webapp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ build/

### VS Code ###
.vscode/

src/main/resources/static
34 changes: 34 additions & 0 deletions webapp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Mindcode webapp

The frontend for mindcode is built using [svelte kit](https://svelte.dev/docs/kit/introduction).

## Development (backend)

Look at the [contribution guide](../CONTRIBUTING.markdown).

As you will see in [deployment](#deployment), building the backend will also build the frontend, so you don't need to setup node if you only want to edit backend code.

To prevent the frontend from being built unecessarily, you may use `-DskipFrontend=true` on the maven command, or set the `SKIP_FRONTEND` environment variable when running the backend through docker.

## Development (frontend)

If you need to make changes to the frontend, run

```sh
cd webapp/frontend
npm run dev
```

This will open a development server on `http://localhost:5173`, which provides hot reload for the pages, and proxies request to `/api/**` to `http://localhost:8080/api/**` (the url where the mindcode webapp server runs during development, the mindcode server needs to be run separatedly).

## Deployment

When building the webapp, [`frontend-maven-plugin`](https://github.com/eirslett/frontend-maven-plugin) will be invoked to build the frontend.

`webapp/frontend/svelte.config.js` contains the frontend configuration, it is configured so that:
- The frontend is built as a collection of html pages with client-side routing
- The build output is placed on `webapp/src/main/resources/static`

> [!WARNING]
> If the `HEROKU` environment variable is present, most folders and files in the project will be deleted,
> preserving only `webapp/target/mindcode-webapp.jar` and a few configuration files.
23 changes: 23 additions & 0 deletions webapp/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
node_modules

# Output
.output
.vercel
.netlify
.wrangler
/.svelte-kit
/build

# OS
.DS_Store
Thumbs.db

# Env
.env
.env.*
!.env.example
!.env.test

# Vite
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
1 change: 1 addition & 0 deletions webapp/frontend/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
engine-strict=true
9 changes: 9 additions & 0 deletions webapp/frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Package Managers
package-lock.json
pnpm-lock.yaml
yarn.lock
bun.lock
bun.lockb

# Miscellaneous
/static/
16 changes: 16 additions & 0 deletions webapp/frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
],
"tailwindStylesheet": "./src/routes/layout.css"
}
16 changes: 16 additions & 0 deletions webapp/frontend/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://shadcn-svelte.com/schema.json",
"tailwind": {
"css": "src\\routes\\layout.css",
"baseColor": "neutral"
},
"aliases": {
"components": "$lib/components",
"utils": "$lib/utils",
"ui": "$lib/components/ui",
"hooks": "$lib/hooks",
"lib": "$lib"
},
"typescript": true,
"registry": "https://shadcn-svelte.com/registry"
}
41 changes: 41 additions & 0 deletions webapp/frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import prettier from 'eslint-config-prettier';
import { fileURLToPath } from 'node:url';
import { includeIgnoreFile } from '@eslint/compat';
import js from '@eslint/js';
import svelte from 'eslint-plugin-svelte';
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import ts from 'typescript-eslint';
import svelteConfig from './svelte.config.js';

const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));

export default defineConfig(
includeIgnoreFile(gitignorePath),
js.configs.recommended,
...ts.configs.recommended,
...svelte.configs.recommended,
prettier,
...svelte.configs.prettier,
{
languageOptions: { globals: { ...globals.browser, ...globals.node } },

rules: {
// typescript-eslint strongly recommend that you do not use the no-undef lint rule on TypeScript projects.
// see: https://typescript-eslint.io/troubleshooting/faqs/eslint/#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
'no-undef': 'off'
}
},
{
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],

languageOptions: {
parserOptions: {
projectService: true,
extraFileExtensions: ['.svelte'],
parser: ts.parser,
svelteConfig
}
}
}
);
Loading