Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: inline @box-extractor/core as @pandacss/extractor #387

Merged
merged 50 commits into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
73065f0
feat(extractor): init package from @box-extractor/core + @box-extract…
astahmer Mar 28, 2023
6954ac5
test: update snapshots
astahmer Mar 28, 2023
de83b95
feat: add 2 latests versions of @box-extractor/core to the bench
astahmer Mar 28, 2023
c24af5b
refactor: swap dependency from @box-extractor/core to @pandacss/extra…
astahmer Mar 28, 2023
d180c9b
test: update snapshots after dep swap
astahmer Mar 28, 2023
0d5e25f
chore: lint + tsc fixes
astahmer Mar 28, 2023
dbd3fa8
fix: next playground
astahmer Mar 28, 2023
1f3bfee
chore: update
segunadebayo Mar 30, 2023
869b158
refactor: rename files
segunadebayo Mar 30, 2023
86ded41
refactor: first pass
segunadebayo Mar 31, 2023
5dfd549
refactor: pass 2
segunadebayo Mar 31, 2023
7207c3e
refactor: pass 3
segunadebayo Mar 31, 2023
ace80ce
refactor: rename is-resolvable
segunadebayo Apr 4, 2023
ca15ea1
refactor: cleanup for unbox and visit-box-node
segunadebayo Apr 4, 2023
c289f0a
Merge remote-tracking branch 'origin' into feat/inline-box-extractor
segunadebayo Apr 4, 2023
370bf15
refactor: get prop name
segunadebayo Apr 4, 2023
af94063
chore: update eval node
segunadebayo Apr 4, 2023
bb9d745
refactor: unbox alil
segunadebayo Apr 4, 2023
5e5d304
refactor: simplify and rename
segunadebayo Apr 5, 2023
fb5a609
refactor: more fns
segunadebayo Apr 5, 2023
908e7ea
refactor: extract
segunadebayo Apr 5, 2023
5ddf980
docs: rename recipe to cva
segunadebayo Apr 6, 2023
6eeb89e
refactor: remove global map
segunadebayo Apr 6, 2023
030f944
refactor: extract
segunadebayo Apr 6, 2023
b87c3cd
chore: cleanups
segunadebayo Apr 6, 2023
7fb805f
fix: classify
segunadebayo Apr 6, 2023
ae50b2d
Merge remote-tracking branch 'origin' into feat/inline-box-extractor
segunadebayo Apr 6, 2023
9a6a8ff
fix: eslint
segunadebayo Apr 6, 2023
12ce7d1
chore: reduce api surface
segunadebayo Apr 6, 2023
efb6c69
refactor: rename vars
segunadebayo Apr 6, 2023
3e90763
refactor: cast -> from
segunadebayo Apr 6, 2023
61e1261
refactor: list => array
segunadebayo Apr 6, 2023
45b26bd
fix: classify
segunadebayo Apr 6, 2023
75444dd
fix: ts
segunadebayo Apr 6, 2023
83505c4
test: update snapshot format
segunadebayo Apr 6, 2023
456e091
fix(extract): missing spreadConditions on CallExpression
astahmer Apr 10, 2023
8e4edaf
refactor(extract): spread gets inlined whenever possible
astahmer Apr 10, 2023
8bd995b
test: unskip some unbox tests
astahmer Apr 10, 2023
f35e82c
refactor(unbox): conditions/spreadConditions format
astahmer Apr 10, 2023
b4a8441
chore: update lil-fp
segunadebayo Apr 11, 2023
051adee
Merge remote-tracking branch 'origin' into feat/inline-box-extractor
segunadebayo Apr 11, 2023
d4623f9
chore: update deps
segunadebayo Apr 11, 2023
eff7826
chore: fix test types
astahmer Apr 11, 2023
88e53d0
fix: propagate unbox changes to parser+generator & update snapshots
astahmer Apr 11, 2023
09752da
chore: revert lock to pnpm 8 format
astahmer Apr 11, 2023
9b18b24
fix(unbox): fallback to empty object
astahmer Apr 11, 2023
eaebf20
chore: update pattern engine
segunadebayo Apr 11, 2023
cb56b64
Merge branch 'main' of github.com:chakra-ui/css-panda into feat/inlin…
segunadebayo Apr 11, 2023
d5ac6d4
chore: improve data output structure after extraction
segunadebayo Apr 11, 2023
ff19aa4
chore: rename to combine result
segunadebayo Apr 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/fresh-paws-cry.md
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
6 changes: 3 additions & 3 deletions docs/recipe/03-atomic-recipe.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ The inline recipe takes the following properties:
- `variants`: The variant styles for the recipe
- `defaultVariants`: The default variants for the recipe

To define an inline recipe, you’d need to use the `recipe` function like this.
To define an inline recipe, you’d need to use the `cva` function like this.

```jsx
import { recipe } from '../panda/css'
import { cva } from '../panda/css'

const button = recipe({
const button = cva({
base: {
display: 'flex',
},
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
"@types/node": "18.15.11",
"@typescript-eslint/eslint-plugin": "5.58.0",
"@typescript-eslint/parser": "5.58.0",
"concurrently": "^8.0.0",
"concurrently": "^8.0.1",
"husky": "8.0.3",
"lint-staged": "13.2.1",
"prettier": "2.8.7",
"ts-morph": "17.0.1",
"ts-morph": "18.0.0",
"tsup": "6.7.0",
"tsx": "3.12.6",
"typescript": "5.0.4",
Expand Down
48 changes: 48 additions & 0 deletions packages/extractor/__tests__/create-project.ts
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,
})
}
Loading