Skip to content

Commit 10a0702

Browse files
committed
aliasing imports via tsconfig.json
1 parent e7ac340 commit 10a0702

23 files changed

Lines changed: 102 additions & 96 deletions

esbuild-configs/desktop.esbuild.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable no-undef */
2+
// @ts-check
23
import { context } from 'esbuild';
34

45
export async function desktop(prodFlag, watchFlag) {

esbuild-configs/web.esbuild.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable no-undef */
2+
// @ts-check
23
import { context } from 'esbuild';
34
import { polyfillNode } from 'esbuild-plugin-polyfill-node';
45

@@ -15,7 +16,7 @@ export async function web(prodFlag, watchFlag) {
1516
external: ['vscode'],
1617
logLevel: 'warning',
1718
plugins: [
18-
polyfillNode({ // trying to make the build as small as possible
19+
polyfillNode({ polyfills: { // trying to make the build as small as possible
1920
child_process: false,
2021
module: false,
2122
os: false,
@@ -26,7 +27,7 @@ export async function web(prodFlag, watchFlag) {
2627
v8: false,
2728
vm: false,
2829
zlib: false,
29-
}),
30+
}}),
3031
/* add to the end of plugins array */
3132
esbuildProblemMatcherPlugin,
3233
],

package-lock.json

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

src/chat.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as vscode from 'vscode';
22

3-
import { NEURO } from './constants';
4-
import { filterFileContents, logOutput, simpleFileName } from './utils';
5-
import { CONFIG } from './config';
3+
import { NEURO } from '~/constants';
4+
import { filterFileContents, logOutput, simpleFileName } from '~/utils';
5+
import { CONFIG } from '~/config';
66
import assert from 'node:assert';
77

88
interface Participant {

src/completions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { NeuroClient } from 'neuro-game-sdk';
22
import * as vscode from 'vscode';
3-
import { NEURO } from './constants';
4-
import { logOutput, simpleFileName, getPositionContext } from './utils';
3+
import { NEURO } from '~/constants';
4+
import { logOutput, simpleFileName, getPositionContext } from '~/utils';
55
import assert from 'node:assert';
6-
import { CONFIG } from './config';
6+
import { CONFIG } from '~/config';
77

88
let lastSuggestions: string[] = [];
99

src/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as vscode from 'vscode';
22
import { NeuroClient } from 'neuro-game-sdk';
33
import { TerminalSession } from './pseudoterminal';
44
import { RceRequest } from './rce';
5-
import type { GitExtension } from './types/git.d';
5+
import type { GitExtension } from '@typing/git.d';
66

77
export interface NeuroTask {
88
id: string;

src/context.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as vscode from 'vscode';
22

3-
import { getFence, logOutput, simpleFileName } from './utils';
4-
import { NEURO } from './constants';
5-
import { PERMISSIONS, getPermissionLevel } from './config';
3+
import { getFence, logOutput, simpleFileName } from '~/utils';
4+
import { NEURO } from '~/constants';
5+
import { PERMISSIONS, getPermissionLevel } from '~/config';
66

77
export function sendCurrentFile() {
88
const editor = vscode.window.activeTextEditor;

src/desktop/extension.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as vscode from 'vscode';
2-
import { reloadTasks, taskEndedHandler } from '../tasks';
3-
import { emergencyTerminalShutdown } from '../pseudoterminal';
4-
import { createClient, isPathNeuroSafe, setVirtualCursor } from '../utils';
5-
import { NEURO } from '../constants';
2+
import { reloadTasks, taskEndedHandler } from '~/tasks';
3+
import { emergencyTerminalShutdown } from '~/pseudoterminal';
4+
import { createClient, isPathNeuroSafe, setVirtualCursor } from '~/utils';
5+
import { NEURO } from '~/constants';
66
import {
77
initializeCommonState,
88
setupCommonProviders,
@@ -14,9 +14,9 @@ import {
1414
getDecorationRenderOptions,
1515
obtainExtensionState,
1616
reloadPermissions,
17-
} from '../shared/extension';
18-
import { registerDocsLink } from '../shared/docs';
19-
import { registerChatParticipant } from '../chat';
17+
} from '@shared/extension';
18+
import { registerDocsLink } from '@shared/docs';
19+
import { registerChatParticipant } from '~/chat';
2020
import { registerUnsupervisedActions, registerUnsupervisedHandlers } from './unsupervised';
2121

2222
export { registerDocsLink };

src/desktop/unsupervised.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { NEURO } from '../constants';
2-
import { registerTaskActions, taskHandlers } from '../tasks';
3-
import { fileActions, registerFileActions } from '../file_actions';
4-
import { gitActions, registerGitActions } from '../git';
5-
import { editingActions, registerEditingActions } from '../editing';
6-
import { ActionData, RCEAction } from '../neuro_client_helper';
7-
import { registerTerminalActions, terminalAccessHandlers } from '../pseudoterminal';
8-
import { lintActions, registerLintActions } from '../lint_problems';
9-
import { cancelRequestAction, RCEActionHandler } from '../rce';
1+
import { NEURO } from '~/constants';
2+
import { registerTaskActions, taskHandlers } from '~/tasks';
3+
import { fileActions, registerFileActions } from '~/file_actions';
4+
import { gitActions, registerGitActions } from '~/git';
5+
import { editingActions, registerEditingActions } from '~/editing';
6+
import { ActionData, RCEAction } from '~/neuro_client_helper';
7+
import { registerTerminalActions, terminalAccessHandlers } from '~/pseudoterminal';
8+
import { lintActions, registerLintActions } from '~/lint_problems';
9+
import { cancelRequestAction, RCEActionHandler } from '~/rce';
1010

1111
/**
1212
* Register unsupervised actions with the Neuro API.

src/editing.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as vscode from 'vscode';
22

3-
import { NEURO } from './constants';
4-
import { escapeRegExp, getFence, getPositionContext, getVirtualCursor, isPathNeuroSafe, logOutput, NeuroPositionContext, setVirtualCursor, substituteMatch } from './utils';
5-
import { ActionData, actionValidationAccept, actionValidationFailure, ActionValidationResult, RCEAction, contextFailure, stripToActions } from './neuro_client_helper';
6-
import { PERMISSIONS, getPermissionLevel, CONFIG } from './config';
3+
import { NEURO } from '~/constants';
4+
import { escapeRegExp, getFence, getPositionContext, getVirtualCursor, isPathNeuroSafe, logOutput, NeuroPositionContext, setVirtualCursor, substituteMatch } from '~/utils';
5+
import { ActionData, actionValidationAccept, actionValidationFailure, ActionValidationResult, RCEAction, contextFailure, stripToActions } from '~/neuro_client_helper';
6+
import { PERMISSIONS, getPermissionLevel, CONFIG } from '~/config';
77

88
const CONTEXT_NO_ACCESS = 'You do not have permission to access this file.';
99
const CONTEXT_NO_ACTIVE_DOCUMENT = 'No active document to edit.';

0 commit comments

Comments
 (0)