@koine/next 2.0.0-beta.147 → 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 +14 -19
- 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,38 +1,33 @@
|
|
|
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
|
|
8
|
+
export type WithKoineOptions = NextConfig & {
|
|
8
9
|
/**
|
|
9
|
-
*
|
|
10
|
-
* automatically prepended before a slash e.g. `{scope}/@{lib}`.
|
|
11
|
-
* @example ["components", "utils"]
|
|
10
|
+
* Set it to `true` when your _Next.js_ app is built inside a Nx monorepo
|
|
12
11
|
*/
|
|
13
|
-
|
|
12
|
+
nx?: boolean;
|
|
14
13
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* Set it to `true` in order to be able importing React components directly
|
|
15
|
+
* from `.svg` files.
|
|
16
|
+
*
|
|
17
|
+
* It automatically configure webpack taking into account the `nx` option.
|
|
18
18
|
*/
|
|
19
|
-
scope?: string;
|
|
20
|
-
};
|
|
21
|
-
export type WithKoineOptions = NextConfig & {
|
|
22
|
-
nx?: boolean;
|
|
23
19
|
svg?: boolean;
|
|
24
20
|
/**
|
|
25
21
|
* Shortcut option to automatically create swc transforms to feed into
|
|
26
|
-
* _Next.js_' `modularizeImports
|
|
22
|
+
* _Next.js_' `modularizeImports`.
|
|
23
|
+
*
|
|
24
|
+
* Pass _one_ or an _array_ of {@link SwcTransformingLib lib transform object}.
|
|
27
25
|
*/
|
|
28
|
-
modularize?:
|
|
26
|
+
modularize?: SwcTransformingLib[] | SwcTransformingLib;
|
|
29
27
|
} & WithI18nLegacyOptions & WithI18nAsyncOptions;
|
|
30
28
|
/**
|
|
31
|
-
* Get
|
|
29
|
+
* Get _Next.js_ config with some extra {@link WithKoineOptions options}
|
|
32
30
|
*
|
|
33
|
-
* @param
|
|
34
|
-
* @property {boolean} [options.nx=false] Nx monorepo setup
|
|
35
|
-
* @property {boolean} [options.svg=false] SVG to react components
|
|
31
|
+
* @param options
|
|
36
32
|
*/
|
|
37
33
|
export declare let withKoine: (options?: WithKoineOptions) => NextConfig;
|
|
38
|
-
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
|
}
|