Skip to content

Commit 09016ca

Browse files
updates
1 parent 42f2a43 commit 09016ca

File tree

8 files changed

+71
-53
lines changed

8 files changed

+71
-53
lines changed

.github/workflows/website.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ jobs:
7373
cp -r deploy/third-party/monaco-editor/package/min/vs deploy/vs && \
7474
rm -rf deploy/third-party/monaco-editor/package/esm/ && \
7575
rm -rf deploy/third-party/monaco-editor/package/dev/
76-
- name: some nice dirs
77-
run : |
78-
mkdir -- 'deploy/../../../vs' && \
79-
cp -r -- 'deploy/vs' 'deploy/../../../vs'
8076
- name: Upload artifact
8177
uses: actions/upload-pages-artifact@v3
8278
with:
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/*
2+
3+
MIT License
4+
5+
Copyright (c) 2025 JustStudio. <https://juststudio.is-a.dev/>
6+
7+
Permission is hereby granted, free of charge, to any person obtaining a copy
8+
of this software and associated documentation files (the "Software"), to deal
9+
in the Software without restriction, including without limitation the rights
10+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
copies of the Software, and to permit persons to whom the Software is
12+
furnished to do so, subject to the following conditions:
13+
14+
The above copyright notice and this permission notice shall be included in all
15+
copies or substantial portions of the Software.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23+
SOFTWARE.
24+
25+
*/
26+
27+
var require = { paths: { 'vs': 'third-party/monaco-editor/package/min/vs' } };
28+
const originalFetch = window.fetch;
29+
window.fetch = function(input, init) {
30+
console.log(input);
31+
let url;
32+
if (typeof input === 'string') {
33+
url = input;
34+
} else if (input instanceof Request) {
35+
url = input.url;
36+
} else {
37+
return originalFetch(input, init);
38+
}
39+
40+
try {
41+
const parsedUrl = new URL(url);
42+
const path = parsedUrl.pathname;
43+
44+
if (path.startsWith('/vs')) {
45+
const newPath = `/third-party/monaco-editor/package/min${path}`;
46+
return originalFetch(newPath, init);
47+
}
48+
} catch (e) {
49+
if (url.startsWith('vs')) {
50+
const newPath = `/third-party/monaco-editor/package/min/${url}`;
51+
return originalFetch(newPath, init);
52+
} else if (url.startsWith('/vs')) {
53+
const newPath = `/third-party/monaco-editor/package/min${url}`;
54+
return originalFetch(newPath, init);
55+
} else if (url.startsWith('../../../vs')) {
56+
const newPath = `/third-party/monaco-editor/package/min${url.slice(8)}`;
57+
return originalFetch(newPath, init);
58+
} else {
59+
return originalFetch(input, init);
60+
}
61+
}
62+
63+
return originalFetch(input, init);
64+
};

_just/js/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
console.log('demo');
1+
console.log('© JustStudio.');

lib/builder.js

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
MIT License
44
5-
Copyright (c) 2025 JustStudio <https://juststudio.is-a.dev/>
5+
Copyright (c) 2025 JustStudio. <https://juststudio.is-a.dev/>
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal
@@ -73,6 +73,7 @@ const Builder = () => {
7373

7474
return (
7575
<>
76+
<script src="/fix/fetch.js"></script>
7677
<div className='builder'>
7778
<div>
7879
<span>{translate.raw('builder-file')}</span>
@@ -93,49 +94,6 @@ const Builder = () => {
9394
/>
9495
</div>
9596
</div>
96-
<Script id="rewrite-fetch">
97-
{`
98-
var require = { paths: { 'vs': 'third-party/monaco-editor/package/min/vs' } };
99-
100-
const originalFetch = window.fetch;
101-
window.fetch = function(input, init) {
102-
console.log(input);
103-
let url;
104-
if (typeof input === 'string') {
105-
url = input;
106-
} else if (input instanceof Request) {
107-
url = input.url;
108-
} else {
109-
return originalFetch(input, init);
110-
}
111-
112-
try {
113-
const parsedUrl = new URL(url);
114-
const path = parsedUrl.pathname;
115-
116-
if (path.startsWith('/vs')) {
117-
const newPath = \`/third-party/monaco-editor/package/min\${path}\`;
118-
return originalFetch(newPath, init);
119-
}
120-
} catch (e) {
121-
if (url.startsWith('vs')) {
122-
const newPath = \`/third-party/monaco-editor/package/min/\${url}\`;
123-
return originalFetch(newPath, init);
124-
} else if (url.startsWith('/vs')) {
125-
const newPath = \`/third-party/monaco-editor/package/min\${url}\`;
126-
return originalFetch(newPath, init);
127-
} else if (url.startsWith('../../../vs')) {
128-
const newPath = \`/third-party/monaco-editor/package/min\${url.slice(8)}\`;
129-
return originalFetch(newPath, init);
130-
} else {
131-
return originalFetch(input, init);
132-
}
133-
}
134-
135-
return originalFetch(input, init);
136-
};
137-
`}
138-
</Script>
13997
<script src="/third-party/monaco-editor/package/min/vs/loader.js"></script>
14098
<script src="/third-party/monaco-editor/package/min/vs/editor/editor.main.js"></script>
14199
<script src="/third-party/monaco-editor/package/min/vs/language/typescript/tsWorker.js"></script>

lib/ui/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
MIT License
44
5-
Copyright (c) 2025 JustStudio <https://juststudio.is-a.dev/>
5+
Copyright (c) 2025 JustStudio. <https://juststudio.is-a.dev/>
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

pages/404.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
MIT License
44
5-
Copyright (c) 2025 JustStudio <https://juststudio.is-a.dev/>
5+
Copyright (c) 2025 JustStudio. <https://juststudio.is-a.dev/>
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

pages/_document.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
MIT License
44
5-
Copyright (c) 2025 JustStudio <https://juststudio.is-a.dev/>
5+
Copyright (c) 2025 JustStudio. <https://juststudio.is-a.dev/>
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

pages/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
MIT License
44
5-
Copyright (c) 2025 JustStudio <https://juststudio.is-a.dev/>
5+
Copyright (c) 2025 JustStudio. <https://juststudio.is-a.dev/>
66
77
Permission is hereby granted, free of charge, to any person obtaining a copy
88
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)