mirror of
https://github.com/katanemo/plano.git
synced 2026-05-27 14:17:15 +02:00
* first commit of the chatGPT selector * stashing changes as checkpoint * pending changes for chrome extension * commiting a working version * converting conversation into messages object * working version of the extension * working version with fixed styling and better tested * fixed the issue that the drop down was too small, and fixed the issue where the route was not displayed on the screen * updating folder with README.md * fixes for default model, and to update the manifest.json file * made changes to the dark mode. improved styles * fix installation bug * added dark mode * fixed default model selection * fixed the scrolling issue * Update README.md * updated content.js to update the labels even when default model * fixed readme * upddated the title of the packag * removing the unnecessary permissions --------- Co-authored-by: Salman Paracha <salmanparacha@MacBook-Pro-329.local> Co-authored-by: cotran <cotran2@utexas.edu> Co-authored-by: Shuguang Chen <54548843+nehcgs@users.noreply.github.com>
64 lines
2.1 KiB
JavaScript
64 lines
2.1 KiB
JavaScript
const { execSync } = require('child_process');
|
||
const fs = require('fs');
|
||
const path = require('path');
|
||
|
||
console.log('Starting the custom build process for the Chrome Extension...');
|
||
|
||
const reactAppDir = path.join(__dirname, '..');
|
||
const contentScriptSource = path.join(reactAppDir, 'src', 'scripts', 'content.js');
|
||
const pageOverrideSource = path.join(reactAppDir, 'src', 'scripts', 'pageFetchOverride.js');
|
||
const buildDir = path.join(reactAppDir, 'build');
|
||
const contentScriptDest = path.join(buildDir, 'static', 'js');
|
||
|
||
// 1️⃣ Run React build
|
||
try {
|
||
console.log('Running react-scripts build...');
|
||
execSync('react-scripts build', { stdio: 'inherit' });
|
||
console.log('React build completed successfully.');
|
||
} catch (err) {
|
||
console.error('React build failed:', err);
|
||
process.exit(1);
|
||
}
|
||
|
||
// 2️⃣ Copy content.js
|
||
try {
|
||
if (!fs.existsSync(contentScriptDest)) {
|
||
throw new Error(`Missing directory: ${contentScriptDest}`);
|
||
}
|
||
fs.copyFileSync(contentScriptSource, path.join(contentScriptDest, 'content.js'));
|
||
console.log(`Copied content.js → ${contentScriptDest}`);
|
||
} catch (err) {
|
||
console.error('Failed to copy content.js:', err);
|
||
process.exit(1);
|
||
}
|
||
|
||
// 3️⃣ Copy pageFetchOverride.js
|
||
try {
|
||
if (!fs.existsSync(buildDir)) {
|
||
throw new Error(`Missing build directory: ${buildDir}`);
|
||
}
|
||
fs.copyFileSync(pageOverrideSource, path.join(buildDir, 'pageFetchOverride.js'));
|
||
console.log(`Copied pageFetchOverride.js → ${buildDir}`);
|
||
} catch (err) {
|
||
console.error('Failed to copy pageFetchOverride.js:', err);
|
||
process.exit(1);
|
||
}
|
||
|
||
// 4️⃣ Copy logo.png from src/assets to build root
|
||
try {
|
||
const logoSource = path.join(reactAppDir, 'src', 'assets', 'logo.png');
|
||
const logoDest = path.join(buildDir, 'logo.png');
|
||
|
||
if (!fs.existsSync(logoSource)) {
|
||
throw new Error(`Missing logo.png at ${logoSource}`);
|
||
}
|
||
|
||
fs.copyFileSync(logoSource, logoDest);
|
||
console.log(`Copied logo.png → ${logoDest}`);
|
||
} catch (err) {
|
||
console.error('Failed to copy logo.png:', err);
|
||
process.exit(1);
|
||
}
|
||
|
||
|
||
console.log('Extension build process finished successfully!');
|