@nimpl/i18n 1.1.2-canary.2 → 1.2.0-canary.0

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/withI18n.js CHANGED
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const createCacheServer_1 = __importDefault(require("./configuration/createCacheServer"));
7
7
  const PORT = "24";
8
8
  let cacheSecret = process.env.I18N_CACHE_SECRET;
9
- const withI18n = async (phase) => {
10
- if (!cacheSecret && process.env.NODE_ENV === "development") {
9
+ const withI18n = async () => {
10
+ if (!cacheSecret) {
11
11
  try {
12
12
  const devResp = await fetch(`http://localhost:${PORT}/?type=dev`);
13
13
  const data = await devResp.json();
@@ -19,7 +19,7 @@ const withI18n = async (phase) => {
19
19
  //
20
20
  }
21
21
  }
22
- if ((phase === "phase-development-server" || phase === "phase-production-server") && !cacheSecret) {
22
+ if (!cacheSecret) {
23
23
  const { secret } = await (0, createCacheServer_1.default)(PORT);
24
24
  cacheSecret = secret;
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nimpl/i18n",
3
- "version": "1.1.2-canary.2",
3
+ "version": "1.2.0-canary.0",
4
4
  "description": "i18n library for working with translations in server and client components",
5
5
  "exports": {
6
6
  "./ClientTranslation": {
package/withI18n.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const withI18n: (phase: string) => Promise<(nextConfig: any) => any>;
1
+ declare const withI18n: () => Promise<(nextConfig: any) => any>;
2
2
  export default withI18n;