@skyux/docs-tools 4.9.3 → 4.9.7

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/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ # 4.9.7 (2021-12-03)
2
+
3
+ - Fixed the `SkyDocsCodeExamplesEditorService` to set wildcard versions (e.g. '*') of SKY UX packages to `^4`. [#188](https://github.com/blackbaud/skyux-docs-tools/pull/188)
4
+
5
+ # 4.9.6 (2021-09-21)
6
+
7
+ - Fixed the `SkyDocsSourceCodeService` to handle both encoded and decoded URI strings for the source code. [#173](https://github.com/blackbaud/skyux-docs-tools/pull/173)
8
+
9
+ # 4.9.5 (2021-08-25)
10
+
11
+ - Fixed the NPM release. [#172](https://github.com/blackbaud/skyux-docs-tools/pull/172)
12
+
13
+ # 4.9.4 (2021-08-25)
14
+
15
+ - [This release is broken. Upgrade to version `4.9.5`.]
16
+ - Fixed the `SkyDocsTypeDocAdapterService` to handle default values generated by `typedoc@~0.20.0`. [#170](https://github.com/blackbaud/skyux-docs-tools/pull/170)
17
+
1
18
  # 4.9.3 (2021-08-13)
2
19
 
3
20
  - Fixed the `SkyDocsTypeDocAdapterService` to use `SkyDocsTypeDefinitionsProvider.anchorIds` if the `anchorId` property has not been set on the individual type definitions. [#167](https://github.com/blackbaud/skyux-docs-tools/pull/167)
@@ -345,7 +345,20 @@
345
345
  return sourceCode
346
346
  .filter(function (file) { return file.filePath.indexOf(path) === 0; })
347
347
  .map(function (file) {
348
- file.rawContents = decodeURIComponent(file.rawContents);
348
+ // TODO: Remove decoding after migrating to Angular CLI. Code examples will not be encoded for SKY UX 5 libraries.
349
+ // SKY UX 4 libraries will return rawContents encoded, while later libraries will
350
+ // return rawContents decoded. Check if the contents need decoded before returning them.
351
+ var decodedContents;
352
+ try {
353
+ decodedContents = decodeURIComponent(file.rawContents);
354
+ if (decodedContents !== file.rawContents) {
355
+ file.rawContents = decodedContents;
356
+ }
357
+ }
358
+ catch (error) {
359
+ // Pre-decoded contents may contain characters like '%' that would throw errors.
360
+ // In these cases, pass along the original rawContents.
361
+ }
349
362
  return file;
350
363
  });
351
364
  };
@@ -461,7 +474,7 @@
461
474
  };
462
475
  SkyDocsCodeExamplesEditorService.prototype.getPayload = function (codeExample) {
463
476
  var angularVersion = '^9.0.0';
464
- var skyuxVersion = '*';
477
+ var skyuxVersion = '^4';
465
478
  var defaultDependencies = {
466
479
  '@angular/animations': angularVersion,
467
480
  '@angular/common': angularVersion,
@@ -492,6 +505,16 @@
492
505
  'zone.js': '~0.11.4'
493
506
  };
494
507
  var mergedDependencies = Object.assign({}, defaultDependencies, codeExample.packageDependencies);
508
+ // Ensure any @skyux dependencies list the correct version of SKY UX.
509
+ // e.g. `"@skyux/core": "*"` --> `"@skyux/core": "4.0.0"`
510
+ for (var packageName in mergedDependencies) {
511
+ if (mergedDependencies.hasOwnProperty(packageName)) {
512
+ var version = mergedDependencies[packageName];
513
+ if (version === '*' && /^(@blackbaud\/skyux-lib-|@skyux)/.test(packageName)) {
514
+ mergedDependencies[packageName] = skyuxVersion;
515
+ }
516
+ }
517
+ }
495
518
  var files = this.parseStackBlitzFiles(codeExample.sourceCode, mergedDependencies, codeExample.theme);
496
519
  return {
497
520
  files: files,
@@ -2578,7 +2601,16 @@
2578
2601
  : property.name;
2579
2602
  };
2580
2603
  SkyDocsTypeDocAdapterService.prototype.getDefaultValue = function (child, tags) {
2581
- return tags.defaultValue || child.defaultValue || undefined;
2604
+ if (tags.defaultValue) {
2605
+ return tags.defaultValue;
2606
+ }
2607
+ // TypeDoc version 0.20.x stopped auto-generating initializers for the default value
2608
+ // (and replaced them with "...") due to the complicated logic it required.
2609
+ // See: https://github.com/TypeStrong/typedoc/issues/1552
2610
+ if (child.defaultValue === '...') {
2611
+ return;
2612
+ }
2613
+ return child.defaultValue;
2582
2614
  };
2583
2615
  SkyDocsTypeDocAdapterService.prototype.getAnchorId = function (entry) {
2584
2616
  var _a;