Skip to content

Commit

Permalink
support tokenInfo for runner
Browse files Browse the repository at this point in the history
  • Loading branch information
mizdra committed Jun 15, 2024
1 parent 2ec229c commit bc061be
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
17 changes: 8 additions & 9 deletions packages/happy-css-modules/src/runner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,14 @@ describe('handles external files', () => {
test('treats imported tokens from external files the same as local tokens', async () => {
await run({ ...defaultOptions });
expect(await readFile(getFixturePath('/test/1.css.d.ts'), 'utf8')).toMatchInlineSnapshot(`
"declare const styles:
& Readonly<Pick<(typeof import("./2.css"))["default"], "b">>
& Readonly<{ "c": string }>
& Readonly<{ "a": string }>
;
export default styles;
//# sourceMappingURL=./1.css.d.ts.map
"
`);
"declare const styles:
& Readonly<typeof import("./2.css")["default"]>
& Readonly<{ "a": string }>
;
export default styles;
//# sourceMappingURL=./1.css.d.ts.map
"
`);
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/happy-css-modules/src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export async function run(options: RunnerOptions): Promise<Watcher | void> {
const result = await locator.load(filePath);
await emitGeneratedFiles({
filePath,
tokens: result.tokens,
tokenInfos: result.tokenInfos,
emitDeclarationMap: options.declarationMap,
dtsFormatOptions: {
localsConvention: options.localsConvention,
Expand Down

0 comments on commit bc061be

Please sign in to comment.