Skip to content

Commit 8eda8f7

Browse files
committed
0.22.8 - cleaning up config factory, bump bun + typescript version, enable noUncheckedIndexedAccess
1 parent 665251c commit 8eda8f7

5 files changed

Lines changed: 27 additions & 8 deletions

File tree

.github/workflows/build-test-and-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Bun
1919
uses: oven-sh/setup-bun@v2
2020
with:
21-
bun-version: 1.2.11
21+
bun-version: 1.2.21
2222
- name: Install dependencies with Bun
2323
run: bun install
2424
- name: Build package with Bun

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@schemavaults/theme",
33
"description": "TailwindCSS theme shared by different SchemaVaults applications",
4-
"version": "0.22.7",
4+
"version": "0.22.8",
55
"private": false,
66
"license": "UNLICENSED",
77
"repository": {
@@ -19,8 +19,8 @@
1919
"@types/react": "19.0.0",
2020
"@types/react-dom": "19.0.0",
2121
"tsc-alias": "1.8.16",
22-
"bun-types": "1.2.11",
23-
"typescript": "5.8.3",
22+
"bun-types": "1.2.21",
23+
"typescript": "5.9.2",
2424
"ignore-loader": "0.1.2",
2525
"tailwindcss": "3.4.17"
2626
},
@@ -69,5 +69,5 @@
6969
"publishConfig": {
7070
"access": "public"
7171
},
72-
"packageManager": "bun@1.2.11"
72+
"packageManager": "bun@1.2.21"
7373
}

src/TailwindConfigFactory.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
import type { Config as TailwindConfig } from "tailwindcss";
2-
import * as tailwindAnimatePlugin from "tailwindcss-animate";
32
import { componentColors } from "./component_colors";
43
import { brandColors } from "./brand_colors";
54
import DefaultOrgScope from "./DefaultOrgScope"; // @schemavaults organization is default
65
import {
76
getScreenBreakpoint,
87
listScreenBreakpoints,
9-
ScreenBreakpointID,
8+
type ScreenBreakpointID,
109
} from "./ScreenBreakpoints";
1110
import type { TailwindTheme } from "./TailwindTheme";
1211
type OsJoinFn = (
1312
path_segment: string,
1413
...remaining_path_segments: string[]
1514
) => string;
1615

16+
// TailwindCSS Plugins:
17+
import tailwindAnimatePlugin from "@/plugins/tailwindcss-animate";
18+
1719
export interface ISchemaVaultsTailwindConfigFactoryInitOptions {
1820
debug?: boolean;
1921
join: OsJoinFn;
@@ -95,6 +97,11 @@ export class SchemaVaultsTailwindConfigFactory
9597
}
9698
}
9799

100+
/**
101+
* @description Load TailwindCSS plugins to use in theme configuration
102+
* @returns Array of TailwindCSS plugins
103+
* @see /plugins directory
104+
*/
98105
protected get plugins(): TailwindConfig["plugins"] {
99106
return [tailwindAnimatePlugin];
100107
}
@@ -167,6 +174,15 @@ export class SchemaVaultsTailwindConfigFactory
167174

168175
const pkg_blob_parts = pkg_blob_string.split("/");
169176

177+
if (
178+
pkg_blob_parts.length < 2 ||
179+
!pkg_blob_parts[1] ||
180+
typeof pkg_blob_parts[1] !== "string"
181+
) {
182+
throw new TypeError(
183+
"Failed to resolve package name from package blob string",
184+
);
185+
}
170186
const package_name: string = pkg_blob_parts[1];
171187

172188
const join: OsJoinFn = this.join;

src/plugins/tailwindcss-animate.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import * as tailwindAnimatePlugin from "tailwindcss-animate";
2+
export default tailwindAnimatePlugin;

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"paths": {
2222
"@/*": ["./src/*"]
2323
},
24-
"strictNullChecks": true
24+
"strictNullChecks": true,
25+
"noUncheckedIndexedAccess": true
2526
},
2627
"include": ["./src/**/*"],
2728
"exclude": ["node_modules"]

0 commit comments

Comments
 (0)