@pradip1995/framework-compiler 0.2.0 → 0.2.1
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/bin/storefront-build.js +1 -16
- package/package.json +1 -1
package/bin/storefront-build.js
CHANGED
|
@@ -13,21 +13,7 @@ const require = createRequire(import.meta.url)
|
|
|
13
13
|
const clientDir = resolve(process.cwd())
|
|
14
14
|
const outDir = join(clientDir, ".generated-app")
|
|
15
15
|
|
|
16
|
-
function loadClientTheme(clientDir) {
|
|
17
|
-
return loadClientStorefrontConfig(clientDir).theme
|
|
18
|
-
}
|
|
19
|
-
|
|
20
16
|
function loadClientStorefrontConfig(clientDir) {
|
|
21
|
-
const envPath = join(clientDir, ".env.local")
|
|
22
|
-
let envTheme = "valero"
|
|
23
|
-
if (existsSync(envPath)) {
|
|
24
|
-
const text = readFileSync(envPath, "utf8")
|
|
25
|
-
const match = text.match(/NEXT_PUBLIC_STOREFRONT_THEME=(.+)/)
|
|
26
|
-
const raw = match?.[1]?.trim().replace(/^["']|["']$/g, "") || "valero"
|
|
27
|
-
const map = { sahsha: "impulse", impulse: "impulse", valero: "valero" }
|
|
28
|
-
envTheme = map[raw] || "valero"
|
|
29
|
-
}
|
|
30
|
-
|
|
31
17
|
let raw = {}
|
|
32
18
|
const jsonPath = join(clientDir, "storefront.config.json")
|
|
33
19
|
const tsPath = join(clientDir, "storefront.config.ts")
|
|
@@ -48,7 +34,6 @@ function loadClientStorefrontConfig(clientDir) {
|
|
|
48
34
|
}
|
|
49
35
|
|
|
50
36
|
return {
|
|
51
|
-
theme: envTheme,
|
|
52
37
|
defaultCountryCode: raw.defaultCountryCode || "in",
|
|
53
38
|
loader,
|
|
54
39
|
}
|
|
@@ -56,7 +41,7 @@ function loadClientStorefrontConfig(clientDir) {
|
|
|
56
41
|
|
|
57
42
|
function generateRootLayout(config) {
|
|
58
43
|
const loaderJson = JSON.stringify(config.loader)
|
|
59
|
-
return `import "@pradip1995/segment-tokens/
|
|
44
|
+
return `import "@pradip1995/segment-tokens/theme.css"
|
|
60
45
|
import "./globals.css"
|
|
61
46
|
import { LoaderProvider, GlobalLoader } from "@pradip1995/segment-loader"
|
|
62
47
|
|