Skip to content

Commit 1c7096c

Browse files
authored
refactor: move config validation to backend (#214)
* chore: rebase on main * refactor: remove legacy config type * refactor: move bundler files into own directory * chore: rebase on main * fix: default to not replacing a variable when not declared * fix: tweak type of BundleSuccess config * chore: rebase from main * chore: bump deps * chore: bump codehike deps * chore: bump dependencies * chore: lint and format
1 parent 7b3556a commit 1c7096c

31 files changed

+2465
-24432
lines changed

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.0.0

api/package.json

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,46 @@
11
{
22
"type": "module",
3-
"name": "ts-express",
3+
"name": "docs-page-api",
44
"version": "1.0.0",
55
"description": "template node and express app with typescript using esm ",
66
"main": "src/app.ts",
77
"author": "<[email protected]>",
88
"license": "MIT",
99
"dependencies": {
10-
"@code-hike/mdx": "^v0.3.0-next.20",
10+
"@code-hike/mdx": "^0.7.2",
1111
"@ltd/j-toml": "^1.30.0",
12-
"@octokit/graphql": "^4.8.0",
12+
"@octokit/graphql": "^5.0.0",
1313
"@types/cors": "^2.8.12",
1414
"@types/express": "^4.17.13",
15-
"@types/lodash.get": "^4.4.6",
15+
"@types/lodash.get": "^4.4.7",
1616
"@types/morgan": "^1.9.3",
17-
"@types/node": "^16.7.1",
17+
"@types/node": "^18.0.0",
1818
"a2a": "^0.2.0",
19-
"camelcase": "^6.2.1",
19+
"camelcase": "^7.0.0",
2020
"cors": "^2.8.5",
21-
"dotenv": "^10.0.0",
22-
"esbuild": "^0.14.2",
23-
"express": "^4.17.1",
24-
"express-basic-auth": "^1.1.1",
21+
"dotenv": "^16.0.1",
22+
"esbuild": "^0.14.47",
23+
"express": "^4.18.1",
24+
"express-basic-auth": "^1.2.1",
2525
"hast-util-parse-selector": "^3.1.0",
26-
"http-status": "^1.5.0",
26+
"http-status": "^1.5.2",
2727
"is-badge": "^2.1.0",
2828
"js-yaml": "^4.1.0",
2929
"lodash.get": "^4.4.2",
30-
"mdx-bundler": "^8.0.0",
30+
"mdx-bundler": "^9.0.1",
3131
"morgan": "^1.10.0",
32-
"node-fetch": "^3.2.2",
33-
"probot": "^12.2.1",
34-
"react": "^17.0.2",
32+
"node-fetch": "^3.2.6",
33+
"probot": "^12.2.4",
34+
"react": "^18.2.0",
3535
"rehype-accessible-emojis": "^0.3.2",
3636
"rehype-katex": "^6.0.2",
37-
"rehype-slug": "^5.0.0",
37+
"rehype-slug": "^5.0.1",
3838
"remark-comment": "^1.0.0",
3939
"remark-gfm": "^3.0.1",
4040
"remark-math": "^5.1.1",
4141
"remark-parse": "^10.0.1",
42-
"shiki": "^0.9.15",
42+
"shiki": "^0.10.1",
4343
"tiny-invariant": "^1.2.0",
44-
"typescript": "4.4.4",
4544
"unist-util-visit": "^4.1.0"
4645
},
4746
"scripts": {
@@ -51,10 +50,10 @@
5150
"postinstall": "tsc"
5251
},
5352
"devDependencies": {
54-
"@docs.page/server": "^1.0.0",
55-
"@octokit/webhooks-types": "^5.3.0",
56-
"nodemon": "^2.0.12",
57-
"ts-node": "^10.4.0",
58-
"typescript": "4.4.3"
53+
"@docs.page/server": "^1.0.1",
54+
"@octokit/webhooks-types": "^6.2.4",
55+
"nodemon": "^2.0.18",
56+
"ts-node": "^10.8.1",
57+
"typescript": "4.7.4"
5958
}
6059
}

api/src/utils/bundler.ts renamed to api/src/bundler/bundler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export async function bundle(
4646

4747
const { code, frontmatter, errors } = await bundleMDX({
4848
source: rawText,
49-
xdmOptions(options) {
49+
mdxOptions(options) {
5050
// @ts-ignore TODO fix types
5151
options.remarkPlugins = [...(options.remarkPlugins ?? []), ...bundleOptions.remarkPlugins];
5252
// @ts-ignore TODO fix types

api/src/utils/getPlugins.ts renamed to api/src/bundler/getPlugins.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { theme } from '../utils/plugins/codeHikeTheme.js';
1+
import { theme } from './plugins/codeHikeTheme.js';
22
import { remarkCodeHike } from '@code-hike/mdx';
33
import remarkGfm from 'remark-gfm';
4-
import rehypeCodeBlocks from '../utils/plugins/rehype-code-blocks.js';
4+
import rehypeCodeBlocks from './plugins/rehype-code-blocks.js';
55
import { rehypeAccessibleEmojis } from 'rehype-accessible-emojis';
6-
import rehypeInlineBadges from '../utils/plugins/rehype-inline-badges.js';
6+
import rehypeInlineBadges from './plugins/rehype-inline-badges.js';
77
import rehypeSlug from 'rehype-slug';
88
import remarkMath from 'remark-math';
99
import rehypeKatex from 'rehype-katex';

0 commit comments

Comments
 (0)