@pradip1995/framework-compiler 0.3.1 → 0.3.3
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.
|
@@ -41,9 +41,11 @@ function formatPluginEntry(key, definition) {
|
|
|
41
41
|
return lines.join("\n")
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
function buildPluginsBlock(enabledPlugins) {
|
|
44
|
+
function buildPluginsBlock(enabledPlugins, moduleOnlyPlugins = []) {
|
|
45
|
+
const skip = new Set(moduleOnlyPlugins)
|
|
45
46
|
const entries = []
|
|
46
47
|
for (const key of enabledPlugins) {
|
|
48
|
+
if (skip.has(key)) continue
|
|
47
49
|
const definition = pluginDefinitions[key]
|
|
48
50
|
if (!definition) {
|
|
49
51
|
throw new Error(`Unknown plugin "${key}" — add it to plugin-definitions.cjs or remove from plugins.config.json`)
|
|
@@ -57,12 +59,13 @@ function hasPlugin(enabledPlugins, name) {
|
|
|
57
59
|
return enabledPlugins.includes(name)
|
|
58
60
|
}
|
|
59
61
|
|
|
60
|
-
function generateMedusaConfig({ enabledPlugins, preset = "full" }) {
|
|
62
|
+
function generateMedusaConfig({ enabledPlugins, preset = "full", moduleOnlyPlugins = [] }) {
|
|
61
63
|
const useShiprocket =
|
|
62
64
|
preset === "full" && hasPlugin(enabledPlugins, "medusa-shiprocket-fulfillment-sbl")
|
|
63
65
|
const usePaymentProvider =
|
|
64
66
|
preset === "full" && hasPlugin(enabledPlugins, "medusa-payment-provider")
|
|
65
67
|
const useCustomerRegistration = hasPlugin(enabledPlugins, "customer-registration")
|
|
68
|
+
const useSmtpPlugin = hasPlugin(enabledPlugins, "@tsc_tech/medusa-plugin-smtp")
|
|
66
69
|
|
|
67
70
|
const fulfillmentProviders = useShiprocket
|
|
68
71
|
? ` providers: [
|
|
@@ -137,9 +140,8 @@ function generateMedusaConfig({ enabledPlugins, preset = "full" }) {
|
|
|
137
140
|
: {}),`
|
|
138
141
|
: ""
|
|
139
142
|
|
|
140
|
-
const notificationModule =
|
|
141
|
-
|
|
142
|
-
? `
|
|
143
|
+
const notificationModule = useSmtpPlugin
|
|
144
|
+
? `
|
|
143
145
|
...(process.env.SMTP_HOST
|
|
144
146
|
? {
|
|
145
147
|
[Modules.NOTIFICATION]: {
|
|
@@ -165,7 +167,7 @@ function generateMedusaConfig({ enabledPlugins, preset = "full" }) {
|
|
|
165
167
|
},
|
|
166
168
|
}
|
|
167
169
|
: {}),`
|
|
168
|
-
|
|
170
|
+
: ""
|
|
169
171
|
|
|
170
172
|
const fileModule =
|
|
171
173
|
preset === "full"
|
|
@@ -244,7 +246,7 @@ module.exports = defineConfig({
|
|
|
244
246
|
},
|
|
245
247
|
},
|
|
246
248
|
plugins: [
|
|
247
|
-
${buildPluginsBlock(enabledPlugins)}
|
|
249
|
+
${buildPluginsBlock(enabledPlugins, moduleOnlyPlugins)}
|
|
248
250
|
],
|
|
249
251
|
modules: {
|
|
250
252
|
[Modules.AUTH]: {
|
package/bin/backend-build.js
CHANGED
|
@@ -160,7 +160,11 @@ function main() {
|
|
|
160
160
|
|
|
161
161
|
writeFileSync(
|
|
162
162
|
join(outDir, "medusa-config.ts"),
|
|
163
|
-
generateMedusaConfig({
|
|
163
|
+
generateMedusaConfig({
|
|
164
|
+
enabledPlugins,
|
|
165
|
+
preset,
|
|
166
|
+
moduleOnlyPlugins: defaults.moduleOnlyPlugins || [],
|
|
167
|
+
})
|
|
164
168
|
)
|
|
165
169
|
|
|
166
170
|
writeFileSync(
|
package/bin/storefront-build.js
CHANGED
|
@@ -282,9 +282,10 @@ function syncBackendDynamicConfigFromBuild(pagesConfig) {
|
|
|
282
282
|
})
|
|
283
283
|
|
|
284
284
|
if (result.synced) {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
285
|
+
const relPath = result.backendConfigPath
|
|
286
|
+
? relative(join(clientDir, ".."), result.backendConfigPath)
|
|
287
|
+
: "backend/.generated-backend/config/homepage-config.json"
|
|
288
|
+
console.log(` dynamic-config: synced ${result.fieldCount} field(s) to ${relPath}`)
|
|
288
289
|
for (const warning of result.warnings || []) {
|
|
289
290
|
console.warn(` dynamic-config: ${warning}`)
|
|
290
291
|
}
|