@onivoro/onix 20.0.0 → 20.0.1

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
@@ -5,10 +5,10 @@
5
5
  "schema": "./src/executors/build-cli/schema.json",
6
6
  "description": "build-cli"
7
7
  },
8
- "orm": {
9
- "implementation": "./src/executors/db/executor",
10
- "schema": "./src/executors/db/schema.json",
11
- "description": "db"
8
+ "typeorm": {
9
+ "implementation": "./src/executors/typeorm/executor",
10
+ "schema": "./src/executors/typeorm/schema.json",
11
+ "description": "typeorm"
12
12
  },
13
13
  "docker-run": {
14
14
  "implementation": "./src/executors/docker/executor",
@@ -30,6 +30,11 @@
30
30
  "schema": "./src/executors/local/schema.json",
31
31
  "description": "serve-locally"
32
32
  },
33
+ "lee": {
34
+ "implementation": "./src/executors/lee/executor",
35
+ "schema": "./src/executors/lee/schema.json",
36
+ "description": "lee"
37
+ },
33
38
  "playwright": {
34
39
  "implementation": "./src/executors/playwright/executor",
35
40
  "schema": "./src/executors/playwright/schema.json",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onivoro/onix",
3
- "version": "20.0.0",
3
+ "version": "20.0.1",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
6
  "typings": "./src/index.d.ts",
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ const promises_1 = require("fs/promises");
6
+ const executor = (options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
7
+ try {
8
+ const wl = (0, devkit_1.workspaceLayout)();
9
+ const to = (0, devkit_1.readTargetOptions)({ project: context.projectName, target: context.targetName }, context);
10
+ yield (0, promises_1.writeFile)(`lee-${Date.now()}`, JSON.stringify({
11
+ options,
12
+ context,
13
+ workspaceLayout: wl,
14
+ targetOptions: to,
15
+ }, null, 2));
16
+ return {
17
+ success: true,
18
+ };
19
+ }
20
+ catch (error) {
21
+ return {
22
+ success: false,
23
+ };
24
+ }
25
+ });
26
+ exports.default = executor;
27
+ //# sourceMappingURL=executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/lee/executor.ts"],"names":[],"mappings":";;;AAAA,uCAMoB;AAEpB,0CAAwC;AAExC,MAAM,QAAQ,GAAoC,CAChD,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,IAAA,wBAAe,GAAE,CAAC;QAC7B,MAAM,EAAE,GAAG,IAAA,0BAAiB,EAAC,EAAE,OAAO,EAAE,OAAO,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC;QAEpG,MAAM,IAAA,oBAAS,EAAC,OAAO,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC;YAClD,OAAO;YACP,OAAO;YACP,eAAe,EAAE,EAAE;YACnB,aAAa,EAAE,EAAE;SAClB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAEb,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"}
@@ -0,0 +1 @@
1
+ export interface ExecutorSchema {}
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json-schema.org/schema",
3
+ "version": 2,
4
+ "title": "Lee executor",
5
+ "description": "",
6
+ "type": "object",
7
+ "properties": {},
8
+ "required": []
9
+ }
@@ -0,0 +1,4 @@
1
+ import { PromiseExecutor } from '@nx/devkit';
2
+ import { ExecutorSchema } from './schema';
3
+ declare const executor: PromiseExecutor<ExecutorSchema>;
4
+ export default executor;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tslib_1 = require("tslib");
4
+ const devkit_1 = require("@nx/devkit");
5
+ const child_process_1 = require("child_process");
6
+ const process_1 = require("process");
7
+ const executor = (options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
8
+ const { envPath, ormConfigPath, runOrRevert } = options;
9
+ try {
10
+ if (envPath) {
11
+ devkit_1.logger.info(`using "${envPath}"`);
12
+ (0, process_1.loadEnvFile)(envPath);
13
+ }
14
+ (0, child_process_1.execSync)(`npm run typeorm -- -d ${ormConfigPath} migration:${runOrRevert} -t=false`, { stdio: 'inherit' });
15
+ return {
16
+ success: true,
17
+ };
18
+ }
19
+ catch (error) {
20
+ return {
21
+ success: false,
22
+ };
23
+ }
24
+ });
25
+ exports.default = executor;
26
+ //# sourceMappingURL=executor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/typeorm/executor.ts"],"names":[],"mappings":";;;AAAA,uCAAsE;AAEtE,iDAAyC;AACzC,qCAAsC;AAEtC,MAAM,QAAQ,GAAoC,CAChD,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAGxD,IAAI,CAAC;QACH,IAAG,OAAO,EAAE,CAAC;YACX,eAAM,CAAC,IAAI,CAAC,UAAU,OAAO,GAAG,CAAC,CAAC;YAClC,IAAA,qBAAW,EAAC,OAAO,CAAC,CAAC;QACvB,CAAC;QAED,IAAA,wBAAQ,EAAC,yBAAyB,aAAa,cAAc,WAAW,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAE3G,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,6 +1,5 @@
1
1
  export interface ExecutorSchema {
2
2
  envPath: string;
3
- envKey: string;
4
3
  ormConfigPath: string;
5
- runOrRevert: string;
4
+ runOrRevert: 'run' | 'revert';
6
5
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/schema",
3
3
  "version": 2,
4
- "title": "Db executor",
4
+ "title": "TypeORM executor",
5
5
  "description": "",
6
6
  "type": "object",
7
7
  "properties": {
@@ -13,16 +13,12 @@
13
13
  "type": "string",
14
14
  "description": "Path and name of the .env file to load"
15
15
  },
16
- "envKey": {
17
- "type": "string",
18
- "description": "Name of the environment variable that points to the location of the envFile"
19
- },
20
16
  "ormConfigPath": {
21
17
  "type": "string",
22
18
  "description": "Path and name of the ormconfig"
23
19
  }
24
20
  },
25
21
  "required": [
26
- "envPath", "envKey", "ormConfigPath"
22
+ "envPath", "ormConfigPath"
27
23
  ]
28
24
  }
@@ -1,20 +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 executor = (options, context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
6
- const { envKey, envPath, ormConfigPath, runOrRevert } = options;
7
- try {
8
- (0, child_process_1.execSync)(`export ${envKey}=${envPath} && npm run typeorm -- -d ${ormConfigPath} migration:${runOrRevert} -t=false`, { stdio: 'inherit' });
9
- return {
10
- success: true,
11
- };
12
- }
13
- catch (error) {
14
- return {
15
- success: false,
16
- };
17
- }
18
- });
19
- exports.default = executor;
20
- //# sourceMappingURL=executor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../onix/src/executors/db/executor.ts"],"names":[],"mappings":";;;AAEA,iDAAyC;AAEzC,MAAM,QAAQ,GAAoC,CAChD,OAAuB,EACvB,OAAwB,EACxB,EAAE;IACF,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAGhE,IAAI,CAAC;QACH,IAAA,wBAAQ,EAAC,UAAU,MAAM,IAAI,OAAO,6BAA6B,aAAa,cAAc,WAAW,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAE1I,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"}
File without changes