astro-tractstack 2.0.0-rc.21 → 2.0.0-rc.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/bin/create-tractstack.js
CHANGED
|
@@ -35,6 +35,7 @@ function getEnvState() {
|
|
|
35
35
|
tenantId: 'default',
|
|
36
36
|
goBackendPath: `${homedir()}/t8k-go-server/`,
|
|
37
37
|
enableMultiTenant: false,
|
|
38
|
+
enableBunny: false,
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
const found = {
|
|
@@ -42,6 +43,7 @@ function getEnvState() {
|
|
|
42
43
|
tenantId: false,
|
|
43
44
|
goBackendPath: false,
|
|
44
45
|
enableMultiTenant: false,
|
|
46
|
+
enableBunny: false,
|
|
45
47
|
};
|
|
46
48
|
|
|
47
49
|
if (!existsSync('.env')) {
|
|
@@ -78,12 +80,15 @@ function getEnvState() {
|
|
|
78
80
|
enableMultiTenant:
|
|
79
81
|
envVars.PUBLIC_ENABLE_MULTI_TENANT === 'true' ||
|
|
80
82
|
defaults.enableMultiTenant,
|
|
83
|
+
enableBunny:
|
|
84
|
+
envVars.PUBLIC_ENABLE_BUNNY === 'true' || defaults.enableBunny,
|
|
81
85
|
},
|
|
82
86
|
envState: {
|
|
83
87
|
goBackend: !!envVars.PUBLIC_GO_BACKEND,
|
|
84
88
|
tenantId: !!envVars.PUBLIC_TENANTID,
|
|
85
89
|
goBackendPath: !!envVars.PRIVATE_GO_BACKEND_PATH,
|
|
86
90
|
enableMultiTenant: envVars.PUBLIC_ENABLE_MULTI_TENANT !== undefined,
|
|
91
|
+
enableBunny: envVars.PUBLIC_ENABLE_BUNNY !== undefined,
|
|
87
92
|
},
|
|
88
93
|
};
|
|
89
94
|
} catch (error) {
|
|
@@ -207,6 +212,21 @@ ${kleur.bold('Examples:')}
|
|
|
207
212
|
);
|
|
208
213
|
}
|
|
209
214
|
|
|
215
|
+
if (!envState.enableBunny) {
|
|
216
|
+
promptQuestions.push({
|
|
217
|
+
type: 'confirm',
|
|
218
|
+
name: 'enableBunny',
|
|
219
|
+
message: 'Enable Bunny Video Player?',
|
|
220
|
+
initial: envDefaults.enableBunny,
|
|
221
|
+
});
|
|
222
|
+
} else {
|
|
223
|
+
console.log(
|
|
224
|
+
kleur.green(
|
|
225
|
+
`✓ Bunny Video Player: ${envDefaults.enableBunny ? 'enabled' : 'disabled'}`
|
|
226
|
+
)
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
210
230
|
// Only prompt for tenantId if multi-tenant will be enabled and tenantId not in .env
|
|
211
231
|
const willEnableMultiTenant =
|
|
212
232
|
enableMultiTenant || envDefaults.enableMultiTenant;
|
|
@@ -261,6 +281,7 @@ ${kleur.bold('Examples:')}
|
|
|
261
281
|
responses.enableMultiTenant === true || // explicit true from prompt
|
|
262
282
|
enableMultiTenant || // CLI flag --multi-tenant
|
|
263
283
|
envDefaults.enableMultiTenant === true, // existing .env value was "true"
|
|
284
|
+
enableBunny: responses.enableBunny ?? envDefaults.enableBunny,
|
|
264
285
|
tenantId: responses.tenantId || envDefaults.tenantId,
|
|
265
286
|
goBackendPath: responses.goBackendPath || envDefaults.goBackendPath,
|
|
266
287
|
includeExamples: responses.includeExamples ?? includeExamples,
|
|
@@ -287,6 +308,7 @@ PUBLIC_GO_BACKEND="${finalResponses.goBackend}"
|
|
|
287
308
|
PUBLIC_TENANTID="${finalTenantId}"
|
|
288
309
|
PRIVATE_GO_BACKEND_PATH="${finalResponses.goBackendPath.endsWith('/') ? finalResponses.goBackendPath : finalResponses.goBackendPath + '/'}"
|
|
289
310
|
PUBLIC_ENABLE_MULTI_TENANT="${finalResponses.enableMultiTenant ? 'true' : 'false'}"
|
|
311
|
+
PUBLIC_ENABLE_BUNNY="${finalResponses.enableBunny ? 'true' : 'false'}"
|
|
290
312
|
`;
|
|
291
313
|
|
|
292
314
|
try {
|
package/package.json
CHANGED
|
@@ -20,10 +20,12 @@ export interface Props {
|
|
|
20
20
|
|
|
21
21
|
const { target, options, fullContentMap /*, resourcesPayload */ } = Astro.props;
|
|
22
22
|
|
|
23
|
+
const enableBunny = import.meta.env.PUBLIC_ENABLE_BUNNY === 'true';
|
|
24
|
+
|
|
23
25
|
export const components = {
|
|
24
26
|
'featured-content': true,
|
|
25
27
|
'list-content': true,
|
|
26
|
-
'bunny-video': true,
|
|
28
|
+
...(enableBunny && { 'bunny-video': true }),
|
|
27
29
|
epinet: true,
|
|
28
30
|
// "custom-hero": true, // Uncomment when you create CustomHero.astro
|
|
29
31
|
};
|
|
@@ -34,7 +36,7 @@ export const components = {
|
|
|
34
36
|
<ListContent options={options} contentMap={fullContentMap} />
|
|
35
37
|
) : target === 'featured-content' ? (
|
|
36
38
|
<FeaturedContent options={options} contentMap={fullContentMap} />
|
|
37
|
-
) : target === 'bunny-video' ? (
|
|
39
|
+
) : target === 'bunny-video' && enableBunny ? (
|
|
38
40
|
<BunnyVideoWrapper options={options} />
|
|
39
41
|
) : target === 'epinet' ? (
|
|
40
42
|
<EpinetWrapper fullContentMap={fullContentMap} client:only="react" /> /*
|
|
@@ -20,11 +20,13 @@ export interface Props {
|
|
|
20
20
|
|
|
21
21
|
const { target, options, fullContentMap /*, resourcesPayload */ } = Astro.props;
|
|
22
22
|
|
|
23
|
+
const enableBunny = import.meta.env.PUBLIC_ENABLE_BUNNY === 'true';
|
|
24
|
+
|
|
23
25
|
export const components = {
|
|
24
26
|
'custom-hero': true,
|
|
25
27
|
'featured-content': true,
|
|
26
28
|
'list-content': true,
|
|
27
|
-
'bunny-video': true,
|
|
29
|
+
...(enableBunny && { 'bunny-video': true }),
|
|
28
30
|
epinet: true,
|
|
29
31
|
};
|
|
30
32
|
---
|
|
@@ -34,7 +36,7 @@ export const components = {
|
|
|
34
36
|
<ListContent options={options} contentMap={fullContentMap} />
|
|
35
37
|
) : target === 'featured-content' ? (
|
|
36
38
|
<FeaturedContent options={options} contentMap={fullContentMap} />
|
|
37
|
-
) : target === 'bunny-video' ? (
|
|
39
|
+
) : target === 'bunny-video' && enableBunny ? (
|
|
38
40
|
<BunnyVideoWrapper options={options} />
|
|
39
41
|
) : target === 'custom-hero' ? (
|
|
40
42
|
<CustomHero />
|
|
@@ -105,6 +105,8 @@ const fullCanonicalUrl = brandConfig?.SITE_URL
|
|
|
105
105
|
? `${brandConfig.SITE_URL.replace(/\/$/, '')}${canonicalURL}`
|
|
106
106
|
: `${brandConfig.SITE_URL.replace(/\/$/, '')}/${canonicalURL}`
|
|
107
107
|
: canonicalURL;
|
|
108
|
+
|
|
109
|
+
const enableBunny = import.meta.env.PUBLIC_ENABLE_BUNNY === 'true';
|
|
108
110
|
---
|
|
109
111
|
|
|
110
112
|
<!doctype html>
|
|
@@ -194,10 +196,15 @@ const fullCanonicalUrl = brandConfig?.SITE_URL
|
|
|
194
196
|
|
|
195
197
|
<ClientRouter />
|
|
196
198
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
{
|
|
200
|
+
enableBunny && (
|
|
201
|
+
<script
|
|
202
|
+
is:inline
|
|
203
|
+
type="text/javascript"
|
|
204
|
+
src="//assets.mediadelivery.net/playerjs/player-0.1.0.min.js"
|
|
205
|
+
/>
|
|
206
|
+
)
|
|
207
|
+
}
|
|
201
208
|
|
|
202
209
|
<script
|
|
203
210
|
src="https://unpkg.com/htmx.org@2.0.4"
|
|
@@ -133,10 +133,15 @@ if (!brandConfig.SITE_INIT) {
|
|
|
133
133
|
<div class="overflow-hidden">
|
|
134
134
|
<CodeHook
|
|
135
135
|
target={codeHookTargets[paneId]}
|
|
136
|
-
|
|
136
|
+
options={(() => {
|
|
137
|
+
const optionsStr =
|
|
138
|
+
codeHookTargets[paneId + '-' + codeHookTargets[paneId]];
|
|
139
|
+
return optionsStr
|
|
140
|
+
? { params: { options: optionsStr } }
|
|
141
|
+
: undefined;
|
|
142
|
+
})()}
|
|
137
143
|
fullContentMap={fullContentMap}
|
|
138
144
|
resourcesPayload={resourcesPayload}
|
|
139
|
-
noPaneId={true}
|
|
140
145
|
/>
|
|
141
146
|
</div>
|
|
142
147
|
) : (
|