import { readPackageJson } from '../utils.js';
/**
 * Detection pattern for PWA Kit v3 storefronts.
 *
 * Detects projects that have PWA Kit v3 SDK dependencies in package.json.
 * Supports two flavors:
 * - Template copy: Has @salesforce/pwa-kit-* packages
 * - Extensible: Has @salesforce/retail-react-app or ccExtensibility field
 */
export const pwaKitV3Pattern = {
    name: 'pwa-kit-v3',
    projectType: 'pwa-kit-v3',
    detect: async (workspacePath) => {
        const pkg = await readPackageJson(workspacePath);
        if (!pkg)
            return false;
        // Check for ccExtensibility field (extensible flavor marker)
        if (pkg.ccExtensibility)
            return true;
        const deps = Object.keys({ ...pkg.dependencies, ...pkg.devDependencies });
        // Template copy flavor: @salesforce/pwa-kit-* packages
        // Extensible flavor: @salesforce/retail-react-app package
        return deps.some((dep) => dep.startsWith('@salesforce/pwa-kit') || dep === '@salesforce/retail-react-app');
    },
};
//# sourceMappingURL=pwa-kit.js.map