@onivoro/onix 20.0.44 → 20.0.46

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/executors.json CHANGED
@@ -25,10 +25,10 @@
25
25
  "schema": "./src/executors/deploy-ecs/schema.json",
26
26
  "description": "deploy-ecs"
27
27
  },
28
- "gen-axios": {
29
- "implementation": "./src/executors/gen/executor",
30
- "schema": "./src/executors/gen/schema.json",
31
- "description": "gen-axios"
28
+ "openapi-gen": {
29
+ "implementation": "./src/executors/openapi-gen/executor",
30
+ "schema": "./src/executors/openapi-gen/schema.json",
31
+ "description": "openapi-gen"
32
32
  },
33
33
  "local": {
34
34
  "implementation": "./src/executors/local/executor",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onivoro/onix",
3
- "version": "20.0.44",
3
+ "version": "20.0.46",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./src/index.d.ts",
@@ -1,4 +1,3 @@
1
- import { PromiseExecutor } from '@nx/devkit';
2
1
  import { ExecutorSchema } from './schema';
3
- declare const executor: PromiseExecutor<ExecutorSchema>;
4
- export default executor;
2
+ declare const _default: import("@nx/devkit").PromiseExecutor<ExecutorSchema>;
3
+ export default _default;
@@ -3,22 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const child_process_1 = require("child_process");
6
- const executor = (options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
7
- const { envPath, ecr, port } = options;
6
+ const executor_factory_function_1 = require("../../functions/executor-factory.function");
7
+ exports.default = (0, executor_factory_function_1.executorFactory)((options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
+ const { envFile, ecr, port } = options;
8
9
  const localPort = (Number(port) + 2000);
9
- try {
10
- const command = `open http://localhost:${localPort} & docker run -p ${localPort}:${port} --env="PORT=${port}" --env-file "${envPath}" "${ecr}"`;
11
- devkit_1.logger.info(command);
12
- (0, child_process_1.execSync)(command);
13
- return {
14
- success: true,
15
- };
16
- }
17
- catch (error) {
18
- return {
19
- success: false,
20
- };
21
- }
22
- });
23
- exports.default = executor;
10
+ const command = `open http://localhost:${localPort} & docker run -p ${localPort}:${port} --env="PORT=${port}" --env-file "${envFile}" "${ecr}"`;
11
+ devkit_1.logger.info(command);
12
+ (0, child_process_1.execSync)(command);
13
+ }));
24
14
  //# sourceMappingURL=executor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/docker/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAsE;AAEtE,iDAAsD;AAEtD,MAAM,QAAQ,GAAoC,CAChD,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACvC,MAAM,SAAS,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IACxC,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,yBAAyB,SAAS,oBAAoB,SAAS,IAAI,IAAI,gBAAgB,IAAI,iBAAiB,OAAO,MAAM,GAAG,GAAG,CAAC;QAEhJ,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAErB,IAAA,wBAAQ,EAAC,OAAO,CAAC,CAAC;QAElB,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,OAAO,EAAE,KAAK;SACf,CAAC;IACJ,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/docker/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAqD;AAErD,iDAAyC;AACzC,yFAA4E;AAE5E,kBAAe,IAAA,2CAAe,EAAC,CAC7B,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;IACvC,MAAM,SAAS,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;IAExC,MAAM,OAAO,GAAG,yBAAyB,SAAS,oBAAoB,SAAS,IAAI,IAAI,gBAAgB,IAAI,iBAAiB,OAAO,MAAM,GAAG,GAAG,CAAC;IAEhJ,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAErB,IAAA,wBAAQ,EAAC,OAAO,CAAC,CAAC;AACpB,CAAC,CAAA,CAAC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export interface ExecutorSchema {
2
- envPath: string;
2
+ envFile: string;
3
3
  ecr: string;
4
+ localPort?: number;
4
5
  port: number;
5
6
  }
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/schema",
3
3
  "version": 2,
4
- "title": "Db executor",
4
+ "title": "Docker executor",
5
5
  "description": "",
6
6
  "type": "object",
7
7
  "properties": {
8
- "envPath": {
8
+ "envFile": {
9
9
  "type": "string",
10
10
  "description": "Path and name of the .env file to load"
11
11
  },
@@ -13,12 +13,16 @@
13
13
  "type": "string",
14
14
  "description": "Name of the ECR repository and tag (conventionally separated by a colon)"
15
15
  },
16
+ "localPort": {
17
+ "type": "number",
18
+ "description": "Local port to bind to localhost"
19
+ },
16
20
  "port": {
17
- "type": "string",
21
+ "type": "number",
18
22
  "description": "Port docker port to bind to localhost"
19
23
  }
20
24
  },
21
25
  "required": [
22
- "envPath", "ecr", "port"
26
+ "envFile", "ecr", "port"
23
27
  ]
24
28
  }
@@ -0,0 +1,3 @@
1
+ import { ExecutorSchema } from './schema';
2
+ declare const _default: import("@nx/devkit").PromiseExecutor<ExecutorSchema>;
3
+ export default _default;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const child_process_1 = require("child_process");
5
+ const executor_factory_function_1 = require("../../functions/executor-factory.function");
6
+ exports.default = (0, executor_factory_function_1.executorFactory)((_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ flavor = 'typescript-axios', openapiJsonPath, outputPath }) {
7
+ (0, child_process_1.execSync)(`rm -rf ${outputPath}`, { stdio: 'inherit' });
8
+ (0, child_process_1.execSync)(`mkdir -p ${outputPath}`, { stdio: 'inherit' });
9
+ (0, child_process_1.execSync)(`docker run --rm -v .:/local openapitools/openapi-generator-cli:v6.3.0 generate -i local/${openapiJsonPath} -g ${flavor} -o local/${outputPath}`, { stdio: 'inherit' });
10
+ }));
11
+ //# sourceMappingURL=executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/openapi-gen/executor.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AACzC,yFAA4E;AAG5E,kBAAe,IAAA,2CAAe,EAAC,KAAqF,EAAE,oDAAhF,EAAE,MAAM,GAAG,kBAAkB,EAAE,eAAe,EAAE,UAAU,EAAkB;IAChH,IAAA,wBAAQ,EAAC,UAAU,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACvD,IAAA,wBAAQ,EAAC,YAAY,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IACzD,IAAA,wBAAQ,EAAC,2FAA2F,eAAe,OAAO,MAAM,aAAa,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AACnL,CAAC,CAAA,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export interface ExecutorSchema {
2
+ flavor?: string;
3
+ openapiJsonPath: string;
4
+ outputPath: string;
5
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "title": "Openapi-gen executor",
5
+ "description": "",
6
+ "type": "object",
7
+ "properties": {
8
+ "flavor": {
9
+ "type": "string",
10
+ "description": "Lowercase identifier corresponding to one of the predefined openapi generator target formats. Defaults to 'typescript-axios'."
11
+ },
12
+ "openapiJsonPath": {
13
+ "type": "string",
14
+ "description": "Path to the openapi definition JSON file (or yml file)."
15
+ },
16
+ "outputPath": {
17
+ "type": "string",
18
+ "description": "Path where the output of the openapi will be written."
19
+ }
20
+ },
21
+ "required": [
22
+ "openapiJsonPath",
23
+ "outputPath"
24
+ ]
25
+ }
@@ -1,4 +0,0 @@
1
- import { PromiseExecutor } from '@nx/devkit';
2
- import { ExecutorSchema } from './schema';
3
- declare const runExecutor: PromiseExecutor<ExecutorSchema>;
4
- export default runExecutor;
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const child_process_1 = require("child_process");
5
- const runExecutor = (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ moniker }) {
6
- try {
7
- (0, child_process_1.execSync)(`rm -rf libs/axios/${moniker}/src/lib`, { stdio: 'inherit' });
8
- (0, child_process_1.execSync)(`mkdir -p libs/axios/${moniker}`, { stdio: 'inherit' });
9
- (0, child_process_1.execSync)(`docker run --rm -v .:/local openapitools/openapi-generator-cli:v6.3.0 generate -i local/api-dox/app-api-${moniker}.json -g typescript-axios -o local/libs/axios/${moniker}/src/lib`, { stdio: 'inherit' });
10
- return {
11
- success: true,
12
- };
13
- }
14
- catch (error) {
15
- return { success: false };
16
- }
17
- });
18
- exports.default = runExecutor;
19
- //# sourceMappingURL=executor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/gen/executor.ts"],"names":[],"mappings":";;;AAEA,iDAAyC;AAEzC,MAAM,WAAW,GAAoC,KAAoB,EAAE,oDAAf,EAAE,OAAO,EAAE;IACrE,IAAI,CAAC;QACH,IAAA,wBAAQ,EAAC,qBAAqB,OAAO,UAAU,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACvE,IAAA,wBAAQ,EAAC,uBAAuB,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACjE,IAAA,wBAAQ,EAAC,2GAA2G,OAAO,iDAAiD,OAAO,UAAU,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAErN,OAAO;YACL,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC,CAAA,CAAC;AAEF,kBAAe,WAAW,CAAC"}
@@ -1,3 +0,0 @@
1
- export interface ExecutorSchema {
2
- moniker: string;
3
- }
@@ -1,14 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/schema",
3
- "version": 2,
4
- "title": "Gen executor",
5
- "description": "",
6
- "type": "object",
7
- "properties": {
8
- "moniker": {
9
- "type": "string",
10
- "description": "Lowercase single-word identifier used to consistently distinguish related projects and libraries"
11
- }
12
- },
13
- "required": []
14
- }