Skip to content

Commit 2319685

Browse files
Combining Vue Simulator Versioning PRs (#337)
* chore: adding versioned directory(v0 and v1) with src * chore: adding version details to version.json * build: modifying build script in vite.config.ts for different versions * build: modifying build script in netlify.toml for different versions * fix: update paths for bootstrap and fontawesome imports * build:add bash script to build multiple vite configurations * revert: removed environment variable and simplify paths, configurations in Vite config * revert: removed environment variables from netlify config * fix: refactor script to read versions dynamically from versions.json instead of using a hardcoded array * fix:add getConfiguredVersion to handle query parameter version(simver) * feat: add dynamic version loading function * feat: add main vue application entrypoint * refactor: update entry point to use version-specific main.ts * fix:path for dynamic import of version * fix: baseurl for different version to /simulatorvue/ * fix: change import paths for different versions and baseurl * Revert "fix: baseurl for different version to /simulatorvue/" This reverts commit 86c921d. * fix: changing single quotes to double * chore: update build script to separate vite build and bash script * fix: changing the baseurl from /simulatorvue/ to point to specific version * fix: changing single quotes with double * feat: adding the html script injection in vite config * feat: adding vite-plugin-html to dependencies * feat: adding simulator version in the circuit data * feat: Redirect to correct circuitversion based on simulatorVersion in openProjectOffline * feat:adding injectScript tag in index.html * feat: add redirect logic for simulator version-based url * feat: replace injectScript with module script for main.ts in index.html * chore: addding index-cv.html to inject custom script * build: update vite config of different versions to set index-cv.html as rollup input * fix: making v0 as default simulator in cv-frontend-vue * fix: adding different paths for versions in netlify.toml * fix:redirect to legacy simulator when no simulator version specified in the circuit_data * feat:version mismatch dialog box for different versions * feat:adding version mismatch dialog box for legacy simulator * fix: package-lock.json conflicts in the versioning-combined-prs and main branch --------- Co-authored-by: Josh Varga <[email protected]>
1 parent 6eae6ed commit 2319685

File tree

1,011 files changed

+126015
-4186
lines changed

Some content is hidden

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

1,011 files changed

+126015
-4186
lines changed

build.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
4+
versions=($(jq -r '.[].version' version.json))
5+
6+
7+
for version in "${versions[@]}"; do
8+
echo "Building for version: $version"
9+
10+
npx vite build --config vite.config."$version".ts
11+
12+
#Build status
13+
if [ $? -ne 0 ]; then
14+
echo "Build failed for version: $version"
15+
exit 1
16+
fi
17+
done
18+
19+
echo "All builds completed successfully"

index-cv.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
8+
<title>CircuitVerse</title>
9+
</head>
10+
11+
<body>
12+
<div id="app"></div>
13+
<%- injectScript %>
14+
</body>
15+
</html>

index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010

1111
<body>
1212
<div id="app"></div>
13-
<script type="module" src="/src/main.ts"></script>
13+
<script type="module" src="/v0/src/main.ts"></script>
1414
</body>
1515
</html>

netlify.toml

+13-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
[build]
2-
command = "npm run build && mkdir -p ./dist && cp -r ../public/* ./dist/ && mv ./dist/simulatorvue/index.html ./dist/"
2+
command = "npm run build && mkdir -p ./dist && cp -r ../public/* ./dist/"
33

44
[[redirects]]
5-
from = "/simulatorvue/*"
6-
to = "/index.html"
5+
from = "/simulatorvue/v0/*"
6+
to = "/simulatorvue/v0/index-cv.html"
7+
status = 200
8+
9+
[[redirects]]
10+
from = "/simulatorvue/v1/*"
11+
to = "/simulatorvue/v1/index-cv.html"
712
status = 200
13+
14+
[[redirects]]
15+
from = "/simulatorvue/*"
16+
to = "/simulatorvue/v0/index-cv.html"
17+
status = 200

0 commit comments

Comments
 (0)