uilint 0.2.15 → 0.2.17

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.
package/dist/index.js CHANGED
@@ -2805,7 +2805,7 @@ program.command("update").description("Update existing style guide with new styl
2805
2805
  });
2806
2806
  });
2807
2807
  program.command("install").description("Install UILint integration").option("--force", "Overwrite existing configuration files").action(async (options) => {
2808
- const { installUI } = await import("./install-ui-73AINMZ5.js");
2808
+ const { installUI } = await import("./install-ui-VNIKF2YT.js");
2809
2809
  await installUI({ force: options.force });
2810
2810
  });
2811
2811
  program.command("serve").description("Start WebSocket server for real-time UI linting").option("-p, --port <number>", "Port to listen on", "9234").action(async (options) => {
@@ -1803,7 +1803,7 @@ function addDevtoolsElementNextJs(program) {
1803
1803
  if (!program || program.type !== "Program") return { changed: false };
1804
1804
  if (hasUILintDevtoolsJsx(program)) return { changed: false };
1805
1805
  const devtoolsMod = parseModule2(
1806
- "const __uilint_devtools = (<uilint-devtools />);"
1806
+ "const __uilint_devtools = <uilint-devtools />;"
1807
1807
  );
1808
1808
  const devtoolsJsx = devtoolsMod.$ast.body?.[0]?.declarations?.[0]?.init ?? null;
1809
1809
  if (!devtoolsJsx || devtoolsJsx.type !== "JSXElement")
@@ -1841,12 +1841,12 @@ function addDevtoolsElementVite(program) {
1841
1841
  if (!arg0) return;
1842
1842
  if (arg0.type !== "JSXElement" && arg0.type !== "JSXFragment") return;
1843
1843
  const devtoolsMod = parseModule2(
1844
- "const __uilint_devtools = (<uilint-devtools />);"
1844
+ "const __uilint_devtools = <uilint-devtools />;"
1845
1845
  );
1846
1846
  const devtoolsJsx = devtoolsMod.$ast.body?.[0]?.declarations?.[0]?.init ?? null;
1847
1847
  if (!devtoolsJsx) return;
1848
1848
  const fragmentMod = parseModule2(
1849
- "const __fragment = (<></>);"
1849
+ "const __fragment = <></>;"
1850
1850
  );
1851
1851
  const fragmentJsx = fragmentMod.$ast.body?.[0]?.declarations?.[0]?.init ?? null;
1852
1852
  if (!fragmentJsx) return;
@@ -1882,7 +1882,7 @@ function addDevtoolsToClientComponent(program) {
1882
1882
  if (!program || program.type !== "Program") return { changed: false };
1883
1883
  if (hasUILintDevtoolsJsx(program)) return { changed: false };
1884
1884
  const devtoolsMod = parseModule2(
1885
- "const __uilint_devtools = (<uilint-devtools />);"
1885
+ "const __uilint_devtools = <uilint-devtools />;"
1886
1886
  );
1887
1887
  const devtoolsJsx = devtoolsMod.$ast.body?.[0]?.declarations?.[0]?.init ?? null;
1888
1888
  if (!devtoolsJsx || devtoolsJsx.type !== "JSXElement")
@@ -1907,7 +1907,7 @@ function addDevtoolsToClientComponent(program) {
1907
1907
  const arg = node.argument;
1908
1908
  if (!arg) return;
1909
1909
  if (arg.type !== "JSXElement" && arg.type !== "JSXFragment") return;
1910
- const fragmentMod = parseModule2("const __fragment = (<></>);");
1910
+ const fragmentMod = parseModule2("const __fragment = <></>;");
1911
1911
  const fragmentJsx = fragmentMod.$ast.body?.[0]?.declarations?.[0]?.init ?? null;
1912
1912
  if (!fragmentJsx) return;
1913
1913
  fragmentJsx.children = [arg, devtoolsJsx];
@@ -1963,7 +1963,7 @@ function wrapChildrenWithProviders(program, providersImportPath) {
1963
1963
  );
1964
1964
  if (childrenIndex === -1) return;
1965
1965
  const providersMod = parseModule2(
1966
- "const __providers = (<Providers>{children}</Providers>);"
1966
+ "const __providers = <Providers>{children}</Providers>;"
1967
1967
  );
1968
1968
  const providersJsx = providersMod.$ast.body?.[0]?.declarations?.[0]?.init ?? null;
1969
1969
  if (!providersJsx) return;
@@ -3956,8 +3956,17 @@ function hasUseClientDirective(filePath) {
3956
3956
  const mod = parseModule5(content);
3957
3957
  const program = mod.$ast;
3958
3958
  if (!program || program.type !== "Program") return false;
3959
+ const directives = program.directives ?? [];
3960
+ for (const directive of directives) {
3961
+ if (directive?.type === "Directive" && directive.value?.type === "DirectiveLiteral" && directive.value.value === "use client") {
3962
+ return true;
3963
+ }
3964
+ }
3959
3965
  const firstStmt = program.body?.[0];
3960
- return firstStmt?.type === "ExpressionStatement" && firstStmt.expression?.type === "StringLiteral" && (firstStmt.expression.value === "use client" || firstStmt.expression.value === "use client");
3966
+ if (firstStmt?.type === "ExpressionStatement" && (firstStmt.expression?.type === "StringLiteral" || firstStmt.expression?.type === "Literal") && firstStmt.expression.value === "use client") {
3967
+ return true;
3968
+ }
3969
+ return false;
3961
3970
  } catch {
3962
3971
  return false;
3963
3972
  }
@@ -4361,7 +4370,10 @@ function selectionsToUserChoices(selections, project, eslintRules) {
4361
4370
  if (appInfo) {
4362
4371
  choices.next = {
4363
4372
  projectPath: appInfo.projectPath,
4364
- detection: appInfo.detection
4373
+ detection: appInfo.detection,
4374
+ // Pass through targetFile and createProviders from the selected target
4375
+ targetFile: target?.targetFile,
4376
+ createProviders: target?.createProviders
4365
4377
  };
4366
4378
  }
4367
4379
  } else if (installer.id === "vite") {
@@ -4403,7 +4415,7 @@ async function installUI(options = {}, executeOptions = {}) {
4403
4415
  console.log("\nNo items selected for installation");
4404
4416
  process.exit(0);
4405
4417
  }
4406
- const { createPlan } = await import("./plan-VPDTICSY.js");
4418
+ const { createPlan } = await import("./plan-2YRYL4YC.js");
4407
4419
  const plan = createPlan(project, choices, { force: options.force });
4408
4420
  const result = await execute(plan, {
4409
4421
  ...executeOptions,
@@ -4428,4 +4440,4 @@ async function installUI(options = {}, executeOptions = {}) {
4428
4440
  export {
4429
4441
  installUI
4430
4442
  };
4431
- //# sourceMappingURL=install-ui-73AINMZ5.js.map
4443
+ //# sourceMappingURL=install-ui-VNIKF2YT.js.map