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:
6
.changeset/nine-brooms-try.md
Normal file
6
.changeset/nine-brooms-try.md
Normal 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
|
||||
2
.github/workflows/generate-docblocks.yml
vendored
2
.github/workflows/generate-docblocks.yml
vendored
@@ -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 }}
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"packages/modules/providers/*",
|
||||
"packages/core/*",
|
||||
"packages/cli/*",
|
||||
"packages/cli/oas/*",
|
||||
"packages/medusa-js",
|
||||
"packages/medusa-react",
|
||||
"packages/*",
|
||||
|
||||
@@ -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, `../../`)
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
/**
|
||||
|
||||
@@ -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 ? [
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user