Skip to content

Commit

Permalink
Add --style option to support styleEntrypoint configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed Jul 4, 2024
1 parent 9349bf6 commit 0714198
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/quiet-islands-bake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@chialab/plasma': patch
---

Add `--style` option to support `styleEntrypoint` configuration.
7 changes: 7 additions & 0 deletions docs/guide/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ The custom elements manifest path to use to generate the wrappers. If not specif
The original module entrypoint to use to import component implementation and types.
If the entrypoint is the main module of the package, it matches the name of NPM module.

## Style entrypoint

- `--style`
- Type: `string`

The original module entrypoint to use to import component styles.

## Outdir

- `--outdir`, `-o`
Expand Down
3 changes: 3 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ program

.argument('[input]', 'custom elements manifest path')
.option('-e, --entrypoint <path>', 'module entrypoint')
.option('--style <path>', 'style module entrypoint')
.option('-o, --outdir <outdir>', 'output directory')
.option('-f, --frameworks <frameworks...>', 'the framework to convert to')
.option('-y, --yes', 'convert all candidates to all available frameworks')
Expand All @@ -49,6 +50,7 @@ program
sourceDir,
options: {
entrypoint?: string;
style?: string;
outdir?: string;
frameworks?: Frameworks[];
yes?: boolean;
Expand Down Expand Up @@ -158,6 +160,7 @@ program
);
const outFile = await transform(entry, framework, {
entrypoint: entrypoint as string,
styleEntrypoint: options.style,
outdir: outDir,
});
task.title = `Converted ${chalk.whiteBright(component)} to ${colorFramework(
Expand Down

0 comments on commit 0714198

Please sign in to comment.