@stylexjs/babel-plugin 0.5.0 → 0.6.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.
@@ -7,6 +7,7 @@
7
7
  *
8
8
  */
9
9
 
10
+ import type { FlatCompiledStyles } from '../../../shared/src/common-types';
10
11
  import * as t from '@babel/types';
11
12
  import { IncludedStyles } from '@stylexjs/shared';
12
13
  type NestedStringObject = Readonly<{
@@ -21,3 +22,6 @@ type NestedStringObject = Readonly<{
21
22
  export declare function convertObjectToAST(
22
23
  obj: NestedStringObject,
23
24
  ): t.ObjectExpression;
25
+ export declare function removeObjectsWithSpreads(obj: {
26
+ readonly [$$Key$$: string]: FlatCompiledStyles;
27
+ }): { readonly [$$Key$$: string]: FlatCompiledStyles };
@@ -7,6 +7,8 @@
7
7
  * @flow strict
8
8
  */
9
9
 
10
+ import type { FlatCompiledStyles } from '../../../shared/src/common-types';
11
+
10
12
  import * as t from '../../flow_modules/@babel/types';
11
13
  import { IncludedStyles } from '@stylexjs/shared';
12
14
 
@@ -23,3 +25,7 @@ type NestedStringObject = $ReadOnly<{
23
25
  declare export function convertObjectToAST(
24
26
  obj: NestedStringObject,
25
27
  ): t.ObjectExpression;
28
+
29
+ declare export function removeObjectsWithSpreads(obj: {
30
+ +[string]: FlatCompiledStyles,
31
+ }): { +[string]: FlatCompiledStyles };
@@ -143,6 +143,12 @@ declare class StateManager {
143
143
  get fileNameForHashing(): null | string;
144
144
  importPathResolver(importPath: string): ImportPathResolution;
145
145
  addStyle(style: [string, { ltr: string; rtl?: string | null }, number]): void;
146
+ registerStyles(
147
+ styles: ReadonlyArray<
148
+ [string, { ltr: string; rtl?: string | null }, number]
149
+ >,
150
+ path?: null | undefined | NodePath,
151
+ ): void;
146
152
  markComposedNamespace(
147
153
  memberExpression: [string, true | string, true | Array<string>],
148
154
  ): void;
@@ -106,6 +106,12 @@ declare export default class StateManager {
106
106
  get fileNameForHashing(): null | string;
107
107
  importPathResolver(importPath: string): ImportPathResolution;
108
108
  addStyle(style: [string, { ltr: string, rtl?: string | null }, number]): void;
109
+ registerStyles(
110
+ styles: $ReadOnlyArray<
111
+ [string, { ltr: string, rtl?: string | null }, number],
112
+ >,
113
+ path?: ?NodePath<>,
114
+ ): void;
109
115
  markComposedNamespace(
110
116
  memberExpression: [string, true | string, true | Array<string>],
111
117
  ): void;
@@ -8,13 +8,14 @@
8
8
  */
9
9
 
10
10
  export type Check<T> = (val: unknown, name?: string) => Error | T;
11
- export type InferCheckType<T> = T extends Check<infer U>
12
- ? U
13
- : /**
14
- * > 11 | export type InferCheckType<T> = T extends Check<infer U> ? U : empty;
15
- * | ^^^^^ Unsupported feature: Translating "empty type" is currently not supported.
16
- **/
17
- any;
11
+ export type InferCheckType<T> =
12
+ T extends Check<infer U>
13
+ ? U
14
+ : /**
15
+ * > 11 | export type InferCheckType<T> = T extends Check<infer U> ? U : empty;
16
+ * | ^^^^^ Unsupported feature: Translating "empty type" is currently not supported.
17
+ **/
18
+ any;
18
19
  type Msg = (value: unknown, name?: string) => string;
19
20
  type PrimitiveChecker<T> = (message?: Msg) => Check<T>;
20
21
  export declare const string: PrimitiveChecker<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stylexjs/babel-plugin",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "StyleX babel plugin.",
5
5
  "main": "lib/index.js",
6
6
  "repository": "https://github.com/facebook/stylex",
@@ -14,8 +14,8 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "@babel/helper-module-imports": "^7.22.15",
17
- "@stylexjs/shared": "0.5.0",
18
- "@stylexjs/stylex": "0.5.0",
17
+ "@stylexjs/shared": "0.6.0",
18
+ "@stylexjs/stylex": "0.6.0",
19
19
  "@babel/core": "^7.23.6",
20
20
  "@babel/traverse": "^7.23.6",
21
21
  "@babel/types": "^7.23.6"