Skip to content

Commit 37293e4

Browse files
committed
fix merge conflict
2 parents 7fe2241 + 63fcf6c commit 37293e4

File tree

626 files changed

+30794
-158713
lines changed

Some content is hidden

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

626 files changed

+30794
-158713
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ node_modules
1313
.nvmrc
1414
Dockerfile
1515
bin
16+
17+
gatsby/public
18+
gatsby/node_modules

.envrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set -e
2+
3+
layout node

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: volta-cli/action@v1
17+
- run: yarn install
18+
working-directory: gatsby
19+
- run: yarn test
20+
working-directory: gatsby

.gitignore

Lines changed: 77 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,84 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
*.pid.lock
13+
14+
# Directory for instrumented libs generated by jscoverage/JSCover
15+
lib-cov
16+
17+
# Coverage directory used by tools like istanbul
18+
coverage
19+
20+
# nyc test coverage
21+
.nyc_output
22+
23+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
24+
.grunt
25+
26+
# Bower dependency directory (https://bower.io/)
27+
bower_components
28+
29+
# node-waf configuration
30+
.lock-wscript
31+
32+
# Compiled binary addons (http://nodejs.org/api/addons.html)
33+
build/Release
34+
35+
# Dependency directories
36+
node_modules/
37+
jspm_packages/
38+
39+
# Typescript v1 declaration files
40+
typings/
41+
42+
# Optional npm cache directory
43+
.npm
44+
45+
# Optional eslint cache
46+
.eslintcache
47+
48+
# Optional REPL history
49+
.node_repl_history
50+
51+
# Output of 'npm pack'
52+
*.tgz
53+
54+
# dotenv environment variables file
55+
.env
56+
.env.development
57+
58+
# gatsby files
59+
.cache/
60+
public
61+
62+
# Mac files
63+
.DS_Store
64+
65+
# Yarn
66+
package-lock.json
67+
yarn-error.log
68+
.pnp/
69+
.pnp.js
70+
# Yarn Integrity file
71+
.yarn-integrity
72+
73+
# jekyll output
174
_site
2-
.sass-cache
375
.jekyll-metadata
476
.jekyll-cache
77+
.sass-cache
578
.link-checker
679
.asset-cache
7-
/node_modules/
8-
/apidocs
9-
package-lock.json
10-
.DS_Store
1180
src/_assets/js/bundle.js*
81+
82+
/apidocs
83+
1284
tmp
13-
coverage/
14-
.yarn-error
15-
yarn-error.log

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.11.3
1+
10.14.2

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
exclude: '\.snap|node_modules$'
2+
repos:
3+
- repo: git://github.com/pre-commit/pre-commit-hooks
4+
rev: v1.4.0
5+
hooks:
6+
- id: check-case-conflict
7+
- id: check-merge-conflict
8+
- id: check-symlinks
9+
- id: check-xml
10+
- id: check-yaml
11+
- id: detect-private-key
12+
- id: end-of-file-fixer
13+
- id: trailing-whitespace
14+
- id: debug-statements
15+
- id: flake8
16+
- id: fix-encoding-pragma
17+
args: ["--remove"]
18+
- repo: git://github.com/getsentry/pre-commit-hooks
19+
rev: f3237d2d65af81d435c49dee3593dc8f03d23c2d
20+
hooks:
21+
- id: prettier
22+
entry: gatsby/node_modules/.bin/prettier
23+
# - id: eslint
24+
# entry: gatsby/node_modules/.bin/eslint

.prettierrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
singleQuote: true

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ cache:
1010
directories:
1111
- node_modules
1212
script:
13-
- bin/test
13+
- yarn test-jekyll
1414
- yarn run snyk-protect
1515
dist: trusty

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
"files.trimTrailingWhitespace": false,
44
"prettier.disableLanguages": ["markdown", "html", "scss"],
55

6+
"files.associations": {
7+
"*.js": "javascriptreact"
8+
},
9+
610
"liquid.format": false,
711

812
"[ruby]": {

.yarnrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
11
ARG VERSION=2020.01.23
2+
23
FROM getsentry/jekyll-base:builder-${VERSION} AS builder
4+
5+
# we have to use a diff base image than jekyll due to the node version requirements
6+
# XXX(dcramer): when jekyll is gone, there's a base imagine we can use if gatsby lives at document root
7+
FROM node:12-buster as gatsby
8+
9+
ARG BUILD_CONF={}
10+
ENV BUILD_CONF="$BUILD_CONF"
11+
12+
ARG ALGOLIA_INDEX=
13+
ENV ALGOLIA_INDEX=$ALGOLIA_INDEX
14+
15+
ARG ALGOLIA_ADMIN_KEY=
16+
ENV ALGOLIA_ADMIN_KEY=$ALGOLIA_ADMIN_KEY
17+
18+
RUN yarn global add gatsby-cli
19+
WORKDIR /usr/src/app
20+
ADD . ./
21+
WORKDIR /usr/src/app/gatsby
22+
RUN yarn
23+
RUN gatsby build
24+
325
FROM getsentry/jekyll-base:runtime-${VERSION} AS runtime
26+
27+
COPY --from=gatsby /usr/src/app/gatsby/public/ /usr/share/nginx/html/gatsby
28+
COPY --from=builder /usr/src/app/_site/ /usr/share/nginx/html/jekyll

Gemfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ GIT
2020
GEM
2121
remote: https://rubygems.org/
2222
specs:
23-
activesupport (5.2.3)
23+
activesupport (5.2.4.3)
2424
concurrent-ruby (~> 1.0, >= 1.0.2)
2525
i18n (>= 0.7, < 2)
2626
minitest (~> 5.1)
@@ -37,7 +37,7 @@ GEM
3737
execjs
3838
colorator (1.1.0)
3939
colorize (0.8.1)
40-
concurrent-ruby (1.1.5)
40+
concurrent-ruby (1.1.6)
4141
em-websocket (0.5.1)
4242
eventmachine (>= 0.12.9)
4343
http_parser.rb (~> 0.6.0)
@@ -62,7 +62,7 @@ GEM
6262
yell (~> 2.0)
6363
http_parser.rb (0.6.0)
6464
httpclient (2.8.3)
65-
i18n (1.6.0)
65+
i18n (1.8.2)
6666
concurrent-ruby (~> 1.0)
6767
jekyll-algolia (1.2.7)
6868
algolia_html_extractor (~> 2.5.2)
@@ -109,15 +109,15 @@ GEM
109109
ruby_dep (~> 1.2)
110110
mercenary (0.3.6)
111111
mini_portile2 (2.3.0)
112-
minitest (5.11.3)
112+
minitest (5.14.1)
113113
nokogiri (1.8.5)
114114
mini_portile2 (~> 2.3.0)
115115
parallel (1.17.0)
116116
pathutil (0.16.2)
117117
forwardable-extended (~> 2.6)
118118
progressbar (1.10.0)
119119
public_suffix (3.0.3)
120-
rack (2.0.8)
120+
rack (2.2.3)
121121
rb-fsevent (0.10.3)
122122
rb-inotify (0.10.0)
123123
ffi (~> 1.0)
@@ -135,7 +135,7 @@ GEM
135135
thread_safe (0.3.6)
136136
typhoeus (1.3.1)
137137
ethon (>= 0.9.0)
138-
tzinfo (1.2.5)
138+
tzinfo (1.2.7)
139139
thread_safe (~> 0.1)
140140
verbal_expressions (0.1.5)
141141
yell (2.1.0)

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Additional Use Grant: You may make use of the Licensed Work, provided that you d
1616
error-reporting or application monitoring features of the
1717
Licensed Work.
1818

19-
Change Date: 2023-04-01
19+
Change Date: 2023-07-01
2020

2121
Change License: Apache License, Version 2.0
2222

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
develop:
2+
[ ! -f gatsby/.env.develpoment ] && cp gatsby/.env.example gatsby/.env.development
3+
yarn develop
4+
5+
test:
6+
yarn test

README.md

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,82 @@
11
# Sentry Documentation
22

3-
The Sentry documentation is a static site, generated by [Jekyll][jekyll].
3+
The Sentry documentation is a static site, generated by [Jekyll][jekyll] and [Gatsby][gatsby].
44

55
## Getting started
66

7-
You will need [Ruby][ruby], [Bundler][bundler], [Node.js][nodejs], and [Yarn] installed. If you don't have opinions about the process, this will get you going:
7+
You will need [Ruby][ruby], [Bundler][bundler], and [Volta][volta.sh] installed. If you don't have opinions about the process, this will get you going:
88

99
```bash
1010
# Install Homebrew and everything mentioned above
1111
$ bin/bootstrap
1212
```
1313

14-
To run the local webserver:
14+
Once you have the required system dependencies:
1515

16+
```bash
17+
# Install or update application dependencies
18+
$ make
1619
```
17-
$ bin/server
20+
21+
Now run the development webserver:
22+
23+
```bash
24+
$ yarn start
1825
```
1926

20-
This will run Bundler to install all the necessary dependencies and then run a webserver at http://localhost:9001/.
27+
You will now be able to access docs via http://localhost:3000.
28+
29+
Note: This is running both the Jekyll (port 9001) and Gatsby (port 8000) servers, with a proxy routing requests between the two.
30+
31+
## The Great Gatsby Migration
32+
33+
The repository currently contains a Jekyll site (`./`) as well as a Gatsby site (`./gatsby`). This is to aid with a progressive migratiopn over to Gatsby. There's a bit of magic that you need to understand in how this is deployed:
34+
35+
- In production, the `nginx.conf` file determines which routes are served by Jekyll vs Gatsby. Gatsby is the default behavior, whereas Jekyll routes are listed explicitly.
2136

22-
[jekyll]: https://jekyllrb.com/
23-
[ruby]: https://www.ruby-lang.org/
24-
[bundler]: http://bundler.io/
25-
[nodejs]: https://nodejs.org/
26-
[yarn]: https://yarnpkg.com
37+
- In development, the proxy server (`server.js`) manages routing between Jekyll (http://localhost:9001) and Gatsby (http://localhost:8000). Route configuration is the same as whats in nginx.
2738

28-
## Development mode
39+
- We've disabled the default optimized static links within Gatsby due to the complexity of navigating between two codebases. Once the Jekyll conversion is done, we'll want to make the change in `<SmartLink>`.
40+
41+
- We're automatically importing _all_ Jekyll pages inside of Gatsby. They won't all work. When formally converting a page over to Gatsby you should move it into a parallel location inside of the Gatsby file tree (`./src/docs/...`). You also like want to convert it to `.mdx` instead of `.md`. (DC: you will need to update `gatsby-node.js` to handle indexing `.mdx` once the first is added!)
42+
43+
- This is likely brittle. We want to move away from Jekyll as quickly as possible, so ideally all new content is done in Gatsby.
44+
45+
- You can determine which engine is used by viewing source and looking for `"Rendered with"` in the HTML.
46+
47+
## MDX Components + Markdown
48+
49+
:pray: that MDX v2 fixes this.
50+
51+
MDX has its flaws. When rendering components, any text inside of them is treated as raw text (_not_ markdown). To work around this you can use the `<markdown>` tag, but it also has its issues. Generally speaking, put an empty after the opening tag, and before the closing tag.
52+
53+
```jsx
54+
// dont do this as parsing will hit weird breakages
55+
<markdown>
56+
foo bar
57+
</markdown>
58+
```
59+
60+
```jsx
61+
// do this@
62+
<markdown>
63+
64+
foo bar
65+
66+
</markdown>
67+
```
68+
69+
## Development mode (Gatsby-specific)
70+
71+
The following instructions assume you're in `./gatsby`.
72+
73+
Nothing to really see here yet. We'll update this when the Jekyll wrappers are gone.
74+
75+
```bash
76+
$ yarn start
77+
```
78+
79+
## Development mode (Jekyll-specific)
2980

3081
There are a number of enhancements in place that are only available when developing locally.
3182

@@ -35,7 +86,7 @@ There are a number of enhancements in place that are only available when develop
3586

3687
### Environment Variables
3788

38-
The following variables can be set when using `bin/server`. Defaults prefer performance.
89+
The following variables can be set when using `bin/server` (aka `yarn start-jekyll`). Defaults prefer performance.
3990

4091
- `FAST_BUILD=true` The master switch. When true, all performance adjustments are enabled. Disable to debug strange behavior.
4192
- `JEKYLL_INCREMENTAL=true` When true, Jekyll only rebuilds pages that have changed. In some cases this can create [unpredictable behavior](https://jekyllrb.com/docs/configuration/#incremental-regeneration).
@@ -79,3 +130,7 @@ Categories are manually defined.
79130
### Add a document
80131

81132
Category hierarchy is automatically defined by folder structure. Add a markdown file to a folder within _src/collections/_documentation_. Order is alphabetical by default, or you may force sorting order by adding an `sidebar_order` integer value in the frontmatter of the document.
133+
134+
## Updating Test Snapshots
135+
136+
When adding new pages, use `bin/test -u` to update test snapshots.

0 commit comments

Comments
 (0)