
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
@scania/tegel-cli
Advanced tools
CLI tool for copying and transforming Tegel components with custom prefixes
⚠️ Warning: This tool is currently in development. Use with caution in production environments. This is only intended for use in microfrontends built with stencil.js
A command-line tool for copying and transforming Tegel design system components with custom prefixes. This tool enables microfrontend teams to use Tegel components with their own naming conventions to avoid Web Component registration conflicts.
The Tegel CLI provides a shadcn-style approach to using Tegel components. Instead of installing components as dependencies, components are copied directly into your project with automatic transformation of all references (component tags, DOM queries, CSS classes) to use your custom prefix.
This solves the Web Components registration conflict when multiple versions of Tegel are used in the same page.
tds-button → my-button)npm install -D @scania/tegel-cli
# or
yarn add -D @scania/tegel-cli
# or
pnpm add -D @scania/tegel-cli
Or use directly with npx:
npx @scania/tegel-cli init
Initialize Tegel in your project:
npx @scania/tegel-cli init
Add components:
# Interactive selection
npx @scania/tegel-cli add
# Add specific components
npx @scania/tegel-cli add button dropdown modal
Use the components with your prefix:
<!-- Assuming prefix is 'my' -->
<my-button variant="primary">Click me</my-button>
<my-dropdown placeholder="Select option">
<my-dropdown-option value="1">Option 1</my-dropdown-option>
</my-dropdown>
initInitialize Tegel configuration in your project.
npx @scania/tegel-cli init [options]
Options:
-f, --force Overwrite existing configuration
Creates a .tegelrc.json configuration file with interactive prompts for:
addAdd Tegel components to your project.
npx @scania/tegel-cli add [components...] [options]
Options:
-p, --prefix <prefix> Override default prefix
-a, --all Add all available components
--no-deps Skip dependency installation
--dry-run Preview changes without writing files
-f, --force Overwrite existing files without prompting
Examples:
# Interactive component selection
npx @scania/tegel-cli add
# Add specific components
npx @scania/tegel-cli add button card modal
# Add all components
npx @scania/tegel-cli add --all
# Preview what would be added
npx @scania/tegel-cli add button --dry-run
When adding components that already exist, the CLI will show a multi-select prompt allowing you to choose which files to override.
updateUpdate existing components to the latest version.
npx @scania/tegel-cli update [components...] [options]
Options:
-a, --all Update all installed components
--dry-run Preview changes without writing files
-f, --force Skip confirmation prompts
Examples:
# Update all components
npx @scania/tegel-cli update --all
# Update specific components
npx @scania/tegel-cli update button card
# Interactive selection
npx @scania/tegel-cli update
The CLI uses a .tegelrc.json file for configuration:
{
"prefix": "my",
"targetDir": "src/lib/tegel",
"transforms": {
"customRules": []
},
"aliases": {
"@/lib/tegel": "./lib/tegel"
},
"includeTests": false,
"version": "1.33.0"
}
"tds")"src/lib/tegel")false)<tds-button> → <my-button>.tds-button → .my-buttontdsClick → myClickquerySelector('tds-modal') → querySelector('my-modal')HTMLTdsButtonElement → HTMLMyButtonElementComponents are copied with the following structure:
src/lib/tegel/
├── components/
│ ├── button/
│ │ ├── button.tsx
│ │ ├── button.scss
│ │ └── button-vars.scss
│ └── card/
│ ├── card.tsx
│ ├── card.scss
│ └── card-vars.scss
├── utils/
│ └── (shared utilities)
├── mixins/
│ └── (SCSS mixins)
├── types/
│ └── (TypeScript definitions)
└── global/
└── (global styles)
The CLI tracks the Tegel version used for your components:
tegel add, if a newer version is available, you'll be prompted to updatetegel update to manually update components.tegelrc.jsonWhen adding components that already exist:
--force to override all files without promptingThe transformed components work with any framework that supports Web Components:
import '@/lib/tegel/components/button/button';
function App() {
return <my-button variant="primary">Click me</my-button>;
}
<template>
<my-button variant="primary">Click me</my-button>
</template>
<script>
import '@/lib/tegel/components/button/button';
</script>
import '@/lib/tegel/components/button/button';
@Component({
template: '<my-button variant="primary">Click me</my-button>'
})
export class AppComponent {}
.tsx files (StencilJS components)@import '@/lib/tegel/global/global';tsconfig.json:
{
"compilerOptions": {
"paths": {
"@/lib/tegel/*": ["./src/lib/tegel/*"]
}
}
}
This package is part of the Tegel monorepo. To work on the CLI:
# Install dependencies
cd packages/tegel-cli
pnpm install
# Build
pnpm build
# Development mode
pnpm dev
# Run tests
pnpm test
# Lint
pnpm lint
This tool is part of the Tegel Design System by Scania.
MIT License
FAQs
CLI tool for copying and transforming Tegel components with custom prefixes
We found that @scania/tegel-cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.