Skip to content

Commit

Permalink
chore: fix OAS circular dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser committed Jun 12, 2024
1 parent 3693f61 commit d6d4b26
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/generate-docblocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ jobs:

- name: Run docblock generator
if: steps.check-commit.outputs.is_release_commit == 'true'
run: "yarn start run ../../../../packages/medusa/src/api --type oas && yarn start clean:oas"
working-directory: www/utils/packages/docblock-generator
run: "yarn generate:oas"
working-directory: www/utils
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_OWNER: ${{ github.repository_owner }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/generate-resources-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ jobs:

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

- name: Generate Sidebar and File Map
run: "yarn prep"
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@ decorators:
- ProductCategoryResponse
AdminShippingOption:
- AdminShippingOption
AdminProductCategory:
- AdminProductCategory
- AdminProduct
BaseProduct:
- BaseProduct
StoreProduct:
- StoreProductCategory

# Similar config to /www/docs/docusaurus.config.js > redocusaurus
# Allows to emulate rendering of API public documentation when using `yarn redocly preview-docs openapi.yaml`
Expand Down
4 changes: 3 additions & 1 deletion www/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"scripts": {
"build": "turbo run build",
"watch": "turbo run watch",
"lint": "turbo run lint"
"lint": "turbo run lint",
"generate:references": "turbo run generate:references",
"generate:oas": "turbo run generate:oas"
},
"dependencies": {
"@babel/core": "^7.23.0",
Expand Down
3 changes: 2 additions & 1 deletion www/utils/packages/docblock-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"start": "node dist/index.js",
"build": "tsc",
"watch": "tsc --watch",
"prepublishOnly": "cross-env NODE_ENV=production tsc --build"
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"generate:oas": "yarn start run ../../../../packages/medusa/src/api --type oas && yarn start clean:oas"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion www/utils/packages/typedoc-generate-references/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"start": "node dist/index.js",
"build": "tsc",
"watch": "tsc --watch",
"prepublishOnly": "cross-env NODE_ENV=production tsc --build"
"prepublishOnly": "cross-env NODE_ENV=production tsc --build",
"generate:references": "yarn start generate all --merge"
},
"publishConfig": {
"access": "public"
Expand Down
12 changes: 11 additions & 1 deletion www/utils/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
]
},
"lint": { },
"watch": { }
"watch": { },
"generate:references": {
"dependsOn": [
"^build"
]
},
"generate:oas": {
"dependsOn": [
"^build"
]
}
}
}

0 comments on commit d6d4b26

Please sign in to comment.