{"id":15504462,"url":"https://github.com/kwonoj/swc-plugin-vanilla-extract","last_synced_at":"2025-04-23T00:11:33.733Z","repository":{"id":59278513,"uuid":"534790408","full_name":"kwonoj/swc-plugin-vanilla-extract","owner":"kwonoj","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-12T17:13:27.000Z","size":354,"stargazers_count":32,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-10T09:42:06.223Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kwonoj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-09T20:07:47.000Z","updated_at":"2024-09-28T16:14:39.000Z","dependencies_parsed_at":"2024-08-23T21:10:01.369Z","dependency_job_id":"0335f2dd-0415-46f9-be67-01858c3f77c5","html_url":"https://github.com/kwonoj/swc-plugin-vanilla-extract","commit_stats":{"total_commits":22,"total_committers":1,"mean_commits":22.0,"dds":0.0,"last_synced_commit":"54f19b28d13da8076f7fe855d93dd6622f6b33fb"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwonoj%2Fswc-plugin-vanilla-extract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwonoj%2Fswc-plugin-vanilla-extract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwonoj%2Fswc-plugin-vanilla-extract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kwonoj%2Fswc-plugin-vanilla-extract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kwonoj","download_url":"https://codeload.github.com/kwonoj/swc-plugin-vanilla-extract/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250000871,"owners_count":21358817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T09:18:08.730Z","updated_at":"2025-04-23T00:11:33.710Z","avatar_url":"https://github.com/kwonoj.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SWC-plugin-vanilla-extract\n\n`SWC-plugin-vanilla-extract`\n\n`swc-plugin-vanilla-extract` is a port of `@vanilla-extract/babel-plugin` for the SWC. Transform can be performed either via SWC's wasm-based plugin, or using custom passes in rust side transform chains.\n\n## What does compatible exactly means?\n\nThis plugin attempts to mimic most of defined behavior of original plugin's test fixture. However, due to differences of plugin envioronment it does not support few things like reading package.json's dir, or packagename. Instead it uses current working directory with configurable package name. See the test cases how does it actually works.\n\n**NOTE: Package can have breaking changes without major semver bump**\n\nGiven SWC's plugin interface itself is under experimental stage does not gaurantee semver-based major bump yet, this package also does not gaurantee semver compliant breaking changes yet. Please refer changelogs if you're encountering unexpected breaking behavior across versions.\n\n# Usage\n\n## Using SWC's wasm-based experimental plugin\n\nFirst, install package via npm:\n\n```\nnpm install --save-dev swc-plugin-vanilla-extract\n```\n\nThen add plugin into swc's configuration:\n\n```\nconst pluginOptions = { packageName?: string }\n\njsc: {\n  ...\n  experimental: {\n    plugins: [\n      [\"swc-plugin-vanilla-extract\", pluginOptions]\n    ]\n  }\n}\n```\n\n## Using custom transform pass in rust\n\nThere is a single interface exposed to create a visitor for the transform, which you can pass into `before_custom_pass`.\n\n```\ncreate_extract_visitor\u003cC: Clone + Comments, S: SourceMapper\u003e(\n    _source_map: std::sync::Arc\u003cS\u003e,\n    _comments: C,\n    filename: \u0026str,\n    package_name: \u0026str,\n    package_dir: \u0026str,\n) -\u003e VanillaExtractVisitor\n```\n\n# Building / Testing\n\nThis package runs original plugin's fixture tests against SWC with its wasm plugin \u0026 custom transform both. `spec` contains set of the fixtures \u0026 unit test to run it, as well as supplimental packages to interop between instrumentation visitor to node.js runtime.\n\nFew npm scripts are supported for wrapping those setups.\n\n- `build:all`: Build all relative packages as debug build.\n- `test`: Runs unit test for wasm plugin \u0026 custom transform.\n- `test:debug`: Runs unit test, but only for `debug-test.yaml` fixture. This is mainly for local dev debugging for individual test fixture behavior.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwonoj%2Fswc-plugin-vanilla-extract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkwonoj%2Fswc-plugin-vanilla-extract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkwonoj%2Fswc-plugin-vanilla-extract/lists"}