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
893 changes: 0 additions & 893 deletions .yarn/releases/yarn-4.1.0.cjs

This file was deleted.

1,000 changes: 1,000 additions & 0 deletions .yarn/releases/yarn-4.18.0.cjs

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
approvedGitRepositories:
- "https://github.com/alexstrat/content-disposition.git"
- "https://github.com/tj/react-click-outside.git"

enableScripts: true

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.1.0.cjs
npmMinimalAgeGate: 0

yarnPath: .yarn/releases/yarn-4.18.0.cjs
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"volta": {
"node": "24.19.0",
"yarn": "4.1.0"
"yarn": "4.18.0"
},
"packageManager": "yarn@4.1.0"
"packageManager": "yarn@4.18.0"
}
2 changes: 1 addition & 1 deletion packages/app/manifests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function allApplicationsDictionary(): Record<string, Manifest> {
return ids.reduce((acc, id) => {
acc[id] = getApplicationById(id);
return acc;
}, {});
}, {} as Record<string, Manifest>);
}

export function listMostPopularApplications(): PopularApps {
Expand Down
46 changes: 34 additions & 12 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
},
"dependencies": {
"1password-node": "^3.0.0",
"@babel/plugin-proposal-decorators": "^7.4.4",
"@babel/runtime": "^7.4.3",
"@electron/remote": "^2.1.3",
"@getstation/apollo-link-reactive-schema": "^1.0.0",
Expand Down Expand Up @@ -193,6 +192,7 @@
"devDependencies": {
"@babel/core": "^7.7.7",
"@babel/plugin-proposal-class-properties": "^7.4.0",
"@babel/plugin-proposal-decorators": "^7.4.4",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-transform-runtime": "^7.4.3",
"@babel/preset-env": "^7.7.1",
Expand All @@ -217,6 +217,8 @@
"@storybook/addon-viewport": "4",
"@storybook/addons": "4",
"@storybook/react": "4",
"@swc/core": "^1.16.1",
"@swc/jest": "^0.2.39",
"@types/array-uniq": "^1.0.1",
"@types/async-lock": "^0.0.21",
"@types/bluebird": "^3.5.26",
Expand Down Expand Up @@ -276,6 +278,7 @@
"@types/yargs": "^13.0.2",
"apollo-storybook-react": "^0.2.1",
"babel-eslint": "^8.2.3",
"babel-jest": "^26.6.3",
"babel-loader": "^8.0.6",
"babel-plugin-dynamic-import-node": "^2.2.0",
"chai": "^4.2.0",
Expand Down Expand Up @@ -323,19 +326,18 @@
"remote-redux-devtools": "0.5.0",
"replace-in-file": "^4.1.3",
"rimraf": "^5.0.10",
"sass": ">=1.34.1 <1.100.0",
"sass": "^1.103.1",
"simple-git": "^1.107.0",
"sinon": "^7.1.1",
"style-loader": "^0.23.1",
"terser-webpack-plugin": "^4.2.3",
"tmp": "0.0.31",
"ts-jest": "^26.5.6",
"ts-loader": "^6.2.1",
"ts-node": "^8.1.0",
"tslint": "^5.11.0",
"tslint-config-station": "^0.6.0",
"tslint-react": "^3.6.0",
"typescript": "^4.9.5",
"typescript": "^5.9.3",
"webpack": "^4.46.0",
"webpack-cli": "^3.3.12",
"webpack-merge": "^4.2.2",
Expand All @@ -346,9 +348,34 @@
"jest": {
"runner": "@jest-runner/electron/main",
"testEnvironment": "node",
"preset": "ts-jest/presets/js-with-babel",
"transform": {
"^.+\\.svg$": "jest-svg-transformer"
"^.+\\.svg$": "jest-svg-transformer",
"^.+\\.tsx?$": [
"@swc/jest",
{
"jsc": {
"target": "es2016",
"parser": {
"syntax": "typescript",
"tsx": true,
"decorators": true
},
"transform": {
"legacyDecorator": true,
"decoratorMetadata": true,
"useDefineForClassFields": false,
"react": {
"runtime": "classic"
}
}
},
"module": {
"type": "commonjs",
"noInterop": true
}
}
],
"^.+\\.jsx?$": "babel-jest"
},
"setupFilesAfterEnv": [
"<rootDir>/test/setup.jest.ts"
Expand All @@ -363,12 +390,7 @@
"json",
"jsx"
],
"testURL": "http://localhost/",
"globals": {
"ts-jest": {
"isolatedModules": true
}
}
"testURL": "http://localhost/"
},
"electronWebpack": {
"title": false,
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/app/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export const getKeyAboveTab = (state: StationState): string => {
const windowsCommonKeymap = {};
const linuxCommonKeymap = {};

const keymap = { ...appleCommonKeymap, ...windowsCommonKeymap, ...linuxCommonKeymap };
const keymap: Record<string, string> = { ...appleCommonKeymap, ...windowsCommonKeymap, ...linuxCommonKeymap };
return keymap[getKeyboardLayout(state)] || '';
};

Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/applications/components/Application.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface OwnProps {
getIconRef?: boolean,
}

const ApplicationActionButtonIconMap = {
const ApplicationActionButtonIconMap: Record<ApplicationActionType, IconSymbol> = {
[ApplicationActionType.Add]: IconSymbol.PLUS,
[ApplicationActionType.Settings]: IconSymbol.COG,
[ApplicationActionType.Remove]: IconSymbol.CROSS,
Expand Down Expand Up @@ -143,7 +143,7 @@ class ApplicationImpl extends React.PureComponent<Props, {}> {

{actionType &&
<Icon
symbolId={ApplicationActionButtonIconMap[actionType]}
symbolId={ApplicationActionButtonIconMap[actionType as ApplicationActionType]}
size={24}
className={classes!.action}
onClick={this.handleAddApplication}
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/bang/components/BangList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export default class BangList extends React.PureComponent<Props, State> {
collapseSections: this.props.items.reduce((state, item) => {
state[item.sectionName] = { collapsed: true };
return state;
}, {}),
}, {} as CollapseSections),
});
}

Expand All @@ -195,7 +195,7 @@ export default class BangList extends React.PureComponent<Props, State> {
collapseSectionsNewState[item.sectionName] = { collapsed: true };
return collapseSectionsNewState;
},
{},
{} as CollapseSections,
);

this.updateCollapsedSections(nextCollapseSectionsState);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default class ComponentWithPopover extends React.PureComponent<Props, Sta
getChild(indice: number) {
const { children } = this.props;
const { showPopper } = this.state;
const child = children![indice];
const child = (children as any)[indice];

if (typeof child === 'function') {
return child({
Expand Down
26 changes: 16 additions & 10 deletions packages/app/src/common/components/ElectronWebview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,13 @@ class ElectronWebview extends React.Component<ElectronWebviewProps, {}> {
componentDidMount() {
const container = ReactDOM.findDOMNode(this.ref);

const props = this.props as Record<string, any>;

let propString = '';
Object.keys(this.props).forEach((propName) => {
// Waiting for a fix https://github.com/electron/electron/issues/9618
if (this.props[propName] !== undefined && typeof this.props[propName] !== 'function') {
propString += getPropString(propName, this.props[propName]);
if (props[propName] !== undefined && typeof props[propName] !== 'function') {
propString += getPropString(propName, props[propName]);
}
});
if (this.props.className) {
Expand Down Expand Up @@ -265,8 +267,8 @@ class ElectronWebview extends React.Component<ElectronWebviewProps, {}> {
this.ready = true;
events.forEach((event) => {
const propName = camelCase(`on-${event}`);
if (this.props[propName]) {
this.view.addEventListener(event, this.props[propName], false);
if (props[propName]) {
this.view.addEventListener(event, props[propName], false);
}
});
if (this.props.onDidAttach) this.props.onDidAttach(...attachArgs);
Expand All @@ -279,12 +281,13 @@ class ElectronWebview extends React.Component<ElectronWebviewProps, {}> {
this.view.focus();
});

const self = this as Record<string, any>;
methods.forEach((method) => {
if (this[method]) return;
this[method] = (...args: any[]) => {
if (self[method]) return;
self[method] = (...args: any[]) => {
if (!this.ready) return;
try {
return this.view[method](...args);
return (this.view as Record<string, any>)[method](...args);
} catch (e) {
logger.notify(e);
}
Expand Down Expand Up @@ -338,10 +341,13 @@ class ElectronWebview extends React.Component<ElectronWebviewProps, {}> {
}

componentDidUpdate(prevProps: ElectronWebviewProps) {
const props = this.props as Record<string, any>;
const previousProps = prevProps as Record<string, any>;
const self = this as Record<string, any>;
Object.keys(changableProps).forEach((propName) => {
const propValue = this.props[propName];
if (propValue !== prevProps[propName]) {
this[changableProps[propName]](propValue);
const propValue = props[propName];
if (propValue !== previousProps[propName]) {
self[(changableProps as Record<string, any>)[propName]](propValue);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/context-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class ContextMenu extends EventEmitter {

const editFlags = props.editFlags;
const hasText = props.selectionText.trim().length > 0;
const can = (type: string) => editFlags[`can${type}`] && hasText;
const can = (type: string) => (editFlags as Record<string, any>)[`can${type}`] && hasText;

let menuTpl: MenuItemConstructorOptions[] = [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/dock/components/NativeAppDockIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export default class NativeAppDockIcon extends React.PureComponent<Props, State>
if (active) {
return (
<g fill="none" fillRule="evenodd" mask={`url(#${this.maskId})`}>
<rect {...sizeProps[size!]} className={classes!.activeInner} />
<rect {...(sizeProps as Record<string, any>)[size!]} className={classes!.activeInner} />
</g>
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/notification-center/webview-preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class BxNotification extends EventTarget('click', 'error', 'close', 'show

Object.keys(properties).forEach(key => {
Object.defineProperty(this, key, {
value: properties[key],
value: (properties as Record<string, any>)[key],
writable: false,
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default class ConfigurePasswordManager extends React.PureComponent<Props
onCancel,
} = this.props;

const ProviderForm = ProvidersForm[provider.id];
const ProviderForm = (ProvidersForm as Record<string, any>)[provider.id];
const error = configurationProcess.step === ConfigurationStep.Error ? configurationProcess.payload : null;

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export default class OnePasswordForm extends React.PureComponent<Props & Overrid
.reduce((result, [k, v]) => {
result[k] = v;
return result;
}, {});
}, {} as Record<string, any>);
}

// tslint:disable-next-line:function-name
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/persistence/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ async function waitForPromise(backend: SingletonStateProxy<any>) {
const keys = Object.keys(backend);
const a = [];
for (const k of keys) {
a.push([k, await backend[k].get()]);
a.push([k, await (backend as Record<string, any>)[k].get()]);
}
return a;
}

export const getInitialState = async (backendKey: string) => {
await checkSqliteBackend();
await migrateUmzug();
const state = await waitForPromise(backends[backendKey]);
const state = await waitForPromise((backends as Record<string, any>)[backendKey]);
return Immutable.Map(state);
};

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/plugins/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { JAVASCRIPT_INJECTIONS } from '../applications/manifest-provider/const';
export const injectJS = memoize(
async (legacyServiceId: Maybe<string>): Promise<string | undefined> => {
if (!legacyServiceId) return;
const scriptsFiles: string[] = JAVASCRIPT_INJECTIONS[legacyServiceId];
const scriptsFiles: string[] = (JAVASCRIPT_INJECTIONS as Record<string, string[]>)[legacyServiceId];

if (scriptsFiles) {
return scriptsFiles.map(
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/resources/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ const graphQLResolverProxyHandler = (dynamicFetchFn: () => Promise<BxResource>):
get: (obj, prop) => {
if (!(prop in obj)) {
// We can have an async getter here because it is used by GraphQL resolvers
return promiseOnce(newObj => Object.assign(obj, newObj)).then(() => obj[prop]);
return promiseOnce(newObj => Object.assign(obj, newObj)).then(() => (obj as any)[prop]);
}
return obj[prop];
return (obj as any)[prop];
},
};
};
Expand Down
5 changes: 3 additions & 2 deletions packages/app/src/sdk/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Consumer } from '@getstation/sdk';
import { BxSDK } from '.';

export const isActiveConsumer = (namespace: string, manifestURL: string, sdk: BxSDK): boolean => {
return sdk[namespace] &&
sdk[namespace].provider._consumers.map((c: Consumer) => c.id).includes(manifestURL);
const consumer = (sdk as Record<string, any>)[namespace];
return consumer &&
consumer.provider._consumers.map((c: Consumer) => c.id).includes(manifestURL);
};
2 changes: 1 addition & 1 deletion packages/app/src/sdk/search/SearchProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function getSearchResults(loadingCategories: Set<string>,
const allCategories = resultsGroupedByCat.keySeq().toSet().union(Immutable.Set(loadingCategories));
const sectionsMap: Map<string, SearchSection> = new Map();
// @ts-ignore: incomplete Immutable declarations
for (const category: string of allCategories) {
for (const category of allCategories as Iterable<string>) {
sectionsMap.set(category, {
sectionName: category,
loading: loadingCategories.has(category),
Expand Down
1 change: 1 addition & 0 deletions packages/app/src/services/lib/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export class ServicePeerHandler {
const requestMethod = getRequestMethod(peer, methodInfos, this);
d('defining a new request', methodInfos.type, methodInfos.getId());
Object.defineProperty(srvc, methodName, {
// tslint:disable-next-line:only-arrow-functions
value: function (this: ServiceBase, ...params: any[]) {
try {
return requestMethod(...params);
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/services/lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ export const observer = <T>(object: T, prefix?: string): RPC.Node<T> & ServiceBa
};

export const serviceFullURI = (srvc: ServiceBase) => {
return `${srvc.constructor[namespace]}:${srvc.uuid}`;
return `${(srvc.constructor as any)[namespace]}:${srvc.uuid}`;
};
4 changes: 2 additions & 2 deletions packages/app/src/services/services/tab-webcontents/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export const addOnNavigateObserver = (wc: Electron.WebContents, obs: RPC.Observe
);
return allEvents.subscribe(() => {
obs.onNavigate!({
canGoBack: wc.canGoBack(),
canGoForward: wc.canGoForward(),
canGoBack: wc.navigationHistory.canGoBack(),
canGoForward: wc.navigationHistory.canGoForward(),
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/services/servicesManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function mapObject(...args: any[]): any {
const services: GlobalServices = {} as any;
const [initializer, handler] = args;
for (const key of Object.keys(initializer)) {
services[key] = handler ? initializer[key](handler) : initializer[key]();
(services as Record<string, any>)[key] = handler ? initializer[key](handler) : initializer[key]();
}
return services;
}
Expand Down
Loading
Loading