@litodocs/cli 0.7.0 → 1.0.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/package.json CHANGED
@@ -1,12 +1,17 @@
1
1
  {
2
2
  "name": "@litodocs/cli",
3
- "version": "0.7.0",
3
+ "version": "1.0.0",
4
4
  "description": "Beautiful documentation sites from Markdown. Fast, simple, and open-source.",
5
- "main": "src/index.js",
6
5
  "type": "module",
7
6
  "bin": {
8
7
  "lito": "./bin/cli.js"
9
8
  },
9
+ "files": [
10
+ "bin/",
11
+ "src/",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
10
15
  "scripts": {
11
16
  "test": "echo \"Error: no test specified\" && exit 1"
12
17
  },
package/src/cli.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  templateListCommand,
13
13
  templateCacheCommand,
14
14
  } from "./commands/template.js";
15
- import { checkForUpdates, upgradeCommand } from "./core/update-check.js";
15
+ import { checkForUpdates, upgradeCommand, getCurrentVersion } from "./core/update-check.js";
16
16
 
17
17
  export async function cli() {
18
18
  const program = new Command();
@@ -25,7 +25,7 @@ export async function cli() {
25
25
  .description(
26
26
  "Beautiful documentation sites from Markdown. Fast, simple, and open-source."
27
27
  )
28
- .version("0.6.0");
28
+ .version(getCurrentVersion());
29
29
 
30
30
  program
31
31
  .command("build")
@@ -1,5 +1,8 @@
1
1
  import { exec } from 'child_process';
2
2
  import { promisify } from 'util';
3
+ import { readFileSync } from 'fs';
4
+ import { fileURLToPath } from 'url';
5
+ import { dirname, join } from 'path';
3
6
  import pc from 'picocolors';
4
7
  import { confirm } from '@clack/prompts';
5
8
 
@@ -11,7 +14,14 @@ const PACKAGE_NAME = '@litodocs/cli';
11
14
  * Get the current installed version from package.json
12
15
  */
13
16
  export function getCurrentVersion() {
14
- return '0.5.2';
17
+ try {
18
+ const __dirname = dirname(fileURLToPath(import.meta.url));
19
+ const pkgPath = join(__dirname, '..', '..', 'package.json');
20
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
21
+ return pkg.version;
22
+ } catch {
23
+ return '1.0.0';
24
+ }
15
25
  }
16
26
 
17
27
  /**
@@ -1,118 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Lito Template Manifest",
4
- "description": "Configuration schema for Lito documentation templates",
5
- "type": "object",
6
- "properties": {
7
- "name": {
8
- "type": "string",
9
- "description": "Template name"
10
- },
11
- "version": {
12
- "type": "string",
13
- "description": "Template version (semver)"
14
- },
15
- "framework": {
16
- "type": "string",
17
- "enum": ["astro", "react", "next", "vue", "nuxt", "svelte"],
18
- "description": "The framework this template uses"
19
- },
20
- "frameworkConfig": {
21
- "type": "object",
22
- "description": "Custom framework configuration overrides",
23
- "properties": {
24
- "contentDir": {
25
- "type": "string",
26
- "description": "Directory where documentation content is placed"
27
- },
28
- "publicDir": {
29
- "type": "string",
30
- "description": "Directory for static public assets"
31
- },
32
- "configFile": {
33
- "type": "string",
34
- "description": "Main framework config file name"
35
- },
36
- "layoutInjection": {
37
- "type": "boolean",
38
- "description": "Whether to inject layout frontmatter into markdown files"
39
- },
40
- "layoutPath": {
41
- "type": "string",
42
- "description": "Path to the markdown layout component"
43
- },
44
- "useMDX": {
45
- "type": "boolean",
46
- "description": "Whether the template uses MDX for markdown processing"
47
- }
48
- }
49
- },
50
- "commands": {
51
- "type": "object",
52
- "description": "Custom build/dev commands",
53
- "properties": {
54
- "dev": {
55
- "type": "array",
56
- "items": [
57
- { "type": "string", "description": "Binary name" },
58
- { "type": "array", "items": { "type": "string" }, "description": "Arguments" }
59
- ],
60
- "description": "Dev server command [binary, [args]]"
61
- },
62
- "build": {
63
- "type": "array",
64
- "items": [
65
- { "type": "string", "description": "Binary name" },
66
- { "type": "array", "items": { "type": "string" }, "description": "Arguments" }
67
- ],
68
- "description": "Build command [binary, [args]]"
69
- }
70
- }
71
- },
72
- "features": {
73
- "type": "object",
74
- "description": "Template feature flags",
75
- "properties": {
76
- "search": {
77
- "type": "boolean",
78
- "default": true,
79
- "description": "Whether template supports search"
80
- },
81
- "i18n": {
82
- "type": "boolean",
83
- "default": false,
84
- "description": "Whether template supports internationalization"
85
- },
86
- "versioning": {
87
- "type": "boolean",
88
- "default": false,
89
- "description": "Whether template supports doc versioning"
90
- },
91
- "darkMode": {
92
- "type": "boolean",
93
- "default": true,
94
- "description": "Whether template supports dark mode"
95
- },
96
- "apiDocs": {
97
- "type": "boolean",
98
- "default": false,
99
- "description": "Whether template supports OpenAPI documentation"
100
- }
101
- }
102
- },
103
- "requiredFiles": {
104
- "type": "array",
105
- "items": { "type": "string" },
106
- "description": "List of files required for this template to work"
107
- },
108
- "author": {
109
- "type": "string",
110
- "description": "Template author"
111
- },
112
- "repository": {
113
- "type": "string",
114
- "description": "Git repository URL"
115
- }
116
- },
117
- "required": ["framework"]
118
- }