Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
shanimal08 committed Jan 31, 2025
1 parent 28b5dbd commit 227c033
Show file tree
Hide file tree
Showing 27 changed files with 2,415 additions and 35 deletions.
1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ dist-ssr

/src/
/lib/
/public/
index.html
.npmrc
vite.config.ts
Expand Down
Binary file added dist/assets/models/BASE.buf
Binary file not shown.
Binary file added dist/assets/models/BOX.buf
Binary file not shown.
Binary file added dist/assets/models/COIN.buf
Binary file not shown.
Binary file added dist/assets/models/COIN_PLACEMENT.buf
Binary file not shown.
Binary file added dist/assets/models/LOSE_ANIMATION.buf
Binary file not shown.
Binary file added dist/assets/textures/LDR_RGB1_0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions dist/assets/textures/LICENSES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[LDR_RGB1_0.png]
https://momentsingraphics.de/BlueNoise.html

[gobo.jpg]
???

[matcap_gold.jpg]
Generated in Blender
Binary file added dist/assets/textures/gobo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added dist/assets/textures/matcap_gold.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,365 changes: 2,365 additions & 0 deletions dist/main.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/main.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/main.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { loadTowerAnimation, removeTowerAnimation } from './scripts/index.ts';
import { properties } from './scripts/core/properties.ts';
import { result, stateManager, status, statusIndex } from './scripts/logic/stateManager.ts';
import { loadTowerAnimation, removeTowerAnimation } from './scripts/index';
import { properties } from './scripts/core/properties';
import { result, stateManager, status, statusIndex } from './scripts/logic/stateManager';

function setAnimationState(id: string, isReplay = false) {
stateManager.set(id, isReplay);
Expand Down
2 changes: 1 addition & 1 deletion lib/scripts/logic/errorAnimationManager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import math from '../utils/math';

import { errorAnimationEndedSignal, stateSignal } from './signals.ts';
import { errorAnimationEndedSignal, stateSignal } from './signals';
import { AnimationResult, AnimationStatus } from '../../types/stateManager';

let isActive = false;
Expand Down
6 changes: 3 additions & 3 deletions lib/scripts/logic/stateManager.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { properties } from '../core/properties';
import settings from '../core/settings';
import { heroBlocks as blocksVisual } from '../visuals/hero/hero.ts';
import { heroBlocks as blocksVisual } from '../visuals/hero/hero';

import { blocks } from './systemManager.ts';
import { gameEndedSignal, stateSignal } from './signals.ts';
import { blocks } from './systemManager';
import { gameEndedSignal, stateSignal } from './signals';
import { AnimationResult, AnimationStatus, StatusManagerState, SuccessLevel } from '../../types/stateManager';

export const PREVENT_CYCLE_STATES = [AnimationStatus.NOT_STARTED, AnimationStatus.RESTART_ANIMATION, AnimationStatus.RESTART, AnimationStatus.STARTED];
Expand Down
2 changes: 1 addition & 1 deletion lib/scripts/logic/stopAnimationManager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import math from '../utils/math';
import { stateSignal, stopAnimationEndedSignal } from './signals.ts';
import { stateSignal, stopAnimationEndedSignal } from './signals';
import { AnimationResult, AnimationStatus } from '../../types/stateManager';

let isActive = false;
Expand Down
2 changes: 1 addition & 1 deletion lib/scripts/logic/successAnimationManager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import math from '../utils/math';

import { completeAnimationEndedSignal, stateSignal } from './signals.ts';
import { completeAnimationEndedSignal, stateSignal } from './signals';
import { AnimationResult, AnimationStatus, SuccessLevel } from '../../types/stateManager';

let currentAnimationStyle: SuccessLevel | null;
Expand Down
4 changes: 2 additions & 2 deletions lib/scripts/logic/systemManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import Block from './Block';

import { stopAnimationManager } from './stopAnimationManager';
import { errorAnimationManager } from './errorAnimationManager';
import { successAnimationManager } from '../logic/successAnimationManager.ts';
import { completeAnimationEndedSignal, endCycleSignal, errorAnimationEndedSignal, spawnSignal, stopAnimationEndedSignal } from '../logic/signals.ts';
import { successAnimationManager } from '../logic/successAnimationManager';
import { completeAnimationEndedSignal, endCycleSignal, errorAnimationEndedSignal, spawnSignal, stopAnimationEndedSignal } from '../logic/signals';
import { SystemManagerState } from '../../types/systemManager';

let firstStartAnimationRatio: SystemManagerState['firstStartAnimationRatio'] = 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/scripts/utils/blueNoise/blueNoise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import loader from '../../core/loader';

import getBlueNoiseShader from './getBlueNoise.glsl?raw';
import { SharedUniforms } from '../../../types/properties';
import { ASSETS_PATH } from '../../core/settings.ts';
import { ASSETS_PATH } from '../../core/settings';

const BlueNoise = () => {
const bn_sharedUniforms: SharedUniforms = {
Expand Down
2 changes: 1 addition & 1 deletion lib/scripts/visuals/coins/coins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import frag from './coins.frag?raw';
import fragDepth from './coinsDepth.frag?raw';
import { floatingCoinsRatio, vortexCoinsRatio } from '../../logic/successAnimationManager';
import { BufferGeometry, InstancedBufferGeometry, Mesh, ShaderMaterial } from 'three';
import { ASSETS_PATH } from '../../core/settings.ts';
import { ASSETS_PATH } from '../../core/settings';

const coinContainer = new THREE.Object3D();
let coinMesh: Mesh | null = null;
Expand Down
10 changes: 5 additions & 5 deletions lib/scripts/visuals/hero/hero.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ import fragDepth from './heroDepth.frag?raw';
import { floatingCubesDisplacement, floatingCubesRatio, successPushDownRatio, successRatio, successColorTowerRatio, towerRotationRatio } from '../../logic/successAnimationManager';
import { stopPushDownRatio, stopSpawnRatio } from '../../logic/stopAnimationManager';
import { failFloatingCubesRatio, failPushDownRatio, failShakeRatio, failSpawnRatio } from '../../logic/errorAnimationManager';
import HeroBlockCoordinates from './HeroBlockCoordinates.ts';
import { lightCameraHelperSignal, lightCameraUpdateSignal } from '../../logic/signals.ts';
import HeroBlockCoordinates from './HeroBlockCoordinates';
import { lightCameraHelperSignal, lightCameraUpdateSignal } from '../../logic/signals';

import { InstancedBufferAttribute } from 'three';
import { SharedUniforms } from '../../../types/properties.ts';
import { HeroType } from '../../../types/hero.ts';
import { SharedUniforms } from '../../../types/properties';
import { HeroType } from '../../../types/hero';
import { AnimationResult } from '../../../types';
import { ASSETS_PATH } from '../../core/settings.ts';
import { ASSETS_PATH } from '../../core/settings';

const TOTAL_BLOCKS = 2 * TOTAL_TILES;
const _v2_0 = new THREE.Vector2();
Expand Down
2 changes: 1 addition & 1 deletion lib/types/block.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Tile from '@logic/Tile.ts';
import Tile from '../scripts/logic/Tile';

interface Vector {
x: number;
Expand Down
2 changes: 1 addition & 1 deletion lib/types/hero.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Mesh, CameraHelper, DataTexture, DirectionalLight, InstancedBufferGeometry, ShaderMaterial } from 'three';
import { SharedUniforms } from './properties';
import HeroBlockCoordinates from '@visuals/hero/HeroBlockCoordinates.ts';
import HeroBlockCoordinates from '../scripts/visuals/hero/HeroBlockCoordinates';

export interface HeroType {
_baseMesh?: Mesh & { material: ShaderMaterial };
Expand Down
2 changes: 1 addition & 1 deletion lib/types/properties.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WebGLRenderer, Vector2, OrthographicCamera, ColorRepresentation, ShaderMaterialParameters, Object3D } from 'three';
import Block from '../scripts/logic/Block.ts';
import Block from '../scripts/logic/Block';
import { OrbitControls } from '../scripts/controls/OrbitControls';

export interface PropertiesType {
Expand Down
2 changes: 1 addition & 1 deletion lib/types/systemManager.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Block from '../scripts/logic/Block.ts';
import Block from '../scripts/logic/Block';

export interface SystemManagerState {
firstStartAnimationRatio: number;
Expand Down
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tari-project/tari-tower",
"version": "0.0.4",
"version": "0.0.5",
"private": false,
"description": "the tower animation used in Tari Universe",
"homepage": "https://github.com/tari-project/tari-tower#readme",
Expand All @@ -12,21 +12,23 @@
"type": "module",
"exports": {
".": {
"/BASE.buf": "./dist/assets/models/BASE.buf",
"/BOX.buf": "./dist/assets/models/BOX.buf",
"/COIN.buf": "./dist/assets/models/COIN.buf",
"/COIN_PLACEMENT.buf": "./dist/assets/models/COIN_PLACEMENT.buf",
"/LOSE_ANIMATION.buf": "./dist/assets/models/LOSE_ANIMATION.buf",
"/gobo.jpg": "./dist/assets/textures/gobo.jpg",
"/LDR_RGB1_0.png": "./dist/assets/textures/LDR_RGB1_0.png",
"/matcap_gold.jpg": "./dist/assets/textures/matcap_gold.jpg",
"assets/models/BASE.buf": "./public/assets/models/BASE.buf",
"assets/models/BOX.buf": "./public/assets/models/BOX.buf",
"assets/models/COIN.buf": "./public/assets/models/COIN.buf",
"assets/models/COIN_PLACEMENT.buf": "./public/assets/models/COIN_PLACEMENT.buf",
"assets/models/LOSE_ANIMATION.buf": "./public/assets/models/LOSE_ANIMATION.buf",
"assets/textures/gobo.jpg": "./public/assets/textures/gobo.jpg",
"assets/textures/LDR_RGB1_0.png": "./public/assets/textures/LDR_RGB1_0.png",
"assets/textures/matcap_gold.jpg": "./public/assets/textures/matcap_gold.jpg",
"assets": "./dist/assets/",
"types": "./dist/main.d.ts",
"default": "./dist/main.js"
}
},
"main": "dist/main.js",
"files": [
"/dist"
"/dist",
"/public"
],
"scripts": {
"dev": "vite",
Expand Down
9 changes: 7 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,20 @@ export default defineConfig({
tsconfigPaths(),
eslint({ eslintOptions: { cache: false, fix: true } }),
libAssetsPlugin({
include: ['**/*.buf', '**/*.glsl', '**/*.frag', '**/*.vert', '**/*.jpg', '**/*.png'],
outputPath: (url) => {
return url.endsWith('.buf') ? 'assets/models' : 'assets/textures';
},
include: ['**/*.buf', '**/*.jpg', '**/*.png'],
name: '[name].[contenthash:8].[ext]',
}),
],
assetsInclude: ['**/*.buf', '**/*.glsl', '**/*.frag', '**/*.vert', '**/*.jpg', '**/*.png'],

build: {
lib: {
entry: resolve(__dirname, 'lib/main.ts'),
formats: ['es'],
},
sourcemap: true,
rollupOptions: {
external: ['three', 'min-signal'],
input: { main: resolve(__dirname, 'lib/main.ts') },
Expand Down

0 comments on commit 227c033

Please sign in to comment.