-
-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: inline @box-extractor/core as @pandacss/extractor (#387)
Co-authored-by: Segun Adebayo <joseshegs@gmail.com>
- Loading branch information
1 parent
d6f0215
commit 78f6012
Showing
68 changed files
with
22,731 additions
and
2,119 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,7 @@ | ||
--- | ||
'@pandacss/extractor': minor | ||
'@pandacss/parser': minor | ||
'@pandacss/types': minor | ||
--- | ||
|
||
refactor: swap dependency from @box-extractor/core to @pandacss/extractor |
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
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,48 @@ | ||
import { Project, ts } from 'ts-morph' | ||
import { extract } from '../src/extract' | ||
import { type ExtractOptions } from '../src/types' | ||
|
||
export const createProject = () => { | ||
return new Project({ | ||
compilerOptions: { | ||
jsx: ts.JsxEmit.React, | ||
jsxFactory: 'React.createElement', | ||
jsxFragmentFactory: 'React.Fragment', | ||
module: ts.ModuleKind.ESNext, | ||
target: ts.ScriptTarget.ESNext, | ||
noUnusedParameters: false, | ||
noEmit: true, | ||
useVirtualFileSystem: true, | ||
allowJs: true, | ||
}, | ||
skipAddingFilesFromTsConfig: true, | ||
skipFileDependencyResolution: true, | ||
skipLoadingLibFiles: true, | ||
}) | ||
} | ||
|
||
export type TestExtractOptions = Omit<ExtractOptions, 'ast'> & { tagNameList?: string[]; functionNameList?: string[] } | ||
export const getTestExtract = ( | ||
project: Project, | ||
code: string, | ||
{ tagNameList, functionNameList, ...options }: TestExtractOptions, | ||
) => { | ||
const sourceFile = project.createSourceFile('file.tsx', code, { overwrite: true, scriptKind: ts.ScriptKind.TSX }) | ||
return extract({ | ||
ast: sourceFile, | ||
...options, | ||
components: tagNameList | ||
? { | ||
matchTag: ({ tagName }) => tagNameList.includes(tagName), | ||
matchProp: () => true, | ||
} | ||
: options.components, | ||
functions: functionNameList | ||
? { | ||
matchFn: ({ fnName }) => functionNameList.includes(fnName), | ||
matchProp: () => true, | ||
matchArg: () => true, | ||
} | ||
: options.functions, | ||
}) | ||
} |
Oops, something went wrong.
78f6012
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
panda-app – ./
panda-app.vercel.app
panda-app-git-main-chakra-ui.vercel.app
panda-app-chakra-ui.vercel.app
78f6012
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
panda-playground – ./playground
panda-playground-git-main-chakra-ui.vercel.app
panda-playground-chakra-ui.vercel.app
panda-playground.vercel.app