@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,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"key": "example.customer",
|
|
3
|
+
"name": "Frontend Entity Example",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Cancellation-aware plugin-owned entity list with Blocks table feedback and cursor navigation.",
|
|
6
|
+
"author": "Plugmatica",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"plugins": []
|
|
9
|
+
},
|
|
10
|
+
"permissions": [],
|
|
11
|
+
"shell": {
|
|
12
|
+
"apps": [
|
|
13
|
+
{
|
|
14
|
+
"key": "customer-example",
|
|
15
|
+
"label": "Customer example",
|
|
16
|
+
"path": "/customer-example",
|
|
17
|
+
"category": "examples",
|
|
18
|
+
"pinned": false,
|
|
19
|
+
"order": 900,
|
|
20
|
+
"permissions": [],
|
|
21
|
+
"layout": "default",
|
|
22
|
+
"navigation": []
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"navigation": [
|
|
26
|
+
{
|
|
27
|
+
"key": "customer-example",
|
|
28
|
+
"label": "Customer example",
|
|
29
|
+
"path": "/customer-example",
|
|
30
|
+
"order": 900,
|
|
31
|
+
"permissions": [],
|
|
32
|
+
"layout": "default",
|
|
33
|
+
"children": []
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"pages": [
|
|
37
|
+
{
|
|
38
|
+
"key": "customer-example",
|
|
39
|
+
"appKey": "customer-example",
|
|
40
|
+
"path": "/customer-example",
|
|
41
|
+
"module": "./CustomerListPage",
|
|
42
|
+
"layout": "default"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"frontend": {
|
|
47
|
+
"entryPoint": "frontend/remoteEntry.js",
|
|
48
|
+
"moduleName": "example_customer",
|
|
49
|
+
"exposes": [
|
|
50
|
+
"./CustomerListPage"
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
"check": "pnpm --dir frontend run typecheck",
|
|
14
|
+
"build": "pnpm --dir frontend run build"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@plugmatica/plugin-build": "^0.1.0"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=22"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -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,7 @@
|
|
|
1
|
+
# Frontend extension starter
|
|
2
|
+
|
|
3
|
+
A self-contained UI extension that contributes to a public runtime capability.
|
|
4
|
+
|
|
5
|
+
The extension uses `extensionTarget.ui(...)` with the target surface/key/point and versioned contract. It does not import the plugin that happens to provide that capability and does not need that provider package in `package.json`.
|
|
6
|
+
|
|
7
|
+
`plugmatica create` materializes a capability selector from the target surface/key/point and contract you supply. The generated plugin remains self-contained and does not depend on the provider plugin package.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@plugmatica/example-frontend-extension",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@plugmatica/i18n": "^0.1.0",
|
|
12
|
+
"@plugmatica/plugin-sdk": "^0.1.0",
|
|
13
|
+
"@plugmatica/ui-kit": "^0.1.0",
|
|
14
|
+
"react": "^19.1.1",
|
|
15
|
+
"react-dom": "^19.1.1",
|
|
16
|
+
"react-hook-form": "^7.71.1"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@plugmatica/plugin-build": "^0.1.0",
|
|
20
|
+
"@types/react": "^19.2.2",
|
|
21
|
+
"@types/react-dom": "^19.2.2",
|
|
22
|
+
"typescript": "^5.9.3",
|
|
23
|
+
"vite": "^8.2.0"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineExtension, extensionTarget } from "@plugmatica/plugin-sdk";
|
|
2
|
+
import type { TabContribution } from "@plugmatica/ui-kit";
|
|
3
|
+
|
|
4
|
+
const relatedItems = extensionTarget.ui({
|
|
5
|
+
surface: "{{targetSurface}}",
|
|
6
|
+
key: "{{targetKey}}",
|
|
7
|
+
point: "{{targetPoint}}",
|
|
8
|
+
contract: { id: "{{targetContractId}}", version: "{{targetContractVersion}}" },
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export default defineExtension({
|
|
12
|
+
target: relatedItems,
|
|
13
|
+
module: "./CustomerNotes",
|
|
14
|
+
contribution: "notes",
|
|
15
|
+
order: 3300,
|
|
16
|
+
contribute: ({ context, t }) =>
|
|
17
|
+
({
|
|
18
|
+
key: "notes",
|
|
19
|
+
label: t("notes.tab"),
|
|
20
|
+
render: () => (
|
|
21
|
+
<p>{t("notes.contributedBy", { plugin: context.plugin.identifier })}</p>
|
|
22
|
+
),
|
|
23
|
+
}) satisfies TabContribution,
|
|
24
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"key": "example.customer-notes",
|
|
3
|
+
"name": "Frontend Extension Example",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Focused typed UI contribution to a dependency plugin.",
|
|
6
|
+
"author": "Plugmatica",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"plugins": []
|
|
9
|
+
},
|
|
10
|
+
"permissions": [],
|
|
11
|
+
"frontend": {
|
|
12
|
+
"entryPoint": "frontend/remoteEntry.js",
|
|
13
|
+
"moduleName": "example_customer_notes",
|
|
14
|
+
"exposes": ["./CustomerNotes"]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
"check": "pnpm --dir frontend run typecheck",
|
|
14
|
+
"build": "pnpm --dir frontend run build"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@plugmatica/plugin-build": "^0.1.0"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=22"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -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,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@plugmatica/example-frontend-minimal",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@plugmatica/i18n": "^0.1.0",
|
|
12
|
+
"@plugmatica/plugin-sdk": "^0.1.0",
|
|
13
|
+
"@plugmatica/ui-kit": "^0.1.0",
|
|
14
|
+
"react": "^19.1.1",
|
|
15
|
+
"react-dom": "^19.1.1",
|
|
16
|
+
"react-hook-form": "^7.71.1"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@plugmatica/plugin-build": "^0.1.0",
|
|
20
|
+
"@types/react": "^19.2.2",
|
|
21
|
+
"@types/react-dom": "^19.2.2",
|
|
22
|
+
"typescript": "^5.9.3",
|
|
23
|
+
"vite": "^8.2.0"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { usePluginI18n } from "@plugmatica/plugin-sdk";
|
|
2
|
+
import { Card, Stack, Typography } from "@plugmatica/ui-kit";
|
|
3
|
+
|
|
4
|
+
export default function Page() {
|
|
5
|
+
const { t } = usePluginI18n();
|
|
6
|
+
return (
|
|
7
|
+
<Stack gap="lg">
|
|
8
|
+
<Typography.Text as="h1" size="2xl" weight="semibold">
|
|
9
|
+
{t("page.title")}
|
|
10
|
+
</Typography.Text>
|
|
11
|
+
<Card>
|
|
12
|
+
<Typography.Text>{t("page.body")}</Typography.Text>
|
|
13
|
+
</Card>
|
|
14
|
+
</Stack>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"key": "example.frontend-minimal",
|
|
3
|
+
"name": "Frontend facet example",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Small frontend-only Plugmatica package demonstrating a page, navigation, UI-kit and i18n.",
|
|
6
|
+
"author": "Plugmatica",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"plugins": []
|
|
9
|
+
},
|
|
10
|
+
"permissions": [],
|
|
11
|
+
"shell": {
|
|
12
|
+
"apps": [
|
|
13
|
+
{
|
|
14
|
+
"key": "frontend-example",
|
|
15
|
+
"label": "Frontend example",
|
|
16
|
+
"path": "/frontend-example",
|
|
17
|
+
"category": "examples",
|
|
18
|
+
"pinned": false,
|
|
19
|
+
"order": 900,
|
|
20
|
+
"permissions": [],
|
|
21
|
+
"layout": "default",
|
|
22
|
+
"navigation": []
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"navigation": [
|
|
26
|
+
{
|
|
27
|
+
"key": "frontend-example",
|
|
28
|
+
"label": "Frontend example",
|
|
29
|
+
"path": "/frontend-example",
|
|
30
|
+
"order": 900,
|
|
31
|
+
"permissions": [],
|
|
32
|
+
"layout": "default",
|
|
33
|
+
"children": []
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"pages": [
|
|
37
|
+
{
|
|
38
|
+
"key": "frontend-example",
|
|
39
|
+
"appKey": "frontend-example",
|
|
40
|
+
"path": "/frontend-example",
|
|
41
|
+
"module": "./Page",
|
|
42
|
+
"layout": "default"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"frontend": {
|
|
47
|
+
"entryPoint": "frontend/remoteEntry.js",
|
|
48
|
+
"moduleName": "example_frontend_minimal",
|
|
49
|
+
"exposes": ["./Page"]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
"check": "pnpm --dir frontend run typecheck",
|
|
14
|
+
"build": "pnpm --dir frontend run build"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@plugmatica/plugin-build": "^0.1.0"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=22"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -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,7 @@
|
|
|
1
|
+
# Frontend provider/event starter
|
|
2
|
+
|
|
3
|
+
Self-contained provider and event-handler contributions resolved through versioned public runtime capabilities.
|
|
4
|
+
|
|
5
|
+
The examples use `extensionTarget.provider(...)` and `extensionTarget.event(...)`; they do not import a provider plugin package. Provider-returned user-facing text still follows the normal Plugmatica i18n contract through `context.i18n`.
|
|
6
|
+
|
|
7
|
+
`plugmatica create` materializes provider/event capability selectors from public keys and versioned contracts. No provider plugin package is imported or added as a frontend dependency.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@plugmatica/example-frontend-provider-event",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "vite build",
|
|
8
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@plugmatica/i18n": "^0.1.0",
|
|
12
|
+
"@plugmatica/ui-kit": "^0.1.0",
|
|
13
|
+
"@plugmatica/plugin-sdk": "^0.1.0",
|
|
14
|
+
"react": "^19.1.1",
|
|
15
|
+
"react-dom": "^19.1.1",
|
|
16
|
+
"react-hook-form": "^7.71.1"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@plugmatica/plugin-build": "^0.1.0",
|
|
20
|
+
"@types/react": "^19.2.2",
|
|
21
|
+
"@types/react-dom": "^19.2.2",
|
|
22
|
+
"typescript": "^5.9.3",
|
|
23
|
+
"vite": "^8.2.0"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineProvider, extensionTarget } from "@plugmatica/plugin-sdk";
|
|
2
|
+
|
|
3
|
+
const badgeProvider = extensionTarget.provider({
|
|
4
|
+
provider: "{{providerKey}}",
|
|
5
|
+
contract: {
|
|
6
|
+
id: "{{providerContractId}}",
|
|
7
|
+
version: "{{providerContractVersion}}",
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export default defineProvider({
|
|
12
|
+
target: badgeProvider,
|
|
13
|
+
module: "./CustomerBadgeProvider",
|
|
14
|
+
provide: ({ context, request }) => {
|
|
15
|
+
const customerId =
|
|
16
|
+
typeof request === "object" && request && "customerId" in request
|
|
17
|
+
? String((request as { customerId: unknown }).customerId)
|
|
18
|
+
: "unknown";
|
|
19
|
+
return {
|
|
20
|
+
customerId,
|
|
21
|
+
label: context.i18n.t("provider.customerLabel"),
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineEventHandler, extensionTarget } from "@plugmatica/plugin-sdk";
|
|
2
|
+
|
|
3
|
+
const customerSaved = extensionTarget.event({
|
|
4
|
+
event: "{{eventKey}}",
|
|
5
|
+
contract: {
|
|
6
|
+
id: "{{eventContractId}}",
|
|
7
|
+
version: "{{eventContractVersion}}",
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export default defineEventHandler({
|
|
12
|
+
target: customerSaved,
|
|
13
|
+
module: "./CustomerSavedHandler",
|
|
14
|
+
handle: async ({ payload }) => {
|
|
15
|
+
if (payload && typeof payload === "object" && "customerId" in payload) {
|
|
16
|
+
console.info(
|
|
17
|
+
"Customer saved",
|
|
18
|
+
String((payload as { customerId: unknown }).customerId),
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"key": "example.customer-automation",
|
|
3
|
+
"name": "Frontend Provider/Event Example",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"description": "Focused provider and event-handler contributions using typed dependency targets.",
|
|
6
|
+
"author": "Plugmatica",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"plugins": []
|
|
9
|
+
},
|
|
10
|
+
"permissions": [],
|
|
11
|
+
"frontend": {
|
|
12
|
+
"entryPoint": "frontend/remoteEntry.js",
|
|
13
|
+
"moduleName": "example_customer_automation",
|
|
14
|
+
"exposes": ["./CustomerBadgeProvider", "./CustomerSavedHandler"]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
"check": "pnpm --dir frontend run typecheck",
|
|
14
|
+
"build": "pnpm --dir frontend run build"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@plugmatica/plugin-build": "^0.1.0"
|
|
18
|
+
},
|
|
19
|
+
"engines": {
|
|
20
|
+
"node": ">=22"
|
|
21
|
+
}
|
|
22
|
+
}
|