@featurevisor/cli 2.27.0 → 3.1.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/lib/index.js CHANGED
@@ -1,92 +1,76 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
- function verb(n) { return function (v) { return step([n, v]); }; }
15
- function step(op) {
16
- if (f) throw new TypeError("Generator is already executing.");
17
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
- if (y = 0, t) op = [op[0] & 2, t.value];
20
- switch (op[0]) {
21
- case 0: case 1: t = op; break;
22
- case 4: _.label++; return { value: op[1], done: false };
23
- case 5: _.label++; y = op[1]; op = [0]; continue;
24
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
- default:
26
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
- if (t[2]) _.ops.pop();
31
- _.trys.pop(); continue;
32
- }
33
- op = body.call(thisArg, _);
34
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
36
7
  }
37
- };
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
38
35
  Object.defineProperty(exports, "__esModule", { value: true });
39
- var fs = require("fs");
40
- var path = require("path");
41
- var core_1 = require("@featurevisor/core");
42
- process.on("unhandledRejection", function (reason) {
36
+ const fs = __importStar(require("fs"));
37
+ const path = __importStar(require("path"));
38
+ const core_1 = require("@featurevisor/core");
39
+ process.on("unhandledRejection", (reason) => {
43
40
  console.error(reason);
44
41
  process.exit(1);
45
42
  });
46
- function main() {
47
- return __awaiter(this, void 0, void 0, function () {
48
- var rootDirectoryPath, argv, cliPackage, corePackage, useRootDirectoryPath, customRootDir, configModulePath, projectConfig, datasource;
49
- return __generator(this, function (_a) {
50
- switch (_a.label) {
51
- case 0:
52
- rootDirectoryPath = process.cwd();
53
- argv = process.argv.slice(2);
54
- if (argv.length === 1 && ["version", "--version", "-v"].indexOf(argv[0]) > -1) {
55
- cliPackage = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"));
56
- corePackage = JSON.parse(fs.readFileSync(require.resolve("@featurevisor/core/package.json"), "utf8"));
57
- console.log("\nPackage versions:\n");
58
- console.log(" - @featurevisor/cli: ".concat(cliPackage.version));
59
- console.log(" - @featurevisor/core: ".concat(corePackage.version));
60
- return [2 /*return*/];
61
- }
62
- useRootDirectoryPath = rootDirectoryPath;
63
- customRootDir = argv.filter(function (arg) { return arg.startsWith("--rootDirectoryPath="); });
64
- if (customRootDir.length > 0) {
65
- useRootDirectoryPath = customRootDir[0].split("=")[1];
66
- }
67
- configModulePath = path.join(rootDirectoryPath, core_1.CONFIG_MODULE_NAME);
68
- if (!!fs.existsSync(configModulePath)) return [3 /*break*/, 2];
69
- // not an existing project
70
- return [4 /*yield*/, (0, core_1.runCLI)({ rootDirectoryPath: useRootDirectoryPath })];
71
- case 1:
72
- // not an existing project
73
- _a.sent();
74
- return [3 /*break*/, 4];
75
- case 2:
76
- projectConfig = (0, core_1.getProjectConfig)(useRootDirectoryPath);
77
- datasource = new core_1.Datasource(projectConfig, useRootDirectoryPath);
78
- return [4 /*yield*/, (0, core_1.runCLI)({
79
- rootDirectoryPath: useRootDirectoryPath,
80
- projectConfig: projectConfig,
81
- datasource: datasource,
82
- })];
83
- case 3:
84
- _a.sent();
85
- _a.label = 4;
86
- case 4: return [2 /*return*/];
87
- }
43
+ async function main() {
44
+ const rootDirectoryPath = process.cwd();
45
+ const argv = process.argv.slice(2);
46
+ if (argv.length === 1 && ["version", "--version", "-v"].indexOf(argv[0]) > -1) {
47
+ const cliPackage = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"));
48
+ const corePackage = JSON.parse(fs.readFileSync(require.resolve("@featurevisor/core/package.json"), "utf8"));
49
+ console.log("\nPackage versions:\n");
50
+ console.log(` - @featurevisor/cli: ${cliPackage.version}`);
51
+ console.log(` - @featurevisor/core: ${corePackage.version}`);
52
+ return;
53
+ }
54
+ let useRootDirectoryPath = rootDirectoryPath;
55
+ const customRootDir = argv.filter((arg) => arg.startsWith("--rootDirectoryPath="));
56
+ if (customRootDir.length > 0) {
57
+ useRootDirectoryPath = customRootDir[0].split("=")[1];
58
+ }
59
+ const configModulePath = path.join(rootDirectoryPath, core_1.CONFIG_MODULE_NAME);
60
+ if (!fs.existsSync(configModulePath)) {
61
+ // not an existing project
62
+ await (0, core_1.runCLI)({ rootDirectoryPath: useRootDirectoryPath });
63
+ }
64
+ else {
65
+ // existing project
66
+ const projectConfig = (0, core_1.getProjectConfig)(useRootDirectoryPath);
67
+ const datasource = new core_1.Datasource(projectConfig, useRootDirectoryPath);
68
+ await (0, core_1.runCLI)({
69
+ rootDirectoryPath: useRootDirectoryPath,
70
+ projectConfig,
71
+ datasource,
88
72
  });
89
- });
73
+ }
90
74
  }
91
75
  main();
92
76
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAyB;AACzB,2BAA6B;AAE7B,2CAA8F;AAE9F,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,UAAC,MAAM;IACtC,OAAO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QACN,mBAAmB;QACnB,MAAM,aAAa,GAAG,IAAA,uBAAgB,EAAC,oBAAoB,CAAC,CAAC;QAC7D,MAAM,UAAU,GAAG,IAAI,iBAAU,CAAC,aAAa,EAAE,oBAAoB,CAAC,CAAC;QAEvE,MAAM,IAAA,aAAM,EAAC;YACX,iBAAiB,EAAE,oBAAoB;YACvC,aAAa;YACb,UAAU;SACX,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
package/package.json CHANGED
@@ -1,17 +1,21 @@
1
1
  {
2
2
  "name": "@featurevisor/cli",
3
- "version": "2.27.0",
3
+ "version": "3.1.0",
4
4
  "description": "CLI package of Featurevisor",
5
5
  "main": "bin.js",
6
6
  "types": "lib/index.d.ts",
7
+ "files": [
8
+ "bin.js",
9
+ "lib"
10
+ ],
7
11
  "bin": {
8
12
  "featurevisor": "bin.js"
9
13
  },
10
14
  "scripts": {
11
15
  "transpile": "rimraf lib && tsc --project tsconfig.cjs.json",
12
- "dist": "echo 'Nothing to dist here'",
13
16
  "build": "npm run transpile",
14
- "test": "echo 'Nothing to test in this package'"
17
+ "test": "node --test test/smoke.cjs",
18
+ "typecheck": "tsc -p tsconfig.typecheck.json"
15
19
  },
16
20
  "homepage": "https://featurevisor.com",
17
21
  "keywords": [
@@ -43,7 +47,7 @@
43
47
  },
44
48
  "license": "MIT",
45
49
  "dependencies": {
46
- "@featurevisor/core": "2.27.0"
50
+ "@featurevisor/core": "3.1.0"
47
51
  },
48
- "gitHead": "7943a7b5b188274c1f7cd27af36cf03721a18d49"
52
+ "gitHead": "f2d587102ba9de9518336e6404ffc326239e6eb1"
49
53
  }