Initial commit: Aeroflot Flights Web - Angular 12 baseline

- Angular 12 application with PrimeNG components
- 5 existing Cypress e2e test suites
- SCSS styling with BEM naming convention
- i18n support (10 languages)
- Leaflet map integration
- Complete component hierarchy and routing structure

This baseline will be used for Angular → React migration.
This commit is contained in:
gnezim
2026-04-05 18:47:57 +03:00
commit 0a5ab058a6
34439 changed files with 4408974 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2023-present Bytedance, Inc. and its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+19
View File
@@ -0,0 +1,19 @@
# @rsbuild/plugin-react
An Rsbuild plugin to provide support for React, integrating features such as JSX compilation and React Refresh.
<p>
<a href="https://npmjs.com/package/@rsbuild/plugin-react">
<img src="https://img.shields.io/npm/v/@rsbuild/plugin-react?style=flat-square&colorA=564341&colorB=EDED91" alt="npm version" />
</a>
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="license" />
<a href="https://npmcharts.com/compare/@rsbuild/plugin-react"><img src="https://img.shields.io/npm/dm/@rsbuild/plugin-react.svg?style=flat-square&colorA=564341&colorB=EDED91" alt="downloads" /></a>
</p>
## Documentation
See [Documentation](https://rsbuild.rs/plugins/list/plugin-react).
## License
[MIT](https://github.com/web-infra-dev/rsbuild/blob/main/LICENSE).
+159
View File
@@ -0,0 +1,159 @@
"use strict";
const __rslib_import_meta_url__ = "u" < typeof document ? new (require('url'.replace('', ''))).URL('file:' + __filename).href : document.currentScript && document.currentScript.src || new URL('main.js', document.baseURI).href;
var __webpack_require__ = {};
__webpack_require__.n = (module)=>{
var getter = module && module.__esModule ? ()=>module.default : ()=>module;
return __webpack_require__.d(getter, {
a: getter
}), getter;
}, __webpack_require__.d = (exports1, definition)=>{
for(var key in definition)__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key) && Object.defineProperty(exports1, key, {
enumerable: !0,
get: definition[key]
});
}, __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop), __webpack_require__.r = (exports1)=>{
"u" > typeof Symbol && Symbol.toStringTag && Object.defineProperty(exports1, Symbol.toStringTag, {
value: 'Module'
}), Object.defineProperty(exports1, '__esModule', {
value: !0
});
};
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__), __webpack_require__.d(__webpack_exports__, {
PLUGIN_REACT_NAME: ()=>PLUGIN_REACT_NAME,
pluginReact: ()=>pluginReact
});
const external_node_module_namespaceObject = require("node:module"), external_node_path_namespaceObject = require("node:path");
var external_node_path_default = __webpack_require__.n(external_node_path_namespaceObject);
const react_require = (0, external_node_module_namespaceObject.createRequire)(__rslib_import_meta_url__);
function applyBasicReactSupport(api, options) {
let REACT_REFRESH_PATH = options.fastRefresh ? react_require.resolve('react-refresh') : '';
api.modifyEnvironmentConfig((config, { mergeEnvironmentConfig })=>{
let isDev = 'development' === config.mode, usingHMR = isDev && config.dev.hmr && 'web' === config.output.target;
return mergeEnvironmentConfig({
tools: {
swc: {
jsc: {
parser: {
syntax: "typescript",
tsx: !0
},
transform: {
react: {
development: isDev,
refresh: usingHMR && options.fastRefresh,
runtime: 'automatic',
...options.swcReactOptions
}
}
}
}
}
}, config);
}), options.swcReactOptions?.runtime === 'preserve' && api.modifyBundlerChain((chain)=>{
chain.module.parser.merge({
javascript: {
jsx: !0
}
});
}), api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isDev, target })=>{
let { config } = environment;
if (!(isDev && config.dev.hmr && 'web' === target) || !options.fastRefresh) return;
chain.resolve.alias.set('react-refresh', external_node_path_default().dirname(REACT_REFRESH_PATH));
let { ReactRefreshRspackPlugin } = await import("@rspack/plugin-react-refresh"), jsRule = chain.module.rules.get(CHAIN_ID.RULE.JS);
chain.plugin(CHAIN_ID.PLUGIN.REACT_FAST_REFRESH).use(ReactRefreshRspackPlugin, [
{
test: jsRule.get('test'),
include: jsRule.include.values(),
exclude: jsRule.exclude.values(),
resourceQuery: {
not: /^\?raw$/
},
...options.reactRefreshOptions
}
]);
});
}
function applyReactProfiler(api) {
let hasReactDomClientCache;
api.modifyEnvironmentConfig((config, { mergeEnvironmentConfig })=>{
if ('production' === config.mode) return mergeEnvironmentConfig(config, {
output: {
minify: {
jsOptions: {
minimizerOptions: {
mangle: {
keep_classnames: !0,
keep_fnames: !0
}
}
}
}
}
});
}), api.modifyBundlerChain((chain, { isProd })=>{
isProd && (chain.resolve.alias.set((()=>{
if (void 0 !== hasReactDomClientCache) return hasReactDomClientCache;
try {
react_require.resolve('react-dom/client', {
paths: [
api.context.rootPath
]
}), hasReactDomClientCache = !0;
} catch {
hasReactDomClientCache = !1;
}
return hasReactDomClientCache;
})() ? 'react-dom/client$' : 'react-dom$', 'react-dom/profiling'), chain.resolve.alias.set('scheduler/tracing', 'scheduler/tracing-profiling'));
});
}
const isDefaultPreset = (config)=>{
let { performance, splitChunks } = config;
return performance.chunkSplit ? performance.chunkSplit?.strategy === 'split-by-experience' : 'object' == typeof splitChunks && (!splitChunks.preset || 'default' === splitChunks.preset);
};
function applySplitChunksRule(api, options) {
api.modifyBundlerChain((chain, { environment, isProd })=>{
let { config } = environment;
if (!isDefaultPreset(config) || 'web' !== config.output.target || !1 === options) return;
let normalizedOptions = !0 === options ? {
react: !0,
router: !0
} : options, currentConfig = chain.optimization.splitChunks.values();
if ('object' != typeof currentConfig) return;
let extraGroups = {};
normalizedOptions.react && (extraGroups.react = {
name: 'lib-react',
test: isProd ? /node_modules[\\/](?:react|react-dom|scheduler)[\\/]/ : /node_modules[\\/](?:react|react-dom|scheduler|react-refresh|@rspack[\\/]plugin-react-refresh)[\\/]/,
priority: 0
}), normalizedOptions.router && (extraGroups.router = {
name: 'lib-router',
test: /node_modules[\\/](?:react-router|react-router-dom|history|@remix-run[\\/]router)[\\/]/,
priority: 0
}), Object.keys(extraGroups).length && chain.optimization.splitChunks({
...currentConfig,
cacheGroups: {
...extraGroups,
...currentConfig.cacheGroups
}
});
});
}
const PLUGIN_REACT_NAME = 'rsbuild:react', pluginReact = (options = {})=>({
name: PLUGIN_REACT_NAME,
setup (api) {
let finalOptions = {
fastRefresh: !0,
splitChunks: !0,
enableProfiler: !1,
...options
};
'rspack' === api.context.bundlerType && (applyBasicReactSupport(api, finalOptions), finalOptions.enableProfiler && applyReactProfiler(api)), applySplitChunksRule(api, finalOptions.splitChunks);
}
});
for(var __rspack_i in exports.PLUGIN_REACT_NAME = __webpack_exports__.PLUGIN_REACT_NAME, exports.pluginReact = __webpack_exports__.pluginReact, __webpack_exports__)-1 === [
"PLUGIN_REACT_NAME",
"pluginReact"
].indexOf(__rspack_i) && (exports[__rspack_i] = __webpack_exports__[__rspack_i]);
Object.defineProperty(exports, '__esModule', {
value: !0
});
+52
View File
@@ -0,0 +1,52 @@
import type { RsbuildPlugin, Rspack } from '@rsbuild/core';
import type { PluginOptions as ReactRefreshOptions } from '@rspack/plugin-react-refresh';
export type SplitReactChunkOptions = {
/**
* Whether to enable split chunking for React-related dependencies (e.g., react, react-dom, scheduler).
*
* @default true
*/
react?: boolean;
/**
* Whether to enable split chunking for routing-related dependencies (e.g., react-router, react-router-dom, history).
*
* @default true
*/
router?: boolean;
};
export type PluginReactOptions = {
/**
* Configure the behavior of SWC to transform React code,
* the same as SWC's [jsc.transform.react](https://swc.rs/docs/configuration/compilation#jsctransformreact).
*/
swcReactOptions?: Rspack.SwcLoaderTransformConfig['react'];
/**
* Configuration for chunk splitting of React-related dependencies when `chunkSplit.strategy`
* is set to `split-by-experience`.
* @default true
*/
splitChunks?: boolean | SplitReactChunkOptions;
/**
* When set to `true`, enables the React Profiler for performance analysis in production builds.
* @default false
*/
enableProfiler?: boolean;
/**
* Options passed to `@rspack/plugin-react-refresh`
* @default
* {
* include: [/\.(?:js|jsx|mjs|cjs|ts|tsx|mts|cts)$/],
* exclude: [/[\\/]node_modules[\\/]/],
* resourceQuery: { not: /^\?raw$/ },
* }
* @see https://rspack.rs/guide/tech/react#rspackplugin-react-refresh
*/
reactRefreshOptions?: ReactRefreshOptions;
/**
* Whether to enable React Fast Refresh in development mode.
* @default true
*/
fastRefresh?: boolean;
};
export declare const PLUGIN_REACT_NAME = "rsbuild:react";
export declare const pluginReact: (options?: PluginReactOptions) => RsbuildPlugin;
+127
View File
@@ -0,0 +1,127 @@
import { createRequire } from "node:module";
import node_path from "node:path";
let react_require = createRequire(import.meta.url);
function applyBasicReactSupport(api, options) {
let REACT_REFRESH_PATH = options.fastRefresh ? react_require.resolve('react-refresh') : '';
api.modifyEnvironmentConfig((config, { mergeEnvironmentConfig })=>{
let isDev = 'development' === config.mode, usingHMR = isDev && config.dev.hmr && 'web' === config.output.target;
return mergeEnvironmentConfig({
tools: {
swc: {
jsc: {
parser: {
syntax: "typescript",
tsx: !0
},
transform: {
react: {
development: isDev,
refresh: usingHMR && options.fastRefresh,
runtime: 'automatic',
...options.swcReactOptions
}
}
}
}
}
}, config);
}), options.swcReactOptions?.runtime === 'preserve' && api.modifyBundlerChain((chain)=>{
chain.module.parser.merge({
javascript: {
jsx: !0
}
});
}), api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isDev, target })=>{
let { config } = environment;
if (!(isDev && config.dev.hmr && 'web' === target) || !options.fastRefresh) return;
chain.resolve.alias.set('react-refresh', node_path.dirname(REACT_REFRESH_PATH));
let { ReactRefreshRspackPlugin } = await import("@rspack/plugin-react-refresh"), jsRule = chain.module.rules.get(CHAIN_ID.RULE.JS);
chain.plugin(CHAIN_ID.PLUGIN.REACT_FAST_REFRESH).use(ReactRefreshRspackPlugin, [
{
test: jsRule.get('test'),
include: jsRule.include.values(),
exclude: jsRule.exclude.values(),
resourceQuery: {
not: /^\?raw$/
},
...options.reactRefreshOptions
}
]);
});
}
function applyReactProfiler(api) {
let hasReactDomClientCache;
api.modifyEnvironmentConfig((config, { mergeEnvironmentConfig })=>{
if ('production' === config.mode) return mergeEnvironmentConfig(config, {
output: {
minify: {
jsOptions: {
minimizerOptions: {
mangle: {
keep_classnames: !0,
keep_fnames: !0
}
}
}
}
}
});
}), api.modifyBundlerChain((chain, { isProd })=>{
isProd && (chain.resolve.alias.set((()=>{
if (void 0 !== hasReactDomClientCache) return hasReactDomClientCache;
try {
react_require.resolve('react-dom/client', {
paths: [
api.context.rootPath
]
}), hasReactDomClientCache = !0;
} catch {
hasReactDomClientCache = !1;
}
return hasReactDomClientCache;
})() ? 'react-dom/client$' : 'react-dom$', 'react-dom/profiling'), chain.resolve.alias.set('scheduler/tracing', 'scheduler/tracing-profiling'));
});
}
function applySplitChunksRule(api, options) {
api.modifyBundlerChain((chain, { environment, isProd })=>{
let { config } = environment;
if (!((config)=>{
let { performance, splitChunks } = config;
return performance.chunkSplit ? performance.chunkSplit?.strategy === 'split-by-experience' : 'object' == typeof splitChunks && (!splitChunks.preset || 'default' === splitChunks.preset);
})(config) || 'web' !== config.output.target || !1 === options) return;
let normalizedOptions = !0 === options ? {
react: !0,
router: !0
} : options, currentConfig = chain.optimization.splitChunks.values();
if ('object' != typeof currentConfig) return;
let extraGroups = {};
normalizedOptions.react && (extraGroups.react = {
name: 'lib-react',
test: isProd ? /node_modules[\\/](?:react|react-dom|scheduler)[\\/]/ : /node_modules[\\/](?:react|react-dom|scheduler|react-refresh|@rspack[\\/]plugin-react-refresh)[\\/]/,
priority: 0
}), normalizedOptions.router && (extraGroups.router = {
name: 'lib-router',
test: /node_modules[\\/](?:react-router|react-router-dom|history|@remix-run[\\/]router)[\\/]/,
priority: 0
}), Object.keys(extraGroups).length && chain.optimization.splitChunks({
...currentConfig,
cacheGroups: {
...extraGroups,
...currentConfig.cacheGroups
}
});
});
}
let PLUGIN_REACT_NAME = 'rsbuild:react', pluginReact = (options = {})=>({
name: PLUGIN_REACT_NAME,
setup (api) {
let finalOptions = {
fastRefresh: !0,
splitChunks: !0,
enableProfiler: !1,
...options
};
'rspack' === api.context.bundlerType && (applyBasicReactSupport(api, finalOptions), finalOptions.enableProfiler && applyReactProfiler(api)), applySplitChunksRule(api, finalOptions.splitChunks);
}
});
export { PLUGIN_REACT_NAME, pluginReact };
+4
View File
@@ -0,0 +1,4 @@
import type { RsbuildPluginAPI } from '@rsbuild/core';
import type { PluginReactOptions } from './index.js';
export declare function applyBasicReactSupport(api: RsbuildPluginAPI, options: PluginReactOptions): void;
export declare function applyReactProfiler(api: RsbuildPluginAPI): void;
+3
View File
@@ -0,0 +1,3 @@
import type { RsbuildPluginAPI } from '@rsbuild/core';
import type { SplitReactChunkOptions } from './index.js';
export declare function applySplitChunksRule(api: RsbuildPluginAPI, options: SplitReactChunkOptions | boolean): void;
+53
View File
@@ -0,0 +1,53 @@
{
"name": "@rsbuild/plugin-react",
"version": "1.4.6",
"description": "React plugin for Rsbuild",
"repository": {
"type": "git",
"url": "https://github.com/web-infra-dev/rsbuild",
"directory": "packages/plugin-react"
},
"license": "MIT",
"type": "module",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
}
},
"main": "./dist/index.cjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"dependencies": {
"@rspack/plugin-react-refresh": "^1.6.1",
"react-refresh": "^0.18.0"
},
"devDependencies": {
"@rsbuild/core-v1": "npm:@rsbuild/core@^1.7.3",
"@rslib/core": "0.20.0",
"@types/node": "^24.12.0",
"typescript": "^5.9.3",
"@rsbuild/core": "2.0.0-beta.8",
"@scripts/test-helper": "1.0.0"
},
"peerDependencies": {
"@rsbuild/core": "^1.0.0 || ^2.0.0-0"
},
"peerDependenciesMeta": {
"@rsbuild/core": {
"optional": true
}
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"build": "rslib build",
"dev": "rslib build -w",
"bump": "pnpx bumpp --no-tag"
}
}