Skip to content

Commit 2fc8bb1

Browse files
refactor(aliases): change import aliases from "~" to "~ui" to be more similar how its used on the cunsumer side, allows for easier copy and paste as well
1 parent c539f65 commit 2fc8bb1

File tree

162 files changed

+576
-579
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+576
-579
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ bun add solid-js clsx tailwind-merge valibot dayjs @solid-primitives/keyed @soli
4747
To ensure Tailwind scans the library's source files for classes (since components are published as source without a build step), add the following `@source` directive to your project's `src/layouts/global.css` (or equivalent global stylesheet):
4848

4949
```css
50-
@source '/node_modules/@adaptive-sm/solid-ui/lib/**/*.{astro,html,md,mdx,ts,tsx}';
50+
@source '/node_modules/@adaptive-sm/solid-ui/export/**/*.{astro,html,md,mdx,ts,tsx}';
5151
```
5252

5353
This tells Tailwind to include classes from the library's `.tsx`, `.ts`, and other relevant files in the purge process, preventing unused classes from being purged during the build. Without it, Tailwind might not detect classes used in imported components, leading to missing styles.
@@ -64,7 +64,7 @@ In your `tsconfig.json`, set up the `~` alias to point to the library:
6464
"baseUrl": ".",
6565
"paths": {
6666
"@/*": ["src/*"],
67-
"~/*": ["./node_modules/@adaptive-sm/solid-ui/lib/*"]
67+
"~ui/*": ["./node_modules/@adaptive-sm/solid-ui/lib/*"]
6868
}
6969
}
7070
}
@@ -83,7 +83,7 @@ export default defineConfig({
8383
resolve: {
8484
alias: {
8585
"@": new URL("./src", import.meta.url).pathname,
86-
"~": new URL("./node_modules/@adaptive-sm/solid-ui/lib", import.meta.url).pathname,
86+
"~ui": new URL("./node_modules/@adaptive-sm/solid-ui/lib", import.meta.url).pathname,
8787
},
8888
},
8989
plugins: [solid(), tailwindcss()],

lib/classes/classesTextLink.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { classArr } from "~/utils/ui/classArr"
1+
import { classArr } from "~ui/utils/ui/classArr"
22

33
export const classesTextLink = classArr(
44
"text-blue-600 hover:text-black", // light

lib/demo_pages/LinkBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BulletLinks } from "~/interactive/list/BulletLinks"
1+
import { BulletLinks } from "~ui/interactive/list/BulletLinks"
22

33
export function LinkBlock(p: { header: string; removeUrlPrefix: string; links: string[] }) {
44
return (

lib/demo_pages/generateDemoRoutes.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { For } from "solid-js"
2-
import { LinkBlock } from "~/demo_pages/LinkBlock"
3-
import { pathDemos } from "~/demo_pages/pathDemos"
4-
import type { RouteObject } from "~/demo_pages/RouteConfig"
5-
import type { DemoListType } from "~/generate_demo_list/DemoListType"
6-
import { LinkButton } from "~/interactive/link/LinkButton"
7-
import { classesGridCols3xl } from "~/static/container/classesGridCols"
8-
import { LayoutWrapperDemo } from "~/static/container/LayoutWrapperDemo"
9-
import { NavDemo } from "~/static/nav/NavDemo"
10-
import { objectEntries } from "~/utils/obj/objectEntries"
11-
import { objectKeys } from "~/utils/obj/objectKeys"
12-
import { classArr } from "~/utils/ui/classArr"
2+
import { LinkBlock } from "~ui/demo_pages/LinkBlock"
3+
import { pathDemos } from "~ui/demo_pages/pathDemos"
4+
import type { RouteObject } from "~ui/demo_pages/RouteConfig"
5+
import type { DemoListType } from "~ui/generate_demo_list/DemoListType"
6+
import { LinkButton } from "~ui/interactive/link/LinkButton"
7+
import { classesGridCols3xl } from "~ui/static/container/classesGridCols"
8+
import { LayoutWrapperDemo } from "~ui/static/container/LayoutWrapperDemo"
9+
import { NavDemo } from "~ui/static/nav/NavDemo"
10+
import { objectEntries } from "~ui/utils/obj/objectEntries"
11+
import { objectKeys } from "~ui/utils/obj/objectKeys"
12+
import { classArr } from "~ui/utils/ui/classArr"
1313

1414
const log = false
1515

lib/env/isDevEnv.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { envMode } from "~/env/envMode"
2-
import { getEnvMode } from "~/env/getEnvMode"
1+
import { envMode } from "~ui/env/envMode"
2+
import { getEnvMode } from "~ui/env/getEnvMode"
33

44
export function isDevEnv(): boolean {
55
return getEnvMode() === envMode.development

lib/env/isProdEnv.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { envMode } from "~/env/envMode"
2-
import { getEnvMode } from "~/env/getEnvMode"
1+
import { envMode } from "~ui/env/envMode"
2+
import { getEnvMode } from "~ui/env/getEnvMode"
33

44
export function isProdEnv(): boolean {
55
return getEnvMode() === envMode.production

lib/generate_demo_list/generateDemoList.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { readdir, writeFile } from "node:fs/promises"
22
import { join } from "node:path"
3-
import { formatGeneratedCodeFile } from "~/generate_demo_list/parts/formatGeneratedCodeFile"
4-
import { objectKeys } from "~/utils/obj/objectKeys"
3+
import { formatGeneratedCodeFile } from "~ui/generate_demo_list/parts/formatGeneratedCodeFile"
4+
import { objectKeys } from "~ui/utils/obj/objectKeys"
55
import { findDemoFilesRecursive } from "./parts/findDemoFilesRecursive"
66
import { removeDemoObjectValueQuotes } from "./parts/removeDemoObjectValueQuotes"
77
import { serializeDemoComponentImport } from "./parts/serializeDemoComponentImport"
@@ -31,7 +31,7 @@ export async function generateDemoList(demoSearchDirRelative: string, outputFile
3131

3232
let output = `
3333
import { lazy } from "solid-js"
34-
import { type DemoListType } from "~/generate_demo_list/DemoListType"\n\n`
34+
import { type DemoListType } from "~ui/generate_demo_list/DemoListType"\n\n`
3535

3636
for (const category of objectKeys(demoPageList)) {
3737
const importPathComponents = demoPageList[category]

lib/generate_demo_list/parts/formatGeneratedCodeFile.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { runCmdAsync } from "~/utils/bun/runCmdAsync"
1+
import { runCmdAsync } from "~ui/utils/bun/runCmdAsync"
22

33
export async function formatGeneratedCodeFile(outputPath: string) {
44
const cmd = `bun run biome check --write ${outputPath}`.split(" ")

lib/i18n/ct0.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { languageSignal } from "~/i18n/languageSignal"
2-
import type { TranslationBlock } from "~/i18n/TranslationBlock"
1+
import { languageSignal } from "~ui/i18n/languageSignal"
2+
import type { TranslationBlock } from "~ui/i18n/TranslationBlock"
33

44
export function ct0(b: TranslationBlock): string {
55
return b[languageSignal.get()]

lib/i18n/getBrowserUserDefinedLanguage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type Language, language } from "~/i18n/language"
1+
import { type Language, language } from "~ui/i18n/language"
22

33
export function getBrowserUserDefinedLanguage(): Language {
44
if (!navigator || !navigator.languages) return language.en

0 commit comments

Comments
 (0)