Skip to content

Commit 3ea5bab

Browse files
committed
Merge branch 'production' into reorder-nav
2 parents a555a3e + f155709 commit 3ea5bab

File tree

552 files changed

+10010
-4110
lines changed

Some content is hidden

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

552 files changed

+10010
-4110
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
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
@@ -140,7 +140,7 @@
140140
/src/content/docs/analytics/analytics-engine/ @irvinebroque @elithrar @cloudflare/pcx-technical-writing
141141
/src/content/docs/cloudflare-for-platforms/ @irvinebroque @dinasaur404 @cloudflare/pcx-technical-writing
142142
/src/content/docs/cloudflare-for-platforms/workers-for-platforms/ @irvinebroque @dinasaur404 @cloudflare/deploy-config @cloudflare/pcx-technical-writing
143-
/src/content/docs/workers/observability/ @irvinebroque @mikenomitch @rohinlohe @kodster28 @cloudflare/pcx-technical-writing
143+
/src/content/docs/workers/observability/ @irvinebroque @mikenomitch @nevikashah @kodster28 @cloudflare/pcx-technical-writing
144144
/src/content/docs/workers/static-assets @irvinebroque @GregBrimble @WalshyDev @kodster28 @cloudflare/deploy-config @cloudflare/pcx-technical-writing
145145
/src/content/docs/workflows/ @elithrar @celso @cloudflare/pcx-technical-writing
146146
/src/content/docs/sandbox/ @whoiskatrin @ghostwriternr @cloudflare/pcx-technical-writing @cloudflare/ai-agents

.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: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
stale-issue-message: "Hey there, we've marked this pull request as stale because there's no recent activity on it. This label helps us identify long-standing issues in our repo (and not used to auto-close issues)."
22+
stale-pr-message: "Hey there, we've marked this pull request as stale because there's no recent activity on it. This label is helps us identify PRs that might need updates (or to be closed out by our team if no longer relevant)."
23+
days-before-stale: 35
24+
# setting to a negative number means they'll never be autoclosed
25+
days-before-close: -1
26+
operations-per-run: 100

.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:
-218 KB
Binary file not shown.

astro.config.ts

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import react from "@astrojs/react";
1111

1212
import { readdir } from "fs/promises";
1313
import { fileURLToPath } from "url";
14+
import { execSync } from "child_process";
15+
import { existsSync } from "fs";
1416

1517
import remarkValidateImages from "./src/plugins/remark/validate-images";
1618

@@ -59,6 +61,52 @@ const customCss = await autogenStyles();
5961

6062
const runLinkCheck = process.env.RUN_LINK_CHECK || false;
6163

64+
/**
65+
* Get the last Git modification date for a file
66+
* @param filePath - Absolute path to the file
67+
* @returns ISO date string or null if not available
68+
*/
69+
function getGitLastModified(filePath: string): string | null {
70+
try {
71+
const result = execSync(`git log -1 --format=%cI -- "${filePath}"`, {
72+
encoding: "utf-8",
73+
}).trim();
74+
return result || null;
75+
} catch (_error) {
76+
return null;
77+
}
78+
}
79+
80+
/**
81+
* Convert a sitemap URL to the corresponding source file path
82+
* @param url - The full URL from the sitemap
83+
* @returns Absolute file path or null if not found
84+
*/
85+
function urlToFilePath(url: string): string | null {
86+
try {
87+
const urlObj = new URL(url);
88+
const pathname = urlObj.pathname.replace(/\/$/, ""); // Remove trailing slash
89+
90+
// Try different file extensions and paths
91+
const possiblePaths = [
92+
`./src/content/docs${pathname}.md`,
93+
`./src/content/docs${pathname}.mdx`,
94+
`./src/content/docs${pathname}/index.md`,
95+
`./src/content/docs${pathname}/index.mdx`,
96+
];
97+
98+
for (const path of possiblePaths) {
99+
if (existsSync(path)) {
100+
return path;
101+
}
102+
}
103+
104+
return null;
105+
} catch (_error) {
106+
return null;
107+
}
108+
}
109+
62110
// https://astro.build/config
63111
export default defineConfig({
64112
site: "https://developers.cloudflare.com",
@@ -194,7 +242,18 @@ export default defineConfig({
194242
return true;
195243
},
196244
serialize(item) {
197-
item.lastmod = new Date().toISOString();
245+
const filePath = urlToFilePath(item.url);
246+
if (filePath) {
247+
const gitDate = getGitLastModified(filePath);
248+
if (gitDate) {
249+
item.lastmod = gitDate;
250+
}
251+
} else {
252+
console.warn(
253+
`[sitemap] Could not find last modified for ${item.url} - setting to now`,
254+
);
255+
item.lastmod = new Date().toISOString();
256+
}
198257
return item;
199258
},
200259
}),

bin/fetch-warp-releases.js

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ fs.writeFileSync(
1414
"utf-8",
1515
);
1616

17+
const linuxDistributions = ["Ubuntu", "Debian", "CentOS", "Fedora"];
18+
1719
const linesToRemove = [
1820
"For related Cloudflare for Teams documentation please see: https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp",
1921
"For Zero Trust documentation please see: <https://developers.cloudflare.com/cloudflare-one/connections/connect-devices/warp>",
2022
"For related Consumer documentation please see: https://developers.cloudflare.com/warp-client/",
2123
"For Consumer documentation please see: <https://developers.cloudflare.com/warp-client/>",
2224
];
2325

24-
for (const { platform } of platforms) {
25-
const isLinux = platform !== "windows" && platform !== "macos";
26+
for (const { platform, display_name } of platforms) {
27+
const isLinux = linuxDistributions.some((dist) =>
28+
display_name.includes(dist),
29+
);
2630

2731
for (const track of ["ga", "beta"]) {
2832
fetch(`${BASE_URL}/update/json/${platform}/${track}`)
@@ -63,9 +67,17 @@ for (const { platform } of platforms) {
6367
);
6468

6569
existingFile.linuxPlatforms[platform] = item.packageSize;
70+
} else {
71+
console.log(
72+
`${platform} already exists in Linux ${track} ${item.version}.`,
73+
);
6674
}
6775

68-
fs.writeFileSync(path, YAML.stringify(existingFile), "utf-8");
76+
fs.writeFileSync(
77+
path,
78+
YAML.stringify(existingFile, { blockQuote: "literal" }),
79+
"utf-8",
80+
);
6981
} else {
7082
console.log(
7183
`${platform} ${track} ${item.version} already exists.`,
@@ -75,7 +87,7 @@ for (const { platform } of platforms) {
7587
return;
7688
}
7789

78-
console.log(`Saving ${track} ${item.version}.`);
90+
console.log(`Saving ${platform} ${track} ${item.version}.`);
7991

8092
let markdown = item.releaseNotes;
8193

@@ -103,14 +115,17 @@ for (const { platform } of platforms) {
103115

104116
fs.writeFileSync(
105117
path,
106-
YAML.stringify({
107-
...item,
108-
releaseNotes,
109-
platformName,
110-
linuxPlatforms: isLinux
111-
? { [platform]: item.packageSize }
112-
: undefined,
113-
}),
118+
YAML.stringify(
119+
{
120+
...item,
121+
releaseNotes,
122+
platformName,
123+
linuxPlatforms: isLinux
124+
? { [platform]: item.packageSize }
125+
: undefined,
126+
},
127+
{ blockQuote: "literal" },
128+
),
114129
"utf-8",
115130
);
116131
});

0 commit comments

Comments
 (0)