botim-cli 0.0.7
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/README.md +375 -0
- package/bin/cli +3 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +459 -0
- package/dist/cli.mjs +106 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.js +13 -0
- package/package.json +83 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare function createReactApp(projectName?: string): Promise<void>;
|
|
4
|
+
|
|
5
|
+
declare function createVueApp(projectName?: string): Promise<void>;
|
|
6
|
+
|
|
7
|
+
declare const ProjectConfigSchema: z.ZodObject<{
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
framework: z.ZodEnum<{
|
|
10
|
+
react: "react";
|
|
11
|
+
vue: "vue";
|
|
12
|
+
}>;
|
|
13
|
+
typescript: z.ZodDefault<z.ZodBoolean>;
|
|
14
|
+
buildTool: z.ZodOptional<z.ZodEnum<{
|
|
15
|
+
vite: "vite";
|
|
16
|
+
webpack: "webpack";
|
|
17
|
+
cra: "cra";
|
|
18
|
+
"vue-cli": "vue-cli";
|
|
19
|
+
}>>;
|
|
20
|
+
features: z.ZodDefault<z.ZodObject<{
|
|
21
|
+
router: z.ZodDefault<z.ZodBoolean>;
|
|
22
|
+
stateManagement: z.ZodDefault<z.ZodBoolean>;
|
|
23
|
+
testing: z.ZodDefault<z.ZodBoolean>;
|
|
24
|
+
linting: z.ZodDefault<z.ZodBoolean>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
packageManager: z.ZodDefault<z.ZodEnum<{
|
|
27
|
+
npm: "npm";
|
|
28
|
+
yarn: "yarn";
|
|
29
|
+
pnpm: "pnpm";
|
|
30
|
+
}>>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
type ProjectConfig = z.infer<typeof ProjectConfigSchema>;
|
|
33
|
+
interface Plugin {
|
|
34
|
+
name: string;
|
|
35
|
+
version: string;
|
|
36
|
+
type: 'template' | 'feature' | 'custom';
|
|
37
|
+
execute: (config: ProjectConfig, context: PluginContext) => Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
interface PluginContext {
|
|
40
|
+
projectPath: string;
|
|
41
|
+
templatePath: string;
|
|
42
|
+
config: ProjectConfig;
|
|
43
|
+
logger: Logger;
|
|
44
|
+
}
|
|
45
|
+
interface Logger {
|
|
46
|
+
info: (message: string) => void;
|
|
47
|
+
success: (message: string) => void;
|
|
48
|
+
error: (message: string) => void;
|
|
49
|
+
warn: (message: string) => void;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
declare class TemplateEngine {
|
|
53
|
+
private fileGenerator;
|
|
54
|
+
constructor();
|
|
55
|
+
generate(config: ProjectConfig, targetPath: string): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare class FileGenerator {
|
|
59
|
+
private spinner;
|
|
60
|
+
generateProject(config: ProjectConfig, templatePath: string, targetPath: string): Promise<void>;
|
|
61
|
+
private copyTemplateFiles;
|
|
62
|
+
private copyDirectoryRecursive;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface PluginRegistry {
|
|
66
|
+
register(plugin: Plugin): void;
|
|
67
|
+
getPlugin(name: string): Plugin | undefined;
|
|
68
|
+
getAllPlugins(): Plugin[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
declare class DefaultPluginRegistry implements PluginRegistry {
|
|
72
|
+
private plugins;
|
|
73
|
+
register(plugin: Plugin): void;
|
|
74
|
+
getPlugin(name: string): Plugin | undefined;
|
|
75
|
+
getAllPlugins(): Plugin[];
|
|
76
|
+
clear(): void;
|
|
77
|
+
}
|
|
78
|
+
declare const pluginRegistry: DefaultPluginRegistry;
|
|
79
|
+
|
|
80
|
+
declare class PluginLoader {
|
|
81
|
+
loadPluginsFromDirectory(pluginDir: string): Promise<void>;
|
|
82
|
+
private loadPlugin;
|
|
83
|
+
loadPluginByName(pluginName: string): Promise<Plugin | undefined>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { FileGenerator, type Plugin, type PluginContext, PluginLoader, type ProjectConfig, TemplateEngine, createReactApp, createVueApp, pluginRegistry };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createReactApp, createVueApp } from "./commands/index.js";
|
|
2
|
+
import { TemplateEngine } from "./core/template-engine.js";
|
|
3
|
+
import { FileGenerator } from "./core/file-generator.js";
|
|
4
|
+
import { pluginRegistry } from "./plugins/plugin-registry.js";
|
|
5
|
+
import { PluginLoader } from "./plugins/plugin-loader.js";
|
|
6
|
+
export {
|
|
7
|
+
FileGenerator,
|
|
8
|
+
PluginLoader,
|
|
9
|
+
TemplateEngine,
|
|
10
|
+
createReactApp,
|
|
11
|
+
createVueApp,
|
|
12
|
+
pluginRegistry
|
|
13
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "botim-cli",
|
|
3
|
+
"version": "0.0.7",
|
|
4
|
+
"description": "A CLI tool that generates boilerplate code for React and Vue applications and manages Mini-Program apps",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"botim-cli": "bin/cli"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"bin",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup && npm run build:bundle",
|
|
18
|
+
"build:bundle": "ncc build src/cli.ts -o dist-bundled -m -e @vercel/ncc && cp dist-bundled/index.js dist/cli.mjs && cp dist-bundled/sourcemap-register.cjs dist/ 2>/dev/null || true && rm -rf dist-bundled",
|
|
19
|
+
"build:tsup": "tsup",
|
|
20
|
+
"dev": "tsup --watch",
|
|
21
|
+
"start": "bash QUICK-INSTALL.sh",
|
|
22
|
+
"type-check": "tsc --noEmit",
|
|
23
|
+
"cli": "node dist/cli.js",
|
|
24
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
25
|
+
"prepare": "npm run build",
|
|
26
|
+
"prepublishOnly": "npm run type-check && npm run build",
|
|
27
|
+
"prepack": "npm run build",
|
|
28
|
+
"install:global": "npm pack @botim/botim-cli@latest --registry https://artifactory.corp.astratech.ae/artifactory/api/npm/npm-local/ && sudo npm install -g botim-cli-*.tgz && rm -f botim-cli-*.tgz"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"cli",
|
|
32
|
+
"boilerplate",
|
|
33
|
+
"generator",
|
|
34
|
+
"react",
|
|
35
|
+
"vue",
|
|
36
|
+
"typescript",
|
|
37
|
+
"template",
|
|
38
|
+
"mini-program",
|
|
39
|
+
"botim",
|
|
40
|
+
"scaffolding"
|
|
41
|
+
],
|
|
42
|
+
"author": "Manoj Choudhary",
|
|
43
|
+
"license": "ISC",
|
|
44
|
+
"type": "module",
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=16.0.0"
|
|
47
|
+
},
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+ssh://git@gitlab.corp.algento.com:open-platform/botim-cli.git"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"@botim:registry": "https://gitlab.corp.algento.com/api/v4/projects/2827/packages/npm/"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://gitlab.corp.algento.com/open-platform/botim-cli#readme",
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/archiver": "7.0.0",
|
|
58
|
+
"@types/form-data": "2.2.1",
|
|
59
|
+
"@types/fs-extra": "11.0.4",
|
|
60
|
+
"@types/inquirer": "9.0.9",
|
|
61
|
+
"@types/node": "24.9.2",
|
|
62
|
+
"@vercel/ncc": "^0.38.4",
|
|
63
|
+
"archiver": "7.0.1",
|
|
64
|
+
"axios": "1.13.1",
|
|
65
|
+
"axios-curlirize": "2.0.0",
|
|
66
|
+
"chalk": "5.6.2",
|
|
67
|
+
"commander": "14.0.2",
|
|
68
|
+
"dotenv": "17.2.3",
|
|
69
|
+
"form-data": "4.0.4",
|
|
70
|
+
"fs-extra": "11.3.2",
|
|
71
|
+
"handlebars": "4.7.8",
|
|
72
|
+
"inquirer": "12.10.0",
|
|
73
|
+
"open": "10.1.0",
|
|
74
|
+
"ora": "9.0.0",
|
|
75
|
+
"pino": "^10.1.0",
|
|
76
|
+
"qr": "^0.5.2",
|
|
77
|
+
"tsup": "^8.5.0",
|
|
78
|
+
"typescript": "^5.9.3",
|
|
79
|
+
"which-pm-runs": "1.1.0",
|
|
80
|
+
"zod": "4.1.12"
|
|
81
|
+
},
|
|
82
|
+
"dependencies": {}
|
|
83
|
+
}
|