@grasp-labs/ds-microfrontends-integration 0.14.1 → 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,4 +1,4 @@
1
- import { c as o } from "./index-DFqk0a9d.js";
1
+ import { c as o } from "./index-p4MWsN-O.js";
2
2
  import { useState as J, useEffect as De, createContext as Zt, useRef as ce, useContext as Gt, useMemo as le, useCallback as Re } from "react";
3
3
  const $e = (e, t, n, r, a) => {
4
4
  if (!r) throw new Error(a ?? `Invalid property path: ${t}
package/dist/index.js CHANGED
@@ -1,35 +1,38 @@
1
- import { A as s, B as l, E as t, F as i, J as r, L as u, N as d, S as o, T as F, a as g, V as n, e as m, f as c, b as V, g as p, q as h, t as S, j as v, k as b, s as T, l as f, h as y, w as D, m as E, n as L, o as P, p as x, v as A, r as I, i as N, u as j, d as B } from "./index-DFqk0a9d.js";
1
+ import { A as s, B as l, E as r, F as t, G as u, J as i, L as o, N as d, R as F, S as g, T as n, b as m, V as c, h as p, i as V, e as h, j as v, s as S, v as b, k as P, l as T, t as f, m as x, g as y, x as D, n as E, o as G, p as L, q as R, w as A, r as I, u as N, a as j, d as B, f as J } from "./index-p4MWsN-O.js";
2
2
  export {
3
3
  s as ArrayField,
4
4
  l as BooleanField,
5
- t as EnumField,
6
- i as FieldError,
7
- r as JsonField,
8
- u as LanguageProvider,
5
+ r as EnumField,
6
+ t as FieldError,
7
+ u as GroupsProvider,
8
+ i as JsonField,
9
+ o as LanguageProvider,
9
10
  d as NumberField,
10
- o as SchemaFields,
11
- F as TextField,
12
- g as ToastProvider,
13
- n as VaultField,
14
- m as VaultInput,
15
- c as VaultInputField,
16
- V as VaultProvider,
17
- p as VaultSecretDialog,
18
- h as buildDefaultValues,
19
- S as createFieldDescriptor,
20
- v as extractConstraints,
21
- b as getArrayItemsSchema,
22
- T as getDefaultValue,
23
- f as getFieldType,
11
+ F as RouteGuard,
12
+ g as SchemaFields,
13
+ n as TextField,
14
+ m as ToastProvider,
15
+ c as VaultField,
16
+ p as VaultInput,
17
+ V as VaultInputField,
18
+ h as VaultProvider,
19
+ v as VaultSecretDialog,
20
+ S as buildDefaultValues,
21
+ b as createFieldDescriptor,
22
+ P as extractConstraints,
23
+ T as getArrayItemsSchema,
24
+ f as getDefaultValue,
25
+ x as getFieldType,
24
26
  y as getLanguage,
25
27
  D as getSchemaResolver,
26
28
  E as isEnumField,
27
- L as isNullable,
28
- P as isObjectWithoutProperties,
29
- x as isReadOnly,
29
+ G as isNullable,
30
+ L as isObjectWithoutProperties,
31
+ R as isReadOnly,
30
32
  A as parseSchemaFields,
31
33
  I as resolveSchema,
32
- N as useLanguage,
33
- j as useToast,
34
- B as useVault
34
+ N as useGroups,
35
+ j as useLanguage,
36
+ B as useToast,
37
+ J as useVault
35
38
  };
@@ -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,45 +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
- shared: { ...i },
14
- ...r
16
+ shared: {
17
+ ...a
18
+ },
19
+ ...n
15
20
  };
16
- }, i = {
21
+ }, a = {
17
22
  react: {
18
23
  singleton: !0,
19
- requiredVersion: "^19.1.0"
24
+ requiredVersion: r.peerDependencies.react
20
25
  },
21
26
  "react-dom": {
22
27
  singleton: !0,
23
- requiredVersion: "^19.1.0"
28
+ requiredVersion: r.peerDependencies["react-dom"]
24
29
  },
25
30
  "react-router": {
26
31
  singleton: !0,
27
- requiredVersion: "^7.8.2"
32
+ requiredVersion: r.peerDependencies["react-router"]
28
33
  },
29
34
  "@grasp-labs/ds-microfrontends-integration": {
30
35
  singleton: !0,
31
- requiredVersion: ">=0.4.0 <1.0.0"
32
- },
33
- axios: {
34
- singleton: !0,
35
- requiredVersion: "^1.7.9"
36
+ requiredVersion: r.version
36
37
  }
37
- }, s = (e) => `microfrontends/${e}/`, c = (e, r = {}) => t({
38
- ...o(e, r)
38
+ }, d = (e) => `microfrontends/${e}/`, p = (e, n = {}) => o({
39
+ ...c(e, n)
39
40
  });
40
41
  export {
41
- i as COMMON_SHARED_DEPS,
42
- s as createMicrofrontendsBase,
43
- o as createModuleFederationConfig,
44
- c as dsFederation
42
+ a as COMMON_SHARED_DEPS,
43
+ d as createMicrofrontendsBase,
44
+ c as createModuleFederationConfig,
45
+ p as dsFederation
45
46
  };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Represents a user group in the system.
3
+ */
4
+ export type Group = {
5
+ id: string;
6
+ name: string;
7
+ tenant_id: string;
8
+ description: string | null;
9
+ };
@@ -1,3 +1,4 @@
1
1
  export * from './Schema';
2
2
  export * from './Translation';
3
3
  export * from './Vault';
4
+ export * from './Groups';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grasp-labs/ds-microfrontends-integration",
3
- "version": "0.14.1",
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",
@@ -76,6 +76,7 @@
76
76
  "@types/react-dom": "^19.1.7",
77
77
  "@vitejs/plugin-react": "^5.1.2",
78
78
  "@vitest/coverage-v8": "^4.0.16",
79
+ "babel-plugin-react-compiler": "^1.0.0",
79
80
  "eslint": "^9.32.0",
80
81
  "eslint-config-prettier": "^10.1.8",
81
82
  "eslint-plugin-prettier": "^5.5.3",