Skip to content

Commit 020bcf5

Browse files
committed
Fix imports
1 parent df94419 commit 020bcf5

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@
7373
"strip-ansi": "^7.1.0",
7474
"terminal-link": "^3.0.0",
7575
"xdg-app-paths": "^8.3.0",
76-
"zod": "^3.23.8"
76+
"zod": "^3.23.8",
77+
"@croct/time": "^0.10.2",
78+
"@commander-js/extra-typings": "^12.1.0"
7779
},
7880
"devDependencies": {
79-
"@commander-js/extra-typings": "^12.1.0",
8081
"@croct/eslint-plugin": "^0.7.1",
8182
"@graphql-codegen/cli": "^5.0.2",
8283
"@swc/jest": "^0.2.36",

src/application/project/code/transformation/javascript/javaScriptCodemod.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import {File} from '@babel/types';
22
import {parse, print} from 'recast';
33
import {parse as babelParse} from '@babel/parser';
4-
import getBabelOptions, {type Overrides} from 'recast/parsers/_babel_options.js';
4+
import getBabelOptionsModule from 'recast/parsers/_babel_options.js';
5+
import type {Overrides} from 'recast/parsers/_babel_options.js';
56
import {Codemod, CodemodOptions, ResultCode} from '@/application/project/code/transformation/codemod';
67
import {Language} from '@/application/project/code/transformation/javascript/utils/parse';
78

@@ -10,6 +11,12 @@ export type Configuration<O extends CodemodOptions> = {
1011
languages: Language[],
1112
};
1213

14+
// This is a workaround mixed ESM and CommonJS modules that causes issues
15+
// when bundling the recast package.
16+
const getBabelOptions = 'default' in getBabelOptionsModule
17+
? getBabelOptionsModule.default as typeof getBabelOptionsModule
18+
: getBabelOptionsModule;
19+
1320
export class JavaScriptCodemod<O extends CodemodOptions> implements Codemod<string, O> {
1421
private readonly codemod: Codemod<File, O>;
1522

src/infrastructure/application/cli/cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {AutoSaveCache, CacheProvider, InMemoryCache} from '@croct/cache';
22
import {ApiKey} from '@croct/sdk/apiKey';
33
import {Clock, Instant, LocalTime} from '@croct/time';
4-
import {SystemClock} from '@croct/time/clock/systemClock';
4+
import {SystemClock} from '@croct/time/clock/systemClock.js';
55
import {homedir} from 'os';
66
import XDGAppPaths from 'xdg-app-paths';
77
import ci from 'ci-info';

0 commit comments

Comments
 (0)