@stripchatdev/create-stripchat-extension 0.1.7
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 +35 -0
- package/dist/bin/cli.d.ts +2 -0
- package/dist/bin/cli.js +176 -0
- package/dist/package.json +28 -0
- package/dist/src/constants.d.ts +19 -0
- package/dist/src/constants.js +48 -0
- package/dist/src/executor.d.ts +2 -0
- package/dist/src/executor.js +22 -0
- package/dist/src/executor.test.d.ts +1 -0
- package/dist/src/executor.test.js +77 -0
- package/dist/src/helpers/detectPackageManager.d.ts +2 -0
- package/dist/src/helpers/detectPackageManager.js +12 -0
- package/dist/src/helpers/detectPackageManager.test.d.ts +1 -0
- package/dist/src/helpers/detectPackageManager.test.js +47 -0
- package/dist/src/helpers/isDirectory.d.ts +1 -0
- package/dist/src/helpers/isDirectory.js +9 -0
- package/dist/src/helpers/isDirectory.test.d.ts +1 -0
- package/dist/src/helpers/isDirectory.test.js +22 -0
- package/dist/src/helpers/isTypescriptOnlyFile.d.ts +1 -0
- package/dist/src/helpers/isTypescriptOnlyFile.js +5 -0
- package/dist/src/helpers/isTypescriptOnlyFile.test.d.ts +1 -0
- package/dist/src/helpers/isTypescriptOnlyFile.test.js +22 -0
- package/dist/src/helpers/normalizeRelPath.d.ts +1 -0
- package/dist/src/helpers/normalizeRelPath.js +1 -0
- package/dist/src/helpers/normalizeRelPath.test.d.ts +1 -0
- package/dist/src/helpers/normalizeRelPath.test.js +19 -0
- package/dist/src/helpers/resolveTemplateExtension.d.ts +1 -0
- package/dist/src/helpers/resolveTemplateExtension.js +17 -0
- package/dist/src/helpers/resolveTemplateExtension.test.d.ts +1 -0
- package/dist/src/helpers/resolveTemplateExtension.test.js +50 -0
- package/dist/src/helpers/resolveTemplatesDir.d.ts +1 -0
- package/dist/src/helpers/resolveTemplatesDir.js +11 -0
- package/dist/src/helpers/resolveTemplatesDir.test.d.ts +1 -0
- package/dist/src/helpers/resolveTemplatesDir.test.js +21 -0
- package/dist/src/mappers/mapProjectConfigToTemplateModel.d.ts +2 -0
- package/dist/src/mappers/mapProjectConfigToTemplateModel.js +26 -0
- package/dist/src/mappers/mapProjectConfigToTemplateModel.test.d.ts +1 -0
- package/dist/src/mappers/mapProjectConfigToTemplateModel.test.js +89 -0
- package/dist/src/planner.d.ts +2 -0
- package/dist/src/planner.js +126 -0
- package/dist/src/planner.test.d.ts +1 -0
- package/dist/src/planner.test.js +46 -0
- package/dist/src/types.d.ts +50 -0
- package/dist/src/types.js +1 -0
- package/dist/src/validators/index.d.ts +6 -0
- package/dist/src/validators/index.js +6 -0
- package/dist/src/validators/isValidCategory.d.ts +2 -0
- package/dist/src/validators/isValidCategory.js +2 -0
- package/dist/src/validators/isValidCategory.test.d.ts +1 -0
- package/dist/src/validators/isValidCategory.test.js +10 -0
- package/dist/src/validators/isValidFramework.d.ts +2 -0
- package/dist/src/validators/isValidFramework.js +2 -0
- package/dist/src/validators/isValidFramework.test.d.ts +1 -0
- package/dist/src/validators/isValidFramework.test.js +10 -0
- package/dist/src/validators/isValidLanguage.d.ts +2 -0
- package/dist/src/validators/isValidLanguage.js +2 -0
- package/dist/src/validators/isValidLanguage.test.d.ts +1 -0
- package/dist/src/validators/isValidLanguage.test.js +10 -0
- package/dist/src/validators/validateName.d.ts +1 -0
- package/dist/src/validators/validateName.js +10 -0
- package/dist/src/validators/validateName.test.d.ts +1 -0
- package/dist/src/validators/validateName.test.js +33 -0
- package/dist/src/validators/validateProjectDir.d.ts +1 -0
- package/dist/src/validators/validateProjectDir.js +6 -0
- package/dist/src/validators/validateProjectDir.test.d.ts +1 -0
- package/dist/src/validators/validateProjectDir.test.js +19 -0
- package/dist/src/validators/validateSlots.d.ts +5 -0
- package/dist/src/validators/validateSlots.js +15 -0
- package/dist/src/validators/validateSlots.test.d.ts +1 -0
- package/dist/src/validators/validateSlots.test.js +34 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +28 -0
- package/templates/.gitignore.ejs +33 -0
- package/templates/AGENTS.md.ejs +503 -0
- package/templates/CLAUDE.md +1 -0
- package/templates/README.md.ejs +38 -0
- package/templates/package.json.ejs +19 -0
- package/templates/public/icon.svg +4 -0
- package/templates/public/manifest.json.ejs +16 -0
- package/templates/public/resolveSlotPage.js.ejs +10 -0
- package/templates/src/slots/background/app.ts.ejs +37 -0
- package/templates/src/slots/background/background.html.ejs +16 -0
- package/templates/src/slots/background/main.ts.ejs +3 -0
- package/templates/src/slots/slot/app.ts.ejs +22 -0
- package/templates/src/slots/slot/app.tsx.ejs +22 -0
- package/templates/src/slots/slot/main.css.ejs +30 -0
- package/templates/src/slots/slot/main.ts.ejs +3 -0
- package/templates/src/slots/slot/main.tsx.ejs +9 -0
- package/templates/src/slots/slot/slot.html.ejs +21 -0
- package/templates/tsconfig.json.ejs +26 -0
- package/templates/vite.config.ts.ejs +23 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createExtHelper } from '@stripchatdev/ext-helper';
|
|
2
|
+
import { useEffect, useState } from 'preact/hooks';
|
|
3
|
+
|
|
4
|
+
const extHelper = createExtHelper();
|
|
5
|
+
|
|
6
|
+
export const App = () => {
|
|
7
|
+
const [status, setStatus] = useState('Loading...');
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
extHelper.makeRequest('v1.ext.context.get', null).then((ctx) => {
|
|
11
|
+
const name = ctx.model?.username ?? 'unknown';
|
|
12
|
+
setStatus(`Connected to ${name}'s room`);
|
|
13
|
+
});
|
|
14
|
+
}, []);
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<div style={{ padding: '16px' }}>
|
|
18
|
+
<h2><%= slot %></h2>
|
|
19
|
+
<p>{status}</p>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
padding: 0;
|
|
4
|
+
margin: 0;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
html[data-theme='dark'] {
|
|
8
|
+
--bg-primary: #000000;
|
|
9
|
+
--text-primary: rgba(248, 248, 248, 0.8);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
html[data-theme='light'] {
|
|
13
|
+
--bg-primary: #f5f5f5;
|
|
14
|
+
--text-primary: rgba(26, 26, 26, 0.8);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
html {
|
|
18
|
+
height: 100%;
|
|
19
|
+
background: var(--bg-primary);
|
|
20
|
+
color: var(--text-primary);
|
|
21
|
+
font-family: system-ui, sans-serif;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
body {
|
|
25
|
+
min-height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#app {
|
|
29
|
+
min-height: 100%;
|
|
30
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>
|
|
8
|
+
<%= slot %>
|
|
9
|
+
</title>
|
|
10
|
+
|
|
11
|
+
<link rel="stylesheet" href="<%= stylePath %>" />
|
|
12
|
+
</head>
|
|
13
|
+
|
|
14
|
+
<body>
|
|
15
|
+
<% if (framework==='preact' ) { -%>
|
|
16
|
+
<div id="app"></div>
|
|
17
|
+
<% } -%>
|
|
18
|
+
<script type="module" src="<%= entryModulePath %>"></script>
|
|
19
|
+
</body>
|
|
20
|
+
|
|
21
|
+
</html>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"noUnusedLocals": true,
|
|
8
|
+
"noUnusedParameters": true,
|
|
9
|
+
"noFallthroughCasesInSwitch": true,
|
|
10
|
+
"noUncheckedIndexedAccess": true,
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"isolatedModules": true,
|
|
13
|
+
"esModuleInterop": true,
|
|
14
|
+
"noEmit": true,
|
|
15
|
+
"skipLibCheck": true<% if (framework === 'preact') { %>,
|
|
16
|
+
"jsx": "react-jsx",
|
|
17
|
+
"jsxImportSource": "preact",
|
|
18
|
+
"paths": {
|
|
19
|
+
"react": ["./node_modules/preact/compat/"],
|
|
20
|
+
"react/jsx-runtime": ["./node_modules/preact/jsx-runtime"],
|
|
21
|
+
"react-dom": ["./node_modules/preact/compat/"],
|
|
22
|
+
"react-dom/*": ["./node_modules/preact/compat/*"]
|
|
23
|
+
}<% } %>
|
|
24
|
+
},
|
|
25
|
+
"include": ["src"]
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
|
|
3
|
+
import { defineConfig } from 'vite';
|
|
4
|
+
<% if (framework === 'preact') { -%>
|
|
5
|
+
import preact from '@preact/preset-vite';
|
|
6
|
+
<% } -%>
|
|
7
|
+
|
|
8
|
+
export default defineConfig({
|
|
9
|
+
base: './',
|
|
10
|
+
build: {
|
|
11
|
+
outDir: 'dist',
|
|
12
|
+
rollupOptions: {
|
|
13
|
+
input: {
|
|
14
|
+
<% slots.forEach((slot, i) => { -%>
|
|
15
|
+
'<%= slot %>': resolve(__dirname, '<%= slot %>.html')<%= i < slots.length - 1 ? ',' : '' %>
|
|
16
|
+
<% }); -%>
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
<% if (framework === 'preact') { -%>
|
|
21
|
+
plugins: [preact()],
|
|
22
|
+
<% } -%>
|
|
23
|
+
});
|