✨ 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
148 lines
5.8 KiB
JavaScript
148 lines
5.8 KiB
JavaScript
"use strict";
|
|
var __assign = (this && this.__assign) || function () {
|
|
__assign = Object.assign || function(t) {
|
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
s = arguments[i];
|
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
t[p] = s[p];
|
|
}
|
|
return t;
|
|
};
|
|
return __assign.apply(this, arguments);
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
var webpack = require("webpack");
|
|
var path = require("path");
|
|
var plugin_1 = require("../plugin");
|
|
describe("TsconfigPathsPlugin", function () {
|
|
var SETTINGS = {
|
|
mode: "development",
|
|
context: path.resolve(__dirname, "src"),
|
|
entry: "".concat(__dirname, "/../../examples/example/src/index.ts"),
|
|
output: {
|
|
path: path.join(__dirname, "../../temp"),
|
|
filename: "bundle.js",
|
|
},
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\\.tsx?$/,
|
|
exclude: /^node_modules/,
|
|
loader: "ts-loader",
|
|
options: {
|
|
configFile: "./example/tsconfig.json",
|
|
},
|
|
},
|
|
],
|
|
},
|
|
resolve: {
|
|
extensions: [".ts", ".tsx", ".js"],
|
|
},
|
|
};
|
|
it("Can initialize the plugin", function (done) {
|
|
var testPlugin = new plugin_1.TsconfigPathsPlugin({
|
|
configFile: "".concat(__dirname, "/../../examples/example/tsconfig.json"),
|
|
logLevel: "INFO",
|
|
extensions: [".ts", ".tsx"],
|
|
mainFields: ["browser", "main"],
|
|
});
|
|
expect(testPlugin).toBeInstanceOf(plugin_1.TsconfigPathsPlugin);
|
|
var testSettings = __assign(__assign({}, SETTINGS), { resolve: {
|
|
extensions: [".ts", ".tsx", ".js"],
|
|
plugins: [testPlugin],
|
|
} });
|
|
var compiler = webpack(testSettings);
|
|
compiler.run(function (err, stats) {
|
|
if (err) {
|
|
done(err);
|
|
return;
|
|
}
|
|
expect(stats).toBeDefined();
|
|
var details = stats === null || stats === void 0 ? void 0 : stats.toJson();
|
|
expect(details === null || details === void 0 ? void 0 : details.errorsCount).toEqual(0);
|
|
// TODO There should probably be a test that verifies the stats match what is expected
|
|
done();
|
|
});
|
|
});
|
|
it("Test to ensure Apply exists and is working", function (done) {
|
|
var _a, _b, _c;
|
|
var webpackSettings = {
|
|
entry: "".concat(__dirname, "/../../examples/example/src/index.ts"),
|
|
target: "web",
|
|
output: {
|
|
path: path.join(__dirname, "../../temp"),
|
|
filename: "[name].js",
|
|
},
|
|
mode: "development",
|
|
resolve: {
|
|
extensions: [
|
|
".ts",
|
|
".tsx",
|
|
".js",
|
|
".jsx",
|
|
"ttf",
|
|
"eot",
|
|
"otf",
|
|
"svg",
|
|
"png",
|
|
"woff",
|
|
"woff2",
|
|
],
|
|
plugins: [
|
|
new plugin_1.TsconfigPathsPlugin({
|
|
configFile: "".concat(__dirname, "/../../examples/example/tsconfig.json"),
|
|
}),
|
|
],
|
|
},
|
|
module: {
|
|
rules: [],
|
|
},
|
|
};
|
|
// Build compiler
|
|
var compiler = webpack(webpackSettings);
|
|
var pluginInstance = (_c = (_b = (_a = compiler === null || compiler === void 0 ? void 0 : compiler.options) === null || _a === void 0 ? void 0 : _a.resolve) === null || _b === void 0 ? void 0 : _b.plugins) === null || _c === void 0 ? void 0 : _c.find(function (plugin) { return plugin instanceof plugin_1.TsconfigPathsPlugin; });
|
|
if (!pluginInstance) {
|
|
return done("TsconfigPathsPlugin not loaded in webpack settings");
|
|
}
|
|
expect(pluginInstance instanceof plugin_1.TsconfigPathsPlugin).toBeTruthy();
|
|
expect(pluginInstance.apply).toBeDefined();
|
|
// Run compiler
|
|
compiler.run(function (err, stats) {
|
|
if (err) {
|
|
done(err);
|
|
return;
|
|
}
|
|
expect(stats).toBeDefined();
|
|
var details = stats === null || stats === void 0 ? void 0 : stats.toJson();
|
|
expect(details === null || details === void 0 ? void 0 : details.errorsCount).toEqual(0);
|
|
done();
|
|
});
|
|
});
|
|
it("Resolves project references", function (done) {
|
|
var testPlugin = new plugin_1.TsconfigPathsPlugin({
|
|
configFile: "".concat(__dirname, "/../../examples/referenceExample/tsconfig.json"),
|
|
logLevel: "INFO",
|
|
extensions: [".ts", ".tsx"],
|
|
mainFields: ["browser", "main"],
|
|
references: ["".concat(__dirname, "/../../examples/example/tsconfig.json")],
|
|
});
|
|
expect(testPlugin).toBeInstanceOf(plugin_1.TsconfigPathsPlugin);
|
|
var testSettings = __assign(__assign({}, SETTINGS), { resolve: {
|
|
extensions: [".ts", ".tsx", ".js"],
|
|
plugins: [testPlugin],
|
|
} });
|
|
var compiler = webpack(testSettings);
|
|
compiler.run(function (err, stats) {
|
|
if (err) {
|
|
done(err);
|
|
return;
|
|
}
|
|
expect(stats).toBeDefined();
|
|
var details = stats === null || stats === void 0 ? void 0 : stats.toJson();
|
|
expect(details === null || details === void 0 ? void 0 : details.errorsCount).toEqual(0);
|
|
// TODO There should probably be a test that verifies the stats match what is expected
|
|
done();
|
|
});
|
|
});
|
|
});
|
|
//# sourceMappingURL=plugins.test.js.map
|