Skip to content

Commit

Permalink
refactor: unify project structure (#48)
Browse files Browse the repository at this point in the history
* refactor: fix styled plugin name

* refactor: split the core plugin into transform and css lookup

* refactor: rename directory

* refactor: split resolveId into single plugin

* refactor: move types for better scope

* refactor: move transform hooks

* refactor: move types for better scope

* refactor: move id utils

* refactor: rename functions

* refactor: return captured imports instead of mutating state

* refactor: helper function should not change state

* refactor: add comment

* refactor: no mutation in helper function

* refactor: fix misleading comment

* refactor: use recursive fn to resolve `composes` deps graph

* refactor: remove unused logging
  • Loading branch information
tkamenoko authored Oct 14, 2024
1 parent 3635edd commit 42e6c23
Show file tree
Hide file tree
Showing 123 changed files with 757 additions and 545 deletions.
18 changes: 0 additions & 18 deletions packages/core/src/vite/hooks/resolveCss/resolveCssModuleId.ts

This file was deleted.

18 changes: 0 additions & 18 deletions packages/core/src/vite/hooks/resolveCss/resolveGlobalStyleId.ts

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion packages/core/src/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ import type { Plugin } from "vite";
import { plugin } from "./plugin";
import type { PluginOption } from "./types";

export function casablanca(options?: Partial<PluginOption>): Plugin {
export function casablanca(options?: Partial<PluginOption>): Plugin[] {
return plugin(options);
}
220 changes: 0 additions & 220 deletions packages/core/src/vite/plugin.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { extractPathAndParamsFromId } from "@casablanca-css/utils";
import { isResolvedCssModuleId } from "../../resolvedCssModuleId/isResolvedCssModuleId";
import { isResolvedCssModuleId } from "#@/vite/types/resolvedCssModuleId";
import type { CssModulesLookup } from "../../types";

type LoadCssModuleReturn = { code: string; map: string | null };
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { extractPathAndParamsFromId } from "@casablanca-css/utils";
import { isResolvedGlobalStyleId } from "#@/vite/resolvedGlobalStyleId";
import type { GlobalStylesLookup } from "#@/vite/types";
import { isResolvedGlobalStyleId } from "#@/vite/types/resolvedGlobalStyleId";
import type { GlobalStylesLookup } from "../../types";

type LoadGlobalStyleReturn = { code: string; map: string | null };

Expand Down
Loading

0 comments on commit 42e6c23

Please sign in to comment.