@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,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* README.md generator for the developer-tool template — hero with badges,
|
|
3
|
+
* platform download buttons, features, star-history chart, contributing.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Windows brand icon as a base64 SVG — shields.io renders macOS/Linux from
|
|
7
|
+
// its built-in logo set but has no working Windows logo, so it's inlined.
|
|
8
|
+
const ICON_WINDOWS = 'PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NDggNTEyIj48cGF0aCBmaWxsPSJ3aGl0ZSIgZD0iTTAgOTMuN2wxODMuNi0yNS4zIDAgMTc3LjQtMTgzLjYgMCAwLTE1Mi4xek0wIDQxOC4zbDE4My42IDI1LjMgMC0xNzUuMi0xODMuNiAwIDAgMTQ5Ljl6bTIwMy44IDI4bDI0NC4yIDMzLjcgMC0yMTEuNi0yNDQuMiAwIDAgMTc3Ljl6bTAtMzgwLjZsMCAxODAuMSAyNDQuMiAwIDAtMjEzLjgtMjQ0LjIgMzMuN3oiLz48L3N2Zz4=';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Generate README.md from content item + brand data
|
|
12
|
+
*
|
|
13
|
+
* @param {Object} data - { name, org, title, description, features, cta, custom, brand }
|
|
14
|
+
* @returns {string} Generated markdown
|
|
15
|
+
*/
|
|
16
|
+
module.exports = function generateReadme(data) {
|
|
17
|
+
const { name, org, title, description, features, cta, custom, brand } = data;
|
|
18
|
+
|
|
19
|
+
const brandmarkUrl = brand?.images?.brandmark || '';
|
|
20
|
+
const platformUrl = cta?.platform || cta?.url || brand?.url || '';
|
|
21
|
+
const downloadUrl = cta?.url || brand?.url || '';
|
|
22
|
+
const brandUrl = brand?.url || '';
|
|
23
|
+
const brandDescription = brand?.description || '';
|
|
24
|
+
const domain = brandUrl.replace(/^https?:\/\//, '').replace(/\/$/, '');
|
|
25
|
+
const encodedUrl = encodeURIComponent(brandUrl);
|
|
26
|
+
|
|
27
|
+
const lines = [];
|
|
28
|
+
|
|
29
|
+
// --- Hero ---
|
|
30
|
+
lines.push('<div align="center">');
|
|
31
|
+
lines.push('');
|
|
32
|
+
lines.push(`<img src="${brandmarkUrl}" width="60" alt="${title} Logo">`);
|
|
33
|
+
lines.push('');
|
|
34
|
+
lines.push(`<h1>${title}</h1>`);
|
|
35
|
+
lines.push('');
|
|
36
|
+
lines.push(`<p><strong>Free <a href="${platformUrl}">${title.toLowerCase()}</a></strong> that ${description}</p>`);
|
|
37
|
+
lines.push('');
|
|
38
|
+
lines.push('<p>');
|
|
39
|
+
lines.push(`<a href="${downloadUrl}"><img src="https://img.shields.io/badge/Download-Free-28a745?style=for-the-badge" alt="Download Free"></a>`);
|
|
40
|
+
lines.push(' ');
|
|
41
|
+
lines.push(`<a href="${platformUrl}"><img src="https://img.shields.io/badge/Website-${domain}-blue?style=for-the-badge" alt="Visit Website"></a>`);
|
|
42
|
+
lines.push('</p>');
|
|
43
|
+
lines.push('');
|
|
44
|
+
lines.push('<p>');
|
|
45
|
+
lines.push(`<a href="https://github.com/${org}/${name}/stargazers"><img src="https://img.shields.io/github/stars/${org}/${name}?style=flat-square&logo=github" alt="Stars"></a>`);
|
|
46
|
+
lines.push(`<a href="https://github.com/${org}/${name}/network/members"><img src="https://img.shields.io/github/forks/${org}/${name}?style=flat-square&logo=github" alt="Forks"></a>`);
|
|
47
|
+
lines.push(`<a href="https://github.com/${org}/${name}/issues"><img src="https://img.shields.io/github/issues/${org}/${name}?style=flat-square" alt="Issues"></a>`);
|
|
48
|
+
lines.push(`<a href="${brandUrl}"><img src="https://img.shields.io/website?url=${encodedUrl}&style=flat-square" alt="Website"></a>`);
|
|
49
|
+
lines.push('</p>');
|
|
50
|
+
lines.push('');
|
|
51
|
+
lines.push('</div>');
|
|
52
|
+
lines.push('');
|
|
53
|
+
lines.push('<br>');
|
|
54
|
+
lines.push('');
|
|
55
|
+
|
|
56
|
+
// --- Blockquote ---
|
|
57
|
+
lines.push(`> ${brandDescription}`);
|
|
58
|
+
lines.push('');
|
|
59
|
+
lines.push('<br>');
|
|
60
|
+
lines.push('');
|
|
61
|
+
|
|
62
|
+
// --- Getting Started ---
|
|
63
|
+
lines.push('## 🚀 Getting Started');
|
|
64
|
+
lines.push('');
|
|
65
|
+
lines.push('### Option 1: Direct download (recommended)');
|
|
66
|
+
lines.push('');
|
|
67
|
+
lines.push('Download the app for your platform.');
|
|
68
|
+
lines.push('');
|
|
69
|
+
lines.push(`<a href="${downloadUrl}?download=windows"><img src="https://img.shields.io/badge/Windows-0078D4?style=for-the-badge&logo=data:image/svg+xml;base64,${ICON_WINDOWS}" alt="Windows"></a> `);
|
|
70
|
+
lines.push(`<a href="${downloadUrl}?download=macos"><img src="https://img.shields.io/badge/macOS-000000?style=for-the-badge&logo=apple&logoColor=white" alt="macOS"></a> `);
|
|
71
|
+
lines.push(`<a href="${downloadUrl}?download=linux"><img src="https://img.shields.io/badge/Linux-FCC624?style=for-the-badge&logo=linux&logoColor=black" alt="Linux"></a>`);
|
|
72
|
+
lines.push('');
|
|
73
|
+
lines.push('### Option 2: From source');
|
|
74
|
+
lines.push('');
|
|
75
|
+
lines.push('Requires [Node.js](https://nodejs.org) and [Git](https://git-scm.com).');
|
|
76
|
+
lines.push('');
|
|
77
|
+
lines.push('```bash');
|
|
78
|
+
lines.push(`git clone https://github.com/${org}/${name}.git`);
|
|
79
|
+
lines.push(`cd ${name}`);
|
|
80
|
+
lines.push('npm install');
|
|
81
|
+
lines.push('npm start');
|
|
82
|
+
lines.push('```');
|
|
83
|
+
lines.push('');
|
|
84
|
+
|
|
85
|
+
// --- Features ---
|
|
86
|
+
if (features?.length) {
|
|
87
|
+
lines.push('## ✨ Features');
|
|
88
|
+
lines.push('');
|
|
89
|
+
for (const feature of features) {
|
|
90
|
+
lines.push(`- ${feature}`);
|
|
91
|
+
}
|
|
92
|
+
lines.push('');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// --- Custom markdown ---
|
|
96
|
+
if (custom) {
|
|
97
|
+
lines.push(custom);
|
|
98
|
+
lines.push('');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// --- Star History ---
|
|
102
|
+
lines.push('## ⭐ Star History');
|
|
103
|
+
lines.push('');
|
|
104
|
+
lines.push(`<a href="https://www.star-history.com/#${org}/${name}&Date">`);
|
|
105
|
+
lines.push(' <picture>');
|
|
106
|
+
lines.push(` <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=${org}/${name}&type=Date&theme=dark" />`);
|
|
107
|
+
lines.push(` <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=${org}/${name}&type=Date" />`);
|
|
108
|
+
lines.push(` <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=${org}/${name}&type=Date" width="100%" />`);
|
|
109
|
+
lines.push(' </picture>');
|
|
110
|
+
lines.push('</a>');
|
|
111
|
+
lines.push('');
|
|
112
|
+
|
|
113
|
+
// --- Contributing ---
|
|
114
|
+
lines.push('## 🤝 Contributing');
|
|
115
|
+
lines.push('');
|
|
116
|
+
lines.push('Contributions are welcome. Issues, pull requests, feature ideas, documentation, design.');
|
|
117
|
+
lines.push('');
|
|
118
|
+
lines.push('<sub>If this project helped you grow, consider giving it a ⭐</sub>');
|
|
119
|
+
|
|
120
|
+
return lines.join('\n');
|
|
121
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* package.json generator for the developer-tool template.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Generate package.json from content item + brand data
|
|
7
|
+
*
|
|
8
|
+
* @param {Object} data - { name, org, title, description, cta, topics, brand }
|
|
9
|
+
* @returns {string} Stringified JSON
|
|
10
|
+
*/
|
|
11
|
+
module.exports = function generatePackageJson(data) {
|
|
12
|
+
const { name, org, title, description, cta, topics, brand } = data;
|
|
13
|
+
|
|
14
|
+
const pkg = {
|
|
15
|
+
name: `${org}-${name}`,
|
|
16
|
+
version: '1.0.0',
|
|
17
|
+
description: `${title} ${description}`,
|
|
18
|
+
main: 'src/index.js',
|
|
19
|
+
scripts: {
|
|
20
|
+
start: 'node src/index.js',
|
|
21
|
+
},
|
|
22
|
+
keywords: topics || [],
|
|
23
|
+
author: brand?.name || '',
|
|
24
|
+
license: 'ISC',
|
|
25
|
+
homepage: cta?.platform || cta?.url || brand?.url || '',
|
|
26
|
+
repository: {
|
|
27
|
+
type: 'git',
|
|
28
|
+
url: `git+https://github.com/${org}/${name}.git`,
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return JSON.stringify(pkg, null, 2) + '\n';
|
|
33
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
const { exec } = require('child_process');
|
|
2
|
+
const { createWriteStream } = require('fs');
|
|
3
|
+
const { pipeline } = require('stream/promises');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const pkg = require('../package.json');
|
|
7
|
+
|
|
8
|
+
const PLATFORM_MAP = {
|
|
9
|
+
darwin: 'mac',
|
|
10
|
+
win32: 'windows',
|
|
11
|
+
linux: 'linux',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
function log(msg) {
|
|
15
|
+
console.log(`[${new Date().toLocaleTimeString()}] ${msg}`);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function getDownloadsFolder() {
|
|
19
|
+
return path.join(os.homedir(), 'Downloads');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function launchFile(filePath) {
|
|
23
|
+
const platform = os.platform();
|
|
24
|
+
log(`Launching ${filePath}...`);
|
|
25
|
+
|
|
26
|
+
if (platform === 'darwin') {
|
|
27
|
+
exec(`open "${filePath}"`);
|
|
28
|
+
} else if (platform === 'win32') {
|
|
29
|
+
exec(`start "" "${filePath}"`);
|
|
30
|
+
} else {
|
|
31
|
+
exec(`xdg-open "${filePath}"`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async function main() {
|
|
36
|
+
const platform = os.platform();
|
|
37
|
+
const platformKey = PLATFORM_MAP[platform] || 'linux';
|
|
38
|
+
|
|
39
|
+
log(`${pkg.name} v${pkg.version}`);
|
|
40
|
+
log(`Platform: ${platform} (${platformKey})`);
|
|
41
|
+
|
|
42
|
+
// Fetch download URLs from the website's config.json
|
|
43
|
+
const siteUrl = new URL(pkg.homepage).origin;
|
|
44
|
+
const configUrl = `${siteUrl}/config.json`;
|
|
45
|
+
log(`Fetching download info from ${configUrl}...`);
|
|
46
|
+
|
|
47
|
+
const configRes = await fetch(configUrl);
|
|
48
|
+
|
|
49
|
+
if (!configRes.ok) {
|
|
50
|
+
throw new Error(`Failed to fetch config: ${configRes.status} ${configRes.statusText}`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const config = await configRes.json();
|
|
54
|
+
const downloads = config.download || {};
|
|
55
|
+
const platformDownloads = downloads[platformKey];
|
|
56
|
+
|
|
57
|
+
if (!platformDownloads) {
|
|
58
|
+
throw new Error(`No downloads available for ${platformKey}`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const url = platformDownloads.universal || platformDownloads.debian || '';
|
|
62
|
+
|
|
63
|
+
if (!url) {
|
|
64
|
+
throw new Error(`No download URL found for ${platformKey}`);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
log(`Download URL: ${url}`);
|
|
68
|
+
|
|
69
|
+
// Download the file
|
|
70
|
+
const fileName = url.split('/').pop();
|
|
71
|
+
const filePath = path.join(getDownloadsFolder(), fileName);
|
|
72
|
+
|
|
73
|
+
log(`Downloading to ${filePath}...`);
|
|
74
|
+
|
|
75
|
+
const downloadRes = await fetch(url);
|
|
76
|
+
|
|
77
|
+
if (!downloadRes.ok) {
|
|
78
|
+
throw new Error(`Download failed: ${downloadRes.status} ${downloadRes.statusText}`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const fileStream = createWriteStream(filePath);
|
|
82
|
+
await pipeline(downloadRes.body, fileStream);
|
|
83
|
+
|
|
84
|
+
log(`Download complete: ${fileName}`);
|
|
85
|
+
|
|
86
|
+
// Install and launch
|
|
87
|
+
if (platform === 'darwin' && fileName.endsWith('.dmg')) {
|
|
88
|
+
log('Mounting DMG...');
|
|
89
|
+
const { execSync } = require('child_process');
|
|
90
|
+
const mountOutput = execSync(`hdiutil attach "${filePath}" -nobrowse`, { encoding: 'utf8' });
|
|
91
|
+
const mountPoint = mountOutput.split('\t').pop().trim();
|
|
92
|
+
log(`Mounted at ${mountPoint}`);
|
|
93
|
+
|
|
94
|
+
const appName = require('fs').readdirSync(mountPoint).find((f) => f.endsWith('.app'));
|
|
95
|
+
|
|
96
|
+
if (appName) {
|
|
97
|
+
const appSource = path.join(mountPoint, appName);
|
|
98
|
+
const appDest = path.join('/Applications', appName);
|
|
99
|
+
log(`Copying ${appName} to /Applications...`);
|
|
100
|
+
execSync(`cp -R "${appSource}" "${appDest}"`);
|
|
101
|
+
log('Launching app...');
|
|
102
|
+
exec(`open "${appDest}"`);
|
|
103
|
+
log(`Ejecting ${mountPoint}...`);
|
|
104
|
+
exec(`hdiutil detach "${mountPoint}"`);
|
|
105
|
+
} else {
|
|
106
|
+
log('No .app found in DMG, opening manually...');
|
|
107
|
+
launchFile(filePath);
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
launchFile(filePath);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
log('Done!');
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
main().catch((err) => {
|
|
117
|
+
console.error(`[${new Date().toLocaleTimeString()}] Error: ${err.message}`);
|
|
118
|
+
console.log(`\nVisit ${pkg.homepage} to download manually.`);
|
|
119
|
+
process.exit(1);
|
|
120
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SEO template registry with convention-based auto-discovery. Each template
|
|
3
|
+
* is a directory here; files starting with `_` and ending with `.js` are
|
|
4
|
+
* generators (strip both → target path, e.g. _README.md.js → README.md),
|
|
5
|
+
* everything else is a static file pushed as-is.
|
|
6
|
+
*/
|
|
7
|
+
const { join, relative, resolve, dirname, basename } = require('node:path');
|
|
8
|
+
const jetpack = require('fs-jetpack');
|
|
9
|
+
|
|
10
|
+
const TEMPLATES = [
|
|
11
|
+
'developer-tool',
|
|
12
|
+
];
|
|
13
|
+
|
|
14
|
+
const loaded = {};
|
|
15
|
+
|
|
16
|
+
for (const name of TEMPLATES) {
|
|
17
|
+
const templateDir = join(__dirname, name);
|
|
18
|
+
// find() returns cwd-relative paths — resolve to absolute so template
|
|
19
|
+
// loading works from any cwd (the manager runs from the brand root)
|
|
20
|
+
const allPaths = jetpack.find(templateDir, { recursive: true, files: true }).map((p) => resolve(p));
|
|
21
|
+
const files = [];
|
|
22
|
+
|
|
23
|
+
for (const absPath of allPaths) {
|
|
24
|
+
const relPath = relative(templateDir, absPath);
|
|
25
|
+
const fileName = basename(absPath);
|
|
26
|
+
|
|
27
|
+
if (fileName.startsWith('_') && fileName.endsWith('.js')) {
|
|
28
|
+
const targetName = fileName.slice(1, -3);
|
|
29
|
+
const dir = dirname(relPath);
|
|
30
|
+
const targetPath = dir === '.' ? targetName : join(dir, targetName);
|
|
31
|
+
files.push({ path: targetPath, generate: require(absPath) });
|
|
32
|
+
} else {
|
|
33
|
+
files.push({ path: relPath, content: jetpack.read(absPath) });
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
loaded[name] = { files };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Load a template by name
|
|
42
|
+
*
|
|
43
|
+
* @param {string} name - Template name (e.g. 'developer-tool')
|
|
44
|
+
* @returns {{ files: Array<{path: string, generate?: Function, content?: string}> }}
|
|
45
|
+
*/
|
|
46
|
+
function loadTemplate(name) {
|
|
47
|
+
const template = loaded[name];
|
|
48
|
+
|
|
49
|
+
if (!template) {
|
|
50
|
+
const available = Object.keys(loaded).join(', ');
|
|
51
|
+
throw new Error(`Unknown SEO template: "${name}". Available: ${available}`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return template;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
module.exports = { loadTemplate };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sync the brand's registry entry to the company server's Firestore at
|
|
3
|
+
* brands/{brand.id}. Only the whitelisted top-level config sections cross
|
|
4
|
+
* (brand identity, repo org info, sponsorship terms), and the document
|
|
5
|
+
* is fully REPLACED on write so keys removed from config disappear from
|
|
6
|
+
* the registry too — omega-manager's `set(data, { merge: false })`
|
|
7
|
+
* semantic, but diff-synced: omega-manager overwrote the document blindly
|
|
8
|
+
* on every run with no dry-run guard; the port reads first and only
|
|
9
|
+
* writes on drift.
|
|
10
|
+
*/
|
|
11
|
+
const chalk = require('chalk').default;
|
|
12
|
+
|
|
13
|
+
// Only these top-level config sections are published to the registry
|
|
14
|
+
const SYNCED_KEYS = ['brand', 'repo', 'sponsorships'];
|
|
15
|
+
|
|
16
|
+
/** Structural equality, key-order-insensitive — a full-replace write means
|
|
17
|
+
* ANY difference (including extra keys in the current doc) is drift. */
|
|
18
|
+
function deepEqual(a, b) {
|
|
19
|
+
if (a === b) return true;
|
|
20
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
21
|
+
return a.length === b.length && a.every((item, index) => deepEqual(item, b[index]));
|
|
22
|
+
}
|
|
23
|
+
if (a && b && typeof a === 'object' && typeof b === 'object' && !Array.isArray(a) && !Array.isArray(b)) {
|
|
24
|
+
const aKeys = Object.keys(a);
|
|
25
|
+
return aKeys.length === Object.keys(b).length && aKeys.every((key) => key in b && deepEqual(a[key], b[key]));
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
module.exports = async function ensureBrands(context) {
|
|
31
|
+
const { brandConfig, db, options } = context;
|
|
32
|
+
const dryRun = options?.dryRun || false;
|
|
33
|
+
|
|
34
|
+
const registryId = brandConfig.brand.id;
|
|
35
|
+
const docPath = `brands/${registryId}`;
|
|
36
|
+
|
|
37
|
+
const desired = {};
|
|
38
|
+
for (const key of SYNCED_KEYS) {
|
|
39
|
+
if (brandConfig[key] !== undefined) {
|
|
40
|
+
desired[key] = brandConfig[key];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const current = await db.getDoc(docPath);
|
|
45
|
+
|
|
46
|
+
if (deepEqual(current, desired)) {
|
|
47
|
+
console.log(` ${chalk.green('✓')} Registry entry ${chalk.dim(docPath)} in sync`);
|
|
48
|
+
return { output: { brands: { synced: true } } };
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const action = current ? 'update' : 'create';
|
|
52
|
+
|
|
53
|
+
if (dryRun) {
|
|
54
|
+
console.log(` ${chalk.yellow('[DRY RUN]')} Would ${action} registry entry ${chalk.cyan(docPath)}`);
|
|
55
|
+
return { output: { brands: { planned: action } } };
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
await db.setDoc(docPath, desired);
|
|
59
|
+
|
|
60
|
+
console.log(` ${chalk.green('✓')} Registry entry ${chalk.dim(docPath)} ${action}d`);
|
|
61
|
+
|
|
62
|
+
return { output: { brands: { [`${action}d`]: true } } };
|
|
63
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server service — publishes the brand's registry entry to the company
|
|
3
|
+
* server's Firestore at brands/{brand.id}. The company's parent backend
|
|
4
|
+
* keeps a registry of every brand it serves (webhook fan-out, cross-brand
|
|
5
|
+
* features read it); this service keeps that entry in sync with the brand
|
|
6
|
+
* config.
|
|
7
|
+
*
|
|
8
|
+
* Auth: SERVER_SERVICE_ACCOUNT in the brand .env — a path to the company
|
|
9
|
+
* server's Firebase service-account JSON (absolute, or relative to the
|
|
10
|
+
* brand root). omega-manager hardcoded the company project
|
|
11
|
+
* ('itw-creative-works') and read its secrets from the company-instance
|
|
12
|
+
* .output/ tree instead; its legacy-brand `_` prefix skip was a
|
|
13
|
+
* company-instance convention and is dropped.
|
|
14
|
+
*/
|
|
15
|
+
const { serviceInputSpec } = require('../../config.js');
|
|
16
|
+
const { createServiceRunner } = require('../../lib/service-runner.js');
|
|
17
|
+
const { requestServiceInput } = require('../../lib/service-input.js');
|
|
18
|
+
const { FirestoreREST, loadServiceAccount } = require('../../lib/firestore-rest.js');
|
|
19
|
+
|
|
20
|
+
module.exports.run = createServiceRunner({
|
|
21
|
+
serviceDir: __dirname,
|
|
22
|
+
setup: async (context) => {
|
|
23
|
+
const config = context.brandConfig.server;
|
|
24
|
+
|
|
25
|
+
if (config === false || config?.enabled === false) {
|
|
26
|
+
return { skip: true, reason: 'server.enabled = false' };
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Tests inject a fake client via context.serverDb
|
|
30
|
+
let db = context.serverDb;
|
|
31
|
+
if (!db) {
|
|
32
|
+
// The shared setup contract (#608): a company-server operator provides
|
|
33
|
+
// the path here; every standalone brand answers Disable once and is
|
|
34
|
+
// never asked again.
|
|
35
|
+
const gate = await requestServiceInput(context, serviceInputSpec('server'));
|
|
36
|
+
if (gate) return gate;
|
|
37
|
+
db = new FirestoreREST(loadServiceAccount(process.env.SERVER_SERVICE_ACCOUNT, context.brandRoot));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return { db };
|
|
41
|
+
},
|
|
42
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-target health checks, grouped by target — omega-manager's target-checks
|
|
3
|
+
* for brand monorepos. Local checks always run; live checks (homepage, API
|
|
4
|
+
* health, npm latest, GitHub Actions) are skipped in dry-run with a "would"
|
|
5
|
+
* line, so a dry run never touches the network.
|
|
6
|
+
*
|
|
7
|
+
* Checks by target:
|
|
8
|
+
* web → package.json, dist/index.html, installed framework vs npm
|
|
9
|
+
* latest, homepage fetch
|
|
10
|
+
* backend → package.json, firebase.json, staged dist/ (build output),
|
|
11
|
+
* installed framework vs npm latest, API health + deployed
|
|
12
|
+
* version (skipped for shared Firebase projects)
|
|
13
|
+
* (all) → package.json, framework version when declared
|
|
14
|
+
*
|
|
15
|
+
* Repo-level (once): working tree clean, latest GitHub Actions run (only
|
|
16
|
+
* with repo.providers.github.org configured).
|
|
17
|
+
*
|
|
18
|
+
* The output shape matches omega-manager's testing service so RunSummary's
|
|
19
|
+
* drill-down works unchanged. Data problems roll up honestly: any failed
|
|
20
|
+
* check → error, any warning → warned.
|
|
21
|
+
*
|
|
22
|
+
* omega-manager deltas: build.json check stays behind (a UJM artifact —
|
|
23
|
+
* @omega.js/web has no build manifest); the stash check stays behind (nothing
|
|
24
|
+
* stashes in the new update service); GitHub Actions is repo-level (one repo
|
|
25
|
+
* per brand, not one per target).
|
|
26
|
+
*/
|
|
27
|
+
const chalk = require('chalk').default;
|
|
28
|
+
|
|
29
|
+
const {
|
|
30
|
+
createRecorder,
|
|
31
|
+
defaultExec,
|
|
32
|
+
checkTargetFiles,
|
|
33
|
+
checkFrameworkVersion,
|
|
34
|
+
checkWorkingTree,
|
|
35
|
+
checkHomepage,
|
|
36
|
+
checkApiHealth,
|
|
37
|
+
checkGitHubActions,
|
|
38
|
+
} = require('../lib/checks.js');
|
|
39
|
+
|
|
40
|
+
module.exports = async (context) => {
|
|
41
|
+
const { brandId, brandRoot, brandConfig, targets, options } = context;
|
|
42
|
+
|
|
43
|
+
// Tests inject fetch/exec/retryDelayMs via options (they ride runManage
|
|
44
|
+
// options so full-loop tests stay network-free); production uses the reals
|
|
45
|
+
const ctx = {
|
|
46
|
+
brandId,
|
|
47
|
+
brandRoot,
|
|
48
|
+
brandConfig,
|
|
49
|
+
dryRun: options?.dryRun || false,
|
|
50
|
+
fetchImpl: options?.fetch || globalThis.fetch,
|
|
51
|
+
exec: options?.exec || defaultExec,
|
|
52
|
+
retryDelayMs: options?.retryDelayMs ?? 1000,
|
|
53
|
+
versionCache: {},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const recorder = createRecorder();
|
|
57
|
+
|
|
58
|
+
for (const entry of targets.filter((item) => item.target)) {
|
|
59
|
+
console.log(` ${chalk.cyan('┌')} ${chalk.cyan.bold(entry.name)} ${chalk.dim(`→ ${entry.target}`)}`);
|
|
60
|
+
|
|
61
|
+
checkTargetFiles(recorder, entry);
|
|
62
|
+
checkFrameworkVersion(recorder, entry, ctx);
|
|
63
|
+
|
|
64
|
+
if (entry.target === 'web') {
|
|
65
|
+
await checkHomepage(recorder, entry, ctx);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (entry.target === 'backend') {
|
|
69
|
+
await checkApiHealth(recorder, entry, ctx);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
console.log(` ${chalk.cyan('└')}`);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
console.log(` ${chalk.cyan('┌')} ${chalk.cyan.bold('repo')}`);
|
|
76
|
+
checkWorkingTree(recorder, ctx);
|
|
77
|
+
checkGitHubActions(recorder, ctx);
|
|
78
|
+
console.log(` ${chalk.cyan('└')}`);
|
|
79
|
+
|
|
80
|
+
const { passed, warned, failed } = recorder.results();
|
|
81
|
+
const status = failed.length > 0 ? 'error' : warned.length > 0 ? 'warned' : 'success';
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
status,
|
|
85
|
+
...(failed.length > 0 ? { error: failed.map((f) => f.name).join(', ') } : {}),
|
|
86
|
+
// The reason carries each warned check's own text, not just its name —
|
|
87
|
+
// the summary line is all a run prints for a warned service, so
|
|
88
|
+
// `outdated (1.0.0 → 1.2.0)` has to survive the rollup.
|
|
89
|
+
...(status === 'warned'
|
|
90
|
+
? { reason: warned.map((w) => (w.warning ? `${w.name}: ${w.warning}` : w.name)).join('; ') }
|
|
91
|
+
: {}),
|
|
92
|
+
output: {
|
|
93
|
+
results: { passed, warned, failed },
|
|
94
|
+
counts: recorder.counts(),
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Testing service — health checks after every other service ran. Same role
|
|
3
|
+
* as omega-manager's testing service: per-target local checks (build output,
|
|
4
|
+
* backend scaffolding, framework version vs npm latest) plus live checks
|
|
5
|
+
* against the deployed brand (homepage, API health + deployed version,
|
|
6
|
+
* GitHub Actions). Live checks skip under --dry-run — a dry run never
|
|
7
|
+
* touches the network.
|
|
8
|
+
*/
|
|
9
|
+
const { createServiceRunner } = require('../../lib/service-runner.js');
|
|
10
|
+
|
|
11
|
+
module.exports.run = createServiceRunner({ serviceDir: __dirname });
|