@stripchatdev/create-stripchat-extension 0.1.22 → 0.1.23
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/dist/bin/cli.js +56 -43
- package/dist/package.json +1 -1
- package/dist/src/constants.d.ts +2 -12
- package/dist/src/constants.js +30 -27
- package/dist/src/executor.test.js +2 -2
- package/dist/src/mappers/mapProjectConfigToTemplateModel.js +3 -4
- package/dist/src/mappers/mapProjectConfigToTemplateModel.test.js +25 -17
- package/dist/src/planner.js +1 -1
- package/dist/src/planner.test.js +16 -14
- package/dist/src/types.d.ts +15 -6
- package/dist/src/validators/validateSlots.d.ts +2 -2
- package/dist/src/validators/validateSlots.js +19 -15
- package/dist/src/validators/validateSlots.test.js +86 -51
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/templates/AGENTS.md.ejs +15 -15
- package/templates/README.md.ejs +1 -1
- package/templates/public/manifest.json.ejs +4 -4
- package/templates/public/resolveSlotPage.js.ejs +3 -3
- package/templates/vite.config.ts.ejs +2 -2
package/templates/README.md.ejs
CHANGED
|
@@ -10,7 +10,7 @@ Read `AGENTS.md` first. It is the project contract for SDK usage, slot lifecycle
|
|
|
10
10
|
|
|
11
11
|
- `public/manifest.json` declares slots, page keys, optional settings entry, and backend actions.
|
|
12
12
|
- `public/resolveSlotPage.js` maps slot types to page keys from `views.pages`.
|
|
13
|
-
- Root HTML files like `<%=
|
|
13
|
+
- Root HTML files like `<%= slotsEntries[0].slotCamelCased %>.html` and `background.html` are emitted to the archive root.
|
|
14
14
|
- Visual slots should stay disposable; keep durable state and coordination in `background`.
|
|
15
15
|
- `vite.config.<%= isTypescript ? 'ts' : 'js' %>` must include every root HTML file in `build.rollupOptions.input`.
|
|
16
16
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "v2.0",
|
|
3
3
|
"views": {
|
|
4
|
-
"slots": <%-
|
|
4
|
+
"slots": [<%- slotsEntries.map(({ slot }) => `"${slot}"`).join(', ') %>],
|
|
5
5
|
"pages": {
|
|
6
|
-
<%
|
|
7
|
-
"<%=
|
|
6
|
+
<% slotsEntries.forEach(({ slotCamelCased }, i) => { -%>
|
|
7
|
+
"<%= slotCamelCased %>": "<%= slotCamelCased %>.html"<%= i < slotsEntries.length - 1 ? ',' : '' %>
|
|
8
8
|
<% }); -%>
|
|
9
9
|
},
|
|
10
10
|
"resolveSlotPageScript": "resolveSlotPage.js"
|
|
11
|
-
}<% if (
|
|
11
|
+
}<% if (slotsEntries.filter(({ slot }) => slot ==='EXTENSION_SLOT_MOVEABLE_OVERLAY').length > 0) { %>,
|
|
12
12
|
"moveableSlot": {
|
|
13
13
|
"width": 400,
|
|
14
14
|
"height": 600
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default function resolveSlotPage(slotType, context, extSettings) {
|
|
2
2
|
switch (slotType) {
|
|
3
|
-
<%
|
|
4
|
-
case '<%=
|
|
5
|
-
return '<%=
|
|
3
|
+
<% slotsEntries.forEach(({ slotCamelCased, slot }) => { -%>
|
|
4
|
+
case '<%= slot %>':
|
|
5
|
+
return '<%= slotCamelCased %>';
|
|
6
6
|
<% }); -%>
|
|
7
7
|
default:
|
|
8
8
|
return null;
|
|
@@ -15,8 +15,8 @@ export default defineConfig({
|
|
|
15
15
|
outDir: 'dist',
|
|
16
16
|
rollupOptions: {
|
|
17
17
|
input: {
|
|
18
|
-
<%
|
|
19
|
-
'<%=
|
|
18
|
+
<% slotsEntries.forEach(({ slotCamelCased }, i) => { -%>
|
|
19
|
+
'<%= slotCamelCased %>': resolve(__dirname, '<%= slotCamelCased %>.html')<%= i < slotsEntries.length - 1 ? ',' : '' %>
|
|
20
20
|
<% }); -%>
|
|
21
21
|
},
|
|
22
22
|
},
|