@jaypie/constructs 1.2.64 → 1.2.65

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.
@@ -1158,16 +1158,18 @@ class JaypieEnvSecret extends JaypieSecret {
1158
1158
  super(scope, idOrEnvKey, props);
1159
1159
  }
1160
1160
  buildSecret(context) {
1161
- const { envKey, id, treatAsEnvKey } = context;
1161
+ const { envKey, id } = context;
1162
1162
  const props = context.props;
1163
1163
  const { consumer = checkEnvIsConsumer$1(), export: exportParam, generateSecretString, provider = checkEnvIsProvider$1(), removalPolicy, roleTag, vendorTag, value, } = props;
1164
1164
  let exportName;
1165
1165
  if (!exportParam) {
1166
- // When shorthand detection is active, use the full construct id (which
1167
- // includes the "EnvSecret_" prefix) so the export name matches what was
1168
- // produced by earlier versions of this construct. Using the raw envKey
1169
- // here produces a shorter name that breaks existing cross-stack imports.
1170
- const exportSource = treatAsEnvKey ? id : envKey || id;
1166
+ // Always derive the export name from the construct id so the name is
1167
+ // stable across both call forms. For shorthand detection the id carries
1168
+ // the "EnvSecret_" prefix; for the explicit (id, { envKey }) form the id
1169
+ // is the caller's construct id. Deriving from envKey instead would change
1170
+ // the export name for an unchanged explicit-form call site across a
1171
+ // version bump and break existing cross-stack imports (issues #347, #365).
1172
+ const exportSource = id;
1171
1173
  exportName = exportEnvName$1(exportSource, process.env, consumer);
1172
1174
  }
1173
1175
  else {