-
-
Notifications
You must be signed in to change notification settings - Fork 240
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e169b6
commit 2f63a4c
Showing
4 changed files
with
26 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@pandacss/config': patch | ||
--- | ||
|
||
Fix issue where panda could load unrelated config files that look like a config e.g. `theming-panda.config.ts` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { isPandaConfig } from '../src/is-panda-config' | ||
|
||
describe('is-panda-config', () => { | ||
test('should work as expected', () => { | ||
expect(isPandaConfig('panda.config.ts')).toBe(true) | ||
expect(isPandaConfig('testing-panda.config.ts')).toBe(false) | ||
expect(isPandaConfig('panda-config.ts')).toBe(false) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,12 @@ | ||
const configs = ['.ts', '.js', '.mts', '.mjs', '.cts', '.cjs'] | ||
const pandaConfigRegex = new RegExp(`panda.config(${configs.join('|')})$`) | ||
const configName = 'panda' | ||
|
||
export const isPandaConfig = (file: string) => pandaConfigRegex.test(file) | ||
const pandaConfigFiles = new Set([ | ||
`${configName}.config.ts`, | ||
`${configName}.config.js`, | ||
`${configName}.config.mts`, | ||
`${configName}.config.mjs`, | ||
`${configName}.config.cts`, | ||
`${configName}.config.cjs`, | ||
]) | ||
|
||
export const isPandaConfig = (file: string) => pandaConfigFiles.has(file) |