@elench/testkit 0.1.64 → 0.1.66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/browser-bridge.mjs +66 -0
- package/lib/app/configs.mjs +81 -0
- package/lib/app/configs.test.mjs +34 -0
- package/lib/cli/command-helpers.mjs +2 -10
- package/lib/cli/commands/browser/serve.mjs +3 -62
- package/lib/cli/db.mjs +3 -68
- package/lib/config/binaries.mjs +34 -0
- package/lib/config/database.mjs +9 -6
- package/lib/config/index.mjs +2 -31
- package/lib/config/runtime.mjs +24 -95
- package/lib/config/validation.mjs +18 -62
- package/lib/coverage/backend-discovery.mjs +68 -85
- package/lib/coverage/backend-discovery.test.mjs +55 -46
- package/lib/coverage/evidence.mjs +15 -3
- package/lib/coverage/evidence.test.mjs +13 -4
- package/lib/coverage/graph-builder.mjs +25 -26
- package/lib/coverage/next-ir-to-graph.mjs +239 -0
- package/lib/coverage/routing.mjs +2 -29
- package/lib/coverage/routing.test.mjs +0 -16
- package/lib/coverage/shared.mjs +22 -82
- package/lib/database/fingerprint.mjs +1 -1
- package/lib/known-failures/github-cache.mjs +159 -0
- package/lib/known-failures/github-transport.mjs +174 -0
- package/lib/known-failures/github.mjs +17 -325
- package/lib/runner/default-runtime-runner.mjs +4 -10
- package/lib/runner/execution-config.mjs +12 -83
- package/lib/runner/live-run.mjs +45 -0
- package/lib/runner/managed-processes.mjs +29 -0
- package/lib/runner/orchestrator.mjs +57 -188
- package/lib/runner/playwright-runner.mjs +4 -11
- package/lib/runner/run-finalization.mjs +132 -0
- package/lib/runner/run-guards.mjs +45 -0
- package/lib/runner/runtime-preparation.mjs +1 -1
- package/lib/runner/services.mjs +3 -4
- package/lib/runner/template-steps.mjs +8 -45
- package/lib/runner/template.mjs +7 -28
- package/lib/shared/configured-steps.mjs +178 -0
- package/lib/shared/configured-steps.test.mjs +73 -0
- package/lib/shared/execution-schema.mjs +74 -0
- package/lib/shared/execution-schema.test.mjs +26 -0
- package/node_modules/@elench/next-analysis/dist/api-routes.d.ts +7 -0
- package/node_modules/@elench/next-analysis/dist/api-routes.d.ts.map +1 -0
- package/node_modules/@elench/next-analysis/dist/api-routes.js +66 -0
- package/node_modules/@elench/next-analysis/dist/api-routes.js.map +1 -0
- package/node_modules/@elench/next-analysis/dist/app-root.d.ts +2 -0
- package/node_modules/@elench/next-analysis/dist/app-root.d.ts.map +1 -0
- package/node_modules/@elench/next-analysis/dist/app-root.js +7 -0
- package/node_modules/@elench/next-analysis/dist/app-root.js.map +1 -0
- package/node_modules/@elench/next-analysis/dist/backend-links.d.ts +8 -0
- package/node_modules/@elench/next-analysis/dist/backend-links.d.ts.map +1 -0
- package/node_modules/@elench/next-analysis/dist/backend-links.js +30 -0
- package/node_modules/@elench/next-analysis/dist/backend-links.js.map +1 -0
- package/node_modules/@elench/next-analysis/dist/index.d.ts +11 -0
- package/node_modules/@elench/next-analysis/dist/index.d.ts.map +1 -0
- package/node_modules/@elench/next-analysis/dist/index.js +10 -0
- package/node_modules/@elench/next-analysis/dist/index.js.map +1 -0
- package/node_modules/@elench/next-analysis/dist/pages.d.ts +7 -0
- package/node_modules/@elench/next-analysis/dist/pages.d.ts.map +1 -0
- package/node_modules/@elench/next-analysis/dist/pages.js +47 -0
- package/node_modules/@elench/next-analysis/dist/pages.js.map +1 -0
- package/node_modules/@elench/next-analysis/dist/project.d.ts +3 -0
- package/node_modules/@elench/next-analysis/dist/project.d.ts.map +1 -0
- package/node_modules/@elench/next-analysis/dist/project.js +102 -0
- package/node_modules/@elench/next-analysis/dist/project.js.map +1 -0
- package/node_modules/@elench/next-analysis/dist/route-tree.d.ts +7 -0
- package/node_modules/@elench/next-analysis/dist/route-tree.d.ts.map +1 -0
- package/node_modules/@elench/next-analysis/dist/route-tree.js +575 -0
- package/node_modules/@elench/next-analysis/dist/route-tree.js.map +1 -0
- package/node_modules/@elench/next-analysis/dist/routes.d.ts +6 -0
- package/node_modules/@elench/next-analysis/dist/routes.d.ts.map +1 -0
- package/node_modules/@elench/next-analysis/dist/routes.js +41 -0
- package/node_modules/@elench/next-analysis/dist/routes.js.map +1 -0
- package/node_modules/@elench/next-analysis/dist/server-actions.d.ts +7 -0
- package/node_modules/@elench/next-analysis/dist/server-actions.d.ts.map +1 -0
- package/node_modules/@elench/next-analysis/dist/server-actions.js +37 -0
- package/node_modules/@elench/next-analysis/dist/server-actions.js.map +1 -0
- package/node_modules/@elench/next-analysis/dist/shared.d.ts +57 -0
- package/node_modules/@elench/next-analysis/dist/shared.d.ts.map +1 -0
- package/node_modules/@elench/next-analysis/dist/shared.js +229 -0
- package/node_modules/@elench/next-analysis/dist/shared.js.map +1 -0
- package/node_modules/@elench/next-analysis/dist/swc.d.ts +53 -0
- package/node_modules/@elench/next-analysis/dist/swc.d.ts.map +1 -0
- package/node_modules/@elench/next-analysis/dist/swc.js +387 -0
- package/node_modules/@elench/next-analysis/dist/swc.js.map +1 -0
- package/node_modules/@elench/next-analysis/dist/types.d.ts +125 -0
- package/node_modules/@elench/next-analysis/dist/types.d.ts.map +1 -0
- package/node_modules/@elench/next-analysis/dist/types.js +2 -0
- package/node_modules/@elench/next-analysis/dist/types.js.map +1 -0
- package/node_modules/@elench/next-analysis/package.json +27 -0
- package/node_modules/@elench/testkit-bridge/dist/index.d.ts +36 -0
- package/node_modules/@elench/testkit-bridge/dist/index.d.ts.map +1 -0
- package/node_modules/@elench/testkit-bridge/dist/index.js +538 -0
- package/node_modules/@elench/testkit-bridge/dist/index.js.map +1 -0
- package/node_modules/@elench/testkit-bridge/package.json +16 -5
- package/node_modules/@elench/testkit-protocol/dist/index.d.ts +190 -0
- package/node_modules/@elench/testkit-protocol/dist/index.d.ts.map +1 -0
- package/node_modules/@elench/testkit-protocol/dist/index.js +296 -0
- package/node_modules/@elench/testkit-protocol/dist/index.js.map +1 -0
- package/node_modules/@elench/testkit-protocol/package.json +14 -7
- package/node_modules/@elench/ts-analysis/dist/callables.d.ts +8 -0
- package/node_modules/@elench/ts-analysis/dist/callables.d.ts.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/callables.js +126 -0
- package/node_modules/@elench/ts-analysis/dist/callables.js.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/exports.d.ts +6 -0
- package/node_modules/@elench/ts-analysis/dist/exports.d.ts.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/exports.js +70 -0
- package/node_modules/@elench/ts-analysis/dist/exports.js.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/index.d.ts +10 -0
- package/node_modules/@elench/ts-analysis/dist/index.d.ts.map +1 -0
- package/node_modules/@elench/ts-analysis/{src/index.mjs → dist/index.js} +9 -14
- package/node_modules/@elench/ts-analysis/dist/index.js.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/jsx.d.ts +9 -0
- package/node_modules/@elench/ts-analysis/dist/jsx.d.ts.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/jsx.js +68 -0
- package/node_modules/@elench/ts-analysis/dist/jsx.js.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/project.d.ts +5 -0
- package/node_modules/@elench/ts-analysis/dist/project.d.ts.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/project.js +90 -0
- package/node_modules/@elench/ts-analysis/dist/project.js.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/requests.d.ts +6 -0
- package/node_modules/@elench/ts-analysis/dist/requests.d.ts.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/requests.js +140 -0
- package/node_modules/@elench/ts-analysis/dist/requests.js.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/resolution.d.ts +4 -0
- package/node_modules/@elench/ts-analysis/dist/resolution.d.ts.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/resolution.js +53 -0
- package/node_modules/@elench/ts-analysis/dist/resolution.js.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/shared.d.ts +6 -0
- package/node_modules/@elench/ts-analysis/dist/shared.d.ts.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/shared.js +31 -0
- package/node_modules/@elench/ts-analysis/dist/shared.js.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/syntax.d.ts +7 -0
- package/node_modules/@elench/ts-analysis/dist/syntax.d.ts.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/syntax.js +27 -0
- package/node_modules/@elench/ts-analysis/dist/syntax.js.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/types.d.ts +58 -0
- package/node_modules/@elench/ts-analysis/dist/types.d.ts.map +1 -0
- package/node_modules/@elench/ts-analysis/dist/types.js +2 -0
- package/node_modules/@elench/ts-analysis/dist/types.js.map +1 -0
- package/node_modules/@elench/ts-analysis/package.json +18 -2
- package/node_modules/@next/routing/README.md +91 -0
- package/node_modules/@next/routing/dist/__tests__/captures.test.d.ts +1 -0
- package/node_modules/@next/routing/dist/__tests__/conditions.test.d.ts +1 -0
- package/node_modules/@next/routing/dist/__tests__/dynamic-after-rewrites.test.d.ts +1 -0
- package/node_modules/@next/routing/dist/__tests__/i18n-resolve-routes.test.d.ts +1 -0
- package/node_modules/@next/routing/dist/__tests__/i18n.test.d.ts +1 -0
- package/node_modules/@next/routing/dist/__tests__/middleware.test.d.ts +1 -0
- package/node_modules/@next/routing/dist/__tests__/normalize-next-data.test.d.ts +1 -0
- package/node_modules/@next/routing/dist/__tests__/redirects.test.d.ts +1 -0
- package/node_modules/@next/routing/dist/__tests__/resolve-routes.test.d.ts +1 -0
- package/node_modules/@next/routing/dist/__tests__/rewrites.test.d.ts +1 -0
- package/node_modules/@next/routing/dist/destination.d.ts +22 -0
- package/node_modules/@next/routing/dist/i18n.d.ts +48 -0
- package/node_modules/@next/routing/dist/index.d.ts +5 -0
- package/node_modules/@next/routing/dist/index.js +1 -0
- package/node_modules/@next/routing/dist/matchers.d.ts +12 -0
- package/node_modules/@next/routing/dist/middleware.d.ts +12 -0
- package/node_modules/@next/routing/dist/next-data.d.ts +10 -0
- package/node_modules/@next/routing/dist/resolve-routes.d.ts +2 -0
- package/node_modules/@next/routing/dist/types.d.ts +97 -0
- package/node_modules/@next/routing/package.json +39 -0
- package/node_modules/@swc/core/README.md +100 -0
- package/node_modules/@swc/core/Visitor.d.ts +218 -0
- package/node_modules/@swc/core/Visitor.js +1399 -0
- package/node_modules/@swc/core/binding.d.ts +59 -0
- package/node_modules/@swc/core/binding.js +368 -0
- package/node_modules/@swc/core/index.d.ts +120 -0
- package/node_modules/@swc/core/index.js +443 -0
- package/node_modules/@swc/core/package.json +120 -0
- package/node_modules/@swc/core/postinstall.js +148 -0
- package/node_modules/@swc/core/spack.d.ts +51 -0
- package/node_modules/@swc/core/spack.js +87 -0
- package/node_modules/@swc/core/util.d.ts +1 -0
- package/node_modules/@swc/core/util.js +104 -0
- package/node_modules/@swc/core-linux-x64-gnu/README.md +3 -0
- package/node_modules/@swc/core-linux-x64-gnu/package.json +46 -0
- package/node_modules/@swc/core-linux-x64-gnu/swc.linux-x64-gnu.node +0 -0
- package/node_modules/@swc/counter/CHANGELOG.md +7 -0
- package/node_modules/@swc/counter/README.md +7 -0
- package/node_modules/@swc/counter/index.js +1 -0
- package/node_modules/@swc/counter/package.json +27 -0
- package/node_modules/@swc/types/LICENSE +201 -0
- package/node_modules/@swc/types/README.md +4 -0
- package/node_modules/@swc/types/assumptions.d.ts +92 -0
- package/node_modules/@swc/types/assumptions.js +2 -0
- package/node_modules/@swc/types/index.d.ts +2049 -0
- package/node_modules/@swc/types/index.js +2 -0
- package/node_modules/@swc/types/package.json +40 -0
- package/node_modules/typescript/LICENSE.txt +55 -0
- package/node_modules/typescript/README.md +50 -0
- package/node_modules/typescript/SECURITY.md +41 -0
- package/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
- package/node_modules/typescript/bin/tsc +2 -0
- package/node_modules/typescript/bin/tsserver +2 -0
- package/node_modules/typescript/lib/_tsc.js +133818 -0
- package/node_modules/typescript/lib/_tsserver.js +659 -0
- package/node_modules/typescript/lib/_typingsInstaller.js +222 -0
- package/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/lib.d.ts +22 -0
- package/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
- package/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
- package/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
- package/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
- package/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
- package/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
- package/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
- package/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
- package/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
- package/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
- package/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
- package/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
- package/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
- package/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
- package/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
- package/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
- package/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
- package/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
- package/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
- package/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
- package/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
- package/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
- package/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
- package/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
- package/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
- package/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
- package/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
- package/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
- package/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
- package/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
- package/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
- package/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
- package/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
- package/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
- package/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
- package/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
- package/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
- package/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
- package/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
- package/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
- package/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
- package/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
- package/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
- package/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
- package/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
- package/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
- package/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
- package/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
- package/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
- package/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
- package/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
- package/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
- package/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
- package/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
- package/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
- package/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
- package/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
- package/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
- package/node_modules/typescript/lib/lib.es6.d.ts +23 -0
- package/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
- package/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
- package/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
- package/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
- package/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
- package/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
- package/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
- package/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
- package/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
- package/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
- package/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
- package/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
- package/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
- package/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
- package/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
- package/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
- package/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
- package/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/tsc.js +8 -0
- package/node_modules/typescript/lib/tsserver.js +8 -0
- package/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
- package/node_modules/typescript/lib/tsserverlibrary.js +21 -0
- package/node_modules/typescript/lib/typesMap.json +497 -0
- package/node_modules/typescript/lib/typescript.d.ts +11437 -0
- package/node_modules/typescript/lib/typescript.js +200276 -0
- package/node_modules/typescript/lib/typingsInstaller.js +8 -0
- package/node_modules/typescript/lib/watchGuard.js +53 -0
- package/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
- package/node_modules/typescript/package.json +120 -0
- package/package.json +13 -8
- package/lib/coverage/fs-walk.mjs +0 -64
- package/lib/coverage/next-discovery.mjs +0 -205
- package/lib/coverage/next-static-analysis.mjs +0 -1045
- package/node_modules/@elench/testkit-bridge/src/index.mjs +0 -583
- package/node_modules/@elench/testkit-bridge/src/index.test.mjs +0 -409
- package/node_modules/@elench/testkit-protocol/src/index.d.ts +0 -231
- package/node_modules/@elench/testkit-protocol/src/index.mjs +0 -265
- package/node_modules/@elench/testkit-protocol/src/index.test.mjs +0 -242
- package/node_modules/@elench/ts-analysis/src/callables.mjs +0 -135
- package/node_modules/@elench/ts-analysis/src/callables.test.mjs +0 -55
- package/node_modules/@elench/ts-analysis/src/exports.mjs +0 -69
- package/node_modules/@elench/ts-analysis/src/exports.test.mjs +0 -50
- package/node_modules/@elench/ts-analysis/src/jsx.mjs +0 -69
- package/node_modules/@elench/ts-analysis/src/jsx.test.mjs +0 -43
- package/node_modules/@elench/ts-analysis/src/project.mjs +0 -100
- package/node_modules/@elench/ts-analysis/src/project.test.mjs +0 -54
- package/node_modules/@elench/ts-analysis/src/requests.mjs +0 -141
- package/node_modules/@elench/ts-analysis/src/requests.test.mjs +0 -35
- package/node_modules/@elench/ts-analysis/src/resolution.mjs +0 -53
- package/node_modules/@elench/ts-analysis/src/shared.mjs +0 -32
- package/node_modules/@elench/ts-analysis/src/syntax.mjs +0 -27
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ensureExistingPath
|
|
2
|
-
import {
|
|
1
|
+
import { ensureExistingPath } from "./paths.mjs";
|
|
2
|
+
import { validateConfiguredCollection } from "../shared/configured-steps.mjs";
|
|
3
3
|
|
|
4
4
|
export function validateConfigCoverage(configs) {
|
|
5
5
|
const names = new Set(configs.map((config) => config.name));
|
|
@@ -60,65 +60,21 @@ export function validateServiceConfig({
|
|
|
60
60
|
}
|
|
61
61
|
for (const [stageName, steps] of Object.entries(database?.template || {})) {
|
|
62
62
|
if (stageName === "inputs") continue;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
ensureExistingPath(
|
|
69
|
-
resolveServiceCwd(productDir, step.cwd || "."),
|
|
70
|
-
step.path,
|
|
71
|
-
`Service "${name}" database.template.${stageName} sql file`
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
if (step.kind === "module") {
|
|
75
|
-
const { modulePath } = parseModuleSpecifier(step.specifier);
|
|
76
|
-
ensureExistingPath(
|
|
77
|
-
resolveServiceCwd(productDir, step.cwd || "."),
|
|
78
|
-
modulePath,
|
|
79
|
-
`Service "${name}" database.template.${stageName} module`
|
|
80
|
-
);
|
|
81
|
-
}
|
|
82
|
-
for (const input of step.inputs || []) {
|
|
83
|
-
ensureExistingPath(
|
|
84
|
-
resolveServiceCwd(productDir, step.cwd || "."),
|
|
85
|
-
input,
|
|
86
|
-
`Service "${name}" database.template.${stageName} step input`
|
|
87
|
-
);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
for (const input of database?.template?.inputs || []) {
|
|
92
|
-
ensureExistingPath(productDir, input, `Service "${name}" database.template input`);
|
|
93
|
-
}
|
|
94
|
-
for (const step of runtime.prepare?.steps || []) {
|
|
95
|
-
if (step.cwd) {
|
|
96
|
-
ensureExistingPath(productDir, step.cwd, `Service "${name}" runtime.prepare step cwd`);
|
|
97
|
-
}
|
|
98
|
-
if (step.kind === "sql-file") {
|
|
99
|
-
ensureExistingPath(
|
|
100
|
-
resolveServiceCwd(productDir, step.cwd || "."),
|
|
101
|
-
step.path,
|
|
102
|
-
`Service "${name}" runtime.prepare sql file`
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
if (step.kind === "module") {
|
|
106
|
-
const { modulePath } = parseModuleSpecifier(step.specifier);
|
|
107
|
-
ensureExistingPath(
|
|
108
|
-
resolveServiceCwd(productDir, step.cwd || "."),
|
|
109
|
-
modulePath,
|
|
110
|
-
`Service "${name}" runtime.prepare module`
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
for (const input of step.inputs || []) {
|
|
114
|
-
ensureExistingPath(
|
|
115
|
-
resolveServiceCwd(productDir, step.cwd || "."),
|
|
116
|
-
input,
|
|
117
|
-
`Service "${name}" runtime.prepare step input`
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
for (const input of runtime.prepare?.inputs || []) {
|
|
122
|
-
ensureExistingPath(productDir, input, `Service "${name}" runtime.prepare input`);
|
|
63
|
+
validateConfiguredCollection({
|
|
64
|
+
productDir,
|
|
65
|
+
label: `Service "${name}" database.template.${stageName}`,
|
|
66
|
+
steps,
|
|
67
|
+
});
|
|
123
68
|
}
|
|
69
|
+
validateConfiguredCollection({
|
|
70
|
+
productDir,
|
|
71
|
+
label: `Service "${name}" database.template`,
|
|
72
|
+
inputs: database?.template?.inputs || [],
|
|
73
|
+
});
|
|
74
|
+
validateConfiguredCollection({
|
|
75
|
+
productDir,
|
|
76
|
+
label: `Service "${name}" runtime.prepare`,
|
|
77
|
+
inputs: runtime.prepare?.inputs || [],
|
|
78
|
+
steps: runtime.prepare?.steps || [],
|
|
79
|
+
});
|
|
124
80
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import {
|
|
4
|
+
collectImports,
|
|
5
|
+
createSourceFile,
|
|
4
6
|
extractExportedFunctionBody,
|
|
5
|
-
|
|
6
|
-
extractExportedMethodBodies,
|
|
7
|
+
resolveImportToSourceFile,
|
|
7
8
|
} from "@elench/ts-analysis";
|
|
8
9
|
import {
|
|
9
|
-
dedupeBackendImports,
|
|
10
|
-
dedupeDataImports,
|
|
11
10
|
dedupeEdges,
|
|
12
11
|
dedupeNodes,
|
|
13
12
|
hasWord,
|
|
@@ -15,7 +14,6 @@ import {
|
|
|
15
14
|
isDataSpecifier,
|
|
16
15
|
modulePathKey,
|
|
17
16
|
} from "./shared.mjs";
|
|
18
|
-
import { resolveImportToSourceFile } from "./fs-walk.mjs";
|
|
19
17
|
|
|
20
18
|
export function extractBackendImports({
|
|
21
19
|
serviceName,
|
|
@@ -26,34 +24,15 @@ export function extractBackendImports({
|
|
|
26
24
|
resolveImportToSourceFile: resolveImportAlias,
|
|
27
25
|
}) {
|
|
28
26
|
const resolveImportFn = resolveImportAlias || resolveImport;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (!isBackendSpecifier(specifier)) continue;
|
|
39
|
-
const resolvedFilePath = resolveImportFn(serviceRoot, filePath, specifier);
|
|
40
|
-
for (const importName of rawNames) {
|
|
41
|
-
imports.push({
|
|
42
|
-
importName,
|
|
43
|
-
node: {
|
|
44
|
-
id: `server_capability:${modulePathKey(resolvedFilePath || filePath)}#${importName}`,
|
|
45
|
-
kind: "server_capability",
|
|
46
|
-
service: serviceName,
|
|
47
|
-
label: importName,
|
|
48
|
-
filePath: resolvedFilePath || null,
|
|
49
|
-
metadata: {
|
|
50
|
-
specifier,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return dedupeBackendImports(imports);
|
|
27
|
+
return collectCapabilityImports({
|
|
28
|
+
serviceName,
|
|
29
|
+
serviceRoot,
|
|
30
|
+
filePath,
|
|
31
|
+
content,
|
|
32
|
+
resolveImportFn,
|
|
33
|
+
matchesSpecifier: isBackendSpecifier,
|
|
34
|
+
kind: "server_capability",
|
|
35
|
+
});
|
|
57
36
|
}
|
|
58
37
|
|
|
59
38
|
export function discoverDataCapabilities({ serviceName, serviceRoot, nodes, readFile = defaultReadFile }) {
|
|
@@ -97,63 +76,67 @@ export function extractDataImports({
|
|
|
97
76
|
resolveImportToSourceFile: resolveImportAlias,
|
|
98
77
|
}) {
|
|
99
78
|
const resolveImportFn = resolveImportAlias || resolveImport;
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
if (!isDataSpecifier(specifier)) continue;
|
|
110
|
-
const resolvedFilePath = resolveImportFn(serviceRoot, filePath, specifier);
|
|
111
|
-
for (const importName of rawNames) {
|
|
112
|
-
imports.push({
|
|
113
|
-
importName,
|
|
114
|
-
node: {
|
|
115
|
-
id: `data_capability:${modulePathKey(resolvedFilePath || filePath)}#${importName}`,
|
|
116
|
-
kind: "data_capability",
|
|
117
|
-
service: serviceName,
|
|
118
|
-
label: importName,
|
|
119
|
-
filePath: resolvedFilePath || null,
|
|
120
|
-
metadata: {
|
|
121
|
-
specifier,
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return dedupeDataImports(imports);
|
|
79
|
+
return collectCapabilityImports({
|
|
80
|
+
serviceName,
|
|
81
|
+
serviceRoot,
|
|
82
|
+
filePath,
|
|
83
|
+
content,
|
|
84
|
+
resolveImportFn,
|
|
85
|
+
matchesSpecifier: isDataSpecifier,
|
|
86
|
+
kind: "data_capability",
|
|
87
|
+
});
|
|
128
88
|
}
|
|
129
89
|
|
|
130
|
-
|
|
90
|
+
function defaultReadFile(filePath) {
|
|
91
|
+
if (!fs.existsSync(filePath)) return null;
|
|
92
|
+
return fs.readFileSync(filePath, "utf8");
|
|
93
|
+
}
|
|
131
94
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
95
|
+
function collectCapabilityImports({
|
|
96
|
+
serviceName,
|
|
97
|
+
serviceRoot,
|
|
98
|
+
filePath,
|
|
99
|
+
content,
|
|
100
|
+
resolveImportFn,
|
|
101
|
+
matchesSpecifier,
|
|
102
|
+
kind,
|
|
103
|
+
}) {
|
|
104
|
+
const sourceFile = createSourceFile(filePath, content);
|
|
105
|
+
const imports = collectImports(sourceFile, {
|
|
106
|
+
resolveImportPath: (specifier) => resolveImportFn(serviceRoot, filePath, specifier),
|
|
107
|
+
readSourceFile: () => null,
|
|
108
|
+
isServerActionFile: () => false,
|
|
109
|
+
});
|
|
137
110
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
111
|
+
const collected = [];
|
|
112
|
+
for (const [localName, imported] of imports.entries()) {
|
|
113
|
+
if (!matchesSpecifier(imported.specifier)) continue;
|
|
114
|
+
const exportName = imported.importedName === "default" ? localName : imported.importedName;
|
|
115
|
+
collected.push({
|
|
116
|
+
importName: localName,
|
|
117
|
+
node: {
|
|
118
|
+
id: `${kind}:${modulePathKey(imported.resolvedFilePath || filePath)}#${exportName}`,
|
|
119
|
+
kind,
|
|
120
|
+
service: serviceName,
|
|
121
|
+
label: exportName,
|
|
122
|
+
filePath: imported.resolvedFilePath || null,
|
|
123
|
+
metadata: {
|
|
124
|
+
specifier: imported.specifier,
|
|
125
|
+
localName,
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
});
|
|
152
129
|
}
|
|
153
|
-
|
|
130
|
+
|
|
131
|
+
return dedupeCapabilityImports(collected);
|
|
154
132
|
}
|
|
155
133
|
|
|
156
|
-
function
|
|
157
|
-
|
|
158
|
-
return
|
|
134
|
+
function dedupeCapabilityImports(entries) {
|
|
135
|
+
const seen = new Set();
|
|
136
|
+
return entries.filter((entry) => {
|
|
137
|
+
const key = `${entry.importName}:${entry.node.id}:${entry.node.filePath || ""}`;
|
|
138
|
+
if (seen.has(key)) return false;
|
|
139
|
+
seen.add(key);
|
|
140
|
+
return true;
|
|
141
|
+
});
|
|
159
142
|
}
|
|
@@ -1,52 +1,61 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
import { extractBackendImports, extractDataImports } from "./backend-discovery.mjs";
|
|
3
|
+
|
|
4
|
+
describe("coverage backend discovery", () => {
|
|
5
|
+
it("tracks local import names while anchoring capabilities to exported names", () => {
|
|
6
|
+
const content = [
|
|
7
|
+
'import { saveSettings as persistSettings } from "@/backend/server/settings";',
|
|
8
|
+
'import { loadProjects as fetchProjects } from "@/backend/data/projects";',
|
|
9
|
+
].join("\n");
|
|
10
|
+
|
|
11
|
+
expect(
|
|
12
|
+
extractBackendImports({
|
|
13
|
+
serviceName: "web",
|
|
14
|
+
serviceRoot: "/repo",
|
|
15
|
+
filePath: "src/app/settings/actions.ts",
|
|
16
|
+
content,
|
|
17
|
+
resolveImport: () => "src/backend/server/settings.ts",
|
|
18
|
+
})
|
|
19
|
+
).toEqual([
|
|
20
|
+
{
|
|
21
|
+
importName: "persistSettings",
|
|
22
|
+
node: {
|
|
23
|
+
id: "server_capability:src/backend/server/settings#saveSettings",
|
|
24
|
+
kind: "server_capability",
|
|
25
|
+
service: "web",
|
|
26
|
+
label: "saveSettings",
|
|
27
|
+
filePath: "src/backend/server/settings.ts",
|
|
28
|
+
metadata: {
|
|
29
|
+
specifier: "@/backend/server/settings",
|
|
30
|
+
localName: "persistSettings",
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
},
|
|
25
34
|
]);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("extracts named exported functions and their bodies", () => {
|
|
29
|
-
const content = `
|
|
30
|
-
export async function saveSettings() {
|
|
31
|
-
return updateSettings();
|
|
32
|
-
}
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
expect(
|
|
37
|
+
extractDataImports({
|
|
38
|
+
serviceName: "web",
|
|
39
|
+
serviceRoot: "/repo",
|
|
40
|
+
filePath: "src/backend/server/settings.ts",
|
|
41
|
+
content,
|
|
42
|
+
resolveImport: () => "src/backend/data/projects.ts",
|
|
43
|
+
})
|
|
44
|
+
).toEqual([
|
|
45
|
+
{
|
|
46
|
+
importName: "fetchProjects",
|
|
47
|
+
node: {
|
|
48
|
+
id: "data_capability:src/backend/data/projects#loadProjects",
|
|
49
|
+
kind: "data_capability",
|
|
50
|
+
service: "web",
|
|
51
|
+
label: "loadProjects",
|
|
52
|
+
filePath: "src/backend/data/projects.ts",
|
|
53
|
+
metadata: {
|
|
54
|
+
specifier: "@/backend/data/projects",
|
|
55
|
+
localName: "fetchProjects",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
},
|
|
42
59
|
]);
|
|
43
|
-
expect(extractExportedFunctionBody(content, "saveSettings")).toContain("updateSettings");
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it("reads a balanced block from a brace offset", () => {
|
|
47
|
-
const content = `before { const tpl = \`{nested}\`; return tpl; } after`;
|
|
48
|
-
const startIndex = content.indexOf("{");
|
|
49
|
-
|
|
50
|
-
expect(readBalancedBlock(content, startIndex)).toBe("{ const tpl = `{nested}`; return tpl; }");
|
|
51
60
|
});
|
|
52
61
|
});
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import {
|
|
3
|
+
import { extractHttpRequests, extractPlaywrightVisitedRoutes } from "@elench/ts-analysis";
|
|
4
4
|
import {
|
|
5
5
|
apiRouteLookupKey,
|
|
6
|
+
DYNAMIC_SEGMENT_TOKEN,
|
|
6
7
|
HTTP_METHODS,
|
|
7
8
|
dedupeTargets,
|
|
8
9
|
findMatchingApiRouteEntry,
|
|
9
10
|
findMatchingRouteValue,
|
|
11
|
+
normalizeRoute,
|
|
10
12
|
toApiRequestPath,
|
|
11
13
|
toSelectionType,
|
|
12
14
|
} from "./shared.mjs";
|
|
@@ -36,7 +38,13 @@ export function inferCoveredNodeIdsForTest(entry, context) {
|
|
|
36
38
|
|
|
37
39
|
// Capability: Playwright page routes (content-first, path-fallback)
|
|
38
40
|
if (entry.framework === "playwright") {
|
|
39
|
-
const gotoRoutes = content
|
|
41
|
+
const gotoRoutes = content
|
|
42
|
+
? extractPlaywrightVisitedRoutes(content, {
|
|
43
|
+
filePath: entry.filePath,
|
|
44
|
+
normalizeRoute,
|
|
45
|
+
dynamicSegmentToken: DYNAMIC_SEGMENT_TOKEN,
|
|
46
|
+
})
|
|
47
|
+
: [];
|
|
40
48
|
const routes = gotoRoutes.length > 0
|
|
41
49
|
? gotoRoutes
|
|
42
50
|
: (() => { const r = inferPageRouteFromTestFile(entry.filePath, context.nextAppRoot, context.serviceRoot); return r ? [r] : []; })();
|
|
@@ -56,7 +64,11 @@ export function inferCoveredNodeIdsForTest(entry, context) {
|
|
|
56
64
|
|
|
57
65
|
// Capability: HTTP request extraction (any test type with rawReq/fetch/wrapper calls)
|
|
58
66
|
if (content) {
|
|
59
|
-
const requests =
|
|
67
|
+
const requests = extractHttpRequests(content, {
|
|
68
|
+
filePath: entry.filePath,
|
|
69
|
+
normalizeRoute,
|
|
70
|
+
dynamicSegmentToken: DYNAMIC_SEGMENT_TOKEN,
|
|
71
|
+
});
|
|
60
72
|
for (const request of requests) {
|
|
61
73
|
if (!request.path.startsWith("/api/")) continue;
|
|
62
74
|
const routeEntry = resolveApiRouteEntry(context, request.method, request.path);
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
extractPlaywrightTargetsFromContent,
|
|
5
5
|
inferDataCapabilitiesFromOwner,
|
|
6
6
|
} from "./evidence.mjs";
|
|
7
|
-
import { extractPlaywrightVisitedRoutes } from "
|
|
7
|
+
import { extractPlaywrightVisitedRoutes } from "@elench/ts-analysis";
|
|
8
8
|
import { DYNAMIC_SEGMENT_TOKEN } from "./shared.mjs";
|
|
9
9
|
|
|
10
10
|
describe("coverage evidence helpers", () => {
|
|
@@ -60,19 +60,28 @@ describe("extractPlaywrightVisitedRoutes", () => {
|
|
|
60
60
|
await page.goto("https://external.com/path"); // external
|
|
61
61
|
await page.goto("http://localhost:3000/events"); // same-origin absolute
|
|
62
62
|
});
|
|
63
|
-
`,
|
|
63
|
+
`, {
|
|
64
|
+
filePath: "nav.pw.testkit.ts",
|
|
65
|
+
dynamicSegmentToken: DYNAMIC_SEGMENT_TOKEN,
|
|
66
|
+
})).toEqual(["/dashboard", "/settings/profile", "/events"]);
|
|
64
67
|
});
|
|
65
68
|
|
|
66
69
|
it("handles property chain: foo.page.goto()", () => {
|
|
67
70
|
expect(extractPlaywrightVisitedRoutes(`
|
|
68
71
|
await this.page.goto("/projects");
|
|
69
|
-
`,
|
|
72
|
+
`, {
|
|
73
|
+
filePath: "test.pw.testkit.ts",
|
|
74
|
+
dynamicSegmentToken: DYNAMIC_SEGMENT_TOKEN,
|
|
75
|
+
})).toEqual(["/projects"]);
|
|
70
76
|
});
|
|
71
77
|
|
|
72
78
|
it("normalizes dynamic goto expressions into route patterns", () => {
|
|
73
79
|
expect(extractPlaywrightVisitedRoutes(`
|
|
74
80
|
await page.goto(\`/projects/\${id}\`);
|
|
75
81
|
await page.goto(someVar);
|
|
76
|
-
`,
|
|
82
|
+
`, {
|
|
83
|
+
filePath: "test.pw.testkit.ts",
|
|
84
|
+
dynamicSegmentToken: DYNAMIC_SEGMENT_TOKEN,
|
|
85
|
+
})).toEqual([`/projects/${DYNAMIC_SEGMENT_TOKEN}`]);
|
|
77
86
|
});
|
|
78
87
|
});
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { discoverDataCapabilities } from "./backend-discovery.mjs";
|
|
2
2
|
import { buildEvidenceDetails, inferCoveredNodeIdsForTest } from "./evidence.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { discoverApiRoutes, discoverPageViews, discoverServerActions } from "./next-discovery.mjs";
|
|
3
|
+
import { convertNextAnalysisToGraph } from "./next-ir-to-graph.mjs";
|
|
5
4
|
import {
|
|
6
5
|
appendGraph,
|
|
7
6
|
createEmptyGraph,
|
|
@@ -11,6 +10,8 @@ import {
|
|
|
11
10
|
toSelectionType,
|
|
12
11
|
} from "./shared.mjs";
|
|
13
12
|
import { DEFAULT_DISCOVERY_EXCLUDES, normalizeDiscoveryConfig } from "../discovery/path-policy.mjs";
|
|
13
|
+
import { resolveServiceCwd } from "../config/paths.mjs";
|
|
14
|
+
import { createNextAnalysisProject } from "@elench/next-analysis";
|
|
14
15
|
|
|
15
16
|
export function buildCoverageGraph({ productDir, repoDiscovery = {}, services = {}, discoveryFiles = [] }) {
|
|
16
17
|
const graph = createEmptyGraph();
|
|
@@ -84,9 +85,7 @@ export function buildCoverageGraph({ productDir, repoDiscovery = {}, services =
|
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
export function buildServiceCoverageContext(productDir, serviceName, config, repoDiscovery = {}) {
|
|
87
|
-
const serviceRoot =
|
|
88
|
-
const nextAppRoot = findNextAppRoot(serviceRoot);
|
|
89
|
-
if (!nextAppRoot) return null;
|
|
88
|
+
const serviceRoot = resolveServiceCwd(productDir, config?.local?.cwd || ".");
|
|
90
89
|
const serviceDiscovery = normalizeDiscoveryConfig(config?.discovery, { allowRoots: true });
|
|
91
90
|
const exclude = [
|
|
92
91
|
...new Set([
|
|
@@ -95,42 +94,42 @@ export function buildServiceCoverageContext(productDir, serviceName, config, rep
|
|
|
95
94
|
...((serviceDiscovery.exclude || []).map(normalizePath)),
|
|
96
95
|
]),
|
|
97
96
|
];
|
|
97
|
+
const nextProject = createNextAnalysisProject({ rootDir: serviceRoot, exclude });
|
|
98
|
+
const nextAppRoot = nextProject.findAppRoot();
|
|
99
|
+
if (!nextAppRoot) return null;
|
|
98
100
|
|
|
99
101
|
const graph = createEmptyGraph();
|
|
100
|
-
const
|
|
102
|
+
const pages = nextProject.discoverPages();
|
|
103
|
+
const apiRoutes = nextProject.discoverApiRoutes();
|
|
104
|
+
const serverActions = nextProject.discoverServerActions();
|
|
105
|
+
const routeTrees = pages.map((page) => nextProject.analyzeRouteTree(page.route)).filter(Boolean);
|
|
106
|
+
const converted = convertNextAnalysisToGraph({
|
|
101
107
|
serviceName,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
};
|
|
107
|
-
const pages = discoverPageViews(discoveryOptions);
|
|
108
|
-
const apiRoutes = discoverApiRoutes(discoveryOptions);
|
|
109
|
-
const serverActions = discoverServerActions({
|
|
110
|
-
serviceName,
|
|
111
|
-
serviceRoot,
|
|
112
|
-
exclude,
|
|
113
|
-
resolveImportToSourceFile,
|
|
108
|
+
pages,
|
|
109
|
+
apiRoutes,
|
|
110
|
+
serverActions,
|
|
111
|
+
routeTrees,
|
|
114
112
|
});
|
|
115
113
|
|
|
116
|
-
for (const node of
|
|
117
|
-
for (const edge of
|
|
114
|
+
for (const node of converted.nodes) graph.nodes.push(node);
|
|
115
|
+
for (const edge of converted.edges) graph.edges.push(edge);
|
|
118
116
|
|
|
119
117
|
const dataAugmentation = discoverDataCapabilities({ serviceName, serviceRoot, nodes: graph.nodes });
|
|
120
118
|
for (const node of dataAugmentation.nodes) graph.nodes.push(node);
|
|
121
119
|
for (const edge of dataAugmentation.edges) graph.edges.push(edge);
|
|
120
|
+
for (const diagnostic of nextProject.getDiagnostics()) graph.diagnostics.push(diagnostic);
|
|
122
121
|
|
|
123
|
-
const pageByRoute = new Map(
|
|
122
|
+
const pageByRoute = new Map(converted.pageEntries.map((entry) => [entry.route, entry]));
|
|
124
123
|
const apiRouteByKey = new Map(
|
|
125
|
-
|
|
124
|
+
converted.routeEntries.map((entry) => [`${entry.method}:${entry.requestPath}`, entry])
|
|
126
125
|
);
|
|
127
126
|
const serverActionByExportKey = new Map(
|
|
128
|
-
|
|
127
|
+
converted.actionEntries.map((entry) => [`${entry.sourceFile}#${entry.exportName}`, entry])
|
|
129
128
|
);
|
|
130
129
|
|
|
131
|
-
for (const pageEntry of
|
|
130
|
+
for (const pageEntry of converted.pageEntries) {
|
|
132
131
|
for (const request of pageEntry.requests) {
|
|
133
|
-
const apiRoute = findMatchingApiRouteEntry(request.method, request.path,
|
|
132
|
+
const apiRoute = findMatchingApiRouteEntry(request.method, request.path, converted.routeEntries);
|
|
134
133
|
if (!apiRoute) continue;
|
|
135
134
|
graph.edges.push({
|
|
136
135
|
id: `handles:${request.node.id}:${apiRoute.node.id}`,
|
|
@@ -161,7 +160,7 @@ export function buildServiceCoverageContext(productDir, serviceName, config, rep
|
|
|
161
160
|
graph,
|
|
162
161
|
pageByRoute,
|
|
163
162
|
apiRouteByKey,
|
|
164
|
-
apiRouteEntries:
|
|
163
|
+
apiRouteEntries: converted.routeEntries,
|
|
165
164
|
serverActionByExportKey,
|
|
166
165
|
dataCapabilities: dataAugmentation.nodes,
|
|
167
166
|
};
|