Skip to content
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
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,11 @@
"strip-ansi": "^7.1.0",
"terminal-link": "^3.0.0",
"xdg-app-paths": "^8.3.0",
"zod": "^3.23.8"
"zod": "^3.23.8",
"@croct/time": "^0.10.2",
"@commander-js/extra-typings": "^12.1.0"
},
"devDependencies": {
"@commander-js/extra-typings": "^12.1.0",
"@croct/eslint-plugin": "^0.7.1",
"@graphql-codegen/cli": "^5.0.2",
"@swc/jest": "^0.2.36",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {File} from '@babel/types';
import {parse, print} from 'recast';
import {parse as babelParse} from '@babel/parser';
import getBabelOptions, {type Overrides} from 'recast/parsers/_babel_options.js';
import getBabelOptionsModule from 'recast/parsers/_babel_options.js';
import type {Overrides} from 'recast/parsers/_babel_options.js';
import {Codemod, CodemodOptions, ResultCode} from '@/application/project/code/transformation/codemod';
import {Language} from '@/application/project/code/transformation/javascript/utils/parse';

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

// This is a workaround mixed ESM and CommonJS modules that causes issues
// when bundling the recast package.
const getBabelOptions = 'default' in getBabelOptionsModule
? getBabelOptionsModule.default as typeof getBabelOptionsModule
: getBabelOptionsModule;

export class JavaScriptCodemod<O extends CodemodOptions> implements Codemod<string, O> {
private readonly codemod: Codemod<File, O>;

Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/application/cli/cli.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {AutoSaveCache, CacheProvider, InMemoryCache} from '@croct/cache';
import {ApiKey} from '@croct/sdk/apiKey';
import {Clock, Instant, LocalTime} from '@croct/time';
import {SystemClock} from '@croct/time/clock/systemClock';
import {SystemClock} from '@croct/time/clock/systemClock.js';
import {homedir} from 'os';
import XDGAppPaths from 'xdg-app-paths';
import ci from 'ci-info';
Expand Down