@topolo/cli 0.5.2 → 0.6.1
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/dist/generate-wrangler.mjs +10 -2
- package/dist/index.js +1215 -331
- package/package.json +4 -4
|
@@ -591,6 +591,9 @@ function emitCloudcontrol() {
|
|
|
591
591
|
const cc = { ...existing };
|
|
592
592
|
cc.name = manifest.name;
|
|
593
593
|
const deployableTargets = Object.values(manifest.targets).filter((t) => t.kind !== 'none');
|
|
594
|
+
const deployableEnvironments = new Set(
|
|
595
|
+
deployableTargets.flatMap((target) => target.environments || ENVS),
|
|
596
|
+
);
|
|
594
597
|
cc.deploy_method = deployableTargets.length ? 'wrangler' : 'none';
|
|
595
598
|
cc.ci_provider = existing.ci_provider || 'github_actions';
|
|
596
599
|
cc.quality_policy = existing.quality_policy || {
|
|
@@ -600,7 +603,7 @@ function emitCloudcontrol() {
|
|
|
600
603
|
};
|
|
601
604
|
cc.repo_identity = existing.repo_identity || cc.repo_identity;
|
|
602
605
|
|
|
603
|
-
cc.environments = ENVS.map((env) => {
|
|
606
|
+
cc.environments = ENVS.filter((env) => deployableEnvironments.has(env)).map((env) => {
|
|
604
607
|
const publicTarget = firstPublicTarget(env);
|
|
605
608
|
const host = publicTarget ? primaryHost(publicTarget, env) : null;
|
|
606
609
|
return {
|
|
@@ -842,7 +845,12 @@ function emitCloudcontrol() {
|
|
|
842
845
|
}
|
|
843
846
|
}
|
|
844
847
|
cc.tags = existing.tags || ['application', 'cloudflare', 'github-actions', 'javascript'];
|
|
845
|
-
|
|
848
|
+
const primaryEnvironment = [...ENVS]
|
|
849
|
+
.reverse()
|
|
850
|
+
.find((environment) => deployableEnvironments.has(environment));
|
|
851
|
+
if (primaryEnvironment) {
|
|
852
|
+
cc.cloudflare_account_id = manifest.environments[primaryEnvironment].accountId;
|
|
853
|
+
}
|
|
846
854
|
|
|
847
855
|
return JSON.stringify(cc, null, 2) + '\n';
|
|
848
856
|
}
|