@koine/next 2.0.0-beta.148 → 2.0.0-beta.149
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/config.cjs.js +1 -1
- package/config.d.ts +3 -17
- package/config.esm.js +2 -2
- package/package.json +5 -5
package/config.cjs.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
var swc = require('@koine/node/swc');
|
|
4
4
|
var next = require('@koine/i18n/next');
|
|
5
5
|
|
|
6
|
-
let withKoine=(s={})=>{let{nx:
|
|
6
|
+
let withKoine=(s={})=>{let{nx:p,svg:a,i18nRoutes:m,i18nCompiler:l,modularize:u,...c}=s,w={modularizeImports:{...u?Array.isArray(u)?swc.swcCreateTransforms(u):swc.swcCreateTransform(u):{},...c.modularizeImports||{},...swc.swcTransformsKoine},...c};return (a&&(p?w.nx={svgr:!0}:(delete w.nx,w.webpack=(e,o)=>{let r="function"==typeof c.webpack?c.webpack(e,o):e;return r.module.rules.push({test:/\.svg$/,use:[{loader:"@svgr/webpack",options:{svgoConfig:{plugins:[{name:"removeViewBox",active:!1}]}}}]}),r})),m)?next.withI18nLegacy({...w,i18nRoutes:m}):l?p?next.withI18nAsync({...w,i18nCompiler:l}):next.withI18n({...w,i18nCompiler:l}):w};
|
|
7
7
|
|
|
8
8
|
exports.withKoine = withKoine;
|
package/config.d.ts
CHANGED
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
|
+
import { type SwcTransformingLib } from "@koine/node/swc";
|
|
2
3
|
import { type WithI18nAsyncOptions, type WithI18nLegacyOptions } from "@koine/i18n/next";
|
|
3
4
|
/**
|
|
4
5
|
* @legacy
|
|
5
6
|
*/
|
|
6
7
|
export type Routes = NonNullable<WithI18nLegacyOptions["i18nRoutes"]>["routes"];
|
|
7
|
-
type ModularizeShortcut = {
|
|
8
|
-
/**
|
|
9
|
-
* A list of the packages to modularize, if a `scope` is given that will be
|
|
10
|
-
* automatically prepended before a slash e.g. `{scope}/@{lib}`.
|
|
11
|
-
* @example ["components", "utils"]
|
|
12
|
-
*/
|
|
13
|
-
libs: string[];
|
|
14
|
-
/**
|
|
15
|
-
* The scope of the packages to modularize, if given a slash is automatically
|
|
16
|
-
* appended between the scope and the lib name
|
|
17
|
-
* @example "@"
|
|
18
|
-
*/
|
|
19
|
-
scope?: string;
|
|
20
|
-
};
|
|
21
8
|
export type WithKoineOptions = NextConfig & {
|
|
22
9
|
/**
|
|
23
10
|
* Set it to `true` when your _Next.js_ app is built inside a Nx monorepo
|
|
@@ -34,9 +21,9 @@ export type WithKoineOptions = NextConfig & {
|
|
|
34
21
|
* Shortcut option to automatically create swc transforms to feed into
|
|
35
22
|
* _Next.js_' `modularizeImports`.
|
|
36
23
|
*
|
|
37
|
-
* Pass
|
|
24
|
+
* Pass _one_ or an _array_ of {@link SwcTransformingLib lib transform object}.
|
|
38
25
|
*/
|
|
39
|
-
modularize?:
|
|
26
|
+
modularize?: SwcTransformingLib[] | SwcTransformingLib;
|
|
40
27
|
} & WithI18nLegacyOptions & WithI18nAsyncOptions;
|
|
41
28
|
/**
|
|
42
29
|
* Get _Next.js_ config with some extra {@link WithKoineOptions options}
|
|
@@ -44,4 +31,3 @@ export type WithKoineOptions = NextConfig & {
|
|
|
44
31
|
* @param options
|
|
45
32
|
*/
|
|
46
33
|
export declare let withKoine: (options?: WithKoineOptions) => NextConfig;
|
|
47
|
-
export {};
|
package/config.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { swcCreateTransforms, swcTransformsKoine } from '@koine/node/swc';
|
|
1
|
+
import { swcCreateTransforms, swcCreateTransform, swcTransformsKoine } from '@koine/node/swc';
|
|
2
2
|
import { withI18nLegacy, withI18nAsync, withI18n } from '@koine/i18n/next';
|
|
3
3
|
|
|
4
|
-
let withKoine=(s={})=>{let{nx:
|
|
4
|
+
let withKoine=(s={})=>{let{nx:p,svg:a,i18nRoutes:m,i18nCompiler:l,modularize:u,...c}=s,w={modularizeImports:{...u?Array.isArray(u)?swcCreateTransforms(u):swcCreateTransform(u):{},...c.modularizeImports||{},...swcTransformsKoine},...c};return (a&&(p?w.nx={svgr:!0}:(delete w.nx,w.webpack=(e,o)=>{let r="function"==typeof c.webpack?c.webpack(e,o):e;return r.module.rules.push({test:/\.svg$/,use:[{loader:"@svgr/webpack",options:{svgoConfig:{plugins:[{name:"removeViewBox",active:!1}]}}}]}),r})),m)?withI18nLegacy({...w,i18nRoutes:m}):l?p?withI18nAsync({...w,i18nCompiler:l}):withI18n({...w,i18nCompiler:l}):w};
|
|
5
5
|
|
|
6
6
|
export { withKoine };
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "@koine/next",
|
|
3
3
|
"sideEffects": false,
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@koine/browser": "2.0.0-beta.
|
|
6
|
-
"@koine/i18n": "2.0.0-beta.
|
|
7
|
-
"@koine/node": "2.0.0-beta.
|
|
8
|
-
"@koine/utils": "2.0.0-beta.
|
|
5
|
+
"@koine/browser": "2.0.0-beta.149",
|
|
6
|
+
"@koine/i18n": "2.0.0-beta.149",
|
|
7
|
+
"@koine/node": "2.0.0-beta.149",
|
|
8
|
+
"@koine/utils": "2.0.0-beta.149"
|
|
9
9
|
},
|
|
10
10
|
"peerDependencies": {
|
|
11
11
|
"next": "^14.0.4",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"module": "./index.esm.js",
|
|
66
66
|
"main": "./index.cjs.js",
|
|
67
67
|
"types": "./index.esm.d.ts",
|
|
68
|
-
"version": "2.0.0-beta.
|
|
68
|
+
"version": "2.0.0-beta.149"
|
|
69
69
|
}
|