Skip to content

Commit f7aa890

Browse files
committed
chore(docs): rename @Private to @internal
The latter is understood by TypeScript's --stripInternal option, so this lets us rely more on the tooling provided by typescript team.
1 parent 4a36fd8 commit f7aa890

38 files changed

+98
-94
lines changed

docs/typescript-definition-package/processors/code_gen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ DtsSerializer.prototype = {
4949
},
5050

5151
member: function(buffer, ast) {
52-
if (ast.private) return;
52+
if (ast.private || ast.internal) return;
5353

5454
buffer.push('\n');
5555
this.comment(buffer, ast.content);

docs/typescript-definition-package/processors/createTypeDefinitionFile.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@ describe('createTypeDefinitionFile processor', function() {
2525

2626

2727

28-
describe('classes with private constructors', function() {
29-
28+
describe('classes with @internal constructors', function() {
29+
3030
it('should convert heritage from `implements` into `extends`', function() {
31-
31+
3232
// Create some mock docs for testing
3333
var docs = [
3434
{
3535
id: 'angular2/angular2',
3636
exports: [
37-
{ docType: 'class', heritage: 'implements Xyz', constructorDoc: { private: true } }
37+
{ docType: 'class', heritage: 'implements Xyz', constructorDoc: { internal: true } }
3838
]
3939
}
4040
];
4141

4242
docs = processor.$process(docs);
43-
43+
4444
expect(docs.length).toEqual(1);
4545
expect(docs[0].docType).toEqual('type-definition');
4646

@@ -49,5 +49,5 @@ describe('createTypeDefinitionFile processor', function() {
4949
expect(moduleDoc.exports[0].heritage).toEqual('extends Xyz');
5050
});
5151
});
52-
52+
5353
});

docs/typescript-package/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
var basePackage = require('dgeni-packages/base');
2+
var jsdocPackage = require('dgeni-packages/jsdoc');
23
var Package = require('dgeni').Package;
34
var path = require('canonical-path');
45

56
// Define the dgeni package for generating the docs
6-
module.exports = new Package('typescript-parsing', [basePackage])
7+
module.exports = new Package('typescript-parsing', [basePackage, jsdocPackage])
78

89
// Register the services and file readers
910
.factory(require('./services/modules'))
@@ -37,6 +38,9 @@ module.exports = new Package('typescript-parsing', [basePackage])
3738
log.level = 'warn';
3839
})
3940

41+
.config(function(parseTagsProcessor) {
42+
parseTagsProcessor.tagDefinitions.push({ name: 'internal', transforms: function() { return true; } });
43+
})
4044

4145
// Configure ids and paths
4246
.config(function(computeIdsProcessor, computePathsProcessor, EXPORT_DOC_TYPES) {

docs/typescript-package/services/convertPrivateClassesToInterfaces.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ module.exports = function convertPrivateClassesToInterfaces() {
44
return function(exportDocs, addInjectableReference) {
55
_.forEach(exportDocs, function(exportDoc) {
66

7-
// Search for classes with a constructor marked as `@private`
8-
if (exportDoc.docType === 'class' && exportDoc.constructorDoc && exportDoc.constructorDoc.private) {
7+
// Search for classes with a constructor marked as `@internal`
8+
if (exportDoc.docType === 'class' && exportDoc.constructorDoc && exportDoc.constructorDoc.internal) {
99

1010
// Convert this class to an interface with no constructor
1111
exportDoc.docType = 'interface';

docs/typescript-package/services/convertPrivateClassesToInterfaces.spec.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ describe('readTypeScriptModules', function() {
1111
convertPrivateClassesToInterfaces = injector.get('convertPrivateClassesToInterfaces');
1212
});
1313

14-
it('should convert private class docs to interface docs', function() {
14+
it('should convert @internal class docs to interface docs', function() {
1515
var docs = [
1616
{
1717
docType: 'class',
1818
name: 'privateClass',
1919
id: 'privateClass',
20-
constructorDoc: { private: true }
20+
constructorDoc: { internal: true }
2121
}
2222
];
2323
convertPrivateClassesToInterfaces(docs, false);
2424
expect(docs[0].docType).toEqual('interface');
2525
});
2626

2727

28-
it('should not touch non-private class docs', function() {
28+
it('should not touch non-internal class docs', function() {
2929
var docs = [
3030
{
3131
docType: 'class',
@@ -45,7 +45,7 @@ describe('readTypeScriptModules', function() {
4545
docType: 'class',
4646
name: 'privateClass',
4747
id: 'privateClass',
48-
constructorDoc: { private: true },
48+
constructorDoc: { internal: true },
4949
heritage: 'implements parentInterface'
5050
}
5151
];
@@ -60,7 +60,7 @@ describe('readTypeScriptModules', function() {
6060
docType: 'class',
6161
name: 'privateClass',
6262
id: 'privateClass',
63-
constructorDoc: { private: true },
63+
constructorDoc: { internal: true },
6464
heritage: 'implements parentInterface'
6565
}
6666
];

modules/angular2/src/core/application_ref.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export function createNgZone(): NgZone {
113113
var _platform: PlatformRef;
114114

115115
/**
116-
* @private
116+
* @internal
117117
*/
118118
export function platformCommon(bindings?: Array<Type | Binding | any[]>, initializer?: () => void):
119119
PlatformRef {
@@ -145,12 +145,12 @@ export function platformCommon(bindings?: Array<Type | Binding | any[]>, initial
145145
*/
146146
export class PlatformRef {
147147
/**
148-
* @private
148+
* @internal
149149
*/
150150
_applications: ApplicationRef[] = [];
151151

152152
/**
153-
* @private
153+
* @internal
154154
*/
155155
constructor(private _injector: Injector, private _dispose: () => void) {}
156156

@@ -251,7 +251,7 @@ export class PlatformRef {
251251
}
252252

253253
/**
254-
* @private
254+
* @internal
255255
*/
256256
_applicationDisposed(app: ApplicationRef): void { ListWrapper.remove(this._applications, app); }
257257
}
@@ -266,7 +266,7 @@ export class ApplicationRef {
266266
private _rootComponents: ComponentRef[] = [];
267267

268268
/**
269-
* @private
269+
* @internal
270270
*/
271271
constructor(private _platform: PlatformRef, private _zone: NgZone, private _injector: Injector) {}
272272

modules/angular2/src/core/application_tokens.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {OpaqueToken, Binding} from 'angular2/src/core/di';
22
import {CONST_EXPR, Math, StringWrapper} from 'angular2/src/core/facade/lang';
33

44
/**
5-
* @private
5+
* @internal
66
*/
77
export const APP_COMPONENT_REF_PROMISE = CONST_EXPR(new OpaqueToken('Promise<ComponentRef>'));
88

modules/angular2/src/core/change_detection/change_detector_ref.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {ChangeDetectionStrategy} from './constants';
66
*/
77
export class ChangeDetectorRef {
88
/**
9-
* @private
9+
* @internal
1010
*/
1111
constructor(private _cd: ChangeDetector) {}
1212

modules/angular2/src/core/change_detection/parser/locals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {BaseException} from 'angular2/src/core/facade/exceptions';
33
import {ListWrapper, MapWrapper} from 'angular2/src/core/facade/collection';
44

55
/**
6-
* @private
6+
* @internal
77
*/
88
export class Locals {
99
constructor(public parent: Locals, public current: Map<any, any>) {}

modules/angular2/src/core/compiler/runtime_compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {Promise, PromiseWrapper} from 'angular2/src/core/facade/async';
1010
@Injectable()
1111
export class RuntimeCompiler extends Compiler {
1212
/**
13-
* @private
13+
* @internal
1414
*/
1515
constructor(_protoViewFactory: ProtoViewFactory, private _templateCompiler: TemplateCompiler) {
1616
super(_protoViewFactory);

0 commit comments

Comments
 (0)