@catchdrift/cli 0.1.21 → 0.1.22
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/package.json +1 -1
- package/src/lib/writers.mjs +5 -4
package/package.json
CHANGED
package/src/lib/writers.mjs
CHANGED
|
@@ -39,13 +39,14 @@ export function writeDriftConfig(cwd, { storybookUrl, chromaticUrl, figmaFiles,
|
|
|
39
39
|
figmaFilesBlock = ` figmaFiles: [\n${entries}\n ],`
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
// Figma token — read from env
|
|
42
|
+
// Figma token — read from env at runtime via a Record cast to avoid TS errors
|
|
43
|
+
// for undeclared env vars. The actual value comes from .env.local (gitignored).
|
|
43
44
|
let figmaTokenLine = null
|
|
44
45
|
if (hasFigma) {
|
|
45
46
|
const envExpr = framework === 'nextjs'
|
|
46
|
-
? `process.env
|
|
47
|
-
: `import.meta.env
|
|
48
|
-
figmaTokenLine = ` figmaToken: ${envExpr}, // set in .env.local — never commit your token`
|
|
47
|
+
? `(process.env as Record<string,string|undefined>)['NEXT_PUBLIC_FIGMA_TOKEN']`
|
|
48
|
+
: `(import.meta.env as Record<string,string|undefined>)['VITE_FIGMA_TOKEN']`
|
|
49
|
+
figmaTokenLine = ` figmaToken: ${envExpr}, // set VITE_FIGMA_TOKEN in .env.local — never commit your token`
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
const lines = [
|