{"id":26508,"library":"trucks-compiler","title":"Trucks Compiler","description":"Web component compiler and package manager that compiles HTML-declared web components into separate JavaScript, CSS, and HTML files. Version 0.3.6 is the latest stable release, with infrequent updates. It uses a plugin architecture with multiple plugin types (core, protocol, transform, generator) and runs on Node.js >=4.0. Differentiators include full component tree transformation, custom plugin support, and multiple resolver protocols.","status":"active","version":"0.3.6","language":"javascript","source_language":"en","source_url":"https://github.com/tmpfs/trucks","tags":["javascript"],"install":[{"cmd":"npm install trucks-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add trucks-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add trucks-compiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS only; no ES module support.","wrong":"import trucks from 'trucks-compiler';","symbol":"trucks","correct":"const trucks = require('trucks-compiler');"},{"note":"Named export via destructuring or property access.","wrong":"const LOAD = require('trucks-compiler').LOAD;","symbol":"LOAD","correct":"const { LOAD } = require('trucks-compiler');"},{"note":"Use the named constant to avoid string literals.","wrong":"const PARSE = 'parse';","symbol":"PARSE","correct":"const { PARSE } = require('trucks-compiler');"}],"quickstart":{"code":"const trucks = require('trucks-compiler');\n\ntrucks({\n  files: ['components.html'],\n  transforms: ['skate'],\n  out: 'build',\n  force: true\n}, (err, state) => {\n  if (err) {\n    throw err;\n  }\n  console.log(state);\n});","lang":"javascript","description":"Demonstrates basic usage: compile a component HTML file with transforms and output directory."},"warnings":[{"fix":"Use require() instead of import.","message":"CommonJS only: package does not provide ESM exports; using ES import syntax will fail.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Wrap with Promise if async/await needed.","message":"Callback-based API: no Promise or async/await support; errors must be handled in callback.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure Node.js version >=4.0.","message":"Node.js engine restriction: requires Node >=4.0; may not work on older versions.","severity":"gotcha","affected_versions":">=0.0.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 trucks-compiler'.","cause":"Package not installed.","error":"Cannot find module 'trucks-compiler'"},{"fix":"Use 'const trucks = require(\"trucks-compiler\");'.","cause":"Incorrect import (ES import on CommonJS package).","error":"TypeError: trucks is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}