refactor: migracja wywołań API przeglądarki do abstrakcji browserAPI #127
@ -159,7 +159,7 @@ const Sidebar = () => {
|
||||
onClick={() => {
|
||||
if (
|
||||
window.confirm(
|
||||
'Czy chcesz wczytać wszystkie domeny w celu „splamienia" twojej przeglądarki? Uwaga przeglądarka może zablokować otwieranie nowych kart. (Ten krok jest opcjonalny)'
|
||||
'Czy chcesz wczytać wszystkie domeny w celu „splamienia" twojej przeglądarki? Uwaga przeglądarka może zablokować otwieranie nowych kart. (Ten krok jest opcjonalny)'
|
||||
)
|
||||
) {
|
||||
let deep_copy = JSON.parse(
|
||||
@ -211,8 +211,8 @@ const Sidebar = () => {
|
||||
<section className="dialog-container dialog-container--warning">
|
||||
<span>
|
||||
<strong>Uwaga!</strong> Niekoniecznie każda przesłana poniżej
|
||||
informacja jest daną osobową. Niektóre z podanych domen mogą
|
||||
należeć do właściciela strony i nie reprezentować podmiotów
|
||||
informacja jest daną osobową. Niektóre z podanych domen mogą
|
||||
należeć do właściciela strony i nie reprezentować podmiotów
|
||||
trzecich.
|
||||
</span>
|
||||
<button
|
||||
|
||||
@ -56,51 +56,36 @@ const copyStaticFiles = {
|
||||
copyFileSync(manifestSrc, manifestDest);
|
||||
console.log(` ✓ Skopiowano ${manifestSrc} → ${manifestDest}`);
|
||||
|
||||
// Kopiowanie katalogu components
|
||||
if (existsSync('./components')) {
|
||||
copyDir('./components', join(DIST_DIR, 'components'));
|
||||
console.log(' ✓ Skopiowano components/');
|
||||
}
|
||||
|
||||
// Kopiowanie katalogu assets
|
||||
if (existsSync('./assets')) {
|
||||
copyDir('./assets', join(DIST_DIR, 'assets'));
|
||||
console.log(' ✓ Skopiowano assets/');
|
||||
// Kopiowanie katalogów statycznych
|
||||
for (const dir of ['components', 'assets']) {
|
||||
if (existsSync(`./${dir}`)) {
|
||||
copyDir(`./${dir}`, join(DIST_DIR, dir));
|
||||
console.log(` ✓ Skopiowano ${dir}/`);
|
||||
}
|
||||
}
|
||||
|
||||
// Kopiowanie wymaganych bibliotek z node_modules (potrzebne dla plików HTML z UMD React)
|
||||
const nodeModulesDest = join(DIST_DIR, 'node_modules');
|
||||
|
||||
// React
|
||||
const reactUmdSrc = './node_modules/react/umd';
|
||||
const reactUmdDest = join(nodeModulesDest, 'react/umd');
|
||||
if (existsSync(reactUmdSrc)) {
|
||||
copyDir(reactUmdSrc, reactUmdDest);
|
||||
console.log(' ✓ Skopiowano node_modules/react/umd/');
|
||||
}
|
||||
|
||||
// React-DOM
|
||||
const reactDomUmdSrc = './node_modules/react-dom/umd';
|
||||
const reactDomUmdDest = join(nodeModulesDest, 'react-dom/umd');
|
||||
if (existsSync(reactDomUmdSrc)) {
|
||||
copyDir(reactDomUmdSrc, reactDomUmdDest);
|
||||
console.log(' ✓ Skopiowano node_modules/react-dom/umd/');
|
||||
}
|
||||
|
||||
// Survey-React
|
||||
const surveyReactSrc = './node_modules/survey-react';
|
||||
const surveyReactDest = join(nodeModulesDest, 'survey-react');
|
||||
if (existsSync(surveyReactSrc)) {
|
||||
// Kopiowanie tylko niezbędnych plików
|
||||
mkdirSync(surveyReactDest, { recursive: true });
|
||||
const surveyFiles = ['survey.react.min.js', 'survey.react.min.css'];
|
||||
surveyFiles.forEach(file => {
|
||||
const src = join(surveyReactSrc, file);
|
||||
if (existsSync(src)) {
|
||||
copyFileSync(src, join(surveyReactDest, file));
|
||||
const nodeDeps = [
|
||||
{ src: 'react/umd', dest: 'react/umd' },
|
||||
{ src: 'react-dom/umd', dest: 'react-dom/umd' },
|
||||
{ src: 'survey-react', dest: 'survey-react', files: ['survey.react.min.js', 'survey.react.min.css'] },
|
||||
];
|
||||
for (const dep of nodeDeps) {
|
||||
const srcPath = `./node_modules/${dep.src}`;
|
||||
const destPath = join(nodeModulesDest, dep.dest);
|
||||
if (existsSync(srcPath)) {
|
||||
if (dep.files) {
|
||||
mkdirSync(destPath, { recursive: true });
|
||||
dep.files.forEach(file => {
|
||||
const fileSrc = join(srcPath, file);
|
||||
if (existsSync(fileSrc)) copyFileSync(fileSrc, join(destPath, file));
|
||||
});
|
||||
} else {
|
||||
copyDir(srcPath, destPath);
|
||||
}
|
||||
});
|
||||
console.log(' ✓ Skopiowano node_modules/survey-react/');
|
||||
console.log(` ✓ Skopiowano node_modules/${dep.src}/`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`✅ Budowanie dla ${TARGET.toUpperCase()} zakończone!`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user