@corva/create-app 0.0.0-73c49372-test → 0.0.0-8bf627d

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 (71) hide show
  1. package/README.md +7 -0
  2. package/bin/create-corva-app.cjs +4 -9
  3. package/common/python/requirements.txt +1 -1
  4. package/lib/commands/release.js +6 -0
  5. package/lib/constants/cli.js +14 -3
  6. package/lib/constants/manifest.js +3 -2
  7. package/lib/constants/package.js +35 -15
  8. package/lib/flows/lib/api.js +23 -14
  9. package/lib/flows/lib/manifest.js +1 -1
  10. package/lib/flows/steps/release/upload-zip-to-corva.js +74 -0
  11. package/lib/flows/steps/zip-file-list-resolve.js +13 -7
  12. package/lib/helpers/cli-version.js +39 -3
  13. package/lib/helpers/manifest.js +9 -1
  14. package/lib/helpers/resolve-app-runtime.js +7 -6
  15. package/lib/helpers/utils.js +7 -1
  16. package/lib/main.js +1 -5
  17. package/package.json +1 -104
  18. package/template_extensions/corva/.eslintrc +32 -0
  19. package/template_extensions/corva/.github/workflows/develop.yml +2 -0
  20. package/template_extensions/corva/.release-please-manifest.json +3 -0
  21. package/template_extensions/corva/release-please-config.json +10 -0
  22. package/templates/scheduler_data-time/javascript/__tests__/processor.spec.js +1 -1
  23. package/templates/scheduler_data-time/typescript/__tests__/processor.spec.ts +1 -1
  24. package/templates/scheduler_depth/javascript/__tests__/processor.spec.js +1 -1
  25. package/templates/scheduler_depth/typescript/__tests__/processor.spec.ts +1 -1
  26. package/templates/scheduler_natural-time/javascript/__tests__/processor.spec.js +1 -1
  27. package/templates/scheduler_natural-time/typescript/__tests__/processor.spec.ts +1 -1
  28. package/templates/stream_depth/javascript/__tests__/processor.spec.js +1 -1
  29. package/templates/stream_depth/typescript/__tests__/processor.spec.ts +1 -1
  30. package/templates/stream_time/javascript/__tests__/processor.spec.js +1 -1
  31. package/templates/stream_time/typescript/__tests__/processor.spec.ts +1 -1
  32. package/templates/task/javascript/__tests__/processor.spec.js +1 -1
  33. package/templates/task/typescript/__tests__/processor.spec.ts +1 -1
  34. package/templates/ui/javascript/.codex/config.toml +3 -0
  35. package/templates/ui/javascript/.cursor/mcp.json +8 -0
  36. package/templates/ui/javascript/.mcp.json +8 -0
  37. package/templates/ui/javascript/AGENTS.md +304 -0
  38. package/templates/ui/javascript/CLAUDE.md +1 -0
  39. package/templates/ui/javascript/config/jest/setupTests.js +19 -0
  40. package/templates/ui/javascript/src/App.completion.js +35 -47
  41. package/templates/ui/javascript/src/App.drilling.js +36 -45
  42. package/templates/ui/javascript/src/App.scss +17 -0
  43. package/templates/ui/javascript/src/AppSettings.js +6 -20
  44. package/templates/ui/javascript/src/__tests__/App.test.js +11 -6
  45. package/templates/ui/javascript/src/__tests__/AppSettings.test.js +12 -5
  46. package/templates/ui/javascript/src/__tests__/TestsExample.test.js +2 -2
  47. package/templates/ui/javascript/src/index.js +1 -0
  48. package/templates/ui/typescript/.codex/config.toml +3 -0
  49. package/templates/ui/typescript/.cursor/mcp.json +8 -0
  50. package/templates/ui/typescript/.mcp.json +8 -0
  51. package/templates/ui/typescript/AGENTS.md +344 -0
  52. package/templates/ui/typescript/CLAUDE.md +1 -0
  53. package/templates/ui/typescript/config/jest/setupTests.js +19 -0
  54. package/templates/ui/typescript/src/App.completion.tsx +35 -49
  55. package/templates/ui/typescript/src/App.drilling.tsx +35 -46
  56. package/templates/ui/typescript/src/App.scss +17 -0
  57. package/templates/ui/typescript/src/AppSettings.tsx +4 -14
  58. package/templates/ui/typescript/src/__mocks__/mockData.ts +22 -0
  59. package/templates/ui/typescript/src/__tests__/App.test.tsx +12 -6
  60. package/templates/ui/typescript/src/__tests__/AppSettings.test.tsx +12 -5
  61. package/templates/ui/typescript/src/__tests__/TestsExample.test.tsx +2 -2
  62. package/templates/ui/typescript/src/custom.d.ts +10 -0
  63. package/templates/ui/typescript/src/index.js +1 -0
  64. package/templates/ui/typescript/src/types.ts +3 -0
  65. package/templates/ui/typescript/tsconfig.json +0 -1
  66. package/templates/ui/javascript/src/App.css +0 -30
  67. package/templates/ui/javascript/src/__mocks__/mockAppProps.js +0 -590
  68. package/templates/ui/javascript/src/__mocks__/mockAppSettingsProps.js +0 -290
  69. package/templates/ui/typescript/src/App.css +0 -30
  70. package/templates/ui/typescript/src/__mocks__/mockAppProps.ts +0 -590
  71. package/templates/ui/typescript/src/__mocks__/mockAppSettingsProps.ts +0 -290
@@ -1,63 +1,51 @@
1
- import { AppHeader } from '@corva/ui/components';
1
+ import { AppContainer, AppHeader } from '@corva/ui/componentsV2';
2
+ import { useAppCommons } from '@corva/ui/effects';
2
3
 
3
4
  import { DEFAULT_SETTINGS } from './constants';
4
5
  import logo from './assets/logo.svg';
5
6
 
6
- import styles from './App.css';
7
+ import styles from './App.scss';
7
8
 
8
- /**
9
- * @param {Object} props
10
- * @param {boolean} props.isExampleCheckboxChecked
11
- * @param {Object} props.appHeaderProps
12
- * @param {Object} props.fracFleet
13
- * @param {Object} props.well
14
- * @param {Object[]} props.wells
15
- * @returns
16
- */
17
- function App({
18
- appHeaderProps,
19
- isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
20
- fracFleet,
21
- well,
22
- wells,
23
- }) {
9
+ const App = () => {
10
+ const { appKey, fracFleet, well, wells, appSettings } = useAppCommons();
11
+ const { isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked } =
12
+ appSettings || {};
24
13
  // NOTE: On general type dashboard app receives wells array
25
14
  // on asset type dashboard app receives well object
26
15
  const wellsList = wells || [well];
27
16
 
28
17
  return (
29
- <div className={styles.container}>
30
- <AppHeader {...appHeaderProps} />
31
- <div className={styles.content}>
32
- <div>
33
- <img src={logo} alt="logo" className={styles.logo} />
34
- <p>
35
- Edit <code>src/App.js</code> and save to reload.
36
- <br />
37
- <br />
38
- </p>
39
- <p>
40
- Frac Fleet: {fracFleet?.name || 'No Frac Fleet'}
41
- <br />
42
- Wells: {wellsList.map(well => well.name).join(', ')}
43
- </p>
44
- <a
45
- className="App-link"
46
- href="https://reactjs.org"
47
- target="_blank"
48
- rel="noopener noreferrer"
49
- >
50
- Learn React
51
- </a>
52
- </div>
53
- <div>
54
- Settings &quot;Example&quot; checkbox is{' '}
18
+ <AppContainer header={<AppHeader />} testId={appKey}>
19
+ <div className={styles.container}>
20
+ <img src={logo} alt="logo" className={styles.logo} />
21
+ <p>
22
+ Edit <code>src/App.js</code> and save to reload.
23
+ <br />
24
+ <br />
25
+ </p>
26
+ <p>
27
+ Frac Fleet: <span data-testid="fracFleet">{fracFleet?.name || 'No Frac Fleet'}</span>
28
+ <br />
29
+ Wells: <span data-testid="wellsList">{wellsList.map(well => well?.name).join(', ')}</span>
30
+ </p>
31
+ <a
32
+ className="App-link"
33
+ href="https://reactjs.org"
34
+ target="_blank"
35
+ rel="noopener noreferrer"
36
+ >
37
+ Learn React
38
+ </a>
39
+ </div>
40
+ <div>
41
+ Settings &quot;Example&quot; checkbox is{' '}
42
+ <span data-testid="exampleCheckboxChecked">
55
43
  {isExampleCheckboxChecked ? 'checked' : 'unchecked'}
56
- </div>
44
+ </span>
57
45
  </div>
58
- </div>
46
+ </AppContainer>
59
47
  );
60
- }
48
+ };
61
49
 
62
50
  // Important: Do not change root component default export (App.js). Use it as container
63
51
  // for your App. It's required to make build and zip scripts work as expected;
@@ -1,57 +1,48 @@
1
- import { AppHeader } from '@corva/ui/components';
1
+ import { AppContainer, AppHeader } from '@corva/ui/componentsV2';
2
+ import { useAppCommons } from '@corva/ui/effects';
2
3
 
3
4
  import { DEFAULT_SETTINGS } from './constants';
4
5
  import logo from './assets/logo.svg';
5
6
 
6
- import styles from './App.css';
7
+ import styles from './App.scss';
8
+
9
+ const App = () => {
10
+ const { appKey, rig, well, appSettings } = useAppCommons();
11
+ const { isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked } =
12
+ appSettings || {};
7
13
 
8
- /**
9
- * @param {Object} props
10
- * @param {Object} props.appHeaderProps
11
- * @param {boolean} props.isExampleCheckboxChecked
12
- * @param {Object} props.rig
13
- * @param {Object} props.well
14
- * @returns
15
- */
16
- function App({
17
- appHeaderProps,
18
- isExampleCheckboxChecked = DEFAULT_SETTINGS.isExampleCheckboxChecked,
19
- rig,
20
- well,
21
- }) {
22
14
  return (
23
- <div className={styles.container}>
24
- <AppHeader {...appHeaderProps} />
25
- <div className={styles.content}>
26
- <div>
27
- <img src={logo} alt="logo" className={styles.logo} />
28
- <p>
29
- Edit <code>src/App.js</code> and save to reload.
30
- <br />
31
- <br />
32
- </p>
33
- <p>
34
- Rig: {rig.name}
35
- <br />
36
- Well: {well.name}
37
- </p>
38
- <a
39
- className="App-link"
40
- href="https://reactjs.org"
41
- target="_blank"
42
- rel="noopener noreferrer"
43
- >
44
- Learn React
45
- </a>
46
- </div>
47
- <div>
48
- Settings &quot;Example&quot; checkbox is{' '}
15
+ <AppContainer header={<AppHeader />} testId={appKey}>
16
+ <div className={styles.container}>
17
+ <img src={logo} alt="logo" className={styles.logo} />
18
+ <p>
19
+ Edit <code>src/App.js</code> and save to reload.
20
+ <br />
21
+ <br />
22
+ </p>
23
+ <p>
24
+ Rig: <span data-testid="rig">{rig?.name}</span>
25
+ <br />
26
+ Well: <span data-testid="well">{well?.name}</span>
27
+ </p>
28
+ <a
29
+ className="App-link"
30
+ href="https://reactjs.org"
31
+ target="_blank"
32
+ rel="noopener noreferrer"
33
+ >
34
+ Learn React
35
+ </a>
36
+ </div>
37
+ <div>
38
+ Settings &quot;Example&quot; checkbox is{' '}
39
+ <span data-testid="exampleCheckboxState">
49
40
  {isExampleCheckboxChecked ? 'checked' : 'unchecked'}
50
- </div>
41
+ </span>
51
42
  </div>
52
- </div>
43
+ </AppContainer>
53
44
  );
54
- }
45
+ };
55
46
 
56
47
  // Important: Do not change root component default export (App.js). Use it as container
57
48
  // for your App. It's required to make build and zip scripts work as expected;
@@ -0,0 +1,17 @@
1
+ .container {
2
+ text-align: center;
3
+ }
4
+
5
+ @keyframes App-logo-spin {
6
+ from {
7
+ transform: rotate(0deg);
8
+ }
9
+ to {
10
+ transform: rotate(-360deg);
11
+ }
12
+ }
13
+
14
+ .logo {
15
+ animation: App-logo-spin infinite 20s linear;
16
+ height: 50px;
17
+ }
@@ -1,26 +1,12 @@
1
1
  import { Checkbox, FormControlLabel } from '@material-ui/core';
2
+ import { useAppCommons } from '@corva/ui/effects';
2
3
 
3
4
  import { DEFAULT_SETTINGS } from './constants';
4
5
 
5
- /**
6
- * @param {Object} props
7
- * @param {Object} props.app
8
- * @param {Object} props.appData
9
- * @param {Object} props.company
10
- * @param {(key: string, value: any) => void} props.onSettingChange
11
- * @param {{isExampleCheckboxChecked: boolean}} props.settings
12
- * @param {Object} props.user
13
- * @returns
14
- */
15
- function AppSettings({
16
- settings: apiSettings,
17
- onSettingChange,
18
- // appData,
19
- // app,
20
- // user = {},
21
- // company = {},
22
- }) {
23
- const settings = { ...DEFAULT_SETTINGS, ...apiSettings };
6
+ const AppSettings = () => {
7
+ const { appSettings, onSettingChange } = useAppCommons();
8
+ const settings = { ...DEFAULT_SETTINGS, ...appSettings };
9
+
24
10
  return (
25
11
  <div>
26
12
  <FormControlLabel
@@ -35,7 +21,7 @@ function AppSettings({
35
21
  />
36
22
  </div>
37
23
  );
38
- }
24
+ };
39
25
 
40
26
  // Important: Do not change root component default export (AppSettings.js). Use it as container
41
27
  // for your App Settings. It's required to make build and zip scripts work as expected;
@@ -1,20 +1,25 @@
1
1
  import { render, screen } from '@testing-library/react';
2
+ import { AppTestWrapper } from '@corva/ui/testing';
2
3
 
3
4
  import App from '../App';
4
- import { mockAppProps } from '../__mocks__/mockAppProps';
5
5
 
6
6
  describe('<App />', () => {
7
7
  it('should show correct layout', () => {
8
- render(<App {...mockAppProps} />);
8
+ render(
9
+ <AppTestWrapper appSettings={{ isExampleCheckboxChecked: true }}>
10
+ <App />
11
+ </AppTestWrapper>
12
+ );
9
13
 
10
14
  screen.getByText(/checked/i);
11
15
  });
12
16
 
13
17
  it('should show correct layout when settings are not provided', () => {
14
- const propsWithoutSettings = mockAppProps;
15
- delete propsWithoutSettings.isExampleCheckboxChecked;
16
-
17
- render(<App {...propsWithoutSettings} />);
18
+ render(
19
+ <AppTestWrapper appSettings={{}}>
20
+ <App />
21
+ </AppTestWrapper>
22
+ );
18
23
 
19
24
  screen.getByText(/unchecked/i);
20
25
  });
@@ -1,21 +1,28 @@
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 { mockAppSettingsProps } from '../__mocks__/mockAppSettingsProps';
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();
9
+ const handleSettingChange = jest.fn();
10
10
 
11
- render(<AppSettings {...mockAppSettingsProps} onSettingChange={handleSettingsChange} />);
11
+ render(
12
+ <AppTestWrapper
13
+ appSettings={{ isExampleCheckboxChecked: true }}
14
+ onSettingChange={handleSettingChange}
15
+ >
16
+ <AppSettings />
17
+ </AppTestWrapper>
18
+ );
12
19
 
13
- const exampleCheckbox = screen.getByTestId('exampleCheckbox').querySelector('input');
20
+ const exampleCheckbox = screen.getByRole('checkbox', { name: /example/i });
14
21
 
15
22
  await act(async () => {
16
23
  await userEvent.click(exampleCheckbox);
17
24
  });
18
25
 
19
- expect(handleSettingsChange).toBeCalledWith('isExampleCheckboxChecked', false);
26
+ expect(handleSettingChange).toBeCalledWith('isExampleCheckboxChecked', false);
20
27
  });
21
28
  });
@@ -1,6 +1,6 @@
1
1
  import { useState } from 'react';
2
2
  import { render, screen, waitFor } from '@testing-library/react';
3
- import { components } from '@corva/ui';
3
+ import { Button } from '@corva/ui/componentsV2';
4
4
  import userEvent from '@testing-library/user-event';
5
5
 
6
6
  const Toggle = () => {
@@ -9,7 +9,7 @@ const Toggle = () => {
9
9
  return (
10
10
  <>
11
11
  {isOn ? 'ON' : 'OFF'}
12
- <components.Button onClick={() => setIsOn(value => !value)}>toggle</components.Button>
12
+ <Button onClick={() => setIsOn(value => !value)}>toggle</Button>
13
13
  </>
14
14
  );
15
15
  };
@@ -1,3 +1,4 @@
1
+ // DO NOT modify this structure
1
2
  import App from './App';
2
3
  import AppSettings from './AppSettings';
3
4
 
@@ -0,0 +1,3 @@
1
+ [mcp_servers.corva-ui]
2
+ command = "npx"
3
+ args = ["-p", "@corva/ui", "corva-ui-mcp"]
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "corva-ui": {
4
+ "command": "npx",
5
+ "args": ["-p", "@corva/ui", "corva-ui-mcp"]
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "mcpServers": {
3
+ "corva-ui": {
4
+ "command": "npx",
5
+ "args": ["-p", "@corva/ui", "corva-ui-mcp"]
6
+ }
7
+ }
8
+ }