Skip to content

Commit

Permalink
chore: move docs-util to www (medusajs#7232)
Browse files Browse the repository at this point in the history
* reorganize docs apps

* add README

* fix directory

* add condition for old docs

* move docs-util to www

* remove remaining docs-util

* fixes of paths

* fix scripts

* path fixes

* fix github actions

* add build packages script
  • Loading branch information
shahednasser authored May 6, 2024
1 parent cf9605f commit b39de05
Show file tree
Hide file tree
Showing 607 changed files with 183 additions and 254 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs-freshness-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:

- name: Install Workspace dependencies
run: yarn install
working-directory: docs-util
working-directory: www/utils

- name: Perform Freshness Check
run: yarn check:freshness
working-directory: docs-util/packages/scripts
working-directory: www/utils/packages/scripts
59 changes: 44 additions & 15 deletions .github/workflows/docs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ jobs:
- name: Build Doc Apps
working-directory: www
run: yarn build
env:
NEXT_PUBLIC_BASE_URL: "http://localhost:3000"
NEXT_PUBLIC_DOCS_URL: "https://medusa-docs.vercel.app"
NEXT_PUBLIC_UI_URL: "https://docs-ui.vercel.app"
# TODO change once we have actual URLs
NEXT_PUBLIC_RESOURCES_URL: "http://example.com"
NEXT_PUBLIC_USER_GUIDE_URL: "http://example.com"

vale-book:
if: ${{ startsWith(github.head_ref, 'docs/') }}
Expand All @@ -52,13 +59,13 @@ jobs:
with:
fetch-depth: 0

- name: Install docs-util Dependencies
- name: Install www/utils Dependencies
run: yarn
working-directory: docs-util
working-directory: www/utils

- name: Build packages
run: yarn build
working-directory: docs-util
working-directory: www/utils

# reviewdog throws an error when the number
# of file changes in a PR is > 300, so
Expand All @@ -67,7 +74,7 @@ jobs:
# less than 300. This is to avoid a PR hanging in
# an error state
- name: Get PR files number
working-directory: docs-util/packages/scripts
working-directory: www/utils/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
id: pr-files

Expand All @@ -78,6 +85,7 @@ jobs:
id: directories

- name: Vale Linter
if: ${{ steps.pr-files.outputs.files_lt_threshold == 'true' }}
uses: errata-ai/vale-action@reviewdog
with:
files: ${{ steps.directories.outputs.LIST }}
Expand All @@ -103,14 +111,22 @@ jobs:
with:
fetch-depth: 0

- 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: docs-util/packages/scripts
working-directory: www/utils/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
id: pr-files

Expand All @@ -121,6 +137,7 @@ jobs:

- 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
Expand All @@ -145,14 +162,22 @@ jobs:
with:
fetch-depth: 0

- 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: docs-util/packages/scripts
working-directory: www/utils/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
id: pr-files

Expand All @@ -162,8 +187,8 @@ jobs:
id: directories

- name: Vale Linter
if: ${{ steps.pr-files.outputs.files_lt_threshold == 'true' }}
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
Expand All @@ -188,13 +213,13 @@ jobs:
with:
fetch-depth: 0

- name: Install docs-util Dependencies
- name: Install www/utils Dependencies
run: yarn
working-directory: docs-util
working-directory: www/utils

- name: Build packages
run: yarn build
working-directory: docs-util
working-directory: www/utils

# reviewdog throws an error when the number
# of file changes in a PR is > 300, so
Expand All @@ -203,7 +228,7 @@ jobs:
# less than 300. This is to avoid a PR hanging in
# an error state
- name: Get PR files number
working-directory: docs-util/packages/scripts
working-directory: www/utils/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
id: pr-files

Expand Down Expand Up @@ -240,13 +265,13 @@ jobs:
with:
fetch-depth: 0

- name: Install docs-util Dependencies
- name: Install www/utils Dependencies
run: yarn
working-directory: docs-util
working-directory: www/utils

- name: Build packages
run: yarn build
working-directory: docs-util
working-directory: www/utils

# reviewdog throws an error when the number
# of file changes in a PR is > 300, so
Expand All @@ -255,7 +280,7 @@ jobs:
# less than 300. This is to avoid a PR hanging in
# an error state
- name: Get PR files number
working-directory: docs-util/packages/scripts
working-directory: www/utils/packages/scripts
run: 'yarn check:pr-files-count ${{ github.ref_name }}'
id: pr-files

Expand Down Expand Up @@ -321,6 +346,10 @@ jobs:
working-directory: www
run: yarn install

- name: Build packages
working-directory: www
run: yarn build:packages

- name: Run Eslint
working-directory: www
run: yarn lint
14 changes: 7 additions & 7 deletions .github/workflows/generate-docblocks-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
workflow_dispatch:
inputs:
referenceName:
description: 'Reference to Generate. Use either `all` or a name of a config file in `docs-util/packages/typedoc-config` such as `product`.'
description: 'Reference to Generate. Use either `all` or a name of a config file in `www/utils/packages/typedoc-config` such as `product`.'
required: false
default: 'all'

Expand Down Expand Up @@ -48,30 +48,30 @@ jobs:

- name: Install Workspace dependencies
run: yarn install
working-directory: docs-util
working-directory: www/utils

- name: Build Workspace dependencies
run: yarn build
working-directory: docs-util
working-directory: www/utils

- name: Generate References
if: ${{ github.event_name == 'workflow_dispatch' }}
run: "yarn start generate ${{ github.event.inputs.referenceName }} --merge"
working-directory: docs-util/packages/typedoc-generate-references
working-directory: www/utils/packages/typedoc-generate-references

- name: Generate References
if: ${{ github.event_name != 'workflow_dispatch' }}
run: "yarn start generate all --merge"
working-directory: docs-util/packages/typedoc-generate-references
working-directory: www/utils/packages/typedoc-generate-references

- name: Generate Changeset
run: "yarn generate:changeset"
working-directory: docs-util/packages/scripts
working-directory: www/utils/packages/scripts

- name: Get PR Message
id: pr-message
run: yarn generate:message
working-directory: docs-util/packages/scripts
working-directory: www/utils/packages/scripts

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/generate-docblocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ jobs:
- name: Install Dependencies
run: yarn

- name: Install docs-util Dependencies
- name: Install www/utils Dependencies
run: yarn
working-directory: docs-util
working-directory: www/utils

- name: Build packages
run: yarn build
working-directory: docs-util
working-directory: www/utils

- name: Check Commit
id: check-commit
run: 'yarn check:release-commit ${{ github.sha }}'
working-directory: docs-util/packages/scripts
working-directory: www/utils/packages/scripts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_OWNER: ${{ github.repository_owner }}
Expand All @@ -42,7 +42,7 @@ jobs:
- name: Run docblock generator
if: steps.check-commit.outputs.is_release_commit == 'true'
run: "yarn start run:release"
working-directory: docs-util/packages/docblock-generator
working-directory: www/utils/packages/docblock-generator
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_OWNER: ${{ github.repository_owner }}
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Generate Changeset
if: steps.check-commit.outputs.is_release_commit == 'true'
run: "yarn generate:changeset"
working-directory: docs-util/packages/scripts
working-directory: www/utils/packages/scripts

- name: Create Pull Request
if: steps.check-commit.outputs.is_release_commit == 'true'
Expand All @@ -78,18 +78,18 @@ jobs:
- name: Install Dependencies
run: yarn

- name: Install docs-util Dependencies
- name: Install www/utils Dependencies
run: yarn
working-directory: docs-util
working-directory: www/utils

- name: Build packages
run: yarn build
working-directory: docs-util
working-directory: www/utils

- name: Check Commit
id: check-commit
run: 'yarn check:release-commit ${{ github.sha }}'
working-directory: docs-util/packages/scripts
working-directory: www/utils/packages/scripts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_OWNER: ${{ github.repository_owner }}
Expand All @@ -98,7 +98,7 @@ jobs:
- name: Run docblock generator
if: steps.check-commit.outputs.is_release_commit == 'true'
run: "yarn start run ../../../packages/medusa/src/api-v2 --type oas && yarn start clean:oas"
working-directory: docs-util/packages/docblock-generator
working-directory: www/utils/packages/docblock-generator
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_OWNER: ${{ github.repository_owner }}
Expand All @@ -113,4 +113,4 @@ jobs:
title: "chore(docs): Generated OAS"
body: "This PR holds all generated OAS for the upcoming release."
branch: "chore/generate-oas"
add-paths: docs-util/oas-output/**
add-paths: www/utils/generated/oas-output/**
20 changes: 10 additions & 10 deletions .github/workflows/generate-public-references.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ jobs:
- name: Generate API Reference
run: yarn openapi:generate

- name: Install and Build docs-util dependencies
- name: Install and Build www/utils dependencies
run: yarn && yarn build
working-directory: docs-util
working-directory: www/utils

- name: Generate Changeset
run: "yarn generate:changeset"
working-directory: docs-util/packages/scripts
working-directory: www/utils/packages/scripts

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
Expand Down Expand Up @@ -92,13 +92,13 @@ jobs:
- name: Generate API Reference (v2)
run: yarn openapi:generate --v2

- name: Install and Build docs-util dependencies
- name: Install and Build www/utils dependencies
run: yarn && yarn build
working-directory: docs-util
working-directory: www/utils

- name: Generate Changeset
run: "yarn generate:changeset"
working-directory: docs-util/packages/scripts
working-directory: www/utils/packages/scripts

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
Expand Down Expand Up @@ -141,19 +141,19 @@ jobs:

- name: Install Workspace dependencies
run: yarn install
working-directory: docs-util
working-directory: www/utils

- name: Build Workspace dependencies
run: yarn build
working-directory: docs-util
working-directory: www/utils

- name: Generate UI Specs
run: yarn generate:ui
working-directory: docs-util/packages/react-docs-generator
working-directory: www/utils/packages/react-docs-generator

- name: Generate Changeset
run: "yarn generate:changeset"
working-directory: docs-util/packages/scripts
working-directory: www/utils/packages/scripts

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
Expand Down
10 changes: 0 additions & 10 deletions docs-util/packages/typedoc-config/_models.js

This file was deleted.

8 changes: 0 additions & 8 deletions docs-util/packages/typedoc-config/api-key-models.js

This file was deleted.

Loading

0 comments on commit b39de05

Please sign in to comment.