{"id":25577,"library":"featws-transpiler","title":"featws-transpiler","description":"A transpiler that converts FeatWS files (features.json, parameters.json, rules.featws) into GRL (Grule Rule Language) format for use with the Grule rule engine (https://github.com/hyperjumptech/grule-rule-engine). Current version is 0.7.4-rc1 (release candidate) with frequent releases. Supports special markers (# for features, $ for parameters, @ for groups), group definitions, JSON rules, and extended feature format. Key differentiator: designed specifically for Banco do Brasil's FeatWS ecosystem, not a general-purpose transpiler.","status":"active","version":"0.7.4-rc1","language":"javascript","source_language":"en","source_url":"https://github.com/bancodobrasil/featws-compiler","tags":["javascript"],"install":[{"cmd":"npm install featws-transpiler","lang":"bash","label":"npm"},{"cmd":"yarn add featws-transpiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add featws-transpiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM module. The package does not export a default function; use named import.","wrong":"const transpile = require('featws-transpiler')","symbol":"transpile","correct":"import { transpile } from 'featws-transpiler'"},{"note":"Type is exported for TypeScript usage. Not a class for instantiation.","wrong":"import FeaturesFile from 'featws-transpiler'","symbol":"FeaturesFile","correct":"import { FeaturesFile } from 'featws-transpiler'"},{"note":"Correct name is RulesFile (plural). Common misspelling as RuleFile.","wrong":"import { RuleFile } from 'featws-transpiler'","symbol":"RulesFile","correct":"import { RulesFile } from 'featws-transpiler'"}],"quickstart":{"code":"import { transpile } from 'featws-transpiler';\nimport { readFileSync } from 'fs';\n\nconst features = JSON.parse(readFileSync('features.json', 'utf8'));\nconst parameters = JSON.parse(readFileSync('parameters.json', 'utf8'));\nconst rules = readFileSync('rules.featws', 'utf8');\n\nconst result = transpile(features, parameters, rules);\nconsole.log(result.grlContent);\n","lang":"typescript","description":"Demonstrates reading required input files and calling the transpile function to generate GRL output."},"warnings":[{"fix":"Refer to the changelog: resolve parameter renamed or reordered. Check the new signature in the source.","message":"v0.7.0-rc1 changed parameters in transpile() call","severity":"breaking","affected_versions":">=0.7.0-rc1"},{"fix":"Always declare non-boolean features in features.json with explicit type.","message":"Default feature type is 'boolean' if not declared in features.json","severity":"gotcha","affected_versions":">=0.4.0"},{"fix":"Use # for features, $ for parameters, @ for groups. Otherwise transpiler may fail silently.","message":"Special markers #, $, @ are mandatory in rules.featws","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Update your code to use the new parameter name (e.g., 'resolver' or similar). Check release notes.","message":"v0.5.0-rc1 renamed 'resolve' parameter to something else","severity":"deprecated","affected_versions":">=0.5.0 <0.7.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install featws-transpiler'. For ESM, ensure package.json has 'type': 'module'.","cause":"Package not installed or ESM import not configured correctly.","error":"Error: Cannot find module 'featws-transpiler'"},{"fix":"Ensure features.json is an array of objects, not a single object. Use JSON.parse(file) correctly.","cause":"features parameter passed as object instead of array.","error":"TypeError: features is not iterable"},{"fix":"Declare the feature in features.json. Use extended format if needed. Ensure # is not escaped.","cause":"The # marker is not being recognized; may be due to incorrect context or missing feature definition.","error":"SyntaxError: Unexpected token '#' in rules.featws"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}