Skip to content

Commit

Permalink
fix(codegen): fix missing initializer error (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonambas authored Apr 11, 2024
1 parent d83914b commit b806ebc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/__tests__/codegen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ describe('codegen', () => {
"file": "ct.mjs",
},
{
"code": "type PluginCtMapType = {
"code": "/* eslint-disable */
type PluginCtMapType = {
'foo.100': '#fff';
'foo.200': {"base":"#000","lg":"#111"};
'bar.100': 'red';
'bar.200': 'blue';};
export const ct: <T extends keyof PluginCtMapType>(alias: T) => PluginCtMapType[T];",
export declare const ct: <T extends keyof PluginCtMapType>(alias: T) => PluginCtMapType[T];",
"file": "ct.d.ts",
},
],
Expand Down
4 changes: 2 additions & 2 deletions src/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export const codegen = (

const ctDtsFile: ArtifactContent = {
file: `ct.d.${dtsExt}`,
code: `type PluginCtMapType = {${serializeMapTypes(map)}};
export const ct: <T extends keyof PluginCtMapType>(alias: T) => PluginCtMapType[T];`,
code: `/* eslint-disable */\ntype PluginCtMapType = {${serializeMapTypes(map)}};
export declare const ct: <T extends keyof PluginCtMapType>(alias: T) => PluginCtMapType[T];`,
};

cssFn.files.push(ctFile, ctDtsFile);
Expand Down

0 comments on commit b806ebc

Please sign in to comment.