Skip to content
This repository was archived by the owner on Feb 20, 2019. It is now read-only.

Commit fe1ed3d

Browse files
author
Lajos Gallay
committed
chore(Moved some constants out from the global scope closer to the usage (typedoc cleanup)):
1 parent 559352f commit fe1ed3d

9 files changed

Lines changed: 29 additions & 23 deletions

File tree

dist/index.js

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sn-fetch-types.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sn-fetch-types.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gulpfile.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ gulp.task('clean', function () {
1616

1717
gulp.task("typedoc", function () {
1818
return gulp
19-
.src(["src/**/*.ts", "!src/**/index.ts"])
19+
.src(["src/**/*.ts",
20+
// "!src/**/index.ts"
21+
])
2022
.pipe(typedoc({
2123
module: "commonjs",
2224
target: "es2015",

src/index.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ import { SnConfigModel } from "./utils/snconfig/snconfigmodel";
1212
/**
1313
* Entry point for the 'sn-client' command
1414
*/
15-
const CMD_INIT = 'init';
16-
const CMD_FETCH_TYPES = 'fetch-types';
17-
const CMD_HELP = 'help';
15+
const Start = async () => {
16+
17+
const CMD_INIT = 'init';
18+
const CMD_FETCH_TYPES = 'fetch-types';
19+
const CMD_HELP = 'help';
1820

19-
(async () => {
2021
await Initializer.Current.Init();
2122

2223
const initializer = Initializer.Current;
@@ -65,4 +66,6 @@ const CMD_HELP = 'help';
6566

6667
process.exit(0);
6768

68-
})();
69+
};
70+
71+
Start();

src/sn-fetch-types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import { Download } from "./utils/download";
77
* Executeable node.js file for fetching / updating pre-generated
88
* Typescript proxy classes from a Sense/Net Content Repository
99
*/
10-
11-
const SN_REPOSITORY_URL_POSTFIX = '/Root/System/Schema/Metadata/TypeScript/meta.zip';
1210
export async function DoFetchTypes(initializer: Initializer = Initializer.Current) {
1311
try {
12+
const SN_REPOSITORY_URL_POSTFIX = '/Root/System/Schema/Metadata/TypeScript/meta.zip';
13+
1414
console.log('Sn-Fetch-Types starting...');
1515
console.log('Checking sn.config.js...');
1616
const cfg = await initializer.SnConfigReader.ValidateAsync('RepositoryUrl', 'UserName', 'Password');

src/utils/snconfig/snconfigreader.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { SnConfigBehavior } from "./snconfigbehavior";
44
import { SnConfigFieldModelStore } from "./snconfigfieldmodelstore";
55
import { SnConfigModel } from "./snconfigmodel";
66

7-
const SN_CONFIG_NAME = 'sn.config.js';
8-
97
/**
108
* This class reads, verifies and extends a configuration file from the specified project directory.
119
*/
1210
export class SnConfigReader {
1311

12+
private readonly SN_CONFIG_NAME: string = 'sn.config.js';
13+
1414
public Config: SnConfigModel = new SnConfigModel();
1515

1616
/**
@@ -24,12 +24,12 @@ export class SnConfigReader {
2424
* @returns {Promise<any>} An awaitable promise that will be resolved when the
2525
* reading is completed or the new Config model is constructed.
2626
*/
27-
public async ReadConfigFile(fileName: string = SN_CONFIG_NAME): Promise<any> {
27+
public async ReadConfigFile(fileName: string = this.SN_CONFIG_NAME): Promise<any> {
2828
let cfg: SnConfigModel;
2929
try {
3030
cfg = require(this.projectDirectory + Path.sep + fileName);
3131
} catch (error) {
32-
console.log(`No '${SN_CONFIG_NAME}' file found in the project root.`);
32+
console.log(`No '${this.SN_CONFIG_NAME}' file found in the project root.`);
3333
cfg = new SnConfigModel();
3434
}
3535
this.Config = cfg;

0 commit comments

Comments
 (0)