@integration-app/react 0.2.0 → 0.3.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.
- package/README.md +49 -34
- package/dist/index.d.ts +377 -160
- package/dist/index.js +517 -226
- package/dist/index.js.map +1 -1
- package/dist/index.module.d.ts +377 -160
- package/dist/index.module.mjs +506 -227
- package/dist/index.module.mjs.map +1 -1
- package/dist/index.umd.d.ts +377 -160
- package/dist/index.umd.js +517 -230
- package/dist/index.umd.js.map +1 -1
- package/package.json +16 -9
- package/src/actions/useAction.ts +35 -0
- package/src/actions/useActionInstance.ts +56 -0
- package/src/actions/useActionInstances.ts +11 -0
- package/src/actions/useActions.ts +11 -0
- package/src/app-events/useAppEventSubscription.ts +6 -6
- package/src/app-events/useAppEventSubscriptions.ts +5 -4
- package/src/app-events/useAppEventType.ts +10 -7
- package/src/app-events/useAppEventTypes.ts +2 -4
- package/src/app-events/useAppEvents.ts +2 -4
- package/src/contexts/index.tsx +4 -0
- package/src/contexts/integration-app-context.tsx +11 -2
- package/src/data-collections/useDataCollectionSpec.ts +26 -0
- package/src/data-links/useDataLinkTable.ts +18 -0
- package/src/data-links/useDataLinkTableInstance.ts +39 -0
- package/src/data-links/useDataLinkTableInstances.ts +19 -0
- package/src/data-links/useDataLinkTables.ts +11 -0
- package/src/data-sources/useDataSource.ts +29 -6
- package/src/data-sources/useDataSourceEvents.ts +2 -4
- package/src/data-sources/useDataSourceInstance.ts +120 -26
- package/src/data-sources/useDataSourceInstanceCollection.ts +14 -4
- package/src/data-sources/useDataSourceInstanceLocations.ts +17 -6
- package/src/data-sources/useDataSourceInstances.ts +17 -0
- package/src/data-sources/useDataSources.ts +2 -4
- package/src/field-mappings/useFieldMapping.ts +29 -8
- package/src/field-mappings/useFieldMappingInstance.ts +37 -14
- package/src/field-mappings/useFieldMappingInstances.ts +6 -5
- package/src/field-mappings/useFieldMappings.ts +2 -4
- package/src/flows/useFlow.ts +28 -6
- package/src/flows/useFlowInstance.ts +62 -5
- package/src/flows/useFlowInstances.ts +2 -4
- package/src/flows/useFlowRun.ts +18 -6
- package/src/flows/useFlowRuns.ts +5 -5
- package/src/flows/useFlows.ts +5 -5
- package/src/hooks/useElement.tsx +142 -136
- package/src/hooks/useElements.tsx +44 -73
- package/src/hooks/useIntegrationAppSWR.tsx +13 -0
- package/src/index.tsx +29 -16
- package/src/integrations/useConnection.ts +14 -5
- package/src/integrations/useConnections.ts +3 -4
- package/src/integrations/useConnectorSpec.ts +14 -0
- package/src/integrations/useIntegration.ts +11 -7
- package/src/integrations/useIntegrations.ts +3 -4
- package/src/screens/useScreen.ts +19 -0
- package/rollup.config.mjs +0 -64
- package/src/hooks/useGetter.tsx +0 -38
- package/src/integrations/useConnectionSpec.ts +0 -25
package/README.md
CHANGED
@@ -7,23 +7,63 @@ To release a new version of a package (@integration-app/sdk, @integration-app/ui
|
|
7
7
|
* Merge the PR.
|
8
8
|
* Run a Github Action to publish a package.
|
9
9
|
|
10
|
-
# Rollup config
|
11
10
|
|
12
|
-
|
11
|
+
# Rollup Configuration
|
13
12
|
|
14
|
-
|
13
|
+
To see the complete configuration, refer to the `rollup.config.mjs` and `rollup.dts.config.mjs` files. Although these files are self-explanatory, here's some additional information:
|
14
|
+
|
15
|
+
In `rollup.config.mjs`, we set `{external: [/node_modules/]}` to exclude our dependencies from being bundled.
|
16
|
+
|
17
|
+
## Bundle and DTS File Generation
|
18
|
+
|
19
|
+
We encountered issues with `rollup-plugin-dts` generating incorrect DTS files when used in the same configuration as `@rollup/plugin-typescript`. To resolve this, we use two Rollup configurations:
|
20
|
+
- `rollup.config.mjs` for bundle generation
|
21
|
+
- `rollup.dts.config.mjs` for DTS file generation.
|
15
22
|
|
16
23
|
## Externals
|
17
24
|
|
18
|
-
We set
|
19
|
-
|
25
|
+
We set external dependencies in `rollup.config.mjs`:
|
26
|
+
- `{external: [/node_modules/]}` to exclude all `node_modules`.
|
27
|
+
- `@integration-app/sdk` to prevent Rollup from bundling the `@integration-app/sdk` package during local development, when it is used via a symlink to the SDK in the root folder.
|
28
|
+
- `react` and `react/jsx-runtime` are excluded to avoid unresolved dependency errors, as React is a peer dependency.
|
29
|
+
|
30
|
+
## Bundle and DTS File Generation Workflow
|
31
|
+
|
32
|
+
When using `rollup-plugin-dts` and `@rollup/plugin-typescript` in the same configuration, we experienced issues with generating incorrect DTS files. To solve this, we use two Rollup configurations:
|
33
|
+
- `rollup.config.mjs` for generating bundles
|
34
|
+
- `rollup.dts.config.mjs` for generating DTS files.
|
35
|
+
|
36
|
+
### Build
|
37
|
+
|
38
|
+
For local build, the following steps are taken:
|
39
|
+
|
40
|
+
- Clean the `/dist` folder.
|
41
|
+
- Install local `@integration-app/sdk` pointed to `sdk` folder
|
42
|
+
- Remove `react` and `react-dom` packages from `node_modules` folder
|
43
|
+
- We should do it to allow out package work in `console`, `engine` and other local projects
|
44
|
+
- Rollup with `rollup.config.mjs` configuration generates bundle files and basic DTS files, which are placed in the `dist/dts` folder.
|
45
|
+
- Rollup with `rollup.dts.config.mjs` configuration uses the basic DTS files to generate `*.d.ts` files for each bundle.
|
46
|
+
|
47
|
+
### Development
|
48
|
+
|
49
|
+
During development, the following steps are taken:
|
50
|
+
|
51
|
+
- Run `build` to generate bundle and DTS files.
|
52
|
+
- If not, Rollup with `rollup.dts.config.mjs` in watch mode fails due to missing DTS files (race condition).
|
53
|
+
- Concurrently run two Rollup processes **in watch mode**:
|
54
|
+
- Rollup with `rollup.config.mjs` configuration to generate bundle files and basic DTS files.
|
55
|
+
- Rollup with `rollup.dts.config.mjs` configuration to generate DTS files for each bundle.
|
56
|
+
|
57
|
+
### Publish via GitHub
|
20
58
|
|
21
|
-
|
59
|
+
During publishing via GitHub, the following steps are taken:
|
22
60
|
|
23
|
-
|
61
|
+
- Clean the `/dist` folder.
|
62
|
+
- Install `@integration-app/sdk@latest` package
|
63
|
+
- Rollup with `rollup.config.mjs` configuration generates bundle files and basic DTS files, which are placed in the `dist/dts` folder.
|
64
|
+
- Rollup with `rollup.dts.config.mjs` configuration uses the basic DTS files to generate `*.d.ts` files for each bundle.
|
24
65
|
|
25
|
-
|
26
|
-
After that plugin `rollup-plugin-dts` is used to generate `*.d.ts` files for each bundle.
|
66
|
+
The `build:publish` command is used in GitHub Actions to ensure that the package uses the latest `@integration-app/sdk` package.
|
27
67
|
|
28
68
|
# Package.json exports
|
29
69
|
|
@@ -41,28 +81,3 @@ After that plugin `rollup-plugin-dts` is used to generate `*.d.ts` files for eac
|
|
41
81
|
}
|
42
82
|
```
|
43
83
|
|
44
|
-
# Local and publish build workflow
|
45
|
-
|
46
|
-
For a local development, we use locally placed `@integration-app/sdk` package.
|
47
|
-
|
48
|
-
And for publishing, we use `@integration-app/sdk@latest` package.
|
49
|
-
|
50
|
-
To make it work, we use `dev` and `build` commands.
|
51
|
-
|
52
|
-
## `dev` workflow
|
53
|
-
|
54
|
-
- Delete `dist` folders
|
55
|
-
- Install local `@integration-app/sdk` pointed to `sdk` folder
|
56
|
-
- Remove `react` and `react-dom` packages from `node_modules` folder
|
57
|
-
- We should do it to allow out package work in `console`, `engine` and other local projects
|
58
|
-
- Run `rollup` in watch mode to build a package
|
59
|
-
|
60
|
-
## `build` workflow
|
61
|
-
|
62
|
-
- Delete `dist` folders
|
63
|
-
- Install `@integration-app/sdk@latest` package
|
64
|
-
- Run `rollup` to build a package
|
65
|
-
|
66
|
-
Because GitHub Actions use `build` command, we could be sure that package uses the latest `@integration-app/sdk` package.
|
67
|
-
|
68
|
-
|