@sfdc-webapps/cli 1.0.2
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/README.md +1414 -0
- package/dist/commands/apply-patches.d.ts +23 -0
- package/dist/commands/apply-patches.d.ts.map +1 -0
- package/dist/commands/apply-patches.js +524 -0
- package/dist/commands/apply-patches.js.map +1 -0
- package/dist/commands/new-app-feature.d.ts +7 -0
- package/dist/commands/new-app-feature.d.ts.map +1 -0
- package/dist/commands/new-app-feature.js +166 -0
- package/dist/commands/new-app-feature.js.map +1 -0
- package/dist/commands/new-app.d.ts +1 -0
- package/dist/commands/new-app.d.ts.map +1 -0
- package/dist/commands/new-app.js +2 -0
- package/dist/commands/new-app.js.map +1 -0
- package/dist/commands/watch-patches.d.ts +6 -0
- package/dist/commands/watch-patches.d.ts.map +1 -0
- package/dist/commands/watch-patches.js +152 -0
- package/dist/commands/watch-patches.js.map +1 -0
- package/dist/core/dependency-resolver.d.ts +40 -0
- package/dist/core/dependency-resolver.d.ts.map +1 -0
- package/dist/core/dependency-resolver.js +122 -0
- package/dist/core/dependency-resolver.js.map +1 -0
- package/dist/core/file-operations.d.ts +37 -0
- package/dist/core/file-operations.d.ts.map +1 -0
- package/dist/core/file-operations.js +201 -0
- package/dist/core/file-operations.js.map +1 -0
- package/dist/core/package-json-merger.d.ts +30 -0
- package/dist/core/package-json-merger.d.ts.map +1 -0
- package/dist/core/package-json-merger.js +104 -0
- package/dist/core/package-json-merger.js.map +1 -0
- package/dist/core/patch-loader.d.ts +17 -0
- package/dist/core/patch-loader.d.ts.map +1 -0
- package/dist/core/patch-loader.js +100 -0
- package/dist/core/patch-loader.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +90 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +21 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/debounce.d.ts +6 -0
- package/dist/utils/debounce.d.ts.map +1 -0
- package/dist/utils/debounce.js +19 -0
- package/dist/utils/debounce.js.map +1 -0
- package/dist/utils/import-merger.d.ts +12 -0
- package/dist/utils/import-merger.d.ts.map +1 -0
- package/dist/utils/import-merger.js +240 -0
- package/dist/utils/import-merger.js.map +1 -0
- package/dist/utils/logger.d.ts +6 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +17 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/path-mappings.d.ts +88 -0
- package/dist/utils/path-mappings.d.ts.map +1 -0
- package/dist/utils/path-mappings.js +138 -0
- package/dist/utils/path-mappings.js.map +1 -0
- package/dist/utils/paths.d.ts +43 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +107 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/route-merger.d.ts +107 -0
- package/dist/utils/route-merger.d.ts.map +1 -0
- package/dist/utils/route-merger.js +303 -0
- package/dist/utils/route-merger.js.map +1 -0
- package/dist/utils/validation.d.ts +29 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +109 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +39 -0
- package/src/commands/apply-patches.ts +594 -0
- package/src/commands/new-app-feature.ts +203 -0
- package/src/commands/new-app.ts +0 -0
- package/src/commands/watch-patches.ts +173 -0
- package/src/core/dependency-resolver.ts +175 -0
- package/src/core/file-operations.ts +265 -0
- package/src/core/package-json-merger.ts +129 -0
- package/src/core/patch-loader.ts +128 -0
- package/src/index.ts +95 -0
- package/src/types.ts +23 -0
- package/src/utils/debounce.ts +23 -0
- package/src/utils/import-merger.ts +293 -0
- package/src/utils/logger.ts +21 -0
- package/src/utils/path-mappings.ts +154 -0
- package/src/utils/paths.ts +121 -0
- package/src/utils/route-merger.ts +357 -0
- package/src/utils/validation.ts +150 -0
- package/test/e2e/E2E_TEST_FIXTURES.md +509 -0
- package/test/e2e/apply-patches.spec.ts +861 -0
- package/test/e2e/fixtures/base-app/digitalExperiences/webApplications/base-app/package.json +10 -0
- package/test/e2e/fixtures/base-app/digitalExperiences/webApplications/base-app/src/appLayout.tsx +27 -0
- package/test/e2e/fixtures/base-app/digitalExperiences/webApplications/base-app/src/home.tsx +8 -0
- package/test/e2e/fixtures/base-app/digitalExperiences/webApplications/base-app/src/index.tsx +10 -0
- package/test/e2e/fixtures/base-app/digitalExperiences/webApplications/base-app/src/old-page.tsx +8 -0
- package/test/e2e/fixtures/base-app/digitalExperiences/webApplications/base-app/src/routes.tsx +23 -0
- package/test/e2e/fixtures/base-app/digitalExperiences/webApplications/base-app/src/styles/global.css +14 -0
- package/test/e2e/fixtures/basic-operations/dep-chain-linear/feature.ts +11 -0
- package/test/e2e/fixtures/basic-operations/dep-chain-linear/template/digitalExperiences/webApplications/dep-chain-linear/src/__inherit__appLayout.tsx +27 -0
- package/test/e2e/fixtures/basic-operations/dep-chain-linear/template/digitalExperiences/webApplications/dep-chain-linear/src/contact.tsx +8 -0
- package/test/e2e/fixtures/basic-operations/dep-chain-linear/template/digitalExperiences/webApplications/dep-chain-linear/src/routes.tsx +17 -0
- package/test/e2e/fixtures/basic-operations/feature-file-inherit-route-add/feature.ts +10 -0
- package/test/e2e/fixtures/basic-operations/feature-file-inherit-route-add/template/digitalExperiences/webApplications/feature-file-inherit-route-add/src/__inherit__appLayout.tsx +27 -0
- package/test/e2e/fixtures/basic-operations/feature-file-inherit-route-add/template/digitalExperiences/webApplications/feature-file-inherit-route-add/src/__inherit__home.tsx +0 -0
- package/test/e2e/fixtures/basic-operations/feature-file-inherit-route-add/template/digitalExperiences/webApplications/feature-file-inherit-route-add/src/about.tsx +8 -0
- package/test/e2e/fixtures/basic-operations/feature-file-inherit-route-add/template/digitalExperiences/webApplications/feature-file-inherit-route-add/src/routes.tsx +17 -0
- package/test/e2e/fixtures/basic-operations/feature-file-prepend-append/feature.ts +10 -0
- package/test/e2e/fixtures/basic-operations/feature-file-prepend-append/template/digitalExperiences/webApplications/feature-file-prepend-append/src/__inherit__appLayout.tsx +27 -0
- package/test/e2e/fixtures/basic-operations/feature-file-prepend-append/template/digitalExperiences/webApplications/feature-file-prepend-append/src/__prepend__index.tsx +2 -0
- package/test/e2e/fixtures/basic-operations/feature-file-prepend-append/template/digitalExperiences/webApplications/feature-file-prepend-append/src/routes.tsx +17 -0
- package/test/e2e/fixtures/basic-operations/feature-file-prepend-append/template/digitalExperiences/webApplications/feature-file-prepend-append/src/settings.tsx +9 -0
- package/test/e2e/fixtures/basic-operations/feature-file-prepend-append/template/digitalExperiences/webApplications/feature-file-prepend-append/src/styles/__append__global.css +10 -0
- package/test/e2e/fixtures/basic-operations/feature-file-route-delete/feature.ts +10 -0
- package/test/e2e/fixtures/basic-operations/feature-file-route-delete/template/digitalExperiences/webApplications/feature-file-route-delete/src/__delete__old-page.tsx +2 -0
- package/test/e2e/fixtures/basic-operations/feature-file-route-delete/template/digitalExperiences/webApplications/feature-file-route-delete/src/__inherit__appLayout.tsx +27 -0
- package/test/e2e/fixtures/basic-operations/feature-file-route-delete/template/digitalExperiences/webApplications/feature-file-route-delete/src/routes.tsx +16 -0
- package/test/e2e/fixtures/composition-5-features/5-features-about/feature.ts +3 -0
- package/test/e2e/fixtures/composition-5-features/5-features-about/template/digitalExperiences/webApplications/5-features-about/src/about.tsx +8 -0
- package/test/e2e/fixtures/composition-5-features/5-features-about/template/digitalExperiences/webApplications/5-features-about/src/routes.tsx +17 -0
- package/test/e2e/fixtures/composition-5-features/5-features-analytics/feature.ts +3 -0
- package/test/e2e/fixtures/composition-5-features/5-features-analytics/template/digitalExperiences/webApplications/5-features-analytics/src/__prepend__index.tsx +2 -0
- package/test/e2e/fixtures/composition-5-features/5-features-footer/feature.ts +3 -0
- package/test/e2e/fixtures/composition-5-features/5-features-footer/template/digitalExperiences/webApplications/5-features-footer/src/footer.tsx +7 -0
- package/test/e2e/fixtures/composition-5-features/5-features-footer/template/digitalExperiences/webApplications/5-features-footer/src/routes.tsx +17 -0
- package/test/e2e/fixtures/composition-5-features/5-features-navigation/feature.ts +3 -0
- package/test/e2e/fixtures/composition-5-features/5-features-navigation/template/digitalExperiences/webApplications/5-features-navigation/src/navigation.tsx +7 -0
- package/test/e2e/fixtures/composition-5-features/5-features-navigation/template/digitalExperiences/webApplications/5-features-navigation/src/routes.tsx +17 -0
- package/test/e2e/fixtures/composition-5-features/5-features-theme/feature.ts +3 -0
- package/test/e2e/fixtures/composition-5-features/5-features-theme/template/digitalExperiences/webApplications/5-features-theme/src/styles/__append__global.css +5 -0
- package/test/e2e/fixtures/composition-append/composition-append-1/feature.ts +10 -0
- package/test/e2e/fixtures/composition-append/composition-append-1/template/digitalExperiences/webApplications/composition-append-1/src/styles/__append__global.css +4 -0
- package/test/e2e/fixtures/composition-append/composition-append-2/feature.ts +10 -0
- package/test/e2e/fixtures/composition-append/composition-append-2/template/digitalExperiences/webApplications/composition-append-2/src/styles/__append__global.css +4 -0
- package/test/e2e/fixtures/composition-append/composition-append-3/feature.ts +10 -0
- package/test/e2e/fixtures/composition-append/composition-append-3/template/digitalExperiences/webApplications/composition-append-3/src/styles/__append__global.css +4 -0
- package/test/e2e/fixtures/composition-inherit-modify/composition-inherit-layout/feature.ts +3 -0
- package/test/e2e/fixtures/composition-inherit-modify/composition-inherit-layout/template/digitalExperiences/webApplications/composition-inherit-layout/src/__inherit__appLayout.tsx +1 -0
- package/test/e2e/fixtures/composition-inherit-modify/composition-modify-layout/feature.ts +3 -0
- package/test/e2e/fixtures/composition-inherit-modify/composition-modify-layout/template/digitalExperiences/webApplications/composition-modify-layout/src/__append__appLayout.tsx +2 -0
- package/test/e2e/fixtures/composition-prepend/composition-prepend-1/feature.ts +10 -0
- package/test/e2e/fixtures/composition-prepend/composition-prepend-1/template/digitalExperiences/webApplications/composition-prepend-1/src/__prepend__index.tsx +2 -0
- package/test/e2e/fixtures/composition-prepend/composition-prepend-2/feature.ts +10 -0
- package/test/e2e/fixtures/composition-prepend/composition-prepend-2/template/digitalExperiences/webApplications/composition-prepend-2/src/__prepend__index.tsx +2 -0
- package/test/e2e/fixtures/composition-prepend/composition-prepend-3/feature.ts +10 -0
- package/test/e2e/fixtures/composition-prepend/composition-prepend-3/template/digitalExperiences/webApplications/composition-prepend-3/src/__prepend__index.tsx +2 -0
- package/test/e2e/fixtures/dep-chain-long/dep-chain-a/feature.ts +11 -0
- package/test/e2e/fixtures/dep-chain-long/dep-chain-a/template/digitalExperiences/webApplications/dep-chain-a/src/page-a.tsx +8 -0
- package/test/e2e/fixtures/dep-chain-long/dep-chain-a/template/digitalExperiences/webApplications/dep-chain-a/src/routes.tsx +17 -0
- package/test/e2e/fixtures/dep-chain-long/dep-chain-b/feature.ts +11 -0
- package/test/e2e/fixtures/dep-chain-long/dep-chain-b/template/digitalExperiences/webApplications/dep-chain-b/src/page-b.tsx +8 -0
- package/test/e2e/fixtures/dep-chain-long/dep-chain-b/template/digitalExperiences/webApplications/dep-chain-b/src/routes.tsx +17 -0
- package/test/e2e/fixtures/dep-chain-long/dep-chain-c/feature.ts +11 -0
- package/test/e2e/fixtures/dep-chain-long/dep-chain-c/template/digitalExperiences/webApplications/dep-chain-c/src/page-c.tsx +8 -0
- package/test/e2e/fixtures/dep-chain-long/dep-chain-c/template/digitalExperiences/webApplications/dep-chain-c/src/routes.tsx +17 -0
- package/test/e2e/fixtures/dep-chain-long/dep-chain-d/feature.ts +10 -0
- package/test/e2e/fixtures/dep-chain-long/dep-chain-d/template/digitalExperiences/webApplications/dep-chain-d/src/page-d.tsx +8 -0
- package/test/e2e/fixtures/dep-chain-long/dep-chain-d/template/digitalExperiences/webApplications/dep-chain-d/src/routes.tsx +17 -0
- package/test/e2e/fixtures/dep-circular/dep-circular-a/feature.ts +11 -0
- package/test/e2e/fixtures/dep-circular/dep-circular-a/template/digitalExperiences/webApplications/dep-circular-a/src/page-a.tsx +8 -0
- package/test/e2e/fixtures/dep-circular/dep-circular-b/feature.ts +11 -0
- package/test/e2e/fixtures/dep-circular/dep-circular-b/template/digitalExperiences/webApplications/dep-circular-b/src/page-b.tsx +8 -0
- package/test/e2e/fixtures/dep-complex-graph/README.md +119 -0
- package/test/e2e/fixtures/dep-complex-graph/create-placeholders.sh +25 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-auth/feature.ts +14 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-auth/template/digitalExperiences/webApplications/dep-complex-graph-auth/src/__delete__old-page.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-auth/template/digitalExperiences/webApplications/dep-complex-graph-auth/src/__inherit__appLayout.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-auth/template/digitalExperiences/webApplications/dep-complex-graph-auth/src/login.tsx +8 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-auth/template/digitalExperiences/webApplications/dep-complex-graph-auth/src/routes.tsx +29 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-auth/template/digitalExperiences/webApplications/dep-complex-graph-auth/src/signup.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-dashboard/feature.ts +14 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-dashboard/template/digitalExperiences/webApplications/dep-complex-graph-dashboard/src/__inherit__appLayout.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-dashboard/template/digitalExperiences/webApplications/dep-complex-graph-dashboard/src/analytics.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-dashboard/template/digitalExperiences/webApplications/dep-complex-graph-dashboard/src/dashboard.tsx +8 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-dashboard/template/digitalExperiences/webApplications/dep-complex-graph-dashboard/src/reports.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-dashboard/template/digitalExperiences/webApplications/dep-complex-graph-dashboard/src/routes.tsx +32 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-profile/feature.ts +14 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-profile/template/digitalExperiences/webApplications/dep-complex-graph-profile/src/__inherit__appLayout.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-profile/template/digitalExperiences/webApplications/dep-complex-graph-profile/src/profile-edit.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-profile/template/digitalExperiences/webApplications/dep-complex-graph-profile/src/profile.tsx +8 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-profile/template/digitalExperiences/webApplications/dep-complex-graph-profile/src/routes.tsx +26 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-shared-components/feature.ts +14 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-shared-components/template/digitalExperiences/webApplications/dep-complex-graph-shared-components/src/__inherit__appLayout.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-shared-components/template/digitalExperiences/webApplications/dep-complex-graph-shared-components/src/components.tsx +8 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-shared-components/template/digitalExperiences/webApplications/dep-complex-graph-shared-components/src/routes.tsx +18 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-shared-types/feature.ts +10 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-shared-types/template/digitalExperiences/webApplications/dep-complex-graph-shared-types/src/__inherit__appLayout.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-shared-types/template/digitalExperiences/webApplications/dep-complex-graph-shared-types/src/routes.tsx +17 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-shared-types/template/digitalExperiences/webApplications/dep-complex-graph-shared-types/src/types.tsx +8 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-shared-utils/feature.ts +10 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-shared-utils/template/digitalExperiences/webApplications/dep-complex-graph-shared-utils/src/__inherit__appLayout.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-shared-utils/template/digitalExperiences/webApplications/dep-complex-graph-shared-utils/src/routes.tsx +18 -0
- package/test/e2e/fixtures/dep-complex-graph/dep-complex-graph-shared-utils/template/digitalExperiences/webApplications/dep-complex-graph-shared-utils/src/tools.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/feature.ts +15 -0
- package/test/e2e/fixtures/dep-complex-graph/template/digitalExperiences/webApplications/dep-complex-graph/src/__inherit__appLayout.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/template/digitalExperiences/webApplications/dep-complex-graph/src/admin-dashboard.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/template/digitalExperiences/webApplications/dep-complex-graph/src/admin-layout.tsx +1 -0
- package/test/e2e/fixtures/dep-complex-graph/template/digitalExperiences/webApplications/dep-complex-graph/src/routes.tsx +24 -0
- package/test/e2e/fixtures/dep-diamond/dep-diamond-left/feature.ts +11 -0
- package/test/e2e/fixtures/dep-diamond/dep-diamond-left/template/digitalExperiences/webApplications/dep-diamond-left/src/left-page.tsx +8 -0
- package/test/e2e/fixtures/dep-diamond/dep-diamond-left/template/digitalExperiences/webApplications/dep-diamond-left/src/routes.tsx +17 -0
- package/test/e2e/fixtures/dep-diamond/dep-diamond-right/feature.ts +11 -0
- package/test/e2e/fixtures/dep-diamond/dep-diamond-right/template/digitalExperiences/webApplications/dep-diamond-right/src/right-page.tsx +8 -0
- package/test/e2e/fixtures/dep-diamond/dep-diamond-right/template/digitalExperiences/webApplications/dep-diamond-right/src/routes.tsx +17 -0
- package/test/e2e/fixtures/dep-diamond/dep-diamond-shared/feature.ts +10 -0
- package/test/e2e/fixtures/dep-diamond/dep-diamond-shared/template/digitalExperiences/webApplications/dep-diamond-shared/src/routes.tsx +17 -0
- package/test/e2e/fixtures/dep-diamond/dep-diamond-shared/template/digitalExperiences/webApplications/dep-diamond-shared/src/shared-utils.tsx +8 -0
- package/test/e2e/fixtures/edges/edge-binary-files/feature.ts +13 -0
- package/test/e2e/fixtures/edges/edge-binary-files/template/digitalExperiences/webApplications/edge-binary-files/src/__inherit__appLayout.tsx +1 -0
- package/test/e2e/fixtures/edges/edge-binary-files/template/digitalExperiences/webApplications/edge-binary-files/src/assets/test-image.png +0 -0
- package/test/e2e/fixtures/edges/edge-binary-files/template/digitalExperiences/webApplications/edge-binary-files/src/placeholder.tsx +0 -0
- package/test/e2e/fixtures/edges/edge-conflicting-prefixes/feature.ts +13 -0
- package/test/e2e/fixtures/edges/edge-conflicting-prefixes/template/digitalExperiences/webApplications/edge-conflicting-prefixes/src/__inherit____delete__conflicting.tsx +5 -0
- package/test/e2e/fixtures/edges/edge-conflicting-prefixes/template/digitalExperiences/webApplications/edge-conflicting-prefixes/src/placeholder.tsx +0 -0
- package/test/e2e/fixtures/edges/edge-empty-feature/feature.ts +16 -0
- package/test/e2e/fixtures/edges/edge-empty-feature/template/digitalExperiences/webApplications/edge-empty-feature/src/placeholder.tsx +0 -0
- package/test/e2e/fixtures/edges/edge-invalid-routes/feature.ts +12 -0
- package/test/e2e/fixtures/edges/edge-invalid-routes/template/digitalExperiences/webApplications/edge-invalid-routes/src/placeholder.tsx +0 -0
- package/test/e2e/fixtures/edges/edge-invalid-routes/template/digitalExperiences/webApplications/edge-invalid-routes/src/routes.tsx +8 -0
- package/test/e2e/fixtures/edges/edge-line-endings/feature.ts +13 -0
- package/test/e2e/fixtures/edges/edge-line-endings/template/digitalExperiences/webApplications/edge-line-endings/src/__prepend__index.tsx +2 -0
- package/test/e2e/fixtures/edges/edge-line-endings/template/digitalExperiences/webApplications/edge-line-endings/src/crlf.tsx +4 -0
- package/test/e2e/fixtures/edges/edge-line-endings/template/digitalExperiences/webApplications/edge-line-endings/src/placeholder.tsx +0 -0
- package/test/e2e/fixtures/edges/edge-line-endings/template/digitalExperiences/webApplications/edge-line-endings/src/styles/__append__global.css +4 -0
- package/test/e2e/fixtures/edges/edge-missing-base-files/feature.ts +13 -0
- package/test/e2e/fixtures/edges/edge-missing-base-files/template/digitalExperiences/webApplications/edge-missing-base-files/src/__inherit__missing.tsx +1 -0
- package/test/e2e/fixtures/edges/edge-missing-base-files/template/digitalExperiences/webApplications/edge-missing-base-files/src/__prepend__nonexistent.tsx +2 -0
- package/test/e2e/fixtures/edges/edge-missing-base-files/template/digitalExperiences/webApplications/edge-missing-base-files/src/placeholder.tsx +0 -0
- package/test/e2e/fixtures/edges/edge-package-json-conflicts-a/feature.ts +14 -0
- package/test/e2e/fixtures/edges/edge-package-json-conflicts-a/template/digitalExperiences/webApplications/edge-package-json-conflicts-a/src/placeholder.tsx +1 -0
- package/test/e2e/fixtures/edges/edge-package-json-conflicts-b/feature.ts +14 -0
- package/test/e2e/fixtures/edges/edge-package-json-conflicts-b/template/digitalExperiences/webApplications/edge-package-json-conflicts-b/src/placeholder.tsx +1 -0
- package/test/e2e/fixtures/edges/edge-performance-many/feature.ts +26 -0
- package/test/e2e/fixtures/edges/edge-performance-many/template/digitalExperiences/webApplications/edge-performance-many/src/placeholder.tsx +0 -0
- package/test/e2e/fixtures/path-mappings/feature-custom-mapping/feature.ts +16 -0
- package/test/e2e/fixtures/path-mappings/feature-custom-mapping/template/web/src/custom-component.tsx +3 -0
- package/test/e2e/fixtures/path-mappings/feature-custom-mapping/template/web/src/routes.tsx +8 -0
- package/test/e2e/fixtures/path-mappings/feature-mixed-paths/feature.ts +7 -0
- package/test/e2e/fixtures/path-mappings/feature-mixed-paths/template/digitalExperiences/webApplications/feature-mixed-paths/assets/icon.svg +3 -0
- package/test/e2e/fixtures/path-mappings/feature-mixed-paths/template/webApp/src/mapped-component.tsx +3 -0
- package/test/e2e/fixtures/path-mappings/feature-mixed-paths/template/webApp/src/routes.tsx +8 -0
- package/test/e2e/fixtures/path-mappings/feature-with-webapp-mapping/feature.ts +7 -0
- package/test/e2e/fixtures/path-mappings/feature-with-webapp-mapping/template/webApp/src/app.tsx +3 -0
- package/test/e2e/fixtures/path-mappings/feature-with-webapp-mapping/template/webApp/src/routes.tsx +8 -0
- package/test/e2e/fixtures/path-mappings/feature-without-mapping/feature.ts +11 -0
- package/test/e2e/fixtures/path-mappings/feature-without-mapping/template/digitalExperiences/webApplications/feature-without-mapping/src/legacy-component.tsx +3 -0
- package/test/e2e/fixtures/path-mappings/feature-without-mapping/template/digitalExperiences/webApplications/feature-without-mapping/src/routes.tsx +8 -0
- package/test/e2e/fixtures/scenarios/scenario-authentication/feature.ts +10 -0
- package/test/e2e/fixtures/scenarios/scenario-authentication/template/digitalExperiences/webApplications/scenario-authentication/src/components/LoginForm.tsx +25 -0
- package/test/e2e/fixtures/scenarios/scenario-authentication/template/digitalExperiences/webApplications/scenario-authentication/src/context/AuthContext.tsx +28 -0
- package/test/e2e/fixtures/scenarios/scenario-authentication/template/digitalExperiences/webApplications/scenario-authentication/src/login.tsx +10 -0
- package/test/e2e/fixtures/scenarios/scenario-authentication/template/digitalExperiences/webApplications/scenario-authentication/src/placeholder.tsx +0 -0
- package/test/e2e/fixtures/scenarios/scenario-authentication/template/digitalExperiences/webApplications/scenario-authentication/src/routes.tsx +17 -0
- package/test/e2e/fixtures/scenarios/scenario-crud-contacts/feature.ts +11 -0
- package/test/e2e/fixtures/scenarios/scenario-crud-contacts/template/digitalExperiences/webApplications/scenario-crud-contacts/src/__inherit__appLayout.tsx +1 -0
- package/test/e2e/fixtures/scenarios/scenario-crud-contacts/template/digitalExperiences/webApplications/scenario-crud-contacts/src/components/ContactDetail.tsx +54 -0
- package/test/e2e/fixtures/scenarios/scenario-crud-contacts/template/digitalExperiences/webApplications/scenario-crud-contacts/src/components/ContactForm.tsx +146 -0
- package/test/e2e/fixtures/scenarios/scenario-crud-contacts/template/digitalExperiences/webApplications/scenario-crud-contacts/src/components/ContactList.tsx +77 -0
- package/test/e2e/fixtures/scenarios/scenario-crud-contacts/template/digitalExperiences/webApplications/scenario-crud-contacts/src/placeholder.tsx +0 -0
- package/test/e2e/fixtures/scenarios/scenario-crud-contacts/template/digitalExperiences/webApplications/scenario-crud-contacts/src/routes.tsx +36 -0
- package/test/e2e/fixtures/scenarios/scenario-crud-contacts/template/digitalExperiences/webApplications/scenario-crud-contacts/src/styles/__append__global.css +176 -0
- package/test/e2e/fixtures/scenarios/scenario-crud-contacts/template/digitalExperiences/webApplications/scenario-crud-contacts/src/utils/contactsApi.ts +42 -0
- package/test/e2e/fixtures/scenarios/scenario-navigation-menu/feature.ts +10 -0
- package/test/e2e/fixtures/scenarios/scenario-navigation-menu/template/digitalExperiences/webApplications/scenario-navigation-menu/src/__append__appLayout.tsx +4 -0
- package/test/e2e/fixtures/scenarios/scenario-navigation-menu/template/digitalExperiences/webApplications/scenario-navigation-menu/src/components/NavigationMenu.tsx +17 -0
- package/test/e2e/fixtures/scenarios/scenario-navigation-menu/template/digitalExperiences/webApplications/scenario-navigation-menu/src/placeholder.tsx +0 -0
- package/test/e2e/fixtures/single-operations/feature-file-append/feature.ts +10 -0
- package/test/e2e/fixtures/single-operations/feature-file-append/template/digitalExperiences/webApplications/feature-file-append/src/styles/__append__global.css +10 -0
- package/test/e2e/fixtures/single-operations/feature-file-inherit/feature.ts +10 -0
- package/test/e2e/fixtures/single-operations/feature-file-inherit/template/digitalExperiences/webApplications/feature-file-inherit/src/__inherit__appLayout.tsx +1 -0
- package/test/e2e/fixtures/single-operations/feature-file-inherit/template/digitalExperiences/webApplications/feature-file-inherit/src/__inherit__home.tsx +1 -0
- package/test/e2e/fixtures/single-operations/feature-file-prepend/feature.ts +10 -0
- package/test/e2e/fixtures/single-operations/feature-file-prepend/template/digitalExperiences/webApplications/feature-file-prepend/src/__prepend__index.tsx +2 -0
- package/test/e2e/fixtures/single-operations/feature-import-merge/feature.ts +10 -0
- package/test/e2e/fixtures/single-operations/feature-import-merge/template/digitalExperiences/webApplications/feature-import-merge/src/routes.tsx +18 -0
- package/test/e2e/fixtures/single-operations/feature-import-merge/template/digitalExperiences/webApplications/feature-import-merge/src/settings.tsx +8 -0
- package/test/e2e/fixtures/single-operations/feature-route-add/feature.ts +10 -0
- package/test/e2e/fixtures/single-operations/feature-route-add/template/digitalExperiences/webApplications/feature-route-add/src/about.tsx +8 -0
- package/test/e2e/fixtures/single-operations/feature-route-add/template/digitalExperiences/webApplications/feature-route-add/src/routes.tsx +23 -0
- package/test/e2e/fixtures/single-operations/feature-route-add/template/digitalExperiences/webApplications/feature-route-add/src/services.tsx +8 -0
- package/test/e2e/fixtures/watch/watch-add-delete-files/feature.ts +13 -0
- package/test/e2e/fixtures/watch/watch-add-delete-files/template/digitalExperiences/webApplications/watch-add-delete-files/src/initial.tsx +4 -0
- package/test/e2e/fixtures/watch/watch-add-delete-files/template/digitalExperiences/webApplications/watch-add-delete-files/src/placeholder.tsx +4 -0
- package/test/e2e/fixtures/watch/watch-basic/feature.ts +13 -0
- package/test/e2e/fixtures/watch/watch-basic/template/digitalExperiences/webApplications/watch-basic/src/placeholder.tsx +4 -0
- package/test/e2e/fixtures/watch/watch-basic/template/digitalExperiences/webApplications/watch-basic/src/watchTest.tsx +3 -0
- package/test/e2e/fixtures/watch/watch-debounce/feature.ts +13 -0
- package/test/e2e/fixtures/watch/watch-debounce/template/digitalExperiences/webApplications/watch-debounce/src/placeholder.tsx +4 -0
- package/test/e2e/fixtures/watch/watch-multiple-files/feature.ts +13 -0
- package/test/e2e/fixtures/watch/watch-multiple-files/template/digitalExperiences/webApplications/watch-multiple-files/src/components/WatchComponent.tsx +3 -0
- package/test/e2e/fixtures/watch/watch-multiple-files/template/digitalExperiences/webApplications/watch-multiple-files/src/placeholder.tsx +4 -0
- package/test/e2e/fixtures/watch/watch-multiple-files/template/digitalExperiences/webApplications/watch-multiple-files/src/styles/theme.css +4 -0
- package/test/e2e/gold/dep-chain-linear-apply/digitalExperiences/webApplications/dep-chain-linear/package.json +10 -0
- package/test/e2e/gold/dep-chain-linear-apply/digitalExperiences/webApplications/dep-chain-linear/src/about.tsx +8 -0
- package/test/e2e/gold/dep-chain-linear-apply/digitalExperiences/webApplications/dep-chain-linear/src/appLayout.tsx +27 -0
- package/test/e2e/gold/dep-chain-linear-apply/digitalExperiences/webApplications/dep-chain-linear/src/contact.tsx +8 -0
- package/test/e2e/gold/dep-chain-linear-apply/digitalExperiences/webApplications/dep-chain-linear/src/home.tsx +8 -0
- package/test/e2e/gold/dep-chain-linear-apply/digitalExperiences/webApplications/dep-chain-linear/src/index.tsx +10 -0
- package/test/e2e/gold/dep-chain-linear-apply/digitalExperiences/webApplications/dep-chain-linear/src/old-page.tsx +8 -0
- package/test/e2e/gold/dep-chain-linear-apply/digitalExperiences/webApplications/dep-chain-linear/src/routes.tsx +35 -0
- package/test/e2e/gold/dep-chain-linear-apply/digitalExperiences/webApplications/dep-chain-linear/src/styles/global.css +14 -0
- package/test/e2e/gold/dep-chain-long-apply/digitalExperiences/webApplications/dep-chain-a/package.json +10 -0
- package/test/e2e/gold/dep-chain-long-apply/digitalExperiences/webApplications/dep-chain-a/src/appLayout.tsx +27 -0
- package/test/e2e/gold/dep-chain-long-apply/digitalExperiences/webApplications/dep-chain-a/src/home.tsx +8 -0
- package/test/e2e/gold/dep-chain-long-apply/digitalExperiences/webApplications/dep-chain-a/src/index.tsx +10 -0
- package/test/e2e/gold/dep-chain-long-apply/digitalExperiences/webApplications/dep-chain-a/src/old-page.tsx +8 -0
- package/test/e2e/gold/dep-chain-long-apply/digitalExperiences/webApplications/dep-chain-a/src/page-a.tsx +8 -0
- package/test/e2e/gold/dep-chain-long-apply/digitalExperiences/webApplications/dep-chain-a/src/page-b.tsx +8 -0
- package/test/e2e/gold/dep-chain-long-apply/digitalExperiences/webApplications/dep-chain-a/src/page-c.tsx +8 -0
- package/test/e2e/gold/dep-chain-long-apply/digitalExperiences/webApplications/dep-chain-a/src/page-d.tsx +8 -0
- package/test/e2e/gold/dep-chain-long-apply/digitalExperiences/webApplications/dep-chain-a/src/routes.tsx +47 -0
- package/test/e2e/gold/dep-chain-long-apply/digitalExperiences/webApplications/dep-chain-a/src/styles/global.css +14 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/package.json +10 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/admin-dashboard.tsx +1 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/admin-layout.tsx +1 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/analytics.tsx +1 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/appLayout.tsx +27 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/components.tsx +8 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/dashboard.tsx +8 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/home.tsx +8 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/index.tsx +10 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/login.tsx +8 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/profile-edit.tsx +1 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/profile.tsx +8 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/reports.tsx +1 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/routes.tsx +94 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/signup.tsx +1 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/styles/global.css +14 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/tools.tsx +1 -0
- package/test/e2e/gold/dep-complex-graph-apply/digitalExperiences/webApplications/dep-complex-graph/src/types.tsx +8 -0
- package/test/e2e/gold/feature-custom-mapping-apply/digitalExperiences/webApplications/feature-custom-mapping/package.json +10 -0
- package/test/e2e/gold/feature-custom-mapping-apply/digitalExperiences/webApplications/feature-custom-mapping/src/appLayout.tsx +27 -0
- package/test/e2e/gold/feature-custom-mapping-apply/digitalExperiences/webApplications/feature-custom-mapping/src/custom-component.tsx +3 -0
- package/test/e2e/gold/feature-custom-mapping-apply/digitalExperiences/webApplications/feature-custom-mapping/src/home.tsx +8 -0
- package/test/e2e/gold/feature-custom-mapping-apply/digitalExperiences/webApplications/feature-custom-mapping/src/index.tsx +10 -0
- package/test/e2e/gold/feature-custom-mapping-apply/digitalExperiences/webApplications/feature-custom-mapping/src/old-page.tsx +8 -0
- package/test/e2e/gold/feature-custom-mapping-apply/digitalExperiences/webApplications/feature-custom-mapping/src/routes.tsx +28 -0
- package/test/e2e/gold/feature-custom-mapping-apply/digitalExperiences/webApplications/feature-custom-mapping/src/styles/global.css +14 -0
- package/test/e2e/gold/feature-file-inherit-route-add-apply/digitalExperiences/webApplications/feature-file-inherit-route-add/package.json +10 -0
- package/test/e2e/gold/feature-file-inherit-route-add-apply/digitalExperiences/webApplications/feature-file-inherit-route-add/src/about.tsx +8 -0
- package/test/e2e/gold/feature-file-inherit-route-add-apply/digitalExperiences/webApplications/feature-file-inherit-route-add/src/appLayout.tsx +27 -0
- package/test/e2e/gold/feature-file-inherit-route-add-apply/digitalExperiences/webApplications/feature-file-inherit-route-add/src/home.tsx +8 -0
- package/test/e2e/gold/feature-file-inherit-route-add-apply/digitalExperiences/webApplications/feature-file-inherit-route-add/src/index.tsx +10 -0
- package/test/e2e/gold/feature-file-inherit-route-add-apply/digitalExperiences/webApplications/feature-file-inherit-route-add/src/old-page.tsx +8 -0
- package/test/e2e/gold/feature-file-inherit-route-add-apply/digitalExperiences/webApplications/feature-file-inherit-route-add/src/routes.tsx +29 -0
- package/test/e2e/gold/feature-file-inherit-route-add-apply/digitalExperiences/webApplications/feature-file-inherit-route-add/src/styles/global.css +14 -0
- package/test/e2e/gold/feature-file-prepend-append-apply/digitalExperiences/webApplications/feature-file-prepend-append/package.json +10 -0
- package/test/e2e/gold/feature-file-prepend-append-apply/digitalExperiences/webApplications/feature-file-prepend-append/src/appLayout.tsx +27 -0
- package/test/e2e/gold/feature-file-prepend-append-apply/digitalExperiences/webApplications/feature-file-prepend-append/src/home.tsx +8 -0
- package/test/e2e/gold/feature-file-prepend-append-apply/digitalExperiences/webApplications/feature-file-prepend-append/src/index.tsx +13 -0
- package/test/e2e/gold/feature-file-prepend-append-apply/digitalExperiences/webApplications/feature-file-prepend-append/src/old-page.tsx +8 -0
- package/test/e2e/gold/feature-file-prepend-append-apply/digitalExperiences/webApplications/feature-file-prepend-append/src/routes.tsx +29 -0
- package/test/e2e/gold/feature-file-prepend-append-apply/digitalExperiences/webApplications/feature-file-prepend-append/src/settings.tsx +9 -0
- package/test/e2e/gold/feature-file-prepend-append-apply/digitalExperiences/webApplications/feature-file-prepend-append/src/styles/global.css +25 -0
- package/test/e2e/gold/feature-file-route-delete-apply/digitalExperiences/webApplications/feature-file-route-delete/package.json +10 -0
- package/test/e2e/gold/feature-file-route-delete-apply/digitalExperiences/webApplications/feature-file-route-delete/src/appLayout.tsx +27 -0
- package/test/e2e/gold/feature-file-route-delete-apply/digitalExperiences/webApplications/feature-file-route-delete/src/home.tsx +8 -0
- package/test/e2e/gold/feature-file-route-delete-apply/digitalExperiences/webApplications/feature-file-route-delete/src/index.tsx +10 -0
- package/test/e2e/gold/feature-file-route-delete-apply/digitalExperiences/webApplications/feature-file-route-delete/src/routes.tsx +17 -0
- package/test/e2e/gold/feature-file-route-delete-apply/digitalExperiences/webApplications/feature-file-route-delete/src/styles/global.css +14 -0
- package/test/e2e/gold/feature-mixed-paths-apply/digitalExperiences/webApplications/feature-mixed-paths/assets/icon.svg +3 -0
- package/test/e2e/gold/feature-mixed-paths-apply/digitalExperiences/webApplications/feature-mixed-paths/package.json +10 -0
- package/test/e2e/gold/feature-mixed-paths-apply/digitalExperiences/webApplications/feature-mixed-paths/src/appLayout.tsx +27 -0
- package/test/e2e/gold/feature-mixed-paths-apply/digitalExperiences/webApplications/feature-mixed-paths/src/home.tsx +8 -0
- package/test/e2e/gold/feature-mixed-paths-apply/digitalExperiences/webApplications/feature-mixed-paths/src/index.tsx +10 -0
- package/test/e2e/gold/feature-mixed-paths-apply/digitalExperiences/webApplications/feature-mixed-paths/src/mapped-component.tsx +3 -0
- package/test/e2e/gold/feature-mixed-paths-apply/digitalExperiences/webApplications/feature-mixed-paths/src/old-page.tsx +8 -0
- package/test/e2e/gold/feature-mixed-paths-apply/digitalExperiences/webApplications/feature-mixed-paths/src/routes.tsx +28 -0
- package/test/e2e/gold/feature-mixed-paths-apply/digitalExperiences/webApplications/feature-mixed-paths/src/styles/global.css +14 -0
- package/test/e2e/gold/feature-with-webapp-mapping-apply/digitalExperiences/webApplications/feature-with-webapp-mapping/package.json +10 -0
- package/test/e2e/gold/feature-with-webapp-mapping-apply/digitalExperiences/webApplications/feature-with-webapp-mapping/src/app.tsx +3 -0
- package/test/e2e/gold/feature-with-webapp-mapping-apply/digitalExperiences/webApplications/feature-with-webapp-mapping/src/appLayout.tsx +27 -0
- package/test/e2e/gold/feature-with-webapp-mapping-apply/digitalExperiences/webApplications/feature-with-webapp-mapping/src/home.tsx +8 -0
- package/test/e2e/gold/feature-with-webapp-mapping-apply/digitalExperiences/webApplications/feature-with-webapp-mapping/src/index.tsx +10 -0
- package/test/e2e/gold/feature-with-webapp-mapping-apply/digitalExperiences/webApplications/feature-with-webapp-mapping/src/old-page.tsx +8 -0
- package/test/e2e/gold/feature-with-webapp-mapping-apply/digitalExperiences/webApplications/feature-with-webapp-mapping/src/routes.tsx +28 -0
- package/test/e2e/gold/feature-with-webapp-mapping-apply/digitalExperiences/webApplications/feature-with-webapp-mapping/src/styles/global.css +14 -0
- package/test/e2e/gold/feature-without-mapping-apply/digitalExperiences/webApplications/feature-without-mapping/package.json +10 -0
- package/test/e2e/gold/feature-without-mapping-apply/digitalExperiences/webApplications/feature-without-mapping/src/appLayout.tsx +27 -0
- package/test/e2e/gold/feature-without-mapping-apply/digitalExperiences/webApplications/feature-without-mapping/src/home.tsx +8 -0
- package/test/e2e/gold/feature-without-mapping-apply/digitalExperiences/webApplications/feature-without-mapping/src/index.tsx +10 -0
- package/test/e2e/gold/feature-without-mapping-apply/digitalExperiences/webApplications/feature-without-mapping/src/legacy-component.tsx +3 -0
- package/test/e2e/gold/feature-without-mapping-apply/digitalExperiences/webApplications/feature-without-mapping/src/old-page.tsx +8 -0
- package/test/e2e/gold/feature-without-mapping-apply/digitalExperiences/webApplications/feature-without-mapping/src/routes.tsx +28 -0
- package/test/e2e/gold/feature-without-mapping-apply/digitalExperiences/webApplications/feature-without-mapping/src/styles/global.css +14 -0
- package/test/e2e/path-mappings.spec.ts +232 -0
- package/test/e2e/watch-patches.spec.ts +237 -0
- package/test/helpers/cli-runner.ts +100 -0
- package/test/helpers/compare-directories.ts +197 -0
- package/test/helpers/create-temp-dir.ts +34 -0
- package/test/helpers/fixtures.ts +67 -0
- package/test/setup.ts +6 -0
- package/test/unit/debounce.spec.ts +159 -0
- package/test/unit/dependency-resolver.spec.ts +260 -0
- package/test/unit/file-operations.spec.ts +264 -0
- package/test/unit/import-merger.spec.ts +395 -0
- package/test/unit/index.spec.ts +158 -0
- package/test/unit/new-app.spec.ts +178 -0
- package/test/unit/new-feature.spec.ts +178 -0
- package/test/unit/package-json-merger.spec.ts +275 -0
- package/test/unit/patch-loader.spec.ts +238 -0
- package/test/unit/path-mappings.spec.ts +241 -0
- package/test/unit/paths.spec.ts +247 -0
- package/test/unit/route-merger.spec.ts +265 -0
- package/test/unit/validation.spec.ts +311 -0
- package/tsconfig.json +20 -0
- package/vitest.config.ts +18 -0
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import { loadFeature, FeatureLoadError } from '../../src/core/patch-loader.js';
|
|
3
|
+
import { mkdirSync, writeFileSync, rmSync } from 'fs';
|
|
4
|
+
import { join } from 'path';
|
|
5
|
+
import { tmpdir } from 'os';
|
|
6
|
+
|
|
7
|
+
describe('patch-loader', () => {
|
|
8
|
+
let tempDir: string;
|
|
9
|
+
|
|
10
|
+
beforeEach(() => {
|
|
11
|
+
tempDir = join(tmpdir(), `patch-loader-test-${Date.now()}`);
|
|
12
|
+
mkdirSync(tempDir, { recursive: true });
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
afterEach(() => {
|
|
16
|
+
if (tempDir) {
|
|
17
|
+
rmSync(tempDir, { recursive: true, force: true });
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Helper to create a feature with feature.ts
|
|
23
|
+
*/
|
|
24
|
+
function createFeatureWithFeature(name: string, patchesContent: string): string {
|
|
25
|
+
const featurePath = join(tempDir, name);
|
|
26
|
+
mkdirSync(featurePath, { recursive: true });
|
|
27
|
+
writeFileSync(join(featurePath, 'feature.ts'), patchesContent);
|
|
28
|
+
return featurePath;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
describe('loadFeature', () => {
|
|
32
|
+
it('should load feature with default values', async () => {
|
|
33
|
+
const featurePath = createFeatureWithFeature('feature-defaults', `
|
|
34
|
+
const feature = {};
|
|
35
|
+
export default feature;
|
|
36
|
+
`);
|
|
37
|
+
|
|
38
|
+
const result = await loadFeature(featurePath);
|
|
39
|
+
|
|
40
|
+
expect(result.features).toHaveLength(1);
|
|
41
|
+
expect(result.templateDir).toBe('template');
|
|
42
|
+
expect(result.dependencies).toEqual([]);
|
|
43
|
+
expect(result.webAppName).toBe('feature-defaults');
|
|
44
|
+
expect(result.routeFilePath).toBe('digitalExperiences/webApplications/feature-defaults/src/routes.tsx');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('should load feature with custom templateDir', async () => {
|
|
48
|
+
const featurePath = createFeatureWithFeature('feature-custom-dir', `
|
|
49
|
+
const feature = {
|
|
50
|
+
templateDir: 'custom-templates'
|
|
51
|
+
};
|
|
52
|
+
export default feature;
|
|
53
|
+
`);
|
|
54
|
+
|
|
55
|
+
const result = await loadFeature(featurePath);
|
|
56
|
+
|
|
57
|
+
expect(result.templateDir).toBe('custom-templates');
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('should load feature with dependencies', async () => {
|
|
61
|
+
const featurePath = createFeatureWithFeature('feature-with-deps', `
|
|
62
|
+
const feature = {
|
|
63
|
+
dependencies: ['../feature-a', '../feature-b']
|
|
64
|
+
};
|
|
65
|
+
export default feature;
|
|
66
|
+
`);
|
|
67
|
+
|
|
68
|
+
const result = await loadFeature(featurePath);
|
|
69
|
+
|
|
70
|
+
expect(result.dependencies).toEqual(['../feature-a', '../feature-b']);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('should load feature with custom webAppName', async () => {
|
|
74
|
+
const featurePath = createFeatureWithFeature('feature-custom-name', `
|
|
75
|
+
const feature = {
|
|
76
|
+
webAppName: 'my-custom-app'
|
|
77
|
+
};
|
|
78
|
+
export default feature;
|
|
79
|
+
`);
|
|
80
|
+
|
|
81
|
+
const result = await loadFeature(featurePath);
|
|
82
|
+
|
|
83
|
+
expect(result.webAppName).toBe('my-custom-app');
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('should load feature array', async () => {
|
|
87
|
+
const featurePath = createFeatureWithFeature('feature-array', `
|
|
88
|
+
const feature1 = { templateDir: 'src1' };
|
|
89
|
+
const feature2 = { templateDir: 'src2' };
|
|
90
|
+
export default [feature1, feature2];
|
|
91
|
+
`);
|
|
92
|
+
|
|
93
|
+
const result = await loadFeature(featurePath);
|
|
94
|
+
|
|
95
|
+
expect(result.features).toHaveLength(2);
|
|
96
|
+
// templateDir should be from the last feature
|
|
97
|
+
expect(result.templateDir).toBe('src2');
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('should throw FeatureLoadError if feature.ts is missing', async () => {
|
|
101
|
+
const featurePath = join(tempDir, 'no-feature');
|
|
102
|
+
mkdirSync(featurePath, { recursive: true });
|
|
103
|
+
|
|
104
|
+
await expect(loadFeature(featurePath)).rejects.toThrow(FeatureLoadError);
|
|
105
|
+
await expect(loadFeature(featurePath)).rejects.toThrow(/No feature.ts found/);
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
it('should throw FeatureLoadError if feature.ts has no default export', async () => {
|
|
109
|
+
const featurePath = createFeatureWithFeature('no-default-export', `
|
|
110
|
+
export const notDefault = {};
|
|
111
|
+
`);
|
|
112
|
+
|
|
113
|
+
await expect(loadFeature(featurePath)).rejects.toThrow(FeatureLoadError);
|
|
114
|
+
await expect(loadFeature(featurePath)).rejects.toThrow(/must have a default export/);
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it('should throw FeatureLoadError if default export is not an object or array', async () => {
|
|
118
|
+
const featurePath = createFeatureWithFeature('invalid-export-string', `
|
|
119
|
+
export default "not an object";
|
|
120
|
+
`);
|
|
121
|
+
|
|
122
|
+
await expect(loadFeature(featurePath)).rejects.toThrow(FeatureLoadError);
|
|
123
|
+
await expect(loadFeature(featurePath)).rejects.toThrow(/must be a Feature object or Feature/);
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
it('should throw FeatureLoadError if default export is null', async () => {
|
|
127
|
+
const featurePath = createFeatureWithFeature('invalid-export-null', `
|
|
128
|
+
export default null;
|
|
129
|
+
`);
|
|
130
|
+
|
|
131
|
+
await expect(loadFeature(featurePath)).rejects.toThrow(FeatureLoadError);
|
|
132
|
+
await expect(loadFeature(featurePath)).rejects.toThrow(/must have a default export/);
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
it('should throw FeatureLoadError if default export is a number', async () => {
|
|
136
|
+
const featurePath = createFeatureWithFeature('invalid-export-number', `
|
|
137
|
+
export default 123;
|
|
138
|
+
`);
|
|
139
|
+
|
|
140
|
+
await expect(loadFeature(featurePath)).rejects.toThrow(FeatureLoadError);
|
|
141
|
+
await expect(loadFeature(featurePath)).rejects.toThrow(/must be a Feature object or Feature/);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it('should throw error if feature.ts file has syntax error', async () => {
|
|
145
|
+
const featurePath = createFeatureWithFeature('syntax-error', `
|
|
146
|
+
this is invalid javascript syntax {{{}
|
|
147
|
+
`);
|
|
148
|
+
|
|
149
|
+
await expect(loadFeature(featurePath)).rejects.toThrow(FeatureLoadError);
|
|
150
|
+
await expect(loadFeature(featurePath)).rejects.toThrow(/Failed to load feature/);
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('should merge dependencies from multiple features', async () => {
|
|
154
|
+
const featurePath = createFeatureWithFeature('multi-deps', `
|
|
155
|
+
const feature1 = { dependencies: ['../dep-a', '../dep-b'] };
|
|
156
|
+
const feature2 = { dependencies: ['../dep-b', '../dep-c'] };
|
|
157
|
+
export default [feature1, feature2];
|
|
158
|
+
`);
|
|
159
|
+
|
|
160
|
+
const result = await loadFeature(featurePath);
|
|
161
|
+
|
|
162
|
+
// Should deduplicate dep-b
|
|
163
|
+
expect(result.dependencies).toContain('../dep-a');
|
|
164
|
+
expect(result.dependencies).toContain('../dep-b');
|
|
165
|
+
expect(result.dependencies).toContain('../dep-c');
|
|
166
|
+
expect(result.dependencies).toHaveLength(3);
|
|
167
|
+
});
|
|
168
|
+
|
|
169
|
+
it('should derive webAppName from directory basename', async () => {
|
|
170
|
+
const featurePath = createFeatureWithFeature('my-awesome-feature', `
|
|
171
|
+
const feature = {};
|
|
172
|
+
export default feature;
|
|
173
|
+
`);
|
|
174
|
+
|
|
175
|
+
const result = await loadFeature(featurePath);
|
|
176
|
+
|
|
177
|
+
expect(result.webAppName).toBe('my-awesome-feature');
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it('should construct routeFilePath with default values', async () => {
|
|
181
|
+
const featurePath = createFeatureWithFeature('route-defaults', `
|
|
182
|
+
const feature = {};
|
|
183
|
+
export default feature;
|
|
184
|
+
`);
|
|
185
|
+
|
|
186
|
+
const result = await loadFeature(featurePath);
|
|
187
|
+
|
|
188
|
+
expect(result.routeFilePath).toBe(
|
|
189
|
+
'digitalExperiences/webApplications/route-defaults/src/routes.tsx'
|
|
190
|
+
);
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('should use custom routeFilePath if provided', async () => {
|
|
194
|
+
const featurePath = createFeatureWithFeature('custom-routes', `
|
|
195
|
+
const feature = {
|
|
196
|
+
routeFilePath: 'custom/path/to/routes.tsx'
|
|
197
|
+
};
|
|
198
|
+
export default feature;
|
|
199
|
+
`);
|
|
200
|
+
|
|
201
|
+
const result = await loadFeature(featurePath);
|
|
202
|
+
|
|
203
|
+
expect(result.routeFilePath).toBe('custom/path/to/routes.tsx');
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it('should override defaults with later feature values in array', async () => {
|
|
207
|
+
const featurePath = createFeatureWithFeature('override-test', `
|
|
208
|
+
const feature1 = { templateDir: 'first' };
|
|
209
|
+
const feature2 = { templateDir: 'second' };
|
|
210
|
+
export default [feature1, feature2];
|
|
211
|
+
`);
|
|
212
|
+
|
|
213
|
+
const result = await loadFeature(featurePath);
|
|
214
|
+
|
|
215
|
+
// Last feature wins
|
|
216
|
+
expect(result.templateDir).toBe('second');
|
|
217
|
+
});
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
describe('FeatureLoadError', () => {
|
|
221
|
+
it('should be throwable with custom message', () => {
|
|
222
|
+
const error = new FeatureLoadError('Custom load error');
|
|
223
|
+
|
|
224
|
+
expect(error.message).toBe('Custom load error');
|
|
225
|
+
expect(error.name).toBe('FeatureLoadError');
|
|
226
|
+
expect(error).toBeInstanceOf(Error);
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
it('should be catchable as FeatureLoadError', () => {
|
|
230
|
+
try {
|
|
231
|
+
throw new FeatureLoadError('Test error');
|
|
232
|
+
} catch (err) {
|
|
233
|
+
expect(err).toBeInstanceOf(FeatureLoadError);
|
|
234
|
+
expect((err as FeatureLoadError).name).toBe('FeatureLoadError');
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
});
|
|
238
|
+
});
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import {
|
|
3
|
+
getDefaultPathMappings,
|
|
4
|
+
arePathMappingsEnabled,
|
|
5
|
+
getEffectivePathMappings,
|
|
6
|
+
applyPathMappings
|
|
7
|
+
} from '../../src/utils/path-mappings.js';
|
|
8
|
+
|
|
9
|
+
describe('path-mappings', () => {
|
|
10
|
+
describe('getDefaultPathMappings', () => {
|
|
11
|
+
it('should create default mapping with feature name', () => {
|
|
12
|
+
const mappings = getDefaultPathMappings('feature-navigation');
|
|
13
|
+
expect(mappings).toEqual([
|
|
14
|
+
{
|
|
15
|
+
from: 'webApp',
|
|
16
|
+
to: 'digitalExperiences/webApplications/feature-navigation'
|
|
17
|
+
}
|
|
18
|
+
]);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should handle different feature names', () => {
|
|
22
|
+
const mappings = getDefaultPathMappings('feature-vibe-coding-starter');
|
|
23
|
+
expect(mappings).toEqual([
|
|
24
|
+
{
|
|
25
|
+
from: 'webApp',
|
|
26
|
+
to: 'digitalExperiences/webApplications/feature-vibe-coding-starter'
|
|
27
|
+
}
|
|
28
|
+
]);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
describe('arePathMappingsEnabled', () => {
|
|
33
|
+
it('should return true when pathMappings is undefined (default)', () => {
|
|
34
|
+
expect(arePathMappingsEnabled(undefined)).toBe(true);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('should return true when enabled is explicitly true', () => {
|
|
38
|
+
expect(arePathMappingsEnabled({ enabled: true })).toBe(true);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('should return false when enabled is explicitly false', () => {
|
|
42
|
+
expect(arePathMappingsEnabled({ enabled: false })).toBe(false);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should return true when enabled is not specified but mappings provided', () => {
|
|
46
|
+
expect(arePathMappingsEnabled({ mappings: [] })).toBe(true);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('should return true for empty config object', () => {
|
|
50
|
+
expect(arePathMappingsEnabled({})).toBe(true);
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
describe('getEffectivePathMappings', () => {
|
|
55
|
+
it('should return default mappings when pathMappings is undefined', () => {
|
|
56
|
+
const mappings = getEffectivePathMappings('feature-test', undefined);
|
|
57
|
+
expect(mappings).toEqual([
|
|
58
|
+
{
|
|
59
|
+
from: 'webApp',
|
|
60
|
+
to: 'digitalExperiences/webApplications/feature-test'
|
|
61
|
+
}
|
|
62
|
+
]);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('should return empty array when disabled', () => {
|
|
66
|
+
const mappings = getEffectivePathMappings('feature-test', { enabled: false });
|
|
67
|
+
expect(mappings).toEqual([]);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('should return custom mappings when provided', () => {
|
|
71
|
+
const custom = [{ from: 'web', to: 'custom/path' }];
|
|
72
|
+
const mappings = getEffectivePathMappings('feature-test', { mappings: custom });
|
|
73
|
+
expect(mappings).toEqual(custom);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('should return default when mappings array is empty', () => {
|
|
77
|
+
const mappings = getEffectivePathMappings('feature-test', { mappings: [] });
|
|
78
|
+
expect(mappings).toEqual([
|
|
79
|
+
{
|
|
80
|
+
from: 'webApp',
|
|
81
|
+
to: 'digitalExperiences/webApplications/feature-test'
|
|
82
|
+
}
|
|
83
|
+
]);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('should return default when pathMappings is empty object', () => {
|
|
87
|
+
const mappings = getEffectivePathMappings('feature-test', {});
|
|
88
|
+
expect(mappings).toEqual([
|
|
89
|
+
{
|
|
90
|
+
from: 'webApp',
|
|
91
|
+
to: 'digitalExperiences/webApplications/feature-test'
|
|
92
|
+
}
|
|
93
|
+
]);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
it('should respect enabled: false even with custom mappings', () => {
|
|
97
|
+
const custom = [{ from: 'web', to: 'custom/path' }];
|
|
98
|
+
const mappings = getEffectivePathMappings('feature-test', {
|
|
99
|
+
enabled: false,
|
|
100
|
+
mappings: custom
|
|
101
|
+
});
|
|
102
|
+
expect(mappings).toEqual([]);
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
describe('applyPathMappings', () => {
|
|
107
|
+
const defaultMappings = [
|
|
108
|
+
{ from: 'webApp', to: 'digitalExperiences/webApplications/feature-nav' }
|
|
109
|
+
];
|
|
110
|
+
|
|
111
|
+
describe('basic mapping', () => {
|
|
112
|
+
it('should apply mapping to webApp path', () => {
|
|
113
|
+
const result = applyPathMappings('webApp/src/app.tsx', defaultMappings);
|
|
114
|
+
expect(result).toBe('digitalExperiences/webApplications/feature-nav/src/app.tsx');
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
it('should apply mapping to nested webApp path', () => {
|
|
118
|
+
const result = applyPathMappings('webApp/src/components/Header.tsx', defaultMappings);
|
|
119
|
+
expect(result).toBe('digitalExperiences/webApplications/feature-nav/src/components/Header.tsx');
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it('should apply mapping to deeply nested paths', () => {
|
|
123
|
+
const result = applyPathMappings('webApp/src/a/b/c/d/file.tsx', defaultMappings);
|
|
124
|
+
expect(result).toBe('digitalExperiences/webApplications/feature-nav/src/a/b/c/d/file.tsx');
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
describe('no match scenarios', () => {
|
|
129
|
+
it('should not modify path that does not match mapping prefix', () => {
|
|
130
|
+
const result = applyPathMappings('src/app.tsx', defaultMappings);
|
|
131
|
+
expect(result).toBe('src/app.tsx');
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it('should not modify full path format (backwards compat)', () => {
|
|
135
|
+
const oldPath = 'digitalExperiences/webApplications/feature-nav/src/app.tsx';
|
|
136
|
+
const result = applyPathMappings(oldPath, defaultMappings);
|
|
137
|
+
expect(result).toBe(oldPath);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('should not modify paths that partially match', () => {
|
|
141
|
+
const result = applyPathMappings('webApplication/src/app.tsx', defaultMappings);
|
|
142
|
+
expect(result).toBe('webApplication/src/app.tsx');
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it('should not modify paths with mapping prefix in middle', () => {
|
|
146
|
+
const result = applyPathMappings('src/webApp/app.tsx', defaultMappings);
|
|
147
|
+
expect(result).toBe('src/webApp/app.tsx');
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
describe('empty or no mappings', () => {
|
|
152
|
+
it('should return path unchanged when no mappings provided', () => {
|
|
153
|
+
const result = applyPathMappings('webApp/src/app.tsx', []);
|
|
154
|
+
expect(result).toBe('webApp/src/app.tsx');
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
describe('exact match', () => {
|
|
159
|
+
it('should handle exact match of mapping prefix', () => {
|
|
160
|
+
const result = applyPathMappings('webApp', defaultMappings);
|
|
161
|
+
expect(result).toBe('digitalExperiences/webApplications/feature-nav');
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
it('should handle exact match with file extension', () => {
|
|
165
|
+
const result = applyPathMappings('webApp.tsx', defaultMappings);
|
|
166
|
+
expect(result).toBe('webApp.tsx'); // No match, doesn't start with 'webApp/'
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
describe('multiple mappings', () => {
|
|
171
|
+
it('should apply first matching mapping when multiple provided', () => {
|
|
172
|
+
const mappings = [
|
|
173
|
+
{ from: 'webApp', to: 'path1' },
|
|
174
|
+
{ from: 'webApp', to: 'path2' } // This should not be used
|
|
175
|
+
];
|
|
176
|
+
const result = applyPathMappings('webApp/file.txt', mappings);
|
|
177
|
+
expect(result).toBe('path1/file.txt');
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
it('should try mappings in order', () => {
|
|
181
|
+
const mappings = [
|
|
182
|
+
{ from: 'foo', to: 'path-foo' },
|
|
183
|
+
{ from: 'webApp', to: 'path-webapp' },
|
|
184
|
+
{ from: 'bar', to: 'path-bar' }
|
|
185
|
+
];
|
|
186
|
+
const result = applyPathMappings('webApp/file.txt', mappings);
|
|
187
|
+
expect(result).toBe('path-webapp/file.txt');
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it('should apply different mappings for different prefixes', () => {
|
|
191
|
+
const mappings = [
|
|
192
|
+
{ from: 'web', to: 'custom/web' },
|
|
193
|
+
{ from: 'shared', to: 'common/shared' }
|
|
194
|
+
];
|
|
195
|
+
expect(applyPathMappings('web/src/app.tsx', mappings)).toBe('custom/web/src/app.tsx');
|
|
196
|
+
expect(applyPathMappings('shared/utils.ts', mappings)).toBe('common/shared/utils.ts');
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
describe('custom mapping prefixes', () => {
|
|
201
|
+
it('should handle custom mapping prefixes', () => {
|
|
202
|
+
const mappings = [{ from: 'web', to: 'custom/web/path' }];
|
|
203
|
+
const result = applyPathMappings('web/src/app.tsx', mappings);
|
|
204
|
+
expect(result).toBe('custom/web/path/src/app.tsx');
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
it('should handle short custom prefix', () => {
|
|
208
|
+
const mappings = [{ from: 'w', to: 'digitalExperiences/webApplications/app' }];
|
|
209
|
+
const result = applyPathMappings('w/src/app.tsx', mappings);
|
|
210
|
+
expect(result).toBe('digitalExperiences/webApplications/app/src/app.tsx');
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
describe('edge cases', () => {
|
|
215
|
+
it('should handle paths with special characters', () => {
|
|
216
|
+
const result = applyPathMappings('webApp/src/app-config.tsx', defaultMappings);
|
|
217
|
+
expect(result).toBe('digitalExperiences/webApplications/feature-nav/src/app-config.tsx');
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it('should handle paths with dots', () => {
|
|
221
|
+
const result = applyPathMappings('webApp/src/app.config.tsx', defaultMappings);
|
|
222
|
+
expect(result).toBe('digitalExperiences/webApplications/feature-nav/src/app.config.tsx');
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
it('should handle paths with underscores', () => {
|
|
226
|
+
const result = applyPathMappings('webApp/src/__inherit__app.tsx', defaultMappings);
|
|
227
|
+
expect(result).toBe('digitalExperiences/webApplications/feature-nav/src/__inherit__app.tsx');
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
it('should handle empty path', () => {
|
|
231
|
+
const result = applyPathMappings('', defaultMappings);
|
|
232
|
+
expect(result).toBe('');
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
it('should handle root level file with no slash', () => {
|
|
236
|
+
const result = applyPathMappings('README.md', defaultMappings);
|
|
237
|
+
expect(result).toBe('README.md');
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
});
|