Skip to content

Commit

Permalink
Chore/dedupe packages (#905)
Browse files Browse the repository at this point in the history
* chore: update typescript

* chore: fix linting

* build: create changeset
  • Loading branch information
odinr authored May 28, 2023
1 parent 64968c4 commit a7858a1
Show file tree
Hide file tree
Showing 36 changed files with 84 additions and 52 deletions.
36 changes: 36 additions & 0 deletions .changeset/stale-pigs-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
"@equinor/fusion-framework-app": patch
"@equinor/fusion-framework-cli": patch
"@equinor/fusion-framework": patch
"@equinor/fusion-framework-module-ag-grid": patch
"@equinor/fusion-framework-module-app": patch
"@equinor/fusion-framework-module-context": patch
"@equinor/fusion-framework-module-http": patch
"@equinor/fusion-framework-module": patch
"@equinor/fusion-framework-module-msal": patch
"@equinor/fusion-framework-module-navigation": patch
"@equinor/fusion-framework-module-service-discovery": patch
"@equinor/fusion-framework-module-telemetry": patch
"@equinor/fusion-framework-module-widget": patch
"@equinor/fusion-framework-react-app": patch
"@equinor/fusion-framework-react-components-bookmark": patch
"@equinor/fusion-framework-react": patch
"@equinor/fusion-framework-legacy-interopt": patch
"@equinor/fusion-framework-react-module-bookmark": patch
"@equinor/fusion-framework-react-module-context": patch
"@equinor/fusion-framework-react-module-event": patch
"@equinor/fusion-framework-react-module-http": patch
"@equinor/fusion-framework-react-module": patch
"@equinor/fusion-framework-cookbook-app-react-bookmark-advanced": patch
"@equinor/fusion-framework-cookbook-app-react-bookmark": patch
"@equinor/fusion-framework-cookbook-app-react": patch
---

__🚧 Chore: dedupe packages__

- align all versions of typescript
- update types to build
- a couple of typecasts did not [satisfies](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#satisfies-support-in-jsdoc) and was recasted as `unknwon`, marked with `TODO`, should be fixed in future
- added missing [exhausted-deps](https://legacy.reactjs.org/docs/hooks-rules.html), this might cause rerender, since `ReactRouterDom.createBrowserHistory` might create history dynamicly.
- this should be tested in portal when updating the `@equinor/fusion-framework-legacy-interopt`
- https://github.com/equinor/fusion-framework/blob/7c0a475174f61ba02570614c237d5cfb3b009cb1/packages/react/legacy-interopt/src/create-legacy-render.tsx#L59
6 changes: 1 addition & 5 deletions cookbooks/app-react-bookmark-advanced/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import Router from './Router';

export const App = () => {
return (
<Router />
);
};
export const App = () => <Router />;

export default App;
4 changes: 1 addition & 3 deletions cookbooks/app-react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
export const App = () => (
<h1>🚀 Hello Fusion😎</h1>
);
export const App = () => <h1>🚀 Hello Fusion😎</h1>;

export default App;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
},
"scripts": {
"bootstrap": "lerna bootstrap",
"clean": "yarn run clean:npm && yarn run clean:build",
"clean:npm": "rm -rf node_modules && npx lerna exec 'rm -rf node_modules'",
"clean": "yarn run clean:build && yarn run clean:npm",
"clean:npm": "npx lerna exec 'rm -rf node_modules' && rm -rf node_modules",
"clean:build": "npx lerna exec 'rm -rf dist'",
"build": "lerna run build",
"build:affected": "nx run-many --target=build --all",
Expand Down Expand Up @@ -73,7 +73,7 @@
"@typescript-eslint/eslint-plugin": "^5.49.0",
"eslint": "^8.33.0",
"eslint-plugin-rxjs": "^5.0.2",
"lerna": "^6.4.1",
"lerna": "^6.6.2",
"nx": "16.2.2",
"prettier": "^2.8.3",
"tslib": "^2.5.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
"@equinor/fusion-framework-module-msal": "^3.0.2"
},
"devDependencies": {
"typescript": "^4.9.3"
"typescript": "^5.0.4"
}
}
3 changes: 2 additions & 1 deletion packages/app/src/configure-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export const configureModules =
}
const modules = (await configurator.initialize(
args.fusion.modules
)) as AppModulesInstance<TModules>;
// TODO
)) as unknown as AppModulesInstance<TModules>;

// @eikeland
// TODO - remove check after fusion-cli is updated (app module is not enabled in fusion-cli)
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,6 @@
"react-dom": "^18.2.0",
"react-router-dom": "^6.9.0",
"styled-components": "^5.3.9",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
}
}
2 changes: 1 addition & 1 deletion packages/framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"rxjs": "^7.5.7"
},
"devDependencies": {
"typescript": "^4.9.3"
"typescript": "^5.0.4"
}
}
2 changes: 1 addition & 1 deletion packages/modules/ag-grid/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"devDependencies": {
"@equinor/fusion-framework-module": "^4.1.0",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@equinor/fusion-framework-module": ">=1.2.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@
"@equinor/fusion-framework-module-event": "^4.0.1",
"@equinor/fusion-framework-module-http": "^5.0.2",
"@equinor/fusion-framework-module-service-discovery": "^7.0.3",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
}
}
1 change: 1 addition & 0 deletions packages/modules/app/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type ModuleDeps = [HttpModule, ServiceDiscoveryModule, EventModule];

export type AppType = 'standalone' | 'report' | 'launcher';

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type CurrentApp<TModules extends Array<AnyModule> = [], TEnv = any> =
| App<TEnv, TModules>
| null
Expand Down
12 changes: 5 additions & 7 deletions packages/modules/context/src/configurator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,11 @@ export interface ContextModuleConfig {
item: ContextItem | null
) => ReturnType<IContextProvider['validateContext']>;

resolveInitialContext?: (
args: {
ref?: AnyModuleInstance | any;
modules: ModuleInstance;
}
// ...args: Parameters<ContextModule['postInitialize']>
) => ObservableInput<ContextItem | void>;
resolveInitialContext?: (args: {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
ref?: AnyModuleInstance | any;
modules: ModuleInstance;
}) => ObservableInput<ContextItem | void>;
}

export interface IContextModuleConfigurator {
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
"rxjs": "^7.5.7"
},
"devDependencies": {
"typescript": "^4.9.3"
"typescript": "^5.0.4"
}
}
2 changes: 1 addition & 1 deletion packages/modules/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"semver": "^7.5.0"
},
"devDependencies": {
"typescript": "^4.9.3"
"typescript": "^5.0.4"
}
}
2 changes: 1 addition & 1 deletion packages/modules/msal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@
"@equinor/fusion-framework-module": "^4.1.0"
},
"devDependencies": {
"typescript": "^4.9.3"
"typescript": "^5.0.4"
}
}
2 changes: 1 addition & 1 deletion packages/modules/navigation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"devDependencies": {
"@equinor/fusion-framework-module": "^4.1.0",
"rxjs": "^7.5.7",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@equinor/fusion-framework-module": ">=1.2.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/service-discovery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"rxjs": "^7.5.7"
},
"devDependencies": {
"typescript": "^4.9.3"
"typescript": "^5.0.4"
}
}
2 changes: 1 addition & 1 deletion packages/modules/telemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
"@microsoft/applicationinsights-web": "^2.7.2"
},
"devDependencies": {
"typescript": "^4.9.3"
"typescript": "^5.0.4"
}
}
2 changes: 1 addition & 1 deletion packages/modules/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
"@equinor/fusion-framework-module": "^4.1.0",
"@equinor/fusion-framework-module-event": "^4.0.1",
"@equinor/fusion-framework-module-service-discovery": "^7.0.3",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
}
}
2 changes: 1 addition & 1 deletion packages/react/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@types/react-dom": "^17.0.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@types/react": "^17.0.0 || ^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/components/bookmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"styled-components": "^5.3.9",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@emotion/css": "^11.10.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ export const MoreMenu = ({ pRef, onClose, open, options }: MenuProps) => {
}}
key={name}
>
{Icon && Icon}
{name}
<>
{Icon && Icon}
{name}
</>
</Menu.Item>
))}
</Menu>
Expand Down
2 changes: 1 addition & 1 deletion packages/react/framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@types/react-dom": "^17.0.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@equinor/fusion-framework-react-module-signalr": "*",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/legacy-interopt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"react": "^17.0.2",
"react-router-dom": "^5",
"rxjs": "^7.5.7",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@equinor/fusion": "*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { lazy } from 'react';
import type { ReactNode } from 'react';

import { FusionContext } from '@equinor/fusion';

Expand All @@ -12,7 +11,7 @@ export const createLegacyContextComponent = (props: Parameters<typeof createFusi
props.framework ??= window.Fusion as PortalFramework;
const fusionContext = await createFusionContext(props);
return {
default: ({ children }: { children?: ReactNode }) => (
default: ({ children }: { children?: JSX.Element }) => (
<FusionContext.Provider value={fusionContext}>{children}</FusionContext.Provider>
),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const AppWrapper = (
break;
}
});
}, [appKey, framework]);
}, [appKey, basename, framework, history]);
return (
<HistoryContext.Provider value={{ history }}>
<Router key={appKey} history={history}>
Expand Down
2 changes: 1 addition & 1 deletion packages/react/modules/bookmark/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"rxjs": "^7.5.7",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@types/react": "^17.0.0 || ^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/modules/context/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@types/react-dom": "^17.0.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@types/react": "^17.0.0 || ^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/modules/event/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@types/react-dom": "^17.0.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@types/react": "^17.0.0 || ^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/modules/http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@types/react-dom": "^17.0.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@equinor/fusion-framework-module-http": ">=1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/modules/module/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@types/react-dom": "^17.0.7",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@types/react": "^17.0.0 || ^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/observable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@types/react": "^17.0.2",
"@types/uuid": "^8.3.4",
"react": "^17.0.2",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@types/react": "^17.0.0 || ^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/query/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@types/react": "^17.0.2",
"@types/uuid": "^8.3.4",
"react": "^17.0.2",
"typescript": "^4.9.3"
"typescript": "^5.0.4"
},
"peerDependencies": {
"@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/widget/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@
"@equinor/fusion-framework-module-widget": "^1.0.3"
},
"devDependencies": {
"typescript": "^4.9.3"
"typescript": "^5.0.4"
}
}
3 changes: 2 additions & 1 deletion packages/widget/src/configure-widget-modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ export const configureWidgetModules =
}
const modules = (await configurator.initialize(
args.fusion.modules
)) as WidgetModulesInstance<TModules>;
// TODO
)) as unknown as WidgetModulesInstance<TModules>;

// TODO - fire event when widget is loaded
// if (args.env.manifest?.key) {
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7562,7 +7562,7 @@ lerna-update-wizard@^1.1.2:
normalize-path "^3.0.0"
semver-compare "^1.0.0"

lerna@^6.4.1:
lerna@^6.6.2:
version "6.6.2"
resolved "https://registry.yarnpkg.com/lerna/-/lerna-6.6.2.tgz#ad921f913aca4e7307123a598768b6f15ca5804f"
integrity sha512-W4qrGhcdutkRdHEaDf9eqp7u4JvI+1TwFy5woX6OI8WPe4PYBdxuILAsvhp614fUG41rKSGDKlOh+AWzdSidTg==
Expand Down Expand Up @@ -11166,12 +11166,12 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==

"typescript@^3 || ^4", typescript@^4.9.3, typescript@^4.9.4:
"typescript@^3 || ^4", typescript@^4.9.4:
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==

"typescript@^4.6.4 || ^5.0.0":
"typescript@^4.6.4 || ^5.0.0", typescript@^5.0.4:
version "5.0.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==
Expand Down

0 comments on commit a7858a1

Please sign in to comment.