New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fable-css-modules

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fable-css-modules - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

26

build/classCollector.js

@@ -144,11 +144,6 @@ "use strict";

ClassCollector.prototype.moduleToText = function (sb, module, indent) {
if (module.subModules.length > 0 || module.classes.length > 0) {
if (module.classes.length > 0) {
sb.indent(indent);
sb.writeLine("module ".concat(module.name, " ="));
sb.writeLine("type ".concat(module.name, " ="));
sb.writeLine();
}
if (module.classes.length > 0) {
sb.indent(indent + 1);
sb.writeLine("type Classes =");
sb.writeLine();
// The same class can be present mutiple times, for example when doing:

@@ -160,11 +155,11 @@ // .container { ... }

var className = uniqueClassNames_1[_i];
sb.indent(indent + 2);
sb.indent(indent + 1);
sb.writeLine("/// <summary>");
sb.indent(indent + 2);
sb.indent(indent + 1);
sb.writeLine("/// Binding for <c>".concat(className, "</c> class"));
sb.indent(indent + 2);
sb.indent(indent + 1);
sb.writeLine("/// </summary>");
sb.indent(indent + 2);
sb.indent(indent + 1);
sb.writeLine("[<Emit(\"$0[\\\"".concat(className, "\\\"]\")>]"));
sb.indent(indent + 2);
sb.indent(indent + 1);
sb.writeLine("abstract ".concat((0, utils_1.hyphenToCamelCase)(className), " : string"));

@@ -174,2 +169,7 @@ sb.writeLine();

}
if (module.subModules.length > 0) {
sb.indent(indent);
sb.writeLine("module ".concat(module.name, " ="));
sb.writeLine();
}
for (var _a = 0, _b = module.subModules; _a < _b.length; _a++) {

@@ -190,3 +190,3 @@ var subModule = _b[_a];

// Add the prelude to the destination file
sb.writeLine("//------------------------------------------------------------------------------\n// This code was generated by fable-css-modules.\n// Changes to this file will be lost when the code is regenerated.\n//------------------------------------------------------------------------------\n\nmodule ".concat(internalPrefix, "CssModules\n\nopen Fable.Core\n"));
sb.writeLine("//------------------------------------------------------------------------------\n// This code was generated by fable-css-modules.\n// Changes to this file will be lost when the code is regenerated.\n//------------------------------------------------------------------------------\n\n[<RequireQualifiedAccess>]\nmodule ".concat(internalPrefix, "CssModules\n\nopen Fable.Core\n"));
// Generate all the modules

@@ -193,0 +193,0 @@ for (_i = 0, _a = this._modules; _i < _a.length; _i++) {

@@ -9,2 +9,14 @@ # Changelog

## 1.1.0 - 2022-06-29
### Changed
* Change from `XXX.YYY.ModuleName.Classes` to `XXX.YYY.ModuleName`
This makes the module path a bit less verbose.
* Mark `CssModules` as `[<RequireQualifiedAccess>]`.
This will the simplification of module path, should make less verbose to access the classes and be still explicit enough.
## 1.0.0 - 2022-06-29

@@ -11,0 +23,0 @@

{
"name": "fable-css-modules",
"version": "1.0.0",
"version": "1.1.0",
"description": "Generate Fable bindings for your CSS modules classes",

@@ -13,3 +13,3 @@ "main": "index.js",

"watch": "tsc -w",
"prepublish": "rimraf build && npm run build"
"prepublishOnly": "rimraf build && npm run build"
},

@@ -16,0 +16,0 @@ "keywords": [

@@ -131,11 +131,6 @@ import path from "path"

moduleToText(sb: StringBuilder, module: Module, indent: number) {
if (module.subModules.length > 0 || module.classes.length > 0) {
sb.indent(indent);
sb.writeLine(`module ${module.name} =`);
sb.writeLine();
}
if (module.classes.length > 0) {
sb.indent(indent + 1);
sb.writeLine(`type Classes =`);
sb.indent(indent);
sb.writeLine(`type ${module.name} =`);
sb.writeLine();

@@ -149,11 +144,11 @@

for (const className of uniqueClassNames) {
sb.indent(indent + 2);
sb.indent(indent + 1);
sb.writeLine("/// <summary>")
sb.indent(indent + 2);
sb.indent(indent + 1);
sb.writeLine(`/// Binding for <c>${className}</c> class`);
sb.indent(indent + 2);
sb.indent(indent + 1);
sb.writeLine("/// </summary>")
sb.indent(indent + 2);
sb.indent(indent + 1);
sb.writeLine(`[<Emit("$0[\\\"${className}\\\"]")>]`);
sb.indent(indent + 2);
sb.indent(indent + 1);
sb.writeLine(`abstract ${hyphenToCamelCase(className)} : string`);

@@ -164,2 +159,8 @@ sb.writeLine();

if (module.subModules.length > 0) {
sb.indent(indent);
sb.writeLine(`module ${module.name} =`);
sb.writeLine();
}
for (const subModule of module.subModules) {

@@ -181,2 +182,3 @@ this.moduleToText(sb, subModule, indent + 1);

[<RequireQualifiedAccess>]
module ${internalPrefix}CssModules

@@ -183,0 +185,0 @@

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