qiskit-documentation/package.json

76 lines
2.8 KiB
JSON
Raw Normal View History

{
"name": "qiskit-documentation",
"version": "0.1.0",
"description": "The documentation content home for https://docs.quantum.ibm.com.",
"author": "Qiskit Development Team",
"license": "Apache-2.0",
Allow running `scripts/js` from other Node projects (#1747) This PR allows other repositories to depend on this repo as a VCS requirement, then to run our scripts, like this: ```json "scripts": { "check": "node node_modules/qiskit-documentation/dist/commands/checkMetadata.js" }, "dependencies": { "qiskit-documentation": "qiskit/documentation#3422358984f9ede3a6ac8a2bbe7df517fbd306cb" }, ``` ``` ❯ npm run check > my-function-docs@0.1.0 check:metadata > node node_modules/qiskit-documentation/dist/commands/checkMetadata.js ``` `node_modules/qiskit-documentation` will include only the contents of `src/js` but compiled to JavaScript, along with `package.json`. That results in the other project bringing in all of the transitive dependencies of this repo. Running scripts locally still works. ## Migration to ES Modules Before, we were using CommonJS for how imports and module loading works. However, this was causing issues when trying to run in other repos. The easiest fix was to migrate to ES Modules by setting `"type": "module"` in `package.json`. This required that we set a `.js` file extension in all of our import statements, and that we use `lodash-es` rather than `lodash`. ## Migration to Playwright I could not get Jest to play nicely with TypeScript & ES Modules. The simplest fix was to migrate to Playwright. We already use Playwright in qiskit-sphinx-theme, so this brings nice consistency to the open source projects. ## Followup work: fix individual scripts Some of the scripts may need changes to work in other repositories, like our internal link checker. For now, `checkMetadata.ts` and `checkExternalLinks.ts` definitely work.
2024-07-24 01:19:24 +08:00
"type": "module",
"files": [
"dist",
"scripts/config/cspell",
"scripts/config/internal-links.json"
Allow running `scripts/js` from other Node projects (#1747) This PR allows other repositories to depend on this repo as a VCS requirement, then to run our scripts, like this: ```json "scripts": { "check": "node node_modules/qiskit-documentation/dist/commands/checkMetadata.js" }, "dependencies": { "qiskit-documentation": "qiskit/documentation#3422358984f9ede3a6ac8a2bbe7df517fbd306cb" }, ``` ``` ❯ npm run check > my-function-docs@0.1.0 check:metadata > node node_modules/qiskit-documentation/dist/commands/checkMetadata.js ``` `node_modules/qiskit-documentation` will include only the contents of `src/js` but compiled to JavaScript, along with `package.json`. That results in the other project bringing in all of the transitive dependencies of this repo. Running scripts locally still works. ## Migration to ES Modules Before, we were using CommonJS for how imports and module loading works. However, this was causing issues when trying to run in other repos. The easiest fix was to migrate to ES Modules by setting `"type": "module"` in `package.json`. This required that we set a `.js` file extension in all of our import statements, and that we use `lodash-es` rather than `lodash`. ## Migration to Playwright I could not get Jest to play nicely with TypeScript & ES Modules. The simplest fix was to migrate to Playwright. We already use Playwright in qiskit-sphinx-theme, so this brings nice consistency to the open source projects. ## Followup work: fix individual scripts Some of the scripts may need changes to work in other repositories, like our internal link checker. For now, `checkMetadata.ts` and `checkExternalLinks.ts` definitely work.
2024-07-24 01:19:24 +08:00
],
"scripts": {
Allow running `scripts/js` from other Node projects (#1747) This PR allows other repositories to depend on this repo as a VCS requirement, then to run our scripts, like this: ```json "scripts": { "check": "node node_modules/qiskit-documentation/dist/commands/checkMetadata.js" }, "dependencies": { "qiskit-documentation": "qiskit/documentation#3422358984f9ede3a6ac8a2bbe7df517fbd306cb" }, ``` ``` ❯ npm run check > my-function-docs@0.1.0 check:metadata > node node_modules/qiskit-documentation/dist/commands/checkMetadata.js ``` `node_modules/qiskit-documentation` will include only the contents of `src/js` but compiled to JavaScript, along with `package.json`. That results in the other project bringing in all of the transitive dependencies of this repo. Running scripts locally still works. ## Migration to ES Modules Before, we were using CommonJS for how imports and module loading works. However, this was causing issues when trying to run in other repos. The easiest fix was to migrate to ES Modules by setting `"type": "module"` in `package.json`. This required that we set a `.js` file extension in all of our import statements, and that we use `lodash-es` rather than `lodash`. ## Migration to Playwright I could not get Jest to play nicely with TypeScript & ES Modules. The simplest fix was to migrate to Playwright. We already use Playwright in qiskit-sphinx-theme, so this brings nice consistency to the open source projects. ## Followup work: fix individual scripts Some of the scripts may need changes to work in other repositories, like our internal link checker. For now, `checkMetadata.ts` and `checkExternalLinks.ts` definitely work.
2024-07-24 01:19:24 +08:00
"prepare": "tsc",
"fmt": "prettier --write .",
Allow running `scripts/js` from other Node projects (#1747) This PR allows other repositories to depend on this repo as a VCS requirement, then to run our scripts, like this: ```json "scripts": { "check": "node node_modules/qiskit-documentation/dist/commands/checkMetadata.js" }, "dependencies": { "qiskit-documentation": "qiskit/documentation#3422358984f9ede3a6ac8a2bbe7df517fbd306cb" }, ``` ``` ❯ npm run check > my-function-docs@0.1.0 check:metadata > node node_modules/qiskit-documentation/dist/commands/checkMetadata.js ``` `node_modules/qiskit-documentation` will include only the contents of `src/js` but compiled to JavaScript, along with `package.json`. That results in the other project bringing in all of the transitive dependencies of this repo. Running scripts locally still works. ## Migration to ES Modules Before, we were using CommonJS for how imports and module loading works. However, this was causing issues when trying to run in other repos. The easiest fix was to migrate to ES Modules by setting `"type": "module"` in `package.json`. This required that we set a `.js` file extension in all of our import statements, and that we use `lodash-es` rather than `lodash`. ## Migration to Playwright I could not get Jest to play nicely with TypeScript & ES Modules. The simplest fix was to migrate to Playwright. We already use Playwright in qiskit-sphinx-theme, so this brings nice consistency to the open source projects. ## Followup work: fix individual scripts Some of the scripts may need changes to work in other repositories, like our internal link checker. For now, `checkMetadata.ts` and `checkExternalLinks.ts` definitely work.
2024-07-24 01:19:24 +08:00
"test": "playwright test",
"typecheck": "tsc",
"check": "npm run check:qiskit-bot && npm run check:patterns-index && npm run check:metadata && npm run check:spelling && npm run check:internal-links && npm run check:orphan-pages && npm run check:fmt",
Allow running `scripts/js` from other Node projects (#1747) This PR allows other repositories to depend on this repo as a VCS requirement, then to run our scripts, like this: ```json "scripts": { "check": "node node_modules/qiskit-documentation/dist/commands/checkMetadata.js" }, "dependencies": { "qiskit-documentation": "qiskit/documentation#3422358984f9ede3a6ac8a2bbe7df517fbd306cb" }, ``` ``` ❯ npm run check > my-function-docs@0.1.0 check:metadata > node node_modules/qiskit-documentation/dist/commands/checkMetadata.js ``` `node_modules/qiskit-documentation` will include only the contents of `src/js` but compiled to JavaScript, along with `package.json`. That results in the other project bringing in all of the transitive dependencies of this repo. Running scripts locally still works. ## Migration to ES Modules Before, we were using CommonJS for how imports and module loading works. However, this was causing issues when trying to run in other repos. The easiest fix was to migrate to ES Modules by setting `"type": "module"` in `package.json`. This required that we set a `.js` file extension in all of our import statements, and that we use `lodash-es` rather than `lodash`. ## Migration to Playwright I could not get Jest to play nicely with TypeScript & ES Modules. The simplest fix was to migrate to Playwright. We already use Playwright in qiskit-sphinx-theme, so this brings nice consistency to the open source projects. ## Followup work: fix individual scripts Some of the scripts may need changes to work in other repositories, like our internal link checker. For now, `checkMetadata.ts` and `checkExternalLinks.ts` definitely work.
2024-07-24 01:19:24 +08:00
"check:metadata": "tsx scripts/js/commands/checkMetadata.ts",
"check:spelling": "tsx scripts/js/commands/checkSpelling.ts",
"check:fmt": "prettier --check .",
Allow running `scripts/js` from other Node projects (#1747) This PR allows other repositories to depend on this repo as a VCS requirement, then to run our scripts, like this: ```json "scripts": { "check": "node node_modules/qiskit-documentation/dist/commands/checkMetadata.js" }, "dependencies": { "qiskit-documentation": "qiskit/documentation#3422358984f9ede3a6ac8a2bbe7df517fbd306cb" }, ``` ``` ❯ npm run check > my-function-docs@0.1.0 check:metadata > node node_modules/qiskit-documentation/dist/commands/checkMetadata.js ``` `node_modules/qiskit-documentation` will include only the contents of `src/js` but compiled to JavaScript, along with `package.json`. That results in the other project bringing in all of the transitive dependencies of this repo. Running scripts locally still works. ## Migration to ES Modules Before, we were using CommonJS for how imports and module loading works. However, this was causing issues when trying to run in other repos. The easiest fix was to migrate to ES Modules by setting `"type": "module"` in `package.json`. This required that we set a `.js` file extension in all of our import statements, and that we use `lodash-es` rather than `lodash`. ## Migration to Playwright I could not get Jest to play nicely with TypeScript & ES Modules. The simplest fix was to migrate to Playwright. We already use Playwright in qiskit-sphinx-theme, so this brings nice consistency to the open source projects. ## Followup work: fix individual scripts Some of the scripts may need changes to work in other repositories, like our internal link checker. For now, `checkMetadata.ts` and `checkExternalLinks.ts` definitely work.
2024-07-24 01:19:24 +08:00
"check:internal-links": "tsx scripts/js/commands/checkInternalLinks.ts",
"check:external-links": "tsx scripts/js/commands/checkExternalLinks.ts",
"check:pages-render": "tsx scripts/js/commands/checkPagesRender.ts",
"check:patterns-index": "tsx scripts/js/commands/checkPatternsIndex.ts",
"check:orphan-pages": "tsx scripts/js/commands/checkOrphanPages.ts",
"check:qiskit-bot": "tsx scripts/js/commands/checkQiskitBotFiles.ts",
"check:stale-images": "tsx scripts/js/commands/checkStaleImages.ts",
"regen-apis": "tsx scripts/js/commands/api/regenerateApiDocs.ts",
"gen-api": "tsx scripts/js/commands/api/updateApiDocs.ts",
"make-historical": "tsx scripts/js/commands/api/convertApiDocsToHistorical.ts",
Add historical redirects file (#1780) Adds a file (and generation script) that links pages in historical API docs to pages in the latest API docs. The banner we show on historical docs pages can use this to link users to a more relevant page in the latest docs, rather than always linking to the top level. The file has the following form. ```json { "package-name": { "version": { "old.page.name": "new.page.name", } } } ``` If a page has no entry in the redirects file, we default to redirecting to the same page in the latest API docs. E.g. `/api/qiskit/0.33/qiskit.dagcircuit.DAGCircuit` will link to `/api/qiskit/qiskit.dagcircuit.DAGCircuit`. This PR only checks if a page with the same name exists in the latest API docs and redirects to the top level if it does not. A follow up PR could include more complicated logic to track moved classes or point to module names when the class is removed. <details><summary><b>Stats</b></summary> Here are some stats to give an idea of how many pages this affects. In total, 35% of historical API pages have a corresponding page in the latest API versions. Looking at the breakdown per version, the majority of recent pages will link to a more helpful page. The rest will behave the same as before. | Package | Page matches | |---------|--------------| | qiskit-ibm-provider/0.10 | 100% | | qiskit-ibm-provider/0.7 | 100% | | qiskit-ibm-provider/0.8 | 100% | | qiskit-ibm-provider/0.9 | 100% | | qiskit-ibm-runtime/0.14 | 90% | | qiskit-ibm-runtime/0.15 | 90% | | qiskit-ibm-runtime/0.16 | 100% | | qiskit-ibm-runtime/0.17 | 100% | | qiskit-ibm-runtime/0.18 | 98% | | qiskit-ibm-runtime/0.19 | 98% | | qiskit-ibm-runtime/0.20 | 98% | | qiskit-ibm-runtime/0.21 | 99% | | qiskit-ibm-runtime/0.22 | 99% | | qiskit-ibm-runtime/0.23 | 100% | | qiskit-ibm-runtime/0.24 | 100% | | qiskit-ibm-runtime/dev | 100% | | qiskit/0.19 | 23% | | qiskit/0.24 | 23% | | qiskit/0.25 | 20% | | qiskit/0.26 | 20% | | qiskit/0.27 | 20% | | qiskit/0.28 | 21% | | qiskit/0.29 | 21% | | qiskit/0.30 | 21% | | qiskit/0.31 | 21% | | qiskit/0.32 | 21% | | qiskit/0.33 | 33% | | qiskit/0.35 | 34% | | qiskit/0.36 | 34% | | qiskit/0.37 | 34% | | qiskit/0.38 | 34% | | qiskit/0.39 | 34% | | qiskit/0.40 | 33% | | qiskit/0.41 | 33% | | qiskit/0.42 | 33% | | qiskit/0.43 | 39% | | qiskit/0.44 | 53% | | qiskit/0.45 | 56% | | qiskit/0.46 | 57% | | qiskit/1.0 | 97% | | qiskit/dev | 100% | </details> --------- Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
2024-07-31 01:19:21 +08:00
"generate-historical-redirects": "tsx scripts/js/commands/api/generateHistoricalRedirects.ts",
"save-internal-links": "tsx scripts/js/commands/saveInternalLinks.ts"
},
"dependencies": {
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": "^8.12.1",
"fast-levenshtein": "^3.0.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": "^14.0.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",
"js-yaml": "^4.1.0",
Allow running `scripts/js` from other Node projects (#1747) This PR allows other repositories to depend on this repo as a VCS requirement, then to run our scripts, like this: ```json "scripts": { "check": "node node_modules/qiskit-documentation/dist/commands/checkMetadata.js" }, "dependencies": { "qiskit-documentation": "qiskit/documentation#3422358984f9ede3a6ac8a2bbe7df517fbd306cb" }, ``` ``` ❯ npm run check > my-function-docs@0.1.0 check:metadata > node node_modules/qiskit-documentation/dist/commands/checkMetadata.js ``` `node_modules/qiskit-documentation` will include only the contents of `src/js` but compiled to JavaScript, along with `package.json`. That results in the other project bringing in all of the transitive dependencies of this repo. Running scripts locally still works. ## Migration to ES Modules Before, we were using CommonJS for how imports and module loading works. However, this was causing issues when trying to run in other repos. The easiest fix was to migrate to ES Modules by setting `"type": "module"` in `package.json`. This required that we set a `.js` file extension in all of our import statements, and that we use `lodash-es` rather than `lodash`. ## Migration to Playwright I could not get Jest to play nicely with TypeScript & ES Modules. The simplest fix was to migrate to Playwright. We already use Playwright in qiskit-sphinx-theme, so this brings nice consistency to the open source projects. ## Followup work: fix individual scripts Some of the scripts may need changes to work in other repositories, like our internal link checker. For now, `checkMetadata.ts` and `checkExternalLinks.ts` definitely work.
2024-07-24 01:19:24 +08:00
"lodash-es": "^4.17.21",
"markdown-link-extractor": "^3.1.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
"mdast": "^3.0.0",
"mkdirp": "^3.0.1",
"p-map": "^6.0.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
"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",
"transform-markdown-links": "^2.1.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
"unified": "^10.0.0",
"unist-util-visit": "^4.0.0",
"yargs": "^17.7.2",
"zx": "^8.1.4"
},
"devDependencies": {
Allow running `scripts/js` from other Node projects (#1747) This PR allows other repositories to depend on this repo as a VCS requirement, then to run our scripts, like this: ```json "scripts": { "check": "node node_modules/qiskit-documentation/dist/commands/checkMetadata.js" }, "dependencies": { "qiskit-documentation": "qiskit/documentation#3422358984f9ede3a6ac8a2bbe7df517fbd306cb" }, ``` ``` ❯ npm run check > my-function-docs@0.1.0 check:metadata > node node_modules/qiskit-documentation/dist/commands/checkMetadata.js ``` `node_modules/qiskit-documentation` will include only the contents of `src/js` but compiled to JavaScript, along with `package.json`. That results in the other project bringing in all of the transitive dependencies of this repo. Running scripts locally still works. ## Migration to ES Modules Before, we were using CommonJS for how imports and module loading works. However, this was causing issues when trying to run in other repos. The easiest fix was to migrate to ES Modules by setting `"type": "module"` in `package.json`. This required that we set a `.js` file extension in all of our import statements, and that we use `lodash-es` rather than `lodash`. ## Migration to Playwright I could not get Jest to play nicely with TypeScript & ES Modules. The simplest fix was to migrate to Playwright. We already use Playwright in qiskit-sphinx-theme, so this brings nice consistency to the open source projects. ## Followup work: fix individual scripts Some of the scripts may need changes to work in other repositories, like our internal link checker. For now, `checkMetadata.ts` and `checkExternalLinks.ts` definitely work.
2024-07-24 01:19:24 +08:00
"@playwright/test": "^1.45.2",
"@types/fast-levenshtein": "^0.0.4",
"@types/js-yaml": "^4.0.9",
Allow running `scripts/js` from other Node projects (#1747) This PR allows other repositories to depend on this repo as a VCS requirement, then to run our scripts, like this: ```json "scripts": { "check": "node node_modules/qiskit-documentation/dist/commands/checkMetadata.js" }, "dependencies": { "qiskit-documentation": "qiskit/documentation#3422358984f9ede3a6ac8a2bbe7df517fbd306cb" }, ``` ``` ❯ npm run check > my-function-docs@0.1.0 check:metadata > node node_modules/qiskit-documentation/dist/commands/checkMetadata.js ``` `node_modules/qiskit-documentation` will include only the contents of `src/js` but compiled to JavaScript, along with `package.json`. That results in the other project bringing in all of the transitive dependencies of this repo. Running scripts locally still works. ## Migration to ES Modules Before, we were using CommonJS for how imports and module loading works. However, this was causing issues when trying to run in other repos. The easiest fix was to migrate to ES Modules by setting `"type": "module"` in `package.json`. This required that we set a `.js` file extension in all of our import statements, and that we use `lodash-es` rather than `lodash`. ## Migration to Playwright I could not get Jest to play nicely with TypeScript & ES Modules. The simplest fix was to migrate to Playwright. We already use Playwright in qiskit-sphinx-theme, so this brings nice consistency to the open source projects. ## Followup work: fix individual scripts Some of the scripts may need changes to work in other repositories, like our internal link checker. For now, `checkMetadata.ts` and `checkExternalLinks.ts` definitely work.
2024-07-24 01:19:24 +08:00
"@types/lodash-es": "^4.14.198",
"@types/node": "^20.6.2",
"@types/yargs": "^17.0.28",
"prettier": "^3.3.3",
Allow running `scripts/js` from other Node projects (#1747) This PR allows other repositories to depend on this repo as a VCS requirement, then to run our scripts, like this: ```json "scripts": { "check": "node node_modules/qiskit-documentation/dist/commands/checkMetadata.js" }, "dependencies": { "qiskit-documentation": "qiskit/documentation#3422358984f9ede3a6ac8a2bbe7df517fbd306cb" }, ``` ``` ❯ npm run check > my-function-docs@0.1.0 check:metadata > node node_modules/qiskit-documentation/dist/commands/checkMetadata.js ``` `node_modules/qiskit-documentation` will include only the contents of `src/js` but compiled to JavaScript, along with `package.json`. That results in the other project bringing in all of the transitive dependencies of this repo. Running scripts locally still works. ## Migration to ES Modules Before, we were using CommonJS for how imports and module loading works. However, this was causing issues when trying to run in other repos. The easiest fix was to migrate to ES Modules by setting `"type": "module"` in `package.json`. This required that we set a `.js` file extension in all of our import statements, and that we use `lodash-es` rather than `lodash`. ## Migration to Playwright I could not get Jest to play nicely with TypeScript & ES Modules. The simplest fix was to migrate to Playwright. We already use Playwright in qiskit-sphinx-theme, so this brings nice consistency to the open source projects. ## Followup work: fix individual scripts Some of the scripts may need changes to work in other repositories, like our internal link checker. For now, `checkMetadata.ts` and `checkExternalLinks.ts` definitely work.
2024-07-24 01:19:24 +08:00
"tsx": "^4.16.2",
"typescript": "^5.2.2"
}
}