qiskit-documentation/package.json

63 lines
2.1 KiB
JSON
Raw Normal View History

{
"name": "docs",
"version": "0.1.0",
"description": "The documentation content home for https://docs.quantum.ibm.com.",
"author": "Qiskit Development Team",
"license": "Apache-2.0",
"scripts": {
"check": "npm run check:metadata && npm run check:spelling && npm run check:links && npm run check:fmt",
Add Jest and Sphinx parsing library (#61) ## Background First part of https://github.com/Qiskit/documentation/issues/9. The docs infrastructure expects MDX files, but `qiskit`, `qiskit-ibm-provider`, and `qiskit-ibm-runtime` use Sphinx to generate their API references from source code. So, @axelhzf created a pipeline to convert Sphinx output to MDX. We are moving that pipeline to live in open source since the API references are also open source. ## What this PR does This adds the `lib/sphinx` code and its tests. The code is copied over without change, other than adding copyright headers. The PR also sets up Jest. A follow up PR will add the actual parsing script. I split up the PRs since this adds non-trivial infrastructure like Jest, so to have a smaller PR to review. This code will be deleted from the internal repository once https://github.com/Qiskit/documentation/issues/9 is complete and the internal repository is consuming this one. ## Why Jest? We use Playwright in https://github.com/Qiskit/qiskit_sphinx_theme, so I considered using that too here for consistency. But I stuck with the internal repo's decision to use Jest because Playwright doesn't have an equivalent to `toMatchInlineSnapshot`. I think Playwright is awesome, but we're never going to have Playwright integration tests in this repository since we're not testing the docs site itself in this repo, i.e. we don't need to spin up a server. Jest is simpler for our unit tests. Co-authored-by: Axel Hernández Ferrera <axelhzf@gmail.com>
2023-09-29 21:33:32 +08:00
"check:metadata": "node -r esbuild-register scripts/commands/checkMetadata.ts",
"check:links": "node -r esbuild-register scripts/commands/checkLinks.ts",
"check:spelling": "cspell --relative --no-progress docs/**/*.md* docs/api/**/*.md*",
"check:fmt": "prettier --check .",
"check-pages-render": "node -r esbuild-register scripts/commands/checkPagesRender.ts",
"fmt": "prettier --write .",
Add Jest and Sphinx parsing library (#61) ## Background First part of https://github.com/Qiskit/documentation/issues/9. The docs infrastructure expects MDX files, but `qiskit`, `qiskit-ibm-provider`, and `qiskit-ibm-runtime` use Sphinx to generate their API references from source code. So, @axelhzf created a pipeline to convert Sphinx output to MDX. We are moving that pipeline to live in open source since the API references are also open source. ## What this PR does This adds the `lib/sphinx` code and its tests. The code is copied over without change, other than adding copyright headers. The PR also sets up Jest. A follow up PR will add the actual parsing script. I split up the PRs since this adds non-trivial infrastructure like Jest, so to have a smaller PR to review. This code will be deleted from the internal repository once https://github.com/Qiskit/documentation/issues/9 is complete and the internal repository is consuming this one. ## Why Jest? We use Playwright in https://github.com/Qiskit/qiskit_sphinx_theme, so I considered using that too here for consistency. But I stuck with the internal repo's decision to use Jest because Playwright doesn't have an equivalent to `toMatchInlineSnapshot`. I think Playwright is awesome, but we're never going to have Playwright integration tests in this repository since we're not testing the docs site itself in this repo, i.e. we don't need to spin up a server. Jest is simpler for our unit tests. Co-authored-by: Axel Hernández Ferrera <axelhzf@gmail.com>
2023-09-29 21:33:32 +08:00
"test": "jest",
"typecheck": "tsc",
Automate the regeneration of the API docs (#739) ### Summary Thanks to #737, the API generation script doesn't need an argument to specify the CI artifact URL used in the generation. Because of that, we can automatize the script to regenerate all API docs in the repository. ### New command The PR adds a new command `regen-apis` where we can regenerate multiple versions of our three APIs with one command: ```bash npm run regen-apis ``` By default, all minor releases of each API will be regenerated, but we can add the `--current-apis-only` argument to regenerate only the latest stable versions. ```bash npm run regen-apis -- --current-apis-only ``` Alternatively, you can regenerate only one of the three available APIs. We can use the `-p` argument, which could be combined with the other arguments, similarly to the API generation script: ```bash npm run regen-apis -- -p <pkg-name> ``` ### Git instructions To run the script, we need to create a dedicated branch and have a clean git status. The script will create a commit per version regenerated and the developers can git cherry-pick them how they want to create different PRs. If the regeneration fails for a specific version, the script will call `git restore` to avoid mixing changes from two different versions when regenerating the next one. ### Output At the end of each call to the new command, we will see a summarization of all versions regenerated with three different possible outcomes per version: <table style="width:100%"> <tr> <th>Possible Output</th> <th>Meaning</th> <th>Creates a new commit</th> <th>Restores the files</th> </tr> <tr> <td>✅ <pkg-name> <version> regenerated correctly</td> <td>The regeneration was successful</td> <td>Yes</td> <td>No</td> </tr> <tr> <td>☑️ <pkg-name> <version> is up-to-date</td> <td>The regeneration was successful, but no files were modified</td> <td>No</td> <td>No</td> </tr> <tr> <td>❌ <pkg-name> <version> failed to regenerate</td> <td>The regeneration failed</td> <td>No</td> <td>Yes</td> </tr> </table> Closes #720 --------- Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-02-02 21:19:20 +08:00
"regen-apis": "node -r esbuild-register scripts/commands/regenerateApiDocs.ts",
"gen-api": "node -r esbuild-register scripts/commands/updateApiDocs.ts",
"make-historical": "node -r esbuild-register scripts/commands/convertApiDocsToHistorical.ts"
},
"devDependencies": {
Add Jest and Sphinx parsing library (#61) ## Background First part of https://github.com/Qiskit/documentation/issues/9. The docs infrastructure expects MDX files, but `qiskit`, `qiskit-ibm-provider`, and `qiskit-ibm-runtime` use Sphinx to generate their API references from source code. So, @axelhzf created a pipeline to convert Sphinx output to MDX. We are moving that pipeline to live in open source since the API references are also open source. ## What this PR does This adds the `lib/sphinx` code and its tests. The code is copied over without change, other than adding copyright headers. The PR also sets up Jest. A follow up PR will add the actual parsing script. I split up the PRs since this adds non-trivial infrastructure like Jest, so to have a smaller PR to review. This code will be deleted from the internal repository once https://github.com/Qiskit/documentation/issues/9 is complete and the internal repository is consuming this one. ## Why Jest? We use Playwright in https://github.com/Qiskit/qiskit_sphinx_theme, so I considered using that too here for consistency. But I stuck with the internal repo's decision to use Jest because Playwright doesn't have an equivalent to `toMatchInlineSnapshot`. I think Playwright is awesome, but we're never going to have Playwright integration tests in this repository since we're not testing the docs site itself in this repo, i.e. we don't need to spin up a server. Jest is simpler for our unit tests. Co-authored-by: Axel Hernández Ferrera <axelhzf@gmail.com>
2023-09-29 21:33:32 +08:00
"@swc/jest": "^0.2.29",
"@types/fast-levenshtein": "^0.0.4",
Add Jest and Sphinx parsing library (#61) ## Background First part of https://github.com/Qiskit/documentation/issues/9. The docs infrastructure expects MDX files, but `qiskit`, `qiskit-ibm-provider`, and `qiskit-ibm-runtime` use Sphinx to generate their API references from source code. So, @axelhzf created a pipeline to convert Sphinx output to MDX. We are moving that pipeline to live in open source since the API references are also open source. ## What this PR does This adds the `lib/sphinx` code and its tests. The code is copied over without change, other than adding copyright headers. The PR also sets up Jest. A follow up PR will add the actual parsing script. I split up the PRs since this adds non-trivial infrastructure like Jest, so to have a smaller PR to review. This code will be deleted from the internal repository once https://github.com/Qiskit/documentation/issues/9 is complete and the internal repository is consuming this one. ## Why Jest? We use Playwright in https://github.com/Qiskit/qiskit_sphinx_theme, so I considered using that too here for consistency. But I stuck with the internal repo's decision to use Jest because Playwright doesn't have an equivalent to `toMatchInlineSnapshot`. I think Playwright is awesome, but we're never going to have Playwright integration tests in this repository since we're not testing the docs site itself in this repo, i.e. we don't need to spin up a server. Jest is simpler for our unit tests. Co-authored-by: Axel Hernández Ferrera <axelhzf@gmail.com>
2023-09-29 21:33:32 +08:00
"@types/jest": "^29.5.5",
"@types/lodash": "^4.14.198",
"@types/node": "^20.6.2",
"@types/yargs": "^17.0.28",
Add Jest and Sphinx parsing library (#61) ## Background First part of https://github.com/Qiskit/documentation/issues/9. The docs infrastructure expects MDX files, but `qiskit`, `qiskit-ibm-provider`, and `qiskit-ibm-runtime` use Sphinx to generate their API references from source code. So, @axelhzf created a pipeline to convert Sphinx output to MDX. We are moving that pipeline to live in open source since the API references are also open source. ## What this PR does This adds the `lib/sphinx` code and its tests. The code is copied over without change, other than adding copyright headers. The PR also sets up Jest. A follow up PR will add the actual parsing script. I split up the PRs since this adds non-trivial infrastructure like Jest, so to have a smaller PR to review. This code will be deleted from the internal repository once https://github.com/Qiskit/documentation/issues/9 is complete and the internal repository is consuming this one. ## Why Jest? We use Playwright in https://github.com/Qiskit/qiskit_sphinx_theme, so I considered using that too here for consistency. But I stuck with the internal repo's decision to use Jest because Playwright doesn't have an equivalent to `toMatchInlineSnapshot`. I think Playwright is awesome, but we're never going to have Playwright integration tests in this repository since we're not testing the docs site itself in this repo, i.e. we don't need to spin up a server. Jest is simpler for our unit tests. Co-authored-by: Axel Hernández Ferrera <axelhzf@gmail.com>
2023-09-29 21:33:32 +08:00
"cheerio": "^1.0.0-rc.12",
"cspell": "^7.3.2",
"esbuild-register": "^3.5.0",
Add Jest and Sphinx parsing library (#61) ## Background First part of https://github.com/Qiskit/documentation/issues/9. The docs infrastructure expects MDX files, but `qiskit`, `qiskit-ibm-provider`, and `qiskit-ibm-runtime` use Sphinx to generate their API references from source code. So, @axelhzf created a pipeline to convert Sphinx output to MDX. We are moving that pipeline to live in open source since the API references are also open source. ## What this PR does This adds the `lib/sphinx` code and its tests. The code is copied over without change, other than adding copyright headers. The PR also sets up Jest. A follow up PR will add the actual parsing script. I split up the PRs since this adds non-trivial infrastructure like Jest, so to have a smaller PR to review. This code will be deleted from the internal repository once https://github.com/Qiskit/documentation/issues/9 is complete and the internal repository is consuming this one. ## Why Jest? We use Playwright in https://github.com/Qiskit/qiskit_sphinx_theme, so I considered using that too here for consistency. But I stuck with the internal repo's decision to use Jest because Playwright doesn't have an equivalent to `toMatchInlineSnapshot`. I think Playwright is awesome, but we're never going to have Playwright integration tests in this repository since we're not testing the docs site itself in this repo, i.e. we don't need to spin up a server. Jest is simpler for our unit tests. Co-authored-by: Axel Hernández Ferrera <axelhzf@gmail.com>
2023-09-29 21:33:32 +08:00
"github-slugger": "^2.0.0",
"globby": "^13.2.2",
"gray-matter": "^4.0.3",
Add Jest and Sphinx parsing library (#61) ## Background First part of https://github.com/Qiskit/documentation/issues/9. The docs infrastructure expects MDX files, but `qiskit`, `qiskit-ibm-provider`, and `qiskit-ibm-runtime` use Sphinx to generate their API references from source code. So, @axelhzf created a pipeline to convert Sphinx output to MDX. We are moving that pipeline to live in open source since the API references are also open source. ## What this PR does This adds the `lib/sphinx` code and its tests. The code is copied over without change, other than adding copyright headers. The PR also sets up Jest. A follow up PR will add the actual parsing script. I split up the PRs since this adds non-trivial infrastructure like Jest, so to have a smaller PR to review. This code will be deleted from the internal repository once https://github.com/Qiskit/documentation/issues/9 is complete and the internal repository is consuming this one. ## Why Jest? We use Playwright in https://github.com/Qiskit/qiskit_sphinx_theme, so I considered using that too here for consistency. But I stuck with the internal repo's decision to use Jest because Playwright doesn't have an equivalent to `toMatchInlineSnapshot`. I think Playwright is awesome, but we're never going to have Playwright integration tests in this repository since we're not testing the docs site itself in this repo, i.e. we don't need to spin up a server. Jest is simpler for our unit tests. Co-authored-by: Axel Hernández Ferrera <axelhzf@gmail.com>
2023-09-29 21:33:32 +08:00
"hast-util-to-mdast": "^8.3.0",
"hast-util-to-text": "^3.1.0",
"is-absolute-url": "^4.0.1",
"jest": "^29.7.0",
"lodash": "^4.17.21",
"mdast": "^3.0.0",
"mkdirp": "^3.0.1",
"p-map": "^6.0.0",
"prettier": "^3.0.3",
Add Jest and Sphinx parsing library (#61) ## Background First part of https://github.com/Qiskit/documentation/issues/9. The docs infrastructure expects MDX files, but `qiskit`, `qiskit-ibm-provider`, and `qiskit-ibm-runtime` use Sphinx to generate their API references from source code. So, @axelhzf created a pipeline to convert Sphinx output to MDX. We are moving that pipeline to live in open source since the API references are also open source. ## What this PR does This adds the `lib/sphinx` code and its tests. The code is copied over without change, other than adding copyright headers. The PR also sets up Jest. A follow up PR will add the actual parsing script. I split up the PRs since this adds non-trivial infrastructure like Jest, so to have a smaller PR to review. This code will be deleted from the internal repository once https://github.com/Qiskit/documentation/issues/9 is complete and the internal repository is consuming this one. ## Why Jest? We use Playwright in https://github.com/Qiskit/qiskit_sphinx_theme, so I considered using that too here for consistency. But I stuck with the internal repo's decision to use Jest because Playwright doesn't have an equivalent to `toMatchInlineSnapshot`. I think Playwright is awesome, but we're never going to have Playwright integration tests in this repository since we're not testing the docs site itself in this repo, i.e. we don't need to spin up a server. Jest is simpler for our unit tests. Co-authored-by: Axel Hernández Ferrera <axelhzf@gmail.com>
2023-09-29 21:33:32 +08:00
"rehype-parse": "^8.0.0",
"rehype-remark": "^9.1.2",
"remark-gfm": "^3.0.1",
"remark-math": "^5.1.1",
"remark-mdx": "^2.3.0",
"remark-parse": "^10.0.1",
"remark-stringify": "^10.0.3",
"typescript": "^5.2.2",
"unified": "^10.0.0",
"unist-util-visit": "^4.0.0",
"yargs": "^17.7.2",
"zx": "^7.2.3"
},
"dependencies": {
"esbuild": "^0.19.11",
"fast-levenshtein": "^3.0.0",
"markdown-link-extractor": "^3.1.0",
"transform-markdown-links": "^2.1.0"
}
}