Skip to content

Commit b74b0df

Browse files
authored
Merge branch 'main' into jquery-to-vue-listeners#433
2 parents 55dc530 + 15f0d4a commit b74b0df

File tree

576 files changed

+745
-78431
lines changed

Some content is hidden

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

576 files changed

+745
-78431
lines changed

.github/workflows/eslint.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,16 @@ jobs:
3131

3232
- name: Install ESLint
3333
run: |
34-
npm install eslint@8.10.0
34+
npm install eslint@8.57.0
3535
npm install @microsoft/eslint-formatter-sarif@2.1.7
3636
3737
- name: Run ESLint
38-
run: npx eslint .
39-
--config .eslintrc.js
40-
--ext .js,.jsx,.ts,.tsx
41-
--format @microsoft/eslint-formatter-sarif
42-
--output-file eslint-results.sarif
38+
run: |
39+
npx eslint . \
40+
--config .eslintrc.js \
41+
--ext .js,.jsx,.ts,.tsx \
42+
--format @microsoft/eslint-formatter-sarif \
43+
--output-file eslint-results.sarif
4344
continue-on-error: true
4445

4546
- name: Upload analysis results to GitHub

.github/workflows/tauri-build.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
args: '--target x86_64-apple-darwin' # Intel Mac
2121
- platform: 'ubuntu-22.04'
2222
args: ''
23+
- platform: 'windows-latest'
24+
args: ''
2325

2426

2527
runs-on: ${{ matrix.platform }}
@@ -64,12 +66,7 @@ jobs:
6466
env:
6567
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6668
with:
67-
projectPath: ./src-tauri
68-
tagName: app-v__VERSION__
69-
releaseName: "CircuitVerse Desktop v__VERSION__"
70-
releaseBody: "See the assets below to download this release."
71-
releaseDraft: true
72-
prerelease: false
69+
projectPath: ./src-tauri
7370
args: ${{ matrix.args }}
7471

7572
- name: Upload Artifacts

README.md

Lines changed: 80 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -10,52 +10,88 @@ We would love to hear from you! We communicate on Slack:
1010

1111
[![Slack](https://img.shields.io/badge/chat-on_slack-purple.svg?style=for-the-badge&logo=slack)](https://circuitverse.org/slack)
1212

13-
## Installation
14-
To set up the project on your local machine, follow these steps:
15-
16-
1. Clone the repository to your local machine using the following command:
17-
```
18-
git clone https://github.com/CircuitVerse/cv-frontend-vue.git
19-
```
20-
2. Navigate to the project directory:
21-
```
22-
cd cv-frontend-vue
23-
```
24-
3. Install the project dependencies:
25-
```
26-
npm install
27-
```
28-
4. Start the development server:
29-
```
30-
npm run dev
31-
```
32-
33-
## Setting up on cloud with Stackblitz
34-
[StackBlitz](https://developer.stackblitz.com/guides/user-guide/what-is-stackblitz) is an instant fullstack web IDE for the JavaScript ecosystem.
35-
36-
1. Initiate the setup process by clicking on the following button:
37-
38-
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/~/github.com/CircuitVerse/cv-frontend-vue)
39-
40-
2. Once the setup is complete, a Preview URL will be displayed in the browser window. Append `/simulatorvue/` to your URL to access the simulator.
41-
```
42-
https://<preview_url>/simulatorvue/
43-
```
13+
## Development & Versions
14+
This repository supports multiple versions of the simulator.
15+
- **v0**: Stable production version.
16+
- **v1**: Experimental version for new features.
17+
18+
To start the development server:
19+
```bash
20+
# Start v0 (Default)
21+
npm run dev
22+
23+
# Start v1 (Windows/Unix)
24+
# Set VITE_SIM_VERSION=v1 in your environment and run npm run dev
25+
```
26+
27+
## Build System
28+
We use a unified build system to generate assets for all versions.
29+
30+
To build all supported versions:
31+
```bash
32+
npm run build
33+
```
34+
35+
To build a specific version:
36+
```bash
37+
npm run build -- v1
38+
```
39+
Built assets will be available in `dist/simulatorvue/`. Each version will have a predictable entry point:
40+
- `dist/simulatorvue/v0/simulator-v0.js`
41+
- `dist/simulatorvue/v1/simulator-v1.js`
42+
43+
## Route-Agnostic Support
44+
The simulator is designed to be **route-agnostic**. It can be mounted on any path (e.g., within a Rails view) by including the appropriate script and setting global variables:
45+
46+
```html
47+
<div id="app"></div>
48+
<script>
49+
window.logixProjectId = "0"; // Project ID or "0" for new
50+
window.isUserLoggedIn = true;
51+
</script>
52+
<script type="module" src="/simulatorvue/v0/simulator-v0.js"></script>
53+
```
54+
55+
## Embed Mode
56+
The simulator can be embedded in two ways:
57+
58+
### 1. Via Iframe (Recommended for external sites)
59+
Use the dedicated embed route in your iframe `src`.
60+
```html
61+
<iframe
62+
src="/simulatorvue/v0/embed/:projectId"
63+
width="100%"
64+
height="600px"
65+
></iframe>
66+
```
67+
68+
### 2. Direct Integration (Recommended for main Rails app)
69+
Include the simulator script on any page and set the `window.embed` flag. This renders the minimal embed UI instead of the full simulator UI.
70+
```html
71+
<div id="app"></div>
72+
<script>
73+
window.embed = true;
74+
window.logixProjectId = "123";
75+
</script>
76+
<script type="module" src="/simulatorvue/v0/simulator-v0.js"></script>
77+
```
78+
79+
The embed mode supports query parameters for customization (e.g., `?theme=dark&fullscreen=false`):
80+
- `theme`: `light` (default) or `dark`
81+
- `display_title`: `true` or `false`
82+
- `clock_time`: `true` or `false`
83+
- `fullscreen`: `true` or `false`
84+
- `zoom_in_out`: `true` or `false`
4485

4586
## How to Use Vue Simulator with CircuitVerse Main Repo
46-
To access the Vue Simulator from the [CircuitVerse main repo](https://github.com/CircuitVerse/CircuitVerse) dev server, you can follow one of the following methods:
47-
48-
### Accessing Vue Simulator
49-
1. Start the CircuitVerse Main Repo dev server.
50-
2. go to the `/simulatorvue` path in the dev server.
51-
3. You would be accessing the Vue Simulator.
52-
53-
### Setting Vue Simulator as Default
54-
1. Log in to the CircuitVerse dev server using the admin account:
55-
- **Email:** `admin@circuitverse.org`
56-
- **Password:** `password`
57-
2. Once logged in, go to `/flipper` path and turn on vuesim feature flag site wide or for your user.
58-
3. After activation, you will be able to access the Vue Simulator site-wide in your dev server, also in `/simulator` path the Vue Simulator will be opening instead of the old simulator.
87+
The Vue Simulator can be integrated into the [CircuitVerse main repo](https://github.com/CircuitVerse/CircuitVerse) as a replacement for the legacy jQuery-based simulator.
88+
89+
### Activation via Flipper
90+
1. Log in to the CircuitVerse dev server using an admin account.
91+
2. Navigate to `/flipper`.
92+
3. Enable the `vuesim` feature flag.
93+
94+
Once enabled, the Rails app will handle routing and data synchronization between the backend and the Vue frontend.
5995

6096
## Code of Conduct
6197
We follow the [Code of Conduct](https://github.com/CircuitVerse/CircuitVerse/blob/master/code-of-conduct.md) of the [CircuitVerse](https://circuitverse.org) Community.

build.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

index-cv.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
<body>
1212
<div id="app"></div>
13-
<%- injectScript %>
13+
<!-- inject-script -->
1414
</body>
1515
</html>

netlify.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
[build]
2-
command = "npm run build && mkdir -p ./dist && cp -r ../public/* ./dist/"
2+
command = "npm run build"
3+
publish = "dist"
34

45
[[redirects]]
56
from = "/"
6-
to = "/simulatorvue"
7+
to = "/simulatorvue/v0/"
78
status = 301
89
force = true
910

1011
[[redirects]]
1112
from = "/simulatorvue/v0/*"
12-
to = "/simulatorvue/v0/index-cv.html"
13+
to = "/simulatorvue/v0/index.html"
1314
status = 200
1415

1516
[[redirects]]
1617
from = "/simulatorvue/v1/*"
17-
to = "/simulatorvue/v1/index-cv.html"
18+
to = "/simulatorvue/v1/index.html"
1819
status = 200
1920

2021
[[redirects]]
2122
from = "/simulatorvue/*"
22-
to = "/simulatorvue/v0/index-cv.html"
23+
to = "/simulatorvue/v0/index.html"
2324
status = 200

0 commit comments

Comments
 (0)