chore(): start moving some packages to the core directory (#7215)

This commit is contained in:
Adrien de Peretti authored and GitHub committed 2024-05-03 13:37:41 +02:00
1 parent fdee748eed
commit bbccd6481d
1436 files changed
+275 -756

No files matched your search

@@ -0,0 +1,6 @@
/dist
node_modules
.DS_store
.env*
.env
*.sql
+279
View File
@@ -0,0 +1,279 @@
# @medusajs/oas-github-ci
## 1.0.27
### Patch Changes
- [#6812](https://github.com/medusajs/medusa/pull/6812) [`e005987adf`](https://github.com/medusajs/medusa/commit/e005987adf2a2dd8c2748e7abc360cc93e7c05ad) Thanks [@shahednasser](https://github.com/shahednasser)! - fix(medusa-oas-cli): fix tool not working in Medusa backends
- Updated dependencies [[`e005987adf`](https://github.com/medusajs/medusa/commit/e005987adf2a2dd8c2748e7abc360cc93e7c05ad)]:
- @medusajs/medusa-oas-cli@0.3.2
## 1.0.26
### Patch Changes
- [#6338](https://github.com/medusajs/medusa/pull/6338) [`374a3f4dab`](https://github.com/medusajs/medusa/commit/374a3f4dab7bf893ba3c579fa7f9c346fa30ad64) Thanks [@shahednasser](https://github.com/shahednasser)! - feat(@medusajs/medusa-oas-cli): added v2 flag
feat(@medusajs/oas-github-ci): added v2 flag
- [#6710](https://github.com/medusajs/medusa/pull/6710) [`bb87db8342`](https://github.com/medusajs/medusa/commit/bb87db83424e2625e273fd5cf06cece37245b6da) Thanks [@shahednasser](https://github.com/shahednasser)! - feat(oas-github-ci): output specs into `specs-v2` directory when the `--v2` option is passed
- Updated dependencies [[`374a3f4dab`](https://github.com/medusajs/medusa/commit/374a3f4dab7bf893ba3c579fa7f9c346fa30ad64)]:
- @medusajs/medusa-oas-cli@0.3.1
## 1.0.25
### Patch Changes
- Updated dependencies [[`e84847be3`](https://github.com/medusajs/medusa/commit/e84847be36c88c5bd8e49e1e8aca734ce941a7c2)]:
- @medusajs/medusa-oas-cli@0.3.0
## 1.0.24
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.24
## 1.0.23
### Patch Changes
- [#5453](https://github.com/medusajs/medusa/pull/5453) [`c1b97050a`](https://github.com/medusajs/medusa/commit/c1b97050ab801c6b5702311f777ebd7f98080a97) Thanks [@shahednasser](https://github.com/shahednasser)! - feat(medusa-oas-cli): Added `--main-file-name` option to specify output file name
feat(oas-github-ci): Added `--with-full-file"` option to output both split and full files
- Updated dependencies [[`c1b97050a`](https://github.com/medusajs/medusa/commit/c1b97050ab801c6b5702311f777ebd7f98080a97)]:
- @medusajs/medusa-oas-cli@0.2.23
## 1.0.22
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.22
## 1.0.21
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.21
## 1.0.20
### Patch Changes
- [#5174](https://github.com/medusajs/medusa/pull/5174) [`fa7c94b4c`](https://github.com/medusajs/medusa/commit/fa7c94b4ccf864d7a6c7ed4bba26b7086ed99b2f) Thanks [@shahednasser](https://github.com/shahednasser)! - feat(@medusajs/oas-github-ci): changed output path to match new docs workspace
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.20
## 1.0.19
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.19
## 1.0.18
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.18
## 1.0.17
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.17
## 1.0.16
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.16
## 1.0.15
### Patch Changes
- [#4770](https://github.com/medusajs/medusa/pull/4770) [`914d773d3`](https://github.com/medusajs/medusa/commit/914d773d3a82c86685b66c0c33ab1d7a9bad7dd4) Thanks [@shahednasser](https://github.com/shahednasser)! - feat(@medusajs/oas-github-ci): Improvements for custom API reference
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.15
## 1.0.14
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.14
## 1.0.13
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.13
## 1.0.12
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.12
## 1.0.11
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.11
## 1.0.10
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.10
## 1.0.9
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.9
## 1.0.8
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.8
## 1.0.7
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.7
## 1.0.6
### Patch Changes
- Updated dependencies [[`cfcd2d54f`](https://github.com/medusajs/medusa/commit/cfcd2d54fd281fd98de881fc6dfbcc6b1b47c855)]:
- @medusajs/medusa-oas-cli@0.2.6
## 1.0.5
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.5
## 1.0.4
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.4
## 1.0.3
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.3
## 1.0.2
### Patch Changes
- Updated dependencies [[`1456056e8`](https://github.com/medusajs/medusa/commit/1456056e8f9d48cc1cb64c1836a6de5d5b263b05)]:
- @medusajs/medusa-oas-cli@0.2.2
## 1.0.2
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.1
## 1.0.1
### Patch Changes
- [#3410](https://github.com/medusajs/medusa/pull/3410) [`8ed67d2d7`](https://github.com/medusajs/medusa/commit/8ed67d2d7d36da2d0cb3541e42bba1770aefc60a) Thanks [@olivermrbl](https://github.com/olivermrbl)! - fix(admin,oas-github-cli): Change public config to private to avoid publishing attempts + include `setup/` in npm release for `admin-ui`
- Updated dependencies [[`813706190`](https://github.com/medusajs/medusa/commit/8137061908d20314314b95d049b966a624e7123d), [`377b9ce8c`](https://github.com/medusajs/medusa/commit/377b9ce8c27cb2c4d10d154c005c7553c173c0e8), [`1c40346e9`](https://github.com/medusajs/medusa/commit/1c40346e9e56718de4a6e2d5c2d52abd388343e3), [`53c4a43ca`](https://github.com/medusajs/medusa/commit/53c4a43ca2b2c04920dc6f38e07348e7dfc23195), [`966aea65c`](https://github.com/medusajs/medusa/commit/966aea65c221403bf316ae7665cc8f73bccd9c38)]:
- @medusajs/medusa-oas-cli@0.2.0
## 1.0.1-rc.8
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.0-rc.8
## 1.0.1-rc.7
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.0-rc.7
## 1.0.1-rc.6
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.0-rc.6
## 1.0.1-rc.5
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.0-rc.5
## 1.0.1-rc.4
### Patch Changes
- Updated dependencies [[`377b9ce8c`](https://github.com/medusajs/medusa/commit/377b9ce8c27cb2c4d10d154c005c7553c173c0e8)]:
- @medusajs/medusa-oas-cli@0.2.0-rc.4
## 1.0.1-rc.3
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.0-rc.3
## 1.0.1-rc.2
### Patch Changes
- Updated dependencies []:
- @medusajs/medusa-oas-cli@0.2.0-rc.2
## 1.0.1-rc.1
### Patch Changes
- Updated dependencies [[`53c4a43ca`](https://github.com/medusajs/medusa/commit/53c4a43ca2b2c04920dc6f38e07348e7dfc23195)]:
- @medusajs/medusa-oas-cli@0.2.0-rc.1
## 1.0.1-rc.0
### Patch Changes
- [#3410](https://github.com/medusajs/medusa/pull/3410) [`8ed67d2d7`](https://github.com/medusajs/medusa/commit/8ed67d2d7d36da2d0cb3541e42bba1770aefc60a) Thanks [@olivermrbl](https://github.com/olivermrbl)! - fix(admin,oas-github-cli): Change public config to private to avoid publishing attempts + include `setup/` in npm release for `admin-ui`
- Updated dependencies [[`813706190`](https://github.com/medusajs/medusa/commit/8137061908d20314314b95d049b966a624e7123d), [`1c40346e9`](https://github.com/medusajs/medusa/commit/1c40346e9e56718de4a6e2d5c2d52abd388343e3), [`966aea65c`](https://github.com/medusajs/medusa/commit/966aea65c221403bf316ae7665cc8f73bccd9c38)]:
- @medusajs/medusa-oas-cli@0.2.0-rc.0
## 1.0.0
+3
View File
@@ -0,0 +1,3 @@
# oas-github-ci - 1.0.0
Script used in CI for validating OAS documentation.
@@ -0,0 +1,27 @@
{
"name": "@medusajs/oas-github-ci",
"version": "1.0.27",
"description": "OAS Github CI",
"main": "scripts/build-openapi.js",
"files": [
"scripts"
],
"repository": {
"type": "git",
"url": "https://github.com/medusajs/medusa",
"directory": "packages/oas/oas-github-ci"
},
"private": true,
"author": "Medusa",
"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",
"test": "jest --passWithNoTests"
},
"dependencies": {
"@medusajs/medusa-oas-cli": "0.3.2",
"execa": "^5.1.1"
}
}
+87
View File
@@ -0,0 +1,87 @@
#!/usr/bin/env node
const fs = require("fs/promises")
const os = require("os")
const path = require("path")
const execa = require("execa")
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 docsApiPath = v2 ? path.resolve(repoRootPath, "www/apps/api-reference/specs-v2") :
path.resolve(repoRootPath, "www/apps/api-reference/specs")
const run = async () => {
const oasOutDir = isDryRun ? await getTmpDirectory() : docsApiPath
for (const apiType of ["store", "admin"]) {
await generateOASSource(oasOutDir, apiType)
const oasSrcFile = path.resolve(oasOutDir, `${apiType}.oas.json`)
const docsOutDir = path.resolve(oasOutDir, apiType)
await generateDocs(oasSrcFile, docsOutDir, isDryRun)
}
}
const generateOASSource = async (outDir, apiType) => {
const commandParams = ["oas", `--type=${apiType}`, `--out-dir=${outDir}`, "--local"]
if (v2) {
commandParams.push(`--v2`)
}
const { all: logs } = await execa(
"medusa-oas",
commandParams,
{ cwd: basePath, all: true }
)
console.log(logs)
}
const generateDocs = async (srcFile, outDir, isDryRun) => {
let params = [
"docs",
`--src-file=${srcFile}`,
`--out-dir=${outDir}`,
`--clean`,
`--split`,
]
if (isDryRun) {
params.push("--dry-run")
}
await runMedusaOasCommand(params)
if (withFullFile && !isDryRun) {
console.log("Generating full file...")
params = [
"docs",
`--src-file=${srcFile}`,
`--out-dir=${outDir}`,
`--main-file-name=openapi.full.yaml`
]
await runMedusaOasCommand(params)
console.log("Finished generating full file.")
}
}
const runMedusaOasCommand = async (params) => {
const { all: logs } = await execa("medusa-oas", params, {
cwd: basePath,
all: true,
})
console.log(logs)
}
const getTmpDirectory = async () => {
/**
* RUNNER_TEMP: GitHub action, the path to a temporary directory on the runner.
*/
const tmpDir = process.env["RUNNER_TEMP"] ?? os.tmpdir()
return await fs.mkdtemp(tmpDir)
}
void (async () => {
try {
await run()
} catch (err) {
console.log(err)
process.exit(1)
}
})()