@corva/create-app 0.0.0-b560f33 → 0.0.0-e3730ad

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 (46) hide show
  1. package/README.md +5 -5
  2. package/common/python/Makefile +8 -5
  3. package/common/python/pyproject.toml +25 -0
  4. package/common/python/uv.lock +381 -0
  5. package/lib/commands/create.js +5 -5
  6. package/lib/constants/cli.js +6 -8
  7. package/lib/constants/manifest.js +3 -3
  8. package/lib/constants/package.js +51 -13
  9. package/lib/flows/lib/api.js +23 -8
  10. package/lib/flows/lib/manifest.js +1 -1
  11. package/lib/flows/steps/zip-file-list-resolve.js +13 -8
  12. package/lib/helpers/cli-version.js +14 -1
  13. package/lib/helpers/resolve-app-runtime.js +30 -15
  14. package/lib/helpers/utils.js +6 -2
  15. package/lib/main.js +3 -8
  16. package/package.json +1 -1
  17. package/templates/ui/javascript/.codex/config.toml +3 -0
  18. package/templates/ui/javascript/.cursor/mcp.json +8 -0
  19. package/templates/ui/javascript/.mcp.json +8 -0
  20. package/templates/ui/javascript/AGENTS.md +304 -0
  21. package/templates/ui/javascript/CLAUDE.md +1 -0
  22. package/templates/ui/javascript/src/App.completion.js +6 -17
  23. package/templates/ui/javascript/src/App.drilling.js +7 -11
  24. package/templates/ui/javascript/src/AppSettings.js +6 -20
  25. package/templates/ui/javascript/src/__tests__/App.test.js +4 -24
  26. package/templates/ui/javascript/src/__tests__/AppSettings.test.js +12 -5
  27. package/templates/ui/javascript/src/index.js +1 -0
  28. package/templates/ui/typescript/.codex/config.toml +3 -0
  29. package/templates/ui/typescript/.cursor/mcp.json +8 -0
  30. package/templates/ui/typescript/.mcp.json +8 -0
  31. package/templates/ui/typescript/AGENTS.md +344 -0
  32. package/templates/ui/typescript/CLAUDE.md +1 -0
  33. package/templates/ui/typescript/src/App.completion.tsx +6 -10
  34. package/templates/ui/typescript/src/App.drilling.tsx +7 -9
  35. package/templates/ui/typescript/src/AppSettings.tsx +4 -4
  36. package/templates/ui/typescript/src/__mocks__/mockData.ts +15 -187
  37. package/templates/ui/typescript/src/__tests__/App.test.tsx +5 -73
  38. package/templates/ui/typescript/src/__tests__/AppSettings.test.tsx +9 -13
  39. package/templates/ui/typescript/src/custom.d.ts +10 -0
  40. package/templates/ui/typescript/src/index.js +1 -0
  41. package/templates/ui/typescript/src/types.ts +0 -615
  42. package/common/python/requirements.txt +0 -2
  43. package/templates/ui/javascript/src/__mocks__/mockAppProps.js +0 -590
  44. package/templates/ui/javascript/src/__mocks__/mockAppSettingsProps.js +0 -290
  45. /package/templates/ui/javascript/src/{App.css → App.scss} +0 -0
  46. /package/templates/ui/typescript/src/{App.css → App.scss} +0 -0
@@ -2,47 +2,13 @@ import { render, screen } from '@testing-library/react';
2
2
  import { AppTestWrapper } from '@corva/ui/testing';
3
3
 
4
4
  import App from '../App';
5
- import { mockApp, mockUser, mockAppHeaderProps } from '../__mocks__/mockData';
5
+ import { mockAppSettings } from '../__mocks__/mockData';
6
6
 
7
7
  describe('<App />', () => {
8
8
  it('should show correct layout', () => {
9
9
  render(
10
- <AppTestWrapper
11
- app={{}}
12
- appId={123}
13
- maximized={false}
14
- appSettings={{}}
15
- onSettingChange={() => {
16
- /* noop */
17
- }}
18
- >
19
- <App
20
- app={mockApp}
21
- package="test"
22
- coordinates={{ w: 0, h: 0, x: 0, y: 0, pixelHeight: 0, pixelWidth: 0 }}
23
- currentUser={mockUser}
24
- devCenterRouter={{ location: { pathname: '', query: {} } }}
25
- segment="test"
26
- appHeaderProps={mockAppHeaderProps}
27
- isNative={false}
28
- layoutEnvironment={{ type: 'test', pdfReportMode: false }}
29
- onSettingChange={() => {
30
- /* noop */
31
- }}
32
- onSettingsChange={() => {
33
- /* noop */
34
- }}
35
- setIsFullscreenModalMode={() => Promise.resolve()}
36
- setIsMaximized={() => {
37
- /* noop */
38
- }}
39
- setMainMenuItems={() => {
40
- /* noop */
41
- }}
42
- setSecondaryMenuItems={() => {
43
- /* noop */
44
- }}
45
- />
10
+ <AppTestWrapper appSettings={mockAppSettings}>
11
+ <App />
46
12
  </AppTestWrapper>
47
13
  );
48
14
 
@@ -51,42 +17,8 @@ describe('<App />', () => {
51
17
 
52
18
  it('should show correct layout when settings are not provided', () => {
53
19
  render(
54
- <AppTestWrapper
55
- app={{}}
56
- appId={123}
57
- maximized={false}
58
- appSettings={{}}
59
- onSettingChange={() => {
60
- /* noop */
61
- }}
62
- >
63
- <App
64
- app={mockApp}
65
- package="test"
66
- coordinates={{ w: 0, h: 0, x: 0, y: 0, pixelHeight: 0, pixelWidth: 0 }}
67
- currentUser={mockUser}
68
- devCenterRouter={{ location: { pathname: '', query: {} } }}
69
- segment="test"
70
- appHeaderProps={mockAppHeaderProps}
71
- isNative={false}
72
- layoutEnvironment={{ type: 'test', pdfReportMode: false }}
73
- onSettingChange={() => {
74
- /* noop */
75
- }}
76
- onSettingsChange={() => {
77
- /* noop */
78
- }}
79
- setIsFullscreenModalMode={() => Promise.resolve()}
80
- setIsMaximized={() => {
81
- /* noop */
82
- }}
83
- setMainMenuItems={() => {
84
- /* noop */
85
- }}
86
- setSecondaryMenuItems={() => {
87
- /* noop */
88
- }}
89
- />
20
+ <AppTestWrapper appSettings={{}}>
21
+ <App />
90
22
  </AppTestWrapper>
91
23
  );
92
24
 
@@ -1,24 +1,20 @@
1
1
  import { render, screen, act } from '@testing-library/react';
2
2
  import userEvent from '@testing-library/user-event';
3
+ import { AppTestWrapper } from '@corva/ui/testing';
3
4
 
4
5
  import AppSettings from '../AppSettings';
5
- import { mockApp, mockUser, mockAppData } from '../__mocks__/mockData';
6
6
 
7
7
  describe('<AppSettings />', () => {
8
8
  it('should call onChange with a changed setting on settings change', async () => {
9
- const handleSettingsChange = jest.fn();
10
- const handleSettingsChangeAll = jest.fn();
9
+ const handleSettingChange = jest.fn();
11
10
 
12
11
  render(
13
- <AppSettings
14
- app={mockApp}
15
- appData={mockAppData}
16
- settings={{ isExampleCheckboxChecked: true }}
17
- layoutEnvironment={{ type: 'test', pdfReportMode: false }}
18
- currentUser={mockUser}
19
- onSettingChange={handleSettingsChange}
20
- onSettingsChange={handleSettingsChangeAll}
21
- />
12
+ <AppTestWrapper
13
+ appSettings={{ isExampleCheckboxChecked: true }}
14
+ onSettingChange={handleSettingChange}
15
+ >
16
+ <AppSettings />
17
+ </AppTestWrapper>
22
18
  );
23
19
 
24
20
  const exampleCheckbox = screen.getByRole('checkbox', { name: /example/i });
@@ -27,6 +23,6 @@ describe('<AppSettings />', () => {
27
23
  await userEvent.click(exampleCheckbox);
28
24
  });
29
25
 
30
- expect(handleSettingsChange).toBeCalledWith('isExampleCheckboxChecked', false);
26
+ expect(handleSettingChange).toBeCalledWith('isExampleCheckboxChecked', false);
31
27
  });
32
28
  });
@@ -7,3 +7,13 @@ declare module '*.css' {
7
7
  const content: Record<string, string>;
8
8
  export default content;
9
9
  }
10
+
11
+ declare module '*.scss' {
12
+ const content: Record<string, string>;
13
+ export default content;
14
+ }
15
+
16
+ declare module '*.sass' {
17
+ const content: Record<string, string>;
18
+ export default content;
19
+ }
@@ -1,3 +1,4 @@
1
+ // DO NOT modify this structure
1
2
  import App from './App';
2
3
  import AppSettings from './AppSettings';
3
4