jsii 5.9.9-dev.2 → 5.9.9-dev.4

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/lib/assembler.js CHANGED
@@ -183,7 +183,7 @@ class Assembler {
183
183
  jsiiVersion,
184
184
  bin: this.projectInfo.bin,
185
185
  fingerprint: '<TBD>',
186
- usedFeatures: this.usedFeatures.size > 0 ? Array.from(this.usedFeatures) : undefined,
186
+ usedFeatures: _assemblyFeatures(this.usedFeatures), // might be appended later
187
187
  };
188
188
  if (this.deprecatedRemover) {
189
189
  this._diagnostics.push(...this.deprecatedRemover.removeFrom(assembly));
@@ -203,6 +203,13 @@ class Assembler {
203
203
  }
204
204
  const validator = new validator_1.Validator(this.projectInfo, assembly);
205
205
  const validationResult = validator.emit();
206
+ // Inject detected features
207
+ if (validationResult.usedFeatures) {
208
+ for (const item of validationResult.usedFeatures) {
209
+ this.usedFeatures.add(item);
210
+ }
211
+ assembly.usedFeatures = _assemblyFeatures(this.usedFeatures);
212
+ }
206
213
  if (!validationResult.emitSkipped) {
207
214
  const zipped = (0, spec_1.writeAssembly)(this.projectInfo.projectRoot, _fingerprint(assembly), {
208
215
  compress: this.compressAssembly ?? false,
@@ -218,6 +225,9 @@ class Assembler {
218
225
  finally {
219
226
  this._afterEmit();
220
227
  }
228
+ function _assemblyFeatures(usedFeatures) {
229
+ return usedFeatures.size > 0 ? Array.from(usedFeatures).sort() : undefined;
230
+ }
221
231
  function _loadReadme() {
222
232
  // Search for `README.md` in a case-insensitive way
223
233
  const fileName = fs