From 70d9f6dab3bef8e621743eb07878c3324bd911b7 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 15 Apr 2024 22:29:39 -0700 Subject: [PATCH 1/2] Added prettier-plugin-tailwindcss --- package.json | 1 + pnpm-lock.yaml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/package.json b/package.json index 60ff631690..546a94f56a 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "devDependencies": { "@changesets/cli": "^2.27.1", "prettier": "^3.2.5", + "prettier-plugin-tailwindcss": "^0.5.14", "turbo": "^1.13.0", "turbo-ignore": "^1.13.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45bde5b5fa..82efa38ee8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,6 +14,9 @@ importers: prettier: specifier: ^3.2.5 version: 3.2.5 + prettier-plugin-tailwindcss: + specifier: ^0.5.14 + version: 0.5.14(prettier@3.2.5) turbo: specifier: ^1.13.0 version: 1.13.0 @@ -17192,6 +17195,61 @@ packages: engines: {node: '>= 0.8.0'} dev: true + /prettier-plugin-tailwindcss@0.5.14(prettier@3.2.5): + resolution: {integrity: sha512-Puaz+wPUAhFp8Lo9HuciYKM2Y2XExESjeT+9NQoVFXZsPPnc9VYss2SpxdQ6vbatmt8/4+SN0oe0I1cPDABg9Q==} + engines: {node: '>=14.21.3'} + peerDependencies: + '@ianvs/prettier-plugin-sort-imports': '*' + '@prettier/plugin-pug': '*' + '@shopify/prettier-plugin-liquid': '*' + '@trivago/prettier-plugin-sort-imports': '*' + '@zackad/prettier-plugin-twig-melody': '*' + prettier: ^3.0 + prettier-plugin-astro: '*' + prettier-plugin-css-order: '*' + prettier-plugin-import-sort: '*' + prettier-plugin-jsdoc: '*' + prettier-plugin-marko: '*' + prettier-plugin-organize-attributes: '*' + prettier-plugin-organize-imports: '*' + prettier-plugin-sort-imports: '*' + prettier-plugin-style-order: '*' + prettier-plugin-svelte: '*' + peerDependenciesMeta: + '@ianvs/prettier-plugin-sort-imports': + optional: true + '@prettier/plugin-pug': + optional: true + '@shopify/prettier-plugin-liquid': + optional: true + '@trivago/prettier-plugin-sort-imports': + optional: true + '@zackad/prettier-plugin-twig-melody': + optional: true + prettier-plugin-astro: + optional: true + prettier-plugin-css-order: + optional: true + prettier-plugin-import-sort: + optional: true + prettier-plugin-jsdoc: + optional: true + prettier-plugin-marko: + optional: true + prettier-plugin-organize-attributes: + optional: true + prettier-plugin-organize-imports: + optional: true + prettier-plugin-sort-imports: + optional: true + prettier-plugin-style-order: + optional: true + prettier-plugin-svelte: + optional: true + dependencies: + prettier: 3.2.5 + dev: true + /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} From 4e90643af69b0fb29b971e62fd6be23831f71980 Mon Sep 17 00:00:00 2001 From: Ozzie Gooen Date: Mon, 15 Apr 2024 22:40:56 -0700 Subject: [PATCH 2/2] Applied prettier, with tailwind-prettier --- .../CodeEditor/focusGutterExtension.tsx | 4 ++-- .../CodeEditor/useTooltipsExtension.tsx | 2 +- .../src/components/PlaygroundSettings.tsx | 10 ++++---- .../src/components/SquiggleEditor.tsx | 2 +- .../ResizableTwoPanelLayout.tsx | 4 ++-- .../components/SquigglePlayground/index.tsx | 6 ++--- .../SquiggleViewer/ValueViewer/Title.tsx | 4 ++-- .../ValueViewer/WithContext.tsx | 16 ++++++------- .../SquiggleViewer/ZoomedInNavigation.tsx | 2 +- .../components/ViewerWithMenuBar/Layout.tsx | 2 +- .../ViewerWithMenuBar/RandomizeSeedButton.tsx | 2 +- .../ViewerWithMenuBar/SimulatingIndicator.tsx | 2 +- .../ViewerWithMenuBar/ViewerBody.tsx | 2 +- .../components/src/components/ui/Alert.tsx | 2 +- .../src/components/ui/ErrorBoundary.tsx | 4 ++-- .../src/components/ui/FnDocumentation.tsx | 12 +++++----- .../src/components/ui/FormSection.tsx | 2 +- .../ui/PanelWithToolbar/ToolbarItem.tsx | 2 +- .../components/ui/PanelWithToolbar/index.tsx | 16 ++++++------- .../src/components/ui/SquiggleErrorAlert.tsx | 6 ++--- .../components/src/components/ui/Toggle.tsx | 6 ++--- .../components/src/lib/MarkdownViewer.tsx | 4 ++-- .../stories/SquigglePlayground.stories.tsx | 2 +- .../components/src/widgets/ArrayWidget.tsx | 2 +- .../components/src/widgets/BoolWidget.tsx | 2 +- .../widgets/CalculatorWidget/Calculator.tsx | 8 +++---- .../CalculatorWidget/CalculatorInput.tsx | 2 +- .../CalculatorWidget/CalculatorResult.tsx | 4 ++-- .../components/src/widgets/DictWidget.tsx | 2 +- .../widgets/DistWidget/DistributionsChart.tsx | 8 +++---- .../src/widgets/DistWidget/SummaryTable.tsx | 6 ++--- .../src/widgets/DistWidget/index.tsx | 2 +- .../FunctionChart/AutomaticFunctionChart.tsx | 2 +- .../FunctionChart/DistFunctionChart.tsx | 2 +- .../src/widgets/PlotWidget/PlotTitle.tsx | 2 +- .../RelativeValueCell.tsx | 16 ++++++------- .../RelativeValuesGridChart/index.tsx | 8 +++---- .../src/widgets/SpecificationWidget.tsx | 16 ++++++------- .../components/src/widgets/StringWidget.tsx | 4 ++-- .../src/widgets/TableChartWidget.tsx | 12 +++++----- .../components/src/widgets/VoidWidget.tsx | 2 +- packages/hub/src/app/RootLayout.tsx | 4 ++-- packages/hub/src/app/admin/layout.tsx | 2 +- .../upgrade-versions/UpgradeVersionsPage.tsx | 4 ++-- packages/hub/src/app/benchmarks/page.tsx | 8 +++---- .../hub/src/app/groups/[slug]/GroupLayout.tsx | 4 ++-- .../hub/src/app/groups/[slug]/InviteForMe.tsx | 2 +- .../groups/[slug]/members/GroupInviteCard.tsx | 6 ++--- .../groups/[slug]/members/GroupMemberCard.tsx | 6 ++--- .../groups/[slug]/members/GroupMemberList.tsx | 2 +- .../members/GroupReusableInviteSection.tsx | 4 ++-- .../[slug]/EditSquiggleSnippetModel.tsx | 2 +- .../[owner]/[slug]/ModelAccessControls.tsx | 6 ++--- .../[variableName]/CacheMenu/index.tsx | 4 ++-- .../RelativeValuesModelLayout.tsx | 6 ++--- .../[slug]/revisions/ModelRevisionsList.tsx | 2 +- .../[revisionId]/ModelRevisionView.tsx | 4 ++-- .../SquiggleVariableRevisionPage.tsx | 2 +- .../variables/[variableName]/VariablePage.tsx | 8 +++---- .../[slug]/variables/[variableName]/page.tsx | 2 +- .../app/models/[owner]/[slug]/view/page.tsx | 2 +- packages/hub/src/app/new/model/NewModel.tsx | 2 +- packages/hub/src/app/not-found.tsx | 6 ++--- .../choose-username/ChooseUsername.tsx | 2 +- packages/hub/src/app/status/StatusPage.tsx | 2 +- .../src/app/users/[username]/UserLayout.tsx | 6 ++--- packages/hub/src/components/EntityCard.tsx | 6 ++--- packages/hub/src/components/EntityInfo.tsx | 4 ++-- packages/hub/src/components/EntityLayout.tsx | 6 ++--- packages/hub/src/components/ErrorBoundary.tsx | 4 ++-- .../GlobalSearch/SearchResultBox.tsx | 2 +- .../GlobalSearch/SearchResultTItle.tsx | 2 +- .../components/GlobalSearch/TextSnippet.tsx | 2 +- .../exports/RelativeValuesExportItem.tsx | 2 +- .../components/layout/NarrowPageLayout.tsx | 2 +- .../layout/RootLayout/DropdownWithArrow.tsx | 4 ++-- .../layout/RootLayout/PageFooter.tsx | 6 ++--- .../components/layout/RootLayout/PageMenu.tsx | 12 +++++----- .../layout/RootLayout/PageMenuLink.tsx | 4 ++-- packages/hub/src/components/ui/Card.tsx | 2 +- packages/hub/src/components/ui/EntityTab.tsx | 4 ++-- packages/hub/src/components/ui/Headers.tsx | 8 +++---- .../hub/src/groups/components/GroupList.tsx | 2 +- .../hub/src/models/components/ModelCard.tsx | 2 +- .../hub/src/models/components/ModelList.tsx | 2 +- .../RelativeValuesDefinitionForm/HTMLForm.tsx | 6 ++--- .../components/common/ClusterIcon.tsx | 2 +- .../components/common/ClusterInfo.tsx | 2 +- .../components/ui/FormHeader.tsx | 2 +- .../components/views/CellBox.tsx | 4 ++-- .../components/views/ClusterFilter.tsx | 4 ++-- .../components/views/GridView/AxisMenu.tsx | 4 ++-- .../components/views/GridView/index.tsx | 10 ++++---- .../components/views/Header.tsx | 2 +- .../views/ListView/ColumnHeader.tsx | 10 ++++---- .../components/views/ListView/index.tsx | 14 +++++------ .../components/views/ListView/sidebar.tsx | 24 +++++++++---------- .../components/views/PlotView/ItemTooltip.tsx | 2 +- .../components/views/PlotView/index.tsx | 2 +- .../views/RelativeCell/ErrorCell.tsx | 2 +- .../src/variables/components/VariableCard.tsx | 4 ++-- .../src/variables/components/VariableList.tsx | 2 +- packages/ui/src/components/Button.tsx | 8 +++---- .../Dropdown/DropdownMenuHeader.tsx | 2 +- .../Dropdown/DropdownMenuItemLayout.tsx | 4 ++-- packages/ui/src/components/Dropdown/index.tsx | 4 ++-- packages/ui/src/components/Modal.tsx | 12 +++++----- packages/ui/src/components/StyledTab.tsx | 2 +- packages/ui/src/components/TextTooltip.tsx | 2 +- .../ui/src/components/WithToasts/index.tsx | 4 ++-- .../ui/src/forms/common/FormFieldLayout.tsx | 2 +- packages/ui/src/forms/common/WithRHFError.tsx | 8 +++---- .../ui/src/forms/styled/StyledCheckbox.tsx | 2 +- .../ui/src/forms/styled/StyledColorInput.tsx | 6 ++--- packages/ui/src/forms/styled/StyledInput.tsx | 2 +- packages/ui/src/forms/styled/StyledRadio.tsx | 8 +++---- .../ui/src/forms/styled/StyledTextArea.tsx | 2 +- .../ui/src/stories/MouseTooltip.stories.tsx | 2 +- .../ui/src/stories/TextTooltip.stories.tsx | 4 ++-- .../src/SquiggleVersionShower.tsx | 2 +- packages/website/src/components/Footer.tsx | 2 +- .../src/components/HomepageFeatures.tsx | 4 ++-- .../components/PlaygroundPage/ShareButton.tsx | 2 +- .../src/components/PlaygroundPage/index.tsx | 2 +- packages/website/src/pages/index.mdx | 8 +++---- packages/website/theme.config.tsx | 2 +- prettier.config.js | 1 + 127 files changed, 291 insertions(+), 290 deletions(-) diff --git a/packages/components/src/components/CodeEditor/focusGutterExtension.tsx b/packages/components/src/components/CodeEditor/focusGutterExtension.tsx index bc7e6fa06b..b2bb5d2b7a 100644 --- a/packages/components/src/components/CodeEditor/focusGutterExtension.tsx +++ b/packages/components/src/components/CodeEditor/focusGutterExtension.tsx @@ -115,7 +115,7 @@ class FocusableMarker extends GutterMarker { override toDOM() { return reactAsDom(
{ e.preventDefault(); e.stopPropagation(); @@ -128,7 +128,7 @@ class FocusableMarker extends GutterMarker { "bg-violet-50 [.cm-activeLineGutter_&]:bg-white", // highlight all markers on gutter hover; highlight the hovered markers even more "group-hover/gutter:bg-violet-200 group-hover/marker:!bg-violet-400", - "rounded-sm w-[3px] h-4 br-1 mt-[1px]", + "br-1 mt-[1px] h-4 w-[3px] rounded-sm", "transition duration-75" )} /> diff --git a/packages/components/src/components/CodeEditor/useTooltipsExtension.tsx b/packages/components/src/components/CodeEditor/useTooltipsExtension.tsx index a7a142711f..fa588ce971 100644 --- a/packages/components/src/components/CodeEditor/useTooltipsExtension.tsx +++ b/packages/components/src/components/CodeEditor/useTooltipsExtension.tsx @@ -28,7 +28,7 @@ const TooltipBox: FC> = ({ }); return ( -
+
{children}
); diff --git a/packages/components/src/components/PlaygroundSettings.tsx b/packages/components/src/components/PlaygroundSettings.tsx index bfc43b4c0e..8b2aea2467 100644 --- a/packages/components/src/components/PlaygroundSettings.tsx +++ b/packages/components/src/components/PlaygroundSettings.tsx @@ -269,7 +269,7 @@ export const PlaygroundSettingsForm: React.FC<{ metaSettings, }) => { return ( -
+
{withGlobalSettings && ( <>
@@ -278,7 +278,7 @@ export const PlaygroundSettingsForm: React.FC<{
-
+
name="chartHeight" @@ -289,18 +289,18 @@ export const PlaygroundSettingsForm: React.FC<{ )} -
+
{withFunctionSettings ? ( -
+
) : null} {withGlobalSettings ? ( -
+
) : null} diff --git a/packages/components/src/components/SquiggleEditor.tsx b/packages/components/src/components/SquiggleEditor.tsx index c611ebffc1..797d9aa1c0 100644 --- a/packages/components/src/components/SquiggleEditor.tsx +++ b/packages/components/src/components/SquiggleEditor.tsx @@ -56,7 +56,7 @@ export const SquiggleEditor: FC = ({ return (
= ({ >
-
+
{renderRight()}
diff --git a/packages/components/src/components/SquigglePlayground/index.tsx b/packages/components/src/components/SquigglePlayground/index.tsx index 7bc87f4f66..a08dac667e 100644 --- a/packages/components/src/components/SquigglePlayground/index.tsx +++ b/packages/components/src/components/SquigglePlayground/index.tsx @@ -188,13 +188,13 @@ export const SquigglePlayground: React.FC = ( ); } else if (defaultAutorunMode === false) { return ( -
-
{`Press the "Run" button (top left) to simulate`}
+
+
{`Press the "Run" button (top left) to simulate`}
); } else { return ( -
+
); diff --git a/packages/components/src/components/SquiggleViewer/ValueViewer/Title.tsx b/packages/components/src/components/SquiggleViewer/ValueViewer/Title.tsx index aa443add16..9015b2cce5 100644 --- a/packages/components/src/components/SquiggleViewer/ValueViewer/Title.tsx +++ b/packages/components/src/components/SquiggleViewer/ValueViewer/Title.tsx @@ -100,7 +100,7 @@ export const Title: FC = (props) => { return (
@@ -116,7 +116,7 @@ export const Title: FC = (props) => { > {title}
- {showColon &&
:
} + {showColon &&
:
}
); }; diff --git a/packages/components/src/components/SquiggleViewer/ValueViewer/WithContext.tsx b/packages/components/src/components/SquiggleViewer/ValueViewer/WithContext.tsx index 61aa48ee31..83443eb342 100644 --- a/packages/components/src/components/SquiggleViewer/ValueViewer/WithContext.tsx +++ b/packages/components/src/components/SquiggleViewer/ValueViewer/WithContext.tsx @@ -137,7 +137,7 @@ export const ValueWithContextViewer: FC = ({ return (
= ({
); } else { - return
; + return
; } }; @@ -155,7 +155,7 @@ export const ValueWithContextViewer: FC = ({ if (isDictOrList) { return (
@@ -178,9 +178,9 @@ export const ValueWithContextViewer: FC = ({ }} tabIndex={viewerType === "tooltip" ? undefined : 0} className={clsx( - "flex justify-between group pr-0.5 hover:bg-stone-100 rounded-sm focus-visible:outline-none", + "group flex justify-between rounded-sm pr-0.5 hover:bg-stone-100 focus-visible:outline-none", isZoomedIn - ? "focus:bg-indigo-50 mb-2 px-0.5 py-1" + ? "mb-2 px-0.5 py-1 focus:bg-indigo-50" : "focus:bg-indigo-100" )} onFocus={(_) => { @@ -207,13 +207,13 @@ export const ValueWithContextViewer: FC = ({ /> {!isOpen && ( -
+
)} {!isOpen && }
-
+
{enableDropdownMenu && } {exportData && exportData.path.length < 2 && onOpenExport && ( @@ -237,7 +237,7 @@ export const ValueWithContextViewer: FC = ({ ) } className={clsx( - "transition cursor-pointer", + "cursor-pointer transition", isRootImport ? "text-violet-400 hover:!text-violet-900 group-hover:text-violet-500 group-focus:text-violet-600" : "text-slate-200 hover:!text-slate-900 group-hover:text-slate-400 group-focus:text-slate-400" diff --git a/packages/components/src/components/SquiggleViewer/ZoomedInNavigation.tsx b/packages/components/src/components/SquiggleViewer/ZoomedInNavigation.tsx index 4ac3b1e5fe..c7de1d4384 100644 --- a/packages/components/src/components/SquiggleViewer/ZoomedInNavigation.tsx +++ b/packages/components/src/components/SquiggleViewer/ZoomedInNavigation.tsx @@ -12,7 +12,7 @@ export const ZoomedInNavigationItem: FC<{
{text} diff --git a/packages/components/src/components/ViewerWithMenuBar/Layout.tsx b/packages/components/src/components/ViewerWithMenuBar/Layout.tsx index 7c7dd77f57..286b90ed21 100644 --- a/packages/components/src/components/ViewerWithMenuBar/Layout.tsx +++ b/packages/components/src/components/ViewerWithMenuBar/Layout.tsx @@ -13,7 +13,7 @@ export const Layout: FC<{
diff --git a/packages/components/src/components/ViewerWithMenuBar/RandomizeSeedButton.tsx b/packages/components/src/components/ViewerWithMenuBar/RandomizeSeedButton.tsx index c95e603a6c..587173ae9c 100644 --- a/packages/components/src/components/ViewerWithMenuBar/RandomizeSeedButton.tsx +++ b/packages/components/src/components/ViewerWithMenuBar/RandomizeSeedButton.tsx @@ -61,7 +61,7 @@ export const RandomizeSeedButton: FC<{ placement="bottom" offset={5} > -
+
diff --git a/packages/components/src/components/ViewerWithMenuBar/ViewerBody.tsx b/packages/components/src/components/ViewerWithMenuBar/ViewerBody.tsx index 4f909f5db8..14217c714a 100644 --- a/packages/components/src/components/ViewerWithMenuBar/ViewerBody.tsx +++ b/packages/components/src/components/ViewerWithMenuBar/ViewerBody.tsx @@ -52,7 +52,7 @@ export const ViewerBody = forwardRef( return (
{isSimulating && ( -
+
)} {