Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit 71ced7d

Browse files
Revert "fix(ng-doc/component-groups-generate processor): use path/outputPath specified in processing.api-docs"
This reverts commit f2c3776. This caused a breaking change to the code, which is not wanted in 0.9.x branch. The feature can be achieved without a breaking change.
1 parent 7afe937 commit 71ced7d

File tree

2 files changed

+2
-49
lines changed

2 files changed

+2
-49
lines changed

ngdoc/processors/component-groups-generate.js

+2-8
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ module.exports = {
1313
throw new Error('Invalid configuration. You must provide config.rendering.contentsFolder');
1414
}
1515

16-
var apiConfig = config.get('processing.api-docs');
17-
if ( !apiConfig ) {
18-
throw new Error('Invalid configuration. You must provide config.processing.api-docs');
19-
}
20-
2116
_.forEach(moduleMap, function(module) {
2217

2318
_(module.components)
@@ -27,7 +22,6 @@ module.exports = {
2722
delete docTypes.overview;
2823
})
2924
.map(function(docs, docType) {
30-
var templateParams = { area: module.area, module: module.name, docType: docType, name: 'index'};
3125
return {
3226
id: module.id + '.' + docType,
3327
docType: 'componentGroup',
@@ -36,8 +30,8 @@ module.exports = {
3630
moduleDoc: module,
3731
area: module.area,
3832
components: docs,
39-
outputPath: path.join(partialsPath, _.template(apiConfig.outputPath, templateParams)),
40-
path: _.template(apiConfig.path, templateParams)
33+
outputPath: path.join(partialsPath, _.template('${module.area}/${module.name}/${docType}/index.html', { module: module, docType: docType })),
34+
path: _.template('${module.area}/${module.name}/${docType}', { module: module, docType: docType })
4135
};
4236
})
4337
.tap(function(groups) {

ngdoc/spec/processors/component-groups-generate.spec.js

-41
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ var processor = require('../../processors/component-groups-generate');
33
var Config = require('dgeni').Config;
44

55
describe("component-groups processor", function() {
6-
76
it("should create a new doc for each group of components (by docType) in each module", function() {
87
var docs = [];
98
var modules = [{
@@ -21,48 +20,8 @@ describe("component-groups processor", function() {
2120

2221
config = new Config();
2322
config.set('rendering.contentsFolder', 'partials');
24-
config.set('processing.api-docs', {
25-
outputPath: '${area}/${module}/${docType}/${name}.html',
26-
path: '${area}/${module}/${docType}/${name}'
27-
});
28-
2923
processor.process(docs, config, modules);
3024

3125
expect(docs.length).toEqual(2);
32-
33-
});
34-
35-
36-
it("should use the outputPath and path specified in processing.api-docs", function() {
37-
var docs = [];
38-
var modules = [{
39-
id: 'mod1',
40-
name: 'test',
41-
area: 'api-docs',
42-
components: [
43-
{ docType: 'a', id: 'a1' },
44-
{ docType: 'a', id: 'a2' },
45-
{ docType: 'a', id: 'a3' },
46-
{ docType: 'a', id: 'a4' },
47-
{ docType: 'b', id: 'b1' },
48-
{ docType: 'b', id: 'b2' },
49-
{ docType: 'b', id: 'a3' }
50-
]
51-
}];
52-
53-
config = new Config();
54-
config.set('rendering.contentsFolder', 'partials');
55-
config.set('processing.api-docs', {
56-
outputPath: '${area}/${module}/${docType}/${name}.html',
57-
path: '${area}/${module}/${docType}/${name}'
58-
});
59-
60-
processor.process(docs, config, modules);
61-
62-
expect(docs[0].path).toBe('api-docs/test/a/index');
63-
expect(docs[0].outputPath).toBe('partials/api-docs/test/a/index.html');
64-
6526
});
66-
67-
6827
});

0 commit comments

Comments
 (0)