@workadventure/map-starter-kit-core 0.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.d.ts +5 -0
- package/dist/server.js +524 -0
- package/dist/server.js.map +1 -0
- package/package.json +23 -4
- package/.github/workflows/release.yml +0 -47
- package/semantic-release.config.js +0 -8
- package/src/controllers/FrontController.ts +0 -95
- package/src/controllers/MapController.ts +0 -104
- package/src/controllers/UploaderController.ts +0 -333
- package/src/getCoreRoot.ts +0 -40
- package/src/views/index.html +0 -169
- package/src/views/step1-git.html +0 -154
- package/src/views/step2-hosting.html +0 -153
- package/src/views/step3-steps-selfhosted.html +0 -502
- package/src/views/step3-steps.html +0 -549
- package/src/views/step4-validated-selfhosted.html +0 -188
- package/src/views/step4-validated.html +0 -80
- package/tsconfig.json +0 -35
- package/vite.config.ts +0 -53
- /package/{public → dist}/assets/index.js +0 -0
- /package/{public → dist}/images/badumtss.svg +0 -0
- /package/{public → dist}/images/brand-discord.svg +0 -0
- /package/{public → dist}/images/brand-github.svg +0 -0
- /package/{public → dist}/images/brand-linkedin.svg +0 -0
- /package/{public → dist}/images/brand-x.svg +0 -0
- /package/{public → dist}/images/brand-youtube.svg +0 -0
- /package/{public → dist}/images/favicon.svg +0 -0
- /package/{public → dist}/images/logo.svg +0 -0
- /package/{public → dist}/images/unknown-room-image copy.png +0 -0
- /package/{public → dist}/images/unknown-room-image.png +0 -0
- /package/{public → dist}/styles/styles.css +0 -0
- /package/{public → dist}/styles/styles.css.map +0 -0
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
-
<meta name="robots" content="noindex">
|
|
9
|
-
<meta name="title" content="WorkAdventure Starter Kit - Self-hosted">
|
|
10
|
-
|
|
11
|
-
<link href="public/styles/styles.css" rel="stylesheet">
|
|
12
|
-
|
|
13
|
-
<title>Your maps - Self-hosted</title>
|
|
14
|
-
<link rel="icon" href="/images/favicon.svg" type="image/svg+xml">
|
|
15
|
-
<script type="module">
|
|
16
|
-
document.addEventListener("DOMContentLoaded", async () => {
|
|
17
|
-
await import('/public/assets/index.js');
|
|
18
|
-
const main = document.querySelector('main .maps-container');
|
|
19
|
-
const emptyEl = document.getElementById('maps-empty');
|
|
20
|
-
const errorEl = document.getElementById('maps-error');
|
|
21
|
-
const loadingEl = document.getElementById('maps-loading');
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
const response = await fetch('/uploader/maps-storage-list');
|
|
25
|
-
if (!response.ok) {
|
|
26
|
-
const err = await response.json().catch(() => ({}));
|
|
27
|
-
throw new Error(err.message || `HTTP ${response.status}`);
|
|
28
|
-
}
|
|
29
|
-
const { maps, mapStorageUrl, playBaseUrl } = await response.json();
|
|
30
|
-
|
|
31
|
-
loadingEl.style.display = 'none';
|
|
32
|
-
|
|
33
|
-
if (!maps || maps.length === 0) {
|
|
34
|
-
emptyEl.style.display = 'block';
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// Maps are already hydrated by the API (path, mapName, mapDescription, mapImage, mapUrl, etc.)
|
|
39
|
-
// Play URL: use PLAY_BASE_URL if set, else derive from map-storage URL (replace "map-storage" by "play")
|
|
40
|
-
const playBase = (playBaseUrl && playBaseUrl.trim())
|
|
41
|
-
? playBaseUrl.replace(/\/$/, '')
|
|
42
|
-
: (mapStorageUrl || '').replace(/\/$/, '').replace('map-storage', 'play');
|
|
43
|
-
const defaultImageUrl = '/public/images/unknown-room-image.png';
|
|
44
|
-
|
|
45
|
-
maps.forEach(map => {
|
|
46
|
-
const section = document.createElement('section');
|
|
47
|
-
section.className = 'card-map';
|
|
48
|
-
const hasImage = map.mapImage && map.mapImage.length > 0;
|
|
49
|
-
const imageUrl = hasImage ? map.mapImage : defaultImageUrl;
|
|
50
|
-
const coverStyle = `background-image: url('${imageUrl.replace(/'/g, "\\'")}');`;
|
|
51
|
-
const coverClass = 'map-cover' + (hasImage ? '' : ' map-cover--no-image');
|
|
52
|
-
const wamPath = (map.wamFileUrl || '').replace(/^\//, '');
|
|
53
|
-
const openUrl = playBase ? `${playBase}/~/${wamPath}` : null;
|
|
54
|
-
|
|
55
|
-
const desc = (map.mapDescription && map.mapDescription.trim()) ? map.mapDescription : 'No description';
|
|
56
|
-
const licence = (map.mapCopyright && map.mapCopyright.trim()) ? map.mapCopyright : 'No licence existing';
|
|
57
|
-
section.innerHTML = `
|
|
58
|
-
<div class="${coverClass}" style="${coverStyle}"></div>
|
|
59
|
-
<div class="map-name">${escapeHtml(map.mapName)}</div>
|
|
60
|
-
<div class="map-detail">
|
|
61
|
-
<div class="map-file"><strong>${escapeHtml(map.filename)}</strong></div>
|
|
62
|
-
</div>
|
|
63
|
-
<div class="map-desc">${escapeHtml(desc)}</div>
|
|
64
|
-
<div class="map-copyright">${escapeHtml(licence)}</div>
|
|
65
|
-
<div class="map-testurl">
|
|
66
|
-
${openUrl
|
|
67
|
-
? `<a href="${escapeHtml(openUrl)}" class="btn" target="_blank" rel="noopener">Open map</a>`
|
|
68
|
-
: `<button type="button" class="btn btn-secondary copy-path-btn" data-path="${escapeHtml(wamPath)}">Copy path</button>
|
|
69
|
-
<span class="map-path-hint">Path: ${escapeHtml(wamPath)}</span>`}
|
|
70
|
-
</div>
|
|
71
|
-
`;
|
|
72
|
-
|
|
73
|
-
const copyBtn = section.querySelector('.copy-path-btn');
|
|
74
|
-
if (copyBtn) {
|
|
75
|
-
copyBtn.addEventListener('click', () => {
|
|
76
|
-
navigator.clipboard.writeText(copyBtn.dataset.path || '');
|
|
77
|
-
copyBtn.textContent = 'Copied!';
|
|
78
|
-
setTimeout(() => { copyBtn.textContent = 'Copy path'; }, 2000);
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
main.appendChild(section);
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
// Background fade from first map image if available
|
|
86
|
-
const firstImg = maps[0]?.mapImage;
|
|
87
|
-
if (firstImg && typeof window.createBackgroundImageFade === 'function') {
|
|
88
|
-
window.createBackgroundImageFade([firstImg]);
|
|
89
|
-
}
|
|
90
|
-
} catch (e) {
|
|
91
|
-
loadingEl.style.display = 'none';
|
|
92
|
-
errorEl.style.display = 'block';
|
|
93
|
-
if (document.getElementById('error-detail')) {
|
|
94
|
-
document.getElementById('error-detail').textContent = e.message || 'Failed to load maps';
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
function escapeHtml(str) {
|
|
100
|
-
const div = document.createElement('div');
|
|
101
|
-
div.textContent = str;
|
|
102
|
-
return div.innerHTML;
|
|
103
|
-
}
|
|
104
|
-
</script>
|
|
105
|
-
</head>
|
|
106
|
-
|
|
107
|
-
<body>
|
|
108
|
-
<div class="content">
|
|
109
|
-
<header>
|
|
110
|
-
<div class="logo">
|
|
111
|
-
<a href="https://workadventu.re/" target="_blank" title="Workadventure">
|
|
112
|
-
<img src="public/images/logo.svg" alt="Workadventure logo" height="36" />
|
|
113
|
-
</a>
|
|
114
|
-
</div>
|
|
115
|
-
<div style="flex-grow: 1;"></div>
|
|
116
|
-
<div class="socials">
|
|
117
|
-
<a href="https://discord.gg/G6Xh9ZM9aR" target="_blank" title="discord">
|
|
118
|
-
<img src="/public/images/brand-discord.svg" alt="discord">
|
|
119
|
-
</a>
|
|
120
|
-
<a href="https://github.com/thecodingmachine/workadventure" target="_blank" title="github">
|
|
121
|
-
<img src="/public/images/brand-github.svg" alt="github">
|
|
122
|
-
</a>
|
|
123
|
-
<a href="https://www.youtube.com/channel/UCXJ9igV-kb9gw1ftR33y5tA" target="_blank" title="youtube">
|
|
124
|
-
<img src="/public/images/brand-youtube.svg" alt="youtube">
|
|
125
|
-
</a>
|
|
126
|
-
<a href="https://twitter.com/Workadventure_" target="_blank" title="twitter">
|
|
127
|
-
<img src="/public/images/brand-x.svg" alt="X">
|
|
128
|
-
</a>
|
|
129
|
-
<a href="https://www.linkedin.com/company/workadventu-re" target="_blank" title="linkedin">
|
|
130
|
-
<img src="/public/images/brand-linkedin.svg" alt="linkedin">
|
|
131
|
-
</a>
|
|
132
|
-
</div>
|
|
133
|
-
<div class="btn-header-wrapper">
|
|
134
|
-
<a href="https://discord.gg/G6Xh9ZM9aR" target="_blank" class="btn btn-light">Talk to the community</a>
|
|
135
|
-
<a href="https://docs.workadventu.re/map-building/" target="_blank" class="btn">Documentation</a>
|
|
136
|
-
</div>
|
|
137
|
-
</header>
|
|
138
|
-
<main class="container">
|
|
139
|
-
<section class="form-center steps" style="max-width: 100%; align-items: center;">
|
|
140
|
-
<img src="public/images/badumtss.svg" alt="Success">
|
|
141
|
-
<h1>
|
|
142
|
-
Your map is ready to <strong>explore</strong> and <strong>share</strong>
|
|
143
|
-
</h1>
|
|
144
|
-
<p class="sub-heading" style="margin-top: 8px;">
|
|
145
|
-
Maps published on your map storage are listed below. Open or copy the path to use them in your WorkAdventure play instance.
|
|
146
|
-
</p>
|
|
147
|
-
|
|
148
|
-
<div id="maps-loading" style="margin-top: 24px;">
|
|
149
|
-
<p>Loading maps from map storage...</p>
|
|
150
|
-
</div>
|
|
151
|
-
<div id="maps-error" style="display: none; margin-top: 24px; color: #ff4444;">
|
|
152
|
-
<p>Could not load the list of maps. <span id="error-detail"></span></p>
|
|
153
|
-
</div>
|
|
154
|
-
<div id="maps-empty" style="display: none; margin-top: 24px;">
|
|
155
|
-
<p>No maps found in your map storage yet.</p>
|
|
156
|
-
</div>
|
|
157
|
-
|
|
158
|
-
<div class="maps-container" style="display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; margin-top: 24px; width: 100%;">
|
|
159
|
-
<!-- Map cards injected here -->
|
|
160
|
-
</div>
|
|
161
|
-
</section>
|
|
162
|
-
</main>
|
|
163
|
-
<div class="button-wrapper">
|
|
164
|
-
<div>
|
|
165
|
-
<a href="step3-steps-selfhosted" class="btn btn-ghost">
|
|
166
|
-
Previous
|
|
167
|
-
</a>
|
|
168
|
-
</div>
|
|
169
|
-
<div style="flex-grow: 1;">
|
|
170
|
-
</div>
|
|
171
|
-
</div>
|
|
172
|
-
</div>
|
|
173
|
-
<div class="bg"></div>
|
|
174
|
-
<style>
|
|
175
|
-
.map-path-hint {
|
|
176
|
-
font-size: 12px;
|
|
177
|
-
opacity: 0.8;
|
|
178
|
-
word-break: break-all;
|
|
179
|
-
}
|
|
180
|
-
.map-cover--no-image {
|
|
181
|
-
background-color: #1b2a41;
|
|
182
|
-
background-size: cover;
|
|
183
|
-
background-position: center;
|
|
184
|
-
}
|
|
185
|
-
</style>
|
|
186
|
-
</body>
|
|
187
|
-
|
|
188
|
-
</html>
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
|
-
<meta name="robots" content="noindex">
|
|
9
|
-
<meta name="title" content="WorkAdventure Starter Kit">
|
|
10
|
-
|
|
11
|
-
<link href="public/styles/styles.css" rel="stylesheet">
|
|
12
|
-
|
|
13
|
-
<title>WorkAdventure test map</title>
|
|
14
|
-
<link rel="icon" href="/images/favicon.svg" type="image/svg+xml">
|
|
15
|
-
<script type="module">
|
|
16
|
-
document.addEventListener("DOMContentLoaded", (event) => {
|
|
17
|
-
// Load index.js to have access to getMapsList
|
|
18
|
-
import('/public/assets/index.js').then(() => {
|
|
19
|
-
window.createBackgroundImageFade();
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
</script>
|
|
23
|
-
</head>
|
|
24
|
-
|
|
25
|
-
<body>
|
|
26
|
-
<div class="content">
|
|
27
|
-
<header>
|
|
28
|
-
<div class="logo">
|
|
29
|
-
<a href="https://workadventu.re/" target="_blank" title="Workadventure">
|
|
30
|
-
<img src="public/images/logo.svg" alt="Workadventure logo" height="36" />
|
|
31
|
-
</a>
|
|
32
|
-
</div>
|
|
33
|
-
<div style="flex-grow: 1;"></div>
|
|
34
|
-
<div class="socials">
|
|
35
|
-
<a href="https://discord.gg/G6Xh9ZM9aR" target="_blank" title="discord">
|
|
36
|
-
<img src="/public/images/brand-discord.svg" alt="discord">
|
|
37
|
-
</a>
|
|
38
|
-
<a href="https://github.com/thecodingmachine/workadventure" target="_blank" title="github">
|
|
39
|
-
<img src="/public/images/brand-github.svg" alt="github">
|
|
40
|
-
</a>
|
|
41
|
-
<a href="https://www.youtube.com/channel/UCXJ9igV-kb9gw1ftR33y5tA" target="_blank" title="youtube">
|
|
42
|
-
<img src="/public/images/brand-youtube.svg" alt="youtube">
|
|
43
|
-
</a>
|
|
44
|
-
<a href="https://twitter.com/Workadventure_" target="_blank" title="twitter">
|
|
45
|
-
<img src="/public/images/brand-x.svg" alt="X">
|
|
46
|
-
</a>
|
|
47
|
-
<a href="https://www.linkedin.com/company/workadventu-re" target="_blank" title="linkedin">
|
|
48
|
-
<img src="/public/images/brand-linkedin.svg" alt="linkedin">
|
|
49
|
-
</a>
|
|
50
|
-
</div>
|
|
51
|
-
<div class="btn-header-wrapper">
|
|
52
|
-
<a href="https://discord.gg/G6Xh9ZM9aR" target="_blank" class="btn btn-light">Talk to the community</a>
|
|
53
|
-
<a href="https://docs.workadventu.re/map-building/" target="_blank" class="btn">Documentation</a>
|
|
54
|
-
</div>
|
|
55
|
-
</header>
|
|
56
|
-
<main class="container">
|
|
57
|
-
<section class="form-center">
|
|
58
|
-
<img src="public/images/badumtss.svg" alt="check">
|
|
59
|
-
<h1>
|
|
60
|
-
Your map is ready to <strong>explore</strong> and <strong>share</strong>
|
|
61
|
-
</h1>
|
|
62
|
-
<a href="https://admin.workadventu.re/login" class="btn btn-secondary" style="margin-top: 16px;" target="_blank">
|
|
63
|
-
Go to map list
|
|
64
|
-
</a>
|
|
65
|
-
</section>
|
|
66
|
-
</main>
|
|
67
|
-
<div class="button-wrapper">
|
|
68
|
-
<div>
|
|
69
|
-
<a href="step3-steps" class="btn btn-ghost">
|
|
70
|
-
Previous
|
|
71
|
-
</a>
|
|
72
|
-
</div>
|
|
73
|
-
<div style="flex-grow: 1;">
|
|
74
|
-
</div>
|
|
75
|
-
</div>
|
|
76
|
-
</div>
|
|
77
|
-
<div class="bg"></div>
|
|
78
|
-
</body>
|
|
79
|
-
|
|
80
|
-
</html>
|
package/tsconfig.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"outDir": "./dist/",
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"useDefineForClassFields": true,
|
|
6
|
-
"module": "ESNext",
|
|
7
|
-
"lib": [
|
|
8
|
-
"ESNext",
|
|
9
|
-
"DOM"
|
|
10
|
-
],
|
|
11
|
-
"allowJs": true,
|
|
12
|
-
"moduleResolution": "Node",
|
|
13
|
-
"strict": true,
|
|
14
|
-
"noImplicitAny": true,
|
|
15
|
-
"strictNullChecks": true,
|
|
16
|
-
"strictFunctionTypes": true,
|
|
17
|
-
"strictBindCallApply": true,
|
|
18
|
-
"strictPropertyInitialization": true,
|
|
19
|
-
"noImplicitThis": true,
|
|
20
|
-
"alwaysStrict": true,
|
|
21
|
-
"noFallthroughCasesInSwitch": true,
|
|
22
|
-
"sourceMap": true,
|
|
23
|
-
"resolveJsonModule": true,
|
|
24
|
-
"isolatedModules": true,
|
|
25
|
-
"esModuleInterop": true,
|
|
26
|
-
"noEmit": true,
|
|
27
|
-
"noUnusedLocals": true,
|
|
28
|
-
"noUnusedParameters": true,
|
|
29
|
-
"noImplicitReturns": true,
|
|
30
|
-
"skipLibCheck": true
|
|
31
|
-
},
|
|
32
|
-
"include": [
|
|
33
|
-
"src/**/*"
|
|
34
|
-
]
|
|
35
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import 'dotenv/config';
|
|
2
|
-
import { defineConfig } from "vite";
|
|
3
|
-
import {VitePluginNode} from "vite-plugin-node";
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
base: "./",
|
|
7
|
-
build: {
|
|
8
|
-
sourcemap: true,
|
|
9
|
-
rollupOptions: {
|
|
10
|
-
input: {
|
|
11
|
-
server: "./src/server.ts"
|
|
12
|
-
},
|
|
13
|
-
output: {
|
|
14
|
-
exports: "named",
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
plugins: [
|
|
19
|
-
...VitePluginNode({
|
|
20
|
-
// Nodejs native Request adapter
|
|
21
|
-
// currently this plugin support 'express', 'nest', 'koa' and 'fastify' out of box,
|
|
22
|
-
// you can also pass a function if you are using other frameworks, see Custom Adapter section
|
|
23
|
-
adapter: 'express',
|
|
24
|
-
|
|
25
|
-
// tell the plugin where is your project entry
|
|
26
|
-
appPath: './src/server.ts',
|
|
27
|
-
|
|
28
|
-
// Optional, default: 'viteNodeApp'
|
|
29
|
-
// the name of named export of you app from the appPath file
|
|
30
|
-
exportName: 'viteNodeApp',
|
|
31
|
-
|
|
32
|
-
// Optional, default: false
|
|
33
|
-
// if you want to init your app on boot, set this to true
|
|
34
|
-
initAppOnBoot: false,
|
|
35
|
-
|
|
36
|
-
// Optional, default: false
|
|
37
|
-
// if you want to reload your app on file changes, set this to true, rebounce delay is 500ms
|
|
38
|
-
reloadAppOnFileChange: false,
|
|
39
|
-
})
|
|
40
|
-
],
|
|
41
|
-
server: {
|
|
42
|
-
host: "localhost",
|
|
43
|
-
headers: {
|
|
44
|
-
"Access-Control-Allow-Origin": "*",
|
|
45
|
-
"Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
|
|
46
|
-
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization",
|
|
47
|
-
"Cache-Control": "no-cache, no-store, must-revalidate",
|
|
48
|
-
},
|
|
49
|
-
open: "/",
|
|
50
|
-
// Ensure Vite transforms TypeScript files when served directly
|
|
51
|
-
middlewareMode: false,
|
|
52
|
-
},
|
|
53
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|