Implement multi-scheme animation name mapper for Owen Animation System
Some checks failed
CI/CD Pipeline / Test & Lint (16.x) (push) Has been cancelled
CI/CD Pipeline / Test & Lint (18.x) (push) Has been cancelled
CI/CD Pipeline / Test & Lint (20.x) (push) Has been cancelled
CI/CD Pipeline / Security Audit (push) Has been cancelled
CI/CD Pipeline / Release (push) Has been cancelled
Release / Validate Version (push) Has been cancelled
Release / Build and Test (push) Has been cancelled
Release / Create Release (push) Has been cancelled
Release / Publish to NPM (push) Has been cancelled
Release / Deploy Demo (push) Has been cancelled
Animation Processing Pipeline / Validate Animation Names (push) Has been cancelled
Animation Processing Pipeline / Process Blender Animation Assets (push) Has been cancelled
Animation Processing Pipeline / Update Animation Documentation (push) Has been cancelled
Animation Processing Pipeline / Deploy Animation Demo (push) Has been cancelled
Some checks failed
CI/CD Pipeline / Test & Lint (16.x) (push) Has been cancelled
CI/CD Pipeline / Test & Lint (18.x) (push) Has been cancelled
CI/CD Pipeline / Test & Lint (20.x) (push) Has been cancelled
CI/CD Pipeline / Security Audit (push) Has been cancelled
CI/CD Pipeline / Release (push) Has been cancelled
Release / Validate Version (push) Has been cancelled
Release / Build and Test (push) Has been cancelled
Release / Create Release (push) Has been cancelled
Release / Publish to NPM (push) Has been cancelled
Release / Deploy Demo (push) Has been cancelled
Animation Processing Pipeline / Validate Animation Names (push) Has been cancelled
Animation Processing Pipeline / Process Blender Animation Assets (push) Has been cancelled
Animation Processing Pipeline / Update Animation Documentation (push) Has been cancelled
Animation Processing Pipeline / Deploy Animation Demo (push) Has been cancelled
- Added AnimationNameMapper class to handle conversion between different animation naming schemes (legacy, artist, hierarchical, semantic). - Included methods for initialization, pattern matching, conversion, and validation of animation names. - Developed comprehensive unit tests for the animation name converter and demo pages using Playwright. - Created a Vite configuration for the demo application, including asset handling and optimization settings. - Enhanced the demo with features for batch conversion, performance metrics, and responsive design.
This commit is contained in:
167
vite.demo.config.js
Normal file
167
vite.demo.config.js
Normal file
@ -0,0 +1,167 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import path from 'path'
|
||||
|
||||
/**
|
||||
* Vite configuration for Owen Animation System Demo
|
||||
*
|
||||
* This configuration builds the demo application showcasing
|
||||
* the multi-scheme animation naming system and its features.
|
||||
*/
|
||||
export default defineConfig({
|
||||
// Demo-specific build configuration
|
||||
root: './demo',
|
||||
|
||||
build: {
|
||||
outDir: '../dist-demo',
|
||||
emptyOutDir: true,
|
||||
|
||||
// Optimization settings for demo
|
||||
rollupOptions: {
|
||||
input: {
|
||||
main: path.resolve(__dirname, 'demo/index.html'),
|
||||
examples: path.resolve(__dirname, 'demo/examples.html'),
|
||||
comparison: path.resolve(__dirname, 'demo/comparison.html'),
|
||||
interactive: path.resolve(__dirname, 'demo/interactive.html')
|
||||
},
|
||||
|
||||
output: {
|
||||
// Asset organization
|
||||
assetFileNames: (assetInfo) => {
|
||||
const info = assetInfo.name.split('.')
|
||||
const ext = info[info.length - 1]
|
||||
|
||||
if (/png|jpe?g|svg|gif|tiff|bmp|ico/i.test(ext)) {
|
||||
return 'assets/images/[name]-[hash][extname]'
|
||||
}
|
||||
|
||||
if (/woff2?|eot|ttf|otf/i.test(ext)) {
|
||||
return 'assets/fonts/[name]-[hash][extname]'
|
||||
}
|
||||
|
||||
if (/gltf|glb|fbx/i.test(ext)) {
|
||||
return 'assets/animations/[name]-[hash][extname]'
|
||||
}
|
||||
|
||||
return 'assets/[name]-[hash][extname]'
|
||||
},
|
||||
|
||||
chunkFileNames: 'js/[name]-[hash].js',
|
||||
entryFileNames: 'js/[name]-[hash].js'
|
||||
}
|
||||
},
|
||||
|
||||
// Source maps for debugging
|
||||
sourcemap: true,
|
||||
|
||||
// Minification
|
||||
minify: 'terser',
|
||||
terserOptions: {
|
||||
compress: {
|
||||
drop_console: false, // Keep console logs for demo
|
||||
drop_debugger: true
|
||||
}
|
||||
},
|
||||
|
||||
// Target modern browsers for demo
|
||||
target: 'es2020'
|
||||
},
|
||||
|
||||
// Development server settings
|
||||
server: {
|
||||
port: 3001,
|
||||
host: true,
|
||||
open: '/demo/',
|
||||
|
||||
// Proxy API calls if needed
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:3000',
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, '')
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// Preview server settings
|
||||
preview: {
|
||||
port: 3002,
|
||||
host: true,
|
||||
open: true
|
||||
},
|
||||
|
||||
// Resolve configuration
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
'@demo': path.resolve(__dirname, 'demo'),
|
||||
'@assets': path.resolve(__dirname, 'assets'),
|
||||
'@examples': path.resolve(__dirname, 'examples')
|
||||
}
|
||||
},
|
||||
|
||||
// Define global constants for demo
|
||||
define: {
|
||||
__DEMO_VERSION__: JSON.stringify(process.env.npm_package_version || '1.0.0'),
|
||||
__BUILD_TIMESTAMP__: JSON.stringify(new Date().toISOString()),
|
||||
__ANIMATION_SCHEMES__: JSON.stringify(['legacy', 'artist', 'hierarchical', 'semantic'])
|
||||
},
|
||||
|
||||
// Plugin configuration
|
||||
plugins: [
|
||||
// Add any demo-specific plugins here
|
||||
],
|
||||
|
||||
// CSS configuration
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
scss: {
|
||||
additionalData: `
|
||||
@import "@demo/styles/variables.scss";
|
||||
@import "@demo/styles/mixins.scss";
|
||||
`
|
||||
}
|
||||
},
|
||||
|
||||
// CSS modules for component styling
|
||||
modules: {
|
||||
localsConvention: 'camelCase'
|
||||
}
|
||||
},
|
||||
|
||||
// Asset handling
|
||||
assetsInclude: [
|
||||
'**/*.gltf',
|
||||
'**/*.glb',
|
||||
'**/*.fbx',
|
||||
'**/*.babylon'
|
||||
],
|
||||
|
||||
// Optimization
|
||||
optimizeDeps: {
|
||||
include: [
|
||||
'three',
|
||||
'three/examples/jsm/loaders/GLTFLoader',
|
||||
'three/examples/jsm/loaders/FBXLoader',
|
||||
'three/examples/jsm/controls/OrbitControls'
|
||||
],
|
||||
exclude: [
|
||||
// Exclude any demo-specific modules that shouldn't be pre-bundled
|
||||
]
|
||||
},
|
||||
|
||||
// Environment variables
|
||||
envPrefix: 'OWEN_DEMO_',
|
||||
|
||||
// Base path for deployment
|
||||
base: process.env.NODE_ENV === 'production' ? '/Owen/' : '/',
|
||||
|
||||
// Worker configuration for animation processing
|
||||
worker: {
|
||||
format: 'es'
|
||||
},
|
||||
|
||||
// Experimental features
|
||||
experimental: {
|
||||
buildAdvancedBaseOptions: true
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user