sprint-es 0.0.129 → 0.0.131

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
@@ -406,8 +406,19 @@ async function main() {
406
406
  fs.rmSync(distPath, { recursive: true, force: true });
407
407
  console.log("[Sprint] dist cleaned ✓");
408
408
  console.log("[Sprint] Compiling with tsup...");
409
+ const tsupCmd = `
410
+ tsup src/**/*.ts
411
+ --outDir dist
412
+ --format esm,cjs
413
+ --target es2020
414
+ --sourcemap
415
+ --clean
416
+ --dts
417
+ --splitting false
418
+ --skip-node-modules-bundle
419
+ `;
409
420
  await runCommand(
410
- `tsc && tsup`,
421
+ `tsc && ${tsupCmd}`,
411
422
  { NODE_ENV: "production" }
412
423
  );
413
424
  console.log("[Sprint] Compilation completed ✓");
@@ -140,7 +140,7 @@ class Sprint {
140
140
  path: "/graphql",
141
141
  graphiql: {
142
142
  enabled: false,
143
- path: "/grapiql"
143
+ path: "/graphiql"
144
144
  }
145
145
  };
146
146
  this.graphqlSchema = null;
@@ -369,12 +369,12 @@ class Sprint {
369
369
  * Load all middleware files from the middlewares folder
370
370
  */
371
371
  async loadMiddlewares(middlewaresPath) {
372
- const fileExt = isProd ? ".js" : ".ts";
372
+ const fileExtensions = isProd ? [".js", ".mjs"] : [".ts"];
373
373
  const files = await fs.promises.readdir(middlewaresPath);
374
374
  for (const file of files) {
375
375
  const filePath = path.join(middlewaresPath, file);
376
376
  const stat = await fs.promises.stat(filePath);
377
- if (stat.isFile() && file.endsWith(fileExt)) {
377
+ if (stat.isFile() && fileExtensions.some((ext) => file.endsWith(ext))) {
378
378
  try {
379
379
  const moduleUrl = url.pathToFileURL(filePath).href;
380
380
  const module2 = await import(moduleUrl);
package/dist/esm/cli.js CHANGED
@@ -387,8 +387,19 @@ async function main() {
387
387
  rmSync(distPath, { recursive: true, force: true });
388
388
  console.log("[Sprint] dist cleaned ✓");
389
389
  console.log("[Sprint] Compiling with tsup...");
390
+ const tsupCmd = `
391
+ tsup src/**/*.ts
392
+ --outDir dist
393
+ --format esm,cjs
394
+ --target es2020
395
+ --sourcemap
396
+ --clean
397
+ --dts
398
+ --splitting false
399
+ --skip-node-modules-bundle
400
+ `;
390
401
  await runCommand(
391
- `tsc && tsup`,
402
+ `tsc && ${tsupCmd}`,
392
403
  { NODE_ENV: "production" }
393
404
  );
394
405
  console.log("[Sprint] Compilation completed ✓");
package/dist/esm/index.js CHANGED
@@ -115,7 +115,7 @@ class Sprint {
115
115
  path: "/graphql",
116
116
  graphiql: {
117
117
  enabled: false,
118
- path: "/grapiql"
118
+ path: "/graphiql"
119
119
  }
120
120
  };
121
121
  this.graphqlSchema = null;
@@ -344,12 +344,12 @@ class Sprint {
344
344
  * Load all middleware files from the middlewares folder
345
345
  */
346
346
  async loadMiddlewares(middlewaresPath) {
347
- const fileExt = isProd ? ".js" : ".ts";
347
+ const fileExtensions = isProd ? [".js", ".mjs"] : [".ts"];
348
348
  const files = await fs.promises.readdir(middlewaresPath);
349
349
  for (const file of files) {
350
350
  const filePath = path.join(middlewaresPath, file);
351
351
  const stat = await fs.promises.stat(filePath);
352
- if (stat.isFile() && file.endsWith(fileExt)) {
352
+ if (stat.isFile() && fileExtensions.some((ext) => file.endsWith(ext))) {
353
353
  try {
354
354
  const moduleUrl = pathToFileURL(filePath).href;
355
355
  const module = await import(moduleUrl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprint-es",
3
- "version": "0.0.129",
3
+ "version": "0.0.131",
4
4
  "description": "Sprint - Quickly API",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",