@docfy/ember 0.4.5 → 0.4.6
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/index.js +15 -0
- package/package.json +3 -2
- package/src/index.ts +16 -0
package/lib/index.js
CHANGED
|
@@ -24,6 +24,7 @@ const core_1 = __importDefault(require("@docfy/core"));
|
|
|
24
24
|
const docfy_output_template_1 = __importDefault(require("./docfy-output-template"));
|
|
25
25
|
const get_config_1 = __importDefault(require("./get-config"));
|
|
26
26
|
const utils_1 = require("./plugins/utils");
|
|
27
|
+
const calculate_cache_key_for_tree_1 = __importDefault(require("calculate-cache-key-for-tree"));
|
|
27
28
|
const debug_1 = __importDefault(require("debug"));
|
|
28
29
|
const debug = debug_1.default('@docfy/ember');
|
|
29
30
|
const templateOnlyComponent = `
|
|
@@ -108,6 +109,20 @@ module.exports = {
|
|
|
108
109
|
}
|
|
109
110
|
this._super.included.apply(this, args);
|
|
110
111
|
},
|
|
112
|
+
// Re-enables caching of this addon, due to opting out
|
|
113
|
+
// of the caching implicitly by specifying treeFor* methods
|
|
114
|
+
cacheKeyForTree(treeType) {
|
|
115
|
+
switch (treeType) {
|
|
116
|
+
case 'app': {
|
|
117
|
+
const sources = this.docfyConfig.sources
|
|
118
|
+
.map((item) => item.root)
|
|
119
|
+
.join(',');
|
|
120
|
+
return calculate_cache_key_for_tree_1.default(treeType, this, [sources]);
|
|
121
|
+
}
|
|
122
|
+
default:
|
|
123
|
+
return calculate_cache_key_for_tree_1.default(treeType, this);
|
|
124
|
+
}
|
|
125
|
+
},
|
|
111
126
|
treeForApp(tree) {
|
|
112
127
|
const trees = [this._super.treeForApp.call(this, tree)];
|
|
113
128
|
if (isDeepAddonInstance(this)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docfy/ember",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"description": "Ember integration with Docfy",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"broccoli-node-api": "^1.7.0",
|
|
39
39
|
"broccoli-plugin": "^4.0.3",
|
|
40
40
|
"broccoli-source": "^3.0.0",
|
|
41
|
+
"calculate-cache-key-for-tree": "2.0.0",
|
|
41
42
|
"debug": "^4.3.1",
|
|
42
43
|
"ember-cli-babel": "^7.23.1",
|
|
43
44
|
"ember-cli-htmlbars": "^5.3.1",
|
|
@@ -121,5 +122,5 @@
|
|
|
121
122
|
"prember"
|
|
122
123
|
]
|
|
123
124
|
},
|
|
124
|
-
"gitHead": "
|
|
125
|
+
"gitHead": "e062ebaf86b5508cb2096de069ed054829f58eb9"
|
|
125
126
|
}
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { DemoComponentChunk } from './plugins/types';
|
|
|
13
13
|
import docfyOutputTemplate from './docfy-output-template';
|
|
14
14
|
import getDocfyConfig from './get-config';
|
|
15
15
|
import { isDemoComponents } from './plugins/utils';
|
|
16
|
+
import cacheKeyForTree from 'calculate-cache-key-for-tree';
|
|
16
17
|
import debugFactory from 'debug';
|
|
17
18
|
const debug = debugFactory('@docfy/ember');
|
|
18
19
|
|
|
@@ -134,6 +135,21 @@ module.exports = {
|
|
|
134
135
|
this._super.included.apply(this, args);
|
|
135
136
|
},
|
|
136
137
|
|
|
138
|
+
// Re-enables caching of this addon, due to opting out
|
|
139
|
+
// of the caching implicitly by specifying treeFor* methods
|
|
140
|
+
cacheKeyForTree(treeType: string): string {
|
|
141
|
+
switch (treeType) {
|
|
142
|
+
case 'app': {
|
|
143
|
+
const sources = (this.docfyConfig as DocfyConfig).sources
|
|
144
|
+
.map((item) => item.root)
|
|
145
|
+
.join(',');
|
|
146
|
+
return cacheKeyForTree(treeType, this, [sources]);
|
|
147
|
+
}
|
|
148
|
+
default:
|
|
149
|
+
return cacheKeyForTree(treeType, this);
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
|
|
137
153
|
treeForApp(tree: Node): Node {
|
|
138
154
|
const trees: Node[] = [this._super.treeForApp.call(this, tree)];
|
|
139
155
|
if (isDeepAddonInstance(this)) {
|