fix(medusa-oas-cli, oas-github-ci): updated paths to docs directories following monorepo reorganization (#7245)

* fix(medusa-oas-cli, oas-github-ci): updated paths to docs directories following monorepo reorganization

* revert change to workspaces

* change oas in workspaces

* revert change in test script
This commit is contained in:
Shahed Nasser
2024-05-06 16:15:38 +03:00
committed by GitHub
parent 4e12168dbd
commit 651b953db7
9 changed files with 2168 additions and 225 deletions

View File

@@ -0,0 +1,6 @@
---
"@medusajs/medusa-oas-cli": patch
"@medusajs/oas-github-ci": patch
---
fix(medusa-oas-cli, oas-github-ci): updated paths to docs directories following monorepo reorganization

View File

@@ -97,7 +97,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"
run: "yarn start run ../../../../packages/medusa/src/api-v2 --type oas && yarn start clean:oas"
working-directory: www/utils/packages/docblock-generator
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -8,6 +8,7 @@
"packages/modules/providers/*",
"packages/core/*",
"packages/cli/*",
"packages/cli/oas/*",
"packages/medusa-js",
"packages/medusa-react",
"packages/*",

View File

@@ -16,7 +16,7 @@ import execa from "execa"
* For now, we only use it if the --v2 flag it passed to the CLI tool.
*/
const oasOutputPath = path.resolve(
__dirname, "..", "..", "..", "..", "docs-util", "oas-output"
__dirname, "..", "..", "..", "..", "..", "..", "www", "utils", "generated", "oas-output"
)
const basePath = path.resolve(__dirname, `../../`)

View File

@@ -12,7 +12,7 @@ import {
} from "./utils/circular-patch-utils"
import { getTmpDirectory, isFile } from "./utils/fs-utils"
import { readJson } from "./utils/json-utils"
import { jsonFileToYamlFile, readYaml, writeYaml, writeYamlFromJson } from "./utils/yaml-utils"
import { readYaml, writeYaml, writeYamlFromJson } from "./utils/yaml-utils"
import yargs from "yargs"
/**

View File

@@ -55,7 +55,7 @@ export const commandOptions: Option[] = [
new Option("-F, --force", "Ignore OAS validation and output OAS files."),
new Option(
"--v2",
"Generate OAS files for V2 endpoints. This loads OAS from docs-util/oas-output/operations directory"
"Generate OAS files for V2 endpoints. This loads OAS from www/utils/generated/oas-output/operations directory"
),
new Option(
"--local",
@@ -157,7 +157,7 @@ async function getOASFromCodebase(
* For now, we only use it if the --v2 flag it passed to the CLI tool.
*/
const oasOutputPath = path.resolve(
__dirname, "..", "..", "..", "..", "docs-util", "oas-output"
__dirname, "..", "..", "..", "..", "..", "www", "utils", "generated", "oas-output"
)
const gen = await swaggerInline(
v2 ? [

View File

@@ -16,8 +16,8 @@
"license": "MIT",
"scripts": {
"ci": "node scripts/build-openapi.js",
"preview:admin": "yarn medusa-oas docs --src-file ../../../docs/api/admin/openapi.yaml --preview",
"preview:store": "yarn medusa-oas docs --src-file ../../../docs/api/store/openapi.yaml --preview",
"preview:admin": "yarn medusa-oas docs --src-file ../../../../www/apps/api-reference/specs/admin/openapi.yaml --preview",
"preview:store": "yarn medusa-oas docs --src-file ../../../../www/apps/api-reference/specs/store/openapi.yaml --preview",
"test": "jest --passWithNoTests"
},
"dependencies": {

View File

@@ -9,7 +9,7 @@ const isDryRun = process.argv.indexOf("--dry-run") !== -1
const withFullFile = process.argv.indexOf("--with-full-file") !== -1
const v2 = process.argv.indexOf("--v2") !== -1
const basePath = path.resolve(__dirname, `../`)
const repoRootPath = path.resolve(basePath, `../../../`)
const repoRootPath = path.resolve(basePath, `../../../../`)
const docsApiPath = v2 ? path.resolve(repoRootPath, "www/apps/api-reference/specs-v2") :
path.resolve(repoRootPath, "www/apps/api-reference/specs")

2370
yarn.lock

File diff suppressed because it is too large Load Diff