Skip to content

Commit

Permalink
chore: commander unsupported option flags
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarmarina committed Jan 18, 2025
1 parent 7f6a0fc commit 8109181
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,10 @@ version(pkg.version, '-v, --version', 'show version number')
.option('-e, --marker-end <string>', 'end replace position')
.option('-g, --custom-glob <string>', 'string pattern to be matched')
.option('-c, --css-file', 'generate a CSS file instead of JS or TS')
.option('-wo, --wo-suffix', 'without suffix string `-styles`')
.option('-w, --wo-suffix', 'without suffix string `-styles`')
.option('-j, --js-file <string>', 'file extension')
.option('-d, --destination <string>', 'location of the output file')
.option('-hr, --hide-reload', 'no reload info output');
.option('-h, --hide-reload', 'no reload info output');
```

### Typescript (--js-file option)
Expand Down Expand Up @@ -224,7 +224,7 @@ export const styles = css`<% content %>`;

> generate css file instead of using template : `undefined`
##### --wo-suffix (-wo)
##### --wo-suffix (-w)

> without suffix string **-styles** : `undefined`
Expand All @@ -236,7 +236,7 @@ export const styles = css`<% content %>`;

> location of the output file : `undefined`
##### --hide-reload (-hr)
##### --hide-reload (-h)

> suppress reload info output : `false`
Expand Down
4 changes: 2 additions & 2 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ program
.option('-e, --marker-end <string>', 'end replace position')
.option('-g, --custom-glob <string>', 'string pattern to be matched')
.option('-c, --css-file', 'generate a CSS file instead of JS or TS')
.option('-wo, --wo-suffix', 'without suffix string `-styles`')
.option('-w, --wo-suffix', 'without suffix string `-styles`')
.option('-j, --js-file <string>', 'file extension')
.option('-d, --destination <string>', 'location of the output file')
.option('-hr, --hide-reload', 'suppress reload info output');
.option('-h, --hide-reload', 'suppress reload info output');

program.parse(process.argv);

Expand Down
6 changes: 4 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,16 +169,18 @@ export class SassStyleTemplate {
return;
}

const cssResult = await this.cssProcessor.autoprefix(rawCss);
const processedContent = await this.cssProcessor.autoprefix(rawCss);

if (!cssResult) {
if (!processedContent) {
return;
}

if (path.basename(fileName).startsWith('_')) {
return;
}

const cssResult = `\n${processedContent.replace(/^(?!\s*$)/gm, ' ')}\n`;

this.fileInfo = {
fileNameWithoutExt: path.basename(fileName, '.scss'),
fileExt: this.options.cssFile
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@blockquote/sass-style-template",
"version": "4.1.0",
"version": "5.0.0",
"description": "A SCSS watcher with autoprefixer for building Web Components using Lit and SASS.",
"keywords": [
"lit",
Expand Down Expand Up @@ -35,10 +35,10 @@
},
"dependencies": {
"autoprefixer": "^10.4.20",
"chokidar": "^4.0.1",
"commander": "^12.1.0",
"postcss": "^8.4.49",
"sass": "^1.81.0",
"chokidar": "^4.0.3",
"commander": "^13.0.0",
"postcss": "^8.5.1",
"sass": "^1.83.4",
"tinyglobby": "^0.2.10"
},
"prettier": {
Expand All @@ -60,9 +60,9 @@
"access": "public"
},
"devDependencies": {
"@eslint/js": "^9.14.0",
"eslint": "^9.14.0",
"eslint-config-prettier": "^9.1.0",
"globals": "^15.12.0"
"@eslint/js": "^9.18.0",
"eslint": "^9.18.0",
"eslint-config-prettier": "^10.0.1",
"globals": "^15.14.0"
}
}
2 changes: 1 addition & 1 deletion tpls/sass-template.tmpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { css } from 'lit';
import {css} from 'lit';

export const styles = css`<% content %>`;

0 comments on commit 8109181

Please sign in to comment.