@boltic/cli 1.0.41 → 1.0.43
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 +64 -15
- package/api/serverless.js +148 -3
- package/cli.js +69 -34
- package/commands/env.js +11 -2
- package/commands/integration.js +11 -2
- package/commands/mcp.js +9 -2
- package/commands/serverless.js +1370 -267
- package/helper/serverless.js +233 -0
- package/helper/verbose.js +62 -0
- package/package.json +2 -2
package/helper/serverless.js
CHANGED
|
@@ -36,6 +36,233 @@ export const LANGUAGE_CHOICES = [
|
|
|
36
36
|
{ name: "Java", value: "java" },
|
|
37
37
|
];
|
|
38
38
|
|
|
39
|
+
// Language-specific .gitignore templates
|
|
40
|
+
export const GITIGNORE_TEMPLATES = {
|
|
41
|
+
nodejs: `# Dependencies
|
|
42
|
+
node_modules/
|
|
43
|
+
package-lock.json
|
|
44
|
+
yarn.lock
|
|
45
|
+
pnpm-lock.yaml
|
|
46
|
+
|
|
47
|
+
# Build output
|
|
48
|
+
dist/
|
|
49
|
+
build/
|
|
50
|
+
.next/
|
|
51
|
+
|
|
52
|
+
# Environment files
|
|
53
|
+
.env
|
|
54
|
+
.env.local
|
|
55
|
+
.env.*.local
|
|
56
|
+
|
|
57
|
+
# Logs
|
|
58
|
+
logs/
|
|
59
|
+
*.log
|
|
60
|
+
npm-debug.log*
|
|
61
|
+
yarn-debug.log*
|
|
62
|
+
yarn-error.log*
|
|
63
|
+
|
|
64
|
+
# IDE
|
|
65
|
+
.idea/
|
|
66
|
+
.vscode/
|
|
67
|
+
*.swp
|
|
68
|
+
*.swo
|
|
69
|
+
*~
|
|
70
|
+
|
|
71
|
+
# OS files
|
|
72
|
+
.DS_Store
|
|
73
|
+
Thumbs.db
|
|
74
|
+
|
|
75
|
+
# Boltic auto-generated files
|
|
76
|
+
autogen_*.js
|
|
77
|
+
`,
|
|
78
|
+
python: `# Byte-compiled / optimized / DLL files
|
|
79
|
+
__pycache__/
|
|
80
|
+
*.py[cod]
|
|
81
|
+
*$py.class
|
|
82
|
+
|
|
83
|
+
# Virtual environments
|
|
84
|
+
venv/
|
|
85
|
+
env/
|
|
86
|
+
.venv/
|
|
87
|
+
.env/
|
|
88
|
+
|
|
89
|
+
# Distribution / packaging
|
|
90
|
+
dist/
|
|
91
|
+
build/
|
|
92
|
+
*.egg-info/
|
|
93
|
+
.eggs/
|
|
94
|
+
|
|
95
|
+
# Environment files
|
|
96
|
+
.env
|
|
97
|
+
.env.local
|
|
98
|
+
.env.*.local
|
|
99
|
+
|
|
100
|
+
# Logs
|
|
101
|
+
*.log
|
|
102
|
+
|
|
103
|
+
# IDE
|
|
104
|
+
.idea/
|
|
105
|
+
.vscode/
|
|
106
|
+
*.swp
|
|
107
|
+
*.swo
|
|
108
|
+
*~
|
|
109
|
+
|
|
110
|
+
# OS files
|
|
111
|
+
.DS_Store
|
|
112
|
+
Thumbs.db
|
|
113
|
+
|
|
114
|
+
# Boltic auto-generated files
|
|
115
|
+
autogen_*.py
|
|
116
|
+
`,
|
|
117
|
+
golang: `# Binaries
|
|
118
|
+
*.exe
|
|
119
|
+
*.exe~
|
|
120
|
+
*.dll
|
|
121
|
+
*.so
|
|
122
|
+
*.dylib
|
|
123
|
+
|
|
124
|
+
# Build output
|
|
125
|
+
bin/
|
|
126
|
+
/main
|
|
127
|
+
|
|
128
|
+
# Test binary
|
|
129
|
+
*.test
|
|
130
|
+
|
|
131
|
+
# Go workspace
|
|
132
|
+
go.work
|
|
133
|
+
go.work.sum
|
|
134
|
+
|
|
135
|
+
# Vendor directory (if not committing dependencies)
|
|
136
|
+
# vendor/
|
|
137
|
+
|
|
138
|
+
# Environment files
|
|
139
|
+
.env
|
|
140
|
+
.env.local
|
|
141
|
+
.env.*.local
|
|
142
|
+
|
|
143
|
+
# Logs
|
|
144
|
+
*.log
|
|
145
|
+
|
|
146
|
+
# IDE
|
|
147
|
+
.idea/
|
|
148
|
+
.vscode/
|
|
149
|
+
*.swp
|
|
150
|
+
*.swo
|
|
151
|
+
*~
|
|
152
|
+
|
|
153
|
+
# OS files
|
|
154
|
+
.DS_Store
|
|
155
|
+
Thumbs.db
|
|
156
|
+
|
|
157
|
+
# Boltic auto-generated files
|
|
158
|
+
autogen_*.go
|
|
159
|
+
`,
|
|
160
|
+
java: `# Compiled class files
|
|
161
|
+
*.class
|
|
162
|
+
|
|
163
|
+
# Build output
|
|
164
|
+
target/
|
|
165
|
+
build/
|
|
166
|
+
out/
|
|
167
|
+
bin/
|
|
168
|
+
|
|
169
|
+
# Package files
|
|
170
|
+
*.jar
|
|
171
|
+
*.war
|
|
172
|
+
*.ear
|
|
173
|
+
|
|
174
|
+
# Maven
|
|
175
|
+
.mvn/
|
|
176
|
+
!.mvn/wrapper/maven-wrapper.jar
|
|
177
|
+
pom.xml.tag
|
|
178
|
+
pom.xml.releaseBackup
|
|
179
|
+
pom.xml.versionsBackup
|
|
180
|
+
pom.xml.next
|
|
181
|
+
|
|
182
|
+
# Gradle
|
|
183
|
+
.gradle/
|
|
184
|
+
gradle/
|
|
185
|
+
gradlew
|
|
186
|
+
gradlew.bat
|
|
187
|
+
|
|
188
|
+
# Environment files
|
|
189
|
+
.env
|
|
190
|
+
.env.local
|
|
191
|
+
.env.*.local
|
|
192
|
+
|
|
193
|
+
# Logs
|
|
194
|
+
*.log
|
|
195
|
+
|
|
196
|
+
# IDE
|
|
197
|
+
.idea/
|
|
198
|
+
.vscode/
|
|
199
|
+
*.iml
|
|
200
|
+
*.ipr
|
|
201
|
+
*.iws
|
|
202
|
+
.classpath
|
|
203
|
+
.project
|
|
204
|
+
.settings/
|
|
205
|
+
*.swp
|
|
206
|
+
*.swo
|
|
207
|
+
*~
|
|
208
|
+
|
|
209
|
+
# OS files
|
|
210
|
+
.DS_Store
|
|
211
|
+
Thumbs.db
|
|
212
|
+
|
|
213
|
+
# Boltic auto-generated files
|
|
214
|
+
AutogenIndex.java
|
|
215
|
+
`,
|
|
216
|
+
container: `# Environment files
|
|
217
|
+
.env
|
|
218
|
+
.env.local
|
|
219
|
+
.env.*.local
|
|
220
|
+
|
|
221
|
+
# Logs
|
|
222
|
+
*.log
|
|
223
|
+
|
|
224
|
+
# IDE
|
|
225
|
+
.idea/
|
|
226
|
+
.vscode/
|
|
227
|
+
*.swp
|
|
228
|
+
*.swo
|
|
229
|
+
*~
|
|
230
|
+
|
|
231
|
+
# OS files
|
|
232
|
+
.DS_Store
|
|
233
|
+
Thumbs.db
|
|
234
|
+
|
|
235
|
+
# Docker
|
|
236
|
+
.docker/
|
|
237
|
+
`,
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Create a .gitignore file for the serverless project
|
|
242
|
+
* @param {string} targetDir - Directory to create .gitignore in
|
|
243
|
+
* @param {string} language - Programming language (nodejs, python, golang, java, container)
|
|
244
|
+
* @returns {boolean} - True if created successfully
|
|
245
|
+
*/
|
|
246
|
+
export function createGitignore(targetDir, language) {
|
|
247
|
+
const gitignorePath = path.join(targetDir, ".gitignore");
|
|
248
|
+
|
|
249
|
+
// Don't overwrite existing .gitignore
|
|
250
|
+
if (fs.existsSync(gitignorePath)) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
const template =
|
|
255
|
+
GITIGNORE_TEMPLATES[language] || GITIGNORE_TEMPLATES.nodejs;
|
|
256
|
+
|
|
257
|
+
try {
|
|
258
|
+
fs.writeFileSync(gitignorePath, template);
|
|
259
|
+
return true;
|
|
260
|
+
} catch {
|
|
261
|
+
// Silently fail - .gitignore is optional
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
39
266
|
/**
|
|
40
267
|
* Parse command line arguments for the create command
|
|
41
268
|
*/
|
|
@@ -45,6 +272,7 @@ export function parseCreateArgs(args) {
|
|
|
45
272
|
language: null,
|
|
46
273
|
directory: process.cwd(),
|
|
47
274
|
type: null, // code, git, or container
|
|
275
|
+
noGitignore: false, // Skip .gitignore creation
|
|
48
276
|
};
|
|
49
277
|
|
|
50
278
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -68,6 +296,8 @@ export function parseCreateArgs(args) {
|
|
|
68
296
|
}
|
|
69
297
|
parsed.type = typeValue;
|
|
70
298
|
i++;
|
|
299
|
+
} else if (arg === "--no-gitignore") {
|
|
300
|
+
parsed.noGitignore = true;
|
|
71
301
|
}
|
|
72
302
|
}
|
|
73
303
|
|
|
@@ -1071,6 +1301,7 @@ export function displayTestStartupMessage(port) {
|
|
|
1071
1301
|
export function parsePublishArgs(args) {
|
|
1072
1302
|
const parsed = {
|
|
1073
1303
|
directory: process.cwd(),
|
|
1304
|
+
verbose: false,
|
|
1074
1305
|
};
|
|
1075
1306
|
|
|
1076
1307
|
for (let i = 0; i < args.length; i++) {
|
|
@@ -1080,6 +1311,8 @@ export function parsePublishArgs(args) {
|
|
|
1080
1311
|
if ((arg === "--directory" || arg === "-d") && nextArg) {
|
|
1081
1312
|
parsed.directory = path.resolve(nextArg);
|
|
1082
1313
|
i++;
|
|
1314
|
+
} else if (arg === "--verbose" || arg === "-v") {
|
|
1315
|
+
parsed.verbose = true;
|
|
1083
1316
|
} else if (!arg.startsWith("-") && !parsed._dirSet) {
|
|
1084
1317
|
// Accept positional argument as directory (e.g., `boltic serverless publish ./my-project`)
|
|
1085
1318
|
parsed.directory = path.resolve(arg);
|
package/helper/verbose.js
CHANGED
|
@@ -18,3 +18,65 @@ export const logApi = (method, url, status) => {
|
|
|
18
18
|
)
|
|
19
19
|
);
|
|
20
20
|
};
|
|
21
|
+
|
|
22
|
+
export const logApiRequest = (method, url, payload = null) => {
|
|
23
|
+
if (!isVerbose) return;
|
|
24
|
+
console.log(
|
|
25
|
+
chalk.dim(
|
|
26
|
+
"\n┌─────────────────────────────────────────────────────────────"
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
console.log(chalk.dim("│ ") + chalk.cyan("REQUEST"));
|
|
30
|
+
console.log(
|
|
31
|
+
chalk.dim(
|
|
32
|
+
"├─────────────────────────────────────────────────────────────"
|
|
33
|
+
)
|
|
34
|
+
);
|
|
35
|
+
console.log(
|
|
36
|
+
chalk.dim("│ ") +
|
|
37
|
+
chalk.yellow("Method: ") +
|
|
38
|
+
chalk.white(method.toUpperCase())
|
|
39
|
+
);
|
|
40
|
+
console.log(chalk.dim("│ ") + chalk.yellow("URL: ") + chalk.white(url));
|
|
41
|
+
if (payload) {
|
|
42
|
+
console.log(chalk.dim("│ ") + chalk.yellow("Payload:"));
|
|
43
|
+
const payloadStr = JSON.stringify(payload, null, 2);
|
|
44
|
+
payloadStr.split("\n").forEach((line) => {
|
|
45
|
+
console.log(chalk.dim("│ ") + chalk.gray(line));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const logApiResponse = (status, data) => {
|
|
51
|
+
if (!isVerbose) return;
|
|
52
|
+
console.log(
|
|
53
|
+
chalk.dim(
|
|
54
|
+
"├─────────────────────────────────────────────────────────────"
|
|
55
|
+
)
|
|
56
|
+
);
|
|
57
|
+
console.log(chalk.dim("│ ") + chalk.cyan("RESPONSE"));
|
|
58
|
+
console.log(
|
|
59
|
+
chalk.dim(
|
|
60
|
+
"├─────────────────────────────────────────────────────────────"
|
|
61
|
+
)
|
|
62
|
+
);
|
|
63
|
+
console.log(
|
|
64
|
+
chalk.dim("│ ") +
|
|
65
|
+
chalk.yellow("Status: ") +
|
|
66
|
+
(status >= 200 && status < 300
|
|
67
|
+
? chalk.green(status)
|
|
68
|
+
: chalk.red(status))
|
|
69
|
+
);
|
|
70
|
+
if (data) {
|
|
71
|
+
console.log(chalk.dim("│ ") + chalk.yellow("Data:"));
|
|
72
|
+
const dataStr = JSON.stringify(data, null, 2);
|
|
73
|
+
dataStr.split("\n").forEach((line) => {
|
|
74
|
+
console.log(chalk.dim("│ ") + chalk.gray(line));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
console.log(
|
|
78
|
+
chalk.dim(
|
|
79
|
+
"└─────────────────────────────────────────────────────────────\n"
|
|
80
|
+
)
|
|
81
|
+
);
|
|
82
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boltic/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.43",
|
|
4
4
|
"description": "Professional CLI for interacting with the Boltic platform — create, manage, and publish integrations, serverless functions, workflows, MCPs, and more with enterprise-grade features and a seamless developer experience",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -136,4 +136,4 @@
|
|
|
136
136
|
"x64",
|
|
137
137
|
"arm64"
|
|
138
138
|
]
|
|
139
|
-
}
|
|
139
|
+
}
|