@chronoter/main 0.1.1 → 0.1.4
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/dist/cli.js +12 -18
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -15,7 +15,7 @@ import { createServer, defineConfig } from 'vite';
|
|
|
15
15
|
import { z } from 'zod';
|
|
16
16
|
import react from '@vitejs/plugin-react';
|
|
17
17
|
import mdx from '@mdx-js/rollup';
|
|
18
|
-
import {
|
|
18
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
19
19
|
import { watch } from 'chokidar';
|
|
20
20
|
import { homedir } from 'os';
|
|
21
21
|
import { createInterface } from 'readline';
|
|
@@ -1632,8 +1632,10 @@ var runVersionCheck = async (packageName, currentVersion) => {
|
|
|
1632
1632
|
} catch {
|
|
1633
1633
|
}
|
|
1634
1634
|
};
|
|
1635
|
+
|
|
1636
|
+
// src/cli/index.ts
|
|
1635
1637
|
var PACKAGE_NAME = "chronoter";
|
|
1636
|
-
var CURRENT_VERSION = "0.1.
|
|
1638
|
+
var CURRENT_VERSION = "0.1.4";
|
|
1637
1639
|
var createCliProgram = () => {
|
|
1638
1640
|
const program = new Command();
|
|
1639
1641
|
program.name("chronoter").description("Chronoter - MDX-based documentation site generator").version(CURRENT_VERSION);
|
|
@@ -1686,23 +1688,15 @@ var main = async () => {
|
|
|
1686
1688
|
await runVersionCheck(PACKAGE_NAME, CURRENT_VERSION);
|
|
1687
1689
|
}
|
|
1688
1690
|
const program = createCliProgram();
|
|
1691
|
+
if (args.length === 0) {
|
|
1692
|
+
program.help();
|
|
1693
|
+
}
|
|
1689
1694
|
await program.parseAsync(process.argv);
|
|
1690
1695
|
};
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
} catch {
|
|
1697
|
-
return false;
|
|
1698
|
-
}
|
|
1699
|
-
})();
|
|
1700
|
-
if (isMainModule) {
|
|
1701
|
-
main().catch((error) => {
|
|
1702
|
-
console.error(chalk2.red("An unexpected error occurred:"));
|
|
1703
|
-
console.error(error);
|
|
1704
|
-
process.exit(1);
|
|
1705
|
-
});
|
|
1706
|
-
}
|
|
1696
|
+
main().catch((error) => {
|
|
1697
|
+
console.error(chalk2.red("An unexpected error occurred:"));
|
|
1698
|
+
console.error(error);
|
|
1699
|
+
process.exit(1);
|
|
1700
|
+
});
|
|
1707
1701
|
|
|
1708
1702
|
export { CURRENT_VERSION, PACKAGE_NAME, createCliProgram };
|