Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
// eslint-disable-next-line import/no-unresolved
import siteConfig from '@generated/docusaurus.config';

(globalThis as any).process = {
...(globalThis as any).process,
env: {
...(globalThis as any).process?.env,
SDK_VERSION: siteConfig.customFields.sdkVersion,
},
};

let docsBaseUrl = siteConfig.customFields.docsBaseUrl as string | undefined;
if (docsBaseUrl && !docsBaseUrl.endsWith('/')) {
docsBaseUrl = docsBaseUrl + '/';
Expand Down
2 changes: 1 addition & 1 deletion e2e/specs/custom-settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ body
expect(await getResult().innerText('body script')).not.toContain('function add_css()');
});

test('stencil', async ({ page, getTestUrl, editor }) => {
test.skip('stencil', async ({ page, getTestUrl, editor }) => {
test.skip(editor === 'codemirror');

await page.goto(getTestUrl({ template: 'stencil' }));
Expand Down
4 changes: 1 addition & 3 deletions src/sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ export async function createPlayground(
const origin = playgroundUrl.origin;
playgroundUrl.searchParams.set('embed', 'true');
playgroundUrl.searchParams.set('loading', isHeadless ? 'eager' : loading);

const process = (globalThis as any).process; // avoid failing in docs & storybook
playgroundUrl.searchParams.set('sdkVersion', process?.env?.SDK_VERSION || 'latest');
playgroundUrl.searchParams.set('sdkVersion', process.env.SDK_VERSION || 'latest');

// for backward-compatibility
if (typeof config === 'object' && Object.keys(config).length > 0) {
Expand Down
4 changes: 3 additions & 1 deletion storybook/src/create-story.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import type { ArgTypes, Story } from '@storybook/html';
import { flatten, unflatten } from 'flat';

// prettier-ignore
import './deps';
// prettier-ignore
import { defaultConfig } from '../../src/livecodes/config/default-config';
import { languages } from '../../src/livecodes/languages';
import { starterTemplates } from '../../src/livecodes/templates/starter';
import type { LiveCodesArgs } from './LiveCodes';
import './deps';

const delimiter = '__';

Expand Down