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
10 changes: 7 additions & 3 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,15 @@ jobs:
restore-keys: |
turbo-${{ github.job }}-${{ github.ref_name }}-

- name: Login to Apify
run: npx -y apify-cli@beta login -t ${{ secrets.APIFY_SCRAPER_TESTS_API_TOKEN }}

- name: Setup Apify CLI
uses: apify/setup-apify-cli-action@main
with:
version: 'beta'
token: ${{ secrets.APIFY_SCRAPER_TESTS_API_TOKEN }}

- name: Add Apify secrets for E2E tests
run: npx -y apify-cli@beta secrets add anthropicApiKey ${{ secrets.ANTHROPIC_API_KEY }}
run: apify secrets add anthropicApiKey ${{ secrets.ANTHROPIC_API_KEY }}

- name: Install Dependencies
run: yarn
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/tools.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function getActorTestDir(url) {
export async function pushActor(client, dirName) {
await copyPackages(dirName);
try {
execSync('npx -y apify-cli@beta push', {
execSync('apify push', {
cwd: dirName,
env: { ...process.env, GIT_CEILING_DIRECTORIES: dirname(dirName) },
});
Expand Down
13 changes: 13 additions & 0 deletions website/patches/@signalwire+docusaurus-plugin-llms-txt+1.2.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/@signalwire/docusaurus-plugin-llms-txt/lib/transformation/plugins/plugin-registry.js b/node_modules/@signalwire/docusaurus-plugin-llms-txt/lib/transformation/plugins/plugin-registry.js
index f35c2df..4d8b9bd 100644
--- a/node_modules/@signalwire/docusaurus-plugin-llms-txt/lib/transformation/plugins/plugin-registry.js
+++ b/node_modules/@signalwire/docusaurus-plugin-llms-txt/lib/transformation/plugins/plugin-registry.js
@@ -73,7 +73,7 @@ export class PluginRegistry {
}
// Always last - converts HTML AST to Markdown AST
processor.use(rehypeRemark, {
- handlers: { br: () => ({ type: 'html', value: '<br />' }) },
+ handlers: { br: () => ({ type: 'break' }) },
});
}
/**
13 changes: 12 additions & 1 deletion website/roa-loader/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ const { inspect } = require('node:util');

const { urlToRequest } = require('loader-utils');

const SIGNING_TOKEN = process.env.APIFY_SIGNING_TOKEN;
const signingUrl = new URL('https://api.apify.com/v2/tools/encode-and-sign');
signingUrl.searchParams.set('token', process.env.APIFY_SIGNING_TOKEN);
signingUrl.searchParams.set('token', SIGNING_TOKEN || '');
const queue = [];
const cache = {};
let working = false;
let warnedAboutMissingToken = false;

function hash(source) {
return createHash('sha1').update(source).digest('hex');
Expand Down Expand Up @@ -89,6 +91,15 @@ module.exports = async function (code) {
return { code, hash: 'fast' };
}

// Skip signing if token is not configured
if (!SIGNING_TOKEN) {
if (!warnedAboutMissingToken) {
console.warn('APIFY_SIGNING_TOKEN is not set, skipping code signing for runnable examples.');
warnedAboutMissingToken = true;
}
return { code, hash: 'unsigned' };
}

console.log(`Signing ${urlToRequest(this.resourcePath)}...`, { working, queue: queue.length });
const codeHash = await encodeAndSign(code);
return { code, hash: codeHash };
Expand Down
3 changes: 2 additions & 1 deletion website/src/theme/DocItem/Content/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import BrowserOnly from '@docusaurus/BrowserOnly';
import { useDoc } from '@docusaurus/plugin-content-docs/client';
import { ThemeClassNames } from '@docusaurus/theme-common';
import LLMButtons from '@site/src/components/LLMButtons';
Expand Down Expand Up @@ -27,7 +28,7 @@ export default function DocItemContent({ children }) {
{syntheticTitle && (
<div className={styles.docItemContent}>
{syntheticTitle && <Heading as="h1">{syntheticTitle}</Heading>}
<LLMButtons />
<BrowserOnly>{() => <LLMButtons />}</BrowserOnly>
</div>
)}
<MDXContent>{children}</MDXContent>
Expand Down
Loading