Cleanup
This commit is contained in:
@@ -1 +0,0 @@
|
||||
|
||||
@@ -17,16 +17,13 @@ const DEPRECATED_PATTERNS = [
|
||||
"from '@/lib/shippingHelper'",
|
||||
"from '@/lib/storeHelper'",
|
||||
"from '@/lib/stats-service'",
|
||||
// Add other deprecated import patterns here
|
||||
];
|
||||
|
||||
// Run grep to find deprecated imports
|
||||
function findDeprecatedImports() {
|
||||
console.log('Searching for deprecated imports...\n');
|
||||
|
||||
DEPRECATED_PATTERNS.forEach(pattern => {
|
||||
try {
|
||||
// Using grep to find the pattern in all TypeScript/JavaScript files
|
||||
const result = execSync(`grep -r "${pattern}" --include="*.ts" --include="*.tsx" --include="*.js" --include="*.jsx" .`, { encoding: 'utf8' });
|
||||
|
||||
if (result) {
|
||||
@@ -36,7 +33,6 @@ function findDeprecatedImports() {
|
||||
suggestReplacement(pattern);
|
||||
}
|
||||
} catch (error) {
|
||||
// grep returns non-zero exit code if no matches found
|
||||
if (error.status !== 1) {
|
||||
console.error(`Error searching for ${pattern}:`, error.message);
|
||||
}
|
||||
@@ -45,14 +41,12 @@ function findDeprecatedImports() {
|
||||
}
|
||||
|
||||
function suggestReplacement(pattern) {
|
||||
// Extract the import path
|
||||
const match = pattern.match(/from '([^']+)'/);
|
||||
if (!match) return;
|
||||
|
||||
const oldPath = match[1];
|
||||
let replacement = '';
|
||||
|
||||
// Generate replacement suggestions based on deprecated path
|
||||
switch (oldPath) {
|
||||
case '@/lib/client-utils':
|
||||
case '@/lib/client-service':
|
||||
@@ -83,7 +77,4 @@ function suggestReplacement(pattern) {
|
||||
}
|
||||
|
||||
// Run the search
|
||||
findDeprecatedImports();
|
||||
|
||||
// Uncomment the following line to run the remove-old-files.js script
|
||||
// node scripts/remove-old-files.js
|
||||
findDeprecatedImports();
|
||||
Reference in New Issue
Block a user