Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .changeset/solid-snakes-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
"@plextv/vite-plugin-react-reanimated-lightning": patch
"@plextv/vite-plugin-react-native-lightning": patch
"@plextv/react-native-lightning-components": patch
"@plextv/react-lightning-components": patch
"@plextv/vite-plugin-msdf-fontgen": patch
"@plextv/react-native-lightning": patch
"@plextv/react-lightning-plugin-css-transform": patch
"@plextv/react-lightning-plugin-flexbox-lite": patch
"@plextv/react-lightning-plugin-reanimated": patch
"@plextv/react-lightning": patch
"@plextv/react-lightning-plugin-flexbox": patch
"@repo/configs": patch
---

fix: Fix builds and enable isolated declarations
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
auto-install-peers=true

# Prefer exact dependency versions.
save-prefix=""
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@
"glob": "11.0.3",
"husky": "9.1.7",
"listr2": "9.0.4",
"tsdown": "^0.15.7",
"tsdown": "0.16.6",
"tsx": "4.20.6",
"turbo": "2.5.8",
"type-fest": "5.1.0",
"typescript": "5.9.3",
"vite": "7.1.10",
"vite-plugin-externalize-deps": "^0.10.0",
"vite-plugin-externalize-deps": "0.10.0",
"vitest": "3.2.4",
"yaml": "2.8.1"
},
Expand Down
1 change: 1 addition & 0 deletions packages/configs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"esModuleInterop": true,
"incremental": false,
"isolatedModules": true,
"isolatedDeclarations": true,
"lib": ["es2022", "DOM", "DOM.Iterable"],
"module": "ESNext",
"moduleDetection": "force",
Expand Down
11 changes: 7 additions & 4 deletions packages/configs/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import { defineConfig } from 'tsdown';
import { defineConfig, type UserConfig } from 'tsdown';

export default defineConfig({
const config: UserConfig = defineConfig({
entry: ['src/index.ts'],
format: ['cjs', 'esm'],
target: 'chrome56',
platform: 'browser',
sourcemap: true,
dts: true,
dts: {
oxc: true,
},
loader: {
'.png': 'asset',
},
// minify: false,
exports: {
devExports: true,
},
Expand All @@ -20,3 +21,5 @@ export default defineConfig({
},
},
});

export default config;
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export function convertCSSTransformToLightning(
| number
| number[]
| Record<string, number | string | number[]>,
) {
): Transform {
const transformResult: Transform = {};

if (typeof transformValue === 'object') {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function convertRotationValue(value: string) {
export function convertRotationValue(value: string): number {
if (value.endsWith('deg')) {
return (Number.parseFloat(value) * Math.PI) / 180;
}
Expand Down
5 changes: 0 additions & 5 deletions packages/plugin-css-transform/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "@repo/configs/tsconfig.react-library.json",
"compilerOptions": {
"rootDir": "src",
"declaration": false,
"declarationMap": false
},
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
8 changes: 5 additions & 3 deletions packages/plugin-css-transform/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import baseConfig from '@repo/configs/tsdown.config';
import { defineConfig } from 'tsdown';
import { defineConfig, type UserConfig } from 'tsdown';
import baseConfig from '../configs/tsdown.config';

export default defineConfig({
const config: UserConfig = defineConfig({
...baseConfig,
entry: ['src/index.ts', 'src/types/jsx.d.ts'],
exports: {
Expand All @@ -17,3 +17,5 @@ export default defineConfig({
},
},
});

export default config;
5 changes: 0 additions & 5 deletions packages/plugin-flexbox-lite/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
{
"extends": "@repo/configs/tsconfig.react-library.json",
"compilerOptions": {
"rootDir": "src",
"declaration": false,
"declarationMap": false
},
"include": ["src", "../../types/*.d.ts"],
"exclude": ["node_modules", "dist"]
}
8 changes: 5 additions & 3 deletions packages/plugin-flexbox-lite/tsdown.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import baseConfig from '@repo/configs/tsdown.config';
import { defineConfig } from 'tsdown';
import { defineConfig, type UserConfig } from 'tsdown';
import baseConfig from '../configs/tsdown.config';

export default defineConfig({
const config: UserConfig = defineConfig({
...baseConfig,
entry: ['./src/index.ts', './src/types/jsx.d.ts'],
exports: {
Expand All @@ -17,3 +17,5 @@ export default defineConfig({
},
},
});

export default config;
4 changes: 2 additions & 2 deletions packages/plugin-flexbox/src/LightningManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class LightningManager {
private _elements = new Map<number, LightningElement>();
private _yogaManager: YogaManager | Workerized<YogaManager> | undefined;

public async init(yogaOptions?: YogaOptions) {
public async init(yogaOptions?: YogaOptions): Promise<void> {
this._yogaManager = await loadYoga(yogaOptions);
this._yogaManager.on('render', this._applyUpdates);
}
Expand Down Expand Up @@ -105,7 +105,7 @@ export class LightningManager {
elementId: number,
style?: Partial<LightningElementStyle> | null,
skipRender = false,
) {
): void {
if (!this._elements.has(elementId)) {
return;
}
Expand Down
23 changes: 13 additions & 10 deletions packages/plugin-flexbox/src/YogaManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,13 @@ export class YogaManager {
private _eventEmitter: EventEmitter<YogaManagerEvents> = new EventEmitter();
private _dataView: SimpleDataView;

public on = this._eventEmitter.on.bind(this._eventEmitter);
public off = this._eventEmitter.off.bind(this._eventEmitter);
public on: EventEmitter<YogaManagerEvents>['on'] = this._eventEmitter.on.bind(
this._eventEmitter,
);
public off: EventEmitter<YogaManagerEvents>['off'] =
this._eventEmitter.off.bind(this._eventEmitter);

public get initialized() {
public get initialized(): boolean {
return this._initialized;
}

Expand All @@ -69,7 +72,7 @@ export class YogaManager {
);
}

public async init(yogaOptions?: YogaOptions) {
public async init(yogaOptions?: YogaOptions): Promise<void> {
Object.assign(this._yogaOptions, yogaOptions);

this._yoga = await loadYoga();
Expand Down Expand Up @@ -104,7 +107,7 @@ export class YogaManager {
this._initialized = true;
}

public addNode(elementId: number) {
public addNode(elementId: number): ManagerNode {
if (this._elementMap.has(elementId)) {
// biome-ignore lint/style/noNonNullAssertion: Already checked
return this._elementMap.get(elementId)!;
Expand All @@ -117,7 +120,7 @@ export class YogaManager {
return node;
}

public removeNode(elementId: number) {
public removeNode(elementId: number): void {
const yogaNode = this._elementMap.get(elementId);

if (yogaNode) {
Expand All @@ -136,7 +139,7 @@ export class YogaManager {
}
}

public addChildNode(parentId: number, childId: number, index?: number) {
public addChildNode(parentId: number, childId: number, index?: number): void {
const parentYogaNode = this._elementMap.get(parentId);
const childYogaNode = this._elementMap.get(childId);

Expand All @@ -153,7 +156,7 @@ export class YogaManager {
childYogaNode.parent = parentYogaNode;
}

public queueRender(elementId: number, force = false) {
public queueRender(elementId: number, force = false): void {
if (!this._initialized || !this._yoga) {
throw new Error('Yoga is not initialized! Did you call `init()`?');
}
Expand Down Expand Up @@ -199,7 +202,7 @@ export class YogaManager {
public applyStyles(
styles: Record<number, Partial<LightningElementStyle>>,
skipRender = false,
) {
): void {
if (!this._initialized) {
throw new Error('Yoga was not initialized! Did you call `init()`?');
}
Expand All @@ -215,7 +218,7 @@ export class YogaManager {
elementId: number,
style: Partial<LightningElementStyle> | null,
skipRender = false,
) {
): void {
if (!style) {
return;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/plugin-flexbox/src/YogaManagerWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -341,4 +341,5 @@ function getId(): number {
return ++count;
}

export default () => wrapWorker<YogaManager>(new Worker());
export default (): Workerized<YogaManager> =>
wrapWorker<YogaManager>(new Worker());
Loading