Skip to content

Commit d8b4495

Browse files
authored
Merge pull request #159 from iterative/update-for-iterative-ai
2 parents 466957d + 4c51a74 commit d8b4495

File tree

15 files changed

+84
-57
lines changed

15 files changed

+84
-57
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check Deployment
2+
on:
3+
workflow_call:
4+
inputs:
5+
passci:
6+
description: 'Pass CI'
7+
required: true
8+
type: boolean
9+
workflow_dispatch:
10+
inputs:
11+
passci:
12+
description: 'Pass CI'
13+
required: true
14+
type: boolean
15+
pull_request:
16+
types: [opened, synchronize, reopened, labeled]
17+
18+
jobs:
19+
check-branches:
20+
if:
21+
startsWith(github.head_ref, 'renovate/') || contains(github.head_ref,
22+
'no-deploy')
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Fail if no passci inputs or pass-ci label
26+
if:
27+
${{ !inputs.passci &&
28+
!contains(github.event.pull_request.labels.*.name, 'pass-ci') }}
29+
run: exit 1

packages/example/gatsby-config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ module.exports = {
1616
resolve: themePackageName,
1717
options: {
1818
simpleLinkerTerms: require('./content/linked-terms'),
19-
plausibleSrc: null
19+
plausibleSrc: null,
20+
sentry: false
2021
}
2122
},
2223
{
@@ -25,7 +26,6 @@ module.exports = {
2526
name: 'images',
2627
path: path.join(__dirname, 'static', 'img')
2728
}
28-
},
29-
'@sentry/gatsby'
29+
}
3030
]
3131
}

packages/example/sentry.config.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

packages/gatsby-theme-iterative/README.md

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -117,40 +117,17 @@ others in the future.
117117
This is the prefix that the docs pages will render to, including the index
118118
page at the exact path.
119119

120+
- sentry: boolean
121+
122+
Default: true
123+
124+
If true, this theme will instantiate `@sentry/gatsby` with a default
125+
configuration. This configuration can be imported from `sentry-config.js` and
126+
overridden by creating a
127+
[Sentry configuration file](https://docs.sentry.io/platforms/javascript/guides/gatsby/#sentry-configuration-file)
128+
in your project's root.
129+
120130
### Examples
121131

122-
See this example from
123-
[the example website's `gatsby-config.js`](https://github.com/iterative/gatsby-theme-iterative/blob/main/packages/example/gatsby-config.js).
124-
125-
```js
126-
const path = require('path')
127-
const {
128-
name: themePackageName
129-
} = require('../gatsby-theme-iterative/package.json')
130-
131-
module.exports = {
132-
trailingSlash: 'never',
133-
siteMetadata: {
134-
title: 'Example website',
135-
description: 'Example website description',
136-
keywords: ['docs', 'test'],
137-
siteUrl: 'http://localhost:8000'
138-
},
139-
plugins: [
140-
{
141-
resolve: themePackageName,
142-
options: {
143-
simpleLinkerTerms: require('./content/linked-terms')
144-
}
145-
},
146-
{
147-
resolve: 'gatsby-source-filesystem',
148-
options: {
149-
name: 'images',
150-
path: path.join(__dirname, 'static', 'img')
151-
}
152-
},
153-
'@sentry/gatsby'
154-
]
155-
}
156-
```
132+
Check out the example project in this project's monorepo, particularly
133+
[`gatsby-config.js`](https://github.com/iterative/gatsby-theme-iterative/blob/main/packages/example/gatsby-config.js).

packages/gatsby-theme-iterative/config-defaults.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ module.exports = {
55
docsInstanceName: 'iterative-docs',
66
glossaryPath: path.resolve('content', 'docs', 'user-guide', 'basic-concepts'),
77
glossaryInstanceName: 'iterative-glossary',
8-
argsLinkerPath: ['command-reference', `ref`, 'cli-reference']
8+
argsLinkerPath: ['command-reference', `ref`, 'cli-reference'],
9+
sentry: true
910
}

packages/gatsby-theme-iterative/gatsby-config.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ require('./config/prismjs/dvctable')
1717
const imageMaxWidth = 700
1818

1919
const defaults = require('./config-defaults')
20+
const sentryConfig = require('./sentry-config')
2021

2122
module.exports = ({
2223
simpleLinkerTerms,
@@ -32,7 +33,8 @@ module.exports = ({
3233
docsPath = defaults.docsPath,
3334
glossaryInstanceName = defaults.glossaryInstanceName,
3435
glossaryPath = defaults.glossaryPath,
35-
argsLinkerPath = defaults.argsLinkerPath
36+
argsLinkerPath = defaults.argsLinkerPath,
37+
sentry = defaults.sentry
3638
}) => ({
3739
plugins: [
3840
{
@@ -135,7 +137,8 @@ module.exports = ({
135137
},
136138
'gatsby-remark-responsive-iframe',
137139
require.resolve('./plugins/resize-image-plugin'),
138-
require.resolve('./plugins/external-link-plugin')
140+
require.resolve('./plugins/external-link-plugin'),
141+
require.resolve('./plugins/null-link-plugin')
139142
]
140143
}
141144
},
@@ -153,6 +156,10 @@ module.exports = ({
153156
placeholder: 'blurred'
154157
}
155158
}
159+
},
160+
sentry && {
161+
resolve: '@sentry/gatsby',
162+
options: sentryConfig
156163
}
157164
].filter(Boolean),
158165
siteMetadata: {

packages/gatsby-theme-iterative/gatsby-node.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ exports.pluginOptionsSchema = ({ Joi }) => {
2323
glossaryInstanceName: Joi.string()
2424
.default('iterative-glossary')
2525
.allow(false),
26-
docsInstanceName: Joi.string().default('iterative-docs'),
26+
docsInstanceName: Joi.string().default('iterative-docs').allow(false),
2727
docsPrefix: Joi.string().default('doc'),
2828
simpleLinkerTerms: Joi.array().items(
2929
Joi.object({
@@ -37,7 +37,8 @@ exports.pluginOptionsSchema = ({ Joi }) => {
3737
.default(defaults.argsLinkerPath),
3838
plausibleSrc: [Joi.string().optional(), Joi.allow(null)],
3939
plausibleAPI: [Joi.string().optional(), Joi.allow(null)],
40-
plausibleDomain: [Joi.string().optional(), Joi.allow(null)]
40+
plausibleDomain: [Joi.string().optional(), Joi.allow(null)],
41+
sentry: Joi.boolean().default(defaults.sentry)
4142
})
4243
}
4344

packages/gatsby-theme-iterative/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dvcorg/gatsby-theme-iterative",
3-
"version": "0.2.6",
3+
"version": "0.2.9-beta.0",
44
"description": "",
55
"main": "index.js",
66
"types": "src/typings.d.ts",
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = async ({ markdownAST }) => {
2+
const { visit } = await import('unist-util-visit')
3+
visit(markdownAST, 'link', node => {
4+
if (!node.url && node?.children?.[0]?.type === 'inlineCode') {
5+
node.type = 'inlineCode'
6+
node.value = node.children[0].value
7+
}
8+
})
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "null-link-plugin",
3+
"version": "1.0.0",
4+
"main": "index.js",
5+
"author": "yathomasi",
6+
"license": "Apache-2.0"
7+
}

0 commit comments

Comments
 (0)