@style-this/core 0.1.2 → 0.1.4

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.
@@ -6,26 +6,32 @@ declare class Transformer$1 {
6
6
  free(): void;
7
7
  [Symbol.dispose](): void;
8
8
  constructor(opts: any);
9
- transform(code: string, filepath: string, import_source?: string | null): Promise<any | undefined>;
9
+ transform(code: string, filepath: string, skip_css_eval: boolean, import_source?: string | null): Promise<any | undefined>;
10
10
  }
11
11
  //#endregion
12
12
  //#region src/compiler.d.ts
13
13
  interface Transformer extends Omit<Transformer$1, "transform"> {
14
- transform(code: string, filepath: string, importSource?: string): Promise<{
14
+ transform(code: string, filepath: string, skipCssEval: boolean, importSource?: string): Promise<{
15
15
  code: string;
16
16
  sourcemap: string;
17
17
  temporaryPrograms: string[];
18
18
  } | undefined>;
19
19
  }
20
+ type CssCachEntry = Promise<string> & {
21
+ resolve: (value: string) => void;
22
+ reject: (error: Error) => void;
23
+ };
20
24
  declare const Transformer: new (opts: {
21
25
  cwd: string;
26
+ ignoredImports: Record<string, string[]>;
22
27
  loadFile: (filepath: string, importer: string) => Promise<[string, string]>;
23
- cssFileStore: Map<string, string>;
24
- exportCache: Record<string, Record<string, any>>;
25
- cssExtension: string;
28
+ cssCache: Map<string, CssCachEntry>;
29
+ valueCache: Record<string, Record<string, any>>;
26
30
  wrapSelectorsWithGlobal?: boolean;
31
+ cssExtension: string;
32
+ useRequire?: boolean;
27
33
  }) => Transformer;
28
34
  declare const initializeStyleThis: () => Promise<void>;
29
35
  //#endregion
30
- export { Transformer, initializeStyleThis };
36
+ export { CssCachEntry, Transformer, initializeStyleThis };
31
37
  //# sourceMappingURL=compiler.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"compiler.d.cts","names":["Transformer","Symbol","dispose","Promise","initialize","InitInput","RequestInfo","URL","Response","BufferSource","WebAssembly","Module","InitOutput","Memory","Table","SyncInitInput","initSync","__wbg_init","default"],"sources":["../native/pkg/style_this.d.ts","../src/compiler.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n\nexport class Transformer {\n free(): void;\n [Symbol.dispose](): void;\n constructor(opts: any);\n transform(code: string, filepath: string, import_source?: string | null): Promise<any | undefined>;\n}\n\nexport function initialize(): void;\n\nexport type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;\n\nexport interface InitOutput {\n readonly memory: WebAssembly.Memory;\n readonly __wbg_transformer_free: (a: number, b: number) => void;\n readonly transformer_new: (a: any) => number;\n readonly transformer_transform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;\n readonly initialize: () => void;\n readonly wasm_bindgen__convert__closures_____invoke__hfe6a4a76b5e0fdbe: (a: number, b: number, c: any) => void;\n readonly wasm_bindgen__closure__destroy__hc2d6b7cd70f3b545: (a: number, b: number) => void;\n readonly wasm_bindgen__convert__closures_____invoke__h3c226b569f92c761: (a: number, b: number, c: any, d: any) => void;\n readonly __wbindgen_malloc: (a: number, b: number) => number;\n readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;\n readonly __wbindgen_exn_store: (a: number) => void;\n readonly __externref_table_alloc: () => number;\n readonly __wbindgen_externrefs: WebAssembly.Table;\n readonly __wbindgen_free: (a: number, b: number, c: number) => void;\n readonly __wbindgen_start: () => void;\n}\n\nexport type SyncInitInput = BufferSource | WebAssembly.Module;\n\n/**\n* Instantiates the given `module`, which can either be bytes or\n* a precompiled `WebAssembly.Module`.\n*\n* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.\n*\n* @returns {InitOutput}\n*/\nexport function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;\n\n/**\n* If `module_or_path` is {RequestInfo} or {URL}, makes a request and\n* for everything else, calls `WebAssembly.instantiate` directly.\n*\n* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.\n*\n* @returns {Promise<InitOutput>}\n*/\nexport default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;\n"],"mappings":";;AAGA;;cAAaA,aAAAA;;ECEb,CDAGC,MAAAA,CAAOC,OAAAA,GCAmB,EAAA,IAAA;EAAa,WAAA,CAAA,IAAA,EAAA,GAAA;EAKrC,SAAA,CAAA,IAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,aAAA,CAAA,EAAA,MAAA,GAAA,IAAA,CAAA,EDHuEC,OCGvE,CAAA,GAAA,GAAA,SAAA,CAAA;;;;ADPQH,UCEI,WAAA,SAAoB,IDA3BE,CCAgC,aDEkCC,EAAO,WAAA,CAAA,CAAA;oECG9E;;;IALY,iBAAY,EAAA,MAAA,EAAA;EAAa,CAAA,GAAA,SAAA,CAAA;;AAAL,cAgBxB,WAhBwB,EAAA,KAAA,IAAA,EAAA;EAAI,GAAA,EAAA,MAAA;EAgB5B,QAAA,EAAA,CAAA,QAOI,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,GALmC,OAKnC,CAAA,CAAA,MAAA,EAAA,MAAA,CAAA,CAAA;EALmC,YAAA,EACpC,GADoC,CAAA,MAAA,EAAA,MAAA,CAAA;EACpC,WAAA,EACD,MADC,CAAA,MAAA,EACc,MADd,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA;EACc,YAAA,EAAA,MAAA;EAAf,uBAAA,CAAA,EAAA,OAAA;CAGT,EAAA,GAAA,WAAA;AAAW,cAEJ,mBAFI,EAAA,GAAA,GAEe,OAFf,CAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"compiler.d.cts","names":["Transformer","Symbol","dispose","Promise","initialize","InitInput","RequestInfo","URL","Response","BufferSource","WebAssembly","Module","InitOutput","Memory","Table","SyncInitInput","initSync","__wbg_init","default"],"sources":["../native/pkg/style_this.d.ts","../src/compiler.ts"],"sourcesContent":["/* tslint:disable */\n/* eslint-disable */\n\nexport class Transformer {\n free(): void;\n [Symbol.dispose](): void;\n constructor(opts: any);\n transform(code: string, filepath: string, skip_css_eval: boolean, import_source?: string | null): Promise<any | undefined>;\n}\n\nexport function initialize(): void;\n\nexport type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;\n\nexport interface InitOutput {\n readonly memory: WebAssembly.Memory;\n readonly __wbg_transformer_free: (a: number, b: number) => void;\n readonly transformer_new: (a: any) => number;\n readonly transformer_transform: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => any;\n readonly initialize: () => void;\n readonly wasm_bindgen__convert__closures_____invoke__h011f6951b77633db: (a: number, b: number, c: any) => void;\n readonly wasm_bindgen__closure__destroy__h4fe13f17b5a5dde9: (a: number, b: number) => void;\n readonly wasm_bindgen__convert__closures_____invoke__h8238ca605d8fd58c: (a: number, b: number, c: any, d: any) => void;\n readonly __wbindgen_malloc: (a: number, b: number) => number;\n readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;\n readonly __wbindgen_exn_store: (a: number) => void;\n readonly __externref_table_alloc: () => number;\n readonly __wbindgen_externrefs: WebAssembly.Table;\n readonly __wbindgen_free: (a: number, b: number, c: number) => void;\n readonly __wbindgen_start: () => void;\n}\n\nexport type SyncInitInput = BufferSource | WebAssembly.Module;\n\n/**\n* Instantiates the given `module`, which can either be bytes or\n* a precompiled `WebAssembly.Module`.\n*\n* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.\n*\n* @returns {InitOutput}\n*/\nexport function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;\n\n/**\n* If `module_or_path` is {RequestInfo} or {URL}, makes a request and\n* for everything else, calls `WebAssembly.instantiate` directly.\n*\n* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.\n*\n* @returns {Promise<InitOutput>}\n*/\nexport default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;\n"],"mappings":";;AAGA;;cAAaA,aAAAA;;ECEb,CDAGC,MAAAA,CAAOC,OAAAA,GCAmB,EAAA,IAAA;EAAa,WAAA,CAAA,IAAA,EAAA,GAAA;EAMrC,SAAA,CAAA,IAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,aAAA,EAAA,OAAA,EAAA,aAAA,CAAA,EAAA,MAAA,GAAA,IAAA,CAAA,EDJ+FC,OCI/F,CAAA,GAAA,GAAA,SAAA,CAAA;;;;ADRQH,UCEI,WAAA,SAAoB,IDA3BE,CCAgC,aDE0DC,EAAO,WAAA,CAAA,CAAA;0FCItG;;;IANY,iBAAY,EAAA,MAAA,EAAA;EAAa,CAAA,GAAA,SAAA,CAAA;;AAAL,KAgBzB,YAAA,GAAe,OAhBU,CAAA,MAAA,CAAA,GAAA;EAAI,OAAA,EAAA,CAAA,KAAA,EAAA,MAAA,EAAA,GAAA,IAAA;EAgB7B,MAAA,EAAA,CAAA,KAAA,EAEM,KAFM,EAAA,GAAG,IAAA;AAM3B,CAAA;AAEkB,cAFL,WAEK,EAAA,KAAA,IAAA,EAAA;EAEkC,GAAA,EAAA,MAAA;EAE5B,cAAA,EAJN,MAIM,CAAA,MAAA,EAAA,MAAA,EAAA,CAAA;EAAZ,QAAA,EAAA,CAAA,QAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,GAFwC,OAExC,CAAA,CAAA,MAAA,EAAA,MAAA,CAAA,CAAA;EACiB,QAAA,EADjB,GACiB,CAAA,MAAA,EADL,YACK,CAAA;EAAf,UAAA,EAAA,MAAA,CAAA,MAAA,EAAe,MAAf,CAAA,MAAA,EAAA,GAAA,CAAA,CAAA;EAMR,uBAAA,CAAA,EAAA,OAAA;EAAW,YAAA,EAAA,MAAA;EAEJ,UAAA,CAAA,EAAA,OAAA;MAFP;cAEO,2BAAmB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@style-this/core",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "CSS-in-JS library for the modern web - core module",
5
5
  "type": "module",
6
6
  "files": [
@@ -32,7 +32,9 @@
32
32
  },
33
33
  "scripts": {
34
34
  "build": "pnpm build:native && pnpm build:js",
35
- "build:native": "cd native && wasm-pack build -t web",
35
+ "build:dev": "pnpm build:native:dev && pnpm build:js",
36
+ "build:native": "cd native && wasm-pack build -t web --release && wasm-opt -O2 pkg/style_this_bg.wasm -o pkg/style_this_bg.wasm",
37
+ "build:native:dev": "cd native && wasm-pack build -t web",
36
38
  "build:js": "tsdown",
37
39
  "dev": "tsdown --watch",
38
40
  "lint": "eslint",