Skip to content

Commit df89048

Browse files
committed
fix(cli): support esm dependencies
1 parent 7ee3ffd commit df89048

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

packages/tools/kolibri-cli/src/generate-scss/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import type { Command } from 'commander';
2-
import { BEM_ALERT, BEM_ICON } from '@public-ui/components';
2+
// @ts-expect-error typed exports not available
3+
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment
4+
const { BEM_ALERT, BEM_ICON } = require('@public-ui/components');
35
import { generateBemScssFile } from 'typed-bem/scss';
46

57
/**
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
declare module '@public-ui/components/dist/esm/index.js' {
2+
export * from '@public-ui/components';
3+
}
Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
{
2-
"compilerOptions": {
3-
"allowSyntheticDefaultImports": true,
4-
"esModuleInterop": true,
5-
"forceConsistentCasingInFileNames": true,
6-
"module": "NodeNext",
7-
"moduleResolution": "nodenext",
8-
"outDir": "./dist",
9-
"resolveJsonModule": true,
10-
"target": "ESNext",
11-
"types": ["node"],
12-
"skipLibCheck": true,
13-
"strict": true
14-
},
15-
"include": ["src"],
2+
"compilerOptions": {
3+
"allowSyntheticDefaultImports": true,
4+
"esModuleInterop": true,
5+
"forceConsistentCasingInFileNames": true,
6+
"module": "ESNext",
7+
"moduleResolution": "bundler",
8+
"outDir": "./dist",
9+
"resolveJsonModule": true,
10+
"target": "ESNext",
11+
"baseUrl": "./src",
12+
"paths": {
13+
"@public-ui/components": ["../../components/dist/types"],
14+
"@public-ui/components/*": ["../../components/dist/types/*"]
15+
},
16+
"types": ["node"],
17+
"skipLibCheck": true,
18+
"strict": true
19+
},
20+
"include": ["src"],
21+
"files": ["src/types.d.ts"],
1622
"exclude": ["node_modules", "dist"]
1723
}

0 commit comments

Comments
 (0)