Skip to content

Commit 2646592

Browse files
committed
release: v0.1.6
1 parent 92433b4 commit 2646592

File tree

4 files changed

+25
-19
lines changed

4 files changed

+25
-19
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "airshipone",
3-
"version": "0.1.5",
3+
"version": "0.1.6",
44
"author": "Timeless Prototype",
55
"license": "MIT",
66
"homepage": "https://timelessp.github.io/airshipone/",

prod-release.sh

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,19 @@ if [[ "$CURRENT_BRANCH" != "main" ]]; then
3030
exit 1
3131
fi
3232

33-
if [[ -n "$(git status --porcelain)" ]]; then
34-
echo "Error: working tree is not clean. Commit/stash changes before release." >&2
35-
exit 1
36-
fi
33+
echo "Step 1/4: bump version and build"
34+
./dev-build-bump-ver.sh
3735

38-
echo "Step 1/4: run full validation checks"
36+
echo "Step 2/4: run full validation checks"
3937
./dev-test.sh
4038

41-
echo "Step 2/4: bump version and build"
42-
./dev-build-bump-ver.sh
43-
4439
NEW_VERSION="$(node -p "require('./package.json').version")"
4540
if [[ -z "$NEW_VERSION" || "$NEW_VERSION" == "undefined" ]]; then
4641
echo "Error: package.json version is missing after bump." >&2
4742
exit 1
4843
fi
4944

50-
echo "Step 3/4: stage and commit release artifacts"
45+
echo "Step 3/4: stage and commit release changes"
5146
git add -A
5247
if [[ -z "$(git status --porcelain)" ]]; then
5348
echo "Error: no changes to commit after release build." >&2

public/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Generated from package.json by scripts/write-version.mjs.
2-
export const APP_VERSION = '0.1.5';
2+
export const APP_VERSION = '0.1.6';

src/main.ts

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,14 +317,15 @@ const cloneControls = (value: ControlMap): ControlMap => {
317317

318318
let appVersion = 'dev';
319319
const loadVersion = async () => {
320-
const response = await fetch('/version.js', { cache: 'no-store' });
320+
const versionUrl = new URL(`${import.meta.env.BASE_URL}version.js`, window.location.origin).toString();
321+
const response = await fetch(versionUrl, { cache: 'no-store' });
321322
if (!response.ok) {
322-
throw new Error(`Failed to load /version.js (${response.status})`);
323+
throw new Error(`Failed to load ${versionUrl} (${response.status})`);
323324
}
324325
const source = await response.text();
325326
const match = source.match(/APP_VERSION\s*=\s*['\"]([^'\"]+)['\"]/);
326327
if (!match || typeof match[1] !== 'string' || match[1].length === 0) {
327-
throw new Error('Failed to parse APP_VERSION from /version.js');
328+
throw new Error(`Failed to parse APP_VERSION from ${versionUrl}`);
328329
}
329330
appVersion = match[1];
330331
};
@@ -564,19 +565,29 @@ const getMaterial = (block: ModuleBlock): THREE.MeshStandardMaterial => {
564565
const texture = getTexture(block.material.tileId);
565566
const isWindow = block.role.includes('window');
566567
const isCeilingLight = block.role.includes('ceiling-light');
567-
const material = new THREE.MeshStandardMaterial({
568+
const params: THREE.MeshStandardMaterialParameters = {
568569
color: roleColor(block.role),
569-
map: texture ?? undefined,
570-
alphaMap: isWindow ? (texture ?? undefined) : undefined,
571570
alphaTest: isWindow ? 0.08 : 0,
572571
metalness: isWindow ? 0.15 : 0.05,
573572
roughness: isWindow ? 0.25 : 0.85,
574573
transparent: isWindow,
575574
opacity: 1,
576575
depthWrite: !isWindow,
577-
emissive: isCeilingLight ? new THREE.Color(0xfff6b8) : undefined,
578576
emissiveIntensity: isCeilingLight ? 1.5 : 0
579-
});
577+
};
578+
579+
if (texture) {
580+
params.map = texture;
581+
if (isWindow) {
582+
params.alphaMap = texture;
583+
}
584+
}
585+
586+
if (isCeilingLight) {
587+
params.emissive = new THREE.Color(0xfff6b8);
588+
}
589+
590+
const material = new THREE.MeshStandardMaterial(params);
580591

581592
if (texture && block.material.uvMode === 'repeat' && block.primitive === 'box') {
582593
const [sizeX, , sizeZ] = getVector3(block.size, `block size (${block.id})`);

0 commit comments

Comments
 (0)