@korioinc/next-conf 1.0.3 → 1.0.6

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.
@@ -2,8 +2,7 @@ import type { NextConfig } from 'next';
2
2
  export interface WithConfigOptions {
3
3
  configFileName?: string;
4
4
  linguiConfigFileName?: string;
5
- /** Directory containing Lingui PO catalogs. Defaults to './lang'. */
6
- linguiLocalePath?: string;
5
+ linguiLoaderDir?: string;
7
6
  }
8
7
  /**
9
8
  * Next.js configuration plugin that injects webpack aliases
@@ -1 +1 @@
1
- {"version":3,"file":"with-config.d.ts","sourceRoot":"","sources":["../../src/plugin/with-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AA2BvC,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,UAAU,GAAE,UAAe,EAAE,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAgFxG"}
1
+ {"version":3,"file":"with-config.d.ts","sourceRoot":"","sources":["../../src/plugin/with-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AA2BvC,MAAM,WAAW,iBAAiB;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAAC,UAAU,GAAE,UAAe,EAAE,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAmFxG"}
@@ -18,7 +18,7 @@ import * as path from 'path';
18
18
  * ```
19
19
  */
20
20
  export function withNextKitConf(nextConfig = {}, options = {}) {
21
- const { configFileName = 'next-kit.config.ts', linguiConfigFileName = 'lingui.config.ts', linguiLocalePath = './lang', } = options;
21
+ const { configFileName = 'next-kit.config.ts', linguiConfigFileName = 'lingui.config.ts', linguiLoaderDir = './lang', } = options;
22
22
  return {
23
23
  ...nextConfig,
24
24
  // Turbopack configuration for development
@@ -36,10 +36,10 @@ export function withNextKitConf(nextConfig = {}, options = {}) {
36
36
  'lingui.config': linguiConfigFileName.startsWith('.') || linguiConfigFileName.startsWith('/')
37
37
  ? linguiConfigFileName
38
38
  : `./${linguiConfigFileName}`,
39
- // Stable alias for Lingui locales
40
- 'lingui.locales': linguiLocalePath.startsWith('.') || linguiLocalePath.startsWith('/')
41
- ? linguiLocalePath
42
- : `./${linguiLocalePath}`,
39
+ // Expose consumer's Lingui loader entry to all imports
40
+ 'lingui.loader': linguiLoaderDir.startsWith('.') || linguiLoaderDir.startsWith('/')
41
+ ? `${linguiLoaderDir}/index.ts`
42
+ : `./${linguiLoaderDir}/index.ts`,
43
43
  },
44
44
  },
45
45
  // Webpack configuration for production builds
@@ -52,7 +52,7 @@ export function withNextKitConf(nextConfig = {}, options = {}) {
52
52
  const cwd = options?.dir || process.cwd();
53
53
  const userConfigPath = path.resolve(cwd, configFileName);
54
54
  const userLinguiConfigPath = path.resolve(cwd, linguiConfigFileName);
55
- const userLinguiLocalesDirAbs = path.resolve(cwd, linguiLocalePath);
55
+ const userLinguiLoaderPath = path.resolve(cwd, linguiLoaderDir, 'index.ts');
56
56
  // Map package paths used by this package
57
57
  const newConfigPaths = [
58
58
  '@korioinc/next-conf/dist/core/config.default',
@@ -68,8 +68,10 @@ export function withNextKitConf(nextConfig = {}, options = {}) {
68
68
  // Also alias lingui.config -> user's lingui config file
69
69
  if (config.resolve?.alias) {
70
70
  config.resolve.alias['lingui.config'] = userLinguiConfigPath;
71
- // Expose Lingui locales alias
72
- config.resolve.alias['lingui.locales'] = userLinguiLocalesDirAbs;
71
+ }
72
+ // Alias lingui.loader -> user's loader entry
73
+ if (config.resolve?.alias) {
74
+ config.resolve.alias['lingui.loader'] = userLinguiLoaderPath;
73
75
  }
74
76
  // Call the original webpack function if it exists
75
77
  if (typeof nextConfig.webpack === 'function') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@korioinc/next-conf",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
4
4
  "description": "Configuration management for Next.js applications",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -35,9 +35,9 @@
35
35
  }
36
36
  },
37
37
  "devDependencies": {
38
- "@types/node": "^22.18.1",
38
+ "@types/node": "^22.18.3",
39
39
  "typescript": "^5.9.2",
40
- "vitest": "^2.0.0"
40
+ "vitest": "^2.1.9"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public",