[package]
authors = ["강동윤 <kdy1997.dev@gmail.com>", "OJ Kwon <kwon.ohjoong@gmail.com>"]
description = "TBD"
edition = "2021"
license = "Apache-2.0"
name = "swc_core"
repository = "https://github.com/swc-project/swc.git"
version = "0.1.1"

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
### Public features
### Users should opt in necessary features explicitly

## General
# Enable `quote!` macro support.
quote = ["swc_ecma_quote"]

## Plugins
# Top level features should be enabled to write plugins for the custom transform.
plugin_transform = [
  # Dependent features
  "__plugin_transform",
  "__common",
  "__ast",
  "__visit",
  "__plugin_transform_schema_v1", # Enable optional packages
  "swc_common/plugin-mode",
  "swc_plugin_proxy/plugin-mode",
  "swc_plugin_macro",
  "swc_plugin",
  "once_cell",
]

### Internal features that public features are relying on.
### This is not supposed to be used directly, and does not gaurantee
### stability across each versions.

# Specify version of AST schema will be used.
# This'll be automatically selected via transform_plugin features,
# SWC upstream decides which version to be used for specific version of
# swc_core.
__plugin_transform_schema_v1 = ["swc_common/plugin_transform_schema_v1"]

# Do not use: testing purpose only
__plugin_transform_schema_vtest = ["swc_common/plugin_transform_schema_vtest"]

## Plugins

# Internal flags for any transform plugin feature
__plugin_transform = []

# Do not use: testing purpose only
# Force enable different version of AST schema
__plugin_transform_schema_test = [
  # Dependent features
  "__plugin_transform",
  "__common",
  "__ast",
  "__visit",
  "__plugin_transform_schema_vtest", # Enable optional packages
  "swc_common/plugin-mode",
  "swc_plugin_proxy/plugin-mode",
  "swc_plugin_macro",
  "swc_plugin",
  "once_cell",
]

## Common
__common = ["swc_common"]

## TODO: Should this be public?
## AST
__ast = ["swc_ecma_ast/rkyv-impl", "swc_atoms"]
__visit = ["swc_ecma_visit"]

[dependencies]
once_cell = { optional = true, version = "1.13.0" }
swc_atoms = { optional = true, version = "0.3.1", path = "../swc_atoms" }
swc_common = { optional = true, version = "0.26.0", path = "../swc_common" }
swc_ecma_ast = { optional = true, version = "0.89.1", path = "../swc_ecma_ast" }
swc_ecma_quote = { optional = true, version = "0.30.0", path = "../swc_ecma_quote" }
swc_ecma_visit = { optional = true, version = "0.75.0", path = "../swc_ecma_visit" }
swc_plugin = { optional = true, version = "0.88.2", path = "../swc_plugin" }
swc_plugin_macro = { optional = true, version = "0.9.0", path = "../swc_plugin_macro" }
swc_plugin_proxy = { optional = true, version = "0.17.0", path = "../swc_plugin_proxy" }