@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.
@@ -21,6 +21,7 @@ function buildBackendPackageJson({ medusa, plugins, projectName = "backend" }) {
21
21
  "@types/node": "^20.12.11",
22
22
  typescript: "^5.6.2",
23
23
  "ts-node": "^10.9.2",
24
+ "react-is": "^19.0.0",
24
25
  },
25
26
  engines: {
26
27
  node: ">=20",
@@ -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
- preset === "full"
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]: {
@@ -50,6 +50,10 @@
50
50
  "medusa-customer-file-upload",
51
51
  "medusa-analytics",
52
52
  "medusa-export",
53
- "medusa-payment-provider"
53
+ "medusa-payment-provider",
54
+ "@tsc_tech/medusa-plugin-smtp"
55
+ ],
56
+ "moduleOnlyPlugins": [
57
+ "@tsc_tech/medusa-plugin-smtp"
54
58
  ]
55
59
  }
@@ -160,7 +160,11 @@ function main() {
160
160
 
161
161
  writeFileSync(
162
162
  join(outDir, "medusa-config.ts"),
163
- generateMedusaConfig({ enabledPlugins, preset })
163
+ generateMedusaConfig({
164
+ enabledPlugins,
165
+ preset,
166
+ moduleOnlyPlugins: defaults.moduleOnlyPlugins || [],
167
+ })
164
168
  )
165
169
 
166
170
  writeFileSync(
@@ -282,9 +282,10 @@ function syncBackendDynamicConfigFromBuild(pagesConfig) {
282
282
  })
283
283
 
284
284
  if (result.synced) {
285
- console.log(
286
- ` dynamic-config: synced ${result.fieldCount} field(s) to backend/config/homepage-config.json`
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pradip1995/framework-compiler",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {