@djangocfg/nextjs 2.1.515 → 2.1.518

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.
@@ -1,7 +1,7 @@
1
1
  import { NextConfig } from 'next';
2
2
  import { Configuration, Compiler } from 'webpack';
3
3
  import { a as I18nPluginOptions } from '../types-DZTgCl85.mjs';
4
- import { P as PWAPluginOptions } from '../plugin-DdmK3zAE.mjs';
4
+ import { P as PWAPluginOptions } from '../plugin-yhoLWYh6.mjs';
5
5
  export { A as AI_DOCS_HINT, M as MCP_API_URL, b as MCP_BASE_URL, c as MCP_SERVER_URL } from '../constants-BDS8GXHN.mjs';
6
6
  import '@djangocfg/i18n';
7
7
 
@@ -18,39 +18,8 @@ function withI18n(config, options) {
18
18
  }
19
19
 
20
20
  // src/pwa/plugin.ts
21
- import { consola } from "consola";
22
- import { createRequire } from "module";
23
- var requirePeer = createRequire(import.meta.url);
24
- function withPWA(nextConfig, options = {}) {
25
- const isDev2 = process.env.NODE_ENV === "development";
26
- const isStaticBuild2 = process.env.NEXT_PUBLIC_STATIC_BUILD === "true";
27
- const shouldDisable = options.disable !== void 0 ? options.disable : isDev2 || isStaticBuild2;
28
- const defaultOptions = {
29
- swSrc: "app/sw.ts",
30
- swDest: "public/sw.js",
31
- disable: shouldDisable,
32
- cacheOnNavigation: true,
33
- reloadOnOnline: true,
34
- ...options
35
- };
36
- try {
37
- if (!process.env.SERWIST_SUPPRESS_TURBOPACK_WARNING) {
38
- process.env.SERWIST_SUPPRESS_TURBOPACK_WARNING = "1";
39
- }
40
- const withSerwistInit = requirePeer("@serwist/next").default;
41
- const withSerwist = withSerwistInit({
42
- swSrc: defaultOptions.swSrc,
43
- swDest: defaultOptions.swDest,
44
- disable: defaultOptions.disable,
45
- cacheOnNavigation: defaultOptions.cacheOnNavigation,
46
- reloadOnOnline: defaultOptions.reloadOnOnline,
47
- ...defaultOptions.serwistOptions
48
- });
49
- return withSerwist(nextConfig);
50
- } catch (error) {
51
- consola.error("Failed to configure Serwist:", error);
52
- return nextConfig;
53
- }
21
+ function withPWA(nextConfig, _options = {}) {
22
+ return nextConfig;
54
23
  }
55
24
 
56
25
  // src/config/constants.ts
@@ -197,14 +166,14 @@ function resolveCspVendors(vendors, warnUnknown = true) {
197
166
  }
198
167
 
199
168
  // src/config/plugins/compression.ts
200
- import { createRequire as createRequire3 } from "module";
169
+ import { createRequire as createRequire2 } from "module";
201
170
 
202
171
  // src/config/packages/checker.ts
203
- import { createRequire as createRequire2 } from "module";
172
+ import { createRequire } from "module";
204
173
  import { join } from "path";
205
174
 
206
175
  // src/config/utils/env.ts
207
- import consola2 from "consola";
176
+ import consola from "consola";
208
177
  var isStaticBuild = process.env.NEXT_PUBLIC_STATIC_BUILD === "true";
209
178
  var isDev = process.env.NODE_ENV === "development";
210
179
  var isProduction = !isDev;
@@ -221,7 +190,7 @@ function hasApiUrl() {
221
190
  }
222
191
  function warnIfApiUrlMissing() {
223
192
  if (hasApiUrl() || isDev) return;
224
- consola2.warn(
193
+ consola.warn(
225
194
  "NEXT_PUBLIC_API_URL is not set \u2014 API-backed features are disabled in this build.\nRequests that need it are skipped rather than sent to a relative path.\nIf this app DOES have a backend, the value must be present at BUILD time:\n \u2022 commit it to the app's `.env.production`, and check no `.dockerignore`\n rule (e.g. `**/.env*`) strips that file from the build context;\n \u2022 or pass it as a Dockerfile ARG/ENV before the build step.\nA compose `environment:` entry is too late \u2014 it only exists at runtime."
226
195
  );
227
196
  }
@@ -268,7 +237,7 @@ function getPackagesForContext(options) {
268
237
  // src/config/packages/checker.ts
269
238
  function isPackageInstalled(packageName) {
270
239
  try {
271
- const consumerRequire = createRequire2(join(process.cwd(), "package.json"));
240
+ const consumerRequire = createRequire(join(process.cwd(), "package.json"));
272
241
  consumerRequire.resolve(packageName);
273
242
  return true;
274
243
  } catch {
@@ -323,7 +292,7 @@ function getReasonText(pkg) {
323
292
  }
324
293
 
325
294
  // src/config/plugins/compression.ts
326
- var requirePeer2 = createRequire3(import.meta.url);
295
+ var requirePeer = createRequire2(import.meta.url);
327
296
  var DEFAULT_OPTIONS = {
328
297
  gzip: true,
329
298
  brotli: true,
@@ -337,7 +306,7 @@ function addCompressionPlugins(config, options = {}) {
337
306
  }
338
307
  const opts = { ...DEFAULT_OPTIONS, ...options };
339
308
  try {
340
- const CompressionPlugin = requirePeer2("compression-webpack-plugin");
309
+ const CompressionPlugin = requirePeer("compression-webpack-plugin");
341
310
  if (!config.plugins) {
342
311
  config.plugins = [];
343
312
  }
@@ -403,7 +372,7 @@ Example queries:
403
372
  import chalk from "chalk";
404
373
  import { execSync, spawn } from "child_process";
405
374
  import Conf from "conf";
406
- import consola3 from "consola";
375
+ import consola2 from "consola";
407
376
  import { existsSync } from "fs";
408
377
  import { join as join2 } from "path";
409
378
  import { createInterface } from "readline";
@@ -622,13 +591,13 @@ async function installPackagesWithProgress(packages) {
622
591
  }
623
592
  console.log("");
624
593
  if (failedPackages.length === 0) {
625
- consola3.success(`All ${total} packages installed successfully!`);
594
+ consola2.success(`All ${total} packages installed successfully!`);
626
595
  return true;
627
596
  } else if (successCount > 0) {
628
- consola3.warn(`${successCount}/${total} packages installed. Failed: ${failedPackages.join(", ")}`);
597
+ consola2.warn(`${successCount}/${total} packages installed. Failed: ${failedPackages.join(", ")}`);
629
598
  return false;
630
599
  } else {
631
- consola3.error(`Failed to install packages: ${failedPackages.join(", ")}`);
600
+ consola2.error(`Failed to install packages: ${failedPackages.join(", ")}`);
632
601
  return false;
633
602
  }
634
603
  }
@@ -639,7 +608,7 @@ async function installPackages(packages) {
639
608
  if (packages.length === 0) return true;
640
609
  const pm = detectPackageManager();
641
610
  const command = buildInstallCommand(packages, pm);
642
- consola3.info(`Installing: ${chalk.cyan(packages.map((p) => p.name).join(", "))}`);
611
+ consola2.info(`Installing: ${chalk.cyan(packages.map((p) => p.name).join(", "))}`);
643
612
  const spinner = createSpinner("Installing packages...");
644
613
  spinner.start();
645
614
  return new Promise((resolve) => {
@@ -679,7 +648,7 @@ async function checkAndInstallPackages(options = {}) {
679
648
  return installPackages(toInstall);
680
649
  }
681
650
  console.log("");
682
- consola3.box("\u{1F4E6} Missing Optional Packages");
651
+ consola2.box("\u{1F4E6} Missing Optional Packages");
683
652
  console.log("");
684
653
  for (const pkg of toInstall) {
685
654
  console.log(` ${chalk.yellow("\u2022")} ${chalk.bold(pkg.name)}`);
@@ -703,7 +672,7 @@ async function checkAndInstallPackages(options = {}) {
703
672
  );
704
673
  if (enableAuto) {
705
674
  installerCache.set("autoInstall", true);
706
- consola3.info("Auto-install enabled. Run with --no-auto-install to disable.");
675
+ consola2.info("Auto-install enabled. Run with --no-auto-install to disable.");
707
676
  }
708
677
  }
709
678
  return success;
@@ -714,7 +683,7 @@ async function checkAndInstallPackages(options = {}) {
714
683
  if (skipPermanently) {
715
684
  const currentSkip = installerCache.get("skipPackages") || [];
716
685
  installerCache.set("skipPackages", [...currentSkip, ...toInstall.map((p) => p.name)]);
717
- consola3.info("Packages added to skip list.");
686
+ consola2.info("Packages added to skip list.");
718
687
  }
719
688
  return false;
720
689
  }
@@ -722,21 +691,21 @@ function printMissingPackagesInfo(packages) {
722
691
  if (packages.length === 0) return;
723
692
  const pm = detectPackageManager();
724
693
  const command = buildInstallCommand(packages, pm);
725
- consola3.warn(`Missing optional packages: ${packages.map((p) => p.name).join(", ")}`);
726
- consola3.info(`Install with: ${chalk.cyan(command)}`);
694
+ consola2.warn(`Missing optional packages: ${packages.map((p) => p.name).join(", ")}`);
695
+ consola2.info(`Install with: ${chalk.cyan(command)}`);
727
696
  }
728
697
  function resetInstallerPreferences() {
729
698
  installerCache.clear();
730
- consola3.success("Installer preferences reset");
699
+ consola2.success("Installer preferences reset");
731
700
  }
732
701
 
733
702
  // src/config/packages/updater.ts
734
703
  import chalk2 from "chalk";
735
704
  import { spawn as spawn2 } from "child_process";
736
705
  import Conf2 from "conf";
737
- import consola4 from "consola";
706
+ import consola3 from "consola";
738
707
  import { existsSync as existsSync2, readFileSync } from "fs";
739
- import { createRequire as createRequire4 } from "module";
708
+ import { createRequire as createRequire3 } from "module";
740
709
  import { join as join3 } from "path";
741
710
  import { createInterface as createInterface2 } from "readline";
742
711
  import semver from "semver";
@@ -789,13 +758,13 @@ function getInstalledVersion(packageName) {
789
758
  } catch {
790
759
  }
791
760
  try {
792
- const consumerRequire = createRequire4(join3(cwd, "package.json"));
761
+ const consumerRequire = createRequire3(join3(cwd, "package.json"));
793
762
  const pkgPath = consumerRequire.resolve(`${packageName}/package.json`);
794
763
  return JSON.parse(readFileSync(pkgPath, "utf-8")).version || null;
795
764
  } catch {
796
765
  }
797
766
  try {
798
- const localRequire = createRequire4(import.meta.url);
767
+ const localRequire = createRequire3(import.meta.url);
799
768
  const pkgPath = localRequire.resolve(`${packageName}/package.json`);
800
769
  return JSON.parse(readFileSync(pkgPath, "utf-8")).version || null;
801
770
  } catch {
@@ -992,13 +961,13 @@ async function updatePackagesWithProgress(packages) {
992
961
  }
993
962
  console.log("");
994
963
  if (failedPackages.length === 0) {
995
- consola4.success(`All ${total} packages updated successfully!`);
964
+ consola3.success(`All ${total} packages updated successfully!`);
996
965
  return true;
997
966
  } else if (successCount > 0) {
998
- consola4.warn(`${successCount}/${total} packages updated. Failed: ${failedPackages.join(", ")}`);
967
+ consola3.warn(`${successCount}/${total} packages updated. Failed: ${failedPackages.join(", ")}`);
999
968
  return false;
1000
969
  } else {
1001
- consola4.error(`Failed to update packages: ${failedPackages.join(", ")}`);
970
+ consola3.error(`Failed to update packages: ${failedPackages.join(", ")}`);
1002
971
  return false;
1003
972
  }
1004
973
  }
@@ -1023,7 +992,7 @@ async function checkAndUpdatePackages(options = {}) {
1023
992
  return updatePackagesWithProgress(outdated);
1024
993
  }
1025
994
  console.log("");
1026
- consola4.box("\u{1F4E6} Updates Available");
995
+ consola3.box("\u{1F4E6} Updates Available");
1027
996
  console.log("");
1028
997
  for (const pkg of outdated) {
1029
998
  console.log(
@@ -1042,7 +1011,7 @@ async function checkAndUpdatePackages(options = {}) {
1042
1011
  );
1043
1012
  if (enableAuto) {
1044
1013
  updaterCache.set("autoUpdate", true);
1045
- consola4.info("Auto-update enabled.");
1014
+ consola3.info("Auto-update enabled.");
1046
1015
  }
1047
1016
  }
1048
1017
  return success;
@@ -1058,21 +1027,21 @@ async function checkAndUpdatePackages(options = {}) {
1058
1027
  }
1059
1028
  }
1060
1029
  updaterCache.set("skippedVersions", skipped);
1061
- consola4.info("Versions skipped. Will prompt again for newer versions.");
1030
+ consola3.info("Versions skipped. Will prompt again for newer versions.");
1062
1031
  }
1063
1032
  return false;
1064
1033
  }
1065
1034
  function resetUpdaterPreferences() {
1066
1035
  updaterCache.clear();
1067
- consola4.success("Updater preferences reset");
1036
+ consola3.success("Updater preferences reset");
1068
1037
  }
1069
1038
 
1070
1039
  // src/config/utils/version.ts
1071
1040
  import chalk3 from "chalk";
1072
1041
  import Conf3 from "conf";
1073
- import consola5 from "consola";
1042
+ import consola4 from "consola";
1074
1043
  import { readFileSync as readFileSync2 } from "fs";
1075
- import { createRequire as createRequire5 } from "module";
1044
+ import { createRequire as createRequire4 } from "module";
1076
1045
  import semver2 from "semver";
1077
1046
  function createMemoryCache3() {
1078
1047
  const store = /* @__PURE__ */ new Map();
@@ -1101,7 +1070,7 @@ function createVersionCache() {
1101
1070
  var versionCache = createVersionCache();
1102
1071
  function getCurrentVersion() {
1103
1072
  try {
1104
- const localRequire = createRequire5(import.meta.url);
1073
+ const localRequire = createRequire4(import.meta.url);
1105
1074
  const pkgPath = localRequire.resolve("../../../package.json");
1106
1075
  return JSON.parse(readFileSync2(pkgPath, "utf-8")).version || null;
1107
1076
  } catch {
@@ -1165,10 +1134,10 @@ function getUpdateCommand() {
1165
1134
  async function printVersionInfo() {
1166
1135
  const { hasUpdate, currentVersion, latestVersion } = await checkForUpdate();
1167
1136
  if (!currentVersion) return;
1168
- consola5.box(`\u{1F4E6} @djangocfg/nextjs v${currentVersion}`);
1137
+ consola4.box(`\u{1F4E6} @djangocfg/nextjs v${currentVersion}`);
1169
1138
  if (hasUpdate && latestVersion) {
1170
- consola5.warn(`Update Available! ${chalk3.red(currentVersion)} \u2192 ${chalk3.green(latestVersion)}`);
1171
- consola5.info(`Run: ${chalk3.cyan(getUpdateCommand())}`);
1139
+ consola4.warn(`Update Available! ${chalk3.red(currentVersion)} \u2192 ${chalk3.green(latestVersion)}`);
1140
+ consola4.info(`Run: ${chalk3.cyan(getUpdateCommand())}`);
1172
1141
  console.log("");
1173
1142
  }
1174
1143
  }