Comparing version 0.1.0-beta.5 to 0.1.0-beta.6
/// <reference types="node" /> | ||
import { Options } from "./contracts"; | ||
export declare const CLI_ERROR_PREFIX = "CssToTs"; | ||
export declare const DEFAULT_IGNORED_GLOB = "node_modules/**/*.css"; | ||
export declare function EmitError(message: string): void; | ||
export declare var CLIDefaults: Options; | ||
export declare function IsNodeError(error: any): error is NodeJS.ErrnoException; |
@@ -57,3 +57,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
let cwd = path.join(this.options.cwd, this.options.rootDir); | ||
new glob_1.Glob(pattern, { cwd: cwd }, (error, filesArray) => { | ||
new glob_1.Glob(pattern, { | ||
ignore: helpers_1.DEFAULT_IGNORED_GLOB, | ||
cwd: cwd, | ||
}, (error, filesArray) => { | ||
if (error) { | ||
@@ -73,3 +76,4 @@ reject(error); | ||
let watcher = chokidar_1.watch(this.options.pattern, { | ||
cwd: cwd | ||
cwd: cwd, | ||
ignored: helpers_1.DEFAULT_IGNORED_GLOB | ||
}); | ||
@@ -76,0 +80,0 @@ watcher.on("change", this.onWatchChange); |
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CLI_ERROR_PREFIX = "CssToTs"; | ||
exports.DEFAULT_IGNORED_GLOB = "node_modules/**/*.css"; | ||
function EmitError(message) { | ||
@@ -4,0 +5,0 @@ console.log(`${exports.CLI_ERROR_PREFIX}: ${message}`); |
{ | ||
"name": "css-to-ts", | ||
"version": "0.1.0-beta.5", | ||
"version": "0.1.0-beta.6", | ||
"description": "css-to-ts takes css file and outputs TypeScript file with an exported string containing content of your css file.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -7,5 +7,7 @@ # css-to-ts | ||
```sh | ||
$ npm install css-to-ts | ||
$ npm install css-to-ts -g | ||
``` | ||
Global installation is not necessary. You can install this package with ```sh $ npm install css-to-ts``` and use it in [`npm-scripts`](https://docs.npmjs.com/misc/scripts). | ||
## Features | ||
@@ -12,0 +14,0 @@ - Takes css files and output TypeScript files with exported string containing content of your css file. |
@@ -6,3 +6,8 @@ import { Glob } from "glob"; | ||
import { CssToTsConverter } from "./css-to-ts-converter"; | ||
import { EmitError, CLIDefaults, IsNodeError } from "./helpers"; | ||
import { | ||
EmitError, | ||
CLIDefaults, | ||
IsNodeError, | ||
DEFAULT_IGNORED_GLOB | ||
} from "./helpers"; | ||
@@ -40,10 +45,14 @@ export class CLIHandler { | ||
let cwd = path.join(this.options.cwd!, this.options.rootDir); | ||
new Glob(pattern, { cwd: cwd }, (error, filesArray) => { | ||
if (error) { | ||
reject(error); | ||
return; | ||
} | ||
resolve(filesArray); | ||
}); | ||
new Glob(pattern, | ||
{ | ||
ignore: DEFAULT_IGNORED_GLOB, | ||
cwd: cwd, | ||
}, | ||
(error, filesArray) => { | ||
if (error) { | ||
reject(error); | ||
return; | ||
} | ||
resolve(filesArray); | ||
}); | ||
}); | ||
@@ -58,3 +67,4 @@ } | ||
let watcher = watch(this.options.pattern, { | ||
cwd: cwd | ||
cwd: cwd, | ||
ignored: DEFAULT_IGNORED_GLOB | ||
}); | ||
@@ -61,0 +71,0 @@ |
import { Options } from "./contracts"; | ||
export const CLI_ERROR_PREFIX = "CssToTs"; | ||
export const DEFAULT_IGNORED_GLOB = "node_modules/**/*.css"; | ||
@@ -5,0 +6,0 @@ export function EmitError(message: string) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35433
736
122