Skip to content

Commit

Permalink
fix: export types of react & solid adapter, esm issues with vite & qwik
Browse files Browse the repository at this point in the history
  • Loading branch information
Mokshit06 committed Apr 12, 2024
1 parent 9895043 commit 85a1e74
Show file tree
Hide file tree
Showing 22 changed files with 169 additions and 162 deletions.
128 changes: 29 additions & 99 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/babel/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ESNext",
"moduleResolution": "node",
"moduleResolution": "node16",
"esModuleInterop": true,
"declaration": true,
"outDir": "build",
Expand All @@ -14,4 +14,4 @@
"dist",
"node_modules"
]
}
}
5 changes: 5 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
"types": "./dist/dynamic.d.ts",
"import": "./dist/dynamic.mjs",
"require": "./dist/dynamic.js"
},
"./types": {
"types": "./dist/types.d.ts",
"import": "./dist/types.mjs",
"require": "./dist/types.js"
}
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/create-runtime-fn.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {
import type {
PatternResult,
RuntimeFn,
VariantGroups,
VariantSelection,
} from '@vanilla-extract/recipes/dist/declarations/src/types';
} from './types';

const shouldApplyCompound = <Variants extends VariantGroups>(
compoundCheck: VariantSelection<Variants>,
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { createRuntimeFn } from './create-runtime-fn';
import type {
PatternOptions,
PatternResult,
RecipeVariants,
RuntimeFn,
VariantGroups,
VariantSelection,
RecipeVariants,
} from '@vanilla-extract/recipes/dist/declarations/src/types';
} from './types';

export type { RecipeVariants };

Expand Down
37 changes: 37 additions & 0 deletions packages/core/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Sourced from @vanilla-extract/recipes

import type { ComplexStyleRule } from '@vanilla-extract/css';
type RecipeStyleRule = ComplexStyleRule | string;
export type VariantDefinitions = Record<string, RecipeStyleRule>;
type BooleanMap<T> = T extends 'true' | 'false' ? boolean : T;
export type VariantGroups = Record<string, VariantDefinitions>;
export type VariantSelection<Variants extends VariantGroups> = {
[VariantGroup in keyof Variants]?: BooleanMap<keyof Variants[VariantGroup]>;
};
export type PatternResult<Variants extends VariantGroups> = {
defaultClassName: string;
variantClassNames: {
[P in keyof Variants]: {
[P in keyof Variants[keyof Variants]]: string;
};
};
defaultVariants: VariantSelection<Variants>;
compoundVariants: Array<[VariantSelection<Variants>, string]>;
};
export interface CompoundVariant<Variants extends VariantGroups> {
variants: VariantSelection<Variants>;
style: RecipeStyleRule;
}
export type PatternOptions<Variants extends VariantGroups> = {
base?: RecipeStyleRule;
variants?: Variants;
defaultVariants?: VariantSelection<Variants>;
compoundVariants?: Array<CompoundVariant<Variants>>;
};
export type RuntimeFn<Variants extends VariantGroups> = (
options?: VariantSelection<Variants>
) => string;
export type RecipeVariants<RecipeFn extends RuntimeFn<VariantGroups>> =
Parameters<RecipeFn>[0];

export {};
4 changes: 2 additions & 2 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ESNext",
"moduleResolution": "node",
"moduleResolution": "node16",
"esModuleInterop": true,
"declaration": true,
"outDir": "build",
Expand All @@ -16,4 +16,4 @@
"dist",
"node_modules"
]
}
}
2 changes: 1 addition & 1 deletion packages/esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@vanilla-extract/esbuild-plugin": "^2.0.5",
"@vanilla-extract/integration": "^6.0.0",
"esbuild": "^0.14.42",
"@macaron-css/integration": "1.0.0"
"@macaron-css/integration": "1.5.1"
},
"files": [
"dist",
Expand Down
4 changes: 2 additions & 2 deletions packages/esbuild/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ESNext",
"moduleResolution": "node",
"moduleResolution": "node16",
"esModuleInterop": true,
"declaration": true,
"outDir": "build",
Expand All @@ -16,4 +16,4 @@
"node_modules",
"build"
]
}
}
16 changes: 8 additions & 8 deletions packages/qwik/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
"name": "@macaron-css/qwik",
"version": "1.5.1",
"license": "MIT",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"type": "module",
"repository": {
"type": "git",
"url": "https://github.com/mokshit06/macaron.git",
"directory": "packages/qwik"
},
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js"
"types": "./dist/index.d.mts",
"import": "./dist/index.mjs"
},
"./dist/*": "./dist/*",
"./runtime": {
"import": "./dist/runtime.mjs",
"require": "./dist/runtime.js"
"types": "./dist/index.d.mts",
"import": "./dist/runtime.mjs"
}
},
"dependencies": {
"@macaron-css/core": "1.5.1"
},
"devDependencies": {
"@builder.io/qwik": "^1.1.5",
"@vanilla-extract/recipes": "^0.2.5"
Expand Down
Loading

0 comments on commit 85a1e74

Please sign in to comment.