@modern-js/devtools-client 2.34.0 → 2.35.1

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 (125) hide show
  1. package/.turbo/turbo-build.log +135 -20
  2. package/CHANGELOG.md +20 -0
  3. package/build.sh +5 -0
  4. package/dist/html/main/index.html +5 -0
  5. package/dist/modern.config.json +31 -11
  6. package/dist/nestedRoutes.json +1 -1
  7. package/dist/route.json +3 -3
  8. package/dist/routes-manifest.json +198 -16
  9. package/dist/static/css/198.76c8c1d9.css +51 -0
  10. package/dist/static/css/main.9bc38ddc.css +1 -0
  11. package/dist/static/js/198.9a4a2f6b.js +1 -0
  12. package/dist/static/js/198.9a4a2f6b.js.LICENSE.txt +39 -0
  13. package/dist/static/js/198.9a4a2f6b.js.map +1 -0
  14. package/dist/static/js/async/config/builder/resolved/page.83919c8c.js +1 -0
  15. package/dist/static/js/async/config/builder/resolved/page.83919c8c.js.map +1 -0
  16. package/dist/static/js/async/config/builder/transformed/page.cdfad512.js +1 -0
  17. package/dist/static/js/async/config/builder/transformed/page.cdfad512.js.map +1 -0
  18. package/dist/static/js/async/config/bundler/resolved/page.c2911ed1.js +1 -0
  19. package/dist/static/js/async/config/bundler/resolved/page.c2911ed1.js.map +1 -0
  20. package/dist/static/js/async/config/bundler/transformed/page.268e1037.js +1 -0
  21. package/dist/static/js/async/config/bundler/transformed/page.268e1037.js.map +1 -0
  22. package/dist/static/js/async/config/framework/resolved/page.d5729166.js +1 -0
  23. package/dist/static/js/async/config/framework/resolved/page.d5729166.js.map +1 -0
  24. package/dist/static/js/async/config/framework/transformed/page.240ab8d3.js +1 -0
  25. package/dist/static/js/async/config/framework/transformed/page.240ab8d3.js.map +1 -0
  26. package/dist/static/js/async/config/layout.272e8d6b.js +1 -0
  27. package/dist/static/js/async/config/layout.272e8d6b.js.map +1 -0
  28. package/dist/static/js/async/config/page.40d352df.js +1 -0
  29. package/dist/static/js/async/config/page.40d352df.js.map +1 -0
  30. package/dist/static/js/async/context/builder/page.62f2bc66.js +1 -0
  31. package/dist/static/js/async/context/builder/page.62f2bc66.js.map +1 -0
  32. package/dist/static/js/async/context/framework/page.052a6c77.js +1 -0
  33. package/dist/static/js/async/context/framework/page.052a6c77.js.map +1 -0
  34. package/dist/static/js/async/context/layout.06edb4f8.js +1 -0
  35. package/dist/static/js/async/context/layout.06edb4f8.js.map +1 -0
  36. package/dist/static/js/async/context/page.94cbdf00.js +1 -0
  37. package/dist/static/js/async/context/page.94cbdf00.js.map +1 -0
  38. package/dist/static/js/async/overview/page.1d1e2eae.js +1 -0
  39. package/dist/static/js/async/overview/page.1d1e2eae.js.map +1 -0
  40. package/dist/static/js/async/page.ae98c3d4.js +1 -0
  41. package/dist/static/js/async/page.ae98c3d4.js.map +1 -0
  42. package/dist/static/js/async/pages/layout.27df0fc6.js +1 -0
  43. package/dist/static/js/async/pages/layout.27df0fc6.js.map +1 -0
  44. package/dist/static/js/async/pages/page.d8425bcf.js +1 -0
  45. package/dist/static/js/async/pages/page.d8425bcf.js.map +1 -0
  46. package/dist/static/js/lib-lodash.d4590abd.js +1 -0
  47. package/dist/static/js/lib-lodash.d4590abd.js.map +1 -0
  48. package/dist/static/js/lib-polyfill.6e913595.js +1 -0
  49. package/dist/static/js/lib-polyfill.6e913595.js.map +1 -0
  50. package/dist/static/js/lib-react.e7e80806.js +1 -0
  51. package/dist/static/js/{lib-react.be1fdbe9.js.LICENSE.txt → lib-react.e7e80806.js.LICENSE.txt} +11 -1
  52. package/dist/static/js/lib-react.e7e80806.js.map +1 -0
  53. package/dist/static/js/lib-router.ee136613.js +1 -0
  54. package/dist/static/js/{lib-router.7b48a0f0.js.LICENSE.txt → lib-router.ee136613.js.LICENSE.txt} +3 -3
  55. package/dist/static/js/lib-router.ee136613.js.map +1 -0
  56. package/dist/static/js/main.7e1a3442.js +1 -0
  57. package/dist/static/js/main.7e1a3442.js.map +1 -0
  58. package/modern.config.ts +42 -3
  59. package/package.json +28 -8
  60. package/scripts/build-redirects.js +32 -0
  61. package/scripts/deploy-netlify.js +0 -0
  62. package/src/.eslintrc.js +4 -0
  63. package/src/components/Breadcrumbs.tsx +43 -0
  64. package/src/components/ObjectInspector.tsx +37 -0
  65. package/src/constants.tsx +34 -0
  66. package/src/routes/RootTabs.tsx +148 -0
  67. package/src/routes/config/builder/resolved/page.tsx +17 -0
  68. package/src/routes/config/builder/transformed/page.tsx +17 -0
  69. package/src/routes/config/bundler/resolved/page.tsx +17 -0
  70. package/src/routes/config/bundler/transformed/page.tsx +17 -0
  71. package/src/routes/config/framework/resolved/page.tsx +17 -0
  72. package/src/routes/config/framework/transformed/page.tsx +17 -0
  73. package/src/routes/config/layout.tsx +68 -0
  74. package/src/routes/config/page.loader.ts +7 -0
  75. package/src/routes/config/page.tsx +1 -0
  76. package/src/routes/context/builder/page.tsx +12 -0
  77. package/src/routes/context/framework/page.tsx +14 -0
  78. package/src/routes/context/layout.tsx +38 -0
  79. package/src/routes/context/page.loader.ts +7 -0
  80. package/src/routes/context/page.tsx +1 -0
  81. package/src/routes/layout.css +3 -0
  82. package/src/routes/layout.tsx +25 -0
  83. package/src/routes/overview/heading.svg +12 -0
  84. package/src/routes/overview/page.tsx +122 -0
  85. package/src/routes/page.loader.ts +7 -0
  86. package/src/routes/page.tsx +1 -0
  87. package/src/routes/pages/BaseRoute.tsx +87 -0
  88. package/src/routes/pages/EntryRoute/ClientRouteStats/ClientRouteStats.tsx +42 -0
  89. package/src/routes/pages/EntryRoute/ClientRouteStats/LegacyRouteStats.tsx +6 -0
  90. package/src/routes/pages/EntryRoute/ClientRouteStats/RemixRoute.tsx +85 -0
  91. package/src/routes/pages/EntryRoute/ClientRouteStats/RemixRouteStats.tsx +44 -0
  92. package/src/routes/pages/EntryRoute/ClientRouteStats/index.ts +1 -0
  93. package/src/routes/pages/EntryRoute/EntryRoute.tsx +25 -0
  94. package/src/routes/pages/EntryRoute/EntryStats.tsx +44 -0
  95. package/src/routes/pages/EntryRoute/MatchRemixRouteContext.ts +6 -0
  96. package/src/routes/pages/EntryRoute/index.ts +1 -0
  97. package/src/routes/pages/MatchUrl.tsx +3 -0
  98. package/src/routes/pages/ServerRoute.tsx +21 -0
  99. package/src/routes/pages/UnknownRoute.tsx +20 -0
  100. package/src/routes/pages/layout.tsx +13 -0
  101. package/src/routes/pages/page.tsx +54 -0
  102. package/src/rpc/index.ts +36 -0
  103. package/src/stores/index.tsx +141 -0
  104. package/src/types/index.ts +62 -0
  105. package/src/utils/context.tsx +22 -0
  106. package/src/utils/hooks.ts +23 -0
  107. package/src/utils/index.ts +1 -0
  108. package/dist/html/devtools/index.html +0 -5
  109. package/dist/static/css/async/devtools_page.215ea1d3.css +0 -1
  110. package/dist/static/js/async/devtools_page.8337a013.js +0 -1
  111. package/dist/static/js/async/devtools_page.8337a013.js.map +0 -1
  112. package/dist/static/js/devtools.56bf0fe9.js +0 -1
  113. package/dist/static/js/devtools.56bf0fe9.js.map +0 -1
  114. package/dist/static/js/lib-polyfill.db4711e8.js +0 -1
  115. package/dist/static/js/lib-polyfill.db4711e8.js.map +0 -1
  116. package/dist/static/js/lib-react.be1fdbe9.js +0 -1
  117. package/dist/static/js/lib-react.be1fdbe9.js.map +0 -1
  118. package/dist/static/js/lib-router.7b48a0f0.js +0 -1
  119. package/dist/static/js/lib-router.7b48a0f0.js.map +0 -1
  120. package/dist/static/js/vendors~node_modules_pnpm_loadable_component_5_15_3_react_18_2_0_node_modules_loadable_compon~2b20fe.2a50a754.js +0 -1
  121. package/dist/static/js/vendors~node_modules_pnpm_loadable_component_5_15_3_react_18_2_0_node_modules_loadable_compon~2b20fe.2a50a754.js.LICENSE.txt +0 -24
  122. package/dist/static/js/vendors~node_modules_pnpm_loadable_component_5_15_3_react_18_2_0_node_modules_loadable_compon~2b20fe.2a50a754.js.map +0 -1
  123. package/src/devtools/routes/index.css +0 -115
  124. package/src/devtools/routes/layout.tsx +0 -9
  125. package/src/devtools/routes/page.tsx +0 -19
package/src/.eslintrc.js CHANGED
@@ -1,3 +1,4 @@
1
+ /** @type {import('eslint').Linter.Config} */
1
2
  // eslint-disable-next-line import/no-commonjs
2
3
  module.exports = {
3
4
  root: true,
@@ -6,4 +7,7 @@ module.exports = {
6
7
  tsconfigRootDir: __dirname,
7
8
  project: ['../tsconfig.json'],
8
9
  },
10
+ rules: {
11
+ curly: 'off',
12
+ },
9
13
  };
@@ -0,0 +1,43 @@
1
+ import React from 'react';
2
+ import styled from '@emotion/styled';
3
+ import { Button, Flex } from '@radix-ui/themes';
4
+ import { ChevronRightIcon } from '@radix-ui/react-icons';
5
+ import type { ButtonProps } from '@radix-ui/themes/dist/cjs/components/button';
6
+
7
+ export type BreadcrumbButtonProps = ButtonProps &
8
+ React.RefAttributes<HTMLButtonElement>;
9
+
10
+ export const BreadcrumbButton: React.FC<BreadcrumbButtonProps> = props => {
11
+ return <Button color="gray" size="1" variant="ghost" {...props} />;
12
+ };
13
+
14
+ export interface BreadcrumbsProps {
15
+ children?: React.ReactElement[];
16
+ }
17
+
18
+ export const Breadcrumbs: React.FC<BreadcrumbsProps> = ({ children = [] }) => {
19
+ const elements: React.ReactElement[] = [];
20
+ for (const child of children) {
21
+ elements.push(child);
22
+ if (child !== children.at(-1)) {
23
+ elements.push(<Connector key={`${child.key}__connector`} />);
24
+ }
25
+ }
26
+ return (
27
+ <Flex align="center" gap="1">
28
+ {elements}
29
+ </Flex>
30
+ );
31
+ };
32
+
33
+ (Breadcrumbs as any).Button = BreadcrumbButton;
34
+
35
+ export default Breadcrumbs as typeof Breadcrumbs & {
36
+ Button: typeof BreadcrumbButton;
37
+ };
38
+
39
+ const Connector = styled(ChevronRightIcon)({
40
+ width: 'var(--font-size-2)',
41
+ height: 'var(--font-size-2)',
42
+ color: 'var(--gray-6)',
43
+ });
@@ -0,0 +1,37 @@
1
+ import styled from '@emotion/styled';
2
+ import { Box } from '@radix-ui/themes';
3
+ import type { Theme } from 'react-base16-styling';
4
+ import { JSONTree } from 'react-json-tree';
5
+
6
+ const theme: Theme = {
7
+ scheme: 'tomorrow',
8
+ author: 'chris kempson (http://chriskempson.com)',
9
+ base00: 'transparent',
10
+ base01: '#282a2e',
11
+ base02: '#373b41',
12
+ base03: '#969896',
13
+ base04: '#b4b7b4',
14
+ base05: '#c5c8c6',
15
+ base06: '#e0e0e0',
16
+ base07: '#ffffff',
17
+ base08: '#cc6666',
18
+ base09: '#de935f',
19
+ base0A: '#f0c674',
20
+ base0B: '#b5bd68',
21
+ base0C: '#8abeb7',
22
+ base0D: '#81a2be',
23
+ base0E: '#b294bb',
24
+ base0F: '#a3685a',
25
+ };
26
+
27
+ const Container = styled(Box)({
28
+ fontSize: 'var(--font-size-2)',
29
+ });
30
+
31
+ export const ObjectInspector: typeof JSONTree = props => {
32
+ return (
33
+ <Container>
34
+ <JSONTree theme={theme} {...props} />
35
+ </Container>
36
+ );
37
+ };
@@ -0,0 +1,34 @@
1
+ import {
2
+ HomeIcon,
3
+ MixerHorizontalIcon,
4
+ FileTextIcon,
5
+ CubeIcon,
6
+ } from '@radix-ui/react-icons';
7
+ import { InternalTab } from './types';
8
+
9
+ export const getDefaultTabs = (): InternalTab[] => [
10
+ {
11
+ name: 'overview',
12
+ title: 'Overview',
13
+ icon: <HomeIcon />,
14
+ view: { type: 'builtin', url: '/overview' },
15
+ },
16
+ {
17
+ name: 'config',
18
+ title: 'Config',
19
+ icon: <MixerHorizontalIcon />,
20
+ view: { type: 'builtin', url: '/config' },
21
+ },
22
+ {
23
+ name: 'pages',
24
+ title: 'Pages',
25
+ icon: <FileTextIcon />,
26
+ view: { type: 'builtin', url: '/pages' },
27
+ },
28
+ {
29
+ name: 'context',
30
+ title: 'Context',
31
+ icon: <CubeIcon />,
32
+ view: { type: 'builtin', url: '/context' },
33
+ },
34
+ ];
@@ -0,0 +1,148 @@
1
+ import { Suspense } from 'react';
2
+ import styled from '@emotion/styled';
3
+ import { useSnapshot } from 'valtio';
4
+ import { Outlet, useNavigate, useLocation } from '@modern-js/runtime/router';
5
+ import { Box, Text, Button } from '@radix-ui/themes';
6
+ import _ from 'lodash';
7
+ import { GearIcon, HomeIcon } from '@radix-ui/react-icons';
8
+ import { useStore } from '@/stores';
9
+ import { InternalTab } from '@/types';
10
+ import Breadcrumbs from '@/components/Breadcrumbs';
11
+
12
+ export const RootTabs: React.FC = () => {
13
+ const $store = useStore();
14
+ const tabs = useSnapshot($store.tabs);
15
+
16
+ const navigate = useNavigate();
17
+ const location = useLocation();
18
+ const currentTabName = location.pathname.split('/').filter(Boolean)[0];
19
+ const currentTab = _.find(tabs, { name: currentTabName });
20
+
21
+ const handleClick = (tab: InternalTab) => {
22
+ if (tab.view.type === 'builtin') {
23
+ navigate(tab.view.url);
24
+ } else {
25
+ throw new Error('Unimplemented.');
26
+ }
27
+ };
28
+
29
+ return (
30
+ <TabRoot>
31
+ <TabNavigator>
32
+ <TabList style={{ touchAction: 'none' }}>
33
+ <TabBrand>
34
+ <IconBox>🌰</IconBox>
35
+ DevTools
36
+ </TabBrand>
37
+ </TabList>
38
+ <TabList>
39
+ {tabs.map(tab => (
40
+ <TabTrigger
41
+ key={tab.name}
42
+ value={tab.name}
43
+ onClick={() => handleClick(tab as any)}
44
+ >
45
+ <IconBox>{tab.icon as any}</IconBox>
46
+ {tab.title}
47
+ </TabTrigger>
48
+ ))}
49
+ </TabList>
50
+ <Box grow="1" />
51
+ <SettingButton>
52
+ <GearIcon />
53
+ <Text>Settings</Text>
54
+ </SettingButton>
55
+ </TabNavigator>
56
+ <TabContent>
57
+ <Box grow="0">
58
+ <Breadcrumbs>
59
+ <Breadcrumbs.Button onClick={() => navigate('overview')}>
60
+ <HomeIcon />
61
+ </Breadcrumbs.Button>
62
+ <Breadcrumbs.Button>{currentTab?.title}</Breadcrumbs.Button>
63
+ </Breadcrumbs>
64
+ </Box>
65
+ <Box grow="1" style={{ overflow: 'hidden' }}>
66
+ <Suspense fallback={<div>loading...</div>}>
67
+ <Outlet />
68
+ </Suspense>
69
+ </Box>
70
+ </TabContent>
71
+ </TabRoot>
72
+ );
73
+ };
74
+
75
+ const SettingButton = styled(Button)({
76
+ '--accent-9': 'var(--gray-5)',
77
+ '--accent-10': 'var(--gray-6)',
78
+ });
79
+
80
+ const IconBox = styled(Box)({
81
+ width: '2rem',
82
+ height: '2rem',
83
+ display: 'flex',
84
+ justifyContent: 'center',
85
+ alignItems: 'center',
86
+ });
87
+
88
+ const TabNavigator = styled(Box)({
89
+ display: 'flex',
90
+ flexDirection: 'column',
91
+ gap: 'var(--block-gap)',
92
+ });
93
+
94
+ const TabRoot = styled(Box)({
95
+ '--block-gap': '0.5rem',
96
+ '--block-color': '#121212',
97
+ display: 'flex',
98
+ padding: 'var(--block-gap)',
99
+ gap: 'var(--block-gap)',
100
+ alignItems: 'stretch',
101
+ height: '100%',
102
+ width: '100%',
103
+ });
104
+
105
+ const TabList = styled(Box)({
106
+ flex: 'none',
107
+ width: '10rem',
108
+ height: 'min-content',
109
+ backgroundColor: 'var(--block-color)',
110
+ borderRadius: 'var(--radius-4)',
111
+ });
112
+
113
+ const TabTrigger = styled.button({
114
+ border: 'none',
115
+ backgroundColor: 'transparent',
116
+ display: 'flex',
117
+ alignItems: 'center',
118
+ height: '3rem',
119
+ width: '100%',
120
+ color: 'var(--gray-11)',
121
+ fontSize: 'var(--font-size-2)',
122
+ transition: 'color 200ms',
123
+ fontWeight: 'bold',
124
+ cursor: 'pointer',
125
+ ':focus': {
126
+ color: 'white',
127
+ },
128
+ });
129
+
130
+ const TabBrand = styled(TabTrigger)({
131
+ color: 'var(--gray-10)',
132
+ cursor: 'default',
133
+ ':focus': {
134
+ color: 'var(--gray-10)',
135
+ },
136
+ });
137
+
138
+ const TabContent = styled(Box)({
139
+ flex: 1,
140
+ flexDirection: 'column',
141
+ alignItems: 'stretch',
142
+ display: 'flex',
143
+ gap: 'var(--space-3)',
144
+ overflow: 'hidden',
145
+ backgroundColor: 'var(--block-color)',
146
+ borderRadius: 'var(--radius-4)',
147
+ padding: '1rem',
148
+ });
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { useSnapshot } from 'valtio';
3
+ import { useStore } from '@/stores';
4
+ import { ObjectInspector } from '@/components/ObjectInspector';
5
+
6
+ const Page: React.FC = () => {
7
+ const $store = useStore();
8
+ const store = useSnapshot($store);
9
+ return (
10
+ <ObjectInspector
11
+ data={store.builder.config.resolved}
12
+ sortObjectKeys={true}
13
+ />
14
+ );
15
+ };
16
+
17
+ export default Page;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { useSnapshot } from 'valtio';
3
+ import { useStore } from '@/stores';
4
+ import { ObjectInspector } from '@/components/ObjectInspector';
5
+
6
+ const Page: React.FC = () => {
7
+ const $store = useStore();
8
+ const store = useSnapshot($store);
9
+ return (
10
+ <ObjectInspector
11
+ data={store.builder.config.transformed}
12
+ sortObjectKeys={true}
13
+ />
14
+ );
15
+ };
16
+
17
+ export default Page;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { useSnapshot } from 'valtio';
3
+ import { useStore } from '@/stores';
4
+ import { ObjectInspector } from '@/components/ObjectInspector';
5
+
6
+ const Page: React.FC = () => {
7
+ const $store = useStore();
8
+ const store = useSnapshot($store);
9
+ return (
10
+ <ObjectInspector
11
+ data={store.bundler.config.resolved}
12
+ sortObjectKeys={true}
13
+ />
14
+ );
15
+ };
16
+
17
+ export default Page;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { useSnapshot } from 'valtio';
3
+ import { useStore } from '@/stores';
4
+ import { ObjectInspector } from '@/components/ObjectInspector';
5
+
6
+ const Page: React.FC = () => {
7
+ const $store = useStore();
8
+ const store = useSnapshot($store);
9
+ return (
10
+ <ObjectInspector
11
+ data={store.bundler.config.transformed}
12
+ sortObjectKeys={true}
13
+ />
14
+ );
15
+ };
16
+
17
+ export default Page;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { useSnapshot } from 'valtio';
3
+ import { useStore } from '@/stores';
4
+ import { ObjectInspector } from '@/components/ObjectInspector';
5
+
6
+ const Page: React.FC = () => {
7
+ const $store = useStore();
8
+ const store = useSnapshot($store);
9
+ return (
10
+ <ObjectInspector
11
+ data={store.framework.config.resolved}
12
+ sortObjectKeys={true}
13
+ />
14
+ );
15
+ };
16
+
17
+ export default Page;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { useSnapshot } from 'valtio';
3
+ import { useStore } from '@/stores';
4
+ import { ObjectInspector } from '@/components/ObjectInspector';
5
+
6
+ const Page: React.FC = () => {
7
+ const $store = useStore();
8
+ const store = useSnapshot($store);
9
+ return (
10
+ <ObjectInspector
11
+ data={store.framework.config.transformed}
12
+ sortObjectKeys={true}
13
+ />
14
+ );
15
+ };
16
+
17
+ export default Page;
@@ -0,0 +1,68 @@
1
+ import { Suspense } from 'react';
2
+ import { Outlet, useNavigate } from '@modern-js/runtime/router';
3
+ import { Box, ScrollArea, Select } from '@radix-ui/themes';
4
+ import styled from '@emotion/styled';
5
+
6
+ export default function Layout() {
7
+ const navigate = useNavigate();
8
+ const handleSelect = (route: string) => {
9
+ navigate(route);
10
+ };
11
+ return (
12
+ <Container>
13
+ <Box grow="0">
14
+ <Select.Root
15
+ onValueChange={handleSelect}
16
+ defaultValue="builder/transformed"
17
+ >
18
+ <Select.Trigger />
19
+ <Select.Content position="popper">
20
+ <Select.Group>
21
+ <Select.Label>Framework</Select.Label>
22
+ <Select.Item value="framework/resolved">
23
+ Resolved Framework Config
24
+ </Select.Item>
25
+ <Select.Item value="framework/transformed">
26
+ Transformed Framework Config
27
+ </Select.Item>
28
+ </Select.Group>
29
+ <Select.Separator />
30
+ <Select.Group>
31
+ <Select.Label>Builder</Select.Label>
32
+ <Select.Item value="builder/resolved">
33
+ Resolved Builder Config
34
+ </Select.Item>
35
+ <Select.Item value="builder/transformed">
36
+ Transformed Builder Config
37
+ </Select.Item>
38
+ </Select.Group>
39
+ <Select.Separator />
40
+ <Select.Group>
41
+ <Select.Label>Bundler</Select.Label>
42
+ <Select.Item value="bundler/resolved">
43
+ Resolved Bundler Configs
44
+ </Select.Item>
45
+ <Select.Item value="bundler/transformed">
46
+ Transformed Bundler Configs
47
+ </Select.Item>
48
+ </Select.Group>
49
+ </Select.Content>
50
+ </Select.Root>
51
+ </Box>
52
+ <Box grow="1" asChild>
53
+ <ScrollArea scrollbars="both">
54
+ <Suspense fallback={'loading...'}>
55
+ <Outlet />
56
+ </Suspense>
57
+ </ScrollArea>
58
+ </Box>
59
+ </Container>
60
+ );
61
+ }
62
+
63
+ const Container = styled(Box)({
64
+ height: '100%',
65
+ display: 'flex',
66
+ flexDirection: 'column',
67
+ alignItems: 'stretch',
68
+ });
@@ -0,0 +1,7 @@
1
+ import { LoaderFunctionArgs, redirect } from '@modern-js/runtime/router';
2
+ import { resolveURL } from 'ufo';
3
+
4
+ export default ({ request }: LoaderFunctionArgs) => {
5
+ const target = resolveURL(request.url, './builder/transformed');
6
+ return redirect(target);
7
+ };
@@ -0,0 +1 @@
1
+ export default null;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { useSnapshot } from 'valtio';
3
+ import { useStore } from '@/stores';
4
+ import { ObjectInspector } from '@/components/ObjectInspector';
5
+
6
+ const Page: React.FC = () => {
7
+ const $store = useStore();
8
+ const store = useSnapshot($store);
9
+ return <ObjectInspector data={store.builder.context} sortObjectKeys={true} />;
10
+ };
11
+
12
+ export default Page;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { useSnapshot } from 'valtio';
3
+ import { useStore } from '@/stores';
4
+ import { ObjectInspector } from '@/components/ObjectInspector';
5
+
6
+ const Page: React.FC = () => {
7
+ const $store = useStore();
8
+ const store = useSnapshot($store);
9
+ return (
10
+ <ObjectInspector data={store.framework.context} sortObjectKeys={true} />
11
+ );
12
+ };
13
+
14
+ export default Page;
@@ -0,0 +1,38 @@
1
+ import { Suspense } from 'react';
2
+ import { Outlet, useNavigate } from '@modern-js/runtime/router';
3
+ import { Box, ScrollArea, Select } from '@radix-ui/themes';
4
+ import styled from '@emotion/styled';
5
+
6
+ export default function Layout() {
7
+ const navigate = useNavigate();
8
+ const handleSelect = (route: string) => {
9
+ navigate(route);
10
+ };
11
+ return (
12
+ <Container>
13
+ <Box grow="0">
14
+ <Select.Root onValueChange={handleSelect} defaultValue="builder">
15
+ <Select.Trigger />
16
+ <Select.Content position="popper">
17
+ <Select.Item value="framework">Framework Context</Select.Item>
18
+ <Select.Item value="builder">Builder Context</Select.Item>
19
+ </Select.Content>
20
+ </Select.Root>
21
+ </Box>
22
+ <Box grow="1" asChild>
23
+ <ScrollArea scrollbars="both">
24
+ <Suspense fallback={'loading...'}>
25
+ <Outlet />
26
+ </Suspense>
27
+ </ScrollArea>
28
+ </Box>
29
+ </Container>
30
+ );
31
+ }
32
+
33
+ const Container = styled(Box)({
34
+ height: '100%',
35
+ display: 'flex',
36
+ flexDirection: 'column',
37
+ alignItems: 'stretch',
38
+ });
@@ -0,0 +1,7 @@
1
+ import { LoaderFunctionArgs, redirect } from '@modern-js/runtime/router';
2
+ import { resolveURL } from 'ufo';
3
+
4
+ export default ({ request }: LoaderFunctionArgs) => {
5
+ const target = resolveURL(request.url, './builder');
6
+ return redirect(target);
7
+ };
@@ -0,0 +1 @@
1
+ export default null;
@@ -0,0 +1,3 @@
1
+ body {
2
+ margin: 0;
3
+ }
@@ -0,0 +1,25 @@
1
+ import '@radix-ui/themes/styles.css';
2
+ import './layout.css';
3
+ import styled from '@emotion/styled';
4
+ import { Box, Theme } from '@radix-ui/themes';
5
+ import { RootTabs } from './RootTabs';
6
+ import { StoreContextProvider } from '@/stores';
7
+
8
+ export default function Layout() {
9
+ return (
10
+ <StoreContextProvider>
11
+ <Theme appearance="dark" className="dark">
12
+ <AppContainer>
13
+ <RootTabs />
14
+ </AppContainer>
15
+ </Theme>
16
+ </StoreContextProvider>
17
+ );
18
+ }
19
+
20
+ const AppContainer = styled(Box)({
21
+ width: '100vw',
22
+ height: '100vh',
23
+ overflow: 'hidden',
24
+ backgroundColor: '#090909',
25
+ });
@@ -0,0 +1,12 @@
1
+ <svg width="455.127" height="76.954" viewBox="0 0 455.127 76.954" xmlns="http://www.w3.org/2000/svg">
2
+ <g id="svgGroup" stroke-linecap="round" fill-rule="evenodd" font-size="9pt" stroke="#d6d8db" stroke-width="0.25mm" fill="#d6d8db" style="stroke:#d6d8db;stroke-width:0.25mm;fill:#d6d8db">
3
+ <path d="M 23.096 75.977 L 0 75.977 L 0 4.59 L 24.707 4.59 A 55.919 55.919 0 0 1 33.49 5.243 Q 38.313 6.01 42.334 7.681 A 32.184 32.184 0 0 1 44.238 8.545 Q 52.246 12.5 56.421 20.117 A 32.438 32.438 0 0 1 59.678 29.175 Q 60.481 33.044 60.581 37.488 A 56.775 56.775 0 0 1 60.596 38.77 A 55.441 55.441 0 0 1 59.943 47.517 Q 58.856 54.315 55.957 59.473 Q 51.318 67.725 42.896 71.851 Q 34.473 75.977 23.096 75.977 Z M 24.902 20.166 L 19.287 20.166 L 19.287 60.156 L 23.584 60.156 A 23.978 23.978 0 0 0 28.389 59.707 Q 33.591 58.641 36.475 55.054 A 15.925 15.925 0 0 0 39.053 50.244 Q 40.576 45.85 40.576 39.453 A 40.21 40.21 0 0 0 40.342 34.984 Q 39.94 31.39 38.843 28.687 A 14.688 14.688 0 0 0 36.837 25.153 A 11.922 11.922 0 0 0 33.643 22.29 A 13.658 13.658 0 0 0 29.587 20.664 Q 27.856 20.259 25.845 20.184 A 24.996 24.996 0 0 0 24.902 20.166 Z" id="0" vector-effect="non-scaling-stroke"/>
4
+ <path d="M 123.291 44.971 L 123.291 53.467 L 89.16 53.467 A 10.988 10.988 0 0 0 90.044 57.31 A 9.877 9.877 0 0 0 92.407 60.596 Q 95.41 63.379 101.27 63.379 Q 106.445 63.379 110.767 62.354 A 42.981 42.981 0 0 0 116.273 60.633 A 52.544 52.544 0 0 0 119.678 59.18 L 119.678 72.9 Q 115.674 75 110.938 75.977 A 41.172 41.172 0 0 1 107.079 76.567 Q 103.519 76.953 98.975 76.953 A 40.077 40.077 0 0 1 90.603 76.113 A 32.226 32.226 0 0 1 84.033 73.975 A 22.906 22.906 0 0 1 73.657 64.746 Q 70.368 59.314 69.938 51.19 A 47.413 47.413 0 0 1 69.873 48.682 Q 69.873 38.721 73.291 32.3 A 22.599 22.599 0 0 1 78.792 25.436 A 21.455 21.455 0 0 1 82.861 22.778 A 28.536 28.536 0 0 1 91.334 20.114 A 37.588 37.588 0 0 1 97.168 19.678 Q 105.083 19.678 110.877 22.388 A 24.328 24.328 0 0 1 111.084 22.485 Q 116.943 25.293 120.117 30.908 A 23.114 23.114 0 0 1 122.498 37.231 Q 123.13 40.033 123.258 43.284 A 42.733 42.733 0 0 1 123.291 44.971 Z M 89.551 41.455 L 105.957 41.455 A 11.664 11.664 0 0 0 105.553 38.576 A 10.108 10.108 0 0 0 104.98 37.012 Q 104.053 35.01 102.271 33.838 A 6.912 6.912 0 0 0 99.862 32.861 A 9.817 9.817 0 0 0 97.852 32.666 A 8.801 8.801 0 0 0 94.934 33.133 A 7.628 7.628 0 0 0 92.212 34.79 A 7.286 7.286 0 0 0 90.54 37.211 Q 90.08 38.257 89.817 39.557 A 16.942 16.942 0 0 0 89.551 41.455 Z" id="1" vector-effect="non-scaling-stroke"/>
5
+ <path d="M 167.48 75.977 L 148.584 75.977 L 127.49 20.654 L 147.412 20.654 L 156.787 53.369 Q 156.924 53.78 157.254 55.389 A 112.258 112.258 0 0 1 157.3 55.615 A 19.061 19.061 0 0 1 157.591 57.518 A 14.863 14.863 0 0 1 157.666 58.984 L 158.008 58.984 A 14.573 14.573 0 0 1 158.26 56.239 A 13.298 13.298 0 0 1 158.35 55.811 Q 158.611 54.652 158.787 53.893 A 136.744 136.744 0 0 1 158.887 53.467 L 168.701 20.654 L 188.574 20.654 L 167.48 75.977 Z" id="2" vector-effect="non-scaling-stroke"/>
6
+ <path d="M 227.783 20.361 L 227.783 75.977 L 208.496 75.977 L 208.496 20.361 L 191.064 20.361 L 191.064 4.59 L 245.166 4.59 L 245.166 20.361 L 227.783 20.361 Z" id="3" vector-effect="non-scaling-stroke"/>
7
+ <path d="M 306.662 54.35 A 43.23 43.23 0 0 0 307.08 48.193 Q 307.08 43.89 306.302 40.21 A 26.737 26.737 0 0 0 303.54 32.666 A 23.91 23.91 0 0 0 293.799 22.998 A 27.016 27.016 0 0 0 287.599 20.615 A 32.596 32.596 0 0 0 279.639 19.678 A 37.958 37.958 0 0 0 272.777 20.269 A 27.435 27.435 0 0 0 264.771 22.998 A 22.673 22.673 0 0 0 255.2 32.666 A 24.588 24.588 0 0 0 254.552 33.991 Q 251.855 39.95 251.855 48.193 A 41.077 41.077 0 0 0 252.243 53.961 A 30.674 30.674 0 0 0 253.882 60.498 A 28.789 28.789 0 0 0 254.738 62.531 A 24.022 24.022 0 0 0 259.619 69.531 A 24.539 24.539 0 0 0 268.335 75.073 A 28.236 28.236 0 0 0 272.567 76.29 A 33.502 33.502 0 0 0 279.346 76.953 A 39.162 39.162 0 0 0 284.365 76.643 A 30.239 30.239 0 0 0 290.918 75.073 A 26.901 26.901 0 0 0 291.395 74.893 A 23.287 23.287 0 0 0 299.658 69.531 Q 303.271 65.869 305.176 60.498 A 32.011 32.011 0 0 0 306.662 54.35 Z M 271.24 48.193 Q 271.24 52.93 272.07 56.177 Q 272.9 59.424 274.731 61.108 A 6.244 6.244 0 0 0 277.833 62.637 A 8.91 8.91 0 0 0 279.541 62.793 A 8.544 8.544 0 0 0 281.524 62.575 A 5.857 5.857 0 0 0 284.277 61.108 A 7.765 7.765 0 0 0 285.716 59.186 Q 286.195 58.303 286.547 57.212 A 15.643 15.643 0 0 0 286.841 56.177 A 24.171 24.171 0 0 0 287.332 53.532 Q 287.527 52.055 287.601 50.353 A 49.717 49.717 0 0 0 287.646 48.193 A 46.12 46.12 0 0 0 287.536 44.893 Q 287.348 42.279 286.841 40.283 Q 286.035 37.109 284.253 35.498 A 6.007 6.007 0 0 0 281.618 34.133 Q 280.696 33.904 279.609 33.888 A 11.184 11.184 0 0 0 279.443 33.887 A 8.132 8.132 0 0 0 276.824 34.285 Q 274.568 35.049 273.292 37.277 A 8.551 8.551 0 0 0 273.169 37.5 A 13.288 13.288 0 0 0 272.091 40.319 Q 271.24 43.492 271.24 48.193 Z" id="4" vector-effect="non-scaling-stroke"/>
8
+ <path d="M 370.382 54.35 A 43.23 43.23 0 0 0 370.801 48.193 Q 370.801 43.89 370.023 40.21 A 26.737 26.737 0 0 0 367.261 32.666 A 23.91 23.91 0 0 0 357.52 22.998 A 27.016 27.016 0 0 0 351.32 20.615 A 32.596 32.596 0 0 0 343.359 19.678 A 37.958 37.958 0 0 0 336.497 20.269 A 27.435 27.435 0 0 0 328.491 22.998 A 22.673 22.673 0 0 0 318.921 32.666 A 24.588 24.588 0 0 0 318.273 33.991 Q 315.576 39.95 315.576 48.193 A 41.077 41.077 0 0 0 315.964 53.961 A 30.674 30.674 0 0 0 317.603 60.498 A 28.789 28.789 0 0 0 318.458 62.531 A 24.022 24.022 0 0 0 323.34 69.531 A 24.539 24.539 0 0 0 332.056 75.073 A 28.236 28.236 0 0 0 336.287 76.29 A 33.502 33.502 0 0 0 343.066 76.953 A 39.162 39.162 0 0 0 348.086 76.643 A 30.239 30.239 0 0 0 354.639 75.073 A 26.901 26.901 0 0 0 355.116 74.893 A 23.287 23.287 0 0 0 363.379 69.531 Q 366.992 65.869 368.896 60.498 A 32.011 32.011 0 0 0 370.382 54.35 Z M 334.961 48.193 Q 334.961 52.93 335.791 56.177 Q 336.621 59.424 338.452 61.108 A 6.244 6.244 0 0 0 341.553 62.637 A 8.91 8.91 0 0 0 343.262 62.793 A 8.544 8.544 0 0 0 345.245 62.575 A 5.857 5.857 0 0 0 347.998 61.108 A 7.765 7.765 0 0 0 349.437 59.186 Q 349.916 58.303 350.268 57.212 A 15.643 15.643 0 0 0 350.562 56.177 A 24.171 24.171 0 0 0 351.052 53.532 Q 351.248 52.055 351.322 50.353 A 49.717 49.717 0 0 0 351.367 48.193 A 46.12 46.12 0 0 0 351.256 44.893 Q 351.068 42.279 350.562 40.283 Q 349.756 37.109 347.974 35.498 A 6.007 6.007 0 0 0 345.339 34.133 Q 344.416 33.904 343.329 33.888 A 11.184 11.184 0 0 0 343.164 33.887 A 8.132 8.132 0 0 0 340.545 34.285 Q 338.289 35.049 337.013 37.277 A 8.551 8.551 0 0 0 336.89 37.5 A 13.288 13.288 0 0 0 335.811 40.319 Q 334.961 43.492 334.961 48.193 Z" id="5" vector-effect="non-scaling-stroke"/>
9
+ <path d="M 400.781 0 L 400.781 75.977 L 381.689 75.977 L 381.689 0 L 400.781 0 Z" id="6" vector-effect="non-scaling-stroke"/>
10
+ <path d="M 411.719 73.877 L 411.719 58.594 A 46.942 46.942 0 0 0 422.363 62.036 Q 426.83 62.901 429.739 63.053 A 22.453 22.453 0 0 0 430.908 63.086 A 23.338 23.338 0 0 0 432.541 63.033 Q 434.538 62.892 435.62 62.378 A 3.273 3.273 0 0 0 436.357 61.909 A 2.089 2.089 0 0 0 437.109 60.254 Q 437.109 59.033 436.108 58.179 A 6.393 6.393 0 0 0 435.444 57.691 Q 434.691 57.202 433.504 56.638 A 34.704 34.704 0 0 0 432.544 56.201 Q 430.581 55.341 427.402 54.024 A 655.312 655.312 0 0 0 425.342 53.174 Q 420.752 51.27 417.7 49.023 A 15.29 15.29 0 0 1 414.486 45.872 A 13.596 13.596 0 0 1 413.135 43.652 A 14.224 14.224 0 0 1 412.024 40.293 Q 411.703 38.727 411.638 36.922 A 25.946 25.946 0 0 1 411.621 35.986 A 16.624 16.624 0 0 1 412.394 30.782 A 13.104 13.104 0 0 1 417.871 23.779 Q 423.083 20.359 431.115 19.791 A 46.937 46.937 0 0 1 434.424 19.678 A 44.511 44.511 0 0 1 441.957 20.296 A 38.904 38.904 0 0 1 444.727 20.874 A 56.912 56.912 0 0 1 451.218 22.917 A 69.134 69.134 0 0 1 454.736 24.365 L 449.512 36.67 Q 445.41 34.814 441.211 33.691 Q 437.323 32.652 434.9 32.575 A 11.911 11.911 0 0 0 434.521 32.568 Q 432.275 32.568 431.055 33.154 A 2.789 2.789 0 0 0 430.465 33.526 A 1.672 1.672 0 0 0 429.834 34.863 A 2.288 2.288 0 0 0 430.42 36.394 A 3.206 3.206 0 0 0 430.688 36.67 Q 431.337 37.263 432.872 37.997 A 28.563 28.563 0 0 0 433.936 38.477 Q 436.328 39.502 440.918 41.357 A 51.888 51.888 0 0 1 444.568 42.989 Q 446.261 43.83 447.675 44.717 A 27.253 27.253 0 0 1 448.901 45.532 A 14.95 14.95 0 0 1 452.141 48.593 A 13.247 13.247 0 0 1 453.589 50.928 A 14.028 14.028 0 0 1 454.64 54.032 Q 455.127 56.238 455.127 58.984 A 20.16 20.16 0 0 1 454.465 64.243 A 16.821 16.821 0 0 1 452.783 68.311 A 14.139 14.139 0 0 1 448.563 72.827 A 19.641 19.641 0 0 1 445.288 74.658 A 23.27 23.27 0 0 1 440.768 76.101 Q 438.568 76.58 435.986 76.79 A 52.548 52.548 0 0 1 431.738 76.953 A 94.534 94.534 0 0 1 426.473 76.814 Q 423.644 76.656 421.167 76.318 A 42.222 42.222 0 0 1 413.509 74.513 A 48.282 48.282 0 0 1 411.719 73.877 Z" id="7" vector-effect="non-scaling-stroke"/>
11
+ </g>
12
+ </svg>