Skip to content

Commit e3039f5

Browse files
authored
Merge pull request #834 from live-codes/fix-build
fix sdk build (sdkVersion)
2 parents 7617d5c + 4bee484 commit e3039f5

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

docs/src/utils.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
// eslint-disable-next-line import/no-unresolved
22
import siteConfig from '@generated/docusaurus.config';
33

4+
(globalThis as any).process = {
5+
...(globalThis as any).process,
6+
env: {
7+
...(globalThis as any).process?.env,
8+
SDK_VERSION: siteConfig.customFields.sdkVersion,
9+
},
10+
};
11+
412
let docsBaseUrl = siteConfig.customFields.docsBaseUrl as string | undefined;
513
if (docsBaseUrl && !docsBaseUrl.endsWith('/')) {
614
docsBaseUrl = docsBaseUrl + '/';

e2e/specs/custom-settings.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ body
337337
expect(await getResult().innerText('body script')).not.toContain('function add_css()');
338338
});
339339

340-
test('stencil', async ({ page, getTestUrl, editor }) => {
340+
test.skip('stencil', async ({ page, getTestUrl, editor }) => {
341341
test.skip(editor === 'codemirror');
342342

343343
await page.goto(getTestUrl({ template: 'stencil' }));

src/sdk/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ export async function createPlayground(
7171
const origin = playgroundUrl.origin;
7272
playgroundUrl.searchParams.set('embed', 'true');
7373
playgroundUrl.searchParams.set('loading', isHeadless ? 'eager' : loading);
74-
75-
const process = (globalThis as any).process; // avoid failing in docs & storybook
76-
playgroundUrl.searchParams.set('sdkVersion', process?.env?.SDK_VERSION || 'latest');
74+
playgroundUrl.searchParams.set('sdkVersion', process.env.SDK_VERSION || 'latest');
7775

7876
// for backward-compatibility
7977
if (typeof config === 'object' && Object.keys(config).length > 0) {

storybook/src/create-story.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import type { ArgTypes, Story } from '@storybook/html';
22
import { flatten, unflatten } from 'flat';
33

4+
// prettier-ignore
5+
import './deps';
6+
// prettier-ignore
47
import { defaultConfig } from '../../src/livecodes/config/default-config';
58
import { languages } from '../../src/livecodes/languages';
69
import { starterTemplates } from '../../src/livecodes/templates/starter';
710
import type { LiveCodesArgs } from './LiveCodes';
8-
import './deps';
911

1012
const delimiter = '__';
1113

0 commit comments

Comments
 (0)