Skip to content

Commit 91ad8f2

Browse files
pabloopezgergunopaulmay-cloudsmithdependabot[bot]runemadsen
authored
merge from Staging (#167)
* add: python uv pkg-mng from ciara with some tweaks * add: small changes * add: go upstream caching * [DOCS-no-ticket] go upstream: add EA note * [gradle] use native maven API context: https://cloudsmith-io.slack.com/archives/C03RCPME8J3/p1750853778322639 * test: work with 2 api versions * Datadog pull interval Context to understand the change: https://cloudsmith-io.slack.com/archives/C053LP018K1/p1750872938999169 * Update integrating-with-datadog.mdx * reorg * Revert support for 2 api spec files * Revert support for 2 api spec files * fix missing component import * fix missing component import * add openapi v3 compatible api schemas * fix(parse.ts): wrong naming * add(continuous security) + a few other fixes * done * edit * add(Claire's review) * epm: @clairemcdyre feedback * typography added * header design done * flatten nested groups with one child * updated containers widths * some more links updated * @paulmay-cloudsmith * malware + updates from readme (chris) * - * remove illustration * remove deployment illustration * remove illustration * - * rm: old token + readme references * integrations add * rm section * sidebar done * add: integrations with svg * add: integrations with svg * Update menu.json * rm(malware page), ask for deeper review * queued readme edits + gcp cloudbuild * DOCS-210 * sidebar edits and quicknav done * Navbar responsive edits * toggleButton edits * eyebrows restyling * searchfield styling done * homepage header light theme done * another batch of changes from readme * clean up * homepage edit done * afterreview edits * Andys extra edits * Andys edits done * clean up * fixes * another batch of changes * card content edit * card content edit * swift + other changes * logo cards edit * vercel fix * vercel fix * vercel fix * vercel fix * add cli upstreams + more * composer supported * done * clean up * clean up * clean up * after review with alan * fix import * final check swift * tags: ['experimental, ...'] * - * fix(oidc_gh_example): ollie suggestion * fix(multiple): @alan suggestions * done * edits * clean up * fix(multiple): @alan suggestions + new langs + others * done * clean up * fix(api_bindings): relocate in devtools * fix(error) menu.json * fix(shiki): rule * fix(shiki): rm swift * fix(shiki): rm swift * add(CLIcontainerized) * add(CLIcontainerized) fix * add(zipapp) * build(deps-dev): bump @eslint/plugin-kit Bumps the npm_and_yarn group with 1 update in the / directory: [@eslint/plugin-kit](https://github.com/eslint/rewrite/tree/HEAD/packages/plugin-kit). Updates `@eslint/plugin-kit` from 0.2.5 to 0.2.8 - [Release notes](https://github.com/eslint/rewrite/releases) - [Changelog](https://github.com/eslint/rewrite/blob/main/packages/plugin-kit/CHANGELOG.md) - [Commits](https://github.com/eslint/rewrite/commits/plugin-kit-v0.2.8/packages/plugin-kit) --- updated-dependencies: - dependency-name: "@eslint/plugin-kit" dependency-version: 0.2.8 dependency-type: indirect dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] <[email protected]> * add(tags like legacy site) * removing experimental tags and fixing SVG to React props * renaming SidePanel to PageInfo * require environmnent variables to show link to GitHub * updating env file * fixing conflict * pointing to main * done with new docs * update(rate limits) * add(about cloudsmith section @Alison) * add(vscode) * add(privileges guide from @dan + a few changes) * add: batch * rm: exc. marks * - * - * add: api lastest pages * - * - * - * - * - * add: dspm glenn review * fix: env NEXT_PUBLIC_CLOUDSMITH_DOCS_URL * add: @ciaracarey suggested edits * add: one from glenn * fix: links * add: missing entries in /formats * fix: unity logo * fix: broken link + mess in integrations snippet * fix: table font size too big * fix: capitalization * add: submenus for formats and integrations --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: gerguno <[email protected]> Co-authored-by: paulmay-cloudsmith <[email protected]> Co-authored-by: paulmay-cloudsmith <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rune Madsen <[email protected]> Co-authored-by: Rune Skjoldborg Madsen <[email protected]>
1 parent a9fd162 commit 91ad8f2

File tree

554 files changed

+21823
-23937
lines changed

Some content is hidden

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

554 files changed

+21823
-23937
lines changed

.env

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
NEXT_PUBLIC_CLOUDSMITH_API_URL="https://api.cloudsmith.io/v2"
1+
NEXT_PUBLIC_CLOUDSMITH_API_URL="https://api.cloudsmith.io"
2+
NEXT_PUBLIC_CLOUDSMITH_DOCS_URL="https://github.com/cloudsmith-io/cloudsmith-docs"
3+
NEXT_PUBLIC_CLOUDSMITH_DOCS_BRANCH="main"
24
CLOUDSMITH_API_V1_URL="https://api.cloudsmith.io/swagger/?format=openapi"
35
CLOUDSMITH_API_V2_URL="https://api.cloudsmith.io/v2/openapi/?format=json"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Then refer to the following guides on how to manage the content of the website:
1313
- [Writing markdown](./docs/markdown.md)
1414
- [Using snippets](./docs/snippets.md)
1515
- [Editing menus](./docs/menus.md)
16+
- [OopenAPI Schemas](./docs/openapi.md)
1617

1718
## Getting started
1819

docs/markdown.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ In the Guides section, you can use a special `GuideLink` component to show a sol
6969
```mdx
7070
import { GuideLink } from '@/components';
7171

72-
<GuideLink href="/getting-started/api-bindings">Click me</GuideLink>
72+
<GuideLink href="/api/api-bindings">Click me</GuideLink>
7373
```
7474

7575
## Dividers

docs/openapi.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# OpenAPI Schemas
2+
3+
The `/api` pages are automatically generated based on two OpenAPI files in `src/content/schemas` holding the `v1` and `v2` API paths.
4+
5+
There are two special features:
6+
7+
- If a path has `"experimental"` as a tag, it will be listed with a big noted saying that this API endpoint is in early access.
8+
- If a path has a `sandboxLink` property with a fully qualified URL, the page will show a API Sandbox link to that URL.

package-lock.json

Lines changed: 17 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-lock.yaml

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/app/(api)/Sidebar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { getMenuItem } from '@/lib/menu/util';
22
import { Sidenav } from '@/components';
3-
import { parseSchema, toMenuItems, toOperations } from '@/lib/swagger/parse';
3+
import { parseSchemas, toMenuItems, toOperations } from '@/lib/swagger/parse';
44

55
export const Sidebar = async () => {
66
const menuData = getMenuItem('api');
77

8-
const schema = await parseSchema();
9-
const operations = toOperations(schema);
8+
const schemas = await parseSchemas();
9+
const operations = toOperations(schemas);
1010
const menuItems = toMenuItems(operations);
1111

1212
const allItems = [];

src/app/(api)/api/[...slug]/page.module.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,38 @@
1010
grid-template-columns: minmax(100px, min-content) minmax(150px, auto) 1fr;
1111
}
1212

13+
.sectionHeading {
14+
color: var(--brand-color-grey-7);
15+
margin-bottom: var(--space-s);
16+
}
17+
1318
.fullWidth {
1419
grid-column: 1 / -1;
1520
}
21+
22+
.description {
23+
display: block;
24+
25+
.sandboxLink {
26+
color: var(--color-text-secondary);
27+
display: flex;
28+
align-items: center;
29+
gap: var(--space-3xs);
30+
width: fit-content;
31+
32+
&:hover {
33+
color: var(--brand-color-blue-7);
34+
}
35+
}
36+
}
37+
38+
.experimentalTag {
39+
margin-bottom: var(--space-s);
40+
}
41+
42+
@media (--tablet-up) {
43+
.description {
44+
display: flex;
45+
justify-content: space-between;
46+
}
47+
}

src/app/(api)/api/[...slug]/page.tsx

Lines changed: 52 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
import { ApiRequest, ApiResponses, TimeAgo, Heading, Paragraph } from '@/components';
1+
import { ApiRequest, ApiResponses, TimeAgo, Heading, Paragraph, Tag, Note } from '@/components';
22
import { loadMdxInfo } from '@/lib/markdown/util';
3-
import { parseSchema, toOperations } from '@/lib/swagger/parse';
3+
import { parseSchemas, toOperations } from '@/lib/swagger/parse';
44
import { toRouteSegments, toSlug } from '@/lib/util';
55
import { notFound } from 'next/navigation';
66
import type { Metadata } from 'next';
77
import { withMdxMetadata, withDefaultMetadata, getLastUpdated } from '@/lib/metadata/util';
8+
import { getMenuItem, getActiveAncestors } from '@/lib/menu/util';
89
import WithQuicknav from '@/components/WithQuickNav';
10+
import { Icon } from '@/icons';
11+
import { Link } from '@/components';
12+
import { cx } from 'class-variance-authority';
913

1014
import styles from './page.module.css';
1115

@@ -27,8 +31,8 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
2731
}
2832

2933
// For Swagger operations, use the operation details
30-
const schema = await parseSchema();
31-
const operations = toOperations(schema);
34+
const schemas = await parseSchemas();
35+
const operations = toOperations(schemas);
3236
const operation = operations.find((op) => op.slug === qualifiedSlug);
3337

3438
if (operation) {
@@ -55,8 +59,8 @@ export const generateStaticParams = async () => {
5559
.map((info) => ({ slug: info.segments }));
5660

5761
// Generate swagger slugs
58-
const schema = await parseSchema();
59-
const operations = toOperations(schema);
62+
const schemas = await parseSchemas();
63+
const operations = toOperations(schemas);
6064
const operationSlugs = operations.map((op) => ({ slug: toRouteSegments(op.slug) }));
6165

6266
return mdxSlugs.concat(operationSlugs);
@@ -70,29 +74,65 @@ const Page = async ({ params }: PageProps) => {
7074
const content = await loadMdxInfo('api');
7175
const mdxInfo = content.find((info) => info.slug === qualifiedSlug);
7276

77+
const pathname = `${qualifiedSlug}`;
78+
const menuData = getMenuItem('api');
79+
const ancestors = getActiveAncestors(pathname, [menuData]);
80+
const parentTitle = ancestors.length > 1 ? ancestors[ancestors.length - 2].title : null;
81+
7382
if (mdxInfo) {
74-
const mdxModule = await import(`@/content/${mdxInfo.file}`);
75-
const { default: Post } = mdxModule;
76-
const lastUpdated = getLastUpdated(mdxModule);
83+
const { default: Post } = await import(`@/content/${mdxInfo.file}`);
84+
const lastUpdated = await getLastUpdated(mdxInfo);
7785

7886
return (
7987
<WithQuicknav>
88+
{parentTitle ? (
89+
<h2 data-quick-nav-ignore className={cx(styles.sectionHeading, 'monoXSUppercase')}>
90+
{parentTitle}
91+
</h2>
92+
) : null}
8093
<Post />
8194
{lastUpdated ? <TimeAgo date={lastUpdated} /> : null}
8295
</WithQuicknav>
8396
);
8497
}
8598

8699
// Otherwise render as an operation
87-
const schema = await parseSchema();
88-
const operations = toOperations(schema);
100+
const schemas = await parseSchemas();
101+
const operations = toOperations(schemas);
89102
const operation = operations.find((op) => op.slug === qualifiedSlug);
90103

91104
if (operation) {
105+
const operationParentTitle =
106+
parentTitle ||
107+
(operation.menuSegments.length > 1 ? operation.menuSegments[operation.menuSegments.length - 2] : null);
108+
92109
return (
93110
<div className={styles.root}>
111+
{operationParentTitle ? (
112+
<h2 data-quick-nav-ignore className={cx(styles.sectionHeading, 'monoXSUppercase')}>
113+
{operationParentTitle}
114+
</h2>
115+
) : null}
116+
{operation.experimental ? (
117+
<Tag variant="lightyellow" className={styles.experimentalTag}>
118+
Early access
119+
</Tag>
120+
) : null}
94121
<Heading size="h1">{operation.title}</Heading>
95-
{operation.description ? <Paragraph>{operation.description}</Paragraph> : null}
122+
<div className={styles.description}>
123+
{operation.description && <Paragraph>{operation.description}</Paragraph>}
124+
{operation.sandboxLink && (
125+
<Link href={operation.sandboxLink} className={cx(styles.sandboxLink, 'bodyS')} target="_blank">
126+
<span>Open API Sandbox</span>
127+
<Icon name="external" title="Open API Sandbox" />
128+
</Link>
129+
)}
130+
</div>
131+
{operation.experimental ? (
132+
<Note variant="warning" noHeadline>
133+
This endpoint is in early access, and may not be available to you. Contact us to request access
134+
</Note>
135+
) : null}
96136

97137
<div className={styles.gridRoot}>
98138
<Heading size="h2" className={styles.fullWidth}>

src/app/(api)/api/page.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ const Page = async () => {
3535
const mdxInfo = content.find((info) => info.slug === '');
3636

3737
if (mdxInfo) {
38-
const mdxModule = await import(`@/content/${mdxInfo.file}`);
39-
const { default: Post } = mdxModule;
40-
const lastUpdated = getLastUpdated(mdxModule);
38+
const { default: Post } = await import(`@/content/${mdxInfo.file}`);
39+
const lastUpdated = await getLastUpdated(mdxInfo);
4140

4241
return (
4342
<WithQuicknav>

0 commit comments

Comments
 (0)