myoperator-ui 0.0.148 → 0.0.149

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +17 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9476,12 +9476,24 @@ async function sync(options) {
9476
9476
  if (!exists) {
9477
9477
  toAdd.push(componentName);
9478
9478
  } else {
9479
- const existingContent = await fs4.readFile(mainFilePath, "utf-8");
9480
- const registryFile = component.files.find((f) => f.name === mainFileName);
9481
9479
  const normalizeForComparison = (content) => content.replace(/\r\n/g, "\n").split("\n").map((line) => line.trimEnd()).join("\n").trim();
9482
- const existingNormalized = normalizeForComparison(existingContent);
9483
- const registryNormalized = registryFile ? normalizeForComparison(registryFile.content) : "";
9484
- if (registryFile && existingNormalized !== registryNormalized) {
9480
+ let needsUpdate = false;
9481
+ for (const registryFile of component.files) {
9482
+ const filePath = path4.join(targetDir, registryFile.name);
9483
+ const fileExists = await fs4.pathExists(filePath);
9484
+ if (!fileExists) {
9485
+ needsUpdate = true;
9486
+ break;
9487
+ }
9488
+ const existingContent = await fs4.readFile(filePath, "utf-8");
9489
+ const existingNormalized = normalizeForComparison(existingContent);
9490
+ const registryNormalized = normalizeForComparison(registryFile.content);
9491
+ if (existingNormalized !== registryNormalized) {
9492
+ needsUpdate = true;
9493
+ break;
9494
+ }
9495
+ }
9496
+ if (needsUpdate) {
9485
9497
  toUpdate.push(componentName);
9486
9498
  } else {
9487
9499
  upToDate.push(componentName);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myoperator-ui",
3
- "version": "0.0.148",
3
+ "version": "0.0.149",
4
4
  "description": "CLI for adding myOperator UI components to your project",
5
5
  "type": "module",
6
6
  "exports": "./dist/index.js",