Compare commits
5 Commits
v1.1.0-bet
...
feat/branc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cdc57e5212 | ||
|
|
d6be6ec309 | ||
|
|
163823dfd9 | ||
|
|
41df685c51 | ||
|
|
e05f091342 |
@@ -278,11 +278,26 @@ async function updateGlobalTypes() {
|
|||||||
fs.mkdirSync(typesDir, { recursive: true });
|
fs.mkdirSync(typesDir, { recursive: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Only write if content has changed (compare without timestamp)
|
||||||
|
let shouldWrite = true;
|
||||||
|
if (fs.existsSync(globalTypesPath)) {
|
||||||
|
const existingContent = fs.readFileSync(globalTypesPath, 'utf-8');
|
||||||
|
|
||||||
|
// Remove timestamp lines for comparison
|
||||||
|
const stripTimestamp = (str) => str.replace(/ \* Generated at: .*\n/g, '').replace(/\/\/ Cached: .*\n/g, '');
|
||||||
|
|
||||||
|
if (stripTimestamp(existingContent) === stripTimestamp(content)) {
|
||||||
|
shouldWrite = false;
|
||||||
|
console.log(`[IOR Resolver] Type declarations unchanged, skipping write to prevent Metro refresh`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldWrite) {
|
||||||
// Write the file
|
// Write the file
|
||||||
fs.writeFileSync(globalTypesPath, content, 'utf-8');
|
fs.writeFileSync(globalTypesPath, content, 'utf-8');
|
||||||
|
|
||||||
console.log(`[IOR Resolver] Updated auto-generated types: ${globalTypesPath}`);
|
console.log(`[IOR Resolver] Updated auto-generated types: ${globalTypesPath}`);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetch remote component based on IOR
|
* Fetch remote component based on IOR
|
||||||
|
|||||||
5583
package-lock.json
generated
5583
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@metatrom/ior-resolver",
|
"name": "@metatrom/ior-resolver",
|
||||||
"version": "1.0.0",
|
"version": "1.1.0-beta.6",
|
||||||
"description": "Interoperable Object Reference (IOR) resolver for Metro bundler and Node.js with support for local and remote component fetching",
|
"description": "Interoperable Object Reference (IOR) resolver for Metro bundler and Node.js with support for local and remote component fetching",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
"sync-fetch": "^0.5.2"
|
"sync-fetch": "^0.5.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@react-native/metro-config": ">=0.80.0"
|
"@react-native/metro-config": ">=0.78.0"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"@react-native/metro-config": {
|
"@react-native/metro-config": {
|
||||||
|
|||||||
Reference in New Issue
Block a user