@plugmatica/plugin-build 0.0.0-stage → 0.1.0
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/LICENSE +21 -0
- package/LICENSE-APACHE +202 -0
- package/README.md +221 -2
- package/dev-target/README.md +20 -0
- package/dev-target/compose.yaml +119 -0
- package/dist/chunk-EOLUQEKQ.js +587 -0
- package/dist/chunk-QHTGR4ZB.js +9378 -0
- package/dist/chunk-TQNG5OZ3.js +3135 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +2606 -0
- package/dist/index.d.ts +2144 -0
- package/dist/index.js +230 -0
- package/dist/vite-WRwB4IG8.d.ts +929 -0
- package/dist/vite.d.ts +3 -0
- package/dist/vite.js +20 -0
- package/package.json +94 -4
- package/templates/README.md +29 -0
- package/templates/backend-capabilities/LICENSE.txt +231 -0
- package/templates/backend-capabilities/backend/Cargo.toml +21 -0
- package/templates/backend-capabilities/backend/src/lib.rs +179 -0
- package/templates/backend-capabilities/backend/tests/basic.rs +174 -0
- package/templates/backend-capabilities/manifest.source.json +64 -0
- package/templates/backend-capabilities/package.json +22 -0
- package/templates/backend-composition/LICENSE.txt +231 -0
- package/templates/backend-composition/backend/Cargo.toml +21 -0
- package/templates/backend-composition/backend/src/lib.rs +96 -0
- package/templates/backend-composition/backend/tests/basic.rs +75 -0
- package/templates/backend-composition/manifest.source.json +26 -0
- package/templates/backend-composition/package.json +22 -0
- package/templates/backend-entities/LICENSE.txt +231 -0
- package/templates/backend-entities/backend/Cargo.toml +20 -0
- package/templates/backend-entities/backend/src/lib.rs +77 -0
- package/templates/backend-entities/backend/tests/basic.rs +26 -0
- package/templates/backend-entities/manifest.source.json +15 -0
- package/templates/backend-entities/package.json +22 -0
- package/templates/backend-minimal/LICENSE.txt +231 -0
- package/templates/backend-minimal/backend/Cargo.toml +21 -0
- package/templates/backend-minimal/backend/src/lib.rs +69 -0
- package/templates/backend-minimal/backend/tests/basic.rs +67 -0
- package/templates/backend-minimal/manifest.source.json +15 -0
- package/templates/backend-minimal/package.json +22 -0
- package/templates/backend-operations/LICENSE.txt +231 -0
- package/templates/backend-operations/backend/Cargo.toml +21 -0
- package/templates/backend-operations/backend/src/lib.rs +117 -0
- package/templates/backend-operations/backend/tests/basic.rs +169 -0
- package/templates/backend-operations/manifest.source.json +15 -0
- package/templates/backend-operations/package.json +22 -0
- package/templates/frontend-entity/LICENSE.txt +27 -0
- package/templates/frontend-entity/README.md +46 -0
- package/templates/frontend-entity/frontend/i18n/en-GB.json +5 -0
- package/templates/frontend-entity/frontend/package.json +32 -0
- package/templates/frontend-entity/frontend/src/CustomerListPage.tsx +98 -0
- package/templates/frontend-entity/frontend/src/model.ts +5 -0
- package/templates/frontend-entity/frontend/tests/entityLifecycle.test.tsx +79 -0
- package/templates/frontend-entity/frontend/tsconfig.json +4 -0
- package/templates/frontend-entity/frontend/vite.config.ts +3 -0
- package/templates/frontend-entity/frontend/vitest.config.ts +9 -0
- package/templates/frontend-entity/manifest.source.json +53 -0
- package/templates/frontend-entity/package.json +22 -0
- package/templates/frontend-entity/pnpm-workspace.yaml +2 -0
- package/templates/frontend-extension/LICENSE.txt +27 -0
- package/templates/frontend-extension/README.md +7 -0
- package/templates/frontend-extension/frontend/i18n/en-GB.json +4 -0
- package/templates/frontend-extension/frontend/package.json +25 -0
- package/templates/frontend-extension/frontend/src/CustomerNotes.tsx +24 -0
- package/templates/frontend-extension/frontend/tsconfig.json +4 -0
- package/templates/frontend-extension/frontend/vite.config.ts +3 -0
- package/templates/frontend-extension/manifest.source.json +16 -0
- package/templates/frontend-extension/package.json +22 -0
- package/templates/frontend-extension/pnpm-workspace.yaml +2 -0
- package/templates/frontend-minimal/LICENSE.txt +27 -0
- package/templates/frontend-minimal/README.md +5 -0
- package/templates/frontend-minimal/frontend/i18n/en-GB.json +4 -0
- package/templates/frontend-minimal/frontend/package.json +25 -0
- package/templates/frontend-minimal/frontend/src/Page.tsx +16 -0
- package/templates/frontend-minimal/frontend/src/entry.ts +1 -0
- package/templates/frontend-minimal/frontend/tsconfig.json +4 -0
- package/templates/frontend-minimal/frontend/vite.config.ts +3 -0
- package/templates/frontend-minimal/manifest.source.json +51 -0
- package/templates/frontend-minimal/package.json +22 -0
- package/templates/frontend-minimal/pnpm-workspace.yaml +2 -0
- package/templates/frontend-provider-event/LICENSE.txt +27 -0
- package/templates/frontend-provider-event/README.md +7 -0
- package/templates/frontend-provider-event/frontend/i18n/en-GB.json +3 -0
- package/templates/frontend-provider-event/frontend/package.json +25 -0
- package/templates/frontend-provider-event/frontend/src/CustomerBadgeProvider.ts +24 -0
- package/templates/frontend-provider-event/frontend/src/CustomerSavedHandler.ts +22 -0
- package/templates/frontend-provider-event/frontend/tsconfig.json +4 -0
- package/templates/frontend-provider-event/frontend/vite.config.ts +3 -0
- package/templates/frontend-provider-event/manifest.source.json +16 -0
- package/templates/frontend-provider-event/package.json +22 -0
- package/templates/frontend-provider-event/pnpm-workspace.yaml +2 -0
- package/templates/full-stack-minimal/LICENSE.txt +231 -0
- package/templates/full-stack-minimal/README.md +49 -0
- package/templates/full-stack-minimal/backend/Cargo.toml +18 -0
- package/templates/full-stack-minimal/backend/src/lib.rs +49 -0
- package/templates/full-stack-minimal/backend/tests/basic.rs +49 -0
- package/templates/full-stack-minimal/frontend/i18n/en-GB.json +6 -0
- package/templates/full-stack-minimal/frontend/package.json +25 -0
- package/templates/full-stack-minimal/frontend/src/Page.tsx +29 -0
- package/templates/full-stack-minimal/frontend/src/entry.ts +1 -0
- package/templates/full-stack-minimal/frontend/tsconfig.json +4 -0
- package/templates/full-stack-minimal/frontend/vite.config.ts +3 -0
- package/templates/full-stack-minimal/manifest.source.json +55 -0
- package/templates/full-stack-minimal/package.json +24 -0
- package/templates/full-stack-minimal/pnpm-workspace.yaml +2 -0
- package/templates/full-stack-workflow-node/LICENSE.txt +231 -0
- package/templates/full-stack-workflow-node/README.md +111 -0
- package/templates/full-stack-workflow-node/backend/Cargo.toml +12 -0
- package/templates/full-stack-workflow-node/backend/src/lib.rs +70 -0
- package/templates/full-stack-workflow-node/frontend/i18n/en-GB.json +10 -0
- package/templates/full-stack-workflow-node/frontend/package.json +29 -0
- package/templates/full-stack-workflow-node/frontend/src/editors/FormatLabelEditor.tsx +25 -0
- package/templates/full-stack-workflow-node/frontend/src/entry.ts +2 -0
- package/templates/full-stack-workflow-node/frontend/src/nodes/FormatLabel.tsx +18 -0
- package/templates/full-stack-workflow-node/frontend/src/presentations/FormatLabelPresentation.tsx +7 -0
- package/templates/full-stack-workflow-node/frontend/tsconfig.json +4 -0
- package/templates/full-stack-workflow-node/frontend/vite.config.ts +5 -0
- package/templates/full-stack-workflow-node/manifest.source.json +18 -0
- package/templates/full-stack-workflow-node/package.json +25 -0
- package/templates/full-stack-workflow-node/pnpm-workspace.yaml +2 -0
- package/templates/localization-fr-fr/LICENSE.txt +27 -0
- package/templates/localization-fr-fr/README.md +5 -0
- package/templates/localization-fr-fr/localization/plugmatica.customer.fr-FR.json +4 -0
- package/templates/localization-fr-fr/manifest.source.json +36 -0
- package/templates/localization-fr-fr/package.json +18 -0
- package/templates/starter-projection.json +448 -0
- package/tsconfig.plugin.json +14 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
Plugmatica starter source licensing
|
|
2
|
+
|
|
3
|
+
The Plugmatica-authored backend/ facet is Apache-2.0 licensed; other supplied files are MIT licensed.
|
|
4
|
+
Preserve the applicable copyright and licence notices for reused code.
|
|
5
|
+
These terms do not prescribe a licence for your own original code.
|
|
6
|
+
|
|
7
|
+
MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) Plugmatica contributors
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
Apache License
|
|
32
|
+
Version 2.0, January 2004
|
|
33
|
+
http://www.apache.org/licenses/
|
|
34
|
+
|
|
35
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
36
|
+
|
|
37
|
+
1. Definitions.
|
|
38
|
+
|
|
39
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
40
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
41
|
+
|
|
42
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
43
|
+
the copyright owner that is granting the License.
|
|
44
|
+
|
|
45
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
46
|
+
other entities that control, are controlled by, or are under common
|
|
47
|
+
control with that entity. For the purposes of this definition,
|
|
48
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
49
|
+
direction or management of such entity, whether by contract or
|
|
50
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
51
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
52
|
+
|
|
53
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
54
|
+
exercising permissions granted by this License.
|
|
55
|
+
|
|
56
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
57
|
+
including but not limited to software source code, documentation
|
|
58
|
+
source, and configuration files.
|
|
59
|
+
|
|
60
|
+
"Object" form shall mean any form resulting from mechanical
|
|
61
|
+
transformation or translation of a Source form, including but
|
|
62
|
+
not limited to compiled object code, generated documentation,
|
|
63
|
+
and conversions to other media types.
|
|
64
|
+
|
|
65
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
66
|
+
Object form, made available under the License, as indicated by a
|
|
67
|
+
copyright notice that is included in or attached to the work
|
|
68
|
+
(an example is provided in the Appendix below).
|
|
69
|
+
|
|
70
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
71
|
+
form, that is based on (or derived from) the Work and for which the
|
|
72
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
73
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
74
|
+
of this License, Derivative Works shall not include works that remain
|
|
75
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
76
|
+
the Work and Derivative Works thereof.
|
|
77
|
+
|
|
78
|
+
"Contribution" shall mean any work of authorship, including
|
|
79
|
+
the original version of the Work and any modifications or additions
|
|
80
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
81
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
82
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
83
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
84
|
+
means any form of electronic, verbal, or written communication sent
|
|
85
|
+
to the Licensor or its representatives, including but not limited to
|
|
86
|
+
communication on electronic mailing lists, source code control systems,
|
|
87
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
88
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
89
|
+
excluding communication that is conspicuously marked or otherwise
|
|
90
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
91
|
+
|
|
92
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
93
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
94
|
+
subsequently incorporated within the Work.
|
|
95
|
+
|
|
96
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
97
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
98
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
99
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
100
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
101
|
+
Work and such Derivative Works in Source or Object form.
|
|
102
|
+
|
|
103
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
104
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
105
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
106
|
+
(except as stated in this section) patent license to make, have made,
|
|
107
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
108
|
+
where such license applies only to those patent claims licensable
|
|
109
|
+
by such Contributor that are necessarily infringed by their
|
|
110
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
111
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
112
|
+
institute patent litigation against any entity (including a
|
|
113
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
114
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
115
|
+
or contributory patent infringement, then any patent licenses
|
|
116
|
+
granted to You under this License for that Work shall terminate
|
|
117
|
+
as of the date such litigation is filed.
|
|
118
|
+
|
|
119
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
120
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
121
|
+
modifications, and in Source or Object form, provided that You
|
|
122
|
+
meet the following conditions:
|
|
123
|
+
|
|
124
|
+
(a) You must give any other recipients of the Work or
|
|
125
|
+
Derivative Works a copy of this License; and
|
|
126
|
+
|
|
127
|
+
(b) You must cause any modified files to carry prominent notices
|
|
128
|
+
stating that You changed the files; and
|
|
129
|
+
|
|
130
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
131
|
+
that You distribute, all copyright, patent, trademark, and
|
|
132
|
+
attribution notices from the Source form of the Work,
|
|
133
|
+
excluding those notices that do not pertain to any part of
|
|
134
|
+
the Derivative Works; and
|
|
135
|
+
|
|
136
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
137
|
+
distribution, then any Derivative Works that You distribute must
|
|
138
|
+
include a readable copy of the attribution notices contained
|
|
139
|
+
within such NOTICE file, excluding those notices that do not
|
|
140
|
+
pertain to any part of the Derivative Works, in at least one
|
|
141
|
+
of the following places: within a NOTICE text file distributed
|
|
142
|
+
as part of the Derivative Works; within the Source form or
|
|
143
|
+
documentation, if provided along with the Derivative Works; or,
|
|
144
|
+
within a display generated by the Derivative Works, if and
|
|
145
|
+
wherever such third-party notices normally appear. The contents
|
|
146
|
+
of the NOTICE file are for informational purposes only and
|
|
147
|
+
do not modify the License. You may add Your own attribution
|
|
148
|
+
notices within Derivative Works that You distribute, alongside
|
|
149
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
150
|
+
that such additional attribution notices cannot be construed
|
|
151
|
+
as modifying the License.
|
|
152
|
+
|
|
153
|
+
You may add Your own copyright statement to Your modifications and
|
|
154
|
+
may provide additional or different license terms and conditions
|
|
155
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
156
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
157
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
158
|
+
the conditions stated in this License.
|
|
159
|
+
|
|
160
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
161
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
162
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
163
|
+
this License, without any additional terms or conditions.
|
|
164
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
165
|
+
the terms of any separate license agreement you may have executed
|
|
166
|
+
with Licensor regarding such Contributions.
|
|
167
|
+
|
|
168
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
169
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
170
|
+
except as required for reasonable and customary use in describing the
|
|
171
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
172
|
+
|
|
173
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
174
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
175
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
176
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
177
|
+
implied, including, without limitation, any warranties or conditions
|
|
178
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
179
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
180
|
+
appropriateness of using or redistributing the Work and assume any
|
|
181
|
+
risks associated with Your exercise of permissions under this License.
|
|
182
|
+
|
|
183
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
184
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
185
|
+
unless required by applicable law (such as deliberate and grossly
|
|
186
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
187
|
+
liable to You for damages, including any direct, indirect, special,
|
|
188
|
+
incidental, or consequential damages of any character arising as a
|
|
189
|
+
result of this License or out of the use or inability to use the
|
|
190
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
191
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
192
|
+
other commercial damages or losses), even if such Contributor
|
|
193
|
+
has been advised of the possibility of such damages.
|
|
194
|
+
|
|
195
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
196
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
197
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
198
|
+
or other liability obligations and/or rights consistent with this
|
|
199
|
+
License. However, in accepting such obligations, You may act only
|
|
200
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
201
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
202
|
+
defend, and hold each Contributor harmless for any liability
|
|
203
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
204
|
+
of your accepting any such warranty or additional liability.
|
|
205
|
+
|
|
206
|
+
END OF TERMS AND CONDITIONS
|
|
207
|
+
|
|
208
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
209
|
+
|
|
210
|
+
To apply the Apache License to your work, attach the following
|
|
211
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
212
|
+
replaced with your own identifying information. (Don't include
|
|
213
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
214
|
+
comment syntax for the file format. We also recommend that a
|
|
215
|
+
file or class name and description of purpose be included on the
|
|
216
|
+
same "printed page" as the copyright notice for easier
|
|
217
|
+
identification within third-party archives.
|
|
218
|
+
|
|
219
|
+
Copyright [yyyy] [name of copyright owner]
|
|
220
|
+
|
|
221
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
222
|
+
you may not use this file except in compliance with the License.
|
|
223
|
+
You may obtain a copy of the License at
|
|
224
|
+
|
|
225
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
226
|
+
|
|
227
|
+
Unless required by applicable law or agreed to in writing, software
|
|
228
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
229
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
230
|
+
See the License for the specific language governing permissions and
|
|
231
|
+
limitations under the License.
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
# Full-stack Workflow node reference (DX6)
|
|
2
|
+
|
|
3
|
+
This is an **independent plugin package source example**, not an extra operation
|
|
4
|
+
inside `plugmatica-workflows` or `plugmatica-sftp`. It intentionally uses only
|
|
5
|
+
public frontend `@plugmatica/plugin-sdk`, `@plugmatica/blocks`, `@plugmatica/ui-kit`
|
|
6
|
+
and the public Rust `plugmatica-sdk`. No plugin may import another plugin's source.
|
|
7
|
+
|
|
8
|
+
The example implements **Format label**:
|
|
9
|
+
|
|
10
|
+
- Rust owns `example.workflow-node:action:format-label`, command `labels.format`,
|
|
11
|
+
input/output JSON Schemas, validation and retry/idempotency semantics.
|
|
12
|
+
- `frontend/src/nodes/FormatLabel.tsx` declares its catalog, typed editable paths
|
|
13
|
+
and lazy editor/presentation using `defineWorkflowNode()`.
|
|
14
|
+
- `WorkflowField` renders `prefix` as a fixed value and `name` as a fixed
|
|
15
|
+
value **or** a mapping/expression from a compatible earlier Workflow node.
|
|
16
|
+
The host owns that mode switch, source selection, validation and persistence.
|
|
17
|
+
- The canvas chip comes from this plugin's own translations, not a backend UI
|
|
18
|
+
schema or an import from the Workflow host.
|
|
19
|
+
|
|
20
|
+
The package deliberately has **no Connection**. Formatting text doesn't require
|
|
21
|
+
external credentials, so requiring a Connection just to demonstrate the picker
|
|
22
|
+
would be misleading. For the actual backend-owned managed Connection binding and
|
|
23
|
+
host-owned picker, see the SDK's backend capability examples and the public
|
|
24
|
+
Workflow guide. No new Connection/secret storage is created by this example.
|
|
25
|
+
|
|
26
|
+
## Create an independent plugin with the public CLI
|
|
27
|
+
|
|
28
|
+
The **registered** `full-stack-workflow-node` starter is projected from this
|
|
29
|
+
example into the published `@plugmatica/plugin-build` CLI. You do **not** need
|
|
30
|
+
to copy files from a Plugmatica source checkout.
|
|
31
|
+
|
|
32
|
+
Install the Rust WASM target and the descriptor tool before building:
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
rustup target add wasm32-unknown-unknown
|
|
36
|
+
cargo install --locked --version 0.1.0 plugmatica-describe
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
pnpm --package=@plugmatica/plugin-build@beta dlx plugmatica create ./workflow-demo \
|
|
41
|
+
--template full-stack-workflow-node \
|
|
42
|
+
--plugin-key acme.workflow-label \
|
|
43
|
+
--name "Workflow Label"
|
|
44
|
+
cd workflow-demo
|
|
45
|
+
pnpm install
|
|
46
|
+
pnpm check
|
|
47
|
+
pnpm build
|
|
48
|
+
pnpm plugin:package
|
|
49
|
+
pnpm workflow:inspect
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Once the separate development images are available, use `pnpm dev:target`
|
|
53
|
+
and `pnpm plugin:dev` to run the installed-host example.
|
|
54
|
+
|
|
55
|
+
The public CLI bootstrap example assumes the public CLI release already includes
|
|
56
|
+
this starter. When testing an **unpublished source delta**, use the locally
|
|
57
|
+
built Plugmatica CLI instead; an older published Beta may not list the template.
|
|
58
|
+
|
|
59
|
+
The CLI personalizes the package key **in both Rust and TypeScript node IDs**.
|
|
60
|
+
The public starter projection supplies published versions for
|
|
61
|
+
`@plugmatica/plugin-build`, `@plugmatica/plugin-sdk`, `@plugmatica/blocks`,
|
|
62
|
+
`@plugmatica/ui-kit`, `@plugmatica/i18n` and the public `plugmatica-sdk` Rust crate.
|
|
63
|
+
It also includes the required React and React Hook Form peers. The checked-in
|
|
64
|
+
source fixture intentionally uses repository-local dependencies; only the
|
|
65
|
+
public projection is portable.
|
|
66
|
+
|
|
67
|
+
`pnpm workflow:inspect` audits the assembled `dist/plugin` package (Rust
|
|
68
|
+
descriptor, WASM header, frontend exposes and all three UI contributions).
|
|
69
|
+
It **does not** assert an installed, enabled, current runtime release. For an
|
|
70
|
+
independent runtime check, save the scoped response from
|
|
71
|
+
`GET /api/workflow-node-types?scopeKind=oss&scopeKey=default&locale=en-GB`
|
|
72
|
+
and compare it with:
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
pnpm exec plugmatica workflow inspect --package dist/plugin --require-ui \
|
|
76
|
+
--registry-json ./effective-nodes.json --json-out ./workflow-inspection.json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Even matching installed backend fingerprints cannot prove that the browser
|
|
80
|
+
loaded the editor. Open the Workflow editor and check the catalog, custom
|
|
81
|
+
fields, value selector, canvas chip and generic fallback independently.
|
|
82
|
+
|
|
83
|
+
Native prerequisites: Rust, `wasm32-unknown-unknown`, and the public
|
|
84
|
+
`plugmatica-plugin-describe` binary. See the public
|
|
85
|
+
[plugin development guide](https://plugmatica.com/plugmatica/plugin-development/).
|
|
86
|
+
|
|
87
|
+
Once installed and reconciled, verify the *effective* Workflow node registry
|
|
88
|
+
contains `acme.workflow-label:action:format-label` (or your chosen key). Add
|
|
89
|
+
this action after a trigger with a text output, set prefix to `Hello, `, map
|
|
90
|
+
name from a prior compatible string output, save/publish, and run. Verify
|
|
91
|
+
`label` in the run output, then reload the draft to ensure the mapping
|
|
92
|
+
survived. The generic schema editor must still work when this plugin's
|
|
93
|
+
remote frontend cannot load.
|
|
94
|
+
|
|
95
|
+
Source examples, compiler checks and package inspections do **not** substitute
|
|
96
|
+
for public native builds or browser/runtime acceptance. Do not hand-edit
|
|
97
|
+
compiler-owned `manifest.json`, `backend/descriptor.json` or `dist/`.
|
|
98
|
+
|
|
99
|
+
## Contract checklist
|
|
100
|
+
|
|
101
|
+
| Owner | Source | Contract |
|
|
102
|
+
| --- | --- | --- |
|
|
103
|
+
| Package author | `manifest.source.json` | One key/version, exposes `./nodes/FormatLabel` |
|
|
104
|
+
| Rust SDK | `backend/src/lib.rs` | Matching action ID, command, input/output schema, retry |
|
|
105
|
+
| Frontend SDK | `frontend/src/nodes/FormatLabel.tsx` | Catalog/editor/presentation, editable `prefix`/`name` |
|
|
106
|
+
| Frontend plugin | `frontend/i18n/en-GB.json` | Owner-local display strings |
|
|
107
|
+
| Host | `workflow.node` | Ownership/contract resolution, Connection controls, save/publish/execute |
|
|
108
|
+
|
|
109
|
+
Never add a private `plugmatica-workflows` dependency or introduce another
|
|
110
|
+
Workflow graph persistence layer. This reference stays deliberately small;
|
|
111
|
+
`plugmatica-sftp` remains the richer managed-Connection and BlobRef proof.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//! Standalone Workflow action example: executable contract only, no React/UI definitions.
|
|
2
|
+
use plugmatica_sdk::prelude::*;
|
|
3
|
+
|
|
4
|
+
const NODE_TYPE: &str = "example.workflow-node:action:format-label";
|
|
5
|
+
|
|
6
|
+
fn format_label(_ctx: PluginContext, payload: Value) -> Result<Value> {
|
|
7
|
+
let prefix = payload.get("prefix").and_then(Value::as_str).unwrap_or("Hello, ");
|
|
8
|
+
let name = payload.get("name").and_then(Value::as_str).ok_or_else(||
|
|
9
|
+
Error::bad_request("name_required", "name must be a string")
|
|
10
|
+
)?;
|
|
11
|
+
if prefix.len() > 128 || name.trim().is_empty() || name.len() > 256 {
|
|
12
|
+
return Err(Error::bad_request("invalid_label_input", "invalid prefix or name"));
|
|
13
|
+
}
|
|
14
|
+
Ok(json!({ "label": format!("{prefix}{name}"), "nameLength": name.chars().count() }))
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
#[plugin]
|
|
18
|
+
pub fn register_plugin(registry: &mut PluginRegistry) {
|
|
19
|
+
registry
|
|
20
|
+
.command_with_access("labels.format", AccessPolicy::internal(), format_label)
|
|
21
|
+
.workflow_action(
|
|
22
|
+
WorkflowAction::command(
|
|
23
|
+
NODE_TYPE,
|
|
24
|
+
"Format label",
|
|
25
|
+
"labels.format",
|
|
26
|
+
json!({
|
|
27
|
+
"type": "object",
|
|
28
|
+
"properties": {
|
|
29
|
+
"prefix": {"type": "string", "title": "Prefix", "maxLength": 128, "default": "Hello, "},
|
|
30
|
+
"name": {"type": "string", "title": "Name", "minLength": 1, "maxLength": 256}
|
|
31
|
+
},
|
|
32
|
+
"required": ["name"],
|
|
33
|
+
"additionalProperties": false
|
|
34
|
+
}),
|
|
35
|
+
json!({
|
|
36
|
+
"type": "object",
|
|
37
|
+
"properties": {
|
|
38
|
+
"label": {"type": "string"},
|
|
39
|
+
"nameLength": {"type": "integer"}
|
|
40
|
+
},
|
|
41
|
+
"required": ["label", "nameLength"],
|
|
42
|
+
"additionalProperties": false
|
|
43
|
+
}),
|
|
44
|
+
)
|
|
45
|
+
.description("Format a label using a literal prefix and a mapped name from an upstream node.")
|
|
46
|
+
.category("Examples")
|
|
47
|
+
.icon("Tag")
|
|
48
|
+
.summary(WorkflowNodeSummaryDescriptor {
|
|
49
|
+
fields: vec![WorkflowNodeSummaryField {
|
|
50
|
+
source: WorkflowNodeSummarySource::Input,
|
|
51
|
+
path: "name".into(),
|
|
52
|
+
label: "Name".into(),
|
|
53
|
+
label_key: None,
|
|
54
|
+
display: WorkflowNodeSummaryDisplay::Value,
|
|
55
|
+
}],
|
|
56
|
+
required_inputs: true,
|
|
57
|
+
})
|
|
58
|
+
.idempotent(WorkflowRetryPolicy {
|
|
59
|
+
max_attempts: 3,
|
|
60
|
+
initial_backoff_seconds: 1,
|
|
61
|
+
max_backoff_seconds: 10,
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
pub fn descriptor() -> plugmatica_sdk::__private::plugmatica_protocol::PluginBackendDescriptor {
|
|
67
|
+
let mut registry = PluginRegistry::new();
|
|
68
|
+
register_plugin(&mut registry);
|
|
69
|
+
registry.descriptor()
|
|
70
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"workflow.formatLabel.title": "Format label",
|
|
3
|
+
"workflow.formatLabel.description": "Combine a prefix with a name from an earlier Workflow node.",
|
|
4
|
+
"workflow.formatLabel.category": "Examples",
|
|
5
|
+
"workflow.formatLabel.help": "Choose a prefix, then enter a name or map it from an earlier Workflow step.",
|
|
6
|
+
"workflow.formatLabel.prefix": "Prefix",
|
|
7
|
+
"workflow.formatLabel.name": "Name",
|
|
8
|
+
"workflow.formatLabel.nameHelp": "Use the value selector to map a text output from an earlier node.",
|
|
9
|
+
"workflow.formatLabel.chip": "Format"
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@plugmatica/example-workflow-node",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=22"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "vite build",
|
|
11
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@plugmatica/blocks": "^0.1.0",
|
|
15
|
+
"@plugmatica/i18n": "^0.1.0",
|
|
16
|
+
"@plugmatica/plugin-sdk": "^0.1.0",
|
|
17
|
+
"@plugmatica/ui-kit": "^0.1.0",
|
|
18
|
+
"react": "^19.1.1",
|
|
19
|
+
"react-dom": "^19.1.1",
|
|
20
|
+
"react-hook-form": "^7.71.1"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@plugmatica/plugin-build": "^0.1.0",
|
|
24
|
+
"@types/react": "^19.2.2",
|
|
25
|
+
"@types/react-dom": "^19.2.2",
|
|
26
|
+
"typescript": "^5.9.3",
|
|
27
|
+
"vite": "^8.2.0"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { WorkflowField } from "@plugmatica/blocks";
|
|
2
|
+
import type { WorkflowNodeEditorContext } from "@plugmatica/plugin-sdk";
|
|
3
|
+
import { Stack, Typography } from "@plugmatica/ui-kit";
|
|
4
|
+
|
|
5
|
+
// Do not use setConfig, duplicate backend JSON Schemas, or import Workflows internals.
|
|
6
|
+
// The host owns the value selector, input source graph, validation and atomic writes.
|
|
7
|
+
export default function FormatLabelEditor(context: WorkflowNodeEditorContext) {
|
|
8
|
+
const t = (key: string) => context.translate?.(key) ?? key;
|
|
9
|
+
return (
|
|
10
|
+
<Stack gap="md" align="stretch">
|
|
11
|
+
<Typography.Text size="sm" color="muted">{t("workflow.formatLabel.help")}</Typography.Text>
|
|
12
|
+
<WorkflowField
|
|
13
|
+
fields={context.fields}
|
|
14
|
+
path="prefix"
|
|
15
|
+
label={t("workflow.formatLabel.prefix")}
|
|
16
|
+
/>
|
|
17
|
+
<WorkflowField
|
|
18
|
+
fields={context.fields}
|
|
19
|
+
path="name"
|
|
20
|
+
label={t("workflow.formatLabel.name")}
|
|
21
|
+
description={t("workflow.formatLabel.nameHelp")}
|
|
22
|
+
/>
|
|
23
|
+
</Stack>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineWorkflowNode } from "@plugmatica/plugin-sdk";
|
|
2
|
+
|
|
3
|
+
// One author-owned definition becomes catalog/editor/presentation contributions.
|
|
4
|
+
// The stable identity and editable paths must match this package's Rust descriptor.
|
|
5
|
+
export default defineWorkflowNode({
|
|
6
|
+
nodeType: "example.workflow-node:action:format-label",
|
|
7
|
+
module: "./nodes/FormatLabel",
|
|
8
|
+
catalog: {
|
|
9
|
+
titleKey: "workflow.formatLabel.title",
|
|
10
|
+
descriptionKey: "workflow.formatLabel.description",
|
|
11
|
+
categoryKey: "workflow.formatLabel.category",
|
|
12
|
+
icon: "Tag",
|
|
13
|
+
keywords: ["example", "format", "label", "text"],
|
|
14
|
+
},
|
|
15
|
+
editableFields: ["prefix", "name"],
|
|
16
|
+
loadEditor: () => import("../editors/FormatLabelEditor"),
|
|
17
|
+
loadPresentation: () => import("../presentations/FormatLabelPresentation"),
|
|
18
|
+
});
|
package/templates/full-stack-workflow-node/frontend/src/presentations/FormatLabelPresentation.tsx
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { WorkflowNodePresentationContext } from "@plugmatica/plugin-sdk";
|
|
2
|
+
import { Badge } from "@plugmatica/ui-kit";
|
|
3
|
+
|
|
4
|
+
// Deliberately omit input values: a canvas chip must not leak secrets/mappings.
|
|
5
|
+
export default function FormatLabelPresentation(context: WorkflowNodePresentationContext) {
|
|
6
|
+
return <Badge size="sm">{context.translate?.("workflow.formatLabel.chip") ?? "Format"}</Badge>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"key": "example.workflow-node",
|
|
3
|
+
"name": "Workflow Node Authoring Example",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"description": "Independent full-stack example: Rust Workflow action with TypeScript-owned editor, catalog and canvas presentation.",
|
|
6
|
+
"author": "Plugmatica",
|
|
7
|
+
"dependencies": { "plugins": [] },
|
|
8
|
+
"permissions": [],
|
|
9
|
+
"backend": {
|
|
10
|
+
"entryPoint": "backend/plugin.wasm",
|
|
11
|
+
"capabilities": []
|
|
12
|
+
},
|
|
13
|
+
"frontend": {
|
|
14
|
+
"entryPoint": "frontend/remoteEntry.js",
|
|
15
|
+
"moduleName": "example_workflow_node",
|
|
16
|
+
"exposes": ["./nodes/FormatLabel"]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "plugmatica-plugin",
|
|
3
|
+
"version": "0.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"plugin:package": "plugmatica package",
|
|
8
|
+
"plugin:install": "plugmatica install",
|
|
9
|
+
"plugin:dev": "plugmatica dev install",
|
|
10
|
+
"dev:target": "plugmatica dev up",
|
|
11
|
+
"frontend:typecheck": "pnpm --dir frontend run typecheck",
|
|
12
|
+
"frontend:build": "pnpm --dir frontend run build",
|
|
13
|
+
"backend:test": "cargo test --manifest-path backend/Cargo.toml",
|
|
14
|
+
"backend:build": "plugmatica backend build",
|
|
15
|
+
"workflow:inspect": "plugmatica workflow inspect --package dist/plugin --require-ui",
|
|
16
|
+
"check": "pnpm --dir frontend run typecheck && cargo test --manifest-path backend/Cargo.toml",
|
|
17
|
+
"build": "plugmatica backend build && pnpm --dir frontend run build"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@plugmatica/plugin-build": "^0.1.0"
|
|
21
|
+
},
|
|
22
|
+
"engines": {
|
|
23
|
+
"node": ">=22"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Plugmatica starter source licensing
|
|
2
|
+
|
|
3
|
+
The Plugmatica-authored files supplied with this starter are MIT licensed.
|
|
4
|
+
Preserve the applicable copyright and licence notices for reused code.
|
|
5
|
+
These terms do not prescribe a licence for your own original code.
|
|
6
|
+
|
|
7
|
+
MIT License
|
|
8
|
+
|
|
9
|
+
Copyright (c) Plugmatica contributors
|
|
10
|
+
|
|
11
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
+
in the Software without restriction, including without limitation the rights
|
|
14
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
+
furnished to do so, subject to the following conditions:
|
|
17
|
+
|
|
18
|
+
The above copyright notice and this permission notice shall be included in all
|
|
19
|
+
copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
+
SOFTWARE.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Localization-resource package example
|
|
2
|
+
|
|
3
|
+
This package has no `frontend` or `backend` block. It contributes only `localization.resources` and declares the catalog owner as a plugin dependency.
|
|
4
|
+
|
|
5
|
+
Localization packs are ordinary Plugmatica packages composed from resources rather than executable facets.
|