Skip to content

Commit

Permalink
chore: Update import paths to support a wider set of module resolutio…
Browse files Browse the repository at this point in the history
…n strategies (#352)

* updated routes

* upgrade svelte-package

* use NodeNext

* update utils

* update components

* update api ref

* config

* update tests

* update lib

* changeset

* updated content

* replace lib import string in preview code
  • Loading branch information
AdrianGonz97 authored Feb 26, 2024
1 parent 91512dc commit fabab62
Show file tree
Hide file tree
Showing 266 changed files with 496 additions and 472 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-berries-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": patch
---

fix: Updated internal import paths to support modern module resolution strategies
2 changes: 1 addition & 1 deletion content/components/accordion.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Organizes content into collapsible sections, allowing users to focu
---

<script>
import { APISection, ComponentPreview, AccordionDemo } from '@/components'
import { APISection, ComponentPreview, AccordionDemo } from '@/components/index.js'
export let schemas
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/alert-dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A modal window that alerts users with important information and awa
---

<script>
import { APISection, ComponentPreview, AlertDialogDemo } from '@/components'
import { APISection, ComponentPreview, AlertDialogDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/aspect-ratio.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Displays content while maintaining a specified aspect ratio, ensuri
---

<script>
import { APISection, ComponentPreview, AspectRatioDemo } from '@/components'
import { APISection, ComponentPreview, AspectRatioDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Represents a user or entity with a recognizable image or placeholde
---

<script>
import { APISection, ComponentPreview, AvatarDemo } from '@/components'
import { APISection, ComponentPreview, AvatarDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A special button component that can receive Melt UI builders for us
---

<script>
import { APISection, ComponentPreview, ButtonDemo } from '@/components'
import { APISection, ComponentPreview, ButtonDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Displays dates and days of the week, facilitating date-related inte
---

<script>
import { APISection, ComponentPreview, CalendarDemo } from '@/components'
import { APISection, ComponentPreview, CalendarDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Allow users to switch between checked, unchecked, and indeterminate
---

<script>
import { APISection, ComponentPreview, CheckboxDemo } from '@/components'
import { APISection, ComponentPreview, CheckboxDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/collapsible.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Conceals or reveals content sections, enhancing space utilization a
---

<script>
import { APISection, ComponentPreview, CollapsibleDemo } from '@/components'
import { APISection, ComponentPreview, CollapsibleDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/combobox.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Enables users to pick from a list of options displayed in a dropdow
---

<script>
import { APISection, ComponentPreview, ComboboxDemo } from '@/components'
import { APISection, ComponentPreview, ComboboxDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/context-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Displays options or actions relevant to a specific context or selec
---

<script>
import { APISection, ComponentPreview, ContextMenuDemo } from '@/components'
import { APISection, ComponentPreview, ContextMenuDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/date-field.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Enables users to input specific dates within a designated field.
---

<script>
import { APISection, ComponentPreview, DateFieldDemo } from '@/components'
import { APISection, ComponentPreview, DateFieldDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Facilitates the selection of dates through an input and calendar-ba
---

<script>
import { APISection, ComponentPreview, DatePickerDemo } from '@/components'
import { APISection, ComponentPreview, DatePickerDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/date-range-field.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Allows users to input a range of dates within a designated field.
---

<script>
import { APISection, ComponentPreview, DateRangeFieldDemo } from '@/components'
import { APISection, ComponentPreview, DateRangeFieldDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/date-range-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Facilitates the selection of date ranges through an input and calen
---

<script>
import { APISection, ComponentPreview, DateRangePickerDemo } from '@/components'
import { APISection, ComponentPreview, DateRangePickerDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/dialog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A modal window presenting content or seeking user input without nav
---

<script>
import { APISection, ComponentPreview, DialogDemo } from '@/components'
import { APISection, ComponentPreview, DialogDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/dropdown-menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Displays a menu of items that users can select from when triggered.
---

<script>
import { APISection, ComponentPreview, DropdownMenuDemo } from '@/components'
import { APISection, ComponentPreview, DropdownMenuDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/label.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Identifies or describes associated UI elements.
---

<script>
import { APISection, ComponentPreview, LabelDemo } from '@/components'
import { APISection, ComponentPreview, LabelDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/link-preview.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Displays a summarized preview of a linked content's details or info
---

<script>
import { APISection, ComponentPreview, LinkPreviewDemo } from '@/components'
import { APISection, ComponentPreview, LinkPreviewDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/menubar.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Organizes and presents a collection of menu options or actions with
---

<script>
import { APISection, ComponentPreview, MenubarDemo } from '@/components'
import { APISection, ComponentPreview, MenubarDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Facilitates navigation between pages.
---

<script>
import { APISection, ComponentPreview, PaginationDemo } from '@/components'
import { APISection, ComponentPreview, PaginationDemo } from '@/components/index.js'
export let schemas
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/pin-input.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Allows users to input a sequence of one-character alphanumeric inpu
---

<script>
import { APISection, ComponentPreview, PinInputDemo } from '@/components'
import { APISection, ComponentPreview, PinInputDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/popover.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Display supplementary content or information when users interact wi
---

<script>
import { APISection, ComponentPreview, PopoverDemo } from '@/components'
import { APISection, ComponentPreview, PopoverDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Visualizes the progress or completion status of a task or process.
---

<script>
import { APISection, ComponentPreview, ProgressDemo } from '@/components'
import { APISection, ComponentPreview, ProgressDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/radio-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Allows users to select a single option from a list of mutually excl
---

<script>
import { APISection, ComponentPreview, RadioGroupDemo } from '@/components'
import { APISection, ComponentPreview, RadioGroupDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/range-calendar.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Presents a calendar view tailored for selecting date ranges.
---

<script>
import { APISection, ComponentPreview, RangeCalendarDemo } from '@/components'
import { APISection, ComponentPreview, RangeCalendarDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Enables users to choose from a list of options presented in a dropd
---

<script>
import { APISection, ComponentPreview, SelectDemo } from '@/components'
import { APISection, ComponentPreview, SelectDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/separator.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Visually separates content or UI elements for clarity and organizat
---

<script>
import { APISection, ComponentPreview, SeparatorDemo } from '@/components'
import { APISection, ComponentPreview, SeparatorDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/slider.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Allows users to select a value from a continuous range by sliding a
---

<script>
import { APISection, ComponentPreview, SliderDemo } from '@/components'
import { APISection, ComponentPreview, SliderDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A toggle control enabling users to switch between "on" and "off" st
---

<script>
import { APISection, ComponentPreview, SwitchDemo } from '@/components'
import { APISection, ComponentPreview, SwitchDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/tabs.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Organizes content into distinct sections, allowing users to switch
---

<script>
import { APISection, ComponentPreview, TabsDemo } from '@/components'
import { APISection, ComponentPreview, TabsDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/toggle-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A control element that switches between two states, providing a bin
---

<script>
import { APISection, ComponentPreview, ToggleGroupDemo } from '@/components'
import { APISection, ComponentPreview, ToggleGroupDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/toggle.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Groups multiple toggle controls, allowing users to enable one or mu
---

<script>
import { APISection, ComponentPreview, ToggleDemo } from '@/components'
import { APISection, ComponentPreview, ToggleDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/toolbar.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Displays frequently used actions or tools in a compact, easily acce
---

<script>
import { APISection, ComponentPreview, ToolbarDemo } from '@/components'
import { APISection, ComponentPreview, ToolbarDemo } from '@/components/index.js'
export let schemas;
</script>

Expand Down
2 changes: 1 addition & 1 deletion content/components/tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Provides additional information or context when users hover over or
---

<script>
import { ComponentPreview, TooltipDemo, APISection } from '@/components'
import { ComponentPreview, TooltipDemo, APISection } from '@/components/index.js'
export let schemas;
</script>

Expand Down
5 changes: 4 additions & 1 deletion mdsvex.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ function getComponentSourceFileContent(src = "") {
// Read the source file.
const filePath = path.join(process.cwd(), newSrc);

const formattedSource = prettier.format(readFileSync(filePath, "utf-8"), codeBlockPrettierConfig);
/** @type {string} */
let formattedSource = prettier.format(readFileSync(filePath, "utf-8"), codeBlockPrettierConfig);

formattedSource = formattedSource.replaceAll(`"$lib/index.js";`, `"bits-ui";`);

return formattedSource;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@playwright/test": "^1.28.1",
"@sveltejs/adapter-vercel": "^5.1.0",
"@sveltejs/kit": "^2.5.0",
"@sveltejs/package": "^2.2.6",
"@sveltejs/package": "^2.2.7",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@tailwindcss/typography": "^0.5.10",
Expand Down
25 changes: 20 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/components/api-ref/data-attr-value-content.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts">
import { Popover } from "$lib";
import { flyAndScale } from "@/utils";
import { Code } from "@/components";
import { Popover } from "$lib/index.js";
import { flyAndScale } from "@/utils/index.js";
import { Code } from "@/components/index.js";
import { Info } from "$icons/index.js";
import type { DataAttrSchema } from "@/types";
import type { DataAttrSchema } from "@/types/index.js";
export let attr: DataAttrSchema;
</script>
Expand Down
Loading

0 comments on commit fabab62

Please sign in to comment.