@norskvideo/ctl-dev-kit 0.2.129 → 0.2.130
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.
|
@@ -74,12 +74,23 @@ export interface GeneratedFile {
|
|
|
74
74
|
executable?: boolean;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/** `norsk-acme` -> `Norsk Acme`: the install name as screens show it. */
|
|
78
|
+
export function productTitle(name: string): string {
|
|
79
|
+
return name
|
|
80
|
+
.split("-")
|
|
81
|
+
.filter((part) => part.length > 0)
|
|
82
|
+
.map((part) => part[0].toUpperCase() + part.slice(1))
|
|
83
|
+
.join(" ");
|
|
84
|
+
}
|
|
85
|
+
|
|
77
86
|
export interface ShapeContext {
|
|
78
87
|
name: string;
|
|
79
88
|
/** Workspace scope, `@<name>`. */
|
|
80
89
|
scope: string;
|
|
81
90
|
/** `product:` value for the shared workflows — `name` minus the `norsk-` prefix. */
|
|
82
91
|
dashboardKey: string;
|
|
92
|
+
/** Human product title for screens, e.g. `Norsk Acme`. */
|
|
93
|
+
title: string;
|
|
83
94
|
devPort: number;
|
|
84
95
|
pins: { mediaImage: string; studioImage: string; studioLib: string; mediaLib: string };
|
|
85
96
|
canon: Canon;
|
|
@@ -210,6 +221,7 @@ export function shapeContext(opts: CreateProductOptions): ShapeContext {
|
|
|
210
221
|
name: opts.name,
|
|
211
222
|
scope: `@${opts.name}`,
|
|
212
223
|
dashboardKey: opts.name.replace(/^norsk-/, ""),
|
|
224
|
+
title: productTitle(opts.name),
|
|
213
225
|
devPort: opts.devPort ?? 4323,
|
|
214
226
|
pins: {
|
|
215
227
|
mediaImage,
|
|
@@ -112,7 +112,7 @@ function indexHtml(ctx: ShapeContext): string {
|
|
|
112
112
|
<head>
|
|
113
113
|
<meta charset="UTF-8" />
|
|
114
114
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
115
|
-
<title>${ctx.
|
|
115
|
+
<title>${ctx.title}</title>
|
|
116
116
|
</head>
|
|
117
117
|
<body>
|
|
118
118
|
<div id="root"></div>
|
|
@@ -93,7 +93,7 @@ function indexHtml(ctx: ShapeContext): string {
|
|
|
93
93
|
<head>
|
|
94
94
|
<meta charset="UTF-8" />
|
|
95
95
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
96
|
-
<title>${ctx.
|
|
96
|
+
<title>${ctx.title} — configure</title>
|
|
97
97
|
</head>
|
|
98
98
|
<body>
|
|
99
99
|
<div id="root"></div>
|
|
@@ -130,7 +130,7 @@ function appTsx(ctx: ShapeContext): string {
|
|
|
130
130
|
export default function App() {
|
|
131
131
|
return (
|
|
132
132
|
<main>
|
|
133
|
-
<h1>${ctx.
|
|
133
|
+
<h1>${ctx.title}</h1>
|
|
134
134
|
<p>
|
|
135
135
|
The starter template needs no configuration. Launch it from norsk-ctl to bring up the Studio + Norsk stack this
|
|
136
136
|
product composes.
|
|
@@ -151,7 +151,7 @@ import App from "./App.tsx";
|
|
|
151
151
|
|
|
152
152
|
test("names the product", () => {
|
|
153
153
|
render(<App />);
|
|
154
|
-
expect(screen.getByRole("heading", { name: "${ctx.
|
|
154
|
+
expect(screen.getByRole("heading", { name: "${ctx.title}" })).toBeInTheDocument();
|
|
155
155
|
});
|
|
156
156
|
`;
|
|
157
157
|
}
|