graphiti 2.0.0.beta.3 → 2.0.0.beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +30 -86
- data/.github/workflows/docs.yml +57 -0
- data/.github/workflows/release.yml +8 -8
- data/.gitignore +7 -0
- data/.npmrc +9 -0
- data/.standard.yml +4 -1
- data/Appraisals +33 -32
- data/CHANGELOG.md +48 -0
- data/README.md +13 -2
- data/UPGRADING.md +2 -58
- data/docs/concepts/backends-and-models.md +122 -0
- data/docs/concepts/endpoints.md +183 -0
- data/docs/concepts/links.md +212 -0
- data/docs/concepts/overview.md +80 -0
- data/docs/concepts/persisting.md +376 -0
- data/docs/concepts/relationships.md +527 -0
- data/docs/concepts/resources.md +677 -0
- data/docs/getting-started/first-api.md +289 -0
- data/docs/getting-started/installation.md +185 -0
- data/docs/intro.md +307 -0
- data/docs/js/authentication.md +63 -0
- data/docs/js/ddau.md +20 -0
- data/docs/js/extra-params.md +41 -0
- data/docs/js/index.md +112 -0
- data/docs/js/installation.md +120 -0
- data/docs/js/middleware.md +72 -0
- data/docs/js/models.md +202 -0
- data/docs/js/reads.md +494 -0
- data/docs/js/state-syncing.md +100 -0
- data/docs/js/writes.md +373 -0
- data/docs/reference/vandal.md +63 -0
- data/docs/reference/why.md +13 -0
- data/docs/topics/authorization.md +155 -0
- data/docs/topics/caching.md +55 -0
- data/docs/topics/customizing-sideloads.md +156 -0
- data/docs/topics/debugging.md +216 -0
- data/docs/topics/error-handling.md +210 -0
- data/docs/topics/etags.md +46 -0
- data/docs/topics/hopping-relationships.md +149 -0
- data/docs/topics/json-attributes.md +77 -0
- data/docs/topics/openstruct-models.md +50 -0
- data/docs/topics/remote-resources.md +291 -0
- data/docs/topics/testing.md +894 -0
- data/docs/topics/without-activerecord.md +324 -0
- data/docs/tutorial/index.md +58 -0
- data/docs/tutorial/step_0.md +107 -0
- data/docs/tutorial/step_1.md +199 -0
- data/docs/tutorial/step_2.md +312 -0
- data/docs/tutorial/step_3.md +142 -0
- data/docs/tutorial/step_4.md +135 -0
- data/docs/tutorial/step_5.md +69 -0
- data/docs/tutorial/step_6.md +82 -0
- data/docs/tutorial/step_7.md +205 -0
- data/docs/tutorial/step_8.md +128 -0
- data/docs/tutorial/step_9.md +171 -0
- data/docs/upgrading.md +260 -0
- data/gemfiles/rails_7_1.gemfile +4 -3
- data/gemfiles/{rails_7_2_graphiti_rails.gemfile → rails_7_2.gemfile} +3 -3
- data/gemfiles/{rails_8_1_graphiti_rails.gemfile → rails_8_0.gemfile} +3 -3
- data/gemfiles/{rails_8_0_graphiti_rails.gemfile → rails_8_1.gemfile} +3 -3
- data/graphiti.gemspec +7 -23
- data/{deprecated_generators → lib/generators}/graphiti/api_test_generator.rb +7 -1
- data/{deprecated_generators → lib/generators}/graphiti/generator_mixin.rb +14 -1
- data/{deprecated_generators → lib/generators}/graphiti/install_generator.rb +19 -13
- data/{deprecated_generators → lib/generators}/graphiti/resource_generator.rb +68 -7
- data/{deprecated_generators → lib/generators}/graphiti/templates/controller.rb.erb +1 -1
- data/{deprecated_generators → lib/generators}/graphiti/templates/index_request_spec.rb.erb +1 -1
- data/{deprecated_generators → lib/generators}/graphiti/templates/resource_reads_spec.rb.erb +6 -6
- data/{deprecated_generators → lib/generators}/graphiti/templates/show_request_spec.rb.erb +1 -1
- data/lib/graphiti/configuration.rb +2 -2
- data/lib/graphiti/error_serializers/conflict_request.rb +19 -0
- data/lib/graphiti/error_serializers/deprecated_constants.rb +48 -0
- data/lib/graphiti/error_serializers/invalid_request.rb +56 -0
- data/lib/graphiti/error_serializers/validation.rb +143 -0
- data/lib/graphiti/errors.rb +4 -4
- data/lib/graphiti/query.rb +1 -1
- data/lib/graphiti/rails/context.rb +33 -0
- data/lib/graphiti/rails/controller.rb +41 -0
- data/lib/graphiti/rails/debugging.rb +18 -0
- data/lib/graphiti/rails/exception_handlers.rb +77 -0
- data/lib/graphiti/rails/railtie.rb +139 -0
- data/lib/graphiti/rails/rake_helpers.rb +42 -0
- data/lib/graphiti/rails/responders.rb +21 -0
- data/lib/graphiti/rails/test_helpers.rb +22 -0
- data/lib/graphiti/rails.rb +47 -29
- data/lib/graphiti/resource/configuration.rb +1 -0
- data/lib/graphiti/resource/interface.rb +2 -2
- data/lib/graphiti/resource/remote.rb +2 -2
- data/lib/graphiti/resource/sideloading.rb +1 -1
- data/lib/graphiti/resource.rb +13 -1
- data/lib/graphiti/responders.rb +7 -20
- data/lib/graphiti/schema.rb +5 -1
- data/lib/graphiti/schema_diff.rb +4 -0
- data/lib/graphiti/scope.rb +45 -37
- data/lib/graphiti/serializer.rb +6 -0
- data/lib/graphiti/sideload/belongs_to.rb +38 -5
- data/lib/graphiti/sideload/polymorphic_belongs_to.rb +27 -23
- data/lib/graphiti/sideload.rb +54 -35
- data/lib/graphiti/spec_helpers/errors.rb +73 -0
- data/lib/graphiti/spec_helpers/errors_proxy.rb +75 -0
- data/lib/graphiti/spec_helpers/helpers.rb +107 -0
- data/lib/graphiti/spec_helpers/matchers.rb +196 -0
- data/lib/graphiti/spec_helpers/node.rb +88 -0
- data/lib/graphiti/spec_helpers/rspec.rb +148 -0
- data/lib/graphiti/spec_helpers.rb +54 -0
- data/lib/graphiti/util/include_params.rb +2 -2
- data/lib/graphiti/util/serializer_relationships.rb +41 -5
- data/lib/graphiti/version.rb +1 -1
- data/lib/graphiti-rails.rb +11 -0
- data/lib/graphiti.rb +34 -10
- data/lib/graphiti_errors.rb +11 -0
- data/lib/graphiti_spec_helpers/rspec.rb +3 -0
- data/lib/graphiti_spec_helpers.rb +11 -0
- data/lib/tasks/graphiti.rake +29 -0
- data/package-lock.json +6199 -0
- data/package.json +5 -4
- data/website/.gitignore +20 -0
- data/website/README.md +43 -0
- data/website/docusaurus.config.js +197 -0
- data/website/package-lock.json +19474 -0
- data/website/package.json +46 -0
- data/website/sidebars.js +82 -0
- data/website/src/css/custom.css +85 -0
- data/website/src/pages/markdown-page.mdx +7 -0
- data/website/static/.nojekyll +0 -0
- data/website/static/1.13/2019/03/31/graphiti-1-0.html +205 -0
- data/website/static/1.13/2019/05/08/graphiti-1-1.html +212 -0
- data/website/static/1.13/2019/05/20/graphiti-1-2.html +214 -0
- data/website/static/1.13/2019/10/14/tutorial.html +198 -0
- data/website/static/1.13/CNAME +1 -0
- data/website/static/1.13/README.md +16 -0
- data/website/static/1.13/assets/css/syntax.css +60 -0
- data/website/static/1.13/assets/favicons/android-chrome-192x192.png +0 -0
- data/website/static/1.13/assets/favicons/android-chrome-256x256.png +0 -0
- data/website/static/1.13/assets/favicons/apple-touch-icon.png +0 -0
- data/website/static/1.13/assets/favicons/browserconfig.xml +9 -0
- data/website/static/1.13/assets/favicons/favicon-16x16.png +0 -0
- data/website/static/1.13/assets/favicons/favicon-32x32.png +0 -0
- data/website/static/1.13/assets/favicons/favicon.ico +0 -0
- data/website/static/1.13/assets/favicons/mstile-150x150.png +0 -0
- data/website/static/1.13/assets/favicons/safari-pinned-tab.svg +1 -0
- data/website/static/1.13/assets/favicons/site.webmanifest +19 -0
- data/website/static/1.13/assets/img/backend.gif +0 -0
- data/website/static/1.13/assets/img/conformity.png +0 -0
- data/website/static/1.13/assets/img/error_payload.png +0 -0
- data/website/static/1.13/assets/img/fancy-cushion.png +0 -0
- data/website/static/1.13/assets/img/gh.png +0 -0
- data/website/static/1.13/assets/img/home-bg.jpg +0 -0
- data/website/static/1.13/assets/img/lifecycle.gif +0 -0
- data/website/static/1.13/assets/img/logo-500.png +0 -0
- data/website/static/1.13/assets/img/logo.png +0 -0
- data/website/static/1.13/assets/img/love-graffiti.jpg +0 -0
- data/website/static/1.13/assets/img/meta_total_count.png +0 -0
- data/website/static/1.13/assets/img/persist.jpg +0 -0
- data/website/static/1.13/assets/img/resource.gif +0 -0
- data/website/static/1.13/assets/img/rest-graffiti.jpg +0 -0
- data/website/static/1.13/assets/img/rest1.gif +0 -0
- data/website/static/1.13/assets/img/rest2.gif +0 -0
- data/website/static/1.13/assets/img/rest3.gif +0 -0
- data/website/static/1.13/assets/img/rethink-rest-graffiti.jpg +0 -0
- data/website/static/1.13/assets/img/sunrise.png +0 -0
- data/website/static/1.13/assets/img/why.png +0 -0
- data/website/static/1.13/assets/js/highlight.pack.js +2 -0
- data/website/static/1.13/assets/main.css +15518 -0
- data/website/static/1.13/assets/main.css.map +1 -0
- data/website/static/1.13/bin/bundle +109 -0
- data/website/static/1.13/bin/jekyll +27 -0
- data/website/static/1.13/bin/kramdown +27 -0
- data/website/static/1.13/bin/listen +27 -0
- data/website/static/1.13/bin/rake +27 -0
- data/website/static/1.13/bin/rougify +27 -0
- data/website/static/1.13/bin/safe_yaml +27 -0
- data/website/static/1.13/bin/sass +27 -0
- data/website/static/1.13/bin/sass-convert +27 -0
- data/website/static/1.13/bin/scss +27 -0
- data/website/static/1.13/blog.html +259 -0
- data/website/static/1.13/cheatsheet.html +316 -0
- data/website/static/1.13/cookbooks/authorization.md +0 -0
- data/website/static/1.13/cookbooks/caching.md +0 -0
- data/website/static/1.13/cookbooks/customizing-sideloads.html +325 -0
- data/website/static/1.13/cookbooks/etags.md +0 -0
- data/website/static/1.13/cookbooks/hopping-relationships.html +324 -0
- data/website/static/1.13/cookbooks/json_attributes.md +0 -0
- data/website/static/1.13/cookbooks/openstruct-models.md +0 -0
- data/website/static/1.13/cookbooks/remote-resources.md +0 -0
- data/website/static/1.13/cookbooks/without-activerecord.html +510 -0
- data/website/static/1.13/features.html +249 -0
- data/website/static/1.13/feed.xml +106 -0
- data/website/static/1.13/guides/concepts/backends-and-models.html +467 -0
- data/website/static/1.13/guides/concepts/debugging.html +440 -0
- data/website/static/1.13/guides/concepts/endpoints.html +432 -0
- data/website/static/1.13/guides/concepts/error-handling.html +396 -0
- data/website/static/1.13/guides/concepts/links.html +501 -0
- data/website/static/1.13/guides/concepts/remote-resources.html +536 -0
- data/website/static/1.13/guides/concepts/resources.html +2176 -0
- data/website/static/1.13/guides/concepts/testing.html +1469 -0
- data/website/static/1.13/guides/getting-started/installation.html +420 -0
- data/website/static/1.13/guides/graphiti-rails-migration.html +242 -0
- data/website/static/1.13/guides/index.html +269 -0
- data/website/static/1.13/guides/overview.html +325 -0
- data/website/static/1.13/guides/upgrading-2-0.html +193 -0
- data/website/static/1.13/guides/upgrading.html +314 -0
- data/website/static/1.13/guides/vandal.html +282 -0
- data/website/static/1.13/guides/why.html +1121 -0
- data/website/static/1.13/index.html +72 -0
- data/website/static/1.13/js/authentication.html +295 -0
- data/website/static/1.13/js/ddau.html +238 -0
- data/website/static/1.13/js/extra-params.html +270 -0
- data/website/static/1.13/js/index.html +321 -0
- data/website/static/1.13/js/installation.html +637 -0
- data/website/static/1.13/js/introduction.html +257 -0
- data/website/static/1.13/js/middleware.html +318 -0
- data/website/static/1.13/js/reads/fieldsets.html +271 -0
- data/website/static/1.13/js/reads/filtering.html +289 -0
- data/website/static/1.13/js/reads/includes.html +260 -0
- data/website/static/1.13/js/reads/index.html +497 -0
- data/website/static/1.13/js/reads/nested-queries.html +353 -0
- data/website/static/1.13/js/reads/pagination.html +260 -0
- data/website/static/1.13/js/reads/sorting.html +265 -0
- data/website/static/1.13/js/reads/statistics.html +289 -0
- data/website/static/1.13/js/state-syncing.html +340 -0
- data/website/static/1.13/js/writes/deferred.html +296 -0
- data/website/static/1.13/js/writes/dirty-tracking.html +399 -0
- data/website/static/1.13/js/writes/index.html +391 -0
- data/website/static/1.13/js/writes/nested.html +330 -0
- data/website/static/1.13/js/writes/validations.html +272 -0
- data/website/static/1.13/quickstart.html +660 -0
- data/website/static/1.13/template +161 -0
- data/website/static/1.13/tutorial/index.html +250 -0
- data/website/static/1.13/tutorial/step_0.html +292 -0
- data/website/static/1.13/tutorial/step_1.html +517 -0
- data/website/static/1.13/tutorial/step_2.html +481 -0
- data/website/static/1.13/tutorial/step_3.html +323 -0
- data/website/static/1.13/tutorial/step_4.html +318 -0
- data/website/static/1.13/tutorial/step_5.html +265 -0
- data/website/static/1.13/tutorial/step_6.html +276 -0
- data/website/static/1.13/tutorial/step_7.html +390 -0
- data/website/static/1.13/tutorial/step_8.html +316 -0
- data/website/static/1.13/tutorial/step_9.html +365 -0
- data/website/static/CNAME +1 -0
- data/website/static/assets/img/error_payload.png +0 -0
- data/website/static/assets/img/legacy/legacy-0378a3bb39.png +0 -0
- data/website/static/assets/img/legacy/legacy-05bbd3e5fd.png +0 -0
- data/website/static/assets/img/legacy/legacy-07aa104495.png +0 -0
- data/website/static/assets/img/legacy/legacy-0c75a16b3a.gif +0 -0
- data/website/static/assets/img/legacy/legacy-3076df6209.png +0 -0
- data/website/static/assets/img/legacy/legacy-7f6889bc89.png +0 -0
- data/website/static/assets/img/legacy/legacy-a2cc4363c3.png +0 -0
- data/website/static/assets/img/legacy/legacy-f67cfa89ab.png +0 -0
- data/website/static/assets/img/meta_total_count.png +0 -0
- data/website/static/img/docusaurus-social-card.jpg +0 -0
- data/website/static/img/docusaurus.png +0 -0
- data/website/static/img/favicon.ico +0 -0
- data/website/static/img/logo.png +0 -0
- data/website/static/img/logo.svg +1 -0
- data/website/static/img/undraw_docusaurus_mountain.svg +171 -0
- data/website/static/img/undraw_docusaurus_react.svg +170 -0
- data/website/static/img/undraw_docusaurus_tree.svg +40 -0
- metadata +251 -54
- data/gemfiles/rails_6.gemfile +0 -18
- data/gemfiles/rails_6_graphiti_rails.gemfile +0 -19
- data/gemfiles/rails_7.gemfile +0 -18
- data/gemfiles/rails_7_1_graphiti_rails.gemfile +0 -19
- data/gemfiles/rails_7_graphiti_rails.gemfile +0 -19
- data/lib/graphiti/deprecated_tasks.rb +0 -49
- data/lib/graphiti/railtie.rb +0 -121
- /data/{deprecated_generators → lib/generators}/graphiti/resource_test_generator.rb +0 -0
- /data/{deprecated_generators → lib/generators}/graphiti/templates/application_resource.rb.erb +0 -0
- /data/{deprecated_generators → lib/generators}/graphiti/templates/create_request_spec.rb.erb +0 -0
- /data/{deprecated_generators → lib/generators}/graphiti/templates/destroy_request_spec.rb.erb +0 -0
- /data/{deprecated_generators → lib/generators}/graphiti/templates/resource.rb.erb +0 -0
- /data/{deprecated_generators → lib/generators}/graphiti/templates/resource_writes_spec.rb.erb +0 -0
- /data/{deprecated_generators → lib/generators}/graphiti/templates/update_request_spec.rb.erb +0 -0
data/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "graphiti",
|
|
3
|
-
"
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0-development",
|
|
4
5
|
"repository": {
|
|
5
6
|
"type": "git",
|
|
6
7
|
"url": "git+https://github.com/graphiti-api/graphiti.git"
|
|
@@ -15,9 +16,9 @@
|
|
|
15
16
|
},
|
|
16
17
|
"devDependencies": {
|
|
17
18
|
"semantic-release-rubygem": "^1.2.0",
|
|
18
|
-
"semantic-release": "^
|
|
19
|
-
"@semantic-release/changelog": "^
|
|
20
|
-
"@semantic-release/git": "^
|
|
19
|
+
"semantic-release": "^25.0.8",
|
|
20
|
+
"@semantic-release/changelog": "^7.0.0",
|
|
21
|
+
"@semantic-release/git": "^11.0.1"
|
|
21
22
|
},
|
|
22
23
|
"release": {
|
|
23
24
|
"branches": [
|
data/website/.gitignore
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
/node_modules
|
|
3
|
+
|
|
4
|
+
# Production
|
|
5
|
+
/build
|
|
6
|
+
|
|
7
|
+
# Generated files
|
|
8
|
+
.docusaurus
|
|
9
|
+
.cache-loader
|
|
10
|
+
|
|
11
|
+
# Misc
|
|
12
|
+
.DS_Store
|
|
13
|
+
.env.local
|
|
14
|
+
.env.development.local
|
|
15
|
+
.env.test.local
|
|
16
|
+
.env.production.local
|
|
17
|
+
|
|
18
|
+
npm-debug.log*
|
|
19
|
+
yarn-debug.log*
|
|
20
|
+
yarn-error.log*
|
data/website/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Website
|
|
2
|
+
|
|
3
|
+
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
**Note**: feel free to use the package manager of your choice.
|
|
12
|
+
|
|
13
|
+
## Local Development
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm run start
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
|
|
20
|
+
|
|
21
|
+
## Build
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run build
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
|
|
28
|
+
|
|
29
|
+
## Deployment
|
|
30
|
+
|
|
31
|
+
Using SSH:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
USE_SSH=true npm run deploy
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Not using SSH:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
GIT_USER=<Your GitHub username> npm run deploy
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
If you are using GitHub Pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
const {themes} = require('prism-react-renderer');
|
|
3
|
+
|
|
4
|
+
const codeBlockTheme = (theme, backgroundColor) => ({
|
|
5
|
+
...theme,
|
|
6
|
+
plain: {...theme.plain, backgroundColor},
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
// Docusaurus prepends baseUrl to navbar and Link hrefs, but not to raw HTML
|
|
10
|
+
// like announcementBar content, so that markup has to build its own absolute
|
|
11
|
+
// paths. Always has a trailing slash.
|
|
12
|
+
const baseUrl = process.env.DOCS_BASE_URL || '/';
|
|
13
|
+
|
|
14
|
+
// The theme's strikethrough and underline on diff lines are inline styles, so
|
|
15
|
+
// CSS cannot undo them. Colour and the +/- signs already carry it.
|
|
16
|
+
const withoutDiffDecoration = (theme) => ({
|
|
17
|
+
...theme,
|
|
18
|
+
styles: theme.styles.map(({types, style}) =>
|
|
19
|
+
types.some((type) => type === 'inserted' || type === 'deleted')
|
|
20
|
+
? {types, style: {...style, textDecorationLine: undefined}}
|
|
21
|
+
: {types, style}
|
|
22
|
+
),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
/** @type {import('@docusaurus/types').Config} */
|
|
26
|
+
const config = {
|
|
27
|
+
title: 'Graphiti',
|
|
28
|
+
tagline: 'Stylish Graph APIs',
|
|
29
|
+
favicon: 'img/favicon.ico',
|
|
30
|
+
|
|
31
|
+
// Apex, matching the CNAME. This feeds canonical tags and sitemap.xml, so it
|
|
32
|
+
// has to agree with the host actually serving the site or the two split
|
|
33
|
+
// search ranking between them.
|
|
34
|
+
url: 'https://graphiti.dev',
|
|
35
|
+
// graphiti.dev resolves to this repo, so the site serves from the root.
|
|
36
|
+
// DOCS_BASE_URL still overrides it for a build served from the project-pages
|
|
37
|
+
// path, which is what /graphiti/ was during the beta.
|
|
38
|
+
baseUrl,
|
|
39
|
+
organizationName: 'graphiti-api',
|
|
40
|
+
projectName: 'graphiti',
|
|
41
|
+
|
|
42
|
+
onBrokenLinks: 'warn',
|
|
43
|
+
markdown: {hooks: {onBrokenMarkdownLinks: 'warn'}},
|
|
44
|
+
|
|
45
|
+
presets: [
|
|
46
|
+
[
|
|
47
|
+
'classic',
|
|
48
|
+
/** @type {import('@docusaurus/preset-classic').Options} */
|
|
49
|
+
({
|
|
50
|
+
docs: {
|
|
51
|
+
// markdown lives at the repo root, next to the code it documents
|
|
52
|
+
path: '../docs',
|
|
53
|
+
routeBasePath: '/',
|
|
54
|
+
sidebarPath: require.resolve('./sidebars.js'),
|
|
55
|
+
editUrl: 'https://github.com/graphiti-api/graphiti/tree/main/website/',
|
|
56
|
+
// Unversioned docs serve at the root, and would otherwise be
|
|
57
|
+
// labelled "Next" in the dropdown. Once `npm run docusaurus
|
|
58
|
+
// docs:version 2.0` cuts a version, that becomes the root and the
|
|
59
|
+
// working copy moves to /next.
|
|
60
|
+
versions: {current: {label: '2.0 beta'}},
|
|
61
|
+
},
|
|
62
|
+
blog: false,
|
|
63
|
+
theme: {customCss: require.resolve('./src/css/custom.css')},
|
|
64
|
+
}),
|
|
65
|
+
],
|
|
66
|
+
],
|
|
67
|
+
|
|
68
|
+
plugins: [
|
|
69
|
+
[
|
|
70
|
+
'@docusaurus/plugin-client-redirects',
|
|
71
|
+
{
|
|
72
|
+
// The 1.x Jekyll site served /guides/* and /cookbooks/*, and early 2.0
|
|
73
|
+
// drafts served /quickstart and /cheatsheet. Keep those URLs alive.
|
|
74
|
+
// Nothing under /1.13/ is touched: that is the frozen 1.x site.
|
|
75
|
+
redirects: [
|
|
76
|
+
{from: ['/quickstart'], to: '/getting-started/first-api'},
|
|
77
|
+
{from: ['/cheatsheet', '/guides', '/guides/index'], to: '/'},
|
|
78
|
+
{from: ['/guides/overview'], to: '/concepts/overview'},
|
|
79
|
+
{from: ['/guides/why'], to: '/reference/why'},
|
|
80
|
+
{from: ['/guides/vandal'], to: '/reference/vandal'},
|
|
81
|
+
{from: ['/guides/upgrading', '/guides/upgrading-2-0', '/reference/upgrading-2-0', '/upgrading/controllers', '/upgrading/testing', '/upgrading/persistence-hooks', '/upgrading/exception-handling', '/upgrading/belongs-to-linkage', '/upgrading/without-rails'], to: '/upgrading'},
|
|
82
|
+
{from: ['/guides/getting-started/installation'], to: '/getting-started/installation'},
|
|
83
|
+
|
|
84
|
+
{from: ['/guides/concepts/resources'], to: '/concepts/resources'},
|
|
85
|
+
{from: ['/guides/concepts/endpoints'], to: '/concepts/endpoints'},
|
|
86
|
+
{from: ['/guides/concepts/links'], to: '/concepts/links'},
|
|
87
|
+
{from: ['/guides/concepts/backends-and-models'], to: '/concepts/backends-and-models'},
|
|
88
|
+
{from: ['/guides/concepts/testing'], to: '/topics/testing'},
|
|
89
|
+
{from: ['/guides/concepts/debugging'], to: '/topics/debugging'},
|
|
90
|
+
{from: ['/guides/concepts/error-handling'], to: '/topics/error-handling'},
|
|
91
|
+
{from: ['/guides/concepts/remote-resources', '/cookbooks/remote-resources'], to: '/topics/remote-resources'},
|
|
92
|
+
|
|
93
|
+
// Cookbook stubs that never had content now point at the real pages
|
|
94
|
+
{from: ['/cookbooks/authorization'], to: '/topics/authorization'},
|
|
95
|
+
{from: ['/cookbooks/caching'], to: '/topics/caching'},
|
|
96
|
+
{from: ['/cookbooks/etags'], to: '/topics/etags'},
|
|
97
|
+
{from: ['/cookbooks/json_attributes'], to: '/topics/json-attributes'},
|
|
98
|
+
{from: ['/cookbooks/openstruct-models'], to: '/topics/openstruct-models'},
|
|
99
|
+
{from: ['/cookbooks/without-activerecord'], to: '/topics/without-activerecord'},
|
|
100
|
+
{from: ['/cookbooks/customizing-sideloads'], to: '/topics/customizing-sideloads'},
|
|
101
|
+
{from: ['/cookbooks/hopping-relationships'], to: '/topics/hopping-relationships'},
|
|
102
|
+
|
|
103
|
+
{from: ['/js/introduction'], to: '/js/'},
|
|
104
|
+
{
|
|
105
|
+
from: [
|
|
106
|
+
'/js/reads/index',
|
|
107
|
+
'/js/reads/filtering',
|
|
108
|
+
'/js/reads/sorting',
|
|
109
|
+
'/js/reads/pagination',
|
|
110
|
+
'/js/reads/fieldsets',
|
|
111
|
+
'/js/reads/includes',
|
|
112
|
+
'/js/reads/nested-queries',
|
|
113
|
+
'/js/reads/statistics',
|
|
114
|
+
],
|
|
115
|
+
to: '/js/reads',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
from: [
|
|
119
|
+
'/js/writes/index',
|
|
120
|
+
'/js/writes/validations',
|
|
121
|
+
'/js/writes/dirty-tracking',
|
|
122
|
+
'/js/writes/nested',
|
|
123
|
+
'/js/writes/deferred',
|
|
124
|
+
],
|
|
125
|
+
to: '/js/writes',
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
|
|
129
|
+
// The 2.0 docs were staged under /graphiti/ for the whole beta, so
|
|
130
|
+
// those URLs are in the wild. createRedirects sees every generated
|
|
131
|
+
// route, which the static /1.13/ tree is not: that one is by hand.
|
|
132
|
+
createRedirects(existingPath) {
|
|
133
|
+
return [`/graphiti${existingPath}`];
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
],
|
|
138
|
+
|
|
139
|
+
themeConfig: {
|
|
140
|
+
announcementBar: {
|
|
141
|
+
// Changing the id un-dismisses the bar for everyone who has closed it.
|
|
142
|
+
id: 'graphiti-2-0-beta',
|
|
143
|
+
content: `Graphiti 2.0 is in beta, and the docs have been reorganized to describe it. <a href="${baseUrl}1.13/">Docs for 1.x</a>.`,
|
|
144
|
+
isCloseable: true,
|
|
145
|
+
},
|
|
146
|
+
colorMode: {
|
|
147
|
+
// Dark for a first-time visitor. Flip respectPrefersColorScheme to true
|
|
148
|
+
// to follow the OS setting instead, in which case defaultMode only
|
|
149
|
+
// applies when the visitor has no preference either way. Once someone
|
|
150
|
+
// uses the navbar toggle their choice is remembered and wins over both.
|
|
151
|
+
defaultMode: 'dark',
|
|
152
|
+
respectPrefersColorScheme: false,
|
|
153
|
+
},
|
|
154
|
+
navbar: {
|
|
155
|
+
title: 'Graphiti',
|
|
156
|
+
logo: {alt: 'Graphiti', src: 'img/logo.png'},
|
|
157
|
+
items: [
|
|
158
|
+
{
|
|
159
|
+
type: 'docsVersionDropdown',
|
|
160
|
+
position: 'right',
|
|
161
|
+
// 1.x stays as the original Jekyll site, frozen under /1.13.
|
|
162
|
+
//
|
|
163
|
+
// The pathname:// prefix is required. It is Docusaurus' escape hatch
|
|
164
|
+
// for a path that is served statically but is not an app route:
|
|
165
|
+
// without it the link renders as a react-router push, which finds no
|
|
166
|
+
// match and shows the 404 page even though the file is served fine.
|
|
167
|
+
// The prefix is stripped before baseUrl is applied, and it also makes
|
|
168
|
+
// the link count as external, hence target '_self' to keep it from
|
|
169
|
+
// opening in a new tab.
|
|
170
|
+
dropdownItemsAfter: [
|
|
171
|
+
{href: 'pathname:///1.13/', label: '1.x', target: '_self'},
|
|
172
|
+
],
|
|
173
|
+
},
|
|
174
|
+
{href: 'https://github.com/graphiti-api/graphiti', label: 'GitHub', position: 'right'},
|
|
175
|
+
{href: 'https://discord.gg/wgqkMBsSRV', label: 'Discord', position: 'right'},
|
|
176
|
+
],
|
|
177
|
+
},
|
|
178
|
+
footer: {
|
|
179
|
+
style: 'dark',
|
|
180
|
+
copyright: [
|
|
181
|
+
'Originally created by <a href="https://github.com/richmolj">Lee Richmond</a>,',
|
|
182
|
+
'<a href="https://github.com/wadetandy">Wade Tandy</a>, and',
|
|
183
|
+
'<a href="https://github.com/wagenet">Peter Wagenet</a>.',
|
|
184
|
+
'Maintained by <a href="https://github.com/jkeen">Jeff Keen</a>',
|
|
185
|
+
'with <a href="https://github.com/graphiti-api/graphiti/graphs/contributors">many contributors</a>.',
|
|
186
|
+
'<br />Graphiti is released under the MIT license.',
|
|
187
|
+
].join(' '),
|
|
188
|
+
},
|
|
189
|
+
prism: {
|
|
190
|
+
theme: withoutDiffDecoration(themes.oneLight),
|
|
191
|
+
darkTheme: withoutDiffDecoration(codeBlockTheme(themes.oneDark, '#21252b')),
|
|
192
|
+
additionalLanguages: ['ruby', 'bash', 'json', 'http', 'diff'],
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
module.exports = config;
|