pasika 0.10.36 → 0.10.38

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.
@@ -1882,11 +1882,21 @@ function resolveComponentPlacement(componentFile, index) {
1882
1882
  return { countedConsumers: counted, expectedFolder: shared, reason: "ccf" };
1883
1883
  }
1884
1884
  var formatFolder = (folder) => `src/${folder.join("/")}/`;
1885
+ function hasExactEntry(directory, entryName) {
1886
+ try {
1887
+ return fs2.readdirSync(directory).includes(entryName);
1888
+ } catch {
1889
+ return false;
1890
+ }
1891
+ }
1892
+ function hasComponentOwner(folderPath, folderName) {
1893
+ return hasExactEntry(folderPath, `${folderName}.tsx`);
1894
+ }
1885
1895
  function isValidComponentFolder(folder, sourceRoot) {
1886
1896
  const name = folder[folder.length - 1];
1887
1897
  if (!name || SUPPORT_FOLDERS2.has(name)) return false;
1888
1898
  const folderPath = path10.join(sourceRoot, ...folder);
1889
- return fs2.existsSync(path10.join(folderPath, `${name}.tsx`)) && fs2.existsSync(path10.join(folderPath, "index.ts"));
1899
+ return hasComponentOwner(folderPath, name) && hasExactEntry(folderPath, "index.ts");
1890
1900
  }
1891
1901
  function owningFolderOf(consumer, sourceRoot) {
1892
1902
  const result = outOfSupportFolders(folderSegmentsOf(consumer, sourceRoot));
@@ -2156,7 +2166,7 @@ function componentFolderStart(segments) {
2156
2166
  return -1;
2157
2167
  }
2158
2168
  function hasComponentBarrel(folderPath) {
2159
- return fs4.existsSync(path13.join(folderPath, "index.ts"));
2169
+ return hasExactEntry(folderPath, "index.ts");
2160
2170
  }
2161
2171
  function componentFolderViolation(segments, sourceRoot) {
2162
2172
  const start = componentFolderStart(segments);
@@ -2166,7 +2176,7 @@ function componentFolderViolation(segments, sourceRoot) {
2166
2176
  if (!folder || SUPPORT_FOLDERS2.has(folder)) continue;
2167
2177
  const folderPath = path13.join(sourceRoot, ...segments.slice(0, depth + 1));
2168
2178
  const label = `src/${segments.slice(0, depth + 1).join("/")}/`;
2169
- if (!fs4.existsSync(path13.join(folderPath, `${folder}.tsx`))) {
2179
+ if (!hasComponentOwner(folderPath, folder)) {
2170
2180
  return `A folder that is not a support folder must be a component folder; add "${folder}.tsx" to ${label} or move its files into a support folder.`;
2171
2181
  }
2172
2182
  if (!hasComponentBarrel(folderPath)) {
@@ -2834,6 +2844,7 @@ function tagName(node) {
2834
2844
  function isInteractive(node) {
2835
2845
  const name = tagName(node);
2836
2846
  if (name === void 0 || !INTERACTIVE_TAGS.has(name)) return false;
2847
+ if (name === "button") return true;
2837
2848
  const attributes = node.openingElement?.attributes;
2838
2849
  if (!attributes) return false;
2839
2850
  return attributes.some(
@@ -2943,7 +2954,10 @@ var interactiveComponentRule = {
2943
2954
  JSXElement(node) {
2944
2955
  if (!isInteractive(node)) return;
2945
2956
  if (isComponentElement(node.parent)) {
2946
- return;
2957
+ const name2 = tagName(node);
2958
+ if (name2 !== "button" || isComponentRoot(node.parent)) {
2959
+ return;
2960
+ }
2947
2961
  }
2948
2962
  if (isInteractive(node.parent)) {
2949
2963
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pasika",
3
- "version": "0.10.36",
3
+ "version": "0.10.38",
4
4
  "description": "Reusable agent setup package",
5
5
  "repository": {
6
6
  "type": "git",