@mohasinac/cli 0.1.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/chunk-32Q3MIAS.js +72 -0
- package/dist/chunk-N3ETBM74.js +24 -0
- package/dist/chunk-TH6TQLJH.js +86 -0
- package/dist/cli.cjs +377 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +363 -0
- package/dist/i18n.cjs +120 -0
- package/dist/i18n.d.cts +45 -0
- package/dist/i18n.d.ts +45 -0
- package/dist/i18n.js +7 -0
- package/dist/index.cjs +192 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +13 -0
- package/dist/next.cjs +109 -0
- package/dist/next.d.cts +44 -0
- package/dist/next.d.ts +44 -0
- package/dist/next.js +9 -0
- package/package.json +50 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __export = (target, all) => {
|
|
24
|
+
for (var name in all)
|
|
25
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
|
+
};
|
|
27
|
+
var __copyProps = (to, from, except, desc) => {
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from))
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
+
}
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
+
|
|
37
|
+
// src/index.ts
|
|
38
|
+
var index_exports = {};
|
|
39
|
+
__export(index_exports, {
|
|
40
|
+
mergeFeatureMessages: () => mergeFeatureMessages,
|
|
41
|
+
resolveTranspilePackages: () => resolveTranspilePackages,
|
|
42
|
+
withFeatures: () => withFeatures
|
|
43
|
+
});
|
|
44
|
+
module.exports = __toCommonJS(index_exports);
|
|
45
|
+
|
|
46
|
+
// src/next.ts
|
|
47
|
+
var ALWAYS_TRANSPILE = [
|
|
48
|
+
"@mohasinac/contracts",
|
|
49
|
+
"@mohasinac/core",
|
|
50
|
+
"@mohasinac/react",
|
|
51
|
+
"@mohasinac/ui",
|
|
52
|
+
"@mohasinac/http",
|
|
53
|
+
"@mohasinac/next",
|
|
54
|
+
"@mohasinac/tokens",
|
|
55
|
+
"@mohasinac/css-tailwind",
|
|
56
|
+
"@mohasinac/css-vanilla"
|
|
57
|
+
];
|
|
58
|
+
var FEATURE_PACKAGE_MAP = {
|
|
59
|
+
layout: "@mohasinac/feat-layout",
|
|
60
|
+
forms: "@mohasinac/feat-forms",
|
|
61
|
+
filters: "@mohasinac/feat-filters",
|
|
62
|
+
media: "@mohasinac/feat-media",
|
|
63
|
+
auth: "@mohasinac/feat-auth",
|
|
64
|
+
account: "@mohasinac/feat-account",
|
|
65
|
+
products: "@mohasinac/feat-products",
|
|
66
|
+
categories: "@mohasinac/feat-categories",
|
|
67
|
+
cart: "@mohasinac/feat-cart",
|
|
68
|
+
wishlist: "@mohasinac/feat-wishlist",
|
|
69
|
+
checkout: "@mohasinac/feat-checkout",
|
|
70
|
+
orders: "@mohasinac/feat-orders",
|
|
71
|
+
payments: "@mohasinac/feat-payments",
|
|
72
|
+
blog: "@mohasinac/feat-blog",
|
|
73
|
+
reviews: "@mohasinac/feat-reviews",
|
|
74
|
+
faq: "@mohasinac/feat-faq",
|
|
75
|
+
search: "@mohasinac/feat-search",
|
|
76
|
+
homepage: "@mohasinac/feat-homepage",
|
|
77
|
+
admin: "@mohasinac/feat-admin",
|
|
78
|
+
events: "@mohasinac/feat-events",
|
|
79
|
+
auctions: "@mohasinac/feat-auctions",
|
|
80
|
+
promotions: "@mohasinac/feat-promotions",
|
|
81
|
+
seller: "@mohasinac/feat-seller",
|
|
82
|
+
stores: "@mohasinac/feat-stores",
|
|
83
|
+
"pre-orders": "@mohasinac/feat-pre-orders",
|
|
84
|
+
consultation: "@mohasinac/feat-consultation",
|
|
85
|
+
corporate: "@mohasinac/feat-corporate",
|
|
86
|
+
"before-after": "@mohasinac/feat-before-after",
|
|
87
|
+
loyalty: "@mohasinac/feat-loyalty",
|
|
88
|
+
collections: "@mohasinac/feat-collections",
|
|
89
|
+
preorders: "@mohasinac/feat-preorders",
|
|
90
|
+
"whatsapp-bot": "@mohasinac/feat-whatsapp-bot"
|
|
91
|
+
};
|
|
92
|
+
function resolveTranspilePackages(features) {
|
|
93
|
+
const featurePackages = Object.entries(features).filter(([, enabled]) => enabled).map(([key]) => FEATURE_PACKAGE_MAP[key]).filter((pkg) => pkg !== void 0);
|
|
94
|
+
return [...ALWAYS_TRANSPILE, ...featurePackages];
|
|
95
|
+
}
|
|
96
|
+
function withFeatures(features) {
|
|
97
|
+
return function applyFeatures(nextConfig) {
|
|
98
|
+
var _a;
|
|
99
|
+
const fromFeatures = resolveTranspilePackages(features);
|
|
100
|
+
const existing = (_a = nextConfig.transpilePackages) != null ? _a : [];
|
|
101
|
+
const merged = [
|
|
102
|
+
...fromFeatures,
|
|
103
|
+
...existing.filter((p) => !fromFeatures.includes(p))
|
|
104
|
+
];
|
|
105
|
+
return __spreadProps(__spreadValues({}, nextConfig), { transpilePackages: merged });
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// src/i18n.ts
|
|
110
|
+
var _dynamicImport = new Function(
|
|
111
|
+
"modulePath",
|
|
112
|
+
"return import(modulePath)"
|
|
113
|
+
);
|
|
114
|
+
var FEATURE_NAMESPACE_MAP = {
|
|
115
|
+
layout: "layout",
|
|
116
|
+
forms: "forms",
|
|
117
|
+
auth: "auth",
|
|
118
|
+
account: "account",
|
|
119
|
+
products: "products",
|
|
120
|
+
categories: "categories",
|
|
121
|
+
cart: "cart",
|
|
122
|
+
wishlist: "wishlist",
|
|
123
|
+
checkout: "checkout",
|
|
124
|
+
orders: "orders",
|
|
125
|
+
payments: "payments",
|
|
126
|
+
blog: "blog",
|
|
127
|
+
reviews: "reviews",
|
|
128
|
+
faq: "faq",
|
|
129
|
+
search: "search",
|
|
130
|
+
homepage: "home",
|
|
131
|
+
admin: "admin",
|
|
132
|
+
events: "events",
|
|
133
|
+
auctions: "auctions",
|
|
134
|
+
promotions: "promotions",
|
|
135
|
+
seller: "seller",
|
|
136
|
+
stores: "stores",
|
|
137
|
+
"pre-orders": "preOrders",
|
|
138
|
+
consultation: "consultation",
|
|
139
|
+
concern: "concern",
|
|
140
|
+
corporate: "corporate",
|
|
141
|
+
"before-after": "beforeAfter",
|
|
142
|
+
loyalty: "loyalty",
|
|
143
|
+
collections: "collections",
|
|
144
|
+
preorders: "preorders"
|
|
145
|
+
};
|
|
146
|
+
function deepMerge(a, b) {
|
|
147
|
+
const result = __spreadValues({}, a);
|
|
148
|
+
for (const key of Object.keys(b)) {
|
|
149
|
+
const av = a[key];
|
|
150
|
+
const bv = b[key];
|
|
151
|
+
if (bv !== null && typeof bv === "object" && !Array.isArray(bv) && av !== null && typeof av === "object" && !Array.isArray(av)) {
|
|
152
|
+
result[key] = deepMerge(av, bv);
|
|
153
|
+
} else {
|
|
154
|
+
result[key] = bv;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
159
|
+
async function tryLoadFeatureMessages(featureKey, locale) {
|
|
160
|
+
var _a;
|
|
161
|
+
try {
|
|
162
|
+
const pkg = `@mohasinac/feat-${featureKey}`;
|
|
163
|
+
const mod = await _dynamicImport(`${pkg}/messages/${locale}.json`);
|
|
164
|
+
return (_a = mod.default) != null ? _a : mod;
|
|
165
|
+
} catch (e) {
|
|
166
|
+
return {};
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
async function mergeFeatureMessages(locale, features) {
|
|
170
|
+
var _a;
|
|
171
|
+
let projectMessages = {};
|
|
172
|
+
try {
|
|
173
|
+
const mod = await _dynamicImport(`../../messages/${locale}.json`);
|
|
174
|
+
projectMessages = (_a = mod.default) != null ? _a : mod;
|
|
175
|
+
} catch (e) {
|
|
176
|
+
}
|
|
177
|
+
const enabledKeys = Object.entries(features).filter(([key, enabled]) => enabled && key in FEATURE_NAMESPACE_MAP).map(([key]) => key);
|
|
178
|
+
const fragments = await Promise.all(
|
|
179
|
+
enabledKeys.map((key) => tryLoadFeatureMessages(key, locale))
|
|
180
|
+
);
|
|
181
|
+
let base = {};
|
|
182
|
+
for (const fragment of fragments) {
|
|
183
|
+
base = deepMerge(base, fragment);
|
|
184
|
+
}
|
|
185
|
+
return deepMerge(base, projectMessages);
|
|
186
|
+
}
|
|
187
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
188
|
+
0 && (module.exports = {
|
|
189
|
+
mergeFeatureMessages,
|
|
190
|
+
resolveTranspilePackages,
|
|
191
|
+
withFeatures
|
|
192
|
+
});
|
package/dist/index.d.cts
ADDED
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
mergeFeatureMessages
|
|
3
|
+
} from "./chunk-TH6TQLJH.js";
|
|
4
|
+
import {
|
|
5
|
+
resolveTranspilePackages,
|
|
6
|
+
withFeatures
|
|
7
|
+
} from "./chunk-32Q3MIAS.js";
|
|
8
|
+
import "./chunk-N3ETBM74.js";
|
|
9
|
+
export {
|
|
10
|
+
mergeFeatureMessages,
|
|
11
|
+
resolveTranspilePackages,
|
|
12
|
+
withFeatures
|
|
13
|
+
};
|
package/dist/next.cjs
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __export = (target, all) => {
|
|
24
|
+
for (var name in all)
|
|
25
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
|
+
};
|
|
27
|
+
var __copyProps = (to, from, except, desc) => {
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from))
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
+
}
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
+
|
|
37
|
+
// src/next.ts
|
|
38
|
+
var next_exports = {};
|
|
39
|
+
__export(next_exports, {
|
|
40
|
+
resolveTranspilePackages: () => resolveTranspilePackages,
|
|
41
|
+
withFeatures: () => withFeatures
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(next_exports);
|
|
44
|
+
var ALWAYS_TRANSPILE = [
|
|
45
|
+
"@mohasinac/contracts",
|
|
46
|
+
"@mohasinac/core",
|
|
47
|
+
"@mohasinac/react",
|
|
48
|
+
"@mohasinac/ui",
|
|
49
|
+
"@mohasinac/http",
|
|
50
|
+
"@mohasinac/next",
|
|
51
|
+
"@mohasinac/tokens",
|
|
52
|
+
"@mohasinac/css-tailwind",
|
|
53
|
+
"@mohasinac/css-vanilla"
|
|
54
|
+
];
|
|
55
|
+
var FEATURE_PACKAGE_MAP = {
|
|
56
|
+
layout: "@mohasinac/feat-layout",
|
|
57
|
+
forms: "@mohasinac/feat-forms",
|
|
58
|
+
filters: "@mohasinac/feat-filters",
|
|
59
|
+
media: "@mohasinac/feat-media",
|
|
60
|
+
auth: "@mohasinac/feat-auth",
|
|
61
|
+
account: "@mohasinac/feat-account",
|
|
62
|
+
products: "@mohasinac/feat-products",
|
|
63
|
+
categories: "@mohasinac/feat-categories",
|
|
64
|
+
cart: "@mohasinac/feat-cart",
|
|
65
|
+
wishlist: "@mohasinac/feat-wishlist",
|
|
66
|
+
checkout: "@mohasinac/feat-checkout",
|
|
67
|
+
orders: "@mohasinac/feat-orders",
|
|
68
|
+
payments: "@mohasinac/feat-payments",
|
|
69
|
+
blog: "@mohasinac/feat-blog",
|
|
70
|
+
reviews: "@mohasinac/feat-reviews",
|
|
71
|
+
faq: "@mohasinac/feat-faq",
|
|
72
|
+
search: "@mohasinac/feat-search",
|
|
73
|
+
homepage: "@mohasinac/feat-homepage",
|
|
74
|
+
admin: "@mohasinac/feat-admin",
|
|
75
|
+
events: "@mohasinac/feat-events",
|
|
76
|
+
auctions: "@mohasinac/feat-auctions",
|
|
77
|
+
promotions: "@mohasinac/feat-promotions",
|
|
78
|
+
seller: "@mohasinac/feat-seller",
|
|
79
|
+
stores: "@mohasinac/feat-stores",
|
|
80
|
+
"pre-orders": "@mohasinac/feat-pre-orders",
|
|
81
|
+
consultation: "@mohasinac/feat-consultation",
|
|
82
|
+
corporate: "@mohasinac/feat-corporate",
|
|
83
|
+
"before-after": "@mohasinac/feat-before-after",
|
|
84
|
+
loyalty: "@mohasinac/feat-loyalty",
|
|
85
|
+
collections: "@mohasinac/feat-collections",
|
|
86
|
+
preorders: "@mohasinac/feat-preorders",
|
|
87
|
+
"whatsapp-bot": "@mohasinac/feat-whatsapp-bot"
|
|
88
|
+
};
|
|
89
|
+
function resolveTranspilePackages(features) {
|
|
90
|
+
const featurePackages = Object.entries(features).filter(([, enabled]) => enabled).map(([key]) => FEATURE_PACKAGE_MAP[key]).filter((pkg) => pkg !== void 0);
|
|
91
|
+
return [...ALWAYS_TRANSPILE, ...featurePackages];
|
|
92
|
+
}
|
|
93
|
+
function withFeatures(features) {
|
|
94
|
+
return function applyFeatures(nextConfig) {
|
|
95
|
+
var _a;
|
|
96
|
+
const fromFeatures = resolveTranspilePackages(features);
|
|
97
|
+
const existing = (_a = nextConfig.transpilePackages) != null ? _a : [];
|
|
98
|
+
const merged = [
|
|
99
|
+
...fromFeatures,
|
|
100
|
+
...existing.filter((p) => !fromFeatures.includes(p))
|
|
101
|
+
];
|
|
102
|
+
return __spreadProps(__spreadValues({}, nextConfig), { transpilePackages: merged });
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
106
|
+
0 && (module.exports = {
|
|
107
|
+
resolveTranspilePackages,
|
|
108
|
+
withFeatures
|
|
109
|
+
});
|
package/dist/next.d.cts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FeaturesConfig } from '@mohasinac/contracts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @mohasinac/cli/next
|
|
5
|
+
*
|
|
6
|
+
* Next.js config helper that reads features.config.ts and automatically
|
|
7
|
+
* populates transpilePackages, so you never hand-edit that list again.
|
|
8
|
+
*
|
|
9
|
+
* Usage in next.config.js:
|
|
10
|
+
*
|
|
11
|
+
* const { withFeatures } = require("@mohasinac/cli/next");
|
|
12
|
+
* const features = require("./features.config").default;
|
|
13
|
+
*
|
|
14
|
+
* module.exports = withFeatures(features)({
|
|
15
|
+
* serverExternalPackages: ["firebase-admin"],
|
|
16
|
+
* // ... other Next.js config
|
|
17
|
+
* });
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Resolves the transpilePackages list from a FeaturesConfig.
|
|
22
|
+
* Returns ALWAYS_TRANSPILE plus any feature packages that are enabled.
|
|
23
|
+
*/
|
|
24
|
+
declare function resolveTranspilePackages(features: FeaturesConfig): string[];
|
|
25
|
+
interface NextConfig {
|
|
26
|
+
transpilePackages?: string[];
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Wraps a Next.js config object, injecting transpilePackages derived from
|
|
31
|
+
* the enabled features.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```js
|
|
35
|
+
* // next.config.js
|
|
36
|
+
* const { withFeatures } = require("@mohasinac/cli/next");
|
|
37
|
+
* const features = require("./features.config").default;
|
|
38
|
+
*
|
|
39
|
+
* module.exports = withFeatures(features)({ serverExternalPackages: ["firebase-admin"] });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function withFeatures(features: FeaturesConfig): (nextConfig: NextConfig) => NextConfig;
|
|
43
|
+
|
|
44
|
+
export { type NextConfig, resolveTranspilePackages, withFeatures };
|
package/dist/next.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { FeaturesConfig } from '@mohasinac/contracts';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @mohasinac/cli/next
|
|
5
|
+
*
|
|
6
|
+
* Next.js config helper that reads features.config.ts and automatically
|
|
7
|
+
* populates transpilePackages, so you never hand-edit that list again.
|
|
8
|
+
*
|
|
9
|
+
* Usage in next.config.js:
|
|
10
|
+
*
|
|
11
|
+
* const { withFeatures } = require("@mohasinac/cli/next");
|
|
12
|
+
* const features = require("./features.config").default;
|
|
13
|
+
*
|
|
14
|
+
* module.exports = withFeatures(features)({
|
|
15
|
+
* serverExternalPackages: ["firebase-admin"],
|
|
16
|
+
* // ... other Next.js config
|
|
17
|
+
* });
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Resolves the transpilePackages list from a FeaturesConfig.
|
|
22
|
+
* Returns ALWAYS_TRANSPILE plus any feature packages that are enabled.
|
|
23
|
+
*/
|
|
24
|
+
declare function resolveTranspilePackages(features: FeaturesConfig): string[];
|
|
25
|
+
interface NextConfig {
|
|
26
|
+
transpilePackages?: string[];
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Wraps a Next.js config object, injecting transpilePackages derived from
|
|
31
|
+
* the enabled features.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```js
|
|
35
|
+
* // next.config.js
|
|
36
|
+
* const { withFeatures } = require("@mohasinac/cli/next");
|
|
37
|
+
* const features = require("./features.config").default;
|
|
38
|
+
*
|
|
39
|
+
* module.exports = withFeatures(features)({ serverExternalPackages: ["firebase-admin"] });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
declare function withFeatures(features: FeaturesConfig): (nextConfig: NextConfig) => NextConfig;
|
|
43
|
+
|
|
44
|
+
export { type NextConfig, resolveTranspilePackages, withFeatures };
|
package/dist/next.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mohasinac/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI and Next.js helpers for the @mohasinac/* pluggable feature library",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "./dist/index.cjs",
|
|
10
|
+
"module": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"bin": {
|
|
13
|
+
"mohasinac": "./dist/cli.js"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js",
|
|
19
|
+
"require": "./dist/index.cjs"
|
|
20
|
+
},
|
|
21
|
+
"./next": {
|
|
22
|
+
"types": "./dist/next.d.ts",
|
|
23
|
+
"import": "./dist/next.js",
|
|
24
|
+
"require": "./dist/next.cjs"
|
|
25
|
+
},
|
|
26
|
+
"./i18n": {
|
|
27
|
+
"types": "./dist/i18n.d.ts",
|
|
28
|
+
"import": "./dist/i18n.js",
|
|
29
|
+
"require": "./dist/i18n.cjs"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "tsup src/index.ts src/cli.ts src/next.ts src/i18n.ts --format esm,cjs --dts",
|
|
37
|
+
"lint": "eslint src"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"commander": "^14.0.3"
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"tsup": "^8.5.0",
|
|
44
|
+
"typescript": "^5.9.3",
|
|
45
|
+
"eslint": "^9.37.0"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"@mohasinac/contracts": "workspace:*"
|
|
49
|
+
}
|
|
50
|
+
}
|