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

Combining Vue Simulator Versioning PRs #337

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
5709f72
chore: adding versioned directory(v0 and v1) with src
aryanndwi123 Jun 4, 2024
1785b8b
chore: adding version details to version.json
aryanndwi123 Jun 23, 2024
457562a
build: modifying build script in vite.config.ts for different versions
aryanndwi123 Jun 23, 2024
e1b896f
build: modifying build script in netlify.toml for different versions
aryanndwi123 Jun 23, 2024
66b27f3
fix: update paths for bootstrap and fontawesome imports
aryanndwi123 Jun 23, 2024
584aa1a
build:add bash script to build multiple vite configurations
aryanndwi123 Jul 3, 2024
b5220a9
revert: removed environment variable and simplify paths, configuratio…
aryanndwi123 Jul 3, 2024
4f1ef2f
revert: removed environment variables from netlify config
aryanndwi123 Jul 4, 2024
1153177
fix: refactor script to read versions dynamically from versions.json …
aryanndwi123 Jul 6, 2024
a20ee7c
fix:add getConfiguredVersion to handle query parameter version(simver)
aryanndwi123 Jul 6, 2024
caea903
feat: add dynamic version loading function
aryanndwi123 Jul 6, 2024
c4e1169
feat: add main vue application entrypoint
aryanndwi123 Jul 6, 2024
e64648d
refactor: update entry point to use version-specific main.ts
aryanndwi123 Jul 6, 2024
31f8873
Merge branch 'restructure-src-directory' into versioning-combined-prs
aryanndwi123 Jul 15, 2024
8379969
Merge branch 'build-script-modification' into versioning-combined-prs
aryanndwi123 Jul 15, 2024
2a69196
Merge branch 'dynamic-version-loading' into versioning-combined-prs
aryanndwi123 Jul 15, 2024
3ac760c
fix:path for dynamic import of version
aryanndwi123 Jul 16, 2024
86c921d
fix: baseurl for different version to /simulatorvue/
aryanndwi123 Jul 16, 2024
8584120
fix: change import paths for different versions and baseurl
aryanndwi123 Jul 16, 2024
29151bf
Revert "fix: baseurl for different version to /simulatorvue/"
aryanndwi123 Jul 16, 2024
e5074eb
fix: changing single quotes to double
aryanndwi123 Jul 16, 2024
2e90266
chore: update build script to separate vite build and bash script
aryanndwi123 Jul 16, 2024
42d0b43
Merge dynamic-version-loading branch to versioning-combined-prs
aryanndwi123 Jul 16, 2024
0abb5d4
Merge branch 'build-scipt-modification' to 'versioning-combined-prs'
aryanndwi123 Jul 16, 2024
69891e6
fix: changing the baseurl from /simulatorvue/ to point to specific ve…
aryanndwi123 Jul 26, 2024
48d527f
fix: changing single quotes with double
aryanndwi123 Jul 26, 2024
6d15c77
feat: adding the html script injection in vite config
aryanndwi123 Jul 29, 2024
33553f5
feat: adding vite-plugin-html to dependencies
aryanndwi123 Jul 29, 2024
70b2cb4
feat: adding simulator version in the circuit data
aryanndwi123 Jul 29, 2024
b44a1c0
merging build-script-modification
aryanndwi123 Jul 29, 2024
ca46248
feat: Redirect to correct circuitversion based on simulatorVersion in…
aryanndwi123 Jul 29, 2024
5cd787d
feat:adding injectScript tag in index.html
aryanndwi123 Jul 29, 2024
a72d535
feat: add redirect logic for simulator version-based url
aryanndwi123 Jul 30, 2024
e21c44d
feat: replace injectScript with module script for main.ts in index.html
aryanndwi123 Jul 30, 2024
15dfd4c
chore: addding index-cv.html to inject custom script
aryanndwi123 Jul 30, 2024
2697be1
build: update vite config of different versions to set index-cv.html …
aryanndwi123 Jul 30, 2024
33d4533
fix: making v0 as default simulator in cv-frontend-vue
aryanndwi123 Jul 30, 2024
4633576
fix: adding different paths for versions in netlify.toml
aryanndwi123 Aug 17, 2024
e92d95b
Merge branch 'main' into versioning-combined-prs
JoshVarga Sep 1, 2024
331bbd4
fix:redirect to legacy simulator when no simulator version specified …
aryanndwi123 Oct 20, 2024
d587a9d
feat:version mismatch dialog box for different versions
aryanndwi123 Oct 25, 2024
e56653d
feat:adding version mismatch dialog box for legacy simulator
aryanndwi123 Oct 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
19 changes: 19 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash


versions=($(jq -r '.[].version' version.json))


for version in "${versions[@]}"; do
echo "Building for version: $version"

npx vite build --config vite.config."$version".ts

#Build status
if [ $? -ne 0 ]; then
echo "Build failed for version: $version"
exit 1
fi
done

echo "All builds completed successfully"
15 changes: 15 additions & 0 deletions index-cv.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<title>CircuitVerse</title>
</head>

<body>
<div id="app"></div>
<%- injectScript %>
</body>
</html>
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<script type="module" src="/v0/src/main.ts"></script>
</body>
</html>
16 changes: 13 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
[build]
command = "npm run build && mkdir -p ./dist && cp -r ../public/* ./dist/ && mv ./dist/simulatorvue/index.html ./dist/"
command = "npm run build && mkdir -p ./dist && cp -r ../public/* ./dist/"

[[redirects]]
from = "/simulatorvue/*"
to = "/index.html"
from = "/simulatorvue/v0/*"
to = "/simulatorvue/v0/index-cv.html"
status = 200

[[redirects]]
from = "/simulatorvue/v1/*"
to = "/simulatorvue/v1/index-cv.html"
status = 200

[[redirects]]
from = "/simulatorvue/*"
to = "/simulatorvue/v0/index-cv.html"
status = 200
1,786 changes: 1,719 additions & 67 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"scripts": {
"serve": "vite preview",
"build": "vite build",
"build": "bash build.sh",
"dev": "vite",
"preview": "vite preview",
"lint": "eslint --ext .js,.vue --ignore-path .gitignore --fix src",
Expand Down Expand Up @@ -55,6 +55,7 @@
"sass": "^1.77.6",
"typescript": "^4.5.4",
"vite": "^2.9.18",
"vite-plugin-html": "^3.2.2",
"vite-plugin-vuetify": "^1.0.0-alpha.0",
"vue-cli-plugin-vuetify": "~2.5.1",
"vue-tsc": "^0.34.7"
Expand Down
21 changes: 21 additions & 0 deletions v0/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<template>
<router-view />
</template>

<script lang="ts" setup>
// import { defineComponent } from 'vue'

// export default defineComponent({
// name: 'App',

// components: {
// HelloWorld,
// },

// data () {
// return {
// //
// }
// },
// })
</script>
236 changes: 236 additions & 0 deletions v0/src/assets/constants/Navbar/NAVBAR_DATA.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
[
{
"id": "1",
"text": "project",
"spanClass": "caret",
"dropdownItems": [
{
"id": "1",
"item": "new_project",
"itemid": "newProject",
"attributes": []
},
{
"id": "2",
"item": "save_online",
"itemid": "save",
"attributes": []
},
{
"id": "3",
"item": "save_offline",
"itemid": "saveOffline",
"attributes": []
},
{
"id": "4",
"item": "open_offline",
"itemid": "createOpenLocalPrompt",
"attributes": []
},
{
"id": "5",
"item": "export_as_file",
"itemid": "ExportProject",
"attributes": []
},
{
"id": "6",
"item": "import_project",
"itemid": "ImportProject",
"attributes": []
},
{
"id": "7",
"item": "clear_project",
"itemid": "clearProject",
"attributes": []
},
{
"id": "8",
"item": "recover_project",
"itemid": "recoverProject",
"attributes": []
},
{
"id": "9",
"item": "preview_circuit",
"itemid": "fullViewOption",
"attributes": []
},
{
"id": "10",
"item": "view_previous_ui",
"itemid": "",
"attributes": [
{
"name": "onclick",
"value": "old_ui_redirect()"
}
]
}
]
},
{
"id": "2",
"text": "circuit",
"spanClass": "caret",
"dropdownItems": [
{
"id": "1",
"item": "new_circuit",
"itemid": "createNewCircuitScope",
"attributes": []
},
{
"id": "2",
"item": "new_verilog_module_html",
"itemid": "newVerilogModule",
"attributes": []
},
{
"id": "3",
"item": "insert_subcircuit",
"itemid": "createSubCircuitPrompt",
"attributes": []
}
]
},
{
"id": "3",
"text": "tools",
"spanClass": "caret",
"dropdownItems": [
{
"id": "1",
"item": "combinational_analysis_html",
"itemid": "createCombinationalAnalysisPrompt",
"attributes": []
},
{
"id": "2",
"item": "hex_bin_dec_converter_html",
"itemid": "bitconverter",
"attributes": []
},
{
"id": "3",
"item": "download_image",
"itemid": "createSaveAsImgPrompt",
"attributes": []
},
{
"id": "4",
"item": "themes",
"itemid": "colorThemes",
"attributes": []
},
{
"id": "5",
"item": "custom_shortcut",
"itemid": "customShortcut",
"attributes": []
},
{
"id": "6",
"item": "export_verilog",
"itemid": "generateVerilog",
"attributes": []
}
]
},
{
"id": "4",
"text": "help",
"spanClass": "caret",
"dropdownItems": [
{
"id": "1",
"item": "tutorial_guide",
"itemid": "showTourGuide",
"attributes": []
},
{
"id": "2",
"item": "user_manual",
"itemid": "",
"attributes": [
{
"name": "href",
"value": "https://docs.circuitverse.org"
},
{
"name": "target",
"value": "_blank"
},
{
"name": "role",
"value": "button"
},
{
"name": "aria-haspopup",
"value": "true"
},
{
"name": "aria-expanded",
"value": "false"
}
]
},
{
"id": "3",
"item": "learn_digital_logic",
"itemid": "",
"attributes": [
{
"name": "href",
"value": "https://learn.circuitverse.org"
},
{
"name": "target",
"value": "_blank"
},
{
"name": "role",
"value": "button"
},
{
"name": "aria-haspopup",
"value": "true"
},
{
"name": "aria-expanded",
"value": "false"
}
]
},
{
"id": "4",
"item": "discussion_forum",
"itemid": "",
"attributes": [
{
"name": "href",
"value": "https://circuitverse.org/forum"
},
{
"name": "target",
"value": "_blank"
},
{
"name": "role",
"value": "button"
},
{
"name": "aria-haspopup",
"value": "true"
},
{
"name": "aria-expanded",
"value": "false"
}
]
}
]
}
]
Loading