Skip to content

Commit 7cb76c1

Browse files
Merge branch 'production' into patricia/pcx19847-gtm
2 parents b0e179e + 00bbe5d commit 7cb76c1

File tree

335 files changed

+5265
-1789
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

335 files changed

+5265
-1789
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
/src/content/docs/cloudflare-one/access-controls/ @kennyj42 @ranbel @cloudflare/pcx-technical-writing
6767
/src/content/docs/cloudflare-one/team-and-resources/devices/ @ranbel @cloudflare/pcx-technical-writing
6868
/src/content/docs/cloudflare-one/networks/connectors/cloudflare-tunnel/ @nikitacano @ranbel @cloudflare/pcx-technical-writing
69-
/src/content/docs/cloudflare-one/applications/casb/ @maxvp @cloudflare/pcx-technical-writing
69+
/src/content/docs/cloudflare-one/cloud-and-saas-findings/ @maxvp @cloudflare/pcx-technical-writing
7070
/src/content/docs/cloudflare-one/traffic-policies/ @maxvp @cloudflare/pcx-technical-writing
7171
/src/content/docs/cloudflare-one/remote-browser-isolation/ @deadlypants1973 @cloudflare/pcx-technical-writing
7272
/src/content/docs/cloudflare-one/data-loss-prevention/ @maxvp @cloudflare/pcx-technical-writing

.github/workflows/anchor-link-audit.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ jobs:
3939
- run: npm run build
4040
env:
4141
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
NODE_OPTIONS: "--max-old-space-size=4192"
4342

4443
- name: Install dependencies
4544
run: curl https://htmltest.wjdp.uk | bash

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ jobs:
6565
- run: npm run build
6666
env:
6767
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68-
NODE_OPTIONS: "--max-old-space-size=4192"
6968
RUN_LINK_CHECK: true
7069

7170
- run: npm run check:worker
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Close stale issues and pull requests (uses actions/stale@v4 with GITHUB_TOKEN)
2+
on:
3+
schedule:
4+
- cron: "0 0 * * 1" # weekly run: every Monday at 00:00 UTC
5+
workflow_dispatch:
6+
7+
permissions:
8+
issues: write
9+
pull-requests: write
10+
11+
name: Close stale issues and PRs
12+
13+
jobs:
14+
stale:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Run stale action
18+
uses: actions/stale@v4
19+
with:
20+
repo-token: ${{ secrets.GITHUB_TOKEN }}
21+
# Messages for issues (mention the issue author)
22+
stale-issue-message: "Hey there, this issue has been automatically marked as stale because it has not had recent activity. It will be auto-closed after and additional 10 days of inactivity. If you need it open for longer, add the label `stale-exempt`."
23+
close-issue-message: "Hey there, this issue has been automatically closed due to 45 days of inactivity. If needed, please reopen or comment and we can reevaluate your request."
24+
# Messages for pull requests (mention the PR author)
25+
stale-pr-message: "Hey there, this pull request has been automatically marked as stale because it has not had recent activity. It will be auto-closed after and additional 10 days of inactivity. If you need it open for longer, add the label `stale-exempt`."
26+
close-pr-message: "Hey there, this pull request has been automatically closed due to 45 days of inactivity. If needed, please reopen or comment and we can reevaluate your request."
27+
# Time thresholds (adjust to your policy)
28+
days-before-stale: 35
29+
days-before-close: 15
30+
operations-per-run: 100
31+
exempt-pr-labels: stale-exempt
32+
exempt-issues-labels: stale-exempt

.github/workflows/publish-preview.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ jobs:
3333
name: Build
3434
env:
3535
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36-
NODE_OPTIONS: --max-old-space-size=6144
3736
- name: Deploy to Cloudflare Workers
3837
env:
3938
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}

.github/workflows/publish-production.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
name: Build
2929
env:
3030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31-
NODE_OPTIONS: --max-old-space-size=6144
3231
- run: npx wrangler deploy
3332
name: Deploy to Cloudflare Workers
3433
env:

bin/generate-descriptions.ts

Lines changed: 75 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,35 @@
1414
* 2. Have a local Worker running on `localhost:8787` with the following code (also requires adding a binding in the Wrangler config file):
1515
*
1616
* ```
17-
* export interface Env {
18-
* AI: Ai;
19-
* }
20-
21-
* export default {
22-
* async fetch(request, env): Promise<Response> {
23-
* const response = await env.AI.run("@cf/facebook/bart-large-cnn", {
24-
* input_text: await request.text(),
25-
* max_length: 60
26-
* });
27-
* return Response.json(response.summary);
28-
* },
29-
* } satisfies ExportedHandler<Env>;
17+
export interface Env {
18+
AI: Ai;
19+
}
20+
21+
export default {
22+
async fetch(request, env): Promise<Response> {
23+
24+
const input_text = await request.text()
25+
26+
const messages = [
27+
{ role: "system", content: "You are an assistant who helps summarize long chunks of text." },
28+
{ role: "system", content: "You help generate optimized SEO descriptions that are - at most - 60 words. These also convey the most important points of the page and contain keywords." },
29+
{ role: "system", content: "In your response, provide no content other than the summary text."},
30+
{
31+
role: "user",
32+
content: input_text,
33+
},
34+
];
35+
const response = await env.AI.run("@cf/meta/llama-3.3-70b-instruct-fp8-fast", { messages });
36+
37+
return Response.json(response.response);
38+
},
39+
} satisfies ExportedHandler<Env>;
3040
* ```
31-
* 3. Run `npx tsx bin/generate-descriptions.ts --pcx-content-type $TYPE` to generate the descriptions.
41+
* 3. Run `npx tsx bin/generate-descriptions.ts [options]` to generate the descriptions.
42+
*
43+
* Available options:
44+
* - `--pcx-content-type $TYPE`: Filter by content type (e.g., tutorial, overview)
45+
* - `--product $PRODUCT`: Filter by product folder (e.g., workers, pages, r2)
3246
*
3347
*/
3448

@@ -166,18 +180,22 @@ async function updateFrontmatter(
166180
function parseArgs() {
167181
const args = process.argv.slice(2);
168182
let pcxContentType: string | undefined;
183+
let product: string | undefined;
169184
let showHelp = false;
170185

171186
for (let i = 0; i < args.length; i++) {
172187
if (args[i] === "--pcx-content-type" && i + 1 < args.length) {
173188
pcxContentType = args[i + 1];
174189
i++; // Skip the next argument as it's the value
190+
} else if (args[i] === "--product" && i + 1 < args.length) {
191+
product = args[i + 1];
192+
i++; // Skip the next argument as it's the value
175193
} else if (args[i] === "--help" || args[i] === "-h") {
176194
showHelp = true;
177195
}
178196
}
179197

180-
return { pcxContentType, showHelp };
198+
return { pcxContentType, product, showHelp };
181199
}
182200

183201
/**
@@ -189,13 +207,14 @@ Usage: npx tsx bin/generate-descriptions.ts [options]
189207
190208
Options:
191209
--pcx-content-type <type> Filter MDX files by pcx_content_type (e.g., overview, tutorial, navigation)
210+
--product <product> Filter MDX files by product folder (e.g., workers, pages, r2)
192211
--help, -h Show this help message
193212
`);
194213
}
195214

196215
async function main() {
197216
// Parse command line arguments
198-
const { pcxContentType, showHelp } = parseArgs();
217+
const { pcxContentType, product, showHelp } = parseArgs();
199218

200219
if (showHelp) {
201220
showUsage();
@@ -205,6 +224,10 @@ async function main() {
205224
if (pcxContentType) {
206225
console.log(`Filtering by pcx_content_type: ${pcxContentType}`);
207226
}
227+
228+
if (product) {
229+
console.log(`Filtering by product: ${product}`);
230+
}
208231
try {
209232
// Find all MDX files in the docs directory
210233
const mdxFiles = await globby("**/*.mdx", {
@@ -213,21 +236,45 @@ async function main() {
213236
});
214237
console.log(`Found ${mdxFiles.length} MDX files in the docs directory`);
215238

216-
// Filter files by pcx_content_type if specified
239+
// Filter files by product if specified
217240
let filteredMdxFiles = mdxFiles;
241+
if (product) {
242+
const productPath = path.join(DOCS_DIR, product);
243+
244+
// Check if the product directory exists
245+
try {
246+
await fs.access(productPath);
247+
} catch (error) {
248+
console.error(
249+
`Product directory not found: ${productPath} -- ${error}`,
250+
);
251+
process.exit(1);
252+
}
253+
254+
// Filter files by product
255+
filteredMdxFiles = mdxFiles.filter((file) => {
256+
return file.startsWith(productPath);
257+
});
258+
console.log(
259+
`Filtered to ${filteredMdxFiles.length} MDX files in product: ${product}`,
260+
);
261+
}
262+
263+
// Further filter files by pcx_content_type if specified
218264
if (pcxContentType) {
219-
filteredMdxFiles = [];
220-
for (const mdxFile of mdxFiles) {
265+
const contentTypeFiltered = [];
266+
for (const mdxFile of filteredMdxFiles) {
221267
try {
222268
const content = await fs.readFile(mdxFile, "utf-8");
223269
const { data: frontmatter } = matter(content);
224270
if (frontmatter.pcx_content_type === pcxContentType) {
225-
filteredMdxFiles.push(mdxFile);
271+
contentTypeFiltered.push(mdxFile);
226272
}
227273
} catch (error) {
228274
console.error(`Error reading ${mdxFile}:`, error);
229275
}
230276
}
277+
filteredMdxFiles = contentTypeFiltered;
231278
console.log(
232279
`Filtered to ${filteredMdxFiles.length} MDX files with pcx_content_type: ${pcxContentType}`,
233280
);
@@ -306,6 +353,14 @@ async function main() {
306353

307354
console.log("\n--- Summary ---");
308355
console.log(`Total MDX files: ${mdxFiles.length}`);
356+
if (product) {
357+
console.log(`Files in product '${product}': ${filteredMdxFiles.length}`);
358+
}
359+
if (pcxContentType) {
360+
console.log(
361+
`Files with pcx_content_type '${pcxContentType}': ${filteredMdxFiles.length}`,
362+
);
363+
}
309364
console.log(`Updated: ${updatedCount}`);
310365
console.log(`Skipped (already had description): ${skippedExistingCount}`);
311366
console.log(`Skipped (description unchanged): ${skippedUnchangedCount}`);

bin/validate-redirects.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ async function main() {
88
let numDuplicateRedirects = 0;
99
let numNonSlashedRedirects = 0;
1010

11-
const validEndings = ["/", "*", ".xml", ".md", ".json", ".html"];
11+
const validEndings = ["/", "*", ".xml", ".md", ".json", ".html", ".pdf"];
1212

1313
const redirectSourceUrls: string[] = [];
1414

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"type": "module",
55
"scripts": {
66
"astro": "npx astro",
7-
"build": "npx astro build",
7+
"build": "export NODE_OPTIONS='--max-old-space-size=6192' || set NODE_OPTIONS='--max-old-space-size=6192'&& npx astro build",
88
"typegen:worker": "npx wrangler types ./worker/worker-configuration.d.ts",
99
"check": "npm run check:astro && npm run check:worker",
1010
"check:astro": "npx astro check",

0 commit comments

Comments
 (0)