@stylexjs/babel-plugin 0.2.0-beta.9 → 0.4.0

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.
Files changed (39) hide show
  1. package/README.md +2 -4
  2. package/flow_modules/@babel/core/index.js.flow +854 -0
  3. package/flow_modules/@babel/generator/index.js.flow +216 -0
  4. package/flow_modules/@babel/helper-module-imports/index.js.flow +182 -0
  5. package/flow_modules/@babel/parser/index.js.flow +253 -0
  6. package/flow_modules/@babel/traverse/index.js.flow +1003 -0
  7. package/flow_modules/@babel/types/index.js.flow +5224 -0
  8. package/lib/babel-path-utils.d.ts +1100 -0
  9. package/lib/babel-path-utils.js.flow +1108 -0
  10. package/lib/index.d.ts +46 -0
  11. package/lib/index.js +4082 -2822
  12. package/lib/index.js.flow +50 -0
  13. package/lib/utils/dev-classname.d.ts +26 -0
  14. package/lib/utils/dev-classname.js.flow +31 -0
  15. package/lib/utils/evaluate-path.d.ts +29 -0
  16. package/lib/utils/evaluate-path.js.flow +37 -0
  17. package/lib/utils/helpers.d.ts +12 -0
  18. package/lib/utils/helpers.js.flow +10 -0
  19. package/lib/utils/js-to-ast.d.ts +23 -0
  20. package/lib/utils/js-to-ast.js.flow +25 -0
  21. package/lib/utils/state-manager.d.ts +110 -0
  22. package/lib/utils/state-manager.js.flow +91 -0
  23. package/lib/visitors/imports.d.ts +20 -0
  24. package/lib/visitors/imports.js.flow +24 -0
  25. package/lib/visitors/stylex-create/index.d.ts +17 -0
  26. package/lib/visitors/stylex-create/index.js.flow +24 -0
  27. package/lib/visitors/stylex-create/parse-stylex-create-arg.d.ts +28 -0
  28. package/lib/visitors/stylex-create/parse-stylex-create-arg.js.flow +30 -0
  29. package/lib/visitors/stylex-create-theme.d.ts +17 -0
  30. package/lib/visitors/stylex-create-theme.js.flow +23 -0
  31. package/lib/visitors/stylex-define-vars.d.ts +17 -0
  32. package/lib/visitors/stylex-define-vars.js.flow +23 -0
  33. package/lib/visitors/stylex-keyframes.d.ts +17 -0
  34. package/lib/visitors/stylex-keyframes.js.flow +23 -0
  35. package/lib/visitors/stylex-merge.d.ts +21 -0
  36. package/lib/visitors/stylex-merge.js.flow +25 -0
  37. package/lib/visitors/stylex-props.d.ts +21 -0
  38. package/lib/visitors/stylex-props.js.flow +25 -0
  39. package/package.json +15 -13
package/README.md CHANGED
@@ -5,8 +5,6 @@ In addition to transforming JS code, this plugin also produces an Array of CSS r
5
5
  generated from all JS files within your project should be concatenated together and converted to a CSS
6
6
  file using the `processStyles` function which is also exported from the same module.
7
7
 
8
- (NOTE: StyleX only uses RTL-friendly logical values of `start` and `end` and disallows using `left` and `right` entirely.)
9
-
10
8
  `@stylexjs/babel-plugin` is fairly lightweight. It pre-computes `stylex` related functions like
11
9
  `stylex.create` and `stylex.keyframes` by converting the argument AST to a JS object and transforming them
12
10
  by passing them to the functions of the corresponding names within `@stylex/shared`
@@ -14,12 +12,12 @@ by passing them to the functions of the corresponding names within `@stylex/shar
14
12
 
15
13
  ## Babel Metadata
16
14
 
17
- The StyleX Babel plugin does more than transform Javascript (or Typescript) files. It also returns a list of injected styles. The way that such a value can be returned while transforming a JS file is by using Babel's `metadata` API.
15
+ The StyleX Babel plugin does more than transform JavaScript (or TypeScript) files. It also returns a list of injected styles. The way that such a value can be returned while transforming a JS file is by using Babel's `metadata` API.
18
16
 
19
17
  An example of this can be seen in some of the tests, but the result of using Babel's `transform(...)` function returns an object contains at least two keys:
20
18
 
21
19
  1. `code` which is the transformed JS code
22
- 2. `metadata` is an object of metatdata that the plugin may want to return as a side-effect.
20
+ 2. `metadata` is an object of metadata that the plugin may want to return as a side-effect.
23
21
 
24
22
  e.g.
25
23