Skip to content

Commit

Permalink
cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoperra committed Nov 4, 2024
1 parent 74b96d7 commit b4971dc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/state/vite/autoKey.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Plugin } from 'vite';
import { astAddAutoNaming } from './internal/astAutoNaming';
import { astAddAutoNaming } from './babel/astAutoNaming';
import { parseModule } from 'magicast';

interface StatebuilderAutonamingOptions {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import * as t from '@babel/types';
import type * as babel from '@babel/core';

/**
* @experimental
*
* Search for components that use `use stateprovider` directive, then wrap them into StateProvider.
*/
export function babelReplaceStateProviderDirective(): babel.PluginObj<any> {
return {
name: 'statebuilder:stateprovider-directive',
Expand Down
2 changes: 1 addition & 1 deletion packages/state/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface StateBuilderPluginOptions {
/**
* Transform components that make use of 'use stateprovider'.
*/
transformStateProviderDirective: boolean;
transformStateProviderDirective?: boolean;
};
}

Expand Down
2 changes: 1 addition & 1 deletion packages/state/vite/stateProviderDirective.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as babel from '@babel/core';
import { basename } from 'node:path';
import { Plugin } from 'vite';
import { babelReplaceStateProviderDirective } from './internal/replaceStateProviderDirective';
import { babelReplaceStateProviderDirective } from './babel/replaceStateProviderDirective';

export function stateProviderDirective(): Plugin {
return {
Expand Down

0 comments on commit b4971dc

Please sign in to comment.