@featurevisor/cli 2.27.0 → 3.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/src/index.ts DELETED
@@ -1,54 +0,0 @@
1
- import * as fs from "fs";
2
- import * as path from "path";
3
-
4
- import { CONFIG_MODULE_NAME, getProjectConfig, Datasource, runCLI } from "@featurevisor/core";
5
-
6
- process.on("unhandledRejection", (reason) => {
7
- console.error(reason);
8
- process.exit(1);
9
- });
10
-
11
- async function main() {
12
- const rootDirectoryPath = process.cwd();
13
- const argv = process.argv.slice(2);
14
-
15
- if (argv.length === 1 && ["version", "--version", "-v"].indexOf(argv[0]) > -1) {
16
- const cliPackage = JSON.parse(
17
- fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"),
18
- );
19
-
20
- const corePackage = JSON.parse(
21
- fs.readFileSync(require.resolve("@featurevisor/core/package.json"), "utf8"),
22
- );
23
-
24
- console.log("\nPackage versions:\n");
25
- console.log(` - @featurevisor/cli: ${cliPackage.version}`);
26
- console.log(` - @featurevisor/core: ${corePackage.version}`);
27
-
28
- return;
29
- }
30
-
31
- let useRootDirectoryPath = rootDirectoryPath;
32
- const customRootDir = argv.filter((arg) => arg.startsWith("--rootDirectoryPath="));
33
- if (customRootDir.length > 0) {
34
- useRootDirectoryPath = customRootDir[0].split("=")[1];
35
- }
36
-
37
- const configModulePath = path.join(rootDirectoryPath, CONFIG_MODULE_NAME);
38
- if (!fs.existsSync(configModulePath)) {
39
- // not an existing project
40
- await runCLI({ rootDirectoryPath: useRootDirectoryPath });
41
- } else {
42
- // existing project
43
- const projectConfig = getProjectConfig(useRootDirectoryPath);
44
- const datasource = new Datasource(projectConfig, useRootDirectoryPath);
45
-
46
- await runCLI({
47
- rootDirectoryPath: useRootDirectoryPath,
48
- projectConfig,
49
- datasource,
50
- });
51
- }
52
- }
53
-
54
- main();
package/tsconfig.cjs.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.cjs.json",
3
- "compilerOptions": {
4
- "outDir": "./lib"
5
- },
6
- "include": ["./src/**/*.ts"]
7
- }