Skip to content

Commit 6028a29

Browse files
authored
docs: Update URL structure (#9237)
1 parent 779e1d0 commit 6028a29

File tree

215 files changed

+1068
-1007
lines changed

Some content is hidden

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

215 files changed

+1068
-1007
lines changed

.circleci/comment.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ async function run() {
6161
[Size diff since last release](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/publish-stats/size-diff.txt)
6262
[Docs](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/verdaccio/docs/index.html)
6363
[Storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html?path=/story/accordion--default)
64-
[S2 Storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-s2/index.html)`
64+
[S2 Storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-s2/index.html)
65+
[S2 docs](https://d1pzu54gtk2aed.cloudfront.net/main/${process.env.CIRCLE_SHA1}/)
66+
[React Aria docs](https://d5iwopk28bdhl.cloudfront.net/main/${process.env.CIRCLE_SHA1}/)`
6567
});
6668
}
6769
} catch (error) {
@@ -81,8 +83,9 @@ async function run() {
8183
8284
* [View the storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook/index.html?path=/story/accordion--default)
8385
* [View the S2 storybook](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/storybook-s2/index.html)
84-
* [View the documentation](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/docs/index.html)
85-
* [View the S2 docs](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/s2-docs/index.html)`
86+
* [View the v3 docs](https://reactspectrum.blob.core.windows.net/reactspectrum/${process.env.CIRCLE_SHA1}/docs/index.html)
87+
* [View the S2 docs](https://d1pzu54gtk2aed.cloudfront.net/pr/${process.env.CIRCLE_SHA1}/)
88+
* [View the React Aria docs](https://d5iwopk28bdhl.cloudfront.net/pr/${process.env.CIRCLE_SHA1}/)`
8689
});
8790
} catch (err) {
8891
console.error(err);

.circleci/config.yml

Lines changed: 66 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ parameters:
1313
type: string
1414
default: ""
1515

16+
orbs:
17+
aws-cli: circleci/aws-cli@5.4.1
18+
aws-s3: circleci/aws-s3@4.1
19+
1620
executors:
1721
rsp:
1822
docker:
@@ -45,6 +49,30 @@ executors:
4549
CACHE_VERSION: v1
4650
working_directory: ~/react-spectrum
4751

52+
commands:
53+
deploy-s3:
54+
parameters:
55+
dir:
56+
type: string
57+
bucket:
58+
type: string
59+
steps:
60+
- attach_workspace:
61+
at: /tmp/dist
62+
- aws-cli/install
63+
- aws-s3/sync:
64+
arguments: --cache-control public,max-age=300,stale-while-revalidate=300 --exclude * --include *.html --include *.txt --include *.json --include *.md --include *.xml
65+
from: /tmp/dist/s2-docs/<< parameters.dir >>
66+
to: << parameters.bucket >>
67+
- aws-s3/sync:
68+
arguments: --cache-control public,max-age=300,stale-while-revalidate=300 --content-type text/x-component;charset=utf-8 --exclude * --include *.rsc
69+
from: /tmp/dist/s2-docs/<< parameters.dir >>
70+
to: << parameters.bucket >>
71+
- aws-s3/sync:
72+
arguments: --cache-control public,max-age=31536000,immutable --include * --exclude *.html --exclude *.rsc --exclude *.txt --exclude *.json --exclude *.md --exclude *.xml
73+
from: /tmp/dist/s2-docs/<< parameters.dir >>
74+
to: << parameters.bucket >>
75+
4876
jobs:
4977
install:
5078
executor: rsp-large
@@ -480,35 +508,35 @@ jobs:
480508
paths:
481509
- '*/docs/'
482510

483-
docs-beta:
511+
s2-docs:
484512
executor: rsp-xlarge
485513
steps:
486514
- restore_cache:
487515
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
488516

489517
- run:
490-
name: build docs
491-
command: make s2-docs-production
518+
name: build s2 docs
519+
command: make s2-docs
492520

493521
- persist_to_workspace:
494522
root: dist
495523
paths:
496-
- '*/docs/'
524+
- 's2-docs/'
497525

498-
s2-docs:
526+
s2-docs-production:
499527
executor: rsp-xlarge
500528
steps:
501529
- restore_cache:
502530
key: react-spectrum-{{ .Environment.CACHE_VERSION }}-{{ .Environment.CIRCLE_SHA1 }}
503531

504532
- run:
505533
name: build s2 docs
506-
command: make s2-docs
534+
command: make s2-docs-production
507535

508536
- persist_to_workspace:
509537
root: dist
510538
paths:
511-
- '*/s2-docs/'
539+
- 's2-docs/'
512540

513541
verdaccio:
514542
executor: rsp-xlarge
@@ -823,6 +851,16 @@ jobs:
823851
azcopy copy "/tmp/dist/production/docs/*" "https://reactspectrum.blob.core.windows.net/\$web${AZURE_STORAGE_SAS_TOKEN}" --recursive --include-pattern "*.txt" --content-type "text/plain; charset=utf-8" --cache-control "max-age=300"
824852
azcopy copy "/tmp/dist/production/docs/*" "https://reactspectrum.blob.core.windows.net/\$web${AZURE_STORAGE_SAS_TOKEN}" --recursive --include-pattern "*.html;*.rsc" --cache-control "max-age=300"
825853
854+
deploy-s3-stage:
855+
executor: rsp
856+
steps:
857+
- deploy-s3:
858+
dir: react-aria
859+
bucket: s3://react-aria-stage
860+
- deploy-s3:
861+
dir: s2
862+
bucket: s3://react-spectrum-stage
863+
826864
comment:
827865
executor: rsp
828866
steps:
@@ -934,6 +972,12 @@ workflows:
934972
- s2-docs:
935973
requires:
936974
- install
975+
- s2-docs-production:
976+
requires:
977+
- install
978+
filters:
979+
branches:
980+
only: main
937981
- verdaccio:
938982
filters:
939983
branches:
@@ -988,7 +1032,21 @@ workflows:
9881032
- storybook
9891033
- storybook-s2
9901034
- docs
1035+
- deploy-s3-stage:
1036+
name: deploy-s3-commit
1037+
requires:
9911038
- s2-docs
1039+
filters:
1040+
branches:
1041+
ignore: main
1042+
- deploy-s3-stage:
1043+
name: deploy-s3-main
1044+
requires:
1045+
- s2-docs
1046+
- s2-docs-production
1047+
filters:
1048+
branches:
1049+
only: main
9921050
- deploy-verdaccio:
9931051
requires:
9941052
- v-docs
@@ -1009,6 +1067,7 @@ workflows:
10091067
requires:
10101068
- ts-diff
10111069
- deploy
1070+
- deploy-s3-commit
10121071
- comment:
10131072
name: comment-verdaccio
10141073
requires:
@@ -1036,26 +1095,6 @@ workflows:
10361095
requires:
10371096
- docs-production
10381097

1039-
1040-
beta-docs:
1041-
when:
1042-
and:
1043-
- equal: [ "beta-docs", << pipeline.parameters.GHA_Action >> ]
1044-
jobs:
1045-
- install
1046-
- docs-beta:
1047-
filters:
1048-
branches:
1049-
only: beta-docs
1050-
requires:
1051-
- install
1052-
- deploy-production:
1053-
filters:
1054-
branches:
1055-
only: beta-docs
1056-
requires:
1057-
- docs-beta
1058-
10591098
nightly:
10601099
triggers:
10611100
- schedule:

Makefile

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
SHELL := /bin/bash
44
PATH := ./node_modules/.bin:$(PATH)
5+
BRANCH := $(or $(CIRCLE_BRANCH),$(shell git rev-parse --abbrev-ref HEAD))
6+
BRANCH_TYPE := $(if $(filter $(BRANCH),main),main,pr)
7+
HASH := $(shell git rev-parse HEAD)
58

69
all: node_modules
710

@@ -146,19 +149,25 @@ s2-api-diff:
146149
node scripts/api-diff.js --skip-same --skip-style-props
147150

148151
s2-docs:
149-
PUBLIC_URL=https://reactspectrum.blob.core.windows.net/reactspectrum/$$(git rev-parse HEAD)/s2-docs DIST_DIR=dist/$$(git rev-parse HEAD)/s2-docs $(MAKE) build-s2-docs
152+
DOCS_ENV=stage PUBLIC_URL=/$(BRANCH_TYPE)/$(HASH) $(MAKE) build-s2-docs
153+
cp packages/dev/docs/pages/disallow-robots.txt dist/s2-docs/react-aria/$(BRANCH_TYPE)/$(HASH)/robots.txt
154+
cp packages/dev/docs/pages/disallow-robots.txt dist/s2-docs/s2/$(BRANCH_TYPE)/$(HASH)/robots.txt
150155

151156
s2-docs-production:
152-
PUBLIC_URL=https://react-spectrum.adobe.com/beta DIST_DIR=dist/production/docs/beta $(MAKE) build-s2-docs
157+
DOCS_ENV=prod PUBLIC_URL=/ $(MAKE) build-s2-docs
158+
cp packages/dev/docs/pages/robots.txt dist/s2-docs/react-aria/robots.txt
159+
cp packages/dev/docs/pages/robots.txt dist/s2-docs/s2/robots.txt
153160

154161
build-s2-docs:
155162
yarn workspace @react-spectrum/s2-docs generate:md
156163
yarn workspace @react-spectrum/s2-docs generate:og
157-
REGISTRY_URL=$(PUBLIC_URL)/registry node scripts/buildRegistry.mjs
158-
REGISTRY_URL=$(PUBLIC_URL)/registry yarn build:s2-docs --public-url $(PUBLIC_URL)
164+
node scripts/buildRegistry.mjs
165+
yarn build:s2-docs
159166
node scripts/createFeedS2.mjs
160-
mkdir -p $(DIST_DIR)
161-
mv packages/dev/s2-docs/dist/* $(DIST_DIR)
162-
mkdir -p $(DIST_DIR)/registry
163-
mv starters/docs/registry $(DIST_DIR)/registry/vanilla
164-
mv starters/tailwind/registry $(DIST_DIR)/registry/tailwind
167+
mkdir -p dist/s2-docs/react-aria/$(PUBLIC_URL)
168+
mkdir -p dist/s2-docs/s2/$(PUBLIC_URL)
169+
mv packages/dev/s2-docs/dist/react-aria/* dist/s2-docs/react-aria/$(PUBLIC_URL)
170+
mv packages/dev/s2-docs/dist/s2/* dist/s2-docs/s2/$(PUBLIC_URL)
171+
mkdir -p dist/s2-docs/react-aria/$(PUBLIC_URL)/registry
172+
mv starters/docs/registry dist/s2-docs/react-aria/$(PUBLIC_URL)/registry/vanilla
173+
mv starters/tailwind/registry dist/s2-docs/react-aria/$(PUBLIC_URL)/registry/tailwind

packages/dev/s2-docs/.parcelrc-s2-docs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"extends": "@parcel/config-default",
3-
"resolvers": ["@react-aria/parcel-resolver-optimize-locales", "@parcel/resolver-glob", "parcel-resolver-docs", "..."],
3+
"resolvers": ["@react-aria/parcel-resolver-optimize-locales", "@parcel/resolver-glob", "./S2DocsResolver", "parcel-resolver-docs", "..."],
44
"transformers": {
55
"docs:*.{js,ts,tsx,json}": ["parcel-transformer-docs", "@parcel/transformer-inline"],
66
"docs-json:*.{js,ts,tsx,json}": ["parcel-transformer-docs"],
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
const {Resolver} = require('@parcel/plugin');
2+
3+
module.exports = new Resolver({
4+
resolve({dependency}) {
5+
// Ignore URL dependencies in MDX files.
6+
if (dependency.sourcePath?.endsWith('.mdx') && dependency.isOptional) {
7+
return {isExcluded: true};
8+
}
9+
}
10+
});

packages/dev/s2-docs/package.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
6-
"start": "DOCS_ENV=dev parcel --config .parcelrc-s2-docs",
7-
"build": "DOCS_ENV=staging parcel build --config .parcelrc-s2-docs",
6+
"start": "parcel 'pages/**/*.mdx' --config .parcelrc-s2-docs",
7+
"start:s2": "DOCS_ENV=dev LIBRARY=s2 parcel 'pages/s2/**/*.mdx' -p 4321 --config .parcelrc-s2-docs --dist-dir dist/s2 --cache-dir ../../../.parcel-cache/s2",
8+
"start:react-aria": "DOCS_ENV=dev LIBRARY=react-aria parcel 'pages/react-aria/**/*.mdx' -p 1234 --config .parcelrc-s2-docs --dist-dir dist/react-aria --cache-dir ../../../.parcel-cache/react-aria",
9+
"build": "yarn build:s2 --public-url $PUBLIC_URL && yarn build:react-aria --public-url $PUBLIC_URL",
10+
"build:s2": "LIBRARY=s2 parcel build 'pages/s2/**/*.mdx' --config .parcelrc-s2-docs --dist-dir dist/s2 --cache-dir ../../../.parcel-cache/s2",
11+
"build:react-aria": "LIBRARY=react-aria parcel build 'pages/react-aria/**/*.mdx' --config .parcelrc-s2-docs --dist-dir dist/react-aria --cache-dir ../../../.parcel-cache/react-aria",
812
"generate:og": "node scripts/generateOGImages.mjs",
913
"generate:md": "node scripts/generateMarkdownDocs.mjs"
1014
},
1115
"targets": {
1216
"react-static": {
13-
"source": "pages/**/*.mdx",
1417
"context": "react-server",
1518
"engines": {
1619
"browsers": [
@@ -22,7 +25,8 @@
2225
"includeNodeModules": {
2326
"tree-sitter-highlight": false,
2427
"json5": false,
25-
"globals-docs": false
28+
"globals-docs": false,
29+
"@parcel/rust": false
2630
}
2731
}
2832
},

packages/dev/s2-docs/pages/WelcomeHeader.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function LibraryCards() {
4141
<Text slot="description">{TAB_DEFS['react-spectrum'].description}</Text>
4242
</Content>
4343
<Footer>
44-
<LinkButton href="s2/index.html" variant="accent">Get started</LinkButton>
44+
<LinkButton href="s2/" variant="accent">Get started</LinkButton>
4545
</Footer>
4646
</ProductCard>
4747

@@ -52,7 +52,7 @@ export function LibraryCards() {
5252
<Text slot="description">{TAB_DEFS['react-aria'].description}</Text>
5353
</Content>
5454
<Footer>
55-
<LinkButton href="react-aria/Autocomplete.html" variant="accent">Explore</LinkButton>
55+
<LinkButton href="react-aria/" variant="accent">Explore</LinkButton>
5656
</Footer>
5757
</ProductCard>
5858

@@ -63,7 +63,7 @@ export function LibraryCards() {
6363
<Text slot="description">{TAB_DEFS['internationalized'].description}</Text>
6464
</Content>
6565
<Footer>
66-
<LinkButton href="internationalized/date/index.html" variant="accent">Show Packages</LinkButton>
66+
<LinkButton href="internationalized/date/" variant="accent">Show Packages</LinkButton>
6767
</Footer>
6868
</ProductCard>
6969
</div>

packages/dev/s2-docs/pages/index.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The React Spectrum docs have a new look! This is a **beta preview** so keep in m
1616
## What's new?
1717

1818
- Docs for [Spectrum 2](https://s2.spectrum.adobe.com) components
19-
- New docs for [React Aria](react-aria/Autocomplete.html) and [Internationalized](internationalized/date/index.html)
19+
- New docs for [React Aria](react-aria/Autocomplete) and [Internationalized](internationalized/date/)
2020
- A new search menu experience
2121
- Interactive controls for examples
2222
- New concept guides
@@ -25,4 +25,4 @@ The React Spectrum docs have a new look! This is a **beta preview** so keep in m
2525

2626
## Roadmap
2727

28-
The existing docs are still available [here](https://react-spectrum.adobe.com/index.html). We plan to do a full release of the new docs site by early 2026, so we welcome any and all feedback!
28+
The existing docs are still available [here](https://react-spectrum.adobe.com/). We plan to do a full release of the new docs site by early 2026, so we welcome any and all feedback!

packages/dev/s2-docs/pages/react-aria/Autocomplete.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@ export const description = 'Allows users to search or filter a list of suggestio
111111

112112
## Content
113113

114-
Autocomplete filters a collection component using a [TextField](TextField.html) or [SearchField](SearchField.html). It can be used to build UI patterns such as command palettes, searchable menus, filterable selects, and more.
114+
Autocomplete filters a collection component using a [TextField](TextField) or [SearchField](SearchField). It can be used to build UI patterns such as command palettes, searchable menus, filterable selects, and more.
115115

116-
[Menu](Menu.html) and [ListBox](ListBox.html) support **virtual focus**, which allows arrow key navigation within the list while the text input is focused. Use `disableVirtualFocus` to require the user to tab between the input and list.
116+
[Menu](Menu) and [ListBox](ListBox) support **virtual focus**, which allows arrow key navigation within the list while the text input is focused. Use `disableVirtualFocus` to require the user to tab between the input and list.
117117

118118
<ExampleSwitcher type="component" examples={['Menu', 'Select', 'ListBox', 'TagGroup', 'GridList', 'Table']}>
119119

@@ -1108,7 +1108,7 @@ function AsyncLoadingExample() {
11081108

11091109
## API
11101110

1111-
```tsx links={{Autocomplete: '#autocomplete', SearchField: 'SearchField.html', TextField: 'TextField.html', Menu: 'Menu.html', ListBox: 'ListBox.html', TagGroup: 'TagGroup.html', GridList: 'GridList.html', Table: 'Table.html'}}
1111+
```tsx links={{Autocomplete: '#autocomplete', SearchField: 'SearchField', TextField: 'TextField', Menu: 'Menu', ListBox: 'ListBox', TagGroup: 'TagGroup', GridList: 'GridList', Table: 'Table'}}
11121112
<Autocomplete>
11131113
<SearchField /> or <TextField />
11141114
<Menu />, <ListBox />, <TagGroup />, <GridList />, or <Table />

packages/dev/s2-docs/pages/react-aria/Breadcrumbs.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const description = 'Displays a hierarchy of links to the current page or
4141

4242
## Content
4343

44-
`Breadcrumbs` follows the [Collection Components API](collections.html?component=Breadcrumbs), accepting both static and dynamic collections. This example shows a dynamic collection, passing a list of objects to the `items` prop, and a function to render the children. The `onAction` event is called when a user presses a breadcrumb.
44+
`Breadcrumbs` follows the [Collection Components API](collections?component=Breadcrumbs), accepting both static and dynamic collections. This example shows a dynamic collection, passing a list of objects to the `items` prop, and a function to render the children. The `onAction` event is called when a user presses a breadcrumb.
4545

4646
```tsx render
4747
"use client";
@@ -80,7 +80,7 @@ function Example() {
8080

8181
<Anatomy />
8282

83-
```tsx links={{Breadcrumbs: '#breadcrumbs', Breadcrumb: '#breadcrumb', Link: 'Link.html'}}
83+
```tsx links={{Breadcrumbs: '#breadcrumbs', Breadcrumb: '#breadcrumb', Link: 'Link'}}
8484
<Breadcrumbs>
8585
<Breadcrumb>
8686
<Link />

0 commit comments

Comments
 (0)