@omega.js/manager 0.1.0
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/.claude-plugin/marketplace.json +14 -0
- package/LICENSE +98 -0
- package/README.md +165 -0
- package/bin/omega +2 -0
- package/bin/omg +2 -0
- package/claude-plugin/.claude-plugin/plugin.json +11 -0
- package/claude-plugin/.mcp.json +9 -0
- package/claude-plugin/README.md +139 -0
- package/claude-plugin/hooks/gate/mark.sh +58 -0
- package/claude-plugin/hooks/gate/run.sh +97 -0
- package/claude-plugin/hooks/guard/run.sh +249 -0
- package/claude-plugin/hooks/hooks.json +63 -0
- package/claude-plugin/hooks/inject/run.sh +127 -0
- package/claude-plugin/hooks/lib/omega-gate.sh +20 -0
- package/claude-plugin/hooks/lib/omega-scope.sh +41 -0
- package/claude-plugin/hooks/lib/omega-skills.sh +209 -0
- package/claude-plugin/hooks/quality/run.sh +132 -0
- package/claude-plugin/hooks/shape/run.sh +45 -0
- package/claude-plugin/mcp-router-launch.js +29 -0
- package/claude-plugin/skills/README.md +48 -0
- package/claude-plugin/skills/accessibility/SKILL.md +31 -0
- package/claude-plugin/skills/analytics/SKILL.md +30 -0
- package/claude-plugin/skills/backend/SKILL.md +25 -0
- package/claude-plugin/skills/brandcheck/SKILL.md +29 -0
- package/claude-plugin/skills/browser/SKILL.md +64 -0
- package/claude-plugin/skills/client/SKILL.md +24 -0
- package/claude-plugin/skills/desktop/SKILL.md +25 -0
- package/claude-plugin/skills/extension/SKILL.md +25 -0
- package/claude-plugin/skills/main/SKILL.md +54 -0
- package/claude-plugin/skills/manager/SKILL.md +25 -0
- package/claude-plugin/skills/seo/SKILL.md +36 -0
- package/claude-plugin/skills/theme/SKILL.md +33 -0
- package/claude-plugin/skills/web/SKILL.md +29 -0
- package/dist/cli-run.js +34 -0
- package/dist/cli.js +29 -0
- package/dist/commands/build.js +17 -0
- package/dist/commands/clean.js +16 -0
- package/dist/commands/company.js +46 -0
- package/dist/commands/deploy.js +143 -0
- package/dist/commands/dev.js +437 -0
- package/dist/commands/devlog.js +25 -0
- package/dist/commands/help.js +48 -0
- package/dist/commands/manage.js +53 -0
- package/dist/commands/migrate.js +76 -0
- package/dist/commands/onboard.js +31 -0
- package/dist/commands/pipeline.js +319 -0
- package/dist/commands/test.js +380 -0
- package/dist/commands/update.js +128 -0
- package/dist/commands/version.js +8 -0
- package/dist/company-init.js +167 -0
- package/dist/company.js +283 -0
- package/dist/config.js +1359 -0
- package/dist/devlog/index.js +226 -0
- package/dist/devlog/lib/collect-commits.js +136 -0
- package/dist/devlog/lib/generate-post.js +201 -0
- package/dist/devlog/lib/ghostii.js +122 -0
- package/dist/devlog/lib/project-map.js +98 -0
- package/dist/devlog/lib/publish-website.js +88 -0
- package/dist/index.js +45 -0
- package/dist/lib/agents-md.js +201 -0
- package/dist/lib/analytics-secret.js +22 -0
- package/dist/lib/argv.js +21 -0
- package/dist/lib/auth-admin.js +120 -0
- package/dist/lib/automation-client.js +210 -0
- package/dist/lib/backend-marketing.js +49 -0
- package/dist/lib/brand.js +240 -0
- package/dist/lib/bundle-id.js +53 -0
- package/dist/lib/claude-settings.js +125 -0
- package/dist/lib/company-scaffold.js +213 -0
- package/dist/lib/company.js +227 -0
- package/dist/lib/config-flow.js +350 -0
- package/dist/lib/config-write.js +41 -0
- package/dist/lib/custom-target.js +75 -0
- package/dist/lib/domain-utils.js +19 -0
- package/dist/lib/duration.js +39 -0
- package/dist/lib/env-order.js +236 -0
- package/dist/lib/env-secret.js +78 -0
- package/dist/lib/firestore-rest.js +326 -0
- package/dist/lib/framework-bin.js +156 -0
- package/dist/lib/gitignore.js +63 -0
- package/dist/lib/google-auth.js +495 -0
- package/dist/lib/google-token.js +66 -0
- package/dist/lib/jwt.js +31 -0
- package/dist/lib/legacy-oauth.js +59 -0
- package/dist/lib/node-version.js +127 -0
- package/dist/lib/owner-plan.js +78 -0
- package/dist/lib/package-scripts.js +152 -0
- package/dist/lib/preflight.js +470 -0
- package/dist/lib/product-create.js +144 -0
- package/dist/lib/run-command.js +74 -0
- package/dist/lib/run-gates.js +70 -0
- package/dist/lib/run-output.js +42 -0
- package/dist/lib/run-summary.js +384 -0
- package/dist/lib/scaffold.js +427 -0
- package/dist/lib/service-input.js +207 -0
- package/dist/lib/service-runner.js +466 -0
- package/dist/lib/stale.js +24 -0
- package/dist/lib/target-selection.js +155 -0
- package/dist/lib/verb-fanout.js +128 -0
- package/dist/lib/verify-live.js +188 -0
- package/dist/manage.js +311 -0
- package/dist/omega-bin.js +7 -0
- package/dist/onboard.js +532 -0
- package/dist/services/account/ensure/users.js +259 -0
- package/dist/services/account/index.js +97 -0
- package/dist/services/account/lib/backend-client.js +107 -0
- package/dist/services/account/lib/password.js +36 -0
- package/dist/services/account/lib/resolve-password.js +100 -0
- package/dist/services/advertising/ensure/sites.js +101 -0
- package/dist/services/advertising/index.js +101 -0
- package/dist/services/advertising/lib/adsense-api.js +41 -0
- package/dist/services/ai/ensure/keys.js +21 -0
- package/dist/services/ai/index.js +36 -0
- package/dist/services/analytics/ensure/google-firebase-link.js +230 -0
- package/dist/services/analytics/ensure/google-streams.js +256 -0
- package/dist/services/analytics/ensure/meta-pixel.js +22 -0
- package/dist/services/analytics/ensure/tiktok-pixel.js +22 -0
- package/dist/services/analytics/index.js +134 -0
- package/dist/services/analytics/lib/analytics-api.js +156 -0
- package/dist/services/analytics/lib/meta-api.js +83 -0
- package/dist/services/analytics/lib/pixel-account.js +78 -0
- package/dist/services/analytics/lib/pixel-provision.js +152 -0
- package/dist/services/analytics/lib/pixel-specs.js +57 -0
- package/dist/services/analytics/lib/pixel-token.js +88 -0
- package/dist/services/analytics/lib/property-flow.js +77 -0
- package/dist/services/analytics/lib/tiktok-api.js +157 -0
- package/dist/services/analytics/lib/tiktok-auth.js +153 -0
- package/dist/services/assets/ensure/logo-gen.js +68 -0
- package/dist/services/assets/index.js +109 -0
- package/dist/services/assets/lib/assets-config.js +168 -0
- package/dist/services/assets/lib/brandmark-api.js +160 -0
- package/dist/services/assets/lib/derived.js +113 -0
- package/dist/services/assets/lib/font-loader.js +67 -0
- package/dist/services/assets/lib/reconcile.js +122 -0
- package/dist/services/assets/lib/reset.js +118 -0
- package/dist/services/assets/lib/svg-logo-generator.js +154 -0
- package/dist/services/assets/lib/svg-to-black.js +32 -0
- package/dist/services/assets/write/favicons.js +82 -0
- package/dist/services/assets/write/icons.js +64 -0
- package/dist/services/assets/write/process.js +96 -0
- package/dist/services/assets/write/reconcile.js +30 -0
- package/dist/services/assets/write/social-icons.js +108 -0
- package/dist/services/assets/write/templates.js +345 -0
- package/dist/services/bookmark/ensure/sync.js +255 -0
- package/dist/services/bookmark/index.js +17 -0
- package/dist/services/campaigns/ensure/contact-person.js +40 -0
- package/dist/services/campaigns/ensure/custom-fields.js +84 -0
- package/dist/services/campaigns/ensure/domain-auth.js +92 -0
- package/dist/services/campaigns/ensure/event-webhook.js +89 -0
- package/dist/services/campaigns/ensure/link-branding.js +187 -0
- package/dist/services/campaigns/ensure/list.js +50 -0
- package/dist/services/campaigns/ensure/segments.js +109 -0
- package/dist/services/campaigns/ensure/sender-identity.js +153 -0
- package/dist/services/campaigns/ensure/unsubscribe-groups.js +116 -0
- package/dist/services/campaigns/index.js +79 -0
- package/dist/services/campaigns/lib/dns-sync.js +81 -0
- package/dist/services/campaigns/lib/segment-query.js +138 -0
- package/dist/services/campaigns/lib/sendgrid-api.js +287 -0
- package/dist/services/captcha/ensure/site-key.js +83 -0
- package/dist/services/captcha/index.js +78 -0
- package/dist/services/captcha/lib/console-url.js +45 -0
- package/dist/services/captcha/lib/recaptcha-api.js +36 -0
- package/dist/services/certificates/ensure/api-key.js +22 -0
- package/dist/services/certificates/ensure/bundle-ids.js +115 -0
- package/dist/services/certificates/ensure/certificates.js +187 -0
- package/dist/services/certificates/ensure/profiles.js +143 -0
- package/dist/services/certificates/index.js +225 -0
- package/dist/services/certificates/lib/apple-api.js +183 -0
- package/dist/services/certificates/lib/certificate-manager.js +252 -0
- package/dist/services/certificates/lib/identifier-manager.js +107 -0
- package/dist/services/certificates/lib/keychain.js +135 -0
- package/dist/services/certificates/lib/manual-walkthrough.js +165 -0
- package/dist/services/certificates/lib/profile-manager.js +115 -0
- package/dist/services/chat/data/baseline-knowledge.md +96 -0
- package/dist/services/chat/ensure/chat.js +106 -0
- package/dist/services/chat/ensure/user.js +45 -0
- package/dist/services/chat/index.js +139 -0
- package/dist/services/chat/lib/baseline-knowledge.js +137 -0
- package/dist/services/cloud/ensure/authentication.js +267 -0
- package/dist/services/cloud/ensure/billing.js +120 -0
- package/dist/services/cloud/ensure/cloud-messaging.js +105 -0
- package/dist/services/cloud/ensure/database.js +60 -0
- package/dist/services/cloud/ensure/firestore.js +79 -0
- package/dist/services/cloud/ensure/functions.js +49 -0
- package/dist/services/cloud/ensure/hosting.js +398 -0
- package/dist/services/cloud/ensure/oauth-consent.js +248 -0
- package/dist/services/cloud/ensure/project-settings.js +72 -0
- package/dist/services/cloud/ensure/sdk-config.js +95 -0
- package/dist/services/cloud/ensure/service-account.js +152 -0
- package/dist/services/cloud/ensure/services.js +103 -0
- package/dist/services/cloud/ensure/storage.js +47 -0
- package/dist/services/cloud/index.js +130 -0
- package/dist/services/cloud/lib/access-heal.js +130 -0
- package/dist/services/cloud/lib/firebase-api.js +662 -0
- package/dist/services/cloud/lib/project-flow.js +102 -0
- package/dist/services/directory/ensure/entry.js +48 -0
- package/dist/services/directory/index.js +64 -0
- package/dist/services/directory/lib/blocks.js +104 -0
- package/dist/services/disperse/index.js +45 -0
- package/dist/services/disperse/write/certs.js +117 -0
- package/dist/services/domain/ensure/nameservers.js +179 -0
- package/dist/services/domain/index.js +69 -0
- package/dist/services/domain/lib/namecheap-api.js +167 -0
- package/dist/services/domain/lib/registrars.js +46 -0
- package/dist/services/domain/lib/whitelist-walkthrough.js +76 -0
- package/dist/services/edge/ensure/cache-rules.js +105 -0
- package/dist/services/edge/ensure/dns-records.js +304 -0
- package/dist/services/edge/ensure/email-routing.js +292 -0
- package/dist/services/edge/ensure/rules-configuration.js +98 -0
- package/dist/services/edge/ensure/rules-managed-transforms.js +101 -0
- package/dist/services/edge/ensure/rules-redirect.js +107 -0
- package/dist/services/edge/ensure/rules-response-headers.js +90 -0
- package/dist/services/edge/ensure/rules-security.js +142 -0
- package/dist/services/edge/ensure/speed-scheduled-tests.js +98 -0
- package/dist/services/edge/ensure/workers.js +219 -0
- package/dist/services/edge/ensure/zone-settings.js +108 -0
- package/dist/services/edge/ensure/zone.js +183 -0
- package/dist/services/edge/index.js +73 -0
- package/dist/services/edge/lib/cloudflare-api.js +84 -0
- package/dist/services/edge/lib/dns-records-helpers.js +518 -0
- package/dist/services/edge/lib/read-cache.js +16 -0
- package/dist/services/edge/lib/ruleset-helper.js +108 -0
- package/dist/services/edge/workers/omega-api-proxy.js +43 -0
- package/dist/services/email/data/baseline-filter.md +4 -0
- package/dist/services/email/data/baseline-knowledge.md +86 -0
- package/dist/services/email/ensure/agent.js +107 -0
- package/dist/services/email/ensure/user.js +45 -0
- package/dist/services/email/index.js +138 -0
- package/dist/services/email/lib/baseline.js +82 -0
- package/dist/services/email/lib/knowledge-file.js +53 -0
- package/dist/services/forms/ensure/form.js +46 -0
- package/dist/services/forms/ensure/user.js +45 -0
- package/dist/services/forms/index.js +138 -0
- package/dist/services/migrations/ensure/notifications.js +189 -0
- package/dist/services/migrations/ensure/orders.js +34 -0
- package/dist/services/migrations/ensure/payment-provider.js +132 -0
- package/dist/services/migrations/ensure/payments-intents.js +34 -0
- package/dist/services/migrations/ensure/state-retirement.js +266 -0
- package/dist/services/migrations/ensure/targets-rename.js +124 -0
- package/dist/services/migrations/ensure/users.js +1176 -0
- package/dist/services/migrations/index.js +101 -0
- package/dist/services/migrations/lib/attribution-touch.js +64 -0
- package/dist/services/migrations/lib/ensure-metadata.js +144 -0
- package/dist/services/migrations/lib/migration-runner.js +473 -0
- package/dist/services/migrations/lib/sanitize-strings.js +112 -0
- package/dist/services/migrations/lib/schema-validator.js +154 -0
- package/dist/services/monitoring/ensure/dsn.js +54 -0
- package/dist/services/monitoring/ensure/projects.js +135 -0
- package/dist/services/monitoring/index.js +54 -0
- package/dist/services/monitoring/lib/sentry-api.js +94 -0
- package/dist/services/newsletter/ensure/custom-fields.js +90 -0
- package/dist/services/newsletter/ensure/publication.js +94 -0
- package/dist/services/newsletter/ensure/segments.js +140 -0
- package/dist/services/newsletter/ensure/webhook.js +108 -0
- package/dist/services/newsletter/index.js +64 -0
- package/dist/services/newsletter/lib/beehiiv-api.js +124 -0
- package/dist/services/newsletter/lib/segment-automation.js +577 -0
- package/dist/services/payment/ensure/chargebee-account.js +30 -0
- package/dist/services/payment/ensure/chargebee-products.js +359 -0
- package/dist/services/payment/ensure/chargebee-webhook.js +113 -0
- package/dist/services/payment/ensure/paypal-account.js +36 -0
- package/dist/services/payment/ensure/paypal-products.js +374 -0
- package/dist/services/payment/ensure/paypal-webhook.js +128 -0
- package/dist/services/payment/ensure/stripe-account.js +93 -0
- package/dist/services/payment/ensure/stripe-disputes.js +56 -0
- package/dist/services/payment/ensure/stripe-products.js +245 -0
- package/dist/services/payment/ensure/stripe-radar.js +74 -0
- package/dist/services/payment/ensure/stripe-webhook.js +130 -0
- package/dist/services/payment/index.js +163 -0
- package/dist/services/payment/lib/chargebee-api.js +338 -0
- package/dist/services/payment/lib/payment-utils.js +116 -0
- package/dist/services/payment/lib/paypal-api.js +354 -0
- package/dist/services/payment/lib/provider-setup.js +134 -0
- package/dist/services/payment/lib/stripe-api.js +152 -0
- package/dist/services/repo/ensure/org.js +70 -0
- package/dist/services/repo/ensure/pages.js +72 -0
- package/dist/services/repo/ensure/repo.js +90 -0
- package/dist/services/repo/index.js +52 -0
- package/dist/services/repo/lib/github-api.js +196 -0
- package/dist/services/search/ensure/ga-link.js +57 -0
- package/dist/services/search/ensure/property.js +137 -0
- package/dist/services/search/ensure/sitemaps.js +70 -0
- package/dist/services/search/index.js +61 -0
- package/dist/services/search/lib/search-console-api.js +92 -0
- package/dist/services/seo/ensure/github-repos.js +271 -0
- package/dist/services/seo/index.js +55 -0
- package/dist/services/seo/lib/gh-api.js +161 -0
- package/dist/services/seo/templates/developer-tool/.github/workflows/maintenance.yml +25 -0
- package/dist/services/seo/templates/developer-tool/.nvmrc +1 -0
- package/dist/services/seo/templates/developer-tool/_README.md.js +121 -0
- package/dist/services/seo/templates/developer-tool/_package.json.js +33 -0
- package/dist/services/seo/templates/developer-tool/src/index.js +120 -0
- package/dist/services/seo/templates/index.js +57 -0
- package/dist/services/server/ensure/brands.js +63 -0
- package/dist/services/server/index.js +42 -0
- package/dist/services/testing/ensure/target-checks.js +97 -0
- package/dist/services/testing/index.js +11 -0
- package/dist/services/testing/lib/checks.js +467 -0
- package/dist/services/update/index.js +20 -0
- package/dist/services/update/lib/cache.js +59 -0
- package/dist/services/update/lib/fingerprint.js +157 -0
- package/dist/services/update/write/targets.js +206 -0
- package/dist/services/workspace/ensure/agents.js +42 -0
- package/dist/services/workspace/ensure/claude-settings.js +34 -0
- package/dist/services/workspace/ensure/config.js +54 -0
- package/dist/services/workspace/ensure/defaults.js +60 -0
- package/dist/services/workspace/ensure/env-keys.js +55 -0
- package/dist/services/workspace/ensure/env-order.js +66 -0
- package/dist/services/workspace/ensure/env-rules.js +97 -0
- package/dist/services/workspace/ensure/gitignore.js +18 -0
- package/dist/services/workspace/ensure/scripts.js +126 -0
- package/dist/services/workspace/ensure/structure.js +97 -0
- package/dist/services/workspace/ensure/translation-sdk.js +148 -0
- package/dist/services/workspace/ensure/workflows.js +54 -0
- package/dist/services/workspace/index.js +8 -0
- package/dist/vendor/account/engine.js +182 -0
- package/dist/vendor/account/features.js +220 -0
- package/dist/vendor/account/index.js +53 -0
- package/dist/vendor/account/schema.js +272 -0
- package/dist/vendor/account/subscription.js +38 -0
- package/dist/vendor/config/company.js +31 -0
- package/dist/vendor/config/defaults.js +173 -0
- package/dist/vendor/config/demo.js +18 -0
- package/dist/vendor/config/desktop-artifacts.js +110 -0
- package/dist/vendor/config/edit.js +769 -0
- package/dist/vendor/config/env-delivery.js +145 -0
- package/dist/vendor/config/env-rules.js +93 -0
- package/dist/vendor/config/env-schema.js +1078 -0
- package/dist/vendor/config/env.js +445 -0
- package/dist/vendor/config/hooks.js +97 -0
- package/dist/vendor/config/index.js +237 -0
- package/dist/vendor/config/instances.js +208 -0
- package/dist/vendor/config/load.js +490 -0
- package/dist/vendor/config/merge.js +68 -0
- package/dist/vendor/config/order.js +139 -0
- package/dist/vendor/config/ports.js +374 -0
- package/dist/vendor/config/providers.js +32 -0
- package/dist/vendor/config/repo.js +142 -0
- package/dist/vendor/config/retired-keys.js +430 -0
- package/dist/vendor/config/schema.js +1610 -0
- package/dist/vendor/config/secrets.js +50 -0
- package/dist/vendor/config/seed.js +34 -0
- package/dist/vendor/config/site-global.js +205 -0
- package/dist/vendor/config/validate.js +554 -0
- package/dist/vendor/config/winback.js +61 -0
- package/dist/vendor/devkit/attach-log-file.js +262 -0
- package/dist/vendor/devkit/certs.js +199 -0
- package/dist/vendor/devkit/ci-workflows.js +520 -0
- package/dist/vendor/devkit/cli-router.js +156 -0
- package/dist/vendor/devkit/command-path.js +46 -0
- package/dist/vendor/devkit/deploy-record.js +180 -0
- package/dist/vendor/devkit/flows.js +317 -0
- package/dist/vendor/devkit/local-https.js +360 -0
- package/dist/vendor/devkit/local.js +1905 -0
- package/dist/vendor/devkit/logger.js +128 -0
- package/dist/vendor/devkit/omega-bin.js +345 -0
- package/dist/vendor/devkit/prompt.js +187 -0
- package/dist/vendor/devkit/safe-install.js +18 -0
- package/dist/vendor/devkit/stop-signals.js +28 -0
- package/dist/vendor/devkit/test/scope.js +162 -0
- package/dist/vendor/devkit/translate/cache.js +84 -0
- package/dist/vendor/devkit/translate/engine.js +243 -0
- package/dist/vendor/devkit/translate/index.js +49 -0
- package/dist/vendor/devkit/translate/languages.js +134 -0
- package/dist/vendor/devkit/translate/providers.js +188 -0
- package/dist/vendor/devkit/update.js +569 -0
- package/docs/AGENTS.md +200 -0
- package/docs/account.md +45 -0
- package/docs/advertising.md +46 -0
- package/docs/ai.md +34 -0
- package/docs/analytics.md +69 -0
- package/docs/assets.md +57 -0
- package/docs/bookmark.md +26 -0
- package/docs/brand.md +151 -0
- package/docs/campaigns.md +96 -0
- package/docs/captcha.md +46 -0
- package/docs/certificates.md +68 -0
- package/docs/chat.md +47 -0
- package/docs/cloud.md +110 -0
- package/docs/company.md +64 -0
- package/docs/directory.md +140 -0
- package/docs/disperse.md +46 -0
- package/docs/domain.md +56 -0
- package/docs/edge.md +234 -0
- package/docs/email.md +42 -0
- package/docs/forms.md +48 -0
- package/docs/index.md +109 -0
- package/docs/migration.md +203 -0
- package/docs/migrations.md +56 -0
- package/docs/monitoring.md +41 -0
- package/docs/newsletter.md +48 -0
- package/docs/payment.md +83 -0
- package/docs/repo.md +48 -0
- package/docs/search.md +44 -0
- package/docs/seo.md +34 -0
- package/docs/server.md +37 -0
- package/docs/shared/agent-docs.md +89 -0
- package/docs/shared/analytics.md +612 -0
- package/docs/shared/brands.md +51 -0
- package/docs/shared/breaking-changes.md +497 -0
- package/docs/shared/config.md +1387 -0
- package/docs/shared/deploys.md +215 -0
- package/docs/shared/icons.md +201 -0
- package/docs/shared/local-dev.md +147 -0
- package/docs/shared/logging.md +202 -0
- package/docs/shared/monitoring.md +153 -0
- package/docs/shared/publishing.md +183 -0
- package/docs/shared/rulings.md +34 -0
- package/docs/shared/testing.md +147 -0
- package/docs/shared/theming.md +604 -0
- package/docs/shared/translation.md +291 -0
- package/docs/shared/updates.md +61 -0
- package/docs/testing.md +34 -0
- package/docs/update.md +36 -0
- package/docs/workspace.md +64 -0
- package/package.json +88 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* State-retirement migration ([#434](https://github.com/Omega-JS-Stack/omega/issues/434))
|
|
3
|
+
* — the on-disk half of killing the third bucket. `.omega/state.json` held a
|
|
4
|
+
* durable cache of derived data; that CONTENT is gone. Every fact it carried
|
|
5
|
+
* now lives where it belongs:
|
|
6
|
+
*
|
|
7
|
+
* - a provisioned id or a confirmation nothing can re-check → config/omega.json5
|
|
8
|
+
* - a secret (the GA Measurement Protocol secrets, the VAPID private key) → the brand .env
|
|
9
|
+
* - everything else → nowhere: the idempotent ensure re-derives it from the
|
|
10
|
+
* platform on the next run, which is what it always did with the cache
|
|
11
|
+
* sitting unused beside it
|
|
12
|
+
*
|
|
13
|
+
* The FILE lives on as the per-machine record home, sectioned per fact kind
|
|
14
|
+
* ([#479](https://github.com/Omega-JS-Stack/omega/issues/479)): `deploy` is
|
|
15
|
+
* the record `@omega.js/devkit/deploy-record` writes on every successful
|
|
16
|
+
* deploy verb, and future record kinds join it as siblings. So this migration
|
|
17
|
+
* owns ONLY the service-keyed sections it retires — every other top-level key
|
|
18
|
+
* is a record it neither reads nor deletes, and a state.json left holding
|
|
19
|
+
* nothing but records is rewritten, not deleted.
|
|
20
|
+
*
|
|
21
|
+
* Unlike its Firestore siblings this migration touches only the brand's own
|
|
22
|
+
* files, so it runs without a service account.
|
|
23
|
+
*
|
|
24
|
+
* Like every migration, a run is an AUDIT until `--execute`:
|
|
25
|
+
* npx omega manage --migration=state-retirement # prints the plan, writes nothing
|
|
26
|
+
* npx omega manage --migration=state-retirement --execute # performs it
|
|
27
|
+
*
|
|
28
|
+
* Idempotent by construction: the executed run trims (or deletes) the file,
|
|
29
|
+
* so a re-run finds nothing to move and reports a clean no-op.
|
|
30
|
+
*/
|
|
31
|
+
const { join } = require('node:path');
|
|
32
|
+
const jetpack = require('fs-jetpack');
|
|
33
|
+
const chalk = require('chalk').default;
|
|
34
|
+
const { writeConfigValues, DIR_TARGETS } = require('../../../vendor/config/index.js');
|
|
35
|
+
|
|
36
|
+
const { writeEnvValue } = require('../../../lib/env-secret.js');
|
|
37
|
+
const { streamSecretEnvName } = require('../../../lib/analytics-secret.js');
|
|
38
|
+
|
|
39
|
+
const STATE_FILE = join('.omega', 'state.json');
|
|
40
|
+
|
|
41
|
+
// The service-keyed sections the retired state file carried — the only keys
|
|
42
|
+
// this migration reads, moves and removes. Anything else is a machine record
|
|
43
|
+
// (devkit's `deploy` today, other record kinds tomorrow) and survives
|
|
44
|
+
// untouched: an unknown key is never assumed to be dead cache (see the header)
|
|
45
|
+
const RETIRED_SECTIONS = new Set([
|
|
46
|
+
'advertising', 'analytics', 'campaigns', 'captcha', 'certificates', 'chat',
|
|
47
|
+
'cloud', 'edge', 'email', 'forms', 'monitoring', 'newsletter', 'payment',
|
|
48
|
+
'repo', 'search',
|
|
49
|
+
]);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Every dot-path in an object that holds a non-object value. Arrays count as
|
|
53
|
+
* leaves: the one array state ever held (the confirmed reCAPTCHA domains)
|
|
54
|
+
* moves whole.
|
|
55
|
+
*
|
|
56
|
+
* @param {Object} node - Object to walk
|
|
57
|
+
* @param {string} [prefix] - Path prefix for recursion
|
|
58
|
+
* @returns {string[]} Dot-paths of every leaf
|
|
59
|
+
*/
|
|
60
|
+
function leafPaths(node, prefix = '') {
|
|
61
|
+
return Object.entries(node).flatMap(([key, value]) => {
|
|
62
|
+
const path = prefix ? `${prefix}.${key}` : key;
|
|
63
|
+
return value && typeof value === 'object' && !Array.isArray(value)
|
|
64
|
+
? leafPaths(value, path)
|
|
65
|
+
: [path];
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Plan every move out of a parsed state.json. Nothing is written here.
|
|
71
|
+
*
|
|
72
|
+
* @param {Object} state - The parsed .omega/state.json
|
|
73
|
+
* @param {Object} [brandConfig] - The merged brand config, consulted for the
|
|
74
|
+
* product catalog: a `[id=…]` edit path can only address a product the
|
|
75
|
+
* catalog already carries, and an id for a product that is gone has no home
|
|
76
|
+
* @returns {Array<{ from: string, config?: string, env?: string, value: * }>}
|
|
77
|
+
* One record per fact that has a new home
|
|
78
|
+
*/
|
|
79
|
+
function planMoves(state, brandConfig = {}) {
|
|
80
|
+
const moves = [];
|
|
81
|
+
const toConfig = (from, path, value) => {
|
|
82
|
+
// An empty string is what a missing optional wrote into state (the SDK
|
|
83
|
+
// config's measurementId); landing it in config would erase a real value
|
|
84
|
+
if (value !== undefined && value !== null && value !== '') {
|
|
85
|
+
moves.push({ from, config: path, value });
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const toEnv = (from, name, value) => {
|
|
89
|
+
if (value) {
|
|
90
|
+
moves.push({ from, env: name, value });
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const confirmed = (from, path, value) => {
|
|
94
|
+
// Only a TRUE confirmation is a fact — false is "not confirmed yet",
|
|
95
|
+
// which is the absence of the key
|
|
96
|
+
if (value === true) {
|
|
97
|
+
moves.push({ from, config: path, value: true });
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
// ── edge: the zone id `omega purge` targets from a build ──────────────────
|
|
102
|
+
toConfig('edge.zoneId', 'edge.providers.cloudflare.zone', state.edge?.zoneId);
|
|
103
|
+
|
|
104
|
+
// ── search: the GA association confirm (no API on either side) ────────────
|
|
105
|
+
confirmed('search.gaLinked', 'search.providers.searchConsole.gaLinked', state.search?.gaLinked);
|
|
106
|
+
|
|
107
|
+
// ── analytics: the measurement id is public config, the Measurement
|
|
108
|
+
// Protocol secret is a secret — the stream id and URI re-derive ─────────
|
|
109
|
+
for (const [key, stream] of Object.entries(state.analytics?.streams || {})) {
|
|
110
|
+
// A legacy state file keys the stream by its target DIR (`website`), which
|
|
111
|
+
// composed straight through would write `targets.website` — a target the
|
|
112
|
+
// validator rejects. DIR_TARGETS is the one dir→target normalizer (#505);
|
|
113
|
+
// a key that is already a target name passes through it untouched
|
|
114
|
+
const target = DIR_TARGETS[key] || key;
|
|
115
|
+
toConfig(
|
|
116
|
+
`analytics.streams.${key}.measurementId`,
|
|
117
|
+
`targets.${target}.analytics.providers.google.id`,
|
|
118
|
+
stream?.measurementId,
|
|
119
|
+
);
|
|
120
|
+
toEnv(
|
|
121
|
+
`analytics.streams.${key}.apiSecret`,
|
|
122
|
+
streamSecretEnvName(target),
|
|
123
|
+
stream?.apiSecret,
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// ── payment: the two Dashboard-only confirms + the provider product ids ───
|
|
128
|
+
confirmed('payment.radarConfirmed', 'payment.providers.stripe.radarConfirmed', state.payment?.radarConfirmed);
|
|
129
|
+
confirmed('payment.disputesConfirmed', 'payment.providers.stripe.disputesConfirmed', state.payment?.disputesConfirmed);
|
|
130
|
+
|
|
131
|
+
const catalog = new Set((brandConfig.payment?.products || []).map((product) => product.id));
|
|
132
|
+
for (const [provider, key] of [['stripe', 'stripeProducts'], ['paypal', 'paypalProducts']]) {
|
|
133
|
+
for (const [productId, id] of Object.entries(state.payment?.[key] || {})) {
|
|
134
|
+
if (catalog.has(productId)) {
|
|
135
|
+
toConfig(`payment.${key}.${productId}`, `payment.products[id=${productId}].${provider}.productId`, id);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// ── cloud: the SDK config, the OAuth-redirect confirm, the VAPID pair ─────
|
|
141
|
+
for (const [key, value] of Object.entries(state.cloud?.sdkConfig || {})) {
|
|
142
|
+
toConfig(`cloud.sdkConfig.${key}`, `cloud.config.${key}`, value);
|
|
143
|
+
}
|
|
144
|
+
confirmed(
|
|
145
|
+
'cloud.authentication.oauthRedirectsConfigured',
|
|
146
|
+
'cloud.oauthRedirectsConfigured',
|
|
147
|
+
state.cloud?.authentication?.oauthRedirectsConfigured,
|
|
148
|
+
);
|
|
149
|
+
toConfig('cloud.cloudMessaging.vapidPublicKey', 'cloud.messaging.vapidKey', state.cloud?.cloudMessaging?.vapidPublicKey);
|
|
150
|
+
toEnv('cloud.cloudMessaging.vapidPrivateKey', 'VAPID_PRIVATE_KEY', state.cloud?.cloudMessaging?.vapidPrivateKey);
|
|
151
|
+
|
|
152
|
+
// ── marketing + monitoring: ids their services already write back ─────────
|
|
153
|
+
toConfig('campaigns.listId', 'marketing.campaigns.providers.sendgrid.listId', state.campaigns?.listId);
|
|
154
|
+
toConfig('newsletter.publicationId', 'marketing.newsletter.providers.beehiiv.publicationId', state.newsletter?.publicationId);
|
|
155
|
+
toConfig('monitoring.org', 'monitoring.providers.sentry.org', state.monitoring?.org);
|
|
156
|
+
|
|
157
|
+
// ── captcha: the domain-list confirm (classic reCAPTCHA has no read API) ──
|
|
158
|
+
if (Array.isArray(state.captcha?.domainsConfirmed)) {
|
|
159
|
+
moves.push({
|
|
160
|
+
from: 'captcha.domainsConfirmed',
|
|
161
|
+
config: 'captcha.providers.recaptcha.domainsConfirmed',
|
|
162
|
+
value: state.captcha.domainsConfirmed,
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return moves;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* State-retirement migration handler.
|
|
171
|
+
*
|
|
172
|
+
* @param {Object} context - Handler context ({ brandRoot, options })
|
|
173
|
+
* @returns {Object} { output } — the plan, or what was performed
|
|
174
|
+
*/
|
|
175
|
+
module.exports = async function ensureStateRetirement(context) {
|
|
176
|
+
const { brandRoot, brandConfig = {}, options = {} } = context;
|
|
177
|
+
const execute = options.execute === true;
|
|
178
|
+
const statePath = join(brandRoot, STATE_FILE);
|
|
179
|
+
|
|
180
|
+
const state = jetpack.read(statePath, 'json');
|
|
181
|
+
if (!state) {
|
|
182
|
+
console.log(` ${chalk.green('✓')} No ${chalk.cyan(STATE_FILE)} — already retired`);
|
|
183
|
+
return { output: { stateRetirement: { retired: true } } };
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const moves = planMoves(state, brandConfig);
|
|
187
|
+
const movedFrom = new Set(moves.map((move) => move.from));
|
|
188
|
+
const dropped = leafPaths(state)
|
|
189
|
+
.filter((path) => RETIRED_SECTIONS.has(path.split('.')[0]))
|
|
190
|
+
.filter((path) => !movedFrom.has(path));
|
|
191
|
+
|
|
192
|
+
// The machine records this migration never touches — what the file keeps
|
|
193
|
+
const kept = Object.fromEntries(Object.entries(state).filter(([key]) => !RETIRED_SECTIONS.has(key)));
|
|
194
|
+
|
|
195
|
+
// Nothing but records left: an already-retired brand. Say so instead of
|
|
196
|
+
// rewriting the file every run.
|
|
197
|
+
if (moves.length === 0 && dropped.length === 0) {
|
|
198
|
+
console.log(` ${chalk.green('✓')} ${chalk.cyan(STATE_FILE)} holds only machine records — already retired`);
|
|
199
|
+
return { output: { stateRetirement: { retired: true, kept: Object.keys(kept) } } };
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// ── The plan, printed the same way in both modes ──────────────────────────
|
|
203
|
+
for (const move of moves) {
|
|
204
|
+
const home = move.config ? `omega.json5 ${chalk.cyan(move.config)}` : `.env ${chalk.cyan(move.env)}`;
|
|
205
|
+
console.log(` ${chalk.dim('→')} ${chalk.dim(move.from)} ${chalk.dim('→')} ${home}`);
|
|
206
|
+
}
|
|
207
|
+
if (dropped.length > 0) {
|
|
208
|
+
console.log(` ${chalk.dim(`⊘ ${dropped.length} re-derived on the next run: ${dropped.join(', ')}`)}`);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const configEdits = Object.fromEntries(
|
|
212
|
+
moves.filter((move) => move.config).map((move) => [move.config, move.value]),
|
|
213
|
+
);
|
|
214
|
+
const envEdits = moves.filter((move) => move.env);
|
|
215
|
+
|
|
216
|
+
// writeConfigValues skips values already equal, so `applied` is the honest
|
|
217
|
+
// list of what this migration actually changes — in both modes
|
|
218
|
+
const report = Object.keys(configEdits).length > 0
|
|
219
|
+
? writeConfigValues(brandRoot, configEdits, { dryRun: !execute })
|
|
220
|
+
: { applied: [] };
|
|
221
|
+
|
|
222
|
+
if (!execute) {
|
|
223
|
+
console.log(` ${chalk.yellow('[AUDIT]')} Would write ${chalk.cyan(report.applied.length)} config value(s) + ${chalk.cyan(envEdits.length)} .env value(s), then retire ${chalk.cyan(STATE_FILE)} ${chalk.dim('(--execute to perform it)')}`);
|
|
224
|
+
return {
|
|
225
|
+
output: {
|
|
226
|
+
stateRetirement: {
|
|
227
|
+
audit: true,
|
|
228
|
+
config: report.applied,
|
|
229
|
+
env: envEdits.map((move) => move.env),
|
|
230
|
+
dropped,
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
for (const move of envEdits) {
|
|
237
|
+
writeEnvValue(brandRoot, move.env, move.value);
|
|
238
|
+
process.env[move.env] = move.value;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// The machine records outlive the retirement — trim rather than delete when
|
|
242
|
+
// the brand has any
|
|
243
|
+
if (Object.keys(kept).length > 0) {
|
|
244
|
+
jetpack.write(statePath, kept, { jsonIndent: 2 });
|
|
245
|
+
console.log(` ${chalk.green('✓')} ${chalk.cyan(STATE_FILE)} trimmed to its machine records: ${chalk.cyan(Object.keys(kept).join(', '))} ${chalk.dim('(the deploy record is owned by @omega.js/devkit/deploy-record)')}`);
|
|
246
|
+
} else {
|
|
247
|
+
jetpack.remove(statePath);
|
|
248
|
+
console.log(` ${chalk.green('✓')} ${chalk.cyan(STATE_FILE)} deleted`);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
console.log(` ${chalk.green('✓')} Retired: ${chalk.cyan(report.applied.length)} config value(s), ${chalk.cyan(envEdits.length)} .env value(s), ${chalk.cyan(dropped.length)} re-derived`);
|
|
252
|
+
|
|
253
|
+
return {
|
|
254
|
+
output: {
|
|
255
|
+
stateRetirement: {
|
|
256
|
+
config: report.applied,
|
|
257
|
+
env: envEdits.map((move) => move.env),
|
|
258
|
+
dropped,
|
|
259
|
+
kept: Object.keys(kept),
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
};
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
module.exports.planMoves = planMoves;
|
|
266
|
+
module.exports.leafPaths = leafPaths;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Targets-rename migration ([#443](https://github.com/Omega-JS-Stack/omega/issues/443))
|
|
3
|
+
* — the on-disk half of one vocabulary. Config has always called them
|
|
4
|
+
* `targets`, so a brand monorepo's surfaces live in `targets/` too, and
|
|
5
|
+
* nothing dual-reads the old name: discovery, scaffolding and the disperse
|
|
6
|
+
* model all speak `targets/` outright.
|
|
7
|
+
*
|
|
8
|
+
* A brand that still carries `apps/` is fixed ONCE, by hand, with this
|
|
9
|
+
* migration — never healed inside every run (Ian, 2026-08-21: no standing
|
|
10
|
+
* backwards-compat machinery). Discovery fails loud on the old shape and
|
|
11
|
+
* points here:
|
|
12
|
+
* npx omega manage --migration=targets-rename # prints the plan, moves nothing
|
|
13
|
+
* npx omega manage --migration=targets-rename --execute # performs it
|
|
14
|
+
* …then `npm install` at the brand root, so npm re-links `node_modules/<target>`
|
|
15
|
+
* at the new path.
|
|
16
|
+
*
|
|
17
|
+
* The root manifest travels with the folder: npm workspaces name the glob, so
|
|
18
|
+
* a renamed folder under an `apps/*` workspaces entry is a brand whose targets
|
|
19
|
+
* resolve nowhere. A hand-renamed folder whose manifest still lags is the
|
|
20
|
+
* same job, half done — the glob is healed on its own.
|
|
21
|
+
*
|
|
22
|
+
* Idempotent: a brand already on `targets/` is a clean no-op. Ambiguous is
|
|
23
|
+
* FATAL — a brand carrying BOTH folders is a half-done migration, and merging
|
|
24
|
+
* them is a guess about which copy is real.
|
|
25
|
+
*
|
|
26
|
+
* Unlike its Firestore siblings this migration touches only the brand's own
|
|
27
|
+
* files, so it runs without a service account (`local: true`).
|
|
28
|
+
*/
|
|
29
|
+
const { join } = require('node:path');
|
|
30
|
+
const chalk = require('chalk').default;
|
|
31
|
+
const jetpack = require('fs-jetpack');
|
|
32
|
+
|
|
33
|
+
const MIGRATION_NAME = 'targets-rename';
|
|
34
|
+
const LEGACY_DIR = 'apps';
|
|
35
|
+
const TARGETS_DIR = 'targets';
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Does the root manifest still name the legacy workspaces glob?
|
|
39
|
+
*
|
|
40
|
+
* @param {string} brandRoot - Absolute brand-monorepo root
|
|
41
|
+
* @returns {boolean} true when `workspaces` carries `apps/*`
|
|
42
|
+
*/
|
|
43
|
+
function hasLegacyGlob(brandRoot) {
|
|
44
|
+
const manifest = jetpack.read(join(brandRoot, 'package.json'), 'json');
|
|
45
|
+
return Boolean(manifest && Array.isArray(manifest.workspaces) && manifest.workspaces.includes(`${LEGACY_DIR}/*`));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Flip the root package.json's `apps/*` workspaces entry to `targets/*`,
|
|
50
|
+
* preserving every other entry and the file's key order.
|
|
51
|
+
*
|
|
52
|
+
* @param {string} brandRoot - Absolute brand-monorepo root
|
|
53
|
+
* @returns {void}
|
|
54
|
+
*/
|
|
55
|
+
function healWorkspacesGlob(brandRoot) {
|
|
56
|
+
const manifestPath = join(brandRoot, 'package.json');
|
|
57
|
+
const manifest = jetpack.read(manifestPath, 'json');
|
|
58
|
+
|
|
59
|
+
manifest.workspaces = manifest.workspaces.map((entry) => (
|
|
60
|
+
entry === `${LEGACY_DIR}/*` ? `${TARGETS_DIR}/*` : entry
|
|
61
|
+
));
|
|
62
|
+
jetpack.write(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Targets-rename migration handler.
|
|
67
|
+
*
|
|
68
|
+
* @param {Object} context - Handler context ({ brandRoot, options })
|
|
69
|
+
* @returns {Object} { output } — the plan, or what was performed
|
|
70
|
+
* @throws {Error} when the brand carries both folders
|
|
71
|
+
*/
|
|
72
|
+
module.exports = async function ensureTargetsRename(context) {
|
|
73
|
+
const { brandRoot, options = {} } = context;
|
|
74
|
+
const execute = options.execute === true;
|
|
75
|
+
|
|
76
|
+
const legacyPath = join(brandRoot, LEGACY_DIR);
|
|
77
|
+
const targetsPath = join(brandRoot, TARGETS_DIR);
|
|
78
|
+
const hasLegacy = jetpack.exists(legacyPath) === 'dir';
|
|
79
|
+
const hasTargets = jetpack.exists(targetsPath) === 'dir';
|
|
80
|
+
|
|
81
|
+
if (hasLegacy && hasTargets) {
|
|
82
|
+
throw new Error(
|
|
83
|
+
`${brandRoot} carries BOTH ${LEGACY_DIR}/ and ${TARGETS_DIR}/ — the #443 rename cannot guess which one is real. `
|
|
84
|
+
+ `Merge them by hand into ${TARGETS_DIR}/, delete ${LEGACY_DIR}/, then run again.`,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const legacyGlob = hasLegacyGlob(brandRoot);
|
|
89
|
+
|
|
90
|
+
if (!hasLegacy && !legacyGlob) {
|
|
91
|
+
console.log(` ${chalk.green('✓')} Already on ${chalk.cyan(`${TARGETS_DIR}/`)} — nothing to rename`);
|
|
92
|
+
return { output: { targetsRename: { migrated: false } } };
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// ── The plan, printed the same way in both modes ──────────────────────────
|
|
96
|
+
const targetNames = hasLegacy ? jetpack.list(legacyPath) || [] : [];
|
|
97
|
+
if (hasLegacy) {
|
|
98
|
+
console.log(` ${chalk.dim('→')} ${chalk.cyan(`${LEGACY_DIR}/`)} ${chalk.dim('→')} ${chalk.cyan(`${TARGETS_DIR}/`)} ${chalk.dim(`(${targetNames.length} target(s): ${targetNames.join(', ')})`)}`);
|
|
99
|
+
}
|
|
100
|
+
if (legacyGlob) {
|
|
101
|
+
console.log(` ${chalk.dim('→')} package.json workspaces ${chalk.cyan(`${LEGACY_DIR}/*`)} ${chalk.dim('→')} ${chalk.cyan(`${TARGETS_DIR}/*`)}`);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if (!execute) {
|
|
105
|
+
console.log(` ${chalk.yellow('[AUDIT]')} Nothing moved ${chalk.dim('(--execute to perform it)')}`);
|
|
106
|
+
return { output: { targetsRename: { audit: true, folder: hasLegacy, workspaces: legacyGlob, targets: targetNames } } };
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (hasLegacy) {
|
|
110
|
+
jetpack.move(legacyPath, targetsPath);
|
|
111
|
+
console.log(` ${chalk.green('✓')} Renamed ${chalk.cyan(`${LEGACY_DIR}/`)} → ${chalk.cyan(`${TARGETS_DIR}/`)}`);
|
|
112
|
+
}
|
|
113
|
+
if (legacyGlob) {
|
|
114
|
+
healWorkspacesGlob(brandRoot);
|
|
115
|
+
console.log(` ${chalk.green('✓')} Root workspaces now say ${chalk.cyan(`${TARGETS_DIR}/*`)}`);
|
|
116
|
+
}
|
|
117
|
+
console.log(` ${chalk.dim('run `npm install` at the brand root to refresh the workspace links')}`);
|
|
118
|
+
|
|
119
|
+
return { output: { targetsRename: { migrated: true, folder: hasLegacy, workspaces: legacyGlob, targets: targetNames } } };
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
module.exports.MIGRATION_NAME = MIGRATION_NAME;
|
|
123
|
+
module.exports.LEGACY_DIR = LEGACY_DIR;
|
|
124
|
+
module.exports.TARGETS_DIR = TARGETS_DIR;
|