✨ MAJOR FEATURES: • Auto-zoom intelligence với smart bounds fitting • Enhanced 3D GPS markers với pulsing effects • Professional route display với 6-layer rendering • Status-based parking icons với availability indicators • Production-ready build optimizations 🗺️ AUTO-ZOOM FEATURES: • Smart bounds fitting cho GPS + selected parking • Adaptive padding (50px) cho visual balance • Max zoom control (level 16) để tránh quá gần • Dynamic centering khi không có selection 🎨 ENHANCED VISUALS: • 3D GPS marker với multi-layer pulse effects • Advanced parking icons với status colors • Selection highlighting với animation • Dimming system cho non-selected items 🛣️ ROUTE SYSTEM: • OpenRouteService API integration • Multi-layer route rendering (glow, shadow, main, animated) • Real-time distance & duration calculation • Visual route info trong popup 📱 PRODUCTION READY: • SSR safe với dynamic imports • Build errors resolved • Global deployment via Vercel • Optimized performance 🌍 DEPLOYMENT: • Vercel: https://whatever-ctk2auuxr-phong12hexdockworks-projects.vercel.app • Bundle size: 22.8 kB optimized • Global CDN distribution • HTTPS enabled 💾 VERSION CONTROL: • MapView-v2.0.tsx backup created • MAPVIEW_VERSIONS.md documentation • Full version history tracking
100 lines
4.4 KiB
JavaScript
100 lines
4.4 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.WebpackCompiler = void 0;
|
|
const fs_1 = require("fs");
|
|
const path_1 = require("path");
|
|
const ui_1 = require("../ui");
|
|
const base_compiler_1 = require("./base-compiler");
|
|
const webpack_defaults_1 = require("./defaults/webpack-defaults");
|
|
const get_value_or_default_1 = require("./helpers/get-value-or-default");
|
|
const webpack = require("webpack");
|
|
class WebpackCompiler extends base_compiler_1.BaseCompiler {
|
|
constructor(pluginsLoader) {
|
|
super(pluginsLoader);
|
|
}
|
|
run(configuration, tsConfigPath, appName, extras, onSuccess) {
|
|
const cwd = process.cwd();
|
|
const configPath = (0, path_1.join)(cwd, tsConfigPath);
|
|
if (!(0, fs_1.existsSync)(configPath)) {
|
|
throw new Error(`Could not find TypeScript configuration file "${tsConfigPath}".`);
|
|
}
|
|
const plugins = this.loadPlugins(configuration, tsConfigPath, appName);
|
|
const pathToSource = this.getPathToSource(configuration, tsConfigPath, appName);
|
|
const entryFile = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'entryFile', appName, 'entryFile', extras.inputs);
|
|
const entryFileRoot = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'root', appName) || '';
|
|
const defaultOptions = (0, webpack_defaults_1.webpackDefaultsFactory)(pathToSource, entryFileRoot, entryFile, extras.debug ?? false, tsConfigPath, plugins);
|
|
let compiler;
|
|
let watchOptions;
|
|
let watch;
|
|
if (Array.isArray(extras.webpackConfigFactoryOrConfig)) {
|
|
const webpackConfigurations = extras.webpackConfigFactoryOrConfig.map((configOrFactory) => {
|
|
const unwrappedConfig = typeof configOrFactory !== 'function'
|
|
? configOrFactory
|
|
: configOrFactory(defaultOptions, webpack);
|
|
return {
|
|
...defaultOptions,
|
|
mode: extras.watchMode ? 'development' : defaultOptions.mode,
|
|
...unwrappedConfig,
|
|
};
|
|
});
|
|
compiler = webpack(webpackConfigurations);
|
|
watchOptions = webpackConfigurations.map((config) => config.watchOptions || {});
|
|
watch = webpackConfigurations.some((config) => config.watch);
|
|
}
|
|
else {
|
|
const projectWebpackOptions = typeof extras.webpackConfigFactoryOrConfig !== 'function'
|
|
? extras.webpackConfigFactoryOrConfig
|
|
: extras.webpackConfigFactoryOrConfig(defaultOptions, webpack);
|
|
const webpackConfiguration = {
|
|
...defaultOptions,
|
|
mode: extras.watchMode ? 'development' : defaultOptions.mode,
|
|
...projectWebpackOptions,
|
|
};
|
|
compiler = webpack(webpackConfiguration);
|
|
watchOptions = webpackConfiguration.watchOptions;
|
|
watch = webpackConfiguration.watch;
|
|
}
|
|
const afterCallback = this.createAfterCallback(onSuccess, extras.assetsManager, extras.watchMode ?? false, watch);
|
|
if (extras.watchMode || watch) {
|
|
compiler.hooks.watchRun.tapAsync('Rebuild info', (params, callback) => {
|
|
console.log(`\n${ui_1.INFO_PREFIX} Webpack is building your sources...\n`);
|
|
callback();
|
|
});
|
|
compiler.watch(watchOptions || {}, afterCallback);
|
|
}
|
|
else {
|
|
compiler.run(afterCallback);
|
|
}
|
|
}
|
|
createAfterCallback(onSuccess, assetsManager, watchMode, watch) {
|
|
return (err, stats) => {
|
|
if (err && stats === undefined) {
|
|
// Could not complete the compilation
|
|
// The error caught is most likely thrown by underlying tasks
|
|
console.log(err);
|
|
return process.exit(1);
|
|
}
|
|
const statsOutput = stats.toString({
|
|
chunks: false,
|
|
colors: true,
|
|
modules: false,
|
|
assets: false,
|
|
});
|
|
if (!err && !stats.hasErrors()) {
|
|
if (!onSuccess) {
|
|
assetsManager.closeWatchers();
|
|
}
|
|
else {
|
|
onSuccess();
|
|
}
|
|
}
|
|
else if (!watchMode && !watch) {
|
|
console.log(statsOutput);
|
|
return process.exit(1);
|
|
}
|
|
console.log(statsOutput);
|
|
};
|
|
}
|
|
}
|
|
exports.WebpackCompiler = WebpackCompiler;
|