Skip to content

Commit 1f5c8a2

Browse files
committed
build: require extensions
1 parent 64bb682 commit 1f5c8a2

147 files changed

Lines changed: 545 additions & 504 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export default tseslint.config(
6666
'import-x/named': 2,
6767
'import-x/namespace': 2,
6868
'import-x/no-named-as-default-member': 0,
69+
'import-x/extensions': ['error', 'ignorePackages'],
6970

7071
'import-x/no-extraneous-dependencies': [
7172
'error',

src/cli/command/cleanup-path.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Cli } from 'clipanion';
22
import { describe, expect, test, vi } from 'vitest';
3-
import { registerCommands } from '.';
3+
import { registerCommands } from './index.ts';
44

55
const mocks = vi.hoisted(() => ({
66
deleteAsync: vi.fn(),

src/cli/command/cleanup-path.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { Command, Option } from 'clipanion';
22
import { deleteAsync } from 'del';
33
import prettyMilliseconds from 'pretty-ms';
4-
import { logger } from '../utils';
5-
import { command } from './utils';
4+
import { logger } from '../utils/index.ts';
5+
import { command } from './utils.ts';
66

77
@command('containerbase-cli')
88
export class CleanupPathCommand extends Command {

src/cli/command/file-download.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { env } from 'node:process';
22
import { Cli } from 'clipanion';
33
import { beforeEach, describe, expect, test, vi } from 'vitest';
4-
import { logger } from '../utils';
5-
import { registerCommands } from '.';
6-
import { scope } from '~test/http-mock';
7-
import { cachePath } from '~test/path';
4+
import { logger } from '../utils/index.ts';
5+
import { registerCommands } from './index.ts';
6+
import { scope } from '~test/http-mock.ts';
7+
import { cachePath } from '~test/path.ts';
88

99
const mocks = vi.hoisted(() => ({
1010
installTool: vi.fn(),
1111
prepareTools: vi.fn(),
1212
}));
1313

14-
vi.mock('../install-tool', () => mocks);
15-
vi.mock('../prepare-tool', () => mocks);
14+
vi.mock('../install-tool/index.ts', () => mocks);
15+
vi.mock('../prepare-tool/index.ts', () => mocks);
1616

1717
describe('cli/command/file-download', () => {
1818
beforeEach(() => {

src/cli/command/file-download.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { pipeline } from 'node:stream/promises';
66
import { Command, Option } from 'clipanion';
77
import { got } from 'got';
88
import prettyMilliseconds from 'pretty-ms';
9-
import { EnvService, createContainer } from '../services';
10-
import { logger } from '../utils';
11-
import { command } from './utils';
9+
import { EnvService, createContainer } from '../services/index.ts';
10+
import { logger } from '../utils/index.ts';
11+
import { command } from './utils.ts';
1212

1313
@command('containerbase-cli')
1414
export class FileDownloadCommand extends Command {

src/cli/command/file-exists.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { env } from 'node:process';
22
import { Cli } from 'clipanion';
33
import { beforeEach, describe, expect, test, vi } from 'vitest';
4-
import { registerCommands } from '.';
5-
import { scope } from '~test/http-mock';
4+
import { registerCommands } from './index.ts';
5+
import { scope } from '~test/http-mock.ts';
66

77
const mocks = vi.hoisted(() => ({
88
installTool: vi.fn(),
99
prepareTools: vi.fn(),
1010
}));
1111

12-
vi.mock('../install-tool', () => mocks);
13-
vi.mock('../prepare-tool', () => mocks);
12+
vi.mock('../install-tool/index.ts', () => mocks);
13+
vi.mock('../prepare-tool/index.ts', () => mocks);
1414

1515
describe('cli/command/file-exists', () => {
1616
beforeEach(() => {

src/cli/command/file-exists.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { version } from 'node:process';
22
import { Command, Option } from 'clipanion';
33
import { got } from 'got';
44
import prettyMilliseconds from 'pretty-ms';
5-
import { EnvService, createContainer } from '../services';
6-
import { logger } from '../utils';
7-
import { command } from './utils';
5+
import { EnvService, createContainer } from '../services/index.ts';
6+
import { logger } from '../utils/index.ts';
7+
import { command } from './utils.ts';
88

99
@command('containerbase-cli')
1010
export class FileExistsCommand extends Command {

src/cli/command/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Cli } from 'clipanion';
22
import { describe, expect, test } from 'vitest';
3-
import { registerCommands } from '.';
3+
import { registerCommands } from './index.ts';
44

55
describe('cli/command/index', () => {
66
test('exits with error', () => {

src/cli/command/index.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import './cleanup-path';
2-
import './file-download';
3-
import './file-exists';
4-
import './init-tool';
5-
import './install-gem';
6-
import './install-npm';
7-
import './install-pip';
8-
import './install-tool';
9-
import './link-tool';
10-
import './prepare-tool';
11-
import './uninstall-gem';
12-
import './uninstall-npm';
13-
import './uninstall-pip';
14-
import './uninstall-tool';
15-
export { registerCommands } from './utils';
1+
import './cleanup-path.ts';
2+
import './file-download.ts';
3+
import './file-exists.ts';
4+
import './init-tool.ts';
5+
import './install-gem.ts';
6+
import './install-npm.ts';
7+
import './install-pip.ts';
8+
import './install-tool.ts';
9+
import './link-tool.ts';
10+
import './prepare-tool.ts';
11+
import './uninstall-gem.ts';
12+
import './uninstall-npm.ts';
13+
import './uninstall-pip.ts';
14+
import './uninstall-tool.ts';
15+
export { registerCommands } from './utils.ts';

src/cli/command/init-tool.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { Cli } from 'clipanion';
22
import { describe, expect, test, vi } from 'vitest';
3-
import { registerCommands } from '.';
3+
import { registerCommands } from './index.ts';
44

55
const mocks = vi.hoisted(() => ({
66
installTool: vi.fn(),
77
prepareTools: vi.fn(),
88
initializeTools: vi.fn(),
99
}));
1010

11-
vi.mock('../install-tool', () => mocks);
12-
vi.mock('../prepare-tool', () => mocks);
11+
vi.mock('../install-tool/index.ts', () => mocks);
12+
vi.mock('../prepare-tool/index.ts', () => mocks);
1313

1414
describe('cli/command/init-tool', () => {
1515
test('init-tool', async () => {

0 commit comments

Comments
 (0)