@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,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secret-shaped key detection — secrets NEVER live in omega.json5; they live
|
|
3
|
+
* in .env. loadConfig() scans the raw files and throws before a resolved
|
|
4
|
+
* config is even produced; validateConfig() reports the same keys as errors.
|
|
5
|
+
*
|
|
6
|
+
* This is a key-NAME test, not a value test: a secret key with an empty or
|
|
7
|
+
* placeholder value is still in the wrong home. Public credentials pass by
|
|
8
|
+
* design — publishableKey, clientId, cloud.config.apiKey (the Firebase web
|
|
9
|
+
* API key is public) all fail to match.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
// Suffix-anchored shapes: *secret / *password / *token / *credential(s) /
|
|
13
|
+
// secretKey / secret_key / privateKey / private_key (+ _id — the pasted
|
|
14
|
+
// service-account JSON classic). Public credentials stay non-matching by
|
|
15
|
+
// design: publishableKey, clientId, apiKey, vapidKey, siteKey.
|
|
16
|
+
const SECRET_KEY_PATTERN = /(secret|password|passwd|token|credentials?|(secret|private)[_-]?key([_-]?id)?)$/i;
|
|
17
|
+
|
|
18
|
+
function walk(node, path, found) {
|
|
19
|
+
if (Array.isArray(node)) {
|
|
20
|
+
node.forEach((item, index) => walk(item, path ? `${path}.${index}` : String(index), found));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (typeof node !== 'object' || node === null) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
Object.keys(node).forEach((key) => {
|
|
29
|
+
const keyPath = path ? `${path}.${key}` : key;
|
|
30
|
+
|
|
31
|
+
if (SECRET_KEY_PATTERN.test(key)) {
|
|
32
|
+
found.push(keyPath);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
walk(node[key], keyPath, found);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Recursively find config keys whose names look like secrets.
|
|
41
|
+
* @param {object} object - Parsed config (or any sub-tree of one).
|
|
42
|
+
* @returns {string[]} Dot-paths of offending keys (array indices included).
|
|
43
|
+
*/
|
|
44
|
+
function findSecretKeys(object) {
|
|
45
|
+
const found = [];
|
|
46
|
+
walk(object, '', found);
|
|
47
|
+
return found;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = { findSecretKeys, SECRET_KEY_PATTERN };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Layer-aware consumer config seeding (dogfood friction #1).
|
|
3
|
+
*
|
|
4
|
+
* Every framework's setup seeds a consumer config/omega.json5. WHETHER it
|
|
5
|
+
* seeds at all depends on where the target lives:
|
|
6
|
+
*
|
|
7
|
+
* - inside a brand monorepo ({brand}/targets/{target}) → NO local-layer file: the
|
|
8
|
+
* brand root's config/omega.json5 owns the shared sections (brand
|
|
9
|
+
* identity, cloud, payment, …) and its `targets.*` is the per-target
|
|
10
|
+
* home, so the framework template SKIPS the config entirely (a seed
|
|
11
|
+
* would shadow the brand layer — the "My Brand ×22" bug — and keep
|
|
12
|
+
* resurrecting a deliberately deleted local file on every setup).
|
|
13
|
+
* - standalone consumer → the framework's full template, placeholders and
|
|
14
|
+
* all (there is no brand layer to inherit from).
|
|
15
|
+
*
|
|
16
|
+
* This module is the ONE home for that decision so the four frameworks can't
|
|
17
|
+
* drift. Standalone templates stay framework-owned.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
const { findBrandRoot } = require('./load.js');
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Decide which seed a target dir should get. Thin wrapper over findBrandRoot so
|
|
24
|
+
* seeding call sites read as intent.
|
|
25
|
+
*
|
|
26
|
+
* @param {string} targetDir - The consumer target dir (or its functions/ dir)
|
|
27
|
+
* @returns {{ standalone: boolean, brandRoot: string|null }}
|
|
28
|
+
*/
|
|
29
|
+
function resolveSeedMode(targetDir) {
|
|
30
|
+
const brandRoot = findBrandRoot(targetDir);
|
|
31
|
+
return { standalone: !brandRoot, brandRoot };
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
module.exports = { resolveSeedMode };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* site-global.js — shape a resolved omega.json5 config as the Jekyll-style
|
|
3
|
+
* `site.*` global, so existing template references port verbatim to the new
|
|
4
|
+
* SSG (plan §2: toSiteGlobal()).
|
|
5
|
+
*
|
|
6
|
+
* Scoped by the real-usage audit (2026-07-06) of UJM's theme/blueprints +
|
|
7
|
+
* somiibo: config-owned keys referenced in templates are the resolved
|
|
8
|
+
* config's own shape, so this is an identity mapping plus: machinery keys
|
|
9
|
+
* stripped (`targets`, `enabled`), `url` derived (explicit url, else
|
|
10
|
+
* brand.url), `baseurl` defaulted. ENGINE-owned keys (posts, pages, data,
|
|
11
|
+
* time) are the SSG's job, not config's. `collections` is NOT one of them
|
|
12
|
+
* (#207): it is the config-carried collections DECLARATION
|
|
13
|
+
* (`targets.web.collections`), which rides the identity mapping like any
|
|
14
|
+
* other section and which the engine reads to generate each declared
|
|
15
|
+
* collection's pages.
|
|
16
|
+
*
|
|
17
|
+
* The resolved config for target 'web' already overlays targets.web onto the
|
|
18
|
+
* top level, so web-specific sections land here automatically.
|
|
19
|
+
*
|
|
20
|
+
* site.targets (#85) is a CURATED view of the raw `targets` machinery —
|
|
21
|
+
* an explicit allow-list of display-safe facts (presence, the derived
|
|
22
|
+
* desktop releases URL, extension store listings), never a spread of the
|
|
23
|
+
* raw config. It is the ONLY home of those facts
|
|
24
|
+
* ([#610](https://github.com/Omega-JS-Stack/omega/issues/610)): the
|
|
25
|
+
* `/download` page, the `/extension` page and the shortlink generator all
|
|
26
|
+
* read `site.targets.desktop.releasesUrl` and
|
|
27
|
+
* `site.targets.extension.listings` directly. The legacy UJM-shaped
|
|
28
|
+
* `download`/`extension` page maps — and the derivation that filled them —
|
|
29
|
+
* are gone; the validator refuses a config still carrying either key.
|
|
30
|
+
*
|
|
31
|
+
* The desktop derivation is OPT-IN (#124): only a brand that carries a
|
|
32
|
+
* `targets.desktop.releases` block gets releases/latest links — merely
|
|
33
|
+
* declaring a desktop target derives nothing, since the release may not
|
|
34
|
+
* exist yet. WHICH repo those links address is not decided here: it is
|
|
35
|
+
* [repo.js](repo.js)'s `releasesRepo`, the one home of the brand's public
|
|
36
|
+
* releases repo (#799).
|
|
37
|
+
*
|
|
38
|
+
* Beside the hub sits `downloads` ([#620](https://github.com/Omega-JS-Stack/omega/issues/620)):
|
|
39
|
+
* one DIRECT-download URL per artifact, so a download button hands over a file
|
|
40
|
+
* instead of a GitHub page. The filenames are
|
|
41
|
+
* [desktop-artifacts.js](desktop-artifacts.js)'s — the same rule
|
|
42
|
+
* @omega.js/desktop packages under — and they carry no version, so releasing a
|
|
43
|
+
* desktop build never touches the website.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
const { desktopProductName, desktopArtifactNames } = require('./desktop-artifacts.js');
|
|
47
|
+
const { releasesRepo } = require('./repo.js');
|
|
48
|
+
|
|
49
|
+
// Keys that are resolution machinery, not site content
|
|
50
|
+
const MACHINERY_KEYS = ['targets', 'enabled'];
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Whether the brand OPTED IN to derived desktop download links (#124):
|
|
54
|
+
* declaring a desktop target is not enough — a `targets.desktop.releases`
|
|
55
|
+
* block must be present (`enabled` defaults true when it is), and
|
|
56
|
+
* `releases.enabled: false` always suppresses. On the pipeline's second
|
|
57
|
+
* toSiteGlobal pass the raw block is gone, so a curated `releasesUrl` is
|
|
58
|
+
* itself the opt-in (idempotence).
|
|
59
|
+
* @param {object} config - resolved config object
|
|
60
|
+
* @returns {boolean}
|
|
61
|
+
*/
|
|
62
|
+
function desktopReleasesEnabled(config) {
|
|
63
|
+
const desktop = targetEntry(config, 'desktop');
|
|
64
|
+
if (!desktop) return false;
|
|
65
|
+
if (desktop.releases) return desktop.releases.enabled !== false;
|
|
66
|
+
|
|
67
|
+
return Boolean(desktop.releasesUrl);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The GitHub releases URL a desktop target's downloads point at: the brand's ONE
|
|
72
|
+
* public releases repo, whose address `@omega.js/config`'s `releasesRepo` owns
|
|
73
|
+
* (#799). Nothing is derived here; a repo the derivation cannot address (no
|
|
74
|
+
* owner, no brand.id) yields no URL.
|
|
75
|
+
* @param {object} config - resolved config object
|
|
76
|
+
* @returns {string|undefined}
|
|
77
|
+
*/
|
|
78
|
+
function desktopReleasesUrl(config) {
|
|
79
|
+
const desktop = targetEntry(config, 'desktop');
|
|
80
|
+
|
|
81
|
+
// Idempotence: the build pipeline applies toSiteGlobal more than once
|
|
82
|
+
// (consumer.js loadSiteData, then engine.js configureOmega). On a second pass
|
|
83
|
+
// the raw releases block is gone, so the curated view's own URL is the
|
|
84
|
+
// authority: re-deriving would rename a brand's explicit releases.repo to the
|
|
85
|
+
// `<brand.id>-releases` default behind its back.
|
|
86
|
+
if (!desktop?.releases && desktop?.releasesUrl) return desktop.releasesUrl;
|
|
87
|
+
|
|
88
|
+
const { repo } = releasesRepo(config);
|
|
89
|
+
|
|
90
|
+
return repo ? `https://github.com/${repo}/releases/latest` : undefined;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The direct-download URL of every desktop artifact, keyed platform → artifact
|
|
95
|
+
* (#620). GitHub's `/releases/latest/download/<asset>` serves the newest
|
|
96
|
+
* release's asset by name, which only holds because the names are versionless.
|
|
97
|
+
* @param {object} config - resolved config object
|
|
98
|
+
* @param {string} releasesUrl - the derived releases hub URL
|
|
99
|
+
* @returns {object|undefined}
|
|
100
|
+
*/
|
|
101
|
+
function desktopDownloads(config, releasesUrl) {
|
|
102
|
+
const desktop = targetEntry(config, 'desktop');
|
|
103
|
+
|
|
104
|
+
// Idempotence, same trap as the URL above: the second toSiteGlobal pass sees
|
|
105
|
+
// the curated view, which carries no app block and no brand-derived product
|
|
106
|
+
// name — the curated URLs are the authority by then.
|
|
107
|
+
if (desktop?.downloads) return desktop.downloads;
|
|
108
|
+
|
|
109
|
+
// No product name (an invalid config — brand.name is required) derives
|
|
110
|
+
// nothing: a guessed filename is a download button that 404s.
|
|
111
|
+
const names = desktopArtifactNames(desktopProductName({ app: desktop?.app, brand: config?.brand }));
|
|
112
|
+
if (!Object.keys(names).length) return undefined;
|
|
113
|
+
|
|
114
|
+
const downloads = {};
|
|
115
|
+
for (const [platform, artifacts] of Object.entries(names)) {
|
|
116
|
+
downloads[platform] = {};
|
|
117
|
+
for (const [artifact, filename] of Object.entries(artifacts)) {
|
|
118
|
+
downloads[platform][artifact] = `${releasesUrl}/download/${filename}`;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return downloads;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* A target's config entry when it is the plain-object form. Array-form
|
|
127
|
+
* (multi-instance) targets return undefined: which instance's facts belong
|
|
128
|
+
* on the site is ambiguous, so instance-form brands supply explicit page
|
|
129
|
+
* maps instead of getting a silently wrong derivation.
|
|
130
|
+
* @param {object} config - resolved config object
|
|
131
|
+
* @param {string} name - target key
|
|
132
|
+
* @returns {object|undefined}
|
|
133
|
+
*/
|
|
134
|
+
function targetEntry(config, name) {
|
|
135
|
+
const entry = config?.targets?.[name];
|
|
136
|
+
if (!entry || typeof entry !== 'object' || Array.isArray(entry)) return undefined;
|
|
137
|
+
return entry;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Curate one target's display-safe view. Presence = enabled; per-type
|
|
142
|
+
* extras are allow-listed here, never spread from the raw entry.
|
|
143
|
+
* @param {string} name - target key (web, backend, desktop, extension, …)
|
|
144
|
+
* @param {object} config - resolved config object
|
|
145
|
+
* @returns {object}
|
|
146
|
+
*/
|
|
147
|
+
function curateTarget(name, config) {
|
|
148
|
+
const view = { enabled: true };
|
|
149
|
+
|
|
150
|
+
if (name === 'desktop' && desktopReleasesEnabled(config)) {
|
|
151
|
+
const releasesUrl = desktopReleasesUrl(config);
|
|
152
|
+
if (releasesUrl) {
|
|
153
|
+
view.releasesUrl = releasesUrl;
|
|
154
|
+
const downloads = desktopDownloads(config, releasesUrl);
|
|
155
|
+
if (downloads) view.downloads = downloads;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (name === 'extension') {
|
|
160
|
+
const listings = targetEntry(config, 'extension')?.listings;
|
|
161
|
+
if (listings) {
|
|
162
|
+
const curated = {};
|
|
163
|
+
for (const [store, entry] of Object.entries(listings)) {
|
|
164
|
+
if (!entry?.url && !entry?.state) continue; // empty entries stay absent, never a truthy {}
|
|
165
|
+
curated[store] = {
|
|
166
|
+
...(entry.url ? { url: entry.url } : {}),
|
|
167
|
+
...(entry.state ? { state: entry.state } : {}),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
if (Object.keys(curated).length) view.listings = curated;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return view;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Convert a RESOLVED config (loadConfig(...).config) into the site.* global.
|
|
179
|
+
* @param {object} config - resolved config object
|
|
180
|
+
* @returns {object} the site global (new object; config is not mutated)
|
|
181
|
+
*/
|
|
182
|
+
function toSiteGlobal(config) {
|
|
183
|
+
const site = {};
|
|
184
|
+
|
|
185
|
+
for (const [key, value] of Object.entries(config || {})) {
|
|
186
|
+
if (MACHINERY_KEYS.includes(key)) continue;
|
|
187
|
+
site[key] = value;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
site.url = config?.url || config?.brand?.url || '';
|
|
191
|
+
site.baseurl = config?.baseurl || '';
|
|
192
|
+
|
|
193
|
+
// Curated targets view (#85) — raw machinery stays stripped above.
|
|
194
|
+
const targets = config?.targets;
|
|
195
|
+
if (targets && typeof targets === 'object') {
|
|
196
|
+
site.targets = {};
|
|
197
|
+
for (const name of Object.keys(targets)) {
|
|
198
|
+
site.targets[name] = curateTarget(name, config);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return site;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
module.exports = { toSiteGlobal };
|