@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,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a framework's `omega` bin FILE via the node_modules directory climb
|
|
3
|
+
* from where the target declares it. A manual walk (not require.resolve) because
|
|
4
|
+
* exports-restricted packages don't expose ./package.json. Shared by the
|
|
5
|
+
* brand-root fan-out commands (`omega test`, `omega deploy`).
|
|
6
|
+
*
|
|
7
|
+
* Also the ONE place those commands decide HOW to run a verb on a target, so
|
|
8
|
+
* the framework lane and the custom-target lane (#603) never drift apart:
|
|
9
|
+
* a framework target dispatches through its own `omega <verb>` bin with the
|
|
10
|
+
* brand's flags forwarded; a custom target runs `npm run <verb>` in its dir
|
|
11
|
+
* with NO flags (a package script has no contract for them) and steps aside
|
|
12
|
+
* loudly when it declares no such script.
|
|
13
|
+
*
|
|
14
|
+
* A backend in CUSTOM-SERVER mode (#584) takes the script lane for the verbs
|
|
15
|
+
* its framework cannot serve — `omega deploy` is a Functions deploy and
|
|
16
|
+
* `omega test` is the emulator lane, and both REFUSE in that mode. It stays a
|
|
17
|
+
* framework target for everything else; a container host's publish command is
|
|
18
|
+
* the brand's to name, and its `deploy` script is where it names it.
|
|
19
|
+
*
|
|
20
|
+
* A framework that does not SERVE a verb at all takes the same lane
|
|
21
|
+
* (SCRIPT_LANE_VERBS): dispatching it would only print "Unknown command".
|
|
22
|
+
*/
|
|
23
|
+
const fs = require('node:fs');
|
|
24
|
+
const path = require('node:path');
|
|
25
|
+
|
|
26
|
+
const { findTarget } = require('../vendor/devkit/omega-bin.js');
|
|
27
|
+
const { targetScripts } = require('./custom-target.js');
|
|
28
|
+
|
|
29
|
+
// The verbs @omega.js/backend serves through Firebase and therefore refuses in
|
|
30
|
+
// custom-server mode (#584) — the fan-outs take the script lane for these, and
|
|
31
|
+
// only these. `build`, `update` and the rest are mode-agnostic.
|
|
32
|
+
const FIREBASE_ONLY_VERBS = new Set(['deploy', 'test']);
|
|
33
|
+
|
|
34
|
+
// Framework → the verbs its CLI has no command for, which the fan-outs must
|
|
35
|
+
// run as the target's own script instead (#603). EMPTY today: every framework
|
|
36
|
+
// serves every fan-out verb, @omega.js/extension's `build` included since
|
|
37
|
+
// [#81](https://github.com/Omega-JS-Stack/omega/issues/81) gave it the verb
|
|
38
|
+
// its siblings already had. The mechanism stays for the next gap.
|
|
39
|
+
const SCRIPT_LANE_VERBS = {};
|
|
40
|
+
|
|
41
|
+
// The verbs NO framework CLI honors `--dry-run` for (checked against web,
|
|
42
|
+
// backend and desktop `build`/`clean`: none reads the flag). Forwarding it
|
|
43
|
+
// would really build — or really CLEAN — under a flag whose whole promise is
|
|
44
|
+
// that nothing happens, so the dry run stops at the plan for the framework
|
|
45
|
+
// lane too, exactly as it already does for the script lane. `deploy` is the
|
|
46
|
+
// counter-case and stays off this list: every framework deploy reads the flag
|
|
47
|
+
// and prints its own dispatch plan.
|
|
48
|
+
const NO_FRAMEWORK_DRY_RUN_VERBS = new Set(['build', 'clean']);
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* @param {string} fromDir - Directory to climb from (where the dep is declared)
|
|
52
|
+
* @param {string} name - Framework package name ('@omega.js/web', …)
|
|
53
|
+
* @returns {string|null} - Absolute bin path, or null when not installed
|
|
54
|
+
*/
|
|
55
|
+
function resolveFrameworkBin(fromDir, name) {
|
|
56
|
+
const resolved = resolveFrameworkPackage(fromDir, name);
|
|
57
|
+
if (!resolved) return null;
|
|
58
|
+
|
|
59
|
+
const bin = typeof resolved.pkg.bin === 'string' ? resolved.pkg.bin : (resolved.pkg.bin || {}).omega;
|
|
60
|
+
return bin ? path.join(resolved.dir, bin) : null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The framework package itself, via the same climb — for readers of its
|
|
65
|
+
* manifest declarations (`projectScripts`, the workspace target heal).
|
|
66
|
+
*
|
|
67
|
+
* @param {string} fromDir - Directory to climb from (where the dep is declared)
|
|
68
|
+
* @param {string} name - Framework package name ('@omega.js/web', …)
|
|
69
|
+
* @returns {{ dir: string, pkg: object }|null} - null when not installed
|
|
70
|
+
*/
|
|
71
|
+
function resolveFrameworkPackage(fromDir, name) {
|
|
72
|
+
let dir = path.resolve(fromDir);
|
|
73
|
+
|
|
74
|
+
while (true) {
|
|
75
|
+
const pkgDir = path.join(dir, 'node_modules', name);
|
|
76
|
+
const pkgPath = path.join(pkgDir, 'package.json');
|
|
77
|
+
|
|
78
|
+
if (fs.existsSync(pkgPath)) {
|
|
79
|
+
return { dir: pkgDir, pkg: JSON.parse(fs.readFileSync(pkgPath, 'utf8')) };
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const parent = path.dirname(dir);
|
|
83
|
+
if (parent === dir) return null;
|
|
84
|
+
dir = parent;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* How the brand-root fan-out should run `verb` on one discovered target.
|
|
90
|
+
*
|
|
91
|
+
* @param {object} entry - A discoverTargets entry ({ name, dir, path, target, custom, projectType }).
|
|
92
|
+
* @param {string} verb - The verb ('deploy', 'test', …).
|
|
93
|
+
* @param {string[]} [forwarded] - Brand-level flags to forward (framework lane only).
|
|
94
|
+
* @param {object} [options]
|
|
95
|
+
* @param {boolean} [options.dryRun] - The run is a dry run: any lane that cannot
|
|
96
|
+
* hand the flag on returns kind:'plan' instead of a command.
|
|
97
|
+
* @returns {{ kind: 'framework'|'custom'|'plan'|'skip'|'error', label?: string,
|
|
98
|
+
* command?: string, args?: string[], framework?: string, detail?: string }}
|
|
99
|
+
*/
|
|
100
|
+
function resolveTargetRun(entry, verb, forwarded = [], options = {}) {
|
|
101
|
+
// The SCRIPT lane — the target's own `npm run <verb>`, which is the whole
|
|
102
|
+
// verb surface of a custom target and the fallback for a framework that
|
|
103
|
+
// cannot serve this one.
|
|
104
|
+
const scriptLane = () => {
|
|
105
|
+
const scripts = targetScripts(entry.path);
|
|
106
|
+
if (!scripts[verb]) {
|
|
107
|
+
return { kind: 'skip', detail: `no "${verb}" script in ${entry.dir}/package.json` };
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// A framework target honors --dry-run itself; a package script has no
|
|
111
|
+
// such contract and the flag is not forwarded to it, so the dry run stops
|
|
112
|
+
// HERE and reports the plan. Running a real deploy under --dry-run would
|
|
113
|
+
// be the worst possible reading of the flag.
|
|
114
|
+
if (options.dryRun) {
|
|
115
|
+
return { kind: 'plan', detail: `would run npm run ${verb} in ${entry.dir}` };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return { kind: 'custom', command: 'npm', args: ['run', verb], label: `npm run ${verb}` };
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
if (entry.custom || (entry.projectType === 'custom' && FIREBASE_ONLY_VERBS.has(verb))) {
|
|
122
|
+
return scriptLane();
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const target = findTarget(entry.path);
|
|
126
|
+
if (!target || target.kind !== 'framework') {
|
|
127
|
+
return { kind: 'error', detail: 'no framework dependency detected (target-root package.json)' };
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// A verb this framework's CLI has no command for is the target's script to
|
|
131
|
+
// run, not a bin dispatch that would fail on "Unknown command"
|
|
132
|
+
if (SCRIPT_LANE_VERBS[target.name]?.has(verb)) {
|
|
133
|
+
return scriptLane();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const binPath = resolveFrameworkBin(target.dir, target.name);
|
|
137
|
+
if (!binPath) {
|
|
138
|
+
return { kind: 'error', detail: `${target.name} is not installed (node_modules climb from ${target.dir} found no bin)` };
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// A verb its own CLI has no --dry-run for stops at the plan HERE, like the
|
|
142
|
+
// script lane — the flag is never forwarded to a bin that would ignore it
|
|
143
|
+
if (options.dryRun && NO_FRAMEWORK_DRY_RUN_VERBS.has(verb)) {
|
|
144
|
+
return { kind: 'plan', framework: target.name, detail: `would run omega ${verb} in ${entry.dir}` };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
return {
|
|
148
|
+
kind: 'framework',
|
|
149
|
+
framework: target.name,
|
|
150
|
+
command: process.execPath,
|
|
151
|
+
args: [binPath, verb, ...forwarded],
|
|
152
|
+
label: `omega ${verb} ${forwarded.join(' ')}`.trimEnd(),
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
module.exports = { resolveFrameworkBin, resolveFrameworkPackage, resolveTargetRun };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared gitignore ensure — the secrets store, the environment env files, run
|
|
3
|
+
* output, and the run logs never get committed. Used by the workspace service
|
|
4
|
+
* (brand roots) and runCompany (the company root, which no service pass touches).
|
|
5
|
+
*
|
|
6
|
+
* The scaffold writes every entry into a NEW brand's .gitignore; this heals
|
|
7
|
+
* every root that predates an entry, on its next manage run (#197: `logs/`;
|
|
8
|
+
* [#586](https://github.com/Omega-JS-Stack/omega/issues/586): `.env.*`).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const { join } = require('node:path');
|
|
12
|
+
const jetpack = require('fs-jetpack');
|
|
13
|
+
|
|
14
|
+
const IGNORE_ENTRY = '.omega/';
|
|
15
|
+
|
|
16
|
+
// Every entry a root's .gitignore must carry: the aliases that already satisfy
|
|
17
|
+
// it, and the comment introducing a freshly added one (matching the scaffold's).
|
|
18
|
+
const ENTRIES = [
|
|
19
|
+
{
|
|
20
|
+
entry: IGNORE_ENTRY,
|
|
21
|
+
aliases: ['.omega', '.omega/'],
|
|
22
|
+
comment: '# Omega manager state (durable IDs + per-run output)',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
entry: 'logs/',
|
|
26
|
+
aliases: ['logs', 'logs/'],
|
|
27
|
+
comment: '# Run logs (truncated on every launch — never committed)',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
// `.env` itself is the scaffold's, and every brand already carries it; this
|
|
31
|
+
// is the environment OVERLAY half (#586), which is just as much a secret
|
|
32
|
+
entry: '.env.*',
|
|
33
|
+
aliases: ['.env.*', '.env*'],
|
|
34
|
+
comment: '# Secrets — the environment overlays beside .env',
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Ensure `.omega/`, `logs/` and `.env.*` are listed in {rootDir}/.gitignore.
|
|
40
|
+
* Idempotent — only the missing entries get appended, each under its own comment.
|
|
41
|
+
*
|
|
42
|
+
* @param {string} rootDir - Directory whose .gitignore gets the entries
|
|
43
|
+
* @returns {'present'|'added'}
|
|
44
|
+
*/
|
|
45
|
+
function ensureOmegaIgnored(rootDir) {
|
|
46
|
+
const gitignorePath = join(rootDir, '.gitignore');
|
|
47
|
+
const existing = jetpack.read(gitignorePath) || '';
|
|
48
|
+
|
|
49
|
+
const lines = existing.split('\n').map((line) => line.trim());
|
|
50
|
+
const missing = ENTRIES.filter(({ aliases }) => !lines.some((line) => aliases.includes(line)));
|
|
51
|
+
|
|
52
|
+
if (missing.length === 0) {
|
|
53
|
+
return 'present';
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const separator = existing.length > 0 && !existing.endsWith('\n') ? '\n' : '';
|
|
57
|
+
const block = missing.map(({ entry, comment }) => `\n${comment}\n${entry}\n`).join('');
|
|
58
|
+
jetpack.write(gitignorePath, existing + separator + block);
|
|
59
|
+
|
|
60
|
+
return 'added';
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
module.exports = { ensureOmegaIgnored, IGNORE_ENTRY };
|