@atlaskit/forge-react-types 0.59.0 → 0.61.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.
Files changed (45) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +10 -0
  3. package/dist/cjs/components/global/__generated__/GlobalExpandableMenuItemProps.codegen.js +1 -0
  4. package/dist/cjs/components/global/__generated__/GlobalLinkMenuItemProps.codegen.js +1 -0
  5. package/dist/cjs/components/global/__generated__/GlobalMainProps.codegen.js +5 -0
  6. package/dist/cjs/components/global/__generated__/GlobalProps.codegen.js +5 -0
  7. package/dist/cjs/components/global/__generated__/GlobalSidebarProps.codegen.js +5 -0
  8. package/dist/cjs/components/global/__generated__/index.js +1 -0
  9. package/dist/es2019/components/global/__generated__/GlobalExpandableMenuItemProps.codegen.js +0 -0
  10. package/dist/es2019/components/global/__generated__/GlobalLinkMenuItemProps.codegen.js +0 -0
  11. package/dist/es2019/components/global/__generated__/GlobalMainProps.codegen.js +1 -0
  12. package/dist/es2019/components/global/__generated__/GlobalProps.codegen.js +1 -0
  13. package/dist/es2019/components/global/__generated__/GlobalSidebarProps.codegen.js +1 -0
  14. package/dist/es2019/components/global/__generated__/index.js +0 -0
  15. package/dist/esm/components/global/__generated__/GlobalExpandableMenuItemProps.codegen.js +0 -0
  16. package/dist/esm/components/global/__generated__/GlobalLinkMenuItemProps.codegen.js +0 -0
  17. package/dist/esm/components/global/__generated__/GlobalMainProps.codegen.js +1 -0
  18. package/dist/esm/components/global/__generated__/GlobalProps.codegen.js +1 -0
  19. package/dist/esm/components/global/__generated__/GlobalSidebarProps.codegen.js +1 -0
  20. package/dist/esm/components/global/__generated__/index.js +0 -0
  21. package/dist/types/components/global/__generated__/GlobalExpandableMenuItemProps.codegen.d.ts +17 -0
  22. package/dist/types/components/global/__generated__/GlobalLinkMenuItemProps.codegen.d.ts +21 -0
  23. package/dist/types/components/global/__generated__/GlobalMainProps.codegen.d.ts +15 -0
  24. package/dist/types/components/global/__generated__/GlobalProps.codegen.d.ts +18 -0
  25. package/dist/types/components/global/__generated__/GlobalSidebarProps.codegen.d.ts +23 -0
  26. package/dist/types/components/global/__generated__/index.d.ts +14 -0
  27. package/dist/types/index.d.ts +1 -0
  28. package/dist/types-ts4.5/components/global/__generated__/GlobalExpandableMenuItemProps.codegen.d.ts +17 -0
  29. package/dist/types-ts4.5/components/global/__generated__/GlobalLinkMenuItemProps.codegen.d.ts +21 -0
  30. package/dist/types-ts4.5/components/global/__generated__/GlobalMainProps.codegen.d.ts +15 -0
  31. package/dist/types-ts4.5/components/global/__generated__/GlobalProps.codegen.d.ts +18 -0
  32. package/dist/types-ts4.5/components/global/__generated__/GlobalSidebarProps.codegen.d.ts +23 -0
  33. package/dist/types-ts4.5/components/global/__generated__/index.d.ts +14 -0
  34. package/dist/types-ts4.5/index.d.ts +1 -0
  35. package/package.json +6 -5
  36. package/scripts/codegen/globalComponentPropTypes.ts +363 -0
  37. package/scripts/codegen-global-runner.ts +18 -0
  38. package/scripts/typechecker.ts +1 -1
  39. package/src/components/global/__generated__/GlobalExpandableMenuItemProps.codegen.tsx +20 -0
  40. package/src/components/global/__generated__/GlobalLinkMenuItemProps.codegen.tsx +24 -0
  41. package/src/components/global/__generated__/GlobalMainProps.codegen.tsx +19 -0
  42. package/src/components/global/__generated__/GlobalProps.codegen.tsx +22 -0
  43. package/src/components/global/__generated__/GlobalSidebarProps.codegen.tsx +27 -0
  44. package/src/components/global/__generated__/index.ts +16 -0
  45. package/src/index.ts +13 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/forge-react-types
2
2
 
3
+ ## 0.61.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`50d654b213b1b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/50d654b213b1b) -
8
+ Export types for Global, GlobalMain, GlobalSidebar
9
+
10
+ ## 0.60.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`cc1ec16a6b6f3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cc1ec16a6b6f3) -
15
+ Add type codegen support for global components
16
+ - [`cc1ec16a6b6f3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cc1ec16a6b6f3) -
17
+ Export Global component prop types
18
+
3
19
  ## 0.59.0
4
20
 
5
21
  ### Minor Changes
package/README.md CHANGED
@@ -33,3 +33,13 @@ yarn workspace @atlaskit/forge-react-types codegen Button
33
33
 
34
34
  NOTE: Make sure any new component prop types are being exported from
35
35
  `packages/forge/forge-react-types/src/components/__generated__/index.ts`
36
+
37
+ ### Generating global component types
38
+
39
+ To generate global component types, run the following command:
40
+
41
+ ```bash
42
+ yarn workspace @atlaskit/forge-react-types codegen-global
43
+ ```
44
+
45
+ This will generate the global component types found in `forge-common-app-gateway` package into `/src/components/global/__generated__/index.ts`.
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - GlobalExpandableMenuItem
5
+ *
6
+ * @codegen <<SignedSource::8f9bf63fd0127b4faa2986b9c9257182>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-ExpandableMenuItem.tsx <<SignedSource::79df02babb605094ae73bdd0c00c7156>>
10
+ */
11
+ export type GlobalExpandableMenuItemProps = {
12
+ /**
13
+ * The display label for the expandable menu item.
14
+ */
15
+ label: string;
16
+ };
17
+ export type TGlobalExpandableMenuItem<T> = (props: GlobalExpandableMenuItemProps) => T;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - GlobalLinkMenuItem
5
+ *
6
+ * @codegen <<SignedSource::13f71ea4b4d387e48fef444bd10847f9>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-LinkMenuItem.tsx <<SignedSource::e70effe0d4e0620246252b35abddb112>>
10
+ */
11
+ export type GlobalLinkMenuItemProps = {
12
+ /**
13
+ * The display label for the menu item.
14
+ */
15
+ label: string;
16
+ /**
17
+ * The URL path to navigate to when clicked.
18
+ */
19
+ href: string;
20
+ };
21
+ export type TGlobalLinkMenuItem<T> = (props: GlobalLinkMenuItemProps) => T;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - GlobalMain
5
+ *
6
+ * @codegen <<SignedSource::11ea5d4235fb0042c3ba744599576b5a>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Main.tsx <<SignedSource::425e3fbc0683323fde14fb4bb6bb3abf>>
10
+ */
11
+ import type React from 'react';
12
+ export type GlobalMainProps = {
13
+ children?: React.ReactElement | React.ReactElement[];
14
+ };
15
+ export type TGlobalMain<T> = (props: GlobalMainProps) => T;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - Global
5
+ *
6
+ * @codegen <<SignedSource::01c434a8e1088249f55e97bba99aa916>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global.tsx <<SignedSource::54502ae221b976e3c4f4849cff6be726>>
10
+ */
11
+ import type React from 'react';
12
+ export type GlobalProps = {
13
+ /**
14
+ * Accepts Global.Sidebar and Global.Main components as children.
15
+ */
16
+ children?: React.ReactElement | React.ReactElement[];
17
+ };
18
+ export type TGlobal<T> = (props: GlobalProps) => T;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - GlobalSidebar
5
+ *
6
+ * @codegen <<SignedSource::79b07a090ede53f7e378c159fed3ac3b>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Sidebar.tsx <<SignedSource::216e7ba54d02c3e167f084fb05e4018f>>
10
+ */
11
+ import type React from 'react';
12
+ export type GlobalSidebarProps = {
13
+ /**
14
+ * URL path for the "For You" section in the sidebar.
15
+ * When provided, enables the "For You" navigation item.
16
+ */
17
+ forYouUrl?: string;
18
+ /**
19
+ * Accepts Global.LinkMenuItem and Global.ExpandMenuItem components.
20
+ */
21
+ children?: React.ReactElement | React.ReactElement[];
22
+ };
23
+ export type TGlobalSidebar<T> = (props: GlobalSidebarProps) => T;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Index file for generated Global component prop types
5
+ *
6
+ * @codegen <<SignedSource::275df2eb411df5669a05d8e4573e519b>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ */
10
+ export type { GlobalProps, TGlobal } from './GlobalProps.codegen';
11
+ export type { GlobalMainProps, TGlobalMain } from './GlobalMainProps.codegen';
12
+ export type { GlobalSidebarProps, TGlobalSidebar } from './GlobalSidebarProps.codegen';
13
+ export type { GlobalLinkMenuItemProps, TGlobalLinkMenuItem } from './GlobalLinkMenuItemProps.codegen';
14
+ export type { GlobalExpandableMenuItemProps, TGlobalExpandableMenuItem } from './GlobalExpandableMenuItemProps.codegen';
@@ -3,3 +3,4 @@ export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, H
3
3
  export type { ChromelessEditorProps, CommentEditorProps, TChromelessEditor, TCommentEditor, } from './components/editor';
4
4
  export type { ChartColorTokens } from './types';
5
5
  export type { FrameProps } from './components/frame';
6
+ export type { GlobalSidebarProps, TGlobalSidebar, GlobalLinkMenuItemProps, TGlobalLinkMenuItem, GlobalExpandableMenuItemProps, TGlobalExpandableMenuItem, GlobalProps, TGlobal, GlobalMainProps, TGlobalMain, } from './components/global/__generated__';
@@ -0,0 +1,17 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - GlobalExpandableMenuItem
5
+ *
6
+ * @codegen <<SignedSource::8f9bf63fd0127b4faa2986b9c9257182>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-ExpandableMenuItem.tsx <<SignedSource::79df02babb605094ae73bdd0c00c7156>>
10
+ */
11
+ export type GlobalExpandableMenuItemProps = {
12
+ /**
13
+ * The display label for the expandable menu item.
14
+ */
15
+ label: string;
16
+ };
17
+ export type TGlobalExpandableMenuItem<T> = (props: GlobalExpandableMenuItemProps) => T;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - GlobalLinkMenuItem
5
+ *
6
+ * @codegen <<SignedSource::13f71ea4b4d387e48fef444bd10847f9>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-LinkMenuItem.tsx <<SignedSource::e70effe0d4e0620246252b35abddb112>>
10
+ */
11
+ export type GlobalLinkMenuItemProps = {
12
+ /**
13
+ * The display label for the menu item.
14
+ */
15
+ label: string;
16
+ /**
17
+ * The URL path to navigate to when clicked.
18
+ */
19
+ href: string;
20
+ };
21
+ export type TGlobalLinkMenuItem<T> = (props: GlobalLinkMenuItemProps) => T;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - GlobalMain
5
+ *
6
+ * @codegen <<SignedSource::11ea5d4235fb0042c3ba744599576b5a>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Main.tsx <<SignedSource::425e3fbc0683323fde14fb4bb6bb3abf>>
10
+ */
11
+ import type React from 'react';
12
+ export type GlobalMainProps = {
13
+ children?: React.ReactElement | React.ReactElement[];
14
+ };
15
+ export type TGlobalMain<T> = (props: GlobalMainProps) => T;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - Global
5
+ *
6
+ * @codegen <<SignedSource::01c434a8e1088249f55e97bba99aa916>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global.tsx <<SignedSource::54502ae221b976e3c4f4849cff6be726>>
10
+ */
11
+ import type React from 'react';
12
+ export type GlobalProps = {
13
+ /**
14
+ * Accepts Global.Sidebar and Global.Main components as children.
15
+ */
16
+ children?: React.ReactElement | React.ReactElement[];
17
+ };
18
+ export type TGlobal<T> = (props: GlobalProps) => T;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - GlobalSidebar
5
+ *
6
+ * @codegen <<SignedSource::79b07a090ede53f7e378c159fed3ac3b>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Sidebar.tsx <<SignedSource::216e7ba54d02c3e167f084fb05e4018f>>
10
+ */
11
+ import type React from 'react';
12
+ export type GlobalSidebarProps = {
13
+ /**
14
+ * URL path for the "For You" section in the sidebar.
15
+ * When provided, enables the "For You" navigation item.
16
+ */
17
+ forYouUrl?: string;
18
+ /**
19
+ * Accepts Global.LinkMenuItem and Global.ExpandMenuItem components.
20
+ */
21
+ children?: React.ReactElement | React.ReactElement[];
22
+ };
23
+ export type TGlobalSidebar<T> = (props: GlobalSidebarProps) => T;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Index file for generated Global component prop types
5
+ *
6
+ * @codegen <<SignedSource::275df2eb411df5669a05d8e4573e519b>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ */
10
+ export type { GlobalProps, TGlobal } from './GlobalProps.codegen';
11
+ export type { GlobalMainProps, TGlobalMain } from './GlobalMainProps.codegen';
12
+ export type { GlobalSidebarProps, TGlobalSidebar } from './GlobalSidebarProps.codegen';
13
+ export type { GlobalLinkMenuItemProps, TGlobalLinkMenuItem } from './GlobalLinkMenuItemProps.codegen';
14
+ export type { GlobalExpandableMenuItemProps, TGlobalExpandableMenuItem } from './GlobalExpandableMenuItemProps.codegen';
@@ -3,3 +3,4 @@ export type { BarChartProps, StackBarChartProps, HorizontalStackBarChartProps, H
3
3
  export type { ChromelessEditorProps, CommentEditorProps, TChromelessEditor, TCommentEditor, } from './components/editor';
4
4
  export type { ChartColorTokens } from './types';
5
5
  export type { FrameProps } from './components/frame';
6
+ export type { GlobalSidebarProps, TGlobalSidebar, GlobalLinkMenuItemProps, TGlobalLinkMenuItem, GlobalExpandableMenuItemProps, TGlobalExpandableMenuItem, GlobalProps, TGlobal, GlobalMainProps, TGlobalMain, } from './components/global/__generated__';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/forge-react-types",
3
- "version": "0.59.0",
3
+ "version": "0.61.0",
4
4
  "description": "Component types for Forge UI Kit React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -23,23 +23,23 @@
23
23
  "dependencies": {
24
24
  "@atlaskit/button": "^23.9.0",
25
25
  "@atlaskit/comment": "^13.2.0",
26
- "@atlaskit/datetime-picker": "^17.4.0",
26
+ "@atlaskit/datetime-picker": "^17.5.0",
27
27
  "@atlaskit/dynamic-table": "^18.3.0",
28
28
  "@atlaskit/form": "^15.3.0",
29
29
  "@atlaskit/inline-edit": "^15.6.0",
30
30
  "@atlaskit/modal-dialog": "^14.10.0",
31
- "@atlaskit/navigation-system": "^5.32.0",
31
+ "@atlaskit/navigation-system": "^5.33.0",
32
32
  "@atlaskit/object": "^1.0.0",
33
33
  "@atlaskit/popup": "^4.13.0",
34
34
  "@atlaskit/primitives": "^18.0.0",
35
35
  "@atlaskit/progress-bar": "^4.1.0",
36
- "@atlaskit/progress-tracker": "^10.4.0",
36
+ "@atlaskit/progress-tracker": "^10.5.0",
37
37
  "@atlaskit/radio": "^8.4.0",
38
38
  "@atlaskit/section-message": "^8.12.0",
39
39
  "@atlaskit/select": "^21.7.0",
40
40
  "@atlaskit/spinner": "^19.0.0",
41
41
  "@atlaskit/tabs": "^18.3.0",
42
- "@atlaskit/tag": "^14.3.0",
42
+ "@atlaskit/tag": "^14.4.0",
43
43
  "@atlaskit/tag-group": "^12.0.0",
44
44
  "@atlaskit/textarea": "^8.2.0",
45
45
  "@atlaskit/textfield": "^8.2.0",
@@ -65,6 +65,7 @@
65
65
  },
66
66
  "scripts": {
67
67
  "codegen": "ts-node ./scripts/codegen-runner.ts",
68
+ "codegen-global": "ts-node ./scripts/codegen-global-runner.ts",
68
69
  "check-types": "ts-node --type-check ./scripts/typechecker.ts"
69
70
  },
70
71
  "sideEffects": [
@@ -0,0 +1,363 @@
1
+ // This file was generated by AI. It is an internal script used only for generating types and is not used in any production code. Use AI to update as needed and check the generated types are correct before committing.
2
+
3
+ /* eslint-disable @typescript-eslint/ban-types */
4
+ import { createSignedArtifact } from '@atlassian/codegen';
5
+ import { Project } from 'ts-morph';
6
+ import type { Symbol, InterfaceDeclaration, PropertySignature, SourceFile } from 'ts-morph';
7
+ import { resolve } from 'path';
8
+ import fs from 'fs';
9
+
10
+ // Path to the global component props source file (re-exports)
11
+ const GLOBAL_PROPS_SOURCE_PATH = resolve(
12
+ __dirname,
13
+ '../../../../..',
14
+ 'services/forge-common-app-gateway/src/types/global-component-props.ts',
15
+ );
16
+
17
+ // Output directory for generated files
18
+ const GLOBAL_OUTPUT_DIR = resolve(
19
+ __dirname,
20
+ '..',
21
+ '..',
22
+ 'src',
23
+ 'components',
24
+ 'global',
25
+ '__generated__',
26
+ );
27
+
28
+ /**
29
+ * Extracts the JSDoc comment from a node and formats it properly.
30
+ * Only extracts JSDoc that is directly attached to the node (not file-level comments).
31
+ */
32
+ const getJSDocComment = (node: InterfaceDeclaration | PropertySignature): string | null => {
33
+ const jsDocs = node.getJsDocs();
34
+ if (jsDocs.length === 0) {
35
+ return null;
36
+ }
37
+
38
+ // Get only the last JSDoc (the one directly attached to the declaration)
39
+ const lastJsDoc = jsDocs[jsDocs.length - 1];
40
+ const comment = lastJsDoc.getInnerText();
41
+
42
+ if (!comment || comment.length === 0) {
43
+ return null;
44
+ }
45
+
46
+ const commentBody = comment
47
+ .split('\n')
48
+ .map((line: string) => line.trimEnd())
49
+ .map((line: string) => (line.length === 0 ? ' *' : ` * ${line}`))
50
+ .join('\n');
51
+
52
+ return `/**\n${commentBody}\n */`;
53
+ };
54
+
55
+ /**
56
+ * Resolves a TypeScript type to its primitive representation.
57
+ * For now, we only support simple primitive types.
58
+ */
59
+ const resolveToPrimitive = (typeText: string): string => {
60
+ // Already primitive types
61
+ const primitives = [
62
+ 'string',
63
+ 'number',
64
+ 'boolean',
65
+ 'null',
66
+ 'undefined',
67
+ 'void',
68
+ 'never',
69
+ 'unknown',
70
+ 'any',
71
+ ];
72
+ if (primitives.includes(typeText)) {
73
+ return typeText;
74
+ }
75
+
76
+ // Handle union types (e.g., "string | undefined")
77
+ if (typeText.includes('|')) {
78
+ const parts = typeText
79
+ .split('|')
80
+ .map((p) => p.trim())
81
+ .filter((p) => p.length > 0);
82
+ const resolvedParts = parts.map((part) => resolveToPrimitive(part));
83
+ return resolvedParts.join(' | ');
84
+ }
85
+
86
+ // For any other type, return as-is (it should already be primitive based on our props)
87
+ return typeText;
88
+ };
89
+
90
+ /**
91
+ * Resolves a symbol to its original interface declaration.
92
+ * Handles re-exported types by following the export declarations.
93
+ */
94
+ const resolveToInterfaceDeclaration = (
95
+ symbol: Symbol,
96
+ sourceFile: SourceFile,
97
+ project: Project,
98
+ ): { interfaceDecl: InterfaceDeclaration; sourceFilePath: string } | null => {
99
+ const symbolName = symbol.getName();
100
+
101
+ // Find the export declaration for this symbol
102
+ const exportDeclarations = sourceFile.getExportDeclarations();
103
+
104
+ for (const exportDecl of exportDeclarations) {
105
+ const namedExports = exportDecl.getNamedExports();
106
+ const matchingExport = namedExports.find(
107
+ (ne) => ne.getName() === symbolName || ne.getAliasNode()?.getText() === symbolName,
108
+ );
109
+
110
+ if (matchingExport) {
111
+ // Get the module specifier (the path being exported from)
112
+ const moduleSpecifier = exportDecl.getModuleSpecifierValue();
113
+ if (!moduleSpecifier) {
114
+ continue;
115
+ }
116
+
117
+ // Resolve the module path
118
+ const moduleSourceFile = exportDecl.getModuleSpecifierSourceFile();
119
+ if (!moduleSourceFile) {
120
+ // Try to manually resolve and add the source file
121
+ const resolvedPath = resolve(sourceFile.getDirectoryPath(), moduleSpecifier + '.tsx');
122
+
123
+ if (fs.existsSync(resolvedPath)) {
124
+ const addedSourceFile = project.addSourceFileAtPath(resolvedPath);
125
+ const interfaceDecl = addedSourceFile.getInterface(symbolName);
126
+ if (interfaceDecl) {
127
+ return {
128
+ interfaceDecl,
129
+ sourceFilePath: resolvedPath,
130
+ };
131
+ }
132
+ }
133
+ continue;
134
+ }
135
+
136
+ // Find the interface in the module source file
137
+ const interfaceDecl = moduleSourceFile.getInterface(symbolName);
138
+ if (interfaceDecl) {
139
+ return {
140
+ interfaceDecl,
141
+ sourceFilePath: moduleSourceFile.getFilePath(),
142
+ };
143
+ }
144
+ }
145
+ }
146
+
147
+ return null;
148
+ };
149
+
150
+ /**
151
+ * Generates the source code for a single component's prop types.
152
+ */
153
+ const generateComponentPropTypeCode = (
154
+ interfaceDecl: InterfaceDeclaration,
155
+ allPropsNames: string[],
156
+ ): string => {
157
+ const interfaceName = interfaceDecl.getName();
158
+ const componentName = interfaceName.replace('Props', '');
159
+
160
+ const lines: string[] = [];
161
+
162
+ // Add eslint directive
163
+ lines.push('/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */');
164
+ lines.push('');
165
+
166
+ // Get interface JSDoc
167
+ const interfaceJSDoc = getJSDocComment(interfaceDecl);
168
+ if (interfaceJSDoc) {
169
+ lines.push(interfaceJSDoc);
170
+ }
171
+
172
+ // Generate the props type
173
+ const properties = interfaceDecl.getProperties();
174
+
175
+ if (properties.length === 0) {
176
+ // Empty props interface
177
+ lines.push(`export type ${interfaceName} = Record<string, never>;`);
178
+ } else {
179
+ lines.push(`export type ${interfaceName} = {`);
180
+
181
+ properties.forEach((prop: PropertySignature) => {
182
+ const propName = prop.getName();
183
+ // Prefer the source-level type annotation (getTypeNode) over the resolved type (getType).
184
+ // getType().getText() can produce degenerate types (any/never/undefined) when the
185
+ // ts-morph Project lacks type definitions, or overly verbose types that expand
186
+ // generic defaults (e.g., ReactElement<X> → ReactElement<X, string | JSXElementConstructor<any>>).
187
+ // The source annotation preserves the developer's intended type expression.
188
+ const resolvedTypeText = prop.getType().getText();
189
+ const sourceTypeText = prop.getTypeNode()?.getText();
190
+ let propType = sourceTypeText ?? resolvedTypeText;
191
+
192
+ // Normalize bare React type references (e.g., ReactElement → React.ReactElement)
193
+ // so the generated file only needs a single React namespace import.
194
+ const reactTypeNames = [
195
+ 'ReactElement',
196
+ 'ReactNode',
197
+ 'ReactFragment',
198
+ 'ReactPortal',
199
+ 'JSXElementConstructor',
200
+ ];
201
+ for (const typeName of reactTypeNames) {
202
+ propType = propType.replace(
203
+ new RegExp(`(?<![\\w.])${typeName}\\b`, 'g'),
204
+ `React.${typeName}`,
205
+ );
206
+ }
207
+
208
+ const isOptional = prop.hasQuestionToken();
209
+ const resolvedType = resolveToPrimitive(propType);
210
+
211
+ // Get property JSDoc
212
+ const propJSDoc = getJSDocComment(prop);
213
+ if (propJSDoc) {
214
+ // Indent the JSDoc for property
215
+ const indentedJSDoc = propJSDoc
216
+ .split('\n')
217
+ .map((line: string) => `\t${line}`)
218
+ .join('\n');
219
+ lines.push(indentedJSDoc);
220
+ }
221
+
222
+ const optionalMarker = isOptional ? '?' : '';
223
+ lines.push(`\t${propName}${optionalMarker}: ${resolvedType};`);
224
+ });
225
+
226
+ lines.push('};');
227
+ }
228
+
229
+ lines.push('');
230
+
231
+ // Generate the T* component type
232
+ if (interfaceJSDoc) {
233
+ lines.push(interfaceJSDoc);
234
+ }
235
+ lines.push(`export type T${componentName}<T> = (props: ${interfaceName}) => T;`);
236
+
237
+ // Detect needed imports based on type references in the generated code
238
+ const generatedCode = lines.slice(2).join('\n'); // skip eslint directive and blank line
239
+ const importLines: string[] = [];
240
+
241
+ if (/\bReact\./.test(generatedCode)) {
242
+ importLines.push("import type React from 'react';");
243
+ }
244
+
245
+ for (const propsName of allPropsNames) {
246
+ if (propsName !== interfaceName && generatedCode.includes(propsName)) {
247
+ importLines.push(`import type { ${propsName} } from './${propsName}.codegen';`);
248
+ }
249
+ }
250
+
251
+ if (importLines.length > 0) {
252
+ // Insert imports after the eslint directive and blank line (index 2)
253
+ lines.splice(2, 0, ...importLines, '');
254
+ }
255
+
256
+ return lines.join('\n');
257
+ };
258
+
259
+ /**
260
+ * Generates prop type files for all Global components.
261
+ *
262
+ * Process:
263
+ * 1. Load the re-export file (global-component-props.ts)
264
+ * 2. Get exported symbols ending with "Props"
265
+ * 3. Resolve each to its original interface declaration
266
+ * 4. Extract type info and resolve to primitives
267
+ * 5. Generate signed .codegen.tsx files and index.ts
268
+ */
269
+ const generateGlobalComponentPropTypes = () => {
270
+ // eslint-disable-next-line no-console
271
+ console.log('Generating Global component prop types...');
272
+
273
+ // Ensure output directory exists
274
+ if (!fs.existsSync(GLOBAL_OUTPUT_DIR)) {
275
+ fs.mkdirSync(GLOBAL_OUTPUT_DIR, { recursive: true });
276
+ }
277
+
278
+ const project = new Project({
279
+ compilerOptions: {
280
+ strict: true,
281
+ },
282
+ });
283
+
284
+ const sourceFile = project.addSourceFileAtPath(GLOBAL_PROPS_SOURCE_PATH);
285
+ const exportedSymbols = sourceFile.getExportSymbols();
286
+ const propsSymbols = exportedSymbols.filter((symbol) => symbol.getName().endsWith('Props'));
287
+
288
+ const allPropsNames = propsSymbols.map((s) => s.getName());
289
+ const generatedFiles: string[] = [];
290
+
291
+ propsSymbols.forEach((symbol) => {
292
+ const symbolName = symbol.getName();
293
+ const componentName = symbolName.replace('Props', '');
294
+
295
+ const resolved = resolveToInterfaceDeclaration(symbol, sourceFile, project);
296
+
297
+ if (!resolved) {
298
+ // eslint-disable-next-line no-console
299
+ console.error(` ✗ Could not resolve ${symbolName} to an interface declaration`);
300
+ return;
301
+ }
302
+
303
+ const { interfaceDecl, sourceFilePath } = resolved;
304
+ const sourceCode = generateComponentPropTypeCode(interfaceDecl, allPropsNames);
305
+ const outputPath = resolve(GLOBAL_OUTPUT_DIR, `${symbolName}.codegen.tsx`);
306
+
307
+ const signedSourceCode = createSignedArtifact(
308
+ sourceCode,
309
+ 'yarn workspace @atlaskit/forge-react-types codegen-global',
310
+ {
311
+ description: `Generated prop types for Global component - ${componentName}`,
312
+ dependencies: [GLOBAL_PROPS_SOURCE_PATH, sourceFilePath],
313
+ outputFolder: GLOBAL_OUTPUT_DIR,
314
+ },
315
+ );
316
+
317
+ fs.writeFileSync(outputPath, signedSourceCode);
318
+ generatedFiles.push(symbolName);
319
+
320
+ // eslint-disable-next-line no-console
321
+ console.log(` ✓ Generated ${symbolName}.codegen.tsx`);
322
+ });
323
+
324
+ generateIndexFile(generatedFiles);
325
+
326
+ // eslint-disable-next-line no-console
327
+ console.log('✓ Global component prop types generation complete!');
328
+ };
329
+
330
+ /**
331
+ * Generates the index.ts file that exports all generated types.
332
+ */
333
+ const generateIndexFile = (interfaceNames: string[]) => {
334
+ const lines: string[] = [];
335
+
336
+ lines.push('/* eslint @repo/internal/codegen/signed-source-integrity: "warn" */');
337
+ lines.push('');
338
+
339
+ interfaceNames.forEach((interfaceName) => {
340
+ const componentName = interfaceName.replace('Props', '');
341
+ lines.push(
342
+ `export type { ${interfaceName}, T${componentName} } from './${interfaceName}.codegen';`,
343
+ );
344
+ });
345
+
346
+ const sourceCode = lines.join('\n') + '\n';
347
+
348
+ const indexPath = resolve(GLOBAL_OUTPUT_DIR, 'index.ts');
349
+
350
+ const signedSourceCode = createSignedArtifact(
351
+ sourceCode,
352
+ 'yarn workspace @atlaskit/forge-react-types codegen-global',
353
+ {
354
+ description: 'Index file for generated Global component prop types',
355
+ dependencies: [GLOBAL_PROPS_SOURCE_PATH],
356
+ outputFolder: GLOBAL_OUTPUT_DIR,
357
+ },
358
+ );
359
+
360
+ fs.writeFileSync(indexPath, signedSourceCode);
361
+ };
362
+
363
+ export { generateGlobalComponentPropTypes };
@@ -0,0 +1,18 @@
1
+ import { generateGlobalComponentPropTypes } from './codegen/globalComponentPropTypes';
2
+
3
+ const runTypeCheck = () => {
4
+ // execute yarn run check-types
5
+ const { execSync } = require('child_process');
6
+ try {
7
+ execSync('yarn run check-types', { stdio: 'inherit' });
8
+ // eslint-disable-next-line no-console
9
+ console.log('✅ 🚀 Type checks passed successfully for generated Global component types!');
10
+ } catch (error) {
11
+ // eslint-disable-next-line no-console
12
+ console.error('❌ Type checks failed:', error);
13
+ process.exit(1);
14
+ }
15
+ };
16
+
17
+ generateGlobalComponentPropTypes();
18
+ runTypeCheck();
@@ -11,7 +11,7 @@ import {
11
11
  type LozengeProps,
12
12
  type RangeProps,
13
13
  type IconProps,
14
- } from '@atlassian/forge-ui/src/components/UIKit';
14
+ } from '@atlassian/forge-ui/UIKit';
15
15
  import { type BadgeProps as GeneratedBadgeProps } from '../src/components/__generated__/BadgeProps.codegen';
16
16
  import { type CalendarProps as GeneratedCalendarProps } from '../src/components/__generated__/CalendarProps.codegen';
17
17
  import { type CheckboxProps as GeneratedCheckboxProps } from '../src/components/__generated__/CheckboxProps.codegen';
@@ -0,0 +1,20 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - GlobalExpandableMenuItem
5
+ *
6
+ * @codegen <<SignedSource::8f9bf63fd0127b4faa2986b9c9257182>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-ExpandableMenuItem.tsx <<SignedSource::79df02babb605094ae73bdd0c00c7156>>
10
+ */
11
+ /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
12
+
13
+ export type GlobalExpandableMenuItemProps = {
14
+ /**
15
+ * The display label for the expandable menu item.
16
+ */
17
+ label: string;
18
+ };
19
+
20
+ export type TGlobalExpandableMenuItem<T> = (props: GlobalExpandableMenuItemProps) => T;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - GlobalLinkMenuItem
5
+ *
6
+ * @codegen <<SignedSource::13f71ea4b4d387e48fef444bd10847f9>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-LinkMenuItem.tsx <<SignedSource::e70effe0d4e0620246252b35abddb112>>
10
+ */
11
+ /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
12
+
13
+ export type GlobalLinkMenuItemProps = {
14
+ /**
15
+ * The display label for the menu item.
16
+ */
17
+ label: string;
18
+ /**
19
+ * The URL path to navigate to when clicked.
20
+ */
21
+ href: string;
22
+ };
23
+
24
+ export type TGlobalLinkMenuItem<T> = (props: GlobalLinkMenuItemProps) => T;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - GlobalMain
5
+ *
6
+ * @codegen <<SignedSource::11ea5d4235fb0042c3ba744599576b5a>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Main.tsx <<SignedSource::425e3fbc0683323fde14fb4bb6bb3abf>>
10
+ */
11
+ /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
12
+
13
+ import type React from 'react';
14
+
15
+ export type GlobalMainProps = {
16
+ children?: React.ReactElement | React.ReactElement[];
17
+ };
18
+
19
+ export type TGlobalMain<T> = (props: GlobalMainProps) => T;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - Global
5
+ *
6
+ * @codegen <<SignedSource::01c434a8e1088249f55e97bba99aa916>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global.tsx <<SignedSource::54502ae221b976e3c4f4849cff6be726>>
10
+ */
11
+ /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
12
+
13
+ import type React from 'react';
14
+
15
+ export type GlobalProps = {
16
+ /**
17
+ * Accepts Global.Sidebar and Global.Main components as children.
18
+ */
19
+ children?: React.ReactElement | React.ReactElement[];
20
+ };
21
+
22
+ export type TGlobal<T> = (props: GlobalProps) => T;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Generated prop types for Global component - GlobalSidebar
5
+ *
6
+ * @codegen <<SignedSource::79b07a090ede53f7e378c159fed3ac3b>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/components/global/Global-Sidebar.tsx <<SignedSource::216e7ba54d02c3e167f084fb05e4018f>>
10
+ */
11
+ /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
12
+
13
+ import type React from 'react';
14
+
15
+ export type GlobalSidebarProps = {
16
+ /**
17
+ * URL path for the "For You" section in the sidebar.
18
+ * When provided, enables the "For You" navigation item.
19
+ */
20
+ forYouUrl?: string;
21
+ /**
22
+ * Accepts Global.LinkMenuItem and Global.ExpandMenuItem components.
23
+ */
24
+ children?: React.ReactElement | React.ReactElement[];
25
+ };
26
+
27
+ export type TGlobalSidebar<T> = (props: GlobalSidebarProps) => T;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
3
+ *
4
+ * Index file for generated Global component prop types
5
+ *
6
+ * @codegen <<SignedSource::275df2eb411df5669a05d8e4573e519b>>
7
+ * @codegenCommand yarn workspace @atlaskit/forge-react-types codegen-global
8
+ * @codegenDependency ../../../../../../../services/forge-common-app-gateway/src/types/global-component-props.ts <<SignedSource::ad330a446ee260180d5b510c18b5e1c8>>
9
+ */
10
+ /* eslint @repo/internal/codegen/signed-source-integrity: "warn" */
11
+
12
+ export type { GlobalProps, TGlobal } from './GlobalProps.codegen';
13
+ export type { GlobalMainProps, TGlobalMain } from './GlobalMainProps.codegen';
14
+ export type { GlobalSidebarProps, TGlobalSidebar } from './GlobalSidebarProps.codegen';
15
+ export type { GlobalLinkMenuItemProps, TGlobalLinkMenuItem } from './GlobalLinkMenuItemProps.codegen';
16
+ export type { GlobalExpandableMenuItemProps, TGlobalExpandableMenuItem } from './GlobalExpandableMenuItemProps.codegen';
package/src/index.ts CHANGED
@@ -162,3 +162,16 @@ export type {
162
162
  export type { ChartColorTokens } from './types';
163
163
 
164
164
  export type { FrameProps } from './components/frame';
165
+
166
+ export type {
167
+ GlobalSidebarProps,
168
+ TGlobalSidebar,
169
+ GlobalLinkMenuItemProps,
170
+ TGlobalLinkMenuItem,
171
+ GlobalExpandableMenuItemProps,
172
+ TGlobalExpandableMenuItem,
173
+ GlobalProps,
174
+ TGlobal,
175
+ GlobalMainProps,
176
+ TGlobalMain,
177
+ } from './components/global/__generated__';