sprint-es 0.0.111 → 0.0.112

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 CHANGED
@@ -387,30 +387,6 @@ async function runDoctor() {
387
387
  }
388
388
  logger.break();
389
389
  }
390
- function fixBadRelativeImports(dir, projectRoot2) {
391
- const nodeModulesPath = path.join(projectRoot2, "node_modules");
392
- for (const file of fs.readdirSync(dir)) {
393
- const fullPath = path.join(dir, file);
394
- if (fs.statSync(fullPath).isDirectory()) fixBadRelativeImports(fullPath, projectRoot2);
395
- else if (file.endsWith(".js")) {
396
- const content = fs.readFileSync(fullPath, "utf-8");
397
- const fixed = content.replace(
398
- /require\(["'](\.\.?\/)+([^"'./][^"']*?)["']\)/g,
399
- (match, dots, pkg) => {
400
- if (fs.existsSync(path.join(nodeModulesPath, pkg))) return `require("${pkg}")`;
401
- return match;
402
- }
403
- ).replace(
404
- /(require\(["'])(\.\.?\/[^"']+?)(["']\))/g,
405
- (match, before, p, after) => {
406
- if (/\.[a-z]+$/.test(p)) return match;
407
- return `${before}${p}.js${after}`;
408
- }
409
- );
410
- if (fixed !== content) fs.writeFileSync(fullPath, fixed);
411
- }
412
- }
413
- }
414
390
  async function main() {
415
391
  switch (command) {
416
392
  case "dev": {
@@ -434,23 +410,16 @@ async function main() {
434
410
  const originalInclude = tsconfig.include ?? [];
435
411
  const patched = originalInclude.filter((p) => !p.includes("sprint.config"));
436
412
  const needsPatching = patched.length !== originalInclude.length;
437
- if (needsPatching) {
438
- fs.writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
439
- }
413
+ if (needsPatching) fs.writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
440
414
  try {
441
415
  console.log("[Sprint] Running tsc...");
442
416
  await runCommand(`tsc --project "${tsconfigPath}"`, { NODE_ENV: "production" });
443
417
  console.log("[Sprint] tsc completed ✓");
444
- console.log("[Sprint] Fixing imports...");
445
- fixBadRelativeImports(distPath, projectRoot);
446
- console.log("[Sprint] Imports fixed ✓");
447
418
  console.log("[Sprint] Running tsc-alias...");
448
419
  await runCommand(`tsc-alias --project "${tsconfigPath}"`, { NODE_ENV: "production" });
449
420
  console.log("[Sprint] tsc-alias completed ✓");
450
421
  } finally {
451
- if (needsPatching) {
452
- fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
453
- }
422
+ if (needsPatching) fs.writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
454
423
  }
455
424
  console.log("[Sprint] Compiling sprint.config.ts...");
456
425
  await runCommand(
@@ -462,9 +431,6 @@ async function main() {
462
431
  console.log("[Sprint] Running tsc...");
463
432
  await runCommand(`tsc --project "${tsconfigPath}"`, { NODE_ENV: "production" });
464
433
  console.log("[Sprint] tsc completed ✓");
465
- console.log("[Sprint] Fixing imports...");
466
- fixBadRelativeImports(distPath, projectRoot);
467
- console.log("[Sprint] Imports fixed ✓");
468
434
  console.log("[Sprint] Running tsc-alias...");
469
435
  await runCommand(`tsc-alias --project "${tsconfigPath}"`, { NODE_ENV: "production" });
470
436
  console.log("[Sprint] tsc-alias completed ✓");
package/dist/esm/cli.js CHANGED
@@ -368,30 +368,6 @@ async function runDoctor() {
368
368
  }
369
369
  logger.break();
370
370
  }
371
- function fixBadRelativeImports(dir, projectRoot2) {
372
- const nodeModulesPath = join(projectRoot2, "node_modules");
373
- for (const file of readdirSync(dir)) {
374
- const fullPath = join(dir, file);
375
- if (statSync(fullPath).isDirectory()) fixBadRelativeImports(fullPath, projectRoot2);
376
- else if (file.endsWith(".js")) {
377
- const content = readFileSync(fullPath, "utf-8");
378
- const fixed = content.replace(
379
- /require\(["'](\.\.?\/)+([^"'./][^"']*?)["']\)/g,
380
- (match, dots, pkg) => {
381
- if (existsSync(join(nodeModulesPath, pkg))) return `require("${pkg}")`;
382
- return match;
383
- }
384
- ).replace(
385
- /(require\(["'])(\.\.?\/[^"']+?)(["']\))/g,
386
- (match, before, p, after) => {
387
- if (/\.[a-z]+$/.test(p)) return match;
388
- return `${before}${p}.js${after}`;
389
- }
390
- );
391
- if (fixed !== content) writeFileSync(fullPath, fixed);
392
- }
393
- }
394
- }
395
371
  async function main() {
396
372
  switch (command) {
397
373
  case "dev": {
@@ -415,23 +391,16 @@ async function main() {
415
391
  const originalInclude = tsconfig.include ?? [];
416
392
  const patched = originalInclude.filter((p) => !p.includes("sprint.config"));
417
393
  const needsPatching = patched.length !== originalInclude.length;
418
- if (needsPatching) {
419
- writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
420
- }
394
+ if (needsPatching) writeFileSync(tsconfigPath, JSON.stringify({ ...tsconfig, include: patched }, null, 4));
421
395
  try {
422
396
  console.log("[Sprint] Running tsc...");
423
397
  await runCommand(`tsc --project "${tsconfigPath}"`, { NODE_ENV: "production" });
424
398
  console.log("[Sprint] tsc completed ✓");
425
- console.log("[Sprint] Fixing imports...");
426
- fixBadRelativeImports(distPath, projectRoot);
427
- console.log("[Sprint] Imports fixed ✓");
428
399
  console.log("[Sprint] Running tsc-alias...");
429
400
  await runCommand(`tsc-alias --project "${tsconfigPath}"`, { NODE_ENV: "production" });
430
401
  console.log("[Sprint] tsc-alias completed ✓");
431
402
  } finally {
432
- if (needsPatching) {
433
- writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
434
- }
403
+ if (needsPatching) writeFileSync(tsconfigPath, JSON.stringify(tsconfig, null, 4));
435
404
  }
436
405
  console.log("[Sprint] Compiling sprint.config.ts...");
437
406
  await runCommand(
@@ -443,9 +412,6 @@ async function main() {
443
412
  console.log("[Sprint] Running tsc...");
444
413
  await runCommand(`tsc --project "${tsconfigPath}"`, { NODE_ENV: "production" });
445
414
  console.log("[Sprint] tsc completed ✓");
446
- console.log("[Sprint] Fixing imports...");
447
- fixBadRelativeImports(distPath, projectRoot);
448
- console.log("[Sprint] Imports fixed ✓");
449
415
  console.log("[Sprint] Running tsc-alias...");
450
416
  await runCommand(`tsc-alias --project "${tsconfigPath}"`, { NODE_ENV: "production" });
451
417
  console.log("[Sprint] tsc-alias completed ✓");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprint-es",
3
- "version": "0.0.111",
3
+ "version": "0.0.112",
4
4
  "description": "Sprint - Quickly API",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",