@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,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a debounced function that delays invoking func until after wait milliseconds
|
|
3
|
+
* have elapsed since the last time the debounced function was invoked.
|
|
4
|
+
*/
|
|
5
|
+
export function debounce(func, wait) {
|
|
6
|
+
let timeoutId = null;
|
|
7
|
+
return function debounced(...args) {
|
|
8
|
+
// Clear any existing timeout
|
|
9
|
+
if (timeoutId !== null) {
|
|
10
|
+
clearTimeout(timeoutId);
|
|
11
|
+
}
|
|
12
|
+
// Set a new timeout
|
|
13
|
+
timeoutId = setTimeout(() => {
|
|
14
|
+
func(...args);
|
|
15
|
+
timeoutId = null;
|
|
16
|
+
}, wait);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=debounce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debounce.js","sourceRoot":"","sources":["../../src/utils/debounce.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAO,EACP,IAAY;IAEZ,IAAI,SAAS,GAA0B,IAAI,CAAC;IAE5C,OAAO,SAAS,SAAS,CAAC,GAAG,IAAmB;QAC9C,6BAA6B;QAC7B,IAAI,SAAS,KAAK,IAAI,EAAE,CAAC;YACvB,YAAY,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC;QAED,oBAAoB;QACpB,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAC1B,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;YACd,SAAS,GAAG,IAAI,CAAC;QACnB,CAAC,EAAE,IAAI,CAAC,CAAC;IACX,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SourceFile } from 'ts-morph';
|
|
2
|
+
/**
|
|
3
|
+
* Merge imports from feature file into target file
|
|
4
|
+
* Handles:
|
|
5
|
+
* - Deduplicating imports from the same module
|
|
6
|
+
* - Merging named imports from the same module
|
|
7
|
+
* - Preventing duplicate default import names from different modules
|
|
8
|
+
* - Merging different import types from the same module
|
|
9
|
+
* - Removing imports from __delete__ marked files
|
|
10
|
+
*/
|
|
11
|
+
export declare function mergeImports(featureFile: SourceFile, targetFile: SourceFile): void;
|
|
12
|
+
//# sourceMappingURL=import-merger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-merger.d.ts","sourceRoot":"","sources":["../../src/utils/import-merger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI,CA0HlF"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Merge imports from feature file into target file
|
|
3
|
+
* Handles:
|
|
4
|
+
* - Deduplicating imports from the same module
|
|
5
|
+
* - Merging named imports from the same module
|
|
6
|
+
* - Preventing duplicate default import names from different modules
|
|
7
|
+
* - Merging different import types from the same module
|
|
8
|
+
* - Removing imports from __delete__ marked files
|
|
9
|
+
*/
|
|
10
|
+
export function mergeImports(featureFile, targetFile) {
|
|
11
|
+
const featureImports = featureFile.getImportDeclarations();
|
|
12
|
+
const targetImports = targetFile.getImportDeclarations();
|
|
13
|
+
// Build a map of existing target imports by module specifier
|
|
14
|
+
// This handles multiple imports from the same module in the target
|
|
15
|
+
const targetImportsMap = new Map();
|
|
16
|
+
const duplicateTargetImports = [];
|
|
17
|
+
for (const imp of targetImports) {
|
|
18
|
+
const moduleSpecifier = imp.getModuleSpecifierValue();
|
|
19
|
+
if (!targetImportsMap.has(moduleSpecifier)) {
|
|
20
|
+
targetImportsMap.set(moduleSpecifier, imp);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
// Found a duplicate import from same module, mark for merging
|
|
24
|
+
duplicateTargetImports.push(imp);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
// Merge duplicate imports in target first
|
|
28
|
+
for (const duplicateImport of duplicateTargetImports) {
|
|
29
|
+
const moduleSpecifier = duplicateImport.getModuleSpecifierValue();
|
|
30
|
+
const primaryImport = targetImportsMap.get(moduleSpecifier);
|
|
31
|
+
if (primaryImport) {
|
|
32
|
+
mergeImportDeclarations(duplicateImport, primaryImport);
|
|
33
|
+
duplicateImport.remove();
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Track all default import names already in target (to prevent conflicts)
|
|
37
|
+
const existingDefaultImportNames = new Set();
|
|
38
|
+
for (const imp of targetFile.getImportDeclarations()) {
|
|
39
|
+
const defaultImport = imp.getDefaultImport();
|
|
40
|
+
if (defaultImport) {
|
|
41
|
+
existingDefaultImportNames.add(defaultImport.getText());
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Add/merge imports from feature
|
|
45
|
+
for (const featureImport of featureImports) {
|
|
46
|
+
const moduleSpecifier = featureImport.getModuleSpecifierValue();
|
|
47
|
+
const targetImport = targetImportsMap.get(moduleSpecifier);
|
|
48
|
+
const featureDefaultImport = featureImport.getDefaultImport()?.getText();
|
|
49
|
+
if (!targetImport) {
|
|
50
|
+
// Import from this module doesn't exist in target
|
|
51
|
+
// Check if default import name would conflict
|
|
52
|
+
if (featureDefaultImport && existingDefaultImportNames.has(featureDefaultImport)) {
|
|
53
|
+
// Feature import has same name as existing import from different module
|
|
54
|
+
// Feature should take precedence - find and replace the conflicting import
|
|
55
|
+
const conflictingImport = targetFile.getImportDeclarations().find(imp => imp.getDefaultImport()?.getText() === featureDefaultImport &&
|
|
56
|
+
imp.getModuleSpecifierValue() !== moduleSpecifier);
|
|
57
|
+
if (conflictingImport) {
|
|
58
|
+
// Replace the module specifier of the conflicting import
|
|
59
|
+
conflictingImport.setModuleSpecifier(moduleSpecifier);
|
|
60
|
+
// Merge any named imports from feature into the updated import
|
|
61
|
+
const featureNamedImports = featureImport.getNamedImports();
|
|
62
|
+
if (featureNamedImports.length > 0) {
|
|
63
|
+
const existingNamedImports = new Set(conflictingImport.getNamedImports().map(ni => ni.getName()));
|
|
64
|
+
for (const namedImport of featureNamedImports) {
|
|
65
|
+
const importName = namedImport.getName();
|
|
66
|
+
if (!existingNamedImports.has(importName)) {
|
|
67
|
+
conflictingImport.addNamedImport({
|
|
68
|
+
name: importName,
|
|
69
|
+
alias: namedImport.getAliasNode()?.getText()
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Update the map to point to the updated import
|
|
75
|
+
targetImportsMap.set(moduleSpecifier, conflictingImport);
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Add the import
|
|
80
|
+
targetFile.addImportDeclaration({
|
|
81
|
+
moduleSpecifier: moduleSpecifier,
|
|
82
|
+
isTypeOnly: featureImport.isTypeOnly(),
|
|
83
|
+
namedImports: featureImport.getNamedImports().map(ni => ({
|
|
84
|
+
name: ni.getName(),
|
|
85
|
+
alias: ni.getAliasNode()?.getText(),
|
|
86
|
+
isTypeOnly: ni.isTypeOnly()
|
|
87
|
+
})),
|
|
88
|
+
defaultImport: featureDefaultImport,
|
|
89
|
+
namespaceImport: featureImport.getNamespaceImport()?.getText()
|
|
90
|
+
});
|
|
91
|
+
// Track the new default import
|
|
92
|
+
if (featureDefaultImport) {
|
|
93
|
+
existingDefaultImportNames.add(featureDefaultImport);
|
|
94
|
+
}
|
|
95
|
+
// Update map with new import
|
|
96
|
+
const newImports = targetFile.getImportDeclarations();
|
|
97
|
+
const addedImport = newImports[newImports.length - 1];
|
|
98
|
+
targetImportsMap.set(moduleSpecifier, addedImport);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
// Import from this module exists, merge them
|
|
102
|
+
mergeImportDeclarations(featureImport, targetImport);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// Final deduplication pass for named imports
|
|
106
|
+
deduplicateNamedImports(targetFile);
|
|
107
|
+
// Remove imports from __delete__ marked files
|
|
108
|
+
removeDeleteMarkedImports(targetFile);
|
|
109
|
+
// Ensure proper formatting: blank line after imports
|
|
110
|
+
ensureBlankLineAfterImports(targetFile);
|
|
111
|
+
// Don't call organizeImports() as it can be too aggressive and remove imports
|
|
112
|
+
// that are actually needed but appear unused in the isolated file context
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Merge sourceImport into targetImport
|
|
116
|
+
* Combines default imports, named imports, and namespace imports
|
|
117
|
+
* Handles type imports vs regular imports appropriately
|
|
118
|
+
*/
|
|
119
|
+
function mergeImportDeclarations(sourceImport, targetImport) {
|
|
120
|
+
const sourceIsTypeOnly = sourceImport.isTypeOnly();
|
|
121
|
+
const targetIsTypeOnly = targetImport.isTypeOnly();
|
|
122
|
+
// If type-only status differs, we need to add a separate import declaration
|
|
123
|
+
// instead of merging, because you can't mix type and regular imports
|
|
124
|
+
if (sourceIsTypeOnly !== targetIsTypeOnly) {
|
|
125
|
+
// Get the source file and add a new import
|
|
126
|
+
const targetFile = targetImport.getSourceFile();
|
|
127
|
+
const moduleSpecifier = sourceImport.getModuleSpecifierValue();
|
|
128
|
+
// Check if an import with matching type-only status already exists
|
|
129
|
+
const existingMatchingImport = targetFile.getImportDeclarations().find(imp => imp.getModuleSpecifierValue() === moduleSpecifier &&
|
|
130
|
+
imp.isTypeOnly() === sourceIsTypeOnly &&
|
|
131
|
+
imp !== targetImport);
|
|
132
|
+
if (existingMatchingImport) {
|
|
133
|
+
// Merge into the matching import instead
|
|
134
|
+
mergeImportDeclarations(sourceImport, existingMatchingImport);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
// Add new import with same type-only status as source
|
|
138
|
+
targetFile.addImportDeclaration({
|
|
139
|
+
moduleSpecifier: moduleSpecifier,
|
|
140
|
+
isTypeOnly: sourceIsTypeOnly,
|
|
141
|
+
namedImports: sourceImport.getNamedImports().map(ni => ({
|
|
142
|
+
name: ni.getName(),
|
|
143
|
+
alias: ni.getAliasNode()?.getText(),
|
|
144
|
+
isTypeOnly: ni.isTypeOnly()
|
|
145
|
+
})),
|
|
146
|
+
defaultImport: sourceImport.getDefaultImport()?.getText(),
|
|
147
|
+
namespaceImport: sourceImport.getNamespaceImport()?.getText()
|
|
148
|
+
});
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
// Same type-only status, proceed with merge
|
|
152
|
+
// Add default import if target doesn't have one and source does
|
|
153
|
+
const sourceDefaultImport = sourceImport.getDefaultImport();
|
|
154
|
+
const targetDefaultImport = targetImport.getDefaultImport();
|
|
155
|
+
if (sourceDefaultImport && !targetDefaultImport) {
|
|
156
|
+
targetImport.setDefaultImport(sourceDefaultImport.getText());
|
|
157
|
+
}
|
|
158
|
+
// Add namespace import if target doesn't have one and source does
|
|
159
|
+
const sourceNamespaceImport = sourceImport.getNamespaceImport();
|
|
160
|
+
const targetNamespaceImport = targetImport.getNamespaceImport();
|
|
161
|
+
if (sourceNamespaceImport && !targetNamespaceImport) {
|
|
162
|
+
targetImport.setNamespaceImport(sourceNamespaceImport.getText());
|
|
163
|
+
}
|
|
164
|
+
// Merge named imports
|
|
165
|
+
const targetNamedImports = new Set(targetImport.getNamedImports().map(ni => ni.getName()));
|
|
166
|
+
for (const sourceNamedImport of sourceImport.getNamedImports()) {
|
|
167
|
+
const importName = sourceNamedImport.getName();
|
|
168
|
+
if (!targetNamedImports.has(importName)) {
|
|
169
|
+
targetImport.addNamedImport({
|
|
170
|
+
name: importName,
|
|
171
|
+
alias: sourceNamedImport.getAliasNode()?.getText(),
|
|
172
|
+
isTypeOnly: sourceNamedImport.isTypeOnly()
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Remove duplicate named imports within each import declaration
|
|
179
|
+
*/
|
|
180
|
+
function deduplicateNamedImports(file) {
|
|
181
|
+
const allImports = file.getImportDeclarations();
|
|
182
|
+
for (const imp of allImports) {
|
|
183
|
+
const namedImports = imp.getNamedImports();
|
|
184
|
+
const seen = new Set();
|
|
185
|
+
for (const namedImport of namedImports) {
|
|
186
|
+
const name = namedImport.getName();
|
|
187
|
+
if (seen.has(name)) {
|
|
188
|
+
namedImport.remove();
|
|
189
|
+
}
|
|
190
|
+
else {
|
|
191
|
+
seen.add(name);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Remove imports from files marked with __delete__ prefix
|
|
198
|
+
* These imports reference deleted files and should be removed
|
|
199
|
+
*/
|
|
200
|
+
function removeDeleteMarkedImports(file) {
|
|
201
|
+
const DELETE_PREFIX = '__delete__';
|
|
202
|
+
const allImports = file.getImportDeclarations();
|
|
203
|
+
for (const imp of allImports) {
|
|
204
|
+
const moduleSpecifier = imp.getModuleSpecifierValue();
|
|
205
|
+
// Check if the module specifier contains __delete__ prefix
|
|
206
|
+
// This covers both direct paths like "./__delete__new" and path segments
|
|
207
|
+
if (moduleSpecifier.includes(DELETE_PREFIX)) {
|
|
208
|
+
imp.remove();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Ensure there's a blank line after the last import declaration
|
|
214
|
+
* This maintains proper formatting between imports and code
|
|
215
|
+
*/
|
|
216
|
+
function ensureBlankLineAfterImports(file) {
|
|
217
|
+
const imports = file.getImportDeclarations();
|
|
218
|
+
if (imports.length === 0) {
|
|
219
|
+
return; // No imports, nothing to do
|
|
220
|
+
}
|
|
221
|
+
const lastImport = imports[imports.length - 1];
|
|
222
|
+
// Get the next statement after imports (if any)
|
|
223
|
+
const statements = file.getStatements();
|
|
224
|
+
const lastImportIndex = statements.indexOf(lastImport);
|
|
225
|
+
if (lastImportIndex === -1 || lastImportIndex === statements.length - 1) {
|
|
226
|
+
return; // Last import is the last statement, no code after it
|
|
227
|
+
}
|
|
228
|
+
const nextStatement = statements[lastImportIndex + 1];
|
|
229
|
+
// Check if there's already proper spacing
|
|
230
|
+
const fullText = file.getFullText();
|
|
231
|
+
const textBetween = fullText.substring(lastImport.getEnd(), nextStatement.getStart());
|
|
232
|
+
// Count newlines in the text between
|
|
233
|
+
const newlineCount = (textBetween.match(/\n/g) || []).length;
|
|
234
|
+
// We want at least 2 newlines (one ends the import, one creates blank line)
|
|
235
|
+
if (newlineCount < 2) {
|
|
236
|
+
// Insert additional newline after the last import
|
|
237
|
+
file.insertText(lastImport.getEnd(), '\n');
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=import-merger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import-merger.js","sourceRoot":"","sources":["../../src/utils/import-merger.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,WAAuB,EAAE,UAAsB;IAC1E,MAAM,cAAc,GAAG,WAAW,CAAC,qBAAqB,EAAE,CAAC;IAC3D,MAAM,aAAa,GAAG,UAAU,CAAC,qBAAqB,EAAE,CAAC;IAEzD,6DAA6D;IAC7D,mEAAmE;IACnE,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAmC,CAAC;IACpE,MAAM,sBAAsB,GAAyB,EAAE,CAAC;IAExD,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE,CAAC;QAChC,MAAM,eAAe,GAAG,GAAG,CAAC,uBAAuB,EAAE,CAAC;QAEtD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC;YAC3C,gBAAgB,CAAC,GAAG,CAAC,eAAe,EAAE,GAAG,CAAC,CAAC;QAC7C,CAAC;aAAM,CAAC;YACN,8DAA8D;YAC9D,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,0CAA0C;IAC1C,KAAK,MAAM,eAAe,IAAI,sBAAsB,EAAE,CAAC;QACrD,MAAM,eAAe,GAAG,eAAe,CAAC,uBAAuB,EAAE,CAAC;QAClE,MAAM,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AAW,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;IAE7D,4EAA4E;IAC5E,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;QACrB,kDAAkD;QAClD,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC;IAC7C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function success(message: string): void;
|
|
2
|
+
export declare function error(message: string): void;
|
|
3
|
+
export declare function info(message: string): void;
|
|
4
|
+
export declare function warning(message: string): void;
|
|
5
|
+
export declare function heading(message: string): void;
|
|
6
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAEA,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE3C;AAED,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE1C;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE7C;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAE7C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
export function success(message) {
|
|
3
|
+
console.log(chalk.green('✓'), message);
|
|
4
|
+
}
|
|
5
|
+
export function error(message) {
|
|
6
|
+
console.error(chalk.red('✗'), message);
|
|
7
|
+
}
|
|
8
|
+
export function info(message) {
|
|
9
|
+
console.log(chalk.blue('ℹ'), message);
|
|
10
|
+
}
|
|
11
|
+
export function warning(message) {
|
|
12
|
+
console.log(chalk.yellow('⚠'), message);
|
|
13
|
+
}
|
|
14
|
+
export function heading(message) {
|
|
15
|
+
console.log(chalk.bold.cyan(`\n${message}`));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,KAAK,CAAC,OAAe;IACnC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AACzC,CAAC;AAED,MAAM,UAAU,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,OAAe;IACrC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { PathMapping, PathMappings } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get default path mappings for a feature
|
|
4
|
+
* Maps webApp → digitalExperiences/webApplications/<featureName>
|
|
5
|
+
*
|
|
6
|
+
* @param featureName - The name of the feature (e.g., 'feature-navigation-menu')
|
|
7
|
+
* @returns Array containing the default path mapping
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* getDefaultPathMappings('feature-nav')
|
|
11
|
+
* // Returns: [{ from: 'webApp', to: 'digitalExperiences/webApplications/feature-nav' }]
|
|
12
|
+
*/
|
|
13
|
+
export declare function getDefaultPathMappings(featureName: string): PathMapping[];
|
|
14
|
+
/**
|
|
15
|
+
* Check if path mappings are enabled for a feature
|
|
16
|
+
* Default: true (enabled by default, opt-out)
|
|
17
|
+
*
|
|
18
|
+
* @param pathMappings - The path mappings configuration from the feature
|
|
19
|
+
* @returns true if mappings are enabled (default), false if explicitly disabled
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* arePathMappingsEnabled(undefined) // Returns: true (default enabled)
|
|
23
|
+
* arePathMappingsEnabled({ enabled: false }) // Returns: false
|
|
24
|
+
* arePathMappingsEnabled({ enabled: true }) // Returns: true
|
|
25
|
+
* arePathMappingsEnabled({ mappings: [...] }) // Returns: true (enabled by default)
|
|
26
|
+
*/
|
|
27
|
+
export declare function arePathMappingsEnabled(pathMappings?: PathMappings): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Get the effective path mappings for a feature
|
|
30
|
+
* Returns custom mappings if provided, otherwise default mappings
|
|
31
|
+
*
|
|
32
|
+
* @param featureName - The name of the feature
|
|
33
|
+
* @param pathMappings - The path mappings configuration from the feature
|
|
34
|
+
* @returns Array of path mappings to apply (empty if disabled)
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* // Default behavior (no config)
|
|
38
|
+
* getEffectivePathMappings('feature-nav', undefined)
|
|
39
|
+
* // Returns: [{ from: 'webApp', to: 'digitalExperiences/webApplications/feature-nav' }]
|
|
40
|
+
*
|
|
41
|
+
* // Disabled
|
|
42
|
+
* getEffectivePathMappings('feature-nav', { enabled: false })
|
|
43
|
+
* // Returns: []
|
|
44
|
+
*
|
|
45
|
+
* // Custom mappings
|
|
46
|
+
* getEffectivePathMappings('feature-nav', { mappings: [{ from: 'web', to: 'custom/path' }] })
|
|
47
|
+
* // Returns: [{ from: 'web', to: 'custom/path' }]
|
|
48
|
+
*/
|
|
49
|
+
export declare function getEffectivePathMappings(featureName: string, pathMappings?: PathMappings): PathMapping[];
|
|
50
|
+
/**
|
|
51
|
+
* Apply path mappings to a template file path
|
|
52
|
+
*
|
|
53
|
+
* This function transforms simplified paths (e.g., "webApp/src/app.tsx") into
|
|
54
|
+
* their full target paths (e.g., "digitalExperiences/webApplications/feature-name/src/app.tsx")
|
|
55
|
+
* based on the provided mappings.
|
|
56
|
+
*
|
|
57
|
+
* The function checks each mapping in order and applies the first one that matches.
|
|
58
|
+
* If no mapping matches, the path is returned unchanged (backwards compatibility).
|
|
59
|
+
*
|
|
60
|
+
* @param templatePath - Path relative to template directory (e.g., "webApp/src/app.tsx")
|
|
61
|
+
* @param mappings - Array of path mappings to apply
|
|
62
|
+
* @returns Transformed path with mapping applied
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* // Apply default webApp mapping
|
|
66
|
+
* applyPathMappings('webApp/src/app.tsx', [{
|
|
67
|
+
* from: 'webApp',
|
|
68
|
+
* to: 'digitalExperiences/webApplications/feature-nav'
|
|
69
|
+
* }])
|
|
70
|
+
* // Returns: 'digitalExperiences/webApplications/feature-nav/src/app.tsx'
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* // Backwards compatibility - old paths pass through
|
|
74
|
+
* applyPathMappings('digitalExperiences/webApplications/feature-nav/src/app.tsx', [...])
|
|
75
|
+
* // Returns: 'digitalExperiences/webApplications/feature-nav/src/app.tsx'
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* // No mappings - path unchanged
|
|
79
|
+
* applyPathMappings('webApp/src/app.tsx', [])
|
|
80
|
+
* // Returns: 'webApp/src/app.tsx'
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* // No match - path unchanged
|
|
84
|
+
* applyPathMappings('src/app.tsx', [{ from: 'webApp', to: '...' }])
|
|
85
|
+
* // Returns: 'src/app.tsx'
|
|
86
|
+
*/
|
|
87
|
+
export declare function applyPathMappings(templatePath: string, mappings: PathMapping[]): string;
|
|
88
|
+
//# sourceMappingURL=path-mappings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-mappings.d.ts","sourceRoot":"","sources":["../../src/utils/path-mappings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAExD;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,EAAE,CAOzE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,OAAO,CAS3E;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,wBAAwB,CACtC,WAAW,EAAE,MAAM,EACnB,YAAY,CAAC,EAAE,YAAY,GAC1B,WAAW,EAAE,CAaf;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,WAAW,EAAE,GACtB,MAAM,CA4BR"}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get default path mappings for a feature
|
|
3
|
+
* Maps webApp → digitalExperiences/webApplications/<featureName>
|
|
4
|
+
*
|
|
5
|
+
* @param featureName - The name of the feature (e.g., 'feature-navigation-menu')
|
|
6
|
+
* @returns Array containing the default path mapping
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* getDefaultPathMappings('feature-nav')
|
|
10
|
+
* // Returns: [{ from: 'webApp', to: 'digitalExperiences/webApplications/feature-nav' }]
|
|
11
|
+
*/
|
|
12
|
+
export function getDefaultPathMappings(featureName) {
|
|
13
|
+
return [
|
|
14
|
+
{
|
|
15
|
+
from: 'webApp',
|
|
16
|
+
to: `digitalExperiences/webApplications/${featureName}`
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Check if path mappings are enabled for a feature
|
|
22
|
+
* Default: true (enabled by default, opt-out)
|
|
23
|
+
*
|
|
24
|
+
* @param pathMappings - The path mappings configuration from the feature
|
|
25
|
+
* @returns true if mappings are enabled (default), false if explicitly disabled
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* arePathMappingsEnabled(undefined) // Returns: true (default enabled)
|
|
29
|
+
* arePathMappingsEnabled({ enabled: false }) // Returns: false
|
|
30
|
+
* arePathMappingsEnabled({ enabled: true }) // Returns: true
|
|
31
|
+
* arePathMappingsEnabled({ mappings: [...] }) // Returns: true (enabled by default)
|
|
32
|
+
*/
|
|
33
|
+
export function arePathMappingsEnabled(pathMappings) {
|
|
34
|
+
// If pathMappings is undefined, default to enabled
|
|
35
|
+
if (!pathMappings)
|
|
36
|
+
return true;
|
|
37
|
+
// If pathMappings.enabled is explicitly set, use that value
|
|
38
|
+
if (pathMappings.enabled !== undefined)
|
|
39
|
+
return pathMappings.enabled;
|
|
40
|
+
// Otherwise, enabled by default
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the effective path mappings for a feature
|
|
45
|
+
* Returns custom mappings if provided, otherwise default mappings
|
|
46
|
+
*
|
|
47
|
+
* @param featureName - The name of the feature
|
|
48
|
+
* @param pathMappings - The path mappings configuration from the feature
|
|
49
|
+
* @returns Array of path mappings to apply (empty if disabled)
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* // Default behavior (no config)
|
|
53
|
+
* getEffectivePathMappings('feature-nav', undefined)
|
|
54
|
+
* // Returns: [{ from: 'webApp', to: 'digitalExperiences/webApplications/feature-nav' }]
|
|
55
|
+
*
|
|
56
|
+
* // Disabled
|
|
57
|
+
* getEffectivePathMappings('feature-nav', { enabled: false })
|
|
58
|
+
* // Returns: []
|
|
59
|
+
*
|
|
60
|
+
* // Custom mappings
|
|
61
|
+
* getEffectivePathMappings('feature-nav', { mappings: [{ from: 'web', to: 'custom/path' }] })
|
|
62
|
+
* // Returns: [{ from: 'web', to: 'custom/path' }]
|
|
63
|
+
*/
|
|
64
|
+
export function getEffectivePathMappings(featureName, pathMappings) {
|
|
65
|
+
// If disabled, return empty array (no mappings)
|
|
66
|
+
if (!arePathMappingsEnabled(pathMappings)) {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
// If custom mappings provided, use those
|
|
70
|
+
if (pathMappings?.mappings && pathMappings.mappings.length > 0) {
|
|
71
|
+
return pathMappings.mappings;
|
|
72
|
+
}
|
|
73
|
+
// Otherwise, use default mappings
|
|
74
|
+
return getDefaultPathMappings(featureName);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Apply path mappings to a template file path
|
|
78
|
+
*
|
|
79
|
+
* This function transforms simplified paths (e.g., "webApp/src/app.tsx") into
|
|
80
|
+
* their full target paths (e.g., "digitalExperiences/webApplications/feature-name/src/app.tsx")
|
|
81
|
+
* based on the provided mappings.
|
|
82
|
+
*
|
|
83
|
+
* The function checks each mapping in order and applies the first one that matches.
|
|
84
|
+
* If no mapping matches, the path is returned unchanged (backwards compatibility).
|
|
85
|
+
*
|
|
86
|
+
* @param templatePath - Path relative to template directory (e.g., "webApp/src/app.tsx")
|
|
87
|
+
* @param mappings - Array of path mappings to apply
|
|
88
|
+
* @returns Transformed path with mapping applied
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* // Apply default webApp mapping
|
|
92
|
+
* applyPathMappings('webApp/src/app.tsx', [{
|
|
93
|
+
* from: 'webApp',
|
|
94
|
+
* to: 'digitalExperiences/webApplications/feature-nav'
|
|
95
|
+
* }])
|
|
96
|
+
* // Returns: 'digitalExperiences/webApplications/feature-nav/src/app.tsx'
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* // Backwards compatibility - old paths pass through
|
|
100
|
+
* applyPathMappings('digitalExperiences/webApplications/feature-nav/src/app.tsx', [...])
|
|
101
|
+
* // Returns: 'digitalExperiences/webApplications/feature-nav/src/app.tsx'
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* // No mappings - path unchanged
|
|
105
|
+
* applyPathMappings('webApp/src/app.tsx', [])
|
|
106
|
+
* // Returns: 'webApp/src/app.tsx'
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* // No match - path unchanged
|
|
110
|
+
* applyPathMappings('src/app.tsx', [{ from: 'webApp', to: '...' }])
|
|
111
|
+
* // Returns: 'src/app.tsx'
|
|
112
|
+
*/
|
|
113
|
+
export function applyPathMappings(templatePath, mappings) {
|
|
114
|
+
// If no mappings, return path as-is (backwards compatibility)
|
|
115
|
+
if (mappings.length === 0) {
|
|
116
|
+
return templatePath;
|
|
117
|
+
}
|
|
118
|
+
// Try each mapping in order (first match wins)
|
|
119
|
+
for (const mapping of mappings) {
|
|
120
|
+
const fromPrefix = mapping.from + '/';
|
|
121
|
+
// Check if path starts with the mapping's "from" prefix
|
|
122
|
+
if (templatePath.startsWith(fromPrefix)) {
|
|
123
|
+
// Replace prefix with "to" prefix
|
|
124
|
+
const remainder = templatePath.substring(fromPrefix.length);
|
|
125
|
+
return mapping.to + '/' + remainder;
|
|
126
|
+
}
|
|
127
|
+
// Also handle exact match (no trailing slash)
|
|
128
|
+
if (templatePath === mapping.from) {
|
|
129
|
+
return mapping.to;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// No mapping matched, return original path
|
|
133
|
+
// This handles both:
|
|
134
|
+
// 1. Old-style full paths (digitalExperiences/webApplications/...)
|
|
135
|
+
// 2. Other paths that don't use the mapping shorthand
|
|
136
|
+
return templatePath;
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=path-mappings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path-mappings.js","sourceRoot":"","sources":["../../src/utils/path-mappings.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,U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C,EAAE,CAAC;YACxC,kCAAkC;YAClC,MAAM,SAAS,GAAG,YAAY,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAC5D,OAAO,OAAO,CAAC,EAAE,GAAG,GAAG,GAAG,SAAS,CAAC;QACtC,CAAC;QAED,8CAA8C;QAC9C,IAAI,YAAY,KAAK,OAAO,CAAC,IAAI,EAAE,CAAC;YAClC,OAAO,OAAO,CAAC,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAED,2CAA2C;IAC3C,qBAAqB;IACrB,mEAAmE;IACnE,sDAAsD;IACtD,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the monorepo root by searching upward for package.json with workspaces
|
|
3
|
+
*/
|
|
4
|
+
export declare function getMonorepoRoot(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Get the features directory path
|
|
7
|
+
*/
|
|
8
|
+
export declare function getFeaturesDir(): string;
|
|
9
|
+
/**
|
|
10
|
+
* Get the directory path for a specific feature
|
|
11
|
+
*/
|
|
12
|
+
export declare function getFeatureDir(featureName: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Resolve a file path within a feature
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveFeatureFile(featureName: string, filePath: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Translate a feature file path to the corresponding base app path
|
|
19
|
+
* Replaces feature name with base app name in the nested structure
|
|
20
|
+
*
|
|
21
|
+
* Handles three formats:
|
|
22
|
+
* 1. Full path: "digitalExperiences/webApplications/feature-simple/src/routes.tsx"
|
|
23
|
+
* → "digitalExperiences/webApplications/base-app/src/routes.tsx"
|
|
24
|
+
* 2. WebApp path: "webApp/src/routes.tsx"
|
|
25
|
+
* → "digitalExperiences/webApplications/base-app/src/routes.tsx"
|
|
26
|
+
* 3. Other SFDX paths: "classes/NavMenu.cls"
|
|
27
|
+
* → "classes/NavMenu.cls" (unchanged, stays at root)
|
|
28
|
+
*/
|
|
29
|
+
export declare function translatePathToBaseApp(featurePath: string, featureName: string, baseAppPath: string): string;
|
|
30
|
+
/**
|
|
31
|
+
* Translate a feature file path to use a target app name
|
|
32
|
+
* Replaces feature name with target app name in the nested structure
|
|
33
|
+
*
|
|
34
|
+
* Handles three formats:
|
|
35
|
+
* 1. Full path: "digitalExperiences/webApplications/feature-simple/src/routes.tsx"
|
|
36
|
+
* → "digitalExperiences/webApplications/target-app/src/routes.tsx"
|
|
37
|
+
* 2. WebApp path: "webApp/src/routes.tsx"
|
|
38
|
+
* → "digitalExperiences/webApplications/target-app/src/routes.tsx"
|
|
39
|
+
* 3. Other SFDX paths: "classes/NavMenu.cls"
|
|
40
|
+
* → "classes/NavMenu.cls" (unchanged, stays at root)
|
|
41
|
+
*/
|
|
42
|
+
export declare function translatePathToTargetApp(featurePath: string, featureName: string, targetAppName: string): string;
|
|
43
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAiBxC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEhF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAyB5G;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAsBhH"}
|