forgecss 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +2 -1
- package/dist/client.min.js +1 -0
- package/dist/forgecss.min.js +31 -1
- package/fx.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +30 -9
- package/lib/forge-lang/Compiler.js +122 -0
- package/lib/forge-lang/Parser.js +208 -0
- package/lib/forge-lang/constants.js +27 -0
- package/lib/forge-lang/utils.js +18 -0
- package/{client → lib}/fx.js +24 -26
- package/lib/helpers.js +27 -16
- package/lib/usages.js +3 -25
- package/package.json +1 -1
- package/scripts/build.js +11 -5
- package/{client/index.js → standalone/client.js} +1 -1
- package/standalone/forgecss.js +76 -0
- package/{lib → standalone/lib}/inventory.js +17 -10
- package/standalone/lib/usages.js +36 -0
- package/lib/generator.js +0 -42
- package/lib/getAllFiles.js +0 -30
- package/lib/inventory.d.ts +0 -4
- package/lib/transformers/arbitrary.js +0 -32
- package/lib/transformers/mediaQuery.js +0 -31
- package/lib/transformers/pseudo.js +0 -46
- package/lib/usages.d.ts +0 -3
package/cli.js
CHANGED
|
@@ -4,9 +4,10 @@ import fs from 'fs';
|
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
6
6
|
import { program } from "commander";
|
|
7
|
-
import ForgeCSS from './index.js';
|
|
8
7
|
import chokidar from "chokidar";
|
|
9
8
|
|
|
9
|
+
import ForgeCSS from './index.js';
|
|
10
|
+
|
|
10
11
|
program.option("-c, --config <string>,", "Path to forgecss config file", process.cwd() + "/forgecss.config.js");
|
|
11
12
|
program.option("-w, --watch", "Enable watch mode", false);
|
|
12
13
|
program.option("-v, --verbose", "Enable watch mode", false);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{function f(n){let t=n.lastIndexOf(":");if(t===-1)return[null,n];let e=n.slice(0,t),i=n.slice(t+1);return[e,i]}function c(n){let t=[],e="",i=0,l=null;for(let r=0;r<n.length;r++){let o=n[r];if(i>0){if(l){e+=o,o===l&&n[r-1]!=="\\"&&(l=null);continue}else if(o==="'"||o==='"'){l=o,e+=o;continue}}if(o==="["){i++,e+=o;continue}if(o==="]"&&i>0){i--,e+=o;continue}if(i===0&&/\s/.test(o)){for(e&&t.push(e),e="";r+1<n.length&&/\s/.test(n[r+1]);)r++;continue}e+=o}return e&&t.push(e),t}function s(n){return c(n).map(t=>{let[e,i]=f(t);return!e||e==="[true]"?i:e==="[false]"?!1:(e=a(e),i.split(",").map(l=>`${e}_${l}`).join(" "))}).filter(Boolean).join(" ")}function a(n){let t=n.trim();return t=t.replace(/[&]/g,"I"),t=t.replace(/[:| =]/g,"-"),t=t.replace(/[^a-zA-Z0-9_-]/g,""),t}function u(n){for(var t=n||document,e=t.querySelectorAll("[class]"),i=0;i<e.length;i++){var l=e[i],r=l.getAttribute("class");if(r){var o=s(r);typeof o=="string"&&o!==r&&l.setAttribute("class",o)}}}window.fx=s;window.forgecss=u;document.readyState!=="loading"?u():document.addEventListener("DOMContentLoaded",function(){u()});window.addEventListener("load",function(){u()});})();
|