namirasoft-sdk-generator 1.2.21 → 1.2.22

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.
@@ -1,4 +1,4 @@
1
- import { BaseNavigatorCommand } from "namirasoft-node-cli";
1
+ import { Application, BaseNavigatorCommand } from "namirasoft-node-cli";
2
2
  export declare class BuildCommand extends BaseNavigatorCommand {
3
- constructor(argv: string[]);
3
+ constructor(app: Application, argv: string[]);
4
4
  }
@@ -4,8 +4,8 @@ exports.BuildCommand = void 0;
4
4
  const namirasoft_node_cli_1 = require("namirasoft-node-cli");
5
5
  const BuildNPMCommand_1 = require("./BuildNPMCommand");
6
6
  class BuildCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
7
- constructor(argv) {
8
- super(argv, { "npm": BuildNPMCommand_1.BuildNPMCommand });
7
+ constructor(app, argv) {
8
+ super(app, argv, { "npm": BuildNPMCommand_1.BuildNPMCommand });
9
9
  }
10
10
  }
11
11
  exports.BuildCommand = BuildCommand;
@@ -1 +1 @@
1
- {"version":3,"file":"BuildCommand.js","sourceRoot":"","sources":["../../src/command/BuildCommand.ts"],"names":[],"mappings":";;;AAAA,6DAA2D;AAC3D,uDAAoD;AAEpD,MAAa,YAAa,SAAQ,0CAAoB;IAElD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,iCAAe,EAAE,CAAC,CAAC;IAC5C,CAAC;CACJ;AAND,oCAMC"}
1
+ {"version":3,"file":"BuildCommand.js","sourceRoot":"","sources":["../../src/command/BuildCommand.ts"],"names":[],"mappings":";;;AAAA,6DAAwE;AACxE,uDAAoD;AAEpD,MAAa,YAAa,SAAQ,0CAAoB;IAElD,YAAY,GAAgB,EAAE,IAAc;QAExC,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,iCAAe,EAAE,CAAC,CAAC;IACjD,CAAC;CACJ;AAND,oCAMC"}
@@ -16,9 +16,9 @@ class BuildNPMCommand extends namirasoft_node_cli_1.BaseCommand {
16
16
  run() {
17
17
  return __awaiter(this, void 0, void 0, function* () {
18
18
  if (this.argv.length != 2) {
19
- this.logger.info("The command format here is:");
20
- this.logger.info(" nsdkg build {platform name} {source directory} {destination directory}");
21
- this.logger.info(" nsdkg build npm . ./npm");
19
+ this.app.logger.info("The command format here is:");
20
+ this.app.logger.info(" nsdkg build {platform name} {source directory} {destination directory}");
21
+ this.app.logger.info(" nsdkg build npm . ./npm");
22
22
  process.exit(1);
23
23
  }
24
24
  let builder = new NPMBuilder_1.NPMBuilder(this.argv[0], this.argv[1]);
@@ -1 +1 @@
1
- {"version":3,"file":"BuildNPMCommand.js","sourceRoot":"","sources":["../../src/command/BuildNPMCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAkD;AAClD,0DAAuD;AAEvD,MAAa,eAAgB,SAAQ,iCAAW;IAE7B,GAAG;;YAEd,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EACzB;gBACI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;gBAChD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,4EAA4E,CAAC,CAAC;gBAC/F,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;gBAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACnB;YACD,IAAI,OAAO,GAAG,IAAI,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YACzD,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC;QACxB,CAAC;KAAA;CACJ;AAdD,0CAcC"}
1
+ {"version":3,"file":"BuildNPMCommand.js","sourceRoot":"","sources":["../../src/command/BuildNPMCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAkD;AAClD,0DAAuD;AAEvD,MAAa,eAAgB,SAAQ,iCAAW;IAE7B,GAAG;;YAEd,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EACzB;gBACI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;gBACpD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,4EAA4E,CAAC,CAAC;gBACnG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;gBACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACnB;YACD,IAAI,OAAO,GAAG,IAAI,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YACzD,MAAM,OAAO,CAAC,GAAG,EAAE,CAAC;QACxB,CAAC;KAAA;CACJ;AAdD,0CAcC"}
@@ -16,20 +16,20 @@ class GitCloneCommand extends namirasoft_node_cli_1.BaseCommand {
16
16
  run() {
17
17
  return __awaiter(this, void 0, void 0, function* () {
18
18
  if (this.argv.length != 2) {
19
- this.logger.info("The command format here is:");
20
- this.logger.info(" nsdkg git clone {url} {directory}");
19
+ this.app.logger.info("The command format here is:");
20
+ this.app.logger.info(" nsdkg git clone {url} {directory}");
21
21
  process.exit(1);
22
22
  }
23
- let { username, token } = this.storage.getCred();
23
+ let { username, token } = this.app.storage.getCred();
24
24
  if (!username || !token) {
25
- this.logger.info("Login is required before using clone.");
26
- this.logger.info(" nsdkg git login");
25
+ this.app.logger.info("Login is required before using clone.");
26
+ this.app.logger.info(" nsdkg git login");
27
27
  process.exit(1);
28
28
  }
29
29
  let command = `git clone https://${username}:${token}@${this.argv[0]} "${this.argv[1]}"`;
30
30
  let x = (0, child_process_1.execSync)(command, { encoding: 'utf-8' });
31
- this.logger.log(x);
32
- this.logger.log(" finished.");
31
+ this.app.logger.log(x);
32
+ this.app.logger.log(" finished.");
33
33
  });
34
34
  }
35
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GitCloneCommand.js","sourceRoot":"","sources":["../../src/command/GitCloneCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAAyC;AACzC,6DAAkD;AAGlD,MAAa,eAAgB,SAAQ,iCAAW;IAE7B,GAAG;;YAEd,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EACzB;gBACI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;gBAChD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;gBAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACnB;YACD,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAI,IAAI,CAAC,OAAmB,CAAC,OAAO,EAAE,CAAC;YAC9D,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK,EACvB;gBACI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;gBAC1D,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;gBACxC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACnB;YACD,IAAI,OAAO,GAAG,qBAAqB,QAAQ,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;YACzF,IAAI,CAAC,GAAG,IAAA,wBAAQ,EAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;YACjD,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACrC,CAAC;KAAA;CACJ;AAtBD,0CAsBC"}
1
+ {"version":3,"file":"GitCloneCommand.js","sourceRoot":"","sources":["../../src/command/GitCloneCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAAyC;AACzC,6DAAkD;AAGlD,MAAa,eAAgB,SAAQ,iCAAW;IAE7B,GAAG;;YAEd,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EACzB;gBACI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;gBACpD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;gBAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACnB;YACD,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAI,IAAI,CAAC,GAAG,CAAC,OAAmB,CAAC,OAAO,EAAE,CAAC;YAClE,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK,EACvB;gBACI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;gBAC9D,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;gBAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACnB;YACD,IAAI,OAAO,GAAG,qBAAqB,QAAQ,IAAI,KAAK,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;YACzF,IAAI,CAAC,GAAG,IAAA,wBAAQ,EAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;YACjD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACvB,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;QACzC,CAAC;KAAA;CACJ;AAtBD,0CAsBC"}
@@ -1,4 +1,4 @@
1
- import { BaseNavigatorCommand } from "namirasoft-node-cli";
1
+ import { Application, BaseNavigatorCommand } from "namirasoft-node-cli";
2
2
  export declare class GitCommand extends BaseNavigatorCommand {
3
- constructor(argv: string[]);
3
+ constructor(app: Application, argv: string[]);
4
4
  }
@@ -6,8 +6,8 @@ const GitCloneCommand_1 = require("./GitCloneCommand");
6
6
  const GitLoginCommand_1 = require("./GitLoginCommand");
7
7
  const GitLogoutCommand_1 = require("./GitLogoutCommand");
8
8
  class GitCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
9
- constructor(argv) {
10
- super(argv, { "login": GitLoginCommand_1.GitLoginCommand, "clone": GitCloneCommand_1.GitCloneCommand, "logout": GitLogoutCommand_1.GitLogoutCommand });
9
+ constructor(app, argv) {
10
+ super(app, argv, { "login": GitLoginCommand_1.GitLoginCommand, "clone": GitCloneCommand_1.GitCloneCommand, "logout": GitLogoutCommand_1.GitLogoutCommand });
11
11
  }
12
12
  }
13
13
  exports.GitCommand = GitCommand;
@@ -1 +1 @@
1
- {"version":3,"file":"GitCommand.js","sourceRoot":"","sources":["../../src/command/GitCommand.ts"],"names":[],"mappings":";;;AAAA,6DAA2D;AAC3D,uDAAoD;AACpD,uDAAoD;AACpD,yDAAsD;AAEtD,MAAa,UAAW,SAAQ,0CAAoB;IAEhD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,iCAAe,EAAE,OAAO,EAAE,iCAAe,EAAE,QAAQ,EAAE,mCAAgB,EAAE,CAAC,CAAC;IACpG,CAAC;CACJ;AAND,gCAMC"}
1
+ {"version":3,"file":"GitCommand.js","sourceRoot":"","sources":["../../src/command/GitCommand.ts"],"names":[],"mappings":";;;AAAA,6DAAwE;AACxE,uDAAoD;AACpD,uDAAoD;AACpD,yDAAsD;AAEtD,MAAa,UAAW,SAAQ,0CAAoB;IAEhD,YAAY,GAAgB,EAAE,IAAc;QAExC,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,iCAAe,EAAE,OAAO,EAAE,iCAAe,EAAE,QAAQ,EAAE,mCAAgB,EAAE,CAAC,CAAC;IACzG,CAAC;CACJ;AAND,gCAMC"}
@@ -1,5 +1,5 @@
1
- import { BaseNavigatorCommand } from "namirasoft-node-cli";
1
+ import { Application, BaseNavigatorCommand } from "namirasoft-node-cli";
2
2
  export declare class GitLoginCommand extends BaseNavigatorCommand {
3
- constructor(argv: string[]);
3
+ constructor(app: Application, argv: string[]);
4
4
  run(): Promise<void>;
5
5
  }
@@ -12,19 +12,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.GitLoginCommand = void 0;
13
13
  const namirasoft_node_cli_1 = require("namirasoft-node-cli");
14
14
  class GitLoginCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
15
- constructor(argv) {
16
- super(argv, {});
15
+ constructor(app, argv) {
16
+ super(app, argv, {});
17
17
  }
18
18
  run() {
19
19
  return __awaiter(this, void 0, void 0, function* () {
20
20
  if (this.argv.length != 2) {
21
- this.logger.info("The command format here is:");
22
- this.logger.info(" nsdkg git login {username} {token}");
21
+ this.app.logger.info("The command format here is:");
22
+ this.app.logger.info(" nsdkg git login {username} {token}");
23
23
  process.exit(1);
24
24
  }
25
25
  let username = this.argv[0];
26
26
  let token = this.argv[1];
27
- this.storage.setCred(username, token);
27
+ this.app.storage.setCred(username, token);
28
28
  });
29
29
  }
30
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GitLoginCommand.js","sourceRoot":"","sources":["../../src/command/GitLoginCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAA2D;AAG3D,MAAa,eAAgB,SAAQ,0CAAoB;IAErD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACpB,CAAC;IACc,GAAG;;YAEd,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EACzB;gBACI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;gBAChD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;gBAC3D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACnB;YACD,IAAI,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC5B,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,OAAmB,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACvD,CAAC;KAAA;CACJ;AAlBD,0CAkBC"}
1
+ {"version":3,"file":"GitLoginCommand.js","sourceRoot":"","sources":["../../src/command/GitLoginCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAwE;AAGxE,MAAa,eAAgB,SAAQ,0CAAoB;IAErD,YAAY,GAAgB,EAAE,IAAc;QAExC,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;IACzB,CAAC;IACc,GAAG;;YAEd,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EACzB;gBACI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;gBACpD,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;gBAC/D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACnB;YACD,IAAI,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC5B,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,CAAC,GAAG,CAAC,OAAmB,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QAC3D,CAAC;KAAA;CACJ;AAlBD,0CAkBC"}
@@ -1,5 +1,4 @@
1
- import { BaseNavigatorCommand } from "namirasoft-node-cli";
2
- export declare class GitLogoutCommand extends BaseNavigatorCommand {
3
- constructor(argv: string[]);
1
+ import { BaseCommand } from "namirasoft-node-cli";
2
+ export declare class GitLogoutCommand extends BaseCommand {
4
3
  run(): Promise<void>;
5
4
  }
@@ -11,13 +11,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.GitLogoutCommand = void 0;
13
13
  const namirasoft_node_cli_1 = require("namirasoft-node-cli");
14
- class GitLogoutCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
15
- constructor(argv) {
16
- super(argv, {});
17
- }
14
+ class GitLogoutCommand extends namirasoft_node_cli_1.BaseCommand {
18
15
  run() {
19
16
  return __awaiter(this, void 0, void 0, function* () {
20
- this.storage.delCred();
17
+ this.app.storage.delCred();
21
18
  });
22
19
  }
23
20
  }
@@ -1 +1 @@
1
- {"version":3,"file":"GitLogoutCommand.js","sourceRoot":"","sources":["../../src/command/GitLogoutCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAA2D;AAG3D,MAAa,gBAAiB,SAAQ,0CAAoB;IAEtD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACpB,CAAC;IACc,GAAG;;YAEb,IAAI,CAAC,OAAmB,CAAC,OAAO,EAAE,CAAC;QACxC,CAAC;KAAA;CACJ;AAVD,4CAUC"}
1
+ {"version":3,"file":"GitLogoutCommand.js","sourceRoot":"","sources":["../../src/command/GitLogoutCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6DAAkD;AAGlD,MAAa,gBAAiB,SAAQ,iCAAW;IAE9B,GAAG;;YAEb,IAAI,CAAC,GAAG,CAAC,OAAmB,CAAC,OAAO,EAAE,CAAC;QAC5C,CAAC;KAAA;CACJ;AAND,4CAMC"}
package/dist/index.js CHANGED
@@ -5,6 +5,11 @@ const namirasoft_node_cli_1 = require("namirasoft-node-cli");
5
5
  const BuildCommand_1 = require("./command/BuildCommand");
6
6
  const GitCommand_1 = require("./command/GitCommand");
7
7
  const Storage_1 = require("./Storage");
8
- let app = new namirasoft_node_cli_1.Application(new Storage_1.Storage(), { "build": BuildCommand_1.BuildCommand, "git": GitCommand_1.GitCommand });
8
+ let currentDir = __dirname;
9
+ const rootDir = process.cwd();
10
+ console.log({ currentDir, rootDir });
11
+ let json = require("../../package.json");
12
+ console.log(json);
13
+ let app = new namirasoft_node_cli_1.Application(new Storage_1.Storage("ns-sdkg"), { "build": BuildCommand_1.BuildCommand, "git": GitCommand_1.GitCommand });
9
14
  app.run();
10
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,6DAAkD;AAClD,yDAAsD;AACtD,qDAAkD;AAClD,uCAAoC;AACpC,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,IAAI,iBAAO,EAAE,EAAE,EAAE,OAAO,EAAE,2BAAY,EAAE,KAAK,EAAE,uBAAU,EAAE,CAAC,CAAC;AACvF,GAAG,CAAC,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,6DAAkD;AAClD,yDAAsD;AACtD,qDAAkD;AAClD,uCAAoC;AAEpC,IAAI,UAAU,GAAW,SAAS,CAAC;AACnC,MAAM,OAAO,GAAW,OAAO,CAAC,GAAG,EAAE,CAAC;AACtC,OAAO,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAC;AACrC,IAAI,IAAI,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;AACzC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAElB,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,IAAI,iBAAO,CAAC,SAAS,CAAC,EAAE,EAAE,OAAO,EAAE,2BAAY,EAAE,KAAK,EAAE,uBAAU,EAAE,CAAC,CAAC;AAChG,GAAG,CAAC,GAAG,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "namirasoft-sdk-generator",
3
3
  "description": "Namira Software Corporation SDK Generator NPM Package",
4
- "version": "1.2.21",
4
+ "version": "1.2.22",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "scripts": {},
@@ -14,7 +14,7 @@
14
14
  "@types/node": "^20.11.25",
15
15
  "axios": "^1.6.7",
16
16
  "namirasoft-log": "^1.2.0",
17
- "namirasoft-node-cli": "^1.2.1",
17
+ "namirasoft-node-cli": "^1.2.3",
18
18
  "namirasoft-schema": "^1.2.16"
19
19
  }
20
20
  }
@@ -1,10 +1,10 @@
1
- import { BaseNavigatorCommand } from "namirasoft-node-cli";
1
+ import { Application, BaseNavigatorCommand } from "namirasoft-node-cli";
2
2
  import { BuildNPMCommand } from "./BuildNPMCommand";
3
3
 
4
4
  export class BuildCommand extends BaseNavigatorCommand
5
5
  {
6
- constructor(argv: string[])
6
+ constructor(app: Application, argv: string[])
7
7
  {
8
- super(argv, { "npm": BuildNPMCommand });
8
+ super(app, argv, { "npm": BuildNPMCommand });
9
9
  }
10
10
  }
@@ -7,9 +7,9 @@ export class BuildNPMCommand extends BaseCommand
7
7
  {
8
8
  if (this.argv.length != 2)
9
9
  {
10
- this.logger.info("The command format here is:");
11
- this.logger.info(" nsdkg build {platform name} {source directory} {destination directory}");
12
- this.logger.info(" nsdkg build npm . ./npm");
10
+ this.app.logger.info("The command format here is:");
11
+ this.app.logger.info(" nsdkg build {platform name} {source directory} {destination directory}");
12
+ this.app.logger.info(" nsdkg build npm . ./npm");
13
13
  process.exit(1);
14
14
  }
15
15
  let builder = new NPMBuilder(this.argv[0], this.argv[1]);
@@ -8,20 +8,20 @@ export class GitCloneCommand extends BaseCommand
8
8
  {
9
9
  if (this.argv.length != 2)
10
10
  {
11
- this.logger.info("The command format here is:");
12
- this.logger.info(" nsdkg git clone {url} {directory}");
11
+ this.app.logger.info("The command format here is:");
12
+ this.app.logger.info(" nsdkg git clone {url} {directory}");
13
13
  process.exit(1);
14
14
  }
15
- let { username, token } = (this.storage as Storage).getCred();
15
+ let { username, token } = (this.app.storage as Storage).getCred();
16
16
  if (!username || !token)
17
17
  {
18
- this.logger.info("Login is required before using clone.");
19
- this.logger.info(" nsdkg git login");
18
+ this.app.logger.info("Login is required before using clone.");
19
+ this.app.logger.info(" nsdkg git login");
20
20
  process.exit(1);
21
21
  }
22
22
  let command = `git clone https://${username}:${token}@${this.argv[0]} "${this.argv[1]}"`;
23
23
  let x = execSync(command, { encoding: 'utf-8' });
24
- this.logger.log(x);
25
- this.logger.log(" finished.");
24
+ this.app.logger.log(x);
25
+ this.app.logger.log(" finished.");
26
26
  }
27
27
  }
@@ -1,12 +1,12 @@
1
- import { BaseNavigatorCommand } from "namirasoft-node-cli";
1
+ import { Application, BaseNavigatorCommand } from "namirasoft-node-cli";
2
2
  import { GitCloneCommand } from "./GitCloneCommand";
3
3
  import { GitLoginCommand } from "./GitLoginCommand";
4
4
  import { GitLogoutCommand } from "./GitLogoutCommand";
5
5
 
6
6
  export class GitCommand extends BaseNavigatorCommand
7
7
  {
8
- constructor(argv: string[])
8
+ constructor(app: Application, argv: string[])
9
9
  {
10
- super(argv, { "login": GitLoginCommand, "clone": GitCloneCommand, "logout": GitLogoutCommand });
10
+ super(app, argv, { "login": GitLoginCommand, "clone": GitCloneCommand, "logout": GitLogoutCommand });
11
11
  }
12
12
  }
@@ -1,22 +1,22 @@
1
- import { BaseNavigatorCommand } from "namirasoft-node-cli";
1
+ import { Application, BaseNavigatorCommand } from "namirasoft-node-cli";
2
2
  import { Storage } from "../Storage";
3
3
 
4
4
  export class GitLoginCommand extends BaseNavigatorCommand
5
5
  {
6
- constructor(argv: string[])
6
+ constructor(app: Application, argv: string[])
7
7
  {
8
- super(argv, {});
8
+ super(app, argv, {});
9
9
  }
10
10
  override async run()
11
11
  {
12
12
  if (this.argv.length != 2)
13
13
  {
14
- this.logger.info("The command format here is:");
15
- this.logger.info(" nsdkg git login {username} {token}");
14
+ this.app.logger.info("The command format here is:");
15
+ this.app.logger.info(" nsdkg git login {username} {token}");
16
16
  process.exit(1);
17
17
  }
18
18
  let username = this.argv[0];
19
19
  let token = this.argv[1];
20
- (this.storage as Storage).setCred(username, token);
20
+ (this.app.storage as Storage).setCred(username, token);
21
21
  }
22
22
  }
@@ -1,14 +1,10 @@
1
- import { BaseNavigatorCommand } from "namirasoft-node-cli";
1
+ import { BaseCommand } from "namirasoft-node-cli";
2
2
  import { Storage } from "../Storage";
3
3
 
4
- export class GitLogoutCommand extends BaseNavigatorCommand
4
+ export class GitLogoutCommand extends BaseCommand
5
5
  {
6
- constructor(argv: string[])
7
- {
8
- super(argv, {});
9
- }
10
6
  override async run()
11
7
  {
12
- (this.storage as Storage).delCred();
8
+ (this.app.storage as Storage).delCred();
13
9
  }
14
10
  }
package/src/index.ts CHANGED
@@ -3,5 +3,12 @@ import { Application } from "namirasoft-node-cli";
3
3
  import { BuildCommand } from "./command/BuildCommand";
4
4
  import { GitCommand } from "./command/GitCommand";
5
5
  import { Storage } from "./Storage";
6
- let app = new Application(new Storage(), { "build": BuildCommand, "git": GitCommand });
6
+
7
+ let currentDir: string = __dirname;
8
+ const rootDir: string = process.cwd();
9
+ console.log({ currentDir, rootDir });
10
+ let json = require("../../package.json");
11
+ console.log(json);
12
+
13
+ let app = new Application(new Storage("ns-sdkg"), { "build": BuildCommand, "git": GitCommand });
7
14
  app.run();