Skip to content

Commit

Permalink
Merge branch 'main' into add-output-folder-option
Browse files Browse the repository at this point in the history
  • Loading branch information
mizdra committed Nov 4, 2024
2 parents ef3040e + 890c199 commit eb082dc
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 61 deletions.
99 changes: 78 additions & 21 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@swc/core": "^1.5.7",
"@swc/jest": "^0.2.36",
"@types/dedent": "^0.7.2",
"@types/eslint": "^8.37.0",
"@types/eslint": "^9.6.0",
"@types/glob": "^8.1.0",
"@types/jest": "^29.5.12",
"@types/less": "^3.0.6",
Expand All @@ -54,7 +54,7 @@
"jest": "^29.7.0",
"less": "^4.2.0",
"line-column": "^1.0.2",
"npm-run-all2": "^5.0.0",
"npm-run-all2": "^6.2.0",
"patch-package": "^8.0.0",
"postcss-import": "^16.1.0",
"postcss-less": "^6.0.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/happy-css-modules/src/emitter/dts.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { EOL } from 'os';
import path, { basename, parse, join } from 'path';
import camelcase from 'camelcase';
import { SourceNode, type CodeWithSourceMap } from '../library/source-map/index.js';
import { SourceNode, type CodeWithSourceMap } from 'source-map';
import { type Token } from '../locator/index.js';
import { type LocalsConvention } from '../runner.js';
import { getRelativePath } from './index.js';
Expand Down Expand Up @@ -73,9 +73,9 @@ function generateTokenDeclarations(
tokens: Token[],
dtsFormatOptions: DtsFormatOptions | undefined,
isExternalFile: (filePath: string) => boolean,
): (typeof SourceNode)[] {
): SourceNode[] {
const formattedTokens = formatTokens(tokens, dtsFormatOptions?.localsConvention);
const result: (typeof SourceNode)[] = [];
const result: SourceNode[] = [];

for (const token of formattedTokens) {
// Only one original position can be associated with one generated position.
Expand Down Expand Up @@ -152,13 +152,13 @@ export function generateDtsContentWithSourceMap(
isExternalFile,
);

let sourceNode: typeof SourceNode;
let sourceNode: SourceNode;
if (!tokenDeclarations || !tokenDeclarations.length) {
sourceNode = new SourceNode(null, null, null, '');
} else {
sourceNode = new SourceNode(1, 0, getRelativePath(sourceMapFilePath, filePath), [
`declare const styles:${EOL}`,
...tokenDeclarations.map((tokenDeclaration) => [' ', tokenDeclaration, EOL]),
...tokenDeclarations.map((tokenDeclaration) => [' ', tokenDeclaration, EOL]).flat(),
`;${EOL}`,
`export default styles;${EOL}`,
]);
Expand Down
3 changes: 0 additions & 3 deletions packages/happy-css-modules/src/library/README.md

This file was deleted.

26 changes: 0 additions & 26 deletions packages/happy-css-modules/src/library/source-map/index.ts

This file was deleted.

4 changes: 0 additions & 4 deletions renovate.json

This file was deleted.

0 comments on commit eb082dc

Please sign in to comment.