@ng-doc/builder 18.2.0 → 18.3.1
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/helpers/repo-link.d.ts +2 -2
- package/helpers/repo-link.js +18 -4
- package/helpers/repo-link.js.map +1 -1
- package/interfaces/repo-config.d.ts +5 -0
- package/package.json +5 -5
- package/types/index.d.ts +1 -0
- package/types/index.js +1 -0
- package/types/index.js.map +1 -1
- package/types/supported-platforms.d.ts +1 -0
- package/types/supported-platforms.js +3 -0
- package/types/supported-platforms.js.map +1 -0
package/helpers/repo-link.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { NgDocRepoConfig } from '../interfaces';
|
|
|
8
8
|
* @param scope
|
|
9
9
|
* @param lineNumber
|
|
10
10
|
*/
|
|
11
|
-
export declare function editFileInRepoUrl({ url, mainBranch }: NgDocRepoConfig, filePath: string, scope: string, lineNumber?: number): string;
|
|
11
|
+
export declare function editFileInRepoUrl({ url, mainBranch, platform }: NgDocRepoConfig, filePath: string, scope: string, lineNumber?: number): string;
|
|
12
12
|
/**
|
|
13
13
|
*
|
|
14
14
|
* @param repoConfig
|
|
@@ -17,4 +17,4 @@ export declare function editFileInRepoUrl({ url, mainBranch }: NgDocRepoConfig,
|
|
|
17
17
|
* @param filePath
|
|
18
18
|
* @param lineNumber
|
|
19
19
|
*/
|
|
20
|
-
export declare function viewFileInRepoUrl({ url, releaseBranch }: NgDocRepoConfig, filePath: string, lineNumber?: number): string;
|
|
20
|
+
export declare function viewFileInRepoUrl({ url, releaseBranch, platform }: NgDocRepoConfig, filePath: string, lineNumber?: number): string;
|
package/helpers/repo-link.js
CHANGED
|
@@ -12,11 +12,18 @@ const posix_1 = require("./posix");
|
|
|
12
12
|
* @param scope
|
|
13
13
|
* @param lineNumber
|
|
14
14
|
*/
|
|
15
|
-
function editFileInRepoUrl({ url, mainBranch }, filePath, scope, lineNumber) {
|
|
15
|
+
function editFileInRepoUrl({ url, mainBranch, platform = 'github' }, filePath, scope, lineNumber) {
|
|
16
16
|
if (url && mainBranch) {
|
|
17
17
|
const rUrl = url.replace(/\/$/, '');
|
|
18
18
|
const fPath = (0, posix_1.posix)(filePath).replace(/^\//, '');
|
|
19
|
-
|
|
19
|
+
let editUrl = '';
|
|
20
|
+
if (platform === 'github') {
|
|
21
|
+
editUrl = `${rUrl}/edit/${mainBranch}/${fPath}?message=docs(${scope}): describe your changes here...${lineNumber ? `#L${lineNumber}` : ''}`;
|
|
22
|
+
}
|
|
23
|
+
else if (platform === 'gitlab') {
|
|
24
|
+
editUrl = `${rUrl}/-/edit/${mainBranch}/${fPath}?message=docs(${scope}): describe your changes here...${lineNumber ? `#L${lineNumber}` : ''}`;
|
|
25
|
+
}
|
|
26
|
+
return editUrl;
|
|
20
27
|
}
|
|
21
28
|
return filePath;
|
|
22
29
|
}
|
|
@@ -28,11 +35,18 @@ function editFileInRepoUrl({ url, mainBranch }, filePath, scope, lineNumber) {
|
|
|
28
35
|
* @param filePath
|
|
29
36
|
* @param lineNumber
|
|
30
37
|
*/
|
|
31
|
-
function viewFileInRepoUrl({ url, releaseBranch }, filePath, lineNumber) {
|
|
38
|
+
function viewFileInRepoUrl({ url, releaseBranch, platform = 'github' }, filePath, lineNumber) {
|
|
32
39
|
if (url && releaseBranch) {
|
|
33
40
|
const rUrl = url.replace(/\/$/, '');
|
|
34
41
|
const fPath = (0, posix_1.posix)(filePath).replace(/^\//, '');
|
|
35
|
-
|
|
42
|
+
let viewUrl = '';
|
|
43
|
+
if (platform === 'github') {
|
|
44
|
+
viewUrl = `${rUrl}/blob/${releaseBranch}/${fPath}${lineNumber ? `#L${lineNumber}` : ''}`;
|
|
45
|
+
}
|
|
46
|
+
else if (platform === 'gitlab') {
|
|
47
|
+
viewUrl = `${rUrl}/-/blob/${releaseBranch}/${fPath}${lineNumber ? `#L${lineNumber}` : ''}`;
|
|
48
|
+
}
|
|
49
|
+
return viewUrl;
|
|
36
50
|
}
|
|
37
51
|
return filePath;
|
|
38
52
|
}
|
package/helpers/repo-link.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo-link.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/repo-link.ts"],"names":[],"mappings":";;AAYA,
|
|
1
|
+
{"version":3,"file":"repo-link.js","sourceRoot":"","sources":["../../../../libs/builder/helpers/repo-link.ts"],"names":[],"mappings":";;AAYA,8CAyBC;AAUD,8CAoBC;AAlED,mCAAgC;AAEhC;;;;;;;;GAQG;AACH,SAAgB,iBAAiB,CAC7B,EAAE,GAAG,EAAE,UAAU,EAAE,QAAQ,GAAG,QAAQ,EAAmB,EACzD,QAAgB,EAChB,KAAa,EACb,UAAmB;IAEnB,IAAI,GAAG,IAAI,UAAU,EAAE,CAAC;QACpB,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACpC,MAAM,KAAK,GAAG,IAAA,aAAK,EAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,OAAO,GAAG,EAAE,CAAC;QAEjB,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACxB,OAAO,GAAG,GAAG,IAAI,SAAS,UAAU,IAAI,KAAK,iBAAiB,KAAK,mCAC/D,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC,CAAC,CAAC,EACrC,EAAE,CAAC;QACP,CAAC;aAAM,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,GAAG,GAAG,IAAI,WAAW,UAAU,IAAI,KAAK,iBAAiB,KAAK,mCACjE,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC,CAAC,CAAC,EACrC,EAAE,CAAC;QACP,CAAC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAC7B,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,GAAG,QAAQ,EAAmB,EAC5D,QAAgB,EAChB,UAAmB;IAEnB,IAAI,GAAG,IAAI,aAAa,EAAE,CAAC;QACvB,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACpC,MAAM,KAAK,GAAG,IAAA,aAAK,EAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI,OAAO,GAAG,EAAE,CAAC;QAEjB,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACxB,OAAO,GAAG,GAAG,IAAI,SAAS,aAAa,IAAI,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7F,CAAC;aAAM,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC/B,OAAO,GAAG,GAAG,IAAI,WAAW,aAAa,IAAI,KAAK,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC/F,CAAC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NgDocPlatform } from '../types';
|
|
1
2
|
/**
|
|
2
3
|
* The repository configuration interface.
|
|
3
4
|
*/
|
|
@@ -14,4 +15,8 @@ export interface NgDocRepoConfig {
|
|
|
14
15
|
* The release branch name (e.g. "release"), uses to generate correct links for the "View source" button
|
|
15
16
|
*/
|
|
16
17
|
releaseBranch: string;
|
|
18
|
+
/**
|
|
19
|
+
* The platform name (e.g. "github"/"gitlab")
|
|
20
|
+
*/
|
|
21
|
+
platform?: NgDocPlatform;
|
|
17
22
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ng-doc/builder",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.3.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"builders": "./builders.json",
|
|
6
6
|
"schematics": "./schematics/collection.json",
|
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
]
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@ng-doc/core": "18.
|
|
15
|
-
"@ng-doc/utils": "18.
|
|
16
|
-
"@angular-devkit/architect": ">=0.1801.0",
|
|
17
|
-
"@angular-devkit/build-angular": ">=18.1.0",
|
|
14
|
+
"@ng-doc/core": "18.3.1",
|
|
15
|
+
"@ng-doc/utils": "18.3.1",
|
|
16
|
+
"@angular-devkit/architect": ">=0.1801.0 < 0.1900.0",
|
|
17
|
+
"@angular-devkit/build-angular": ">= 18.1.0 < 19.0.0",
|
|
18
18
|
"chokidar": "3.5.3",
|
|
19
19
|
"minimatch": "9.0.1",
|
|
20
20
|
"rxjs": "^7.0.0",
|
package/types/index.d.ts
CHANGED
package/types/index.js
CHANGED
|
@@ -6,4 +6,5 @@ tslib_1.__exportStar(require("./artifact-processor"), exports);
|
|
|
6
6
|
tslib_1.__exportStar(require("./component-asset"), exports);
|
|
7
7
|
tslib_1.__exportStar(require("./constructable"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./supported-declaration"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./supported-platforms"), exports);
|
|
9
10
|
//# sourceMappingURL=index.js.map
|
package/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/builder/types/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,+DAAqC;AACrC,4DAAkC;AAClC,0DAAgC;AAChC,kEAAwC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/builder/types/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,+DAAqC;AACrC,4DAAkC;AAClC,0DAAgC;AAChC,kEAAwC;AACxC,gEAAsC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type NgDocPlatform = 'github' | 'gitlab';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supported-platforms.js","sourceRoot":"","sources":["../../../../libs/builder/types/supported-platforms.ts"],"names":[],"mappings":""}
|