Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move constants to typings as well #7369

Merged
merged 1 commit into from
Jul 25, 2023
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
2 changes: 1 addition & 1 deletion lib/actions/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {CONFIG_LOAD, CONFIG_RELOAD} from '../constants/config';
import {CONFIG_LOAD, CONFIG_RELOAD} from '../../typings/constants/config';
import type {HyperActions} from '../../typings/hyper';
import type {configOptions} from '../../typings/config';

Expand Down
4 changes: 2 additions & 2 deletions lib/actions/header.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {CLOSE_TAB, CHANGE_TAB} from '../constants/tabs';
import {CLOSE_TAB, CHANGE_TAB} from '../../typings/constants/tabs';
import {
UI_WINDOW_MAXIMIZE,
UI_WINDOW_UNMAXIMIZE,
UI_OPEN_HAMBURGER_MENU,
UI_WINDOW_MINIMIZE,
UI_WINDOW_CLOSE
} from '../constants/ui';
} from '../../typings/constants/ui';
import rpc from '../rpc';
import {userExitTermGroup, setActiveGroup} from './term-groups';
import type {HyperDispatch} from '../../typings/hyper';
Expand Down
2 changes: 1 addition & 1 deletion lib/actions/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import rpc from '../rpc';
import {INIT} from '../constants';
import {INIT} from '../../typings/constants';
import type {HyperDispatch} from '../../typings/hyper';

export default function init() {
Expand Down
2 changes: 1 addition & 1 deletion lib/actions/notifications.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {NOTIFICATION_MESSAGE, NOTIFICATION_DISMISS} from '../constants/notifications';
import {NOTIFICATION_MESSAGE, NOTIFICATION_DISMISS} from '../../typings/constants/notifications';
import type {HyperActions} from '../../typings/hyper';

export function dismissNotification(id: string): HyperActions {
Expand Down
2 changes: 1 addition & 1 deletion lib/actions/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
SESSION_USER_DATA,
SESSION_SET_XTERM_TITLE,
SESSION_SEARCH
} from '../constants/sessions';
} from '../../typings/constants/sessions';
import type {HyperState, HyperDispatch, HyperActions} from '../../typings/hyper';
import type {Session} from '../../typings/common';

Expand Down
4 changes: 2 additions & 2 deletions lib/actions/term-groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
TERM_GROUP_REQUEST,
TERM_GROUP_EXIT,
TERM_GROUP_EXIT_ACTIVE
} from '../constants/term-groups';
import {SESSION_REQUEST} from '../constants/sessions';
} from '../../typings/constants/term-groups';
import {SESSION_REQUEST} from '../../typings/constants/sessions';
import findBySession from '../utils/term-groups';
import {getRootGroups} from '../selectors';
import {setActiveSession, ptyExitSession, userExitSession} from './sessions';
Expand Down
2 changes: 1 addition & 1 deletion lib/actions/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
UI_OPEN_SSH_URL,
UI_CONTEXTMENU_OPEN,
UI_COMMAND_EXEC
} from '../constants/ui';
} from '../../typings/constants/ui';

import {setActiveGroup} from './term-groups';
import type parseUrl from 'parse-url';
Expand Down
2 changes: 1 addition & 1 deletion lib/actions/updater.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {UPDATE_INSTALL, UPDATE_AVAILABLE} from '../constants/updater';
import {UPDATE_INSTALL, UPDATE_AVAILABLE} from '../../typings/constants/updater';
import rpc from '../rpc';
import type {HyperActions} from '../../typings/hyper';

Expand Down
2 changes: 1 addition & 1 deletion lib/reducers/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
SESSION_SET_XTERM_TITLE,
SESSION_SET_CWD,
SESSION_SEARCH
} from '../constants/sessions';
} from '../../typings/constants/sessions';
import type {sessionState, session, Mutable, ISessionReducer} from '../../typings/hyper';

const initialState: sessionState = Immutable<Mutable<sessionState>>({
Expand Down
6 changes: 3 additions & 3 deletions lib/reducers/term-groups.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {v4 as uuidv4} from 'uuid';
import type {Immutable as ImmutableType} from 'seamless-immutable';
import Immutable from 'seamless-immutable';
import {TERM_GROUP_EXIT, TERM_GROUP_RESIZE} from '../constants/term-groups';
import type {SessionAddAction} from '../constants/sessions';
import {SESSION_ADD, SESSION_SET_ACTIVE} from '../constants/sessions';
import {TERM_GROUP_EXIT, TERM_GROUP_RESIZE} from '../../typings/constants/term-groups';
import type {SessionAddAction} from '../../typings/constants/sessions';
import {SESSION_ADD, SESSION_SET_ACTIVE} from '../../typings/constants/sessions';
import findBySession from '../utils/term-groups';
import {decorateTermGroupsReducer} from '../utils/plugins';
import type {ITermGroup, ITermState, ITermGroups, ITermGroupReducer, Mutable} from '../../typings/hyper';
Expand Down
10 changes: 5 additions & 5 deletions lib/reducers/ui.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {Immutable as ImmutableType} from 'seamless-immutable';
import Immutable from 'seamless-immutable';
import {decorateUIReducer} from '../utils/plugins';
import {CONFIG_LOAD, CONFIG_RELOAD} from '../constants/config';
import {CONFIG_LOAD, CONFIG_RELOAD} from '../../typings/constants/config';
import {
UI_FONT_SIZE_SET,
UI_FONT_SIZE_RESET,
Expand All @@ -11,17 +11,17 @@ import {
UI_WINDOW_GEOMETRY_CHANGED,
UI_ENTER_FULLSCREEN,
UI_LEAVE_FULLSCREEN
} from '../constants/ui';
import {NOTIFICATION_MESSAGE, NOTIFICATION_DISMISS} from '../constants/notifications';
} from '../../typings/constants/ui';
import {NOTIFICATION_MESSAGE, NOTIFICATION_DISMISS} from '../../typings/constants/notifications';
import {
SESSION_ADD,
SESSION_RESIZE,
SESSION_PTY_DATA,
SESSION_PTY_EXIT,
SESSION_SET_ACTIVE,
SESSION_SET_CWD
} from '../constants/sessions';
import {UPDATE_AVAILABLE} from '../constants/updater';
} from '../../typings/constants/sessions';
import {UPDATE_AVAILABLE} from '../../typings/constants/updater';
import type {uiState, Mutable, IUiReducer} from '../../typings/hyper';
import {release} from 'os';

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"./lib/",
"./test/",
"./cli/",
"./typings"
"./typings/"
],
"references": [
{
Expand Down
2 changes: 1 addition & 1 deletion lib/constants/config.ts → typings/constants/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type {configOptions} from '../../typings/config';
import type {configOptions} from '../config';

export const CONFIG_LOAD = 'CONFIG_LOAD';
export const CONFIG_RELOAD = 'CONFIG_RELOAD';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ export const TERM_GROUP_REQUEST = 'TERM_GROUP_REQUEST';
export const TERM_GROUP_EXIT = 'TERM_GROUP_EXIT';
export const TERM_GROUP_RESIZE = 'TERM_GROUP_RESIZE';
export const TERM_GROUP_EXIT_ACTIVE = 'TERM_GROUP_EXIT_ACTIVE';
export const DIRECTION = {
HORIZONTAL: 'HORIZONTAL',
VERTICAL: 'VERTICAL'
} as const;
export enum DIRECTION {
HORIZONTAL = 'HORIZONTAL',
VERTICAL = 'VERTICAL'
}

export interface TermGroupRequestAction {
type: typeof TERM_GROUP_REQUEST;
Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions typings/hyper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ export type HyperState = {
termGroups: ITermState;
};

import type {UIActions} from '../lib/constants/ui';
import type {ConfigActions} from '../lib/constants/config';
import type {SessionActions} from '../lib/constants/sessions';
import type {NotificationActions} from '../lib/constants/notifications';
import type {UpdateActions} from '../lib/constants/updater';
import type {TermGroupActions} from '../lib/constants/term-groups';
import type {InitActions} from '../lib/constants';
import type {TabActions} from '../lib/constants/tabs';
import type {UIActions} from './constants/ui';
import type {ConfigActions} from './constants/config';
import type {SessionActions} from './constants/sessions';
import type {NotificationActions} from './constants/notifications';
import type {UpdateActions} from './constants/updater';
import type {TermGroupActions} from './constants/term-groups';
import type {InitActions} from './constants';
import type {TabActions} from './constants/tabs';

export type HyperActions = (
| UIActions
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const config: webpack.Configuration[] = [
mode: 'none',
name: 'hyper',
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx']
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts']
},
devtool: isProd ? 'hidden-source-map' : 'cheap-module-source-map',
entry: './lib/index.tsx',
Expand Down
Loading