@darraghor/nest-backend-libs 2.3.0 → 2.5.0
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/dist/cli/cli.js
CHANGED
|
@@ -6,10 +6,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
require("reflect-metadata");
|
|
8
8
|
const yargs_1 = __importDefault(require("yargs"));
|
|
9
|
+
const WriteApiClientCommand_1 = require("./commands/WriteApiClientCommand");
|
|
9
10
|
const WriteTypeOrmConfigCommand_1 = require("./commands/WriteTypeOrmConfigCommand");
|
|
10
11
|
void yargs_1.default
|
|
11
12
|
.usage("Usage: $0 <command> [options]")
|
|
12
13
|
.command(new WriteTypeOrmConfigCommand_1.WriteTypeOrmConfigCommand())
|
|
14
|
+
.command(new WriteApiClientCommand_1.WriteApiClientCommand())
|
|
13
15
|
.recommendCommands()
|
|
14
16
|
.demandCommand(1)
|
|
15
17
|
.strict()
|
package/dist/cli/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";;;;;;AACA,4BAA0B;AAC1B,kDAA0B;AAC1B,oFAA+E;AAE/E,KAAK,eAAK;KACL,KAAK,CAAC,+BAA+B,CAAC;KACtC,OAAO,CAAC,IAAI,qDAAyB,EAAE,CAAC;KACxC,iBAAiB,EAAE;KACnB,aAAa,CAAC,CAAC,CAAC;KAChB,MAAM,EAAE;KACR,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC;KACrB,IAAI,CAAC,GAAG,CAAC;KACT,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":";;;;;;AACA,4BAA0B;AAC1B,kDAA0B;AAC1B,4EAAuE;AACvE,oFAA+E;AAE/E,KAAK,eAAK;KACL,KAAK,CAAC,+BAA+B,CAAC;KACtC,OAAO,CAAC,IAAI,qDAAyB,EAAE,CAAC;KACxC,OAAO,CAAC,IAAI,6CAAqB,EAAE,CAAC;KACpC,iBAAiB,EAAE;KACnB,aAAa,CAAC,CAAC,CAAC;KAChB,MAAM,EAAE;KACR,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC;KACrB,IAAI,CAAC,GAAG,CAAC;KACT,KAAK,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as yargs from "yargs";
|
|
2
|
+
/**
|
|
3
|
+
* Generates a new migration file with sql needs to be executed to update schema.
|
|
4
|
+
*/
|
|
5
|
+
type ArgumentsType = {
|
|
6
|
+
fePath: string;
|
|
7
|
+
itPath: string;
|
|
8
|
+
packageName: string;
|
|
9
|
+
};
|
|
10
|
+
export declare class WriteApiClientCommand implements yargs.CommandModule<ArgumentsType, ArgumentsType> {
|
|
11
|
+
command: string;
|
|
12
|
+
describe: string;
|
|
13
|
+
builder(args: yargs.Argv): yargs.Argv<{
|
|
14
|
+
fePath: string;
|
|
15
|
+
} & {
|
|
16
|
+
itPath: string;
|
|
17
|
+
} & {
|
|
18
|
+
packageName: string;
|
|
19
|
+
}>;
|
|
20
|
+
handler(args: yargs.ArgumentsCamelCase<ArgumentsType>): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.WriteApiClientCommand = void 0;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
// eslint-disable-next-line unicorn/import-style
|
|
9
|
+
const util_1 = __importDefault(require("util"));
|
|
10
|
+
class WriteApiClientCommand {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.command = "api:write-client";
|
|
13
|
+
this.describe = "Generates a new api client and installs it into frontend and integration test apps.";
|
|
14
|
+
}
|
|
15
|
+
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
16
|
+
builder(args) {
|
|
17
|
+
return args
|
|
18
|
+
.option("fePath", {
|
|
19
|
+
type: "string",
|
|
20
|
+
default: "../../apps/frontend",
|
|
21
|
+
describe: "The relative path to the frontend app.",
|
|
22
|
+
})
|
|
23
|
+
.option("itPath", {
|
|
24
|
+
type: "string",
|
|
25
|
+
default: "../../apps/backend-e2e",
|
|
26
|
+
describe: "The relative path to the integration test app.",
|
|
27
|
+
})
|
|
28
|
+
.option("packageName", {
|
|
29
|
+
type: "string",
|
|
30
|
+
demandOption: true,
|
|
31
|
+
describe: "The name of package being created",
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
async handler(
|
|
35
|
+
// eslint-disable-next-line unicorn/prevent-abbreviations
|
|
36
|
+
args) {
|
|
37
|
+
// call the script
|
|
38
|
+
const execPromise = util_1.default.promisify(child_process_1.exec);
|
|
39
|
+
const commandArguments = [args.fePath, args.itPath, args.packageName];
|
|
40
|
+
const result = await execPromise(`../../open-api-generation/generate.sh ${commandArguments.join(" ")}`);
|
|
41
|
+
console.log(result.stdout);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.WriteApiClientCommand = WriteApiClientCommand;
|
|
45
|
+
//# sourceMappingURL=WriteApiClientCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WriteApiClientCommand.js","sourceRoot":"","sources":["../../../src/cli/commands/WriteApiClientCommand.ts"],"names":[],"mappings":";;;;;;AAEA,iDAAmC;AACnC,gDAAgD;AAChD,gDAAwB;AAQxB,MAAa,qBAAqB;IAAlC;QAGI,YAAO,GAAG,kBAAkB,CAAC;QAC7B,aAAQ,GACJ,qFAAqF,CAAC;IAsC9F,CAAC;IApCG,yDAAyD;IACzD,OAAO,CAAC,IAAgB;QACpB,OAAO,IAAI;aACN,MAAM,CAAC,QAAQ,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,qBAAqB;YAC9B,QAAQ,EAAE,wCAAwC;SACrD,CAAC;aACD,MAAM,CAAC,QAAQ,EAAE;YACd,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,wBAAwB;YACjC,QAAQ,EAAE,gDAAgD;SAC7D,CAAC;aACD,MAAM,CAAC,aAAa,EAAE;YACnB,IAAI,EAAE,QAAQ;YACd,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,mCAAmC;SAChD,CAAC,CAAC;IACX,CAAC;IAED,KAAK,CAAC,OAAO;IACT,yDAAyD;IACzD,IAA6C;QAE7C,kBAAkB;QAElB,MAAM,WAAW,GAAG,cAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;QACzC,MAAM,gBAAgB,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACtE,MAAM,MAAM,GAAG,MAAM,WAAW,CAC5B,yCAAyC,gBAAgB,CAAC,IAAI,CAC1D,GAAG,CACN,EAAE,CACN,CAAC;QAEF,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,CAAC;CACJ;AA3CD,sDA2CC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@darraghor/nest-backend-libs",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"description": "Some helpers for personal projects in nestjs",
|
|
6
6
|
"homepage": "https://github.com/darraghoriordan/nest-backend-libs",
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
],
|
|
29
29
|
"bin": {
|
|
30
30
|
"miller": "dist/cli/cli.js",
|
|
31
|
-
"write-db-config": "dist/database-postgres/write-typeorm-config.js",
|
|
32
31
|
"generate-client": "dist/open-api-generation/generate.sh"
|
|
33
32
|
},
|
|
34
33
|
"scripts": {
|