@pandacss/compiler 2.0.0-beta.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.
@@ -0,0 +1,24 @@
1
+ import { Compiler, CompilerOptions } from '@pandacss/compiler-shared';
2
+ import { LoadConfigOptions } from '@pandacss/config';
3
+ export { LoadConfigOptions, LoadConfigResult } from '@pandacss/config';
4
+
5
+ interface LoadCompilerResult {
6
+ /** The compiler built from the loaded config snapshot. */
7
+ compiler: Compiler;
8
+ /** Resolved config path. */
9
+ path: string;
10
+ /** Module ids to watch for invalidation. */
11
+ dependencies: string[];
12
+ }
13
+ /**
14
+ * Node-only convenience: load a user's `panda.config.{ts,js,…}` from disk and
15
+ * build a compiler from it. Bundles + serializes the config via
16
+ * `@pandacss/config`, then feeds the snapshot to
17
+ * {@link createCompilerFromSnapshot} (live `transform` callbacks included).
18
+ *
19
+ * Pulls in Rolldown, so it lives on the `@pandacss/compiler/loader` subpath to
20
+ * keep the core entry dependency-light.
21
+ */
22
+ declare function loadCompiler(options: LoadConfigOptions, compilerOptions?: CompilerOptions): Promise<LoadCompilerResult>;
23
+
24
+ export { type LoadCompilerResult, loadCompiler };
package/dist/loader.js ADDED
@@ -0,0 +1,14 @@
1
+ import {
2
+ createCompilerFromSnapshot
3
+ } from "./chunk-7OM4CBA4.js";
4
+
5
+ // src/loader.ts
6
+ import { loadConfig } from "@pandacss/config";
7
+ async function loadCompiler(options, compilerOptions) {
8
+ const loaded = await loadConfig(options);
9
+ const compiler = createCompilerFromSnapshot({ config: loaded.config, callbacks: loaded.callbacks }, compilerOptions);
10
+ return { compiler, path: loaded.path, dependencies: loaded.dependencies };
11
+ }
12
+ export {
13
+ loadCompiler
14
+ };
package/package.json ADDED
@@ -0,0 +1,78 @@
1
+ {
2
+ "name": "@pandacss/compiler",
3
+ "version": "2.0.0-beta.0",
4
+ "description": "Native Rust binding for the Panda compiler engine",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "source": "./src/index.ts",
11
+ "types": "./dist/index.d.ts",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./loader": {
15
+ "source": "./src/loader.ts",
16
+ "types": "./dist/loader.d.ts",
17
+ "default": "./dist/loader.js"
18
+ },
19
+ "./package.json": "./package.json"
20
+ },
21
+ "author": "Segun Adebayo <joseshegs@gmail.com>",
22
+ "license": "MIT",
23
+ "sideEffects": false,
24
+ "homepage": "https://panda-css.com",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/chakra-ui/panda.git",
28
+ "directory": "packages/compiler"
29
+ },
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
33
+ "files": [
34
+ "dist",
35
+ "binding.cjs"
36
+ ],
37
+ "napi": {
38
+ "binaryName": "compiler",
39
+ "packageName": "@pandacss/compiler",
40
+ "targets": [
41
+ "aarch64-apple-darwin",
42
+ "x86_64-apple-darwin",
43
+ "x86_64-unknown-linux-gnu",
44
+ "aarch64-unknown-linux-gnu",
45
+ "x86_64-unknown-linux-musl",
46
+ "aarch64-unknown-linux-musl",
47
+ "x86_64-pc-windows-msvc",
48
+ "aarch64-pc-windows-msvc"
49
+ ]
50
+ },
51
+ "dependencies": {
52
+ "@pandacss/compiler-shared": "2.0.0-beta.0",
53
+ "@pandacss/config": "2.0.0-beta.0"
54
+ },
55
+ "devDependencies": {
56
+ "@napi-rs/cli": "^3.7.1",
57
+ "@pandacss/preset-base": "2.0.0-beta.0",
58
+ "@pandacss/preset-panda": "2.0.0-beta.0"
59
+ },
60
+ "optionalDependencies": {
61
+ "@pandacss/compiler-darwin-arm64": "2.0.0-beta.0",
62
+ "@pandacss/compiler-darwin-x64": "2.0.0-beta.0",
63
+ "@pandacss/compiler-linux-x64-gnu": "2.0.0-beta.0",
64
+ "@pandacss/compiler-linux-arm64-gnu": "2.0.0-beta.0",
65
+ "@pandacss/compiler-linux-x64-musl": "2.0.0-beta.0",
66
+ "@pandacss/compiler-linux-arm64-musl": "2.0.0-beta.0",
67
+ "@pandacss/compiler-win32-x64-msvc": "2.0.0-beta.0",
68
+ "@pandacss/compiler-win32-arm64-msvc": "2.0.0-beta.0"
69
+ },
70
+ "scripts": {
71
+ "build": "pnpm build:native && pnpm build:js",
72
+ "build:js": "tsup src/index.ts src/loader.ts --format=esm --platform=node --dts",
73
+ "build:fast": "tsup src/index.ts src/loader.ts --format=esm --platform=node --no-dts",
74
+ "build:native": "napi build --platform --release --manifest-path crate/Cargo.toml --output-dir . --js binding.cjs --dts native.d.ts",
75
+ "dev": "pnpm build:fast --watch",
76
+ "test": "vitest run"
77
+ }
78
+ }