@grasp-labs/ds-microfrontends-integration 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,9 @@
1
- import { Schema } from 'src/types/Schema';
2
- export declare function createTestSchema(schema: Pick<Schema, "type"> & Partial<Schema>): Schema;
1
+ import { Schema } from '../../types';
2
+ type SchemaType = Pick<Schema, "type">;
3
+ type ExtendedSchemaType = SchemaType["type"] | "ref" | string[];
4
+ export declare function createTestSchema(schema: Omit<Schema, "type"> & {
5
+ type: ExtendedSchemaType;
6
+ }): Schema & {
7
+ type: ExtendedSchemaType;
8
+ };
9
+ export {};
@@ -1,39 +1,38 @@
1
1
  import { IconName } from '@grasp-labs/ds-react-components';
2
2
  import { ModuleFederationOptions } from '@module-federation/vite/lib/utils/normalizeModuleFederationOptions';
3
- /**
4
- * @deprecated Use @grasp-labs/ds-web-microfrontends-common-lib instead
5
- */
6
- export type RouteConfig = {
3
+ export type BaseItem = {
4
+ /**
5
+ * Display label used as fallback when translation is not available
6
+ */
7
7
  label: string;
8
+ /**
9
+ * Translation key for internationalization.
10
+ * Must be placed in 'navigation' translation namespace in the host application for it to work.
11
+ */
12
+ labelKey: string;
13
+ icon: IconName;
14
+ };
15
+ export type RouteConfig = BaseItem & {
8
16
  path: string;
9
- icon?: IconName;
10
17
  type?: "hidden" | "visible";
11
18
  };
19
+ export type CategoryConfig = BaseItem & {
20
+ type: "category";
21
+ children: Record<string, RouteConfig | CategoryConfig>;
22
+ };
23
+ export type NavigationItem = RouteConfig | CategoryConfig;
12
24
  /**
13
25
  * INDEX is a mandatory route representing the root of the microfrontend, used as the parent navigation item in the sidebar
14
- * @deprecated Use @grasp-labs/ds-web-microfrontends-common-lib instead
15
26
  */
16
27
  export type IndexNavigationConfig = {
17
28
  INDEX: RouteConfig;
18
29
  };
19
- /**
20
- * @deprecated Use @grasp-labs/ds-web-microfrontends-common-lib instead
21
- */
22
- export type NavigationConfig<TKeys extends string = string> = IndexNavigationConfig & Record<TKeys, RouteConfig>;
23
- /**
24
- * @deprecated Use @grasp-labs/ds-web-microfrontends-common-lib instead
25
- */
30
+ export type NavigationConfig<TKeys extends string = string> = IndexNavigationConfig & Record<TKeys, NavigationItem>;
26
31
  export type MicrofrontendExposes = {
27
32
  ".": string;
28
33
  "./navigationConfig": string;
29
34
  } & Record<string, string>;
30
- /**
31
- * @deprecated Use @grasp-labs/ds-web-microfrontends-common-lib instead
32
- */
33
35
  export declare const createModuleFederationConfig: (name: string, overrides?: Partial<ModuleFederationOptions>) => ModuleFederationOptions;
34
- /**
35
- * @deprecated Use @grasp-labs/ds-web-microfrontends-common-lib instead
36
- */
37
36
  export declare const COMMON_SHARED_DEPS: {
38
37
  react: {
39
38
  singleton: boolean;
@@ -51,22 +50,12 @@ export declare const COMMON_SHARED_DEPS: {
51
50
  singleton: boolean;
52
51
  requiredVersion: string;
53
52
  };
54
- axios: {
55
- singleton: boolean;
56
- requiredVersion: string;
57
- };
58
53
  };
59
- /**
60
- * @deprecated Use @grasp-labs/ds-web-microfrontends-common-lib instead
61
- */
62
54
  export declare const createMicrofrontendsBase: (name: string) => string;
63
55
  /**
64
- * @deprecated This file is deprecated and will be removed in a future release.
65
- * Please use @grasp-labs/ds-web-microfrontends-common-lib package instead.
66
- * All exports from this file are now available in the external package.
67
- *
68
- * Migration guide:
69
- * - Replace imports from './mf-common' with '@grasp-labs/ds-web-microfrontends-common-lib'
70
- * - Install the package: npm install @grasp-labs/ds-web-microfrontends-common-lib
56
+ * Creates a configured Vite Module Federation plugin for Data Science microfrontends
57
+ * @param name - The name of the microfrontend
58
+ * @param overrides - Optional overrides for the Module Federation configuration
59
+ * @returns Configured Vite plugin
71
60
  */
72
61
  export declare const dsFederation: (name: string, overrides?: Partial<ModuleFederationOptions>) => import('vite').Plugin<any>[];
package/dist/mf-common.js CHANGED
@@ -1,47 +1,46 @@
1
- import { federation as t } from "@module-federation/vite";
2
- const o = (e, r = {}) => {
3
- const n = s(e);
1
+ import { federation as o } from "@module-federation/vite";
2
+ const s = "0.15.0", i = { react: "19.2.3", "react-dom": "19.2.3", "react-router": "7.8.2" }, r = {
3
+ version: s,
4
+ peerDependencies: i
5
+ }, c = (e, n = {}) => {
6
+ const t = d(e);
4
7
  return {
5
8
  name: e,
6
9
  manifest: !0,
7
10
  filename: "remoteEntry.js",
8
- getPublicPath: `function() {return "${n}"}`,
11
+ getPublicPath: `function() {return "${t}"}`,
9
12
  exposes: {
10
13
  ".": "./src/App",
11
14
  "./navigationConfig": "./src/navigationConfig"
12
15
  },
13
16
  shared: {
14
- ...i
17
+ ...a
15
18
  },
16
- ...r
19
+ ...n
17
20
  };
18
- }, i = {
21
+ }, a = {
19
22
  react: {
20
23
  singleton: !0,
21
- requiredVersion: "^19.1.0"
24
+ requiredVersion: r.peerDependencies.react
22
25
  },
23
26
  "react-dom": {
24
27
  singleton: !0,
25
- requiredVersion: "^19.1.0"
28
+ requiredVersion: r.peerDependencies["react-dom"]
26
29
  },
27
30
  "react-router": {
28
31
  singleton: !0,
29
- requiredVersion: "^7.8.2"
32
+ requiredVersion: r.peerDependencies["react-router"]
30
33
  },
31
34
  "@grasp-labs/ds-microfrontends-integration": {
32
35
  singleton: !0,
33
- requiredVersion: ">=0.4.0 <1.0.0"
34
- },
35
- axios: {
36
- singleton: !0,
37
- requiredVersion: "^1.7.9"
36
+ requiredVersion: r.version
38
37
  }
39
- }, s = (e) => `microfrontends/${e}/`, c = (e, r = {}) => t({
40
- ...o(e, r)
38
+ }, d = (e) => `microfrontends/${e}/`, p = (e, n = {}) => o({
39
+ ...c(e, n)
41
40
  });
42
41
  export {
43
- i as COMMON_SHARED_DEPS,
44
- s as createMicrofrontendsBase,
45
- o as createModuleFederationConfig,
46
- c as dsFederation
42
+ a as COMMON_SHARED_DEPS,
43
+ d as createMicrofrontendsBase,
44
+ c as createModuleFederationConfig,
45
+ p as dsFederation
47
46
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grasp-labs/ds-microfrontends-integration",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "sideEffects": false,
34
34
  "scripts": {
35
- "build": "tsc && vite build",
35
+ "build": "tsc -p tsconfig.app.json && vite build",
36
36
  "lint": "eslint .",
37
37
  "lint:fix": "eslint . --fix",
38
38
  "dev": "npm run build -- --watch",