@onivoro/onix 20.0.42 → 20.0.44

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onivoro/onix",
3
- "version": "20.0.42",
3
+ "version": "20.0.44",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./src/index.d.ts",
@@ -1,3 +1,3 @@
1
- import { DeployLambdaConfig } from "onix/src/functions/deploy-lambda.function";
1
+ import { DeployLambdaConfig } from "../../functions/deploy-lambda.function";
2
2
 
3
3
  export interface ExecutorSchema extends Omit<DeployLambdaConfig, 'sourcePath'> { }
@@ -1,4 +1,3 @@
1
- import { PromiseExecutor } from '@nx/devkit';
2
1
  import { ExecutorSchema } from './schema';
3
- declare const runExecutor: PromiseExecutor<ExecutorSchema>;
4
- export default runExecutor;
2
+ declare const _default: import("@nx/devkit").PromiseExecutor<ExecutorSchema>;
3
+ export default _default;
@@ -4,23 +4,14 @@ const tslib_1 = require("tslib");
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const child_process_1 = require("child_process");
6
6
  const load_env_file_function_1 = require("../../functions/load-env-file.function");
7
- const runExecutor = (options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
7
+ const executor_factory_function_1 = require("../../functions/executor-factory.function");
8
+ exports.default = (0, executor_factory_function_1.executorFactory)((options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
9
  const { debugPort, envFile } = options;
9
- try {
10
- (0, load_env_file_function_1.loadEnvFile)(envFile);
11
- const inspectStatement = debugPort ? `--port=${debugPort}` : '';
12
- const command = `npx nx run ${context.projectName}:serve ${inspectStatement}`;
13
- devkit_1.logger.debug(command);
14
- (0, child_process_1.execSync)(command, { stdio: 'inherit' });
15
- return {
16
- success: true,
17
- };
18
- }
19
- catch (error) {
20
- return {
21
- success: false,
22
- };
23
- }
24
- });
25
- exports.default = runExecutor;
10
+ (0, load_env_file_function_1.loadEnvFile)(envFile);
11
+ const inspectStatement = debugPort ? `--port=${debugPort}` : '';
12
+ const command = `npx nx run ${context.projectName}:serve ${inspectStatement}`;
13
+ devkit_1.logger.debug(command);
14
+ const [program, ...args] = command.split(' ');
15
+ (0, child_process_1.spawnSync)(program, args, { stdio: 'inherit' });
16
+ }));
26
17
  //# sourceMappingURL=executor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/local/executor.ts"],"names":[],"mappings":";;;AAAA,uCAIoB;AACpB,iDAAyC;AAEzC,mFAAqE;AAErE,MAAM,WAAW,GAAoC,CACnD,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEvC,IAAI,CAAC;QACH,IAAA,oCAAW,EAAC,OAAO,CAAC,CAAC;QAErB,MAAM,gBAAgB,GAAG,SAAS,CAAC,CAAC,CAAC,UAAU,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,MAAM,OAAO,GAAG,cAAc,OAAO,CAAC,WAAW,UAAU,gBAAgB,EAAE,CAAC;QAC9E,eAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtB,IAAA,wBAAQ,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAExC,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,CAAA;AAED,kBAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/local/executor.ts"],"names":[],"mappings":";;;AAAA,uCAGoB;AACpB,iDAA0C;AAE1C,mFAAqE;AACrE,yFAA4E;AAE5E,kBAAe,IAAA,2CAAe,EAAC,CAC7B,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IAEvC,IAAA,oCAAW,EAAC,OAAO,CAAC,CAAC;IAErB,MAAM,gBAAgB,GAAG,SAAS,CAAC,CAAC,CAAC,UAAU,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAEhE,MAAM,OAAO,GAAG,cAAc,OAAO,CAAC,WAAW,UAAU,gBAAgB,EAAE,CAAC;IAE9E,eAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAEtB,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAE9C,IAAA,yBAAS,EAAC,OAAO,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;AACjD,CAAC,CAAA,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { ExecutorContext, PromiseExecutor } from "@nx/devkit";
2
+ export type TOnixPromiseExecutor<TExecutorSchema = any> = (options: TExecutorSchema, context: ExecutorContext) => Promise<void | {
3
+ success: boolean;
4
+ }>;
5
+ export declare function executorFactory<TExecutorSchema>(executor: TOnixPromiseExecutor<TExecutorSchema>): PromiseExecutor<TExecutorSchema>;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executorFactory = executorFactory;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nx/devkit");
6
+ function executorFactory(executor) {
7
+ const runExecutor = (options, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
8
+ try {
9
+ return (yield executor(options, context)) || { success: true };
10
+ }
11
+ catch (error) {
12
+ devkit_1.logger.error((error === null || error === void 0 ? void 0 : error.message) || error);
13
+ return {
14
+ success: false,
15
+ };
16
+ }
17
+ });
18
+ return runExecutor;
19
+ }
20
+ //# sourceMappingURL=executor-factory.function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor-factory.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/executor-factory.function.ts"],"names":[],"mappings":";;AAOA,0CAkBC;;AAzBD,uCAAsE;AAOtE,SAAgB,eAAe,CAAkB,QAA+C;IAE5F,MAAM,WAAW,GAAqC,CAClD,OAAwB,EACxB,OAAwB,EAC1B,EAAE;QACA,IAAI,CAAC;YACD,OAAO,CAAC,MAAM,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QACnE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,eAAM,CAAC,KAAK,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,KAAI,KAAK,CAAC,CAAC;YAEtC,OAAO;gBACH,OAAO,EAAE,KAAK;aACjB,CAAC;QACN,CAAC;IACL,CAAC,CAAA,CAAA;IAED,OAAO,WAAW,CAAC;AACvB,CAAC"}
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loadEnvFile = loadEnvFile;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const fs_1 = require("fs");
6
+ const process_1 = require("process");
6
7
  function loadEnvFile(envFile) {
7
8
  if (envFile) {
8
9
  if ((0, fs_1.existsSync)(envFile)) {
9
- loadEnvFile(envFile);
10
+ (0, process_1.loadEnvFile)(envFile);
10
11
  }
11
12
  else {
12
13
  devkit_1.logger.warn(`specified environment path "${envFile}" does not exist`);
@@ -1 +1 @@
1
- {"version":3,"file":"load-env-file.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/load-env-file.function.ts"],"names":[],"mappings":";;AAGA,kCAQC;AAXD,uCAAoC;AACpC,2BAAgC;AAEhC,SAAgB,WAAW,CAAC,OAAe;IACvC,IAAI,OAAO,EAAE,CAAC;QACV,IAAG,IAAA,eAAU,EAAC,OAAO,CAAC,EAAE,CAAC;YACrB,WAAW,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;aAAM,CAAC;YACJ,eAAM,CAAC,IAAI,CAAC,+BAA+B,OAAO,kBAAkB,CAAC,CAAC;QAC1E,CAAC;IACL,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"load-env-file.function.js","sourceRoot":"","sources":["../../../../onix/src/functions/load-env-file.function.ts"],"names":[],"mappings":";;AAIA,kCAQC;AAZD,uCAAoC;AACpC,2BAAgC;AAChC,qCAAyD;AAEzD,SAAgB,WAAW,CAAC,OAAe;IACvC,IAAI,OAAO,EAAE,CAAC;QACV,IAAG,IAAA,eAAU,EAAC,OAAO,CAAC,EAAE,CAAC;YACrB,IAAA,qBAAe,EAAC,OAAO,CAAC,CAAC;QAC7B,CAAC;aAAM,CAAC;YACJ,eAAM,CAAC,IAAI,CAAC,+BAA+B,OAAO,kBAAkB,CAAC,CAAC;QAC1E,CAAC;IACL,CAAC;AACL,CAAC"}
package/src/index.d.ts CHANGED
@@ -1,14 +1,15 @@
1
1
  export { playwrightConfig } from './utils/playwright.config';
2
2
  export * from './types/onix-config.type';
3
3
  export * from './plugins/plugin';
4
+ export * from './functions/executor-factory.function';
5
+ export * from './functions/extract-project-build-outputs.function';
6
+ export * from './functions/extract-project-configuration.function';
7
+ export * from './functions/load-env-file.function';
8
+ export * from './functions/normalize-output-path.function';
4
9
  export * from './inference/add-docker-target.function';
5
10
  export * from './inference/add-docker-targets.function';
6
11
  export * from './inference/add-serve-target.function';
7
12
  export * from './inference/add-serve-targets.function';
8
13
  export * from './inference/build-onix-targets.function';
9
- export * from './functions/extract-project-build-outputs.function';
10
- export * from './functions/extract-project-configuration.function';
11
- export * from './functions/load-env-file.function';
12
- export * from './functions/normalize-output-path.function';
13
14
  export * from './inference/read-targets-cache.function';
14
15
  export * from './inference/write-targets-to-cache.function';
package/src/index.js CHANGED
@@ -6,15 +6,16 @@ var playwright_config_1 = require("./utils/playwright.config");
6
6
  Object.defineProperty(exports, "playwrightConfig", { enumerable: true, get: function () { return playwright_config_1.playwrightConfig; } });
7
7
  tslib_1.__exportStar(require("./types/onix-config.type"), exports);
8
8
  tslib_1.__exportStar(require("./plugins/plugin"), exports);
9
+ tslib_1.__exportStar(require("./functions/executor-factory.function"), exports);
10
+ tslib_1.__exportStar(require("./functions/extract-project-build-outputs.function"), exports);
11
+ tslib_1.__exportStar(require("./functions/extract-project-configuration.function"), exports);
12
+ tslib_1.__exportStar(require("./functions/load-env-file.function"), exports);
13
+ tslib_1.__exportStar(require("./functions/normalize-output-path.function"), exports);
9
14
  tslib_1.__exportStar(require("./inference/add-docker-target.function"), exports);
10
15
  tslib_1.__exportStar(require("./inference/add-docker-targets.function"), exports);
11
16
  tslib_1.__exportStar(require("./inference/add-serve-target.function"), exports);
12
17
  tslib_1.__exportStar(require("./inference/add-serve-targets.function"), exports);
13
18
  tslib_1.__exportStar(require("./inference/build-onix-targets.function"), exports);
14
- tslib_1.__exportStar(require("./functions/extract-project-build-outputs.function"), exports);
15
- tslib_1.__exportStar(require("./functions/extract-project-configuration.function"), exports);
16
- tslib_1.__exportStar(require("./functions/load-env-file.function"), exports);
17
- tslib_1.__exportStar(require("./functions/normalize-output-path.function"), exports);
18
19
  tslib_1.__exportStar(require("./inference/read-targets-cache.function"), exports);
19
20
  tslib_1.__exportStar(require("./inference/write-targets-to-cache.function"), exports);
20
21
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../onix/src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAA6D;AAApD,qHAAA,gBAAgB,OAAA;AAEzB,mEAAyC;AAEzC,2DAAiC;AAEjC,iFAAuD;AACvD,kFAAwD;AACxD,gFAAsD;AACtD,iFAAuD;AACvD,kFAAwD;AACxD,6FAAmE;AACnE,6FAAmE;AACnE,6EAAmD;AACnD,qFAA2D;AAC3D,kFAAwD;AACxD,sFAA4D"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../onix/src/index.ts"],"names":[],"mappings":";;;;AAAA,+DAA6D;AAApD,qHAAA,gBAAgB,OAAA;AAEzB,mEAAyC;AAEzC,2DAAiC;AAEjC,gFAAsD;AACtD,6FAAmE;AACnE,6FAAmE;AACnE,6EAAmD;AACnD,qFAA2D;AAE3D,iFAAuD;AACvD,kFAAwD;AACxD,gFAAsD;AACtD,iFAAuD;AACvD,kFAAwD;AACxD,kFAAwD;AACxD,sFAA4D"}