diff --git a/.github/workflows/docs-test.yml b/.github/workflows/docs-test.yml index adfa6ee5b3..d4745003eb 100644 --- a/.github/workflows/docs-test.yml +++ b/.github/workflows/docs-test.yml @@ -334,6 +334,63 @@ jobs: env: REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} + vale-cloud: + if: ${{ startsWith(github.head_ref, 'docs/') }} + runs-on: ubuntu-latest + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ github.token }} + + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install Dependencies + run: yarn + + - name: Build Dependencies + run: yarn build + + - name: Install www/utils Dependencies + run: yarn + working-directory: www/utils + + - name: Build packages + run: yarn build + working-directory: www/utils + + # reviewdog throws an error when the number + # of file changes in a PR is > 300, so + # we retrieve the number of changed files + # and only run the linter if the number is + # less than 300. This is to avoid a PR hanging in + # an error state + - name: Get PR files number + working-directory: www/utils/packages/scripts + run: "yarn check:pr-files-count ${{ github.ref_name }}" + id: pr-files + + - name: Get Directories to Scan + working-directory: www/vale + run: ./get-files.sh cloud/app + id: directories + + - name: Vale Linter + uses: errata-ai/vale-action@reviewdog + if: ${{ steps.pr-files.outputs.files_lt_threshold == 'true' }} + with: + files: ${{ steps.directories.outputs.LIST }} + fail_on_error: true + vale_flags: "--minAlertLevel=error" + reporter: github-pr-check + token: ${{ github.token }} + filter_mode: nofilter + env: + REVIEWDOG_GITHUB_API_TOKEN: ${{ github.token }} + content-eslint: if: ${{ startsWith(github.head_ref, 'docs/') }} runs-on: ubuntu-latest diff --git a/www/apps/api-reference/.env.sample b/www/apps/api-reference/.env.sample index aab106ae0e..14ed595905 100644 --- a/www/apps/api-reference/.env.sample +++ b/www/apps/api-reference/.env.sample @@ -10,6 +10,7 @@ NEXT_PUBLIC_DOCS_URL= NEXT_PUBLIC_UI_URL= NEXT_PUBLIC_RESOURCES_URL= NEXT_PUBLIC_USER_GUIDE_URL= +NEXT_PUBLIC_CLOUD_URL= NEXT_PUBLIC_DOCS_V1_URL= NEXT_PUBLIC_API_V1_URL= ALGOLIA_WRITE_API_KEY= diff --git a/www/apps/book/.env.sample b/www/apps/book/.env.sample index d909edcb62..c7055dabd1 100644 --- a/www/apps/book/.env.sample +++ b/www/apps/book/.env.sample @@ -7,6 +7,7 @@ NEXT_PUBLIC_ENV= NEXT_PUBLIC_BASE_URL= NEXT_PUBLIC_RESOURCES_URL= NEXT_PUBLIC_USER_GUIDE_URL= +NEXT_PUBLIC_CLOUD_URL= NEXT_PUBLIC_UI_URL= NEXT_PUBLIC_API_URL= NEXT_PUBLIC_DOCS_V1_URL= diff --git a/www/apps/book/app/learn/deployment/general/page.mdx b/www/apps/book/app/learn/deployment/general/page.mdx index cbe41b122f..9c118f7ad5 100644 --- a/www/apps/book/app/learn/deployment/general/page.mdx +++ b/www/apps/book/app/learn/deployment/general/page.mdx @@ -10,13 +10,13 @@ In this document, you'll learn the general steps to deploy your Medusa applicati Find how-to guides for specific platforms in [this documentation](!resources!/deployment). - + -Want Medusa to manage and maintain your infrastructure? [Sign up and learn more about Medusa Cloud](https://medusajs.com/pricing) +Want Medusa to manage and maintain your infrastructure? [Sign up and learn more about Cloud](https://medusajs.com/pricing) -Medusa Cloud is our managed services offering that makes deploying and operating Medusa applications possible without having to worry about configuring, scaling, and maintaining infrastructure. Medusa Cloud hosts your server, Admin dashboard, database, and Redis instance. +Cloud is our managed services offering that makes deploying and operating Medusa applications possible without having to worry about configuring, scaling, and maintaining infrastructure. Cloud hosts your server, Admin dashboard, database, and Redis instance. -With Medusa Cloud, you maintain full customization control as you deploy your own modules and customizations directly from GitHub: +With Cloud, you maintain full customization control as you deploy your own modules and customizations directly from GitHub: - Push to deploy. - Multiple testing environments. diff --git a/www/apps/book/app/learn/deployment/page.mdx b/www/apps/book/app/learn/deployment/page.mdx index ec044bc644..2516191bb4 100644 --- a/www/apps/book/app/learn/deployment/page.mdx +++ b/www/apps/book/app/learn/deployment/page.mdx @@ -46,16 +46,16 @@ Learn more about worker modes and how to configure them in the [Worker Mode chap ### How to Deploy Medusa? -Medusa Cloud is our managed services offering that makes deploying and operating Medusa applications possible without having to worry about configuring, scaling, and maintaining infrastructure. Medusa Cloud hosts your server, Admin dashboard, database, and Redis instance. +Cloud is our managed services offering that makes deploying and operating Medusa applications possible without having to worry about configuring, scaling, and maintaining infrastructure. Cloud hosts your server, Admin dashboard, database, and Redis instance. -With Medusa Cloud, you maintain full customization control as you deploy your own modules and customizations directly from GitHub: +With Cloud, you maintain full customization control as you deploy your own modules and customizations directly from GitHub: - Push to deploy. - Multiple testing environments. - Preview environments for new PRs. - Test on production-like data. -[Sign up and learn more about Medusa Cloud](https://medusajs.com/pricing) +[Sign up and learn more about Cloud](https://medusajs.com/pricing) To self-host Medusa, the [next chapter](./general/page.mdx) explains the general steps to deploy your Medusa application. Refer to [this reference](!resources!/deployment) to find how-to deployment guides for general and specific hosting providers. diff --git a/www/apps/cloud/.content.eslintrc.mjs b/www/apps/cloud/.content.eslintrc.mjs new file mode 100644 index 0000000000..40e7abc55e --- /dev/null +++ b/www/apps/cloud/.content.eslintrc.mjs @@ -0,0 +1,155 @@ +import prettier from "eslint-plugin-prettier" +import markdown from "eslint-plugin-markdown" +import globals from "globals" +import babelParser from "@babel/eslint-parser" +import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin" +import tsParser from "@typescript-eslint/parser" +import path from "node:path" +import { fileURLToPath } from "node:url" +import js from "@eslint/js" +import { FlatCompat } from "@eslint/eslintrc" + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}) + +export default [ + { + ignores: ["**/references/**/*"], + }, + { + plugins: { + prettier, + markdown, + }, + + languageOptions: { + globals: { + ...globals.node, + }, + + parser: babelParser, + ecmaVersion: 13, + sourceType: "module", + + parserOptions: { + requireConfigFile: false, + + ecmaFeatures: { + experimentalDecorators: true, + modules: true, + }, + }, + }, + + settings: { + react: { + version: "detect", + }, + }, + + rules: { + "no-undef": "off", + "no-unused-expressions": "off", + "no-unused-vars": "off", + "no-unused-labels": "off", + "no-console": "off", + curly: ["error", "all"], + "new-cap": "off", + "require-jsdoc": "off", + camelcase: "off", + "no-invalid-this": "off", + + "max-len": [ + "warn", + { + code: 64, + }, + ], + + semi: ["error", "never"], + + quotes: [ + "error", + "double", + { + allowTemplateLiterals: true, + }, + ], + + "comma-dangle": [ + "error", + { + arrays: "always-multiline", + objects: "always-multiline", + imports: "always-multiline", + exports: "always-multiline", + functions: "never", + }, + ], + + "object-curly-spacing": ["error", "always"], + "arrow-parens": ["error", "always"], + "linebreak-style": 0, + + "no-confusing-arrow": [ + "error", + { + allowParens: false, + }, + ], + + "space-before-function-paren": [ + "error", + { + anonymous: "always", + named: "never", + asyncArrow: "always", + }, + ], + + "space-infix-ops": "off", + "eol-last": ["error", "always"], + "react/prop-types": "off", + "react/jsx-no-undef": "off", + }, + }, + { + files: ["**/*.md", "**/*.mdx"], + processor: "markdown/markdown", + }, + { + files: ["**/*.md/*.js", "**/*.mdx/*.js", "**/*.md/*.jsx", "**/*.mdx/*.jsx"], + }, + ...compat.extends("plugin:@typescript-eslint/recommended").map((config) => ({ + ...config, + files: ["**/*.md/*.ts", "**/*.mdx/*.ts", "**/*.md/*.tsx", "**/*.mdx/*.tsx"], + })), + { + files: ["**/*.md/*.ts", "**/*.mdx/*.ts", "**/*.md/*.tsx", "**/*.mdx/*.tsx"], + + plugins: { + "@typescript-eslint": typescriptEslintEslintPlugin, + }, + + languageOptions: { + parser: tsParser, + }, + + rules: { + "@typescript-eslint/no-unused-vars": "off", + "@typescript-eslint/no-empty-function": "off", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-var-requires": "off", + "prefer-rest-params": "off", + "@typescript-eslint/ban-ts-comment": "off", + "@typescript-eslint/no-non-null-asserted-optional-chain": "off", + "@typescript-eslint/ban-types": "off", + }, + }, +] diff --git a/www/apps/cloud/.env.example b/www/apps/cloud/.env.example new file mode 100644 index 0000000000..cfa0a5a1b1 --- /dev/null +++ b/www/apps/cloud/.env.example @@ -0,0 +1,20 @@ +NEXT_PUBLIC_SEGMENT_API_KEY= +NEXT_PUBLIC_DOCS_ALGOLIA_INDEX_NAME= +NEXT_PUBLIC_API_ALGOLIA_INDEX_NAME= +NEXT_PUBLIC_ALGOLIA_API_KEY= +NEXT_PUBLIC_ALGOLIA_APP_ID= +NEXT_PUBLIC_ENV= +NEXT_PUBLIC_BASE_URL= +NEXT_PUBLIC_BASE_PATH= +NEXT_PUBLIC_DOCS_URL= +NEXT_PUBLIC_RESOURCES_URL= +NEXT_PUBLIC_UI_URL= +NEXT_PUBLIC_API_URL= +NEXT_PUBLIC_USER_GUIDE_URL= +ALGOLIA_WRITE_API_KEY= +ANALYZE_BUNDLE= +NEXT_PUBLIC_AI_ASSISTANT_URL= +NEXT_PUBLIC_AI_WEBSITE_ID= +NEXT_PUBLIC_AI_API_ASSISTANT_RECAPTCHA_SITE_KEY= +CLOUDINARY_CLOUD_NAME= +NEXT_PUBLIC_GA_ID= \ No newline at end of file diff --git a/www/apps/cloud/.gitignore b/www/apps/cloud/.gitignore new file mode 100644 index 0000000000..fd3dbb571a --- /dev/null +++ b/www/apps/cloud/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js +.yarn/install-state.gz + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/www/apps/cloud/README.md b/www/apps/cloud/README.md new file mode 100644 index 0000000000..c4033664f8 --- /dev/null +++ b/www/apps/cloud/README.md @@ -0,0 +1,36 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/www/apps/cloud/app/favicon.ico b/www/apps/cloud/app/favicon.ico new file mode 100644 index 0000000000..bebbf17e40 Binary files /dev/null and b/www/apps/cloud/app/favicon.ico differ diff --git a/www/apps/cloud/app/globals.css b/www/apps/cloud/app/globals.css new file mode 100644 index 0000000000..4a75d63add --- /dev/null +++ b/www/apps/cloud/app/globals.css @@ -0,0 +1,43 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +@layer base { + + html { + @apply antialiased; + text-rendering: optimizeLegibility; + } + + body { + @apply overflow-x-hidden; + } + + *::selection { + @apply bg-medusa-bg-highlight; + } + + *:not(.code-block-elm) { + scrollbar-color: var(--docs-border-base) var(--docs-bg-base); + } + + .code-block-elm { + scrollbar-color: var(--docs-contrast-border-base) transparent; + } + + aside * { + scrollbar-color: var(--docs-border-base) var(--docs-bg-subtle); + } + + body[data-modal="opened"] { + @apply !overflow-hidden; + } + + .text-wrap { + text-wrap: wrap; + } +} + +.grecaptcha-badge { + visibility: hidden; +} \ No newline at end of file diff --git a/www/apps/cloud/app/icon.ico b/www/apps/cloud/app/icon.ico new file mode 100644 index 0000000000..bebbf17e40 Binary files /dev/null and b/www/apps/cloud/app/icon.ico differ diff --git a/www/apps/cloud/app/layout.tsx b/www/apps/cloud/app/layout.tsx new file mode 100644 index 0000000000..3759aa7522 --- /dev/null +++ b/www/apps/cloud/app/layout.tsx @@ -0,0 +1,70 @@ +import type { Metadata } from "next" +import { Inter, Roboto_Mono } from "next/font/google" +import Providers from "@/providers" +import "./globals.css" +import { BareboneLayout, TightLayout } from "docs-ui" +import { config } from "@/config" +import clsx from "clsx" +import Footer from "../components/Footer" + +const ogImage = + "https://res.cloudinary.com/dza7lstvk/image/upload/v1732200992/Medusa%20Resources/opengraph-image_daq6nx.jpg" + +export const metadata: Metadata = { + title: { + template: `%s - ${config.titleSuffix}`, + default: config.titleSuffix || "", + }, + description: "Explore and learn how to use the Medusa Admin.", + metadataBase: new URL( + process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000" + ), + openGraph: { + images: [ + { + url: ogImage, + type: "image/jpeg", + height: "1260", + width: "2400", + }, + ], + }, + twitter: { + images: [ + { + url: ogImage, + type: "image/jpeg", + height: "1260", + width: "2400", + }, + ], + }, +} + +export const inter = Inter({ + subsets: ["latin"], + variable: "--font-inter", + weight: ["400", "500"], +}) + +export const robotoMono = Roboto_Mono({ + subsets: ["latin"], + variable: "--font-roboto-mono", +}) + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + + }> + {children} + + + ) +} diff --git a/www/apps/cloud/app/not-found.mdx b/www/apps/cloud/app/not-found.mdx new file mode 100644 index 0000000000..277170c593 --- /dev/null +++ b/www/apps/cloud/app/not-found.mdx @@ -0,0 +1,47 @@ +--- +hide_content_menu: true +--- + +import { CardList, H1 } from "docs-ui" +import { + BookOpen, + AcademicCapSolid, + ComputerDesktopSolid, + BuildingStorefront +} from "@medusajs/icons" + +export const metadata = { + title: `Page Not Found`, +} + +# {metadata.title} + +The page you were looking for isn't available. + +If you think this is a mistake, please [report this issue on GitHub](https://github.com/medusajs/medusa/issues/new?assignees=&labels=type%3A+docs&template=docs.yml). + + \ No newline at end of file diff --git a/www/apps/cloud/app/page.mdx b/www/apps/cloud/app/page.mdx new file mode 100644 index 0000000000..8a767f4564 --- /dev/null +++ b/www/apps/cloud/app/page.mdx @@ -0,0 +1,7 @@ +export const metadata = { + title: `Cloud Documentation`, +} + +# {metadata.title} + +Welcome to the Cloud documentation! \ No newline at end of file diff --git a/www/apps/cloud/app/sitemap.ts b/www/apps/cloud/app/sitemap.ts new file mode 100644 index 0000000000..d3bc3e9a9b --- /dev/null +++ b/www/apps/cloud/app/sitemap.ts @@ -0,0 +1,13 @@ +import { retrieveMdxPages } from "build-scripts" +import type { MetadataRoute } from "next" +import path from "path" +import { config } from "../config" +import { basePathUrl } from "../utils/base-path-url" + +export default function sitemap(): MetadataRoute.Sitemap { + return retrieveMdxPages({ + basePath: path.resolve("app"), + }).map((filePath) => ({ + url: `${config.baseUrl}${basePathUrl(filePath)}`, + })) +} diff --git a/www/apps/cloud/components/EditButton/index.tsx b/www/apps/cloud/components/EditButton/index.tsx new file mode 100644 index 0000000000..e31540935c --- /dev/null +++ b/www/apps/cloud/components/EditButton/index.tsx @@ -0,0 +1,37 @@ +"use client" + +import { EditButton as UiEditButton } from "docs-ui" +import { usePathname } from "next/navigation" +import { useCallback, useEffect, useState } from "react" + +const EditButton = () => { + const pathname = usePathname() + const [editDate, setEditDate] = useState() + + const loadEditDate = useCallback(async () => { + const generatedEditDates = (await import("../../generated/edit-dates.mjs")) + .generatedEditDates + setEditDate( + (generatedEditDates as Record)[ + `app${pathname.replace(/\/$/, "")}/page.mdx` + ] + ) + }, [pathname]) + + useEffect(() => { + void loadEditDate() + }, [loadEditDate]) + + if (!editDate) { + return <> + } + + return ( + + ) +} + +export default EditButton diff --git a/www/apps/cloud/components/Feedback/index.tsx b/www/apps/cloud/components/Feedback/index.tsx new file mode 100644 index 0000000000..345e93244c --- /dev/null +++ b/www/apps/cloud/components/Feedback/index.tsx @@ -0,0 +1,28 @@ +"use client" + +import { + Feedback as UiFeedback, + FeedbackProps as UiFeedbackProps, +} from "docs-ui" +import { usePathname } from "next/navigation" +import { basePathUrl } from "../../utils/base-path-url" +import { useMemo } from "react" + +type FeedbackProps = Omit + +const Feedback = (props: FeedbackProps) => { + const pathname = usePathname() + + const feedbackPathname = useMemo(() => basePathUrl(pathname), [pathname]) + + return ( + + ) +} + +export default Feedback diff --git a/www/apps/cloud/components/Footer/index.tsx b/www/apps/cloud/components/Footer/index.tsx new file mode 100644 index 0000000000..b0c2a250cd --- /dev/null +++ b/www/apps/cloud/components/Footer/index.tsx @@ -0,0 +1,17 @@ +"use client" + +import { Footer as UiFooter } from "docs-ui" +import Feedback from "../Feedback" +import EditButton from "../EditButton" + +const Footer = () => { + return ( + } + editComponent={} + /> + ) +} + +export default Footer diff --git a/www/apps/cloud/components/MDXComponents/index.tsx b/www/apps/cloud/components/MDXComponents/index.tsx new file mode 100644 index 0000000000..8dd8409eb5 --- /dev/null +++ b/www/apps/cloud/components/MDXComponents/index.tsx @@ -0,0 +1,16 @@ +import type { MDXComponents as MDXComponentsType } from "mdx/types" +import { + Link, + MDXComponents as UiMdxComponents, + InlineThemeImage, + InlineIcon, +} from "docs-ui" + +const MDXComponents: MDXComponentsType = { + ...UiMdxComponents, + a: Link, + InlineThemeImage, + InlineIcon, +} + +export default MDXComponents diff --git a/www/apps/cloud/config/index.ts b/www/apps/cloud/config/index.ts new file mode 100644 index 0000000000..caaa9e3bbf --- /dev/null +++ b/www/apps/cloud/config/index.ts @@ -0,0 +1,34 @@ +import { DocsConfig, Sidebar } from "types" +import { generatedSidebars } from "@/generated/sidebar.mjs" +import { globalConfig } from "docs-ui" +import { basePathUrl } from "../utils/base-path-url" + +const baseUrl = process.env.NEXT_PUBLIC_BASE_URL || "http://localhost:3000" + +export const config: DocsConfig = { + ...globalConfig, + titleSuffix: "Medusa Cloud Documentation", + baseUrl, + basePath: process.env.NEXT_PUBLIC_BASE_PATH, + sidebars: generatedSidebars as Sidebar.Sidebar[], + project: { + title: "Cloud", + key: "cloud", + }, + logo: `${process.env.NEXT_PUBLIC_BASE_PATH}/images/logo.png`, + breadcrumbOptions: { + startItems: [ + { + title: "Documentation", + link: baseUrl, + }, + ], + }, + version: { + ...globalConfig.version, + bannerImage: { + light: basePathUrl("/images/get-started-card.png"), + dark: basePathUrl("/images/get-started-card-dark.png"), + }, + }, +} diff --git a/www/apps/cloud/eslint.config.mjs b/www/apps/cloud/eslint.config.mjs new file mode 100644 index 0000000000..21838f2aa2 --- /dev/null +++ b/www/apps/cloud/eslint.config.mjs @@ -0,0 +1,210 @@ +import prettier from "eslint-plugin-prettier/recommended" +import globals from "globals" +import babelParser from "@babel/eslint-parser" +import typescriptEslintEslintPlugin from "@typescript-eslint/eslint-plugin" +import tsParser from "@typescript-eslint/parser" +import path from "node:path" +import { fileURLToPath } from "node:url" +import js from "@eslint/js" +import { FlatCompat } from "@eslint/eslintrc" + +const __filename = fileURLToPath(import.meta.url) +const __dirname = path.dirname(__filename) +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all, +}) + +export default [ + prettier, + { + ignores: [ + "**/eslint-config-docs", + "**/.eslintrc.js", + "**/dist", + "**/next.config.js", + "**/spec", + "**/node_modules", + "**/public", + "**/.eslintrc.js", + "generated", + ], + }, + ...compat.extends( + "eslint:recommended", + "plugin:react/recommended", + "plugin:react/jsx-runtime", + "plugin:react-hooks/recommended", + "plugin:@next/next/recommended" + ), + { + languageOptions: { + globals: { + ...globals.node, + ...globals.jest, + ...globals.browser, + }, + + parser: babelParser, + ecmaVersion: 13, + sourceType: "module", + + parserOptions: { + requireConfigFile: false, + + ecmaFeatures: { + experimentalDecorators: true, + jsx: true, + modules: true, + }, + + project: true, + }, + }, + + settings: { + react: { + version: "detect", + }, + }, + + rules: { + curly: ["error", "all"], + "new-cap": "off", + "require-jsdoc": "off", + "no-unused-expressions": "off", + "no-unused-vars": "off", + camelcase: "off", + "no-invalid-this": "off", + + "max-len": [ + "error", + { + code: 80, + ignoreStrings: true, + ignoreRegExpLiterals: true, + ignoreComments: true, + ignoreTrailingComments: true, + ignoreUrls: true, + ignoreTemplateLiterals: true, + }, + ], + + semi: ["error", "never"], + + quotes: [ + "error", + "double", + { + allowTemplateLiterals: true, + }, + ], + + "comma-dangle": [ + "error", + { + arrays: "always-multiline", + objects: "always-multiline", + imports: "always-multiline", + exports: "always-multiline", + functions: "never", + }, + ], + + "object-curly-spacing": ["error", "always"], + "arrow-parens": ["error", "always"], + "linebreak-style": 0, + + "no-confusing-arrow": [ + "error", + { + allowParens: false, + }, + ], + + "space-before-function-paren": [ + "error", + { + anonymous: "always", + named: "never", + asyncArrow: "always", + }, + ], + + "space-infix-ops": "error", + "eol-last": ["error", "always"], + + "no-console": [ + "error", + { + allow: ["error", "warn"], + }, + ], + + "react/prop-types": [ + 2, + { + ignore: ["className"], + }, + ], + }, + }, + ...compat + .extends( + "plugin:@typescript-eslint/recommended", + "plugin:react/recommended" + ) + .map((config) => ({ + ...config, + files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"], + })), + { + files: ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"], + + plugins: { + "@typescript-eslint": typescriptEslintEslintPlugin, + }, + + languageOptions: { + parser: tsParser, + ecmaVersion: 13, + sourceType: "module", + + parserOptions: { + project: "./tsconfig.json", + }, + }, + + settings: { + next: { + rootDir: ".", + }, + }, + + rules: { + "react/react-in-jsx-scope": "off", + "@typescript-eslint/prefer-ts-expect-error": "off", + "valid-jsdoc": "off", + + "@typescript-eslint/no-non-null-assertion": "off", + "@typescript-eslint/no-floating-promises": "error", + "@typescript-eslint/await-thenable": "error", + "@typescript-eslint/promise-function-async": "error", + "@/keyword-spacing": "error", + + "@/space-before-function-paren": [ + "error", + { + anonymous: "always", + named: "never", + asyncArrow: "always", + }, + ], + + "@/space-infix-ops": "error", + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/no-unused-vars": "warn", + }, + }, +] diff --git a/www/apps/cloud/generated/edit-dates.mjs b/www/apps/cloud/generated/edit-dates.mjs new file mode 100644 index 0000000000..b4befe2269 --- /dev/null +++ b/www/apps/cloud/generated/edit-dates.mjs @@ -0,0 +1,3 @@ +export const generatedEditDates = { + "app/page.mdx": "2025-06-12T07:37:21.748Z" +} \ No newline at end of file diff --git a/www/apps/cloud/generated/sidebar.mjs b/www/apps/cloud/generated/sidebar.mjs new file mode 100644 index 0000000000..3282b293b4 --- /dev/null +++ b/www/apps/cloud/generated/sidebar.mjs @@ -0,0 +1,16 @@ +export const generatedSidebars = [ + { + "sidebar_id": "cloud", + "title": "Cloud", + "items": [ + { + "loaded": true, + "isPathHref": true, + "type": "link", + "path": "/", + "title": "Introduction", + "children": [] + } + ] + } +] \ No newline at end of file diff --git a/www/apps/cloud/mdx-components.tsx b/www/apps/cloud/mdx-components.tsx new file mode 100644 index 0000000000..051343a01b --- /dev/null +++ b/www/apps/cloud/mdx-components.tsx @@ -0,0 +1,17 @@ +import type { MDXComponents } from "mdx/types" +import CustomMDXComponents from "./components/MDXComponents" + +// This file allows you to provide custom React components +// to be used in MDX files. You can import and use any +// React component you want, including components from +// other libraries. + +// This file is required to use MDX in `app` directory. +export function useMDXComponents(components: MDXComponents): MDXComponents { + return { + // Allows customizing built-in components, e.g. to add styling. + // h1: ({ children }) =>

{children}

, + ...components, + ...CustomMDXComponents, + } +} diff --git a/www/apps/cloud/middleware.ts b/www/apps/cloud/middleware.ts new file mode 100644 index 0000000000..45470c2329 --- /dev/null +++ b/www/apps/cloud/middleware.ts @@ -0,0 +1,15 @@ +import { NextResponse } from "next/server" +import type { NextRequest } from "next/server" + +export function middleware(request: NextRequest) { + return NextResponse.rewrite( + new URL( + `${request.nextUrl.basePath}/md-content${request.nextUrl.pathname.replace("/index.html.md", "")}`, + request.url + ) + ) +} + +export const config = { + matcher: "/:path*/index.html.md", +} diff --git a/www/apps/cloud/next.config.mjs b/www/apps/cloud/next.config.mjs new file mode 100644 index 0000000000..3755d9281b --- /dev/null +++ b/www/apps/cloud/next.config.mjs @@ -0,0 +1,139 @@ +import mdx from "@next/mdx" +import path from "path" +import rehypeMdxCodeProps from "rehype-mdx-code-props" +import rehypeSlug from "rehype-slug" +import remarkDirective from "remark-directive" +import remarkFrontmatter from "remark-frontmatter" +import { + brokenLinkCheckerPlugin, + localLinksRehypePlugin, + cloudinaryImgRehypePlugin, + resolveAdmonitionsPlugin, + crossProjectLinksPlugin, + prerequisitesLinkFixerPlugin, + remarkAttachFrontmatterDataPlugin, + recmaInjectMdxDataPlugin, +} from "remark-rehype-plugins" +import bundleAnalyzer from "@next/bundle-analyzer" +import withExtractedTableOfContents from "@stefanprobst/rehype-extract-toc" + +const withMDX = mdx({ + extension: /\.mdx?$/, + options: { + rehypePlugins: [ + [ + brokenLinkCheckerPlugin, + { + crossProjects: { + docs: { + projectPath: path.resolve("..", "book"), + }, + ui: { + projectPath: path.resolve("..", "ui"), + contentPath: "src/content/docs", + }, + resources: { + projectPath: path.resolve("..", "resources"), + hasGeneratedSlugs: true, + }, + api: { + projectPath: path.resolve("..", "api-reference"), + skipSlugValidation: true, + }, + "user-guide": { + projectPath: path.resolve("..", "user-guide"), + }, + }, + }, + ], + [ + crossProjectLinksPlugin, + { + baseUrl: process.env.NEXT_PUBLIC_BASE_URL, + projectUrls: { + docs: { + url: process.env.NEXT_PUBLIC_DOCS_URL, + path: "", + }, + resources: { + url: process.env.NEXT_PUBLIC_RESOURCES_URL, + }, + ui: { + url: process.env.NEXT_PUBLIC_UI_URL, + }, + api: { + url: process.env.NEXT_PUBLIC_API_URL, + }, + "user-guide": { + url: process.env.NEXT_PUBLIC_USER_GUIDE_URL, + }, + }, + useBaseUrl: + process.env.NODE_ENV === "production" || + process.env.VERCEL_ENV === "production", + }, + ], + [localLinksRehypePlugin], + [ + rehypeMdxCodeProps, + { + tagName: "code", + }, + ], + [rehypeSlug], + [ + cloudinaryImgRehypePlugin, + { + cloudinaryConfig: { + cloudName: process.env.CLOUDINARY_CLOUD_NAME || "", + flags: ["fl_lossy", "f_auto"], + resize: { + action: "pad", + aspectRatio: "16:9", + }, + roundCorners: 16, + }, + }, + ], + [ + prerequisitesLinkFixerPlugin, + { + checkLinksType: "value", + }, + ], + [withExtractedTableOfContents], + ], + remarkPlugins: [ + [remarkFrontmatter], + [remarkDirective], + [resolveAdmonitionsPlugin], + [remarkAttachFrontmatterDataPlugin], + ], + recmaPlugins: [[recmaInjectMdxDataPlugin]], + jsx: true, + }, +}) + +/** @type {import('next').NextConfig} */ +const nextConfig = { + // Configure `pageExtensions` to include MDX files + pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"], + + transpilePackages: ["docs-ui"], + basePath: process.env.NEXT_PUBLIC_BASE_PATH || "/cloud", + outputFileTracingIncludes: { + "/md\\-content/\\[\\[\\.\\.\\.slug\\]\\]": ["./app/**/*.mdx"], + }, + outputFileTracingExcludes: { + "*": ["node_modules/@medusajs/icons"], + }, + experimental: { + optimizePackageImports: ["@medusajs/icons", "@medusajs/ui"], + }, +} + +const withBundleAnalyzer = bundleAnalyzer({ + enabled: process.env.ANALYZE === "true", +}) + +export default withMDX(withBundleAnalyzer(nextConfig)) diff --git a/www/apps/cloud/package.json b/www/apps/cloud/package.json new file mode 100644 index 0000000000..7988e1df9f --- /dev/null +++ b/www/apps/cloud/package.json @@ -0,0 +1,57 @@ +{ + "name": "cloud", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "yarn prep && next dev", + "dev:monorepo": "yarn prep && yarn dev -p 3005", + "build": "yarn prep && next build", + "build:dev": "NODE_ENV=test yarn build", + "start": "next start", + "start:monorepo": "yarn start -p 3005", + "lint": "next lint --fix", + "lint:content": "eslint --no-config-lookup -c .content.eslintrc.mjs app/**/*.mdx --fix", + "prep": "node ./scripts/prepare.mjs" + }, + "dependencies": { + "@mdx-js/loader": "^3.1.0", + "@mdx-js/react": "^3.1.0", + "@medusajs/icons": "2.8.4", + "@next/mdx": "15.0.4", + "@stefanprobst/rehype-extract-toc": "^3.0.0", + "clsx": "^2.1.0", + "docs-ui": "*", + "next": "15.0.4", + "react": "rc", + "react-dom": "rc", + "rehype-mdx-code-props": "^2.0.0", + "rehype-slug": "^6.0.0", + "remark-directive": "^3.0.0", + "remark-frontmatter": "^5.0.0", + "remark-rehype-plugins": "*" + }, + "devDependencies": { + "@types/mdx": "^2.0.13", + "@types/node": "^20", + "@types/react": "npm:types-react@rc", + "@types/react-dom": "npm:types-react@rc", + "autoprefixer": "^10.0.1", + "build-scripts": "*", + "eslint": "^9.13.0", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-react-hooks": "^5.0.0", + "postcss": "^8", + "tailwind": "*", + "tailwindcss": "^3.3.0", + "tsconfig": "*", + "types": "*", + "typescript": "^5" + }, + "engines": { + "node": ">=20" + }, + "overrides": { + "@types/react": "npm:types-react@rc", + "@types/react-dom": "npm:types-react-dom@rc" + } +} diff --git a/www/apps/cloud/postcss.config.js b/www/apps/cloud/postcss.config.js new file mode 100644 index 0000000000..73368e608a --- /dev/null +++ b/www/apps/cloud/postcss.config.js @@ -0,0 +1 @@ +module.exports = require("tailwind/postcss.config") diff --git a/www/apps/cloud/providers/index.tsx b/www/apps/cloud/providers/index.tsx new file mode 100644 index 0000000000..6ec76414bc --- /dev/null +++ b/www/apps/cloud/providers/index.tsx @@ -0,0 +1,77 @@ +"use client" + +import { + AiAssistantProvider, + AnalyticsProvider, + ColorModeProvider, + HooksLoader, + LearningPathProvider, + MobileProvider, + ModalProvider, + NotificationProvider, + PaginationProvider, + ScrollControllerProvider, + SiteConfigProvider, +} from "docs-ui" +import SidebarProvider from "./sidebar" +import SearchProvider from "./search" +import { config } from "../config" +import { MainNavProvider } from "./main-nav" + +type ProvidersProps = { + children?: React.ReactNode +} + +const Providers = ({ children }: ProvidersProps) => { + return ( + + + + + + + + + + + + + + + {children} + + + + + + + + + + + + + + + ) +} + +export default Providers diff --git a/www/apps/cloud/providers/main-nav.tsx b/www/apps/cloud/providers/main-nav.tsx new file mode 100644 index 0000000000..cdb5a18040 --- /dev/null +++ b/www/apps/cloud/providers/main-nav.tsx @@ -0,0 +1,28 @@ +"use client" + +import { + getNavDropdownItems, + MainNavProvider as UiMainNavProvider, +} from "docs-ui" +import { useMemo } from "react" +import { config } from "../config" + +type MainNavProviderProps = { + children?: React.ReactNode +} + +export const MainNavProvider = ({ children }: MainNavProviderProps) => { + const navigationDropdownItems = useMemo( + () => + getNavDropdownItems({ + basePath: config.baseUrl, + }), + [] + ) + + return ( + + {children} + + ) +} diff --git a/www/apps/cloud/providers/search.tsx b/www/apps/cloud/providers/search.tsx new file mode 100644 index 0000000000..f5c496142e --- /dev/null +++ b/www/apps/cloud/providers/search.tsx @@ -0,0 +1,52 @@ +"use client" + +import { SearchProvider as UiSearchProvider } from "docs-ui" +import { config } from "../config" + +type SearchProviderProps = { + children: React.ReactNode +} + +const SearchProvider = ({ children }: SearchProviderProps) => { + return ( + + {children} + + ) +} + +export default SearchProvider diff --git a/www/apps/cloud/providers/sidebar.tsx b/www/apps/cloud/providers/sidebar.tsx new file mode 100644 index 0000000000..4a7ac455da --- /dev/null +++ b/www/apps/cloud/providers/sidebar.tsx @@ -0,0 +1,25 @@ +"use client" +import { + SidebarProvider as UiSidebarProvider, + useScrollController, +} from "docs-ui" +import { config } from "@/config" + +type SidebarProviderProps = { + children?: React.ReactNode +} + +const SidebarProvider = ({ children }: SidebarProviderProps) => { + const { scrollableElement } = useScrollController() + + return ( + + {children} + + ) +} + +export default SidebarProvider diff --git a/www/apps/cloud/public/images/ai-assistent-luminosity.png b/www/apps/cloud/public/images/ai-assistent-luminosity.png new file mode 100644 index 0000000000..dc321b5326 Binary files /dev/null and b/www/apps/cloud/public/images/ai-assistent-luminosity.png differ diff --git a/www/apps/cloud/public/images/ai-assistent.png b/www/apps/cloud/public/images/ai-assistent.png new file mode 100644 index 0000000000..69a06999a3 Binary files /dev/null and b/www/apps/cloud/public/images/ai-assistent.png differ diff --git a/www/apps/cloud/public/images/api-key-icon.png b/www/apps/cloud/public/images/api-key-icon.png new file mode 100644 index 0000000000..88d8166f9f Binary files /dev/null and b/www/apps/cloud/public/images/api-key-icon.png differ diff --git a/www/apps/cloud/public/images/auth-icon.png b/www/apps/cloud/public/images/auth-icon.png new file mode 100644 index 0000000000..c3afa03d74 Binary files /dev/null and b/www/apps/cloud/public/images/auth-icon.png differ diff --git a/www/apps/cloud/public/images/cart-icon.png b/www/apps/cloud/public/images/cart-icon.png new file mode 100644 index 0000000000..75a37f623d Binary files /dev/null and b/www/apps/cloud/public/images/cart-icon.png differ diff --git a/www/apps/cloud/public/images/currency-icon.png b/www/apps/cloud/public/images/currency-icon.png new file mode 100644 index 0000000000..fef1c2f7e2 Binary files /dev/null and b/www/apps/cloud/public/images/currency-icon.png differ diff --git a/www/apps/cloud/public/images/customer-icon.png b/www/apps/cloud/public/images/customer-icon.png new file mode 100644 index 0000000000..b1deb68afc Binary files /dev/null and b/www/apps/cloud/public/images/customer-icon.png differ diff --git a/www/apps/cloud/public/images/fulfillment-icon.png b/www/apps/cloud/public/images/fulfillment-icon.png new file mode 100644 index 0000000000..efbf148a01 Binary files /dev/null and b/www/apps/cloud/public/images/fulfillment-icon.png differ diff --git a/www/apps/cloud/public/images/get-started-card-dark.png b/www/apps/cloud/public/images/get-started-card-dark.png new file mode 100644 index 0000000000..cf78ad0c31 Binary files /dev/null and b/www/apps/cloud/public/images/get-started-card-dark.png differ diff --git a/www/apps/cloud/public/images/get-started-card.png b/www/apps/cloud/public/images/get-started-card.png new file mode 100644 index 0000000000..5b05ed9b27 Binary files /dev/null and b/www/apps/cloud/public/images/get-started-card.png differ diff --git a/www/apps/cloud/public/images/inventory-icon.png b/www/apps/cloud/public/images/inventory-icon.png new file mode 100644 index 0000000000..7632438bac Binary files /dev/null and b/www/apps/cloud/public/images/inventory-icon.png differ diff --git a/www/apps/cloud/public/images/logo-dark.png b/www/apps/cloud/public/images/logo-dark.png new file mode 100644 index 0000000000..53559cf37f Binary files /dev/null and b/www/apps/cloud/public/images/logo-dark.png differ diff --git a/www/apps/cloud/public/images/logo-icon-dark.png b/www/apps/cloud/public/images/logo-icon-dark.png new file mode 100644 index 0000000000..1d155bd664 Binary files /dev/null and b/www/apps/cloud/public/images/logo-icon-dark.png differ diff --git a/www/apps/cloud/public/images/logo-icon.png b/www/apps/cloud/public/images/logo-icon.png new file mode 100644 index 0000000000..40efd0a958 Binary files /dev/null and b/www/apps/cloud/public/images/logo-icon.png differ diff --git a/www/apps/cloud/public/images/logo-mobile-dark.png b/www/apps/cloud/public/images/logo-mobile-dark.png new file mode 100644 index 0000000000..7355634572 Binary files /dev/null and b/www/apps/cloud/public/images/logo-mobile-dark.png differ diff --git a/www/apps/cloud/public/images/logo-mobile.png b/www/apps/cloud/public/images/logo-mobile.png new file mode 100644 index 0000000000..4dea6521bd Binary files /dev/null and b/www/apps/cloud/public/images/logo-mobile.png differ diff --git a/www/apps/cloud/public/images/logo.png b/www/apps/cloud/public/images/logo.png new file mode 100644 index 0000000000..edc3ec827d Binary files /dev/null and b/www/apps/cloud/public/images/logo.png differ diff --git a/www/apps/cloud/public/images/magnifying-glass-dark.svg b/www/apps/cloud/public/images/magnifying-glass-dark.svg new file mode 100644 index 0000000000..ae81c809d2 --- /dev/null +++ b/www/apps/cloud/public/images/magnifying-glass-dark.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/www/apps/cloud/public/images/magnifying-glass.svg b/www/apps/cloud/public/images/magnifying-glass.svg new file mode 100644 index 0000000000..c46314a831 --- /dev/null +++ b/www/apps/cloud/public/images/magnifying-glass.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/www/apps/cloud/public/images/order-icon.png b/www/apps/cloud/public/images/order-icon.png new file mode 100644 index 0000000000..8869a30ec8 Binary files /dev/null and b/www/apps/cloud/public/images/order-icon.png differ diff --git a/www/apps/cloud/public/images/payment-icon.png b/www/apps/cloud/public/images/payment-icon.png new file mode 100644 index 0000000000..124d62965d Binary files /dev/null and b/www/apps/cloud/public/images/payment-icon.png differ diff --git a/www/apps/cloud/public/images/pricing-icon.png b/www/apps/cloud/public/images/pricing-icon.png new file mode 100644 index 0000000000..ae0e8ad462 Binary files /dev/null and b/www/apps/cloud/public/images/pricing-icon.png differ diff --git a/www/apps/cloud/public/images/product-icon.png b/www/apps/cloud/public/images/product-icon.png new file mode 100644 index 0000000000..8fdb4f0d0c Binary files /dev/null and b/www/apps/cloud/public/images/product-icon.png differ diff --git a/www/apps/cloud/public/images/promotion-icon.png b/www/apps/cloud/public/images/promotion-icon.png new file mode 100644 index 0000000000..640200620b Binary files /dev/null and b/www/apps/cloud/public/images/promotion-icon.png differ diff --git a/www/apps/cloud/public/images/region-icon.png b/www/apps/cloud/public/images/region-icon.png new file mode 100644 index 0000000000..72fb2b63e6 Binary files /dev/null and b/www/apps/cloud/public/images/region-icon.png differ diff --git a/www/apps/cloud/public/images/sales-channel-icon.png b/www/apps/cloud/public/images/sales-channel-icon.png new file mode 100644 index 0000000000..47867c1508 Binary files /dev/null and b/www/apps/cloud/public/images/sales-channel-icon.png differ diff --git a/www/apps/cloud/public/images/search-hit-arrow-light.svg b/www/apps/cloud/public/images/search-hit-arrow-light.svg new file mode 100644 index 0000000000..8b119c36ec --- /dev/null +++ b/www/apps/cloud/public/images/search-hit-arrow-light.svg @@ -0,0 +1,4 @@ + + + + diff --git a/www/apps/cloud/public/images/search-hit-arrow.svg b/www/apps/cloud/public/images/search-hit-arrow.svg new file mode 100644 index 0000000000..57385383d4 --- /dev/null +++ b/www/apps/cloud/public/images/search-hit-arrow.svg @@ -0,0 +1,4 @@ + + + + diff --git a/www/apps/cloud/public/images/search-hit-light.svg b/www/apps/cloud/public/images/search-hit-light.svg new file mode 100644 index 0000000000..0c8b06d829 --- /dev/null +++ b/www/apps/cloud/public/images/search-hit-light.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/www/apps/cloud/public/images/search-hit.svg b/www/apps/cloud/public/images/search-hit.svg new file mode 100644 index 0000000000..c7ee94e659 --- /dev/null +++ b/www/apps/cloud/public/images/search-hit.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/www/apps/cloud/public/images/search-no-result-light.svg b/www/apps/cloud/public/images/search-no-result-light.svg new file mode 100644 index 0000000000..5de948ec32 --- /dev/null +++ b/www/apps/cloud/public/images/search-no-result-light.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/www/apps/cloud/public/images/search-no-result.svg b/www/apps/cloud/public/images/search-no-result.svg new file mode 100644 index 0000000000..ed49a6f6c6 --- /dev/null +++ b/www/apps/cloud/public/images/search-no-result.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/www/apps/cloud/public/images/stock-location-icon.png b/www/apps/cloud/public/images/stock-location-icon.png new file mode 100644 index 0000000000..61674b2f5b Binary files /dev/null and b/www/apps/cloud/public/images/stock-location-icon.png differ diff --git a/www/apps/cloud/public/images/tax-icon.png b/www/apps/cloud/public/images/tax-icon.png new file mode 100644 index 0000000000..2be16099b4 Binary files /dev/null and b/www/apps/cloud/public/images/tax-icon.png differ diff --git a/www/apps/cloud/public/images/user-icon.png b/www/apps/cloud/public/images/user-icon.png new file mode 100644 index 0000000000..bff05107f0 Binary files /dev/null and b/www/apps/cloud/public/images/user-icon.png differ diff --git a/www/apps/cloud/public/next.svg b/www/apps/cloud/public/next.svg new file mode 100644 index 0000000000..5174b28c56 --- /dev/null +++ b/www/apps/cloud/public/next.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/apps/cloud/public/vercel.svg b/www/apps/cloud/public/vercel.svg new file mode 100644 index 0000000000..d2f8422273 --- /dev/null +++ b/www/apps/cloud/public/vercel.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/www/apps/cloud/scripts/prepare.mjs b/www/apps/cloud/scripts/prepare.mjs new file mode 100644 index 0000000000..325404f5a8 --- /dev/null +++ b/www/apps/cloud/scripts/prepare.mjs @@ -0,0 +1,9 @@ +import { generateEditedDates, generateSidebar } from "build-scripts" +import { sidebar } from "../sidebar.mjs" + +async function main() { + await generateSidebar(sidebar) + await generateEditedDates() +} + +void main() diff --git a/www/apps/cloud/sidebar.mjs b/www/apps/cloud/sidebar.mjs new file mode 100644 index 0000000000..88bd899a35 --- /dev/null +++ b/www/apps/cloud/sidebar.mjs @@ -0,0 +1,14 @@ +/** @type {import('types').Sidebar.RawSidebar[]} */ +export const sidebar = [ + { + sidebar_id: "cloud", + title: "Cloud", + items: [ + { + type: "link", + path: "/", + title: "Introduction", + }, + ], + }, +] diff --git a/www/apps/cloud/tailwind.config.js b/www/apps/cloud/tailwind.config.js new file mode 100644 index 0000000000..d582b22247 --- /dev/null +++ b/www/apps/cloud/tailwind.config.js @@ -0,0 +1,37 @@ +import coreConfig from "tailwind" + +/** @type {import('tailwindcss').Config} */ +module.exports = { + ...coreConfig, + content: [ + ...coreConfig.content, + "./pages/**/*.{js,ts,jsx,tsx,mdx}", + "./components/**/*.{js,ts,jsx,tsx,mdx}", + "./app/**/*.{js,ts,jsx,tsx,mdx}", + "./layouts/**/*.{js,ts,jsx,tsx,mdx}", + "./providers/**/*.{js,ts,jsx,tsx,mdx}", + ], + theme: { + ...coreConfig.theme, + extend: { + ...coreConfig.theme.extend, + container: { + center: true, + screens: { + "2xl": "1400px", + }, + }, + }, + backgroundImage: { + ...coreConfig.theme.backgroundImage, + "search-hit": "url('/images/search-hit-light.svg')", + "search-hit-dark": "url('/images/search-hit.svg')", + "search-arrow": "url('/images/search-hit-arrow-light.svg')", + "search-arrow-dark": "url('/images/search-hit-arrow.svg')", + "search-no-result": "url('/images/search-no-result-light.svg')", + "search-no-result-dark": "url('/images/search-no-result.svg')", + "magnifying-glass": "url('/images/magnifying-glass.svg')", + "magnifying-glass-dark": "url('/images/magnifying-glass-dark.svg')", + }, + }, +} diff --git a/www/apps/cloud/tsconfig.json b/www/apps/cloud/tsconfig.json new file mode 100644 index 0000000000..69f731d677 --- /dev/null +++ b/www/apps/cloud/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "tsconfig/nextjs.json", + "compilerOptions": { + "paths": { + "@/*": [ + "./*" + ] + }, + "jsx": "preserve", + }, + "include": [ + "next-env.d.ts", + "**/*.tsx", + "**/*.ts", + "**/*.js", + ".next/types/**/*.ts", + "**/*.mjs" + ] +} diff --git a/www/apps/cloud/utils/base-path-url.ts b/www/apps/cloud/utils/base-path-url.ts new file mode 100644 index 0000000000..b8584730ad --- /dev/null +++ b/www/apps/cloud/utils/base-path-url.ts @@ -0,0 +1,5 @@ +import { getLinkWithBasePath } from "docs-ui" + +export function basePathUrl(path = "") { + return getLinkWithBasePath(path, process.env.NEXT_PUBLIC_BASE_PATH) +} diff --git a/www/apps/cloud/vercel.json b/www/apps/cloud/vercel.json new file mode 100644 index 0000000000..323833758c --- /dev/null +++ b/www/apps/cloud/vercel.json @@ -0,0 +1,7 @@ +{ + "framework": "nextjs", + "installCommand": "yarn install", + "buildCommand": "turbo run build", + "outputDirectory": ".next", + "ignoreCommand": "bash ../../ignore-build-script.sh" +} \ No newline at end of file diff --git a/www/apps/resources/.env.sample b/www/apps/resources/.env.sample index 9b5052bb66..48b30d7f8d 100644 --- a/www/apps/resources/.env.sample +++ b/www/apps/resources/.env.sample @@ -10,6 +10,7 @@ NEXT_PUBLIC_DOCS_URL= NEXT_PUBLIC_USER_GUIDE_URL= NEXT_PUBLIC_UI_URL= NEXT_PUBLIC_API_URL= +NEXT_PUBLIC_CLOUD_URL= NEXT_PUBLIC_DOCS_V1_URL= ALGOLIA_WRITE_API_KEY= ANALYZE_BUNDLE= diff --git a/www/apps/resources/app/deployment/page.mdx b/www/apps/resources/app/deployment/page.mdx index 5d017e856c..93cc908c49 100644 --- a/www/apps/resources/app/deployment/page.mdx +++ b/www/apps/resources/app/deployment/page.mdx @@ -8,25 +8,25 @@ export const metadata = { Find guides to deploy your Medusa application, Medusa Admin, and Next.js Starter Storefront. -## Medusa Cloud +## Cloud -Medusa Cloud is our managed services offering for Medusa applications. Medusa Cloud hosts your server, Admin dashboard, database, and Redis instance. The infrastructure is security-compliant and optimized for Medusa and supports: +Cloud is our managed services offering for Medusa applications. Cloud hosts your server, Admin dashboard, database, and Redis instance. The infrastructure is security-compliant and optimized for Medusa and supports: - Zero configuration. - Built-in autoscaling. - Deploy to regions around the world. - 99.99% uptime guarantee. -With Medusa Cloud, you maintain full customization control as you deploy your own modules and customizations directly from GitHub: +With Cloud, you maintain full customization control as you deploy your own modules and customizations directly from GitHub: - Push to deploy. - Multiple testing environments. - Preview environments for new PRs. - Test on production-like data. -Medusa Cloud users also gets early access to new features (for example, Gift Cards and Draft Orders). +Cloud users also gets early access to new features (for example, Gift Cards and Draft Orders). -[Sign up and learn more about Medusa Cloud](https://medusajs.com/pricing/) +[Sign up and learn more about Cloud](https://medusajs.com/pricing/) --- diff --git a/www/apps/resources/app/how-to-tutorials/tutorials/loyalty-points/page.mdx b/www/apps/resources/app/how-to-tutorials/tutorials/loyalty-points/page.mdx index 92e962dfaf..af78cda5a7 100644 --- a/www/apps/resources/app/how-to-tutorials/tutorials/loyalty-points/page.mdx +++ b/www/apps/resources/app/how-to-tutorials/tutorials/loyalty-points/page.mdx @@ -31,7 +31,7 @@ In this tutorial, you'll learn how to implement a loyalty points system in Medus -Medusa Cloud provides a beta Store Credits feature that facilitates building a loyalty point system. [Get in touch](https://medusajs.com/contact) for early access. +Cloud provides a beta Store Credits feature that facilitates building a loyalty point system. [Get in touch](https://medusajs.com/contact) for early access. diff --git a/www/apps/resources/app/infrastructure-modules/file/s3/page.mdx b/www/apps/resources/app/infrastructure-modules/file/s3/page.mdx index d3c7061f1e..645cb4ecb8 100644 --- a/www/apps/resources/app/infrastructure-modules/file/s3/page.mdx +++ b/www/apps/resources/app/infrastructure-modules/file/s3/page.mdx @@ -13,7 +13,7 @@ The S3 File Module Provider integrates Amazon S3 and services following a compat -Medusa Cloud offers a managed file storage solution with AWS S3 for your Medusa application. Contact the [sales team](https://medusajs.com/pricing/) to learn more. +Cloud offers a managed file storage solution with AWS S3 for your Medusa application. Contact the [sales team](https://medusajs.com/pricing/) to learn more. diff --git a/www/apps/resources/app/recipes/ecommerce/page.mdx b/www/apps/resources/app/recipes/ecommerce/page.mdx index 04761654d1..9b9d73616a 100644 --- a/www/apps/resources/app/recipes/ecommerce/page.mdx +++ b/www/apps/resources/app/recipes/ecommerce/page.mdx @@ -60,9 +60,9 @@ For example, you can integrate [Stripe](../../commerce-modules/payment/payment-p ## Deploy the Medusa Application -The most efficient way to deploy your Medusa application is to use [Medusa Cloud](https://medusajs.com/pricing). Medusa Cloud is our managed services offering that makes deploying and operating Medusa applications possible without having to worry about configuring, scaling, and maintaining infrastructure. Medusa Cloud hosts your server, Admin dashboard, database, and Redis instance. +The most efficient way to deploy your Medusa application is to use [Cloud](https://medusajs.com/pricing). Cloud is our managed services offering that makes deploying and operating Medusa applications possible without having to worry about configuring, scaling, and maintaining infrastructure. Cloud hosts your server, Admin dashboard, database, and Redis instance. -With Medusa Cloud, you maintain full customization control as you deploy your own modules and customizations directly from GitHub: +With Cloud, you maintain full customization control as you deploy your own modules and customizations directly from GitHub: - Push to deploy. - Multiple testing environments. @@ -74,8 +74,8 @@ Our documentation also provides a step-by-step guides to deploy your Medusa appl