Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

frets-styles-generator

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frets-styles-generator - npm Package Compare versions

Comparing version 0.1.9 to 0.2.0

38

build/main/build-style-type.js

@@ -6,5 +6,5 @@ #! /usr/bin/env node

const postcss = require("postcss");
let importer = require("postcss-import");
let camelcase = require("camel-case");
let program = require("commander");
const importer = require("postcss-import");
const camelcase = require("camel-case");
const program = require("commander");
const walk = require("walk");

@@ -15,6 +15,6 @@ const normalize = require("normalize-path");

let classProperties = [];
let protectedGetters = Object.getOwnPropertyNames(Object.getPrototypeOf(new String())).concat(["input", "button", "div", "select", "textarea", "label", "div", "$"]);
const protectedGetters = Object.getOwnPropertyNames(Object.getPrototypeOf("")).concat(["input", "button", "div", "select", "textarea", "label", "div", "$"]);
// console.log(protectedGetters.join(", "));
program
.version("0.1.4")
.version("0.2.0")
.usage("[options] inputPath")

@@ -45,3 +45,4 @@ .option("-w, --watch", "watch the file for changes")

});
let customConfigObject = {};
// const customConfigObject: { path?: string[] } = {};
let customPlugins = [];
let postCssConfigPath = process.cwd() + "/postcss.config.js";

@@ -51,3 +52,14 @@ if (!fs.existsSync(postCssConfigPath)) {

}
customConfigObject = require(postCssConfigPath).plugins["postcss-import"];
customPlugins = require(postCssConfigPath).plugins;
if (customPlugins) {
if (customPlugins["import"]) {
delete customPlugins["import"];
}
if (customPlugins["atImport"]) {
delete customPlugins["atImport"];
}
if (customPlugins["importer"]) {
delete customPlugins["importer"];
}
}
function readFile(input, output) {

@@ -69,6 +81,8 @@ console.log("reading " + input);

// }
const opts = Object.assign(customConfigObject || {}, { root: inputPath });
console.log("Using Importer Config: ", opts);
postcss([importer(opts)])
.process(data.toString())
// const opts = Object.assign(customConfigObject || {}, { root: inputPath });
// console.log("Using Config: ", opts);
postcss([...customPlugins, importer({ root: inputPath })])
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QyxDQUFDO1lBQ3RDLENBQUM7WUFDRCxFQUFFLENBQUMsQ0FBQyxTQUFTLElBQUksQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDO2dCQUM3QixVQUFVLEdBQUcsSUFBSSxDQUFDO2dCQUNsQixPQUFPLENBQUMsR0FBRyxDQUFDLHlCQUF5QixDQUFDLENBQUM7Z0JBQ3ZDLEVBQUUsQ0FBQyxTQUFTLENBQUMsS0FBSyxFQUFFLEdBQUcsRUFBRSxDQUFDLFFBQVEsQ0FBQyxLQUFLLEVBQUUsTUFBTSxDQUFDLENBQUMsQ0FBQztZQUNyRCxDQUFDO1FBQ0gsQ0FBQyxDQUFDLENBQUM7SUFDUCxDQUFDLENBQUMsQ0FBQztBQUNMLENBQUMifQ==

@@ -46,3 +46,3 @@ "use strict";

}
if (typeof properties === "object" && properties.length > 0) {
if (properties && typeof properties === "object" && properties.length > 0) {
return Maquette.h(this.toString(), properties);

@@ -62,8 +62,19 @@ }

get div(): BaseStyles { return new BaseStyles("div"); }
get img(): BaseStyles { return new BaseStyles("img"); }
get a(): BaseStyles { return new BaseStyles("a"); }
get p(): BaseStyles { return new BaseStyles("p"); }
get ul(): BaseStyles { return new BaseStyles("ul"); }
get ol(): BaseStyles { return new BaseStyles("ol"); }
get li(): BaseStyles { return new BaseStyles("li"); }
get section(): BaseStyles { return new BaseStyles("section"); }
get header(): BaseStyles { return new BaseStyles("header"); }
get article(): BaseStyles { return new BaseStyles("article"); }
get nav(): BaseStyles { return new BaseStyles("nav"); }
get aside(): BaseStyles { return new BaseStyles("aside"); }
get span(): BaseStyles { return new BaseStyles("span"); }
get button(): BaseStyles { return new BaseStyles("button.btn"); }
get input(): BaseStyles { return new BaseStyles("input.input"); }
get label(): BaseStyles { return new BaseStyles("label.label"); }
get select(): BaseStyles { return new BaseStyles("select.select"); }
get textarea(): BaseStyles { return new BaseStyles("textarea.textarea"); }
get button(): BaseStyles { return new BaseStyles("button"); }
get input(): BaseStyles { return new BaseStyles("input"); }
get label(): BaseStyles { return new BaseStyles("label"); }
get select(): BaseStyles { return new BaseStyles("select"); }
get textarea(): BaseStyles { return new BaseStyles("textarea"); }

@@ -106,2 +117,2 @@ public toString = (): string => {

exports.default = default_1;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFxdWV0dGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGVtcGxhdGVzL21hcXVldHRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsbUJBQXdCLGVBQXlCO0lBQy9DLE1BQU0sQ0FBQzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O1VBdUZDLGVBQWUsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDOzs7Ozs7Ozs7O0NBVW5DLENBQUM7QUFDRixDQUFDO0FBbkdELDRCQW1HQyJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFxdWV0dGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGVtcGxhdGVzL21hcXVldHRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsbUJBQXdCLGVBQXlCO0lBQy9DLE1BQU0sQ0FBQzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7VUFrR0MsZUFBZSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUM7Ozs7Ozs7Ozs7Q0FVbkMsQ0FBQztBQUNGLENBQUM7QUE5R0QsNEJBOEdDIn0=

@@ -5,2 +5,12 @@ # Change Log

<a name="0.2.0"></a>
# [0.2.0](https://gitlab.com/FRETS/frets/compare/v0.1.9...v0.2.0) (2019-01-23)
### Features
* custom configs and default template ([5ef0769](https://gitlab.com/FRETS/frets/commit/5ef0769))
<a name="0.1.9"></a>

@@ -7,0 +17,0 @@ ## [0.1.9](https://gitlab.com/FRETS/frets/compare/v0.1.8...v0.1.9) (2018-11-14)

{
"name": "frets-styles-generator",
"version": "0.1.9",
"version": "0.2.0",
"description": "Tool that genreates a typescript class for FRETS based on a CSS file",

@@ -107,9 +107,9 @@ "main": "build/main/index.js",

"camel-case": "^3.0.0",
"commander": "^2.12.2",
"commander": "^2.19.0",
"normalize-path": "^3.0.0",
"postcss": "^6.0.13",
"postcss-import": "^11.0.0",
"tslib": "^1.6.0",
"walk": "^2.3.13"
"postcss": "^7.0.14",
"postcss-import": "^12.0.1",
"tslib": "^1.9.3",
"walk": "^2.3.14"
}
}
# frets-styles-generator
Genreates a typescript class from a given input css file.
Genreates a typescript class from a given input css file. The typescript
Uses postcss under the hood.
## Installation
`npm install frets-styles-generator --save-dev`
## Usage
`node node_modules/.bin/frets-styles-generator`
The first argument you pass to the program will be the directory to scan for CSS files. It defaults to "./src" if you leave the argument out. Each CSS file that is found will be run through postcss (utilizing the [postcss-import](https://github.com/postcss/postcss-import) plugin by default) and then turned into a .ts file like [orginialFilename-styles.ts] based on the template specified. The default template is for [maquette](https://github.com/AFASSoftware/maquette) hyperscript functions.
Optionally pass this argument `-t '[path to custom template.js file]'` to specify a custom template.
Includes an optional watch flag `-w`.
Used in conjunction with FRETS and/or a hyperscript implementation. This particular template is specifically for the Maquette hyperscript implementation. Meaning it outputs a ts file that expects maquette to be available for import, so you will need 'maquette' in your project as a dependency.
Includes an options flag `-o` which will overwrite the original css file using the postcss-import plugin.
Used in conjunction with FRETS and/or another hyperscript implementation. This particular template is specifically for the Maquette hyperscript implementation. Meaning it outputs a ts file that expects maquette to be available for import, so you will need 'maquette' in your project as a dependency.
I find it especially useful for rapid prototyping if you point it at [BaseCSS](https://github.com/basscss/bassplate) or [tachyons](http://tachyons.io/) because then you have a chainable typescript method for every "atomic" css class.
## Custom Templates
See the [current maquette template](https://gitlab.com/FRETS/frets-styles-generator/blob/master/src/templates/maquette.ts) for an example.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc