sprint-es 0.0.150 → 0.0.153
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/cjs/cli.cjs +24 -0
- package/dist/esm/cli.js +24 -0
- package/package.json +5 -2
package/dist/cjs/cli.cjs
CHANGED
|
@@ -387,6 +387,25 @@ async function runDoctor() {
|
|
|
387
387
|
}
|
|
388
388
|
logger.break();
|
|
389
389
|
}
|
|
390
|
+
const commandDependencies = {
|
|
391
|
+
build: {
|
|
392
|
+
ts: ["tsup", "typescript"],
|
|
393
|
+
js: ["tsup"]
|
|
394
|
+
}
|
|
395
|
+
};
|
|
396
|
+
function checkDependencies(command2, isTS) {
|
|
397
|
+
const config = commandDependencies[command2];
|
|
398
|
+
if (!config) return [];
|
|
399
|
+
const deps = config.ts ?? [];
|
|
400
|
+
const missing = [];
|
|
401
|
+
for (const dep of deps) {
|
|
402
|
+
const binPath = path.join(projectRoot, "node_modules", ".bin", dep);
|
|
403
|
+
if (!fs.existsSync(binPath)) {
|
|
404
|
+
missing.push(dep);
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
return missing;
|
|
408
|
+
}
|
|
390
409
|
async function main() {
|
|
391
410
|
const hasDist = fs.existsSync(path.join(projectRoot, "dist"));
|
|
392
411
|
const hasTsConfig = fs.existsSync(path.join(projectRoot, "tsconfig.json"));
|
|
@@ -407,9 +426,14 @@ async function main() {
|
|
|
407
426
|
}
|
|
408
427
|
case "build": {
|
|
409
428
|
console.log("🚀 Building for production...");
|
|
429
|
+
checkDependencies("build");
|
|
410
430
|
const distPath = path.join(projectRoot, "dist");
|
|
411
431
|
const tsconfigPath = path.join(projectRoot, "tsconfig.json");
|
|
412
432
|
const hasSprintConfigTs = fs.existsSync(path.join(projectRoot, "sprint.config.ts"));
|
|
433
|
+
if (!hasSprintConfigTs) {
|
|
434
|
+
console.error("[Sprint] This command only works for TypeScript-based projects.");
|
|
435
|
+
process.exit(1);
|
|
436
|
+
}
|
|
413
437
|
console.log("[Sprint] Cleaning dist...");
|
|
414
438
|
fs.rmSync(distPath, { recursive: true, force: true });
|
|
415
439
|
console.log("[Sprint] dist cleaned ✓");
|
package/dist/esm/cli.js
CHANGED
|
@@ -368,6 +368,25 @@ async function runDoctor() {
|
|
|
368
368
|
}
|
|
369
369
|
logger.break();
|
|
370
370
|
}
|
|
371
|
+
const commandDependencies = {
|
|
372
|
+
build: {
|
|
373
|
+
ts: ["tsup", "typescript"],
|
|
374
|
+
js: ["tsup"]
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
function checkDependencies(command2, isTS) {
|
|
378
|
+
const config = commandDependencies[command2];
|
|
379
|
+
if (!config) return [];
|
|
380
|
+
const deps = config.ts ?? [];
|
|
381
|
+
const missing = [];
|
|
382
|
+
for (const dep of deps) {
|
|
383
|
+
const binPath = join(projectRoot, "node_modules", ".bin", dep);
|
|
384
|
+
if (!existsSync(binPath)) {
|
|
385
|
+
missing.push(dep);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
return missing;
|
|
389
|
+
}
|
|
371
390
|
async function main() {
|
|
372
391
|
const hasDist = existsSync(join(projectRoot, "dist"));
|
|
373
392
|
const hasTsConfig = existsSync(join(projectRoot, "tsconfig.json"));
|
|
@@ -388,9 +407,14 @@ async function main() {
|
|
|
388
407
|
}
|
|
389
408
|
case "build": {
|
|
390
409
|
console.log("🚀 Building for production...");
|
|
410
|
+
checkDependencies("build");
|
|
391
411
|
const distPath = join(projectRoot, "dist");
|
|
392
412
|
const tsconfigPath = join(projectRoot, "tsconfig.json");
|
|
393
413
|
const hasSprintConfigTs = existsSync(join(projectRoot, "sprint.config.ts"));
|
|
414
|
+
if (!hasSprintConfigTs) {
|
|
415
|
+
console.error("[Sprint] This command only works for TypeScript-based projects.");
|
|
416
|
+
process.exit(1);
|
|
417
|
+
}
|
|
394
418
|
console.log("[Sprint] Cleaning dist...");
|
|
395
419
|
rmSync(distPath, { recursive: true, force: true });
|
|
396
420
|
console.log("[Sprint] dist cleaned ✓");
|
package/package.json
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sprint-es",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.153",
|
|
4
4
|
"description": "Sprint - Quickly API",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/types/index.d.ts",
|
|
8
8
|
"type": "module",
|
|
9
|
-
"bin":
|
|
9
|
+
"bin": {
|
|
10
|
+
"sprint": "dist/esm/cli.js",
|
|
11
|
+
"sprint-es": "dist/esm/cli.js"
|
|
12
|
+
},
|
|
10
13
|
"exports": {
|
|
11
14
|
".": {
|
|
12
15
|
"types": "./dist/types/index.d.ts",
|