@smithy/service-client-documentation-generator 3.0.0 → 4.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/dist-cjs/index.js +19 -26
- package/dist-types/index.d.ts +1 -1
- package/dist-types/sdk-client-toc-plugin.d.ts +1 -1
- package/dist-types/utils.d.ts +1 -1
- package/package.json +10 -6
package/dist-cjs/index.js
CHANGED
|
@@ -21,17 +21,16 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
21
21
|
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
22
22
|
if (decorator = decorators[i])
|
|
23
23
|
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
24
|
-
if (kind && result)
|
|
25
|
-
__defProp(target, key, result);
|
|
24
|
+
if (kind && result) __defProp(target, key, result);
|
|
26
25
|
return result;
|
|
27
26
|
};
|
|
28
27
|
|
|
29
28
|
// src/index.ts
|
|
30
|
-
var
|
|
31
|
-
__export(
|
|
29
|
+
var index_exports = {};
|
|
30
|
+
__export(index_exports, {
|
|
32
31
|
load: () => load
|
|
33
32
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(index_exports);
|
|
35
34
|
|
|
36
35
|
|
|
37
36
|
// src/sdk-client-toc-plugin.ts
|
|
@@ -40,28 +39,23 @@ var import_typedoc = require("typedoc");
|
|
|
40
39
|
|
|
41
40
|
// src/utils.ts
|
|
42
41
|
var import_path = require("path");
|
|
43
|
-
var isClientModel = /* @__PURE__ */ __name((model) => {
|
|
44
|
-
var _a, _b;
|
|
45
|
-
return (_b = (_a = model == null ? void 0 : model.sources) == null ? void 0 : _a[0]) == null ? void 0 : _b.fullFileName.includes(`${import_path.sep}clients${import_path.sep}`);
|
|
46
|
-
}, "isClientModel");
|
|
42
|
+
var isClientModel = /* @__PURE__ */ __name((model) => model?.sources?.[0]?.fullFileName.includes(`${import_path.sep}clients${import_path.sep}`), "isClientModel");
|
|
47
43
|
|
|
48
44
|
// src/sdk-client-toc-plugin.ts
|
|
49
|
-
var
|
|
45
|
+
var SdkClientTocPlugin = class {
|
|
50
46
|
constructor(options, logger, renderer) {
|
|
51
47
|
this.options = options;
|
|
52
48
|
this.logger = logger;
|
|
53
49
|
this.renderer = renderer;
|
|
54
|
-
this.changeLinksToLowerCase = (context) => {
|
|
50
|
+
this.changeLinksToLowerCase = /* @__PURE__ */ __name((context) => {
|
|
55
51
|
Object.keys(context.project.reflections).forEach((reflectionName) => {
|
|
56
52
|
context.project.reflections[reflectionName]._alias = context.project.reflections[reflectionName].getAlias().toLowerCase();
|
|
57
53
|
});
|
|
58
|
-
};
|
|
59
|
-
this.onEndResolve = (context) => {
|
|
60
|
-
|
|
61
|
-
if (!this.clientDir)
|
|
62
|
-
this.clientDir = this.loadClientDir(context.project);
|
|
54
|
+
}, "changeLinksToLowerCase");
|
|
55
|
+
this.onEndResolve = /* @__PURE__ */ __name((context) => {
|
|
56
|
+
if (!this.clientDir) this.clientDir = this.loadClientDir(context.project);
|
|
63
57
|
for (const model of Object.values(context.project.reflections)) {
|
|
64
|
-
const isEffectiveParent = model instanceof import_typedoc.ContainerReflection &&
|
|
58
|
+
const isEffectiveParent = model instanceof import_typedoc.ContainerReflection && model.children?.length || model.isProject();
|
|
65
59
|
if (!isEffectiveParent || model.kindOf(import_typedoc.ReflectionKind.SomeModule)) {
|
|
66
60
|
return;
|
|
67
61
|
}
|
|
@@ -79,14 +73,16 @@ var _SdkClientTocPlugin = class _SdkClientTocPlugin {
|
|
|
79
73
|
model.groups.splice(modulesIndex, 1);
|
|
80
74
|
}
|
|
81
75
|
}
|
|
82
|
-
};
|
|
76
|
+
}, "onEndResolve");
|
|
83
77
|
this.renderer.application.converter.on(import_typedoc.Converter.EVENT_END, this.changeLinksToLowerCase);
|
|
84
78
|
this.renderer.application.converter.on(import_typedoc.Converter.EVENT_RESOLVE_END, this.onEndResolve);
|
|
85
79
|
}
|
|
80
|
+
static {
|
|
81
|
+
__name(this, "SdkClientTocPlugin");
|
|
82
|
+
}
|
|
86
83
|
// Confirm declaration comes from the same folder as the client class
|
|
87
84
|
belongsToClientPackage(model) {
|
|
88
|
-
|
|
89
|
-
return this.clientDir && ((_a = model.sources) == null ? void 0 : _a[0].fullFileName.indexOf(this.clientDir)) === 0;
|
|
85
|
+
return this.clientDir && model.sources?.[0].fullFileName.indexOf(this.clientDir) === 0;
|
|
90
86
|
}
|
|
91
87
|
isClient(model) {
|
|
92
88
|
const { extendedTypes = [] } = model;
|
|
@@ -116,8 +112,7 @@ var _SdkClientTocPlugin = class _SdkClientTocPlugin {
|
|
|
116
112
|
*/
|
|
117
113
|
defineCategories(group, reflections) {
|
|
118
114
|
const categories = group.categories || [];
|
|
119
|
-
if (this.isCategorized(categories))
|
|
120
|
-
return group.categories;
|
|
115
|
+
if (this.isCategorized(categories)) return group.categories;
|
|
121
116
|
const clients = new import_typedoc.ReflectionCategory("Clients");
|
|
122
117
|
const commands = new import_typedoc.ReflectionCategory("Commands");
|
|
123
118
|
const paginators = new import_typedoc.ReflectionCategory("Paginators");
|
|
@@ -157,14 +152,12 @@ var _SdkClientTocPlugin = class _SdkClientTocPlugin {
|
|
|
157
152
|
return (0, import_path.dirname)((0, import_path.dirname)(fullFileName));
|
|
158
153
|
}
|
|
159
154
|
};
|
|
160
|
-
__name(_SdkClientTocPlugin, "SdkClientTocPlugin");
|
|
161
155
|
__decorateClass([
|
|
162
156
|
(0, import_typedoc.BindOption)("defaultGroup")
|
|
163
|
-
],
|
|
157
|
+
], SdkClientTocPlugin.prototype, "defaultGroup", 2);
|
|
164
158
|
__decorateClass([
|
|
165
159
|
(0, import_typedoc.BindOption)("defaultCategory")
|
|
166
|
-
],
|
|
167
|
-
var SdkClientTocPlugin = _SdkClientTocPlugin;
|
|
160
|
+
], SdkClientTocPlugin.prototype, "defaultCategory", 2);
|
|
168
161
|
|
|
169
162
|
// src/index.ts
|
|
170
163
|
function load(app) {
|
package/dist-types/index.d.ts
CHANGED
package/dist-types/utils.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@smithy/service-client-documentation-generator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types && yarn build:types:downlevel'",
|
|
6
6
|
"build:cjs": "node ../../scripts/inline service-client-documentation-generator",
|
|
7
7
|
"build:es": "yarn g:tsc -p tsconfig.es.json",
|
|
8
8
|
"build:types": "yarn g:tsc -p tsconfig.types.json",
|
|
9
|
-
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
|
|
9
|
+
"build:types:downlevel": "rimraf dist-types/ts3.4 && downlevel-dts dist-types dist-types/ts3.4",
|
|
10
10
|
"stage-release": "rimraf ./.release && yarn pack && mkdir ./.release && tar zxvf ./package.tgz --directory ./.release && rm ./package.tgz",
|
|
11
11
|
"clean": "rimraf ./dist-* && rimraf *.tsbuildinfo || exit 0",
|
|
12
12
|
"lint": "eslint -c ../../.eslintrc.js \"src/**/*.ts\"",
|
|
13
|
-
"format": "prettier --config ../../prettier.config.js --ignore-path
|
|
13
|
+
"format": "prettier --config ../../prettier.config.js --ignore-path ../../.prettierignore --write \"**/*.{ts,md,json}\"",
|
|
14
14
|
"test": "exit 0"
|
|
15
15
|
},
|
|
16
16
|
"main": "./dist-cjs/index.js",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"url": "https://aws.amazon.com/javascript/"
|
|
22
22
|
},
|
|
23
23
|
"license": "Apache-2.0",
|
|
24
|
+
"sideEffects": false,
|
|
24
25
|
"keywords": [
|
|
25
26
|
"typedocplugin"
|
|
26
27
|
],
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
"typedoc": "0.23.23"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|
|
32
|
-
"@types/node": "^
|
|
33
|
+
"@types/node": "^18.11.9",
|
|
33
34
|
"concurrently": "7.0.0",
|
|
34
35
|
"downlevel-dts": "0.10.1",
|
|
35
36
|
"rimraf": "3.0.2"
|
|
@@ -47,13 +48,16 @@
|
|
|
47
48
|
"files": [
|
|
48
49
|
"dist-*/**"
|
|
49
50
|
],
|
|
50
|
-
"homepage": "https://github.com/
|
|
51
|
+
"homepage": "https://github.com/smithy-lang/smithy-typescript/tree/main/packages/client-documentation-generator",
|
|
51
52
|
"repository": {
|
|
52
53
|
"type": "git",
|
|
53
|
-
"url": "https://github.com/
|
|
54
|
+
"url": "https://github.com/smithy-lang/smithy-typescript.git",
|
|
54
55
|
"directory": "packages/client-documentation-generator"
|
|
55
56
|
},
|
|
56
57
|
"publishConfig": {
|
|
57
58
|
"directory": ".release/package"
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=18.0.0"
|
|
58
62
|
}
|
|
59
63
|
}
|