-
Notifications
You must be signed in to change notification settings - Fork 63
Programmatic API
The API that used in most cases by itself. The main entry point being new Stylable() with stylable.analyze() and stylable.transform(), and may include higher level API containers in the future, for example: StylableLanguageService, StylableEditor, etc.
APIs that are not required for the normal transform flow offered by new Stylable(), like introspection & editing APIs, are exposed from @stylable/core. This is similar to the way Stylable exposes this type of API today, but is improved by setting formal naming conventions in order to help DX:
feature level APIs "[action] [feature] [context]":
-
parse -
parseModuleImportStatement -
validate -
validateCustomPropertyName -
ensure -
ensureModuleImport -
remove -
removeModuleImport -
get -
getMixinSymbols/getModuleDependencies
high level APIs "[action] [context]":
-
parse -
parseStylesheet -
transform -
transformSelector/transformAST/transformSelector
Some APIs are commonly used and might be cumbersome or complex so a simpler alternative is exposed on Stylable / StylableMeta instances:
stylable.getDependencies(meta)stylable.transform