@corva/create-app 0.0.0-73c49372-test → 0.0.0-747377c
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.
- package/README.md +7 -0
- package/bin/create-corva-app.cjs +4 -9
- package/common/python/requirements.txt +1 -1
- package/lib/commands/release.js +6 -0
- package/lib/constants/cli.js +14 -3
- package/lib/constants/manifest.js +3 -2
- package/lib/constants/package.js +36 -16
- package/lib/flows/lib/api.js +23 -14
- package/lib/flows/lib/manifest.js +1 -1
- package/lib/flows/steps/release/upload-zip-to-corva.js +74 -0
- package/lib/flows/steps/zip-file-list-resolve.js +13 -7
- package/lib/helpers/cli-version.js +39 -3
- package/lib/helpers/manifest.js +9 -1
- package/lib/helpers/resolve-app-runtime.js +7 -6
- package/lib/helpers/utils.js +7 -1
- package/lib/main.js +1 -5
- package/package.json +1 -104
- package/template_extensions/corva/.eslintrc +32 -0
- package/template_extensions/corva/.github/workflows/develop.yml +2 -0
- package/template_extensions/corva/.release-please-manifest.json +3 -0
- package/template_extensions/corva/release-please-config.json +10 -0
- package/templates/scheduler_data-time/javascript/__tests__/processor.spec.js +1 -1
- package/templates/scheduler_data-time/typescript/__tests__/processor.spec.ts +1 -1
- package/templates/scheduler_depth/javascript/__tests__/processor.spec.js +1 -1
- package/templates/scheduler_depth/typescript/__tests__/processor.spec.ts +1 -1
- package/templates/scheduler_natural-time/javascript/__tests__/processor.spec.js +1 -1
- package/templates/scheduler_natural-time/typescript/__tests__/processor.spec.ts +1 -1
- package/templates/stream_depth/javascript/__tests__/processor.spec.js +1 -1
- package/templates/stream_depth/typescript/__tests__/processor.spec.ts +1 -1
- package/templates/stream_time/javascript/__tests__/processor.spec.js +1 -1
- package/templates/stream_time/typescript/__tests__/processor.spec.ts +1 -1
- package/templates/task/javascript/__tests__/processor.spec.js +1 -1
- package/templates/task/typescript/__tests__/processor.spec.ts +1 -1
- package/templates/ui/javascript/.codex/config.toml +3 -0
- package/templates/ui/javascript/.cursor/mcp.json +8 -0
- package/templates/ui/javascript/.mcp.json +8 -0
- package/templates/ui/javascript/AGENTS.md +304 -0
- package/templates/ui/javascript/CLAUDE.md +1 -0
- package/templates/ui/javascript/config/jest/setupTests.js +19 -0
- package/templates/ui/javascript/src/App.completion.js +35 -47
- package/templates/ui/javascript/src/App.drilling.js +36 -45
- package/templates/ui/javascript/src/App.scss +17 -0
- package/templates/ui/javascript/src/AppSettings.js +6 -20
- package/templates/ui/javascript/src/__tests__/App.test.js +11 -6
- package/templates/ui/javascript/src/__tests__/AppSettings.test.js +12 -5
- package/templates/ui/javascript/src/__tests__/TestsExample.test.js +2 -2
- package/templates/ui/javascript/src/index.js +1 -0
- package/templates/ui/typescript/.codex/config.toml +3 -0
- package/templates/ui/typescript/.cursor/mcp.json +8 -0
- package/templates/ui/typescript/.mcp.json +8 -0
- package/templates/ui/typescript/AGENTS.md +344 -0
- package/templates/ui/typescript/CLAUDE.md +1 -0
- package/templates/ui/typescript/config/jest/setupTests.js +19 -0
- package/templates/ui/typescript/src/App.completion.tsx +35 -49
- package/templates/ui/typescript/src/App.drilling.tsx +35 -46
- package/templates/ui/typescript/src/App.scss +17 -0
- package/templates/ui/typescript/src/AppSettings.tsx +4 -14
- package/templates/ui/typescript/src/__mocks__/mockData.ts +22 -0
- package/templates/ui/typescript/src/__tests__/App.test.tsx +12 -6
- package/templates/ui/typescript/src/__tests__/AppSettings.test.tsx +12 -5
- package/templates/ui/typescript/src/__tests__/TestsExample.test.tsx +2 -2
- package/templates/ui/typescript/src/custom.d.ts +10 -0
- package/templates/ui/typescript/src/index.js +1 -0
- package/templates/ui/typescript/src/types.ts +3 -0
- package/templates/ui/typescript/tsconfig.json +0 -1
- package/templates/ui/javascript/src/App.css +0 -30
- package/templates/ui/javascript/src/__mocks__/mockAppProps.js +0 -590
- package/templates/ui/javascript/src/__mocks__/mockAppSettingsProps.js +0 -290
- package/templates/ui/typescript/src/App.css +0 -30
- package/templates/ui/typescript/src/__mocks__/mockAppProps.ts +0 -590
- package/templates/ui/typescript/src/__mocks__/mockAppSettingsProps.ts +0 -290
|
@@ -1,63 +1,51 @@
|
|
|
1
|
-
import { AppHeader } from '@corva/ui/
|
|
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.
|
|
7
|
+
import styles from './App.scss';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
Settings "Example" 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 "Example" checkbox is{' '}
|
|
42
|
+
<span data-testid="exampleCheckboxChecked">
|
|
55
43
|
{isExampleCheckboxChecked ? 'checked' : 'unchecked'}
|
|
56
|
-
</
|
|
44
|
+
</span>
|
|
57
45
|
</div>
|
|
58
|
-
</
|
|
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/
|
|
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.
|
|
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
|
-
<
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
<
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
<
|
|
48
|
-
Settings "Example" 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 "Example" checkbox is{' '}
|
|
39
|
+
<span data-testid="exampleCheckboxState">
|
|
49
40
|
{isExampleCheckboxChecked ? 'checked' : 'unchecked'}
|
|
50
|
-
</
|
|
41
|
+
</span>
|
|
51
42
|
</div>
|
|
52
|
-
</
|
|
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;
|
|
@@ -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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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(
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
9
|
+
const handleSettingChange = jest.fn();
|
|
10
10
|
|
|
11
|
-
render(
|
|
11
|
+
render(
|
|
12
|
+
<AppTestWrapper
|
|
13
|
+
appSettings={{ isExampleCheckboxChecked: true }}
|
|
14
|
+
onSettingChange={handleSettingChange}
|
|
15
|
+
>
|
|
16
|
+
<AppSettings />
|
|
17
|
+
</AppTestWrapper>
|
|
18
|
+
);
|
|
12
19
|
|
|
13
|
-
const exampleCheckbox = screen.
|
|
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(
|
|
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 {
|
|
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
|
-
<
|
|
12
|
+
<Button onClick={() => setIsOn(value => !value)}>toggle</Button>
|
|
13
13
|
</>
|
|
14
14
|
);
|
|
15
15
|
};
|