Skip to content

Commit 117fac9

Browse files
Updates
1 parent f92367e commit 117fac9

File tree

8 files changed

+127
-5
lines changed

8 files changed

+127
-5
lines changed

src/_justManifest_end.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
window._justManifest = _justManifest_;
1+
window._just_Manifest = _just_Manifest0;

src/_justManifest_start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
const _justManifest_ = [];
1+
const _just_Manifest0 = [];

src/buildManifest_end.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
window._just_Manifest = _just_buildManifest;
1+
window._just_buildManifest = _just_buildManifest0;
22

33
/* Example usage:
44

src/buildManifest_start.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
const _just_buildManifest = [];
1+
const _just_buildManifest0 = [];

src/build_map.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,34 @@
2525
BUILD_ID=$(cat .next/BUILD_ID)
2626
mkdir -p deploy/_just/static/
2727
mkdir -p deploy/_just/static/$BUILD_ID/
28+
mkdir -p deploy/_just/static/chunks/
29+
30+
generate_strings() {
31+
local count=$1
32+
local length=$2
33+
local chars="qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890-_"
34+
for ((i=0; i<count; i++)); do
35+
local random_string=""
36+
for ((j=0; j<length; j++)); do
37+
random_string+="${chars:RANDOM%32:1}"
38+
done
39+
echo "$random_string"
40+
done
41+
}
42+
43+
random_strings=($(generate_strings 1 16))
44+
clearCache_name=${random_strings[0]}c
2845

2946
echo "$(cat $GITHUB_ACTION_PATH/src/buildManifest_start.js)" > deploy/_just/static/$BUILD_ID/buildManifest.js
3047
echo "$(cat $GITHUB_ACTION_PATH/src/_justManifest_start.js)" > deploy/_just/static/$BUILD_ID/_justManifest.js
48+
echo "$(cat $GITHUB_ACTION_PATH/src/clearCache.js)" > deploy/_just/static/chunks/$clearCache_name.js
3149
find _just_data -mindepth 1 -print | while read -r path; do
3250
relative_path=${path#_just_data/}
3351
first_line=$(head -n 1 "$path")
3452
if [ -f "$path" ]; then
3553
if [[ "$first_line" != "// _just hide" ||
3654
"$first_line" != "// _just doNotModify+hide" ]]; then
37-
echo " _just_buildManifest.push(\"$relative_path\");" >> deploy/_just/static/$BUILD_ID/_justManifest.js
55+
echo " _justManifest_.push(\"$relative_path\");" >> deploy/_just/static/$BUILD_ID/_justManifest.js
3856
fi
3957
fi
4058
done

src/clearCache.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
window._just_Manifest.forEach(item => {
2+
const url = `${window.location.protocol}//${window.location.hostname}/${item}`;
3+
if (caches) {
4+
caches.keys().then(cacheNames => {
5+
cacheNames.forEach(cacheName => {
6+
caches.open(cacheName).then(cache => {
7+
cache.match(url).then(response => {
8+
if (response) {
9+
cache.delete(url);
10+
}
11+
});
12+
});
13+
});
14+
});
15+
}
16+
});

src/error.html

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width">
2+
<title>_just error</title>
3+
<meta name="viewport" content="width=device-width, initial-scale=1.0"><meta charset="utf-8"><style>
4+
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:ital,wght@0,100..700;1,100..700&family=Roboto:ital,wght@0,100..900;1,100..900&family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');
5+
html {
6+
line-height: 1.15;
7+
font-family: "Rubik";
8+
font-size: 16px;
9+
scroll-behavior: smooth
10+
}
11+
body {
12+
margin: 0;
13+
font-weight: 400;
14+
font-style: normal;
15+
text-decoration: none;
16+
text-transform: none;
17+
letter-spacing: normal;
18+
line-height: 1.15;
19+
background: #161616;
20+
}
21+
* {
22+
box-sizing: border-box;
23+
border-width: 0;
24+
border-style: solid;
25+
-webkit-font-smoothing: antialiased;
26+
}
27+
.home-container.just_ {
28+
width: 100%;
29+
display: -webkit-box;
30+
display: -webkit-flex;
31+
display: -moz-box;
32+
display: -ms-flexbox;
33+
display: flex;
34+
min-height: 100vh;
35+
-webkit-box-align: center;
36+
-webkit-align-items: center;
37+
-moz-box-align: center;
38+
-ms-flex-align: center;
39+
align-items: center;
40+
-webkit-box-orient: vertical;
41+
-webkit-box-direction: normal;
42+
-webkit-flex-direction: column;
43+
-moz-box-orient: vertical;
44+
-moz-box-direction: normal;
45+
-ms-flex-direction: column;
46+
flex-direction: column;
47+
-webkit-box-pack: center;
48+
-webkit-justify-content: center;
49+
-moz-box-pack: center;
50+
-ms-flex-pack: center;
51+
justify-content: center;
52+
background-image: -webkit-linear-gradient(left,rgba(0,0,0,.72)0%,rgba(0,0,0,.8)100%),-webkit-linear-gradient(315deg,rgb(0,25,136)1%,rgb(125,10,242)99%);
53+
background-image: -moz-linear-gradient(left,rgba(0,0,0,.72)0%,rgba(0,0,0,.8)100%),-moz-linear-gradient(315deg,rgb(0,25,136)1%,rgb(125,10,242)99%);
54+
background-image: -o-linear-gradient(left,rgba(0,0,0,.72)0%,rgba(0,0,0,.8)100%),-o-linear-gradient(315deg,rgb(0,25,136)1%,rgb(125,10,242)99%);
55+
background-image: linear-gradient(90deg,rgba(0,0,0,.72)0%,rgba(0,0,0,.8)100%),linear-gradient(135deg,rgb(0,25,136)1%,rgb(125,10,242)99%)
56+
}
57+
._just {
58+
scale: 0.98;
59+
border-radius: 50px;
60+
overflow: hidden;
61+
box-shadow: 0px 0px 20px 0px #000000c4;
62+
}
63+
.home-name.just_ {
64+
color: rgb(255,255,255);
65+
font-size: 50px;
66+
font-family: "Rubik"
67+
}
68+
69+
.home-text1.just_ {
70+
color: rgb(255,255,255);
71+
font-size: 1.5em;font-family: "Rubik"
72+
}
73+
74+
.home-text2.just_ {
75+
color: rgb(255,255,255);
76+
font-size: 16px;font-family: "Rubik"
77+
}
78+
</style></head><body>
79+
<div class="_just"><div class="just_ home-container"><span class="just_ home-name"><span class="just_">
80+
<span>Uh Oh!</span>
81+
</span></span><h1 class="just_ home-text1"><span class="just_">
82+
<span>_just error: a client-side exception has occurred.</span>
83+
</span></h1><span class="just_ home-text2"><span class="just_">
84+
<span>See the browser console for more information.</span>
85+
</span></span></div></div><script>document.ondragstart=noselect;document.onselectstart=noselect;document.oncontextmenu=noselect;function noselect(){return false;}</script></body></html>

src/override_deployment.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,6 @@ fi
4747
if [ ! -f "deploy/404.html" ]; then
4848
cp _just/404.html deploy/404.html
4949
fi
50+
51+
mkdir -p deploy/_just/e/
52+
echo "$(cat $GITHUB_ACTION_PATH/src/error.html)" > deploy/_just/e/1.html

0 commit comments

Comments
 (0)