Skip to content

update typed-css-modules #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"chalk": "^2.4.1",
"css-modules-loader-core": "^1.1.0",
"glob": "^7.1.3",
"typed-css-modules": "^0.3.7"
"typed-css-modules": "^0.4.2"
},
"engines": {
"node": ">= 8"
Expand Down
8 changes: 0 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ interface DtsCreator {

interface DtsContent {
readonly outputFilePath: string;
readonly messageList: ReadonlyArray<string>;
writeFile(): Promise<this>;
}

Expand All @@ -44,13 +43,6 @@ async function writeFile(dtsCreator: DtsCreator, cssFile: string): Promise<void>
// clears cache so that watch mode generates update-to-date typing.
const content = await dtsCreator.create(cssFile, undefined, true);
await content.writeFile();
if (content.messageList.length > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gdelmas why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the new version of typed-css-modules no longer has a messagesList.

i guess the reason is, that it was only used to collect classnames that could not be emitted. yet the new version can emit all classnames now.

i therefore also updated the definition to reflect that in line 26.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gdelmas Sounds good. I will merge the PR if you can rebase.

console.warn(chalk.yellow(`[Warn] ${cssFile}`));
for (const message of content.messageList) {
console.warn(chalk.yellow(`[Warn] ${message}`));
}
throw new Error(`Failed to generate typing for ${cssFile}`);
}
}

async function generateTypingIfNecessary(dtsCreator: DtsCreator, cssFile: string): Promise<void> {
Expand Down
6 changes: 5 additions & 1 deletion test/cases/basic/expected/style.css.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export const foo: string;
declare const styles: {
readonly "foo": string;
};
export = styles;

6 changes: 5 additions & 1 deletion test/cases/typecheck/expected/style.css.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export const foo: string;
declare const styles: {
readonly "foo": string;
};
export = styles;

Loading