Skip to content

Commit 547b16e

Browse files
authored
docs: fix code block titles (medusajs#5733)
* docs: fix code block titles * remove console * fix build error
1 parent de8f748 commit 547b16e

File tree

110 files changed

+481
-454
lines changed

Some content is hidden

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

110 files changed

+481
-454
lines changed

www/apps/api-reference/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"openapi-sampler": "^1.3.1",
3636
"openapi-types": "^12.1.3",
3737
"postcss": "8.4.27",
38-
"prism-react-renderer": "^2.0.6",
38+
"prism-react-renderer": "^2.3.0",
3939
"react": "latest",
4040
"react-dom": "latest",
4141
"react-instantsearch": "^7.0.1",

www/apps/docs/content/admin/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ In this document, you'll learn about the different ways you can configure the ad
1212

1313
The `build` command in the admin CLI allows you to manually build the admin dashboard. If you intend to use it, you should typically add it to the `package.json` of the Medusa backend:
1414

15-
```json title=package.json
15+
```json title="package.json"
1616
{
1717
"scripts": {
1818
// other scripts...
@@ -29,7 +29,7 @@ You can add the following option to the `medusa-admin build` command:
2929

3030
The `develop` command in the admin CLI allows you to run the admin dashboard in development separately from the Medusa backend. If you intend to use it, you should typically add it to the `package.json` of the Medusa backend:
3131

32-
```json title=package.json
32+
```json title="package.json"
3333
{
3434
"scripts": {
3535
// other scripts...
@@ -84,7 +84,7 @@ This is an advanced feature and requires knowledge of configuring webpack. If co
8484

8585
For example:
8686

87-
```js title=src/admin/webpack.config.js
87+
```js title="src/admin/webpack.config.js"
8888
import { withCustomWebpackConfig } from "@medusajs/admin"
8989

9090
export default withCustomWebpackConfig((config, webpack) => {

www/apps/docs/content/admin/onboarding.mdx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Each of the collapsible elements below hold the path to the file that you should
6262
<Details>
6363
<Summary>src/admin/types/icon-type.ts</Summary>
6464

65-
```tsx title=src/admin/types/icon-type.ts
65+
```tsx title="src/admin/types/icon-type.ts"
6666
import React from "react"
6767

6868
type IconProps = {
@@ -80,7 +80,7 @@ Each of the collapsible elements below hold the path to the file that you should
8080

8181
<!-- eslint-disable max-len -->
8282

83-
```tsx title=src/admin/components/shared/icons/get-started.tsx
83+
```tsx title="src/admin/components/shared/icons/get-started.tsx"
8484
import React from "react"
8585
import IconProps from "../../../types/icon-type"
8686

@@ -115,7 +115,7 @@ Each of the collapsible elements below hold the path to the file that you should
115115

116116
<!-- eslint-disable max-len -->
117117

118-
```tsx title=src/admin/components/shared/icons/dollar-sign-icon.tsx
118+
```tsx title="src/admin/components/shared/icons/dollar-sign-icon.tsx"
119119
import React from "react"
120120
import IconProps from "../../../types/icon-type"
121121

@@ -162,7 +162,7 @@ Each of the collapsible elements below hold the path to the file that you should
162162

163163
<!-- eslint-disable max-len -->
164164

165-
```tsx title=src/admin/components/shared/accordion.tsx
165+
```tsx title="src/admin/components/shared/accordion.tsx"
166166
import * as AccordionPrimitive from "@radix-ui/react-accordion"
167167
import React from "react"
168168
import { CheckCircleSolid, CircleMiniSolid } from "@medusajs/icons"
@@ -295,7 +295,7 @@ Each of the collapsible elements below hold the path to the file that you should
295295
296296
<!-- eslint-disable max-len -->
297297
298-
```tsx title=src/admin/components/shared/card.tsx
298+
```tsx title="src/admin/components/shared/card.tsx"
299299
import { Text, clx } from "@medusajs/ui"
300300
301301
type CardProps = {
@@ -348,7 +348,7 @@ An [entity](../development/entities/overview.mdx) represents a table in the data
348348

349349
To create the entity, create the file `src/models/onboarding.ts` with the following content:
350350

351-
```ts title=src/models/onboarding.ts
351+
```ts title="src/models/onboarding.ts"
352352
import { BaseEntity } from "@medusajs/medusa"
353353
import { Column, Entity } from "typeorm"
354354

@@ -367,7 +367,7 @@ export class OnboardingState extends BaseEntity {
367367

368368
Then, create the file `src/repositories/onboarding.ts` that holds the repository of the entity with the following content:
369369

370-
```ts title=src/repositories/onboarding.ts
370+
```ts title="src/repositories/onboarding.ts"
371371
import {
372372
dataSource,
373373
} from "@medusajs/medusa/dist/loaders/database"
@@ -450,7 +450,7 @@ Start by creating the file `src/types/onboarding.ts` with the following content:
450450
451451
<!-- eslint-disable @typescript-eslint/no-empty-interface -->
452452
453-
```ts title=src/types/onboarding.ts
453+
```ts title="src/types/onboarding.ts"
454454
import { OnboardingState } from "../models/onboarding"
455455

456456
export type UpdateOnboardingStateInput = {
@@ -472,7 +472,7 @@ Then, create the file `src/services/onboarding.ts` with the following content:
472472
473473
<!-- eslint-disable prefer-rest-params -->
474474
475-
```ts title=src/services/onboarding.ts
475+
```ts title="src/services/onboarding.ts"
476476
import { TransactionBaseService } from "@medusajs/medusa"
477477
import OnboardingRepository from "../repositories/onboarding"
478478
import { OnboardingState } from "../models/onboarding"
@@ -540,7 +540,7 @@ The last part of this step is to create the [API Routes](../development/api-rout
540540
541541
To add these API Routes, create the file `src/api/admin/onboarding/route.ts` with the following content:
542542
543-
```ts title=src/api/admin/onboarding/route.ts
543+
```ts title="src/api/admin/onboarding/route.ts"
544544
import type {
545545
MedusaRequest,
546546
MedusaResponse,
@@ -597,7 +597,7 @@ Create the file `src/admin/widgets/onboarding-flow/onboarding-flow.tsx` with the
597597
598598
<!-- eslint-disable @typescript-eslint/ban-types -->
599599
600-
```tsx title=src/admin/widgets/onboarding-flow/onboarding-flow.tsx
600+
```tsx title="src/admin/widgets/onboarding-flow/onboarding-flow.tsx"
601601
import { OrderDetailsWidgetProps, ProductDetailsWidgetProps, WidgetConfig, WidgetProps } from "@medusajs/admin"
602602
import { useAdminCustomPost, useAdminCustomQuery, useMedusa } from "medusa-react"
603603
import React, { useEffect, useState, useMemo, useCallback } from "react"
@@ -1059,7 +1059,7 @@ const OnboardingFlow = (props: OnboardingWidgetProps) => {
10591059
const isCurrent = currentStep === step.id
10601060
return (
10611061
<Accordion.Item
1062-
title={step.title}
1062+
title="{step.title}"
10631063
value={step.id}
10641064
headingSize="medium"
10651065
active={isCurrent}
@@ -1135,7 +1135,7 @@ Notice that as there are two types of flows, you'll be creating the components f
11351135
11361136
<!-- eslint-disable max-len -->
11371137
1138-
```tsx title=src/admin/components/onboarding-flow/default/products/products-list.tsx
1138+
```tsx title="src/admin/components/onboarding-flow/default/products/products-list.tsx"
11391139
import React, { useMemo } from "react"
11401140
import {
11411141
useAdminCreateProduct,
@@ -1221,7 +1221,7 @@ Notice that as there are two types of flows, you'll be creating the components f
12211221
12221222
<!-- eslint-disable max-len -->
12231223
1224-
```tsx title=src/admin/components/onboarding-flow/default/products/product-detail.tsx
1224+
```tsx title="src/admin/components/onboarding-flow/default/products/product-detail.tsx"
12251225
import React, { useEffect, useMemo } from "react"
12261226
import {
12271227
useAdminPublishableApiKeys,
@@ -1325,7 +1325,7 @@ Notice that as there are two types of flows, you'll be creating the components f
13251325
13261326
<!-- eslint-disable max-len -->
13271327
1328-
```tsx title=src/admin/components/onboarding-flow/default/orders/orders-list.tsx
1328+
```tsx title="src/admin/components/onboarding-flow/default/orders/orders-list.tsx"
13291329
import React from "react"
13301330
import {
13311331
useAdminProduct,
@@ -1420,7 +1420,7 @@ Notice that as there are two types of flows, you'll be creating the components f
14201420
14211421
<!-- eslint-disable max-len -->
14221422
1423-
```tsx title=src/admin/components/onboarding-flow/default/orders/order-detail.tsx
1423+
```tsx title="src/admin/components/onboarding-flow/default/orders/order-detail.tsx"
14241424
import React from "react"
14251425
import {
14261426
ComputerDesktopSolid,
@@ -1571,7 +1571,7 @@ Notice that as there are two types of flows, you'll be creating the components f
15711571
15721572
<!-- eslint-disable max-len -->
15731573
1574-
```tsx title=src/admin/components/onboarding-flow/nextjs/products/products-list.tsx
1574+
```tsx title="src/admin/components/onboarding-flow/nextjs/products/products-list.tsx"
15751575
import React from "react"
15761576
import {
15771577
useAdminCreateProduct,
@@ -1669,7 +1669,7 @@ Notice that as there are two types of flows, you'll be creating the components f
16691669
16701670
<!-- eslint-disable max-len -->
16711671
1672-
```tsx title=src/admin/components/onboarding-flow/nextjs/products/product-detail.tsx
1672+
```tsx title="src/admin/components/onboarding-flow/nextjs/products/product-detail.tsx"
16731673
import { useAdminProduct } from "medusa-react"
16741674
import { StepContentProps } from "../../../../widgets/onboarding-flow/onboarding-flow"
16751675
import { Button, Text } from "@medusajs/ui"
@@ -1737,7 +1737,7 @@ Notice that as there are two types of flows, you'll be creating the components f
17371737
17381738
<!-- eslint-disable max-len -->
17391739
1740-
```tsx title=src/admin/components/onboarding-flow/nextjs/orders/orders-list.tsx
1740+
```tsx title="src/admin/components/onboarding-flow/nextjs/orders/orders-list.tsx"
17411741
import React from "react"
17421742
import {
17431743
useAdminProduct,
@@ -1817,7 +1817,7 @@ Notice that as there are two types of flows, you'll be creating the components f
18171817
18181818
<!-- eslint-disable max-len -->
18191819
1820-
```tsx title=src/admin/components/onboarding-flow/nextjs/orders/order-detail.tsx
1820+
```tsx title="src/admin/components/onboarding-flow/nextjs/orders/order-detail.tsx"
18211821
import React from "react"
18221822
import { CurrencyDollarSolid, NextJs, SquaresPlusSolid } from "@medusajs/icons"
18231823
import { IconBadge, Heading, Text } from "@medusajs/ui"

www/apps/docs/content/admin/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ npm install @medusajs/admin
5656

5757
In `medusa-config.js`, add the admin plugin into the array of `plugins`:
5858

59-
```js title=medusa-config.js
59+
```js title="medusa-config.js"
6060
const plugins = [
6161
// ...
6262
{

www/apps/docs/content/admin/routes.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ These changes may already be available in your Medusa project. They're included
4040

4141
First, update your `tsconfig.json` with the following configurations:
4242

43-
```json title=tsconfig.json
43+
```json title="tsconfig.json"
4444
{
4545
"compilerOptions": {
4646
"target": "es2019",
@@ -81,7 +81,7 @@ The addition of `"jsx": "react-jsx"` specified how should TypeScript transform J
8181

8282
Next, create the file `tsconfig.server.json` with the following content:
8383

84-
```json title=tsconfig.server.json
84+
```json title="tsconfig.server.json"
8585
{
8686
"extends": "./tsconfig.json",
8787
"compilerOptions": {
@@ -96,7 +96,7 @@ This is the configuration that will be used to transpile your custom backend cod
9696

9797
Finally, create the file `tsconfig.admin.json` with the following content:
9898

99-
```json title=tsconfig.admin.json
99+
```json title="tsconfig.admin.json"
100100
{
101101
"extends": "./tsconfig.json",
102102
"compilerOptions": {
@@ -135,7 +135,7 @@ For an admin route to be valid, it must default export a React component. There
135135

136136
For example, you can create the file `src/admin/routes/custom/page.tsx` with the following content:
137137

138-
```tsx title=src/admin/routes/custom/page.tsx
138+
```tsx title="src/admin/routes/custom/page.tsx"
139139
const CustomPage = () => {
140140
return (
141141
<div>
@@ -217,7 +217,7 @@ The object has one property `link`, which is an object having the following prop
217217

218218
For example, you can change the content of the previous route you created to export a config object:
219219

220-
```tsx title=src/admin/routes/custom/page.tsx
220+
```tsx title="src/admin/routes/custom/page.tsx"
221221
import { RouteConfig } from "@medusajs/admin"
222222
import { CustomIcon } from "../../icons/custom"
223223

@@ -261,7 +261,7 @@ If you're installing it in a plugin with admin customizations, make sure to incl
261261

262262
For example:
263263

264-
```tsx title=src/admin/routes/custom/[id]/page.tsx
264+
```tsx title="src/admin/routes/custom/[id]/page.tsx"
265265
import { useParams } from "react-router-dom"
266266

267267
const CustomPage = () => {
@@ -285,7 +285,7 @@ If you want to use routing functionalities such as linking to another page or na
285285

286286
For example, to add a link to another page:
287287

288-
```tsx title=src/admin/routes/custom/page.tsx
288+
```tsx title="src/admin/routes/custom/page.tsx"
289289
import { Link } from "react-router-dom"
290290

291291
const CustomPage = () => {
@@ -314,7 +314,7 @@ For example, to customize your custom route:
314314

315315
<!-- eslint-disable max-len -->
316316

317-
```tsx title=src/admin/routes/custom/page.tsx
317+
```tsx title="src/admin/routes/custom/page.tsx"
318318
const CustomPage = () => {
319319
return (
320320
<div
@@ -341,7 +341,7 @@ Make sure to also install the Medusa React package first if you’re intending t
341341

342342
For example, you can retrieve available products and display them in your route:
343343

344-
```tsx title=src/admin/routes/custom/page.tsx
344+
```tsx title="src/admin/routes/custom/page.tsx"
345345
import { useAdminProducts } from "medusa-react"
346346

347347
const CustomPage = () => {

www/apps/docs/content/admin/setting-pages.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ These changes may already be available in your Medusa project. They're included
3636

3737
First, update your `tsconfig.json` with the following configurations:
3838

39-
```json title=tsconfig.json
39+
```json title="tsconfig.json"
4040
{
4141
"compilerOptions": {
4242
"target": "es2019",
@@ -77,7 +77,7 @@ The addition of `"jsx": "react-jsx"` specified how should TypeScript transform J
7777

7878
Next, create the file `tsconfig.server.json` with the following content:
7979

80-
```json title=tsconfig.server.json
80+
```json title="tsconfig.server.json"
8181
{
8282
"extends": "./tsconfig.json",
8383
"compilerOptions": {
@@ -92,7 +92,7 @@ This is the configuration that will be used to transpile your custom backend cod
9292

9393
Finally, create the file `tsconfig.admin.json` with the following content:
9494

95-
```json title=tsconfig.admin.json
95+
```json title="tsconfig.admin.json"
9696
{
9797
"extends": "./tsconfig.json",
9898
"compilerOptions": {
@@ -131,7 +131,7 @@ For a setting page to be valid, it must default export a React component. There
131131

132132
For example, you can create the file `src/admin/settings/custom/page.tsx` with the following content:
133133

134-
```tsx title=src/admin/settings/custom/page.tsx
134+
```tsx title="src/admin/settings/custom/page.tsx"
135135
import type { SettingConfig } from "@medusajs/admin"
136136
import { CustomIcon } from "../../icons/custom"
137137

@@ -184,7 +184,7 @@ Every route receives props of the type `RouteProps`, which includes the `notify`
184184

185185
For example:
186186

187-
```tsx title=src/admin/settings/custom/page.tsx
187+
```tsx title="src/admin/settings/custom/page.tsx"
188188
import type { SettingConfig } from "@medusajs/admin"
189189
import type { SettingProps } from "@medusajs/admin"
190190

@@ -226,7 +226,7 @@ For example, to customize the style of your custom setting page:
226226

227227
<!-- eslint-disable max-len -->
228228

229-
```tsx title=src/admin/settings/custom/page.tsx
229+
```tsx title="src/admin/settings/custom/page.tsx"
230230
import type { SettingConfig } from "@medusajs/admin"
231231

232232
const CustomSettingPage = () => {
@@ -269,7 +269,7 @@ If you're installing it in a plugin with admin customizations, make sure to incl
269269

270270
For example, to add a link to another page:
271271

272-
```tsx title=src/admin/settings/custom/page.tsx
272+
```tsx title="src/admin/settings/custom/page.tsx"
273273
import type { SettingConfig } from "@medusajs/admin"
274274
import { Link } from "react-router-dom"
275275

@@ -310,7 +310,7 @@ Make sure to also install the Medusa React package first if you’re intending t
310310

311311
For example, you can retrieve available products and display them in your route:
312312

313-
```tsx title=src/admin/settings/custom/page.tsx
313+
```tsx title="src/admin/settings/custom/page.tsx"
314314
import type { SettingConfig } from "@medusajs/admin"
315315
import { useAdminProducts } from "medusa-react"
316316

0 commit comments

Comments
 (0)