@master/css-cli 2.0.0-beta.111 → 2.0.0-rc.15
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/README.md +10 -19
- package/dist/bin/index.bundle.js +12 -0
- package/package.json +1 -1
- package/dist/bin/index.js +0 -82
- package/dist/bin/index.js.map +0 -7
- package/dist/index.js +0 -32
- package/dist/index.js.map +0 -7
package/dist/index.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
var g=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var h=(o,t)=>{for(var i in t)g(o,i,{get:t[i],enumerable:!0})},j=(o,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of S(t))!d.call(o,s)&&s!==i&&g(o,s,{get:()=>t[s],enumerable:!(r=x(t,s))||r.enumerable});return o};var $=o=>j(g({},"__esModule",{value:!0}),o);var F={};h(F,{generateCJSFileSchema:()=>C,generateESMFileSchema:()=>y,generateTSFileSchema:()=>O});module.exports=$(F);function l({aot:o,jit:t,moduleExports:i,typeSyntax:r,require:s}){let c={},p={},m=[],f=(e,n)=>{e in c?typeof n=="string"?c[e].unshift(n):c[e].push(n):c[e]=[n]},a=`${i?"":"export "}const config = {
|
|
2
|
-
themes: {},
|
|
3
|
-
colors: {},
|
|
4
|
-
classes: {},
|
|
5
|
-
values: {},
|
|
6
|
-
semantics: {},
|
|
7
|
-
breakpoints: {},
|
|
8
|
-
selectors: {},
|
|
9
|
-
mediaQueries: {}
|
|
10
|
-
}`;if(r?a=`/** @type {import('@master/css').Config} */
|
|
11
|
-
`+a:s||(f("@master/css","{ Config }"),a=a.replace(/ =/,": Config$&")),m.push(a),p.config="",t&&(f("@master/css","MasterCSS"),p.css="new MasterCSS(config)"),o){let e=`${i?"":"export "}const compilerOptions = {
|
|
12
|
-
sources: [],
|
|
13
|
-
classes: {
|
|
14
|
-
// whitelist of class names for unpredictable dynamics
|
|
15
|
-
fixed: [],
|
|
16
|
-
// blacklist of class names to exclude accidentally captured
|
|
17
|
-
ignored: [] // or RegExp[]
|
|
18
|
-
}
|
|
19
|
-
}`;r?e=`/** @type {import('@master/css-compiler').Options} */
|
|
20
|
-
`+e:s||(f("@master/css-compiler","{ Options }"),e=e.replace(/ =/,": Options$&")),m.push(e),p.compilerOptions=""}let u=Object.entries(c),b=Object.entries(p);return(u.length?u.map(([e,n])=>s?`const ${n.join(", ")} = require('${e}')`:`import ${n.join(", ")} from '${e}'`).join(`
|
|
21
|
-
`)+`
|
|
22
|
-
|
|
23
|
-
`:"")+m.join(`
|
|
24
|
-
|
|
25
|
-
`)+`
|
|
26
|
-
|
|
27
|
-
`+(i?`module.exports = {
|
|
28
|
-
${b.map(([e,n])=>n?e+": "+n:e).join(`,
|
|
29
|
-
`)}
|
|
30
|
-
}`:b.filter(([,e])=>e).map(([e,n])=>`export const ${e} = ${n}`).join(`
|
|
31
|
-
`))}function O({aot:o,jit:t}){return l({aot:o,jit:t})}function y({aot:o,jit:t}){return l({aot:o,jit:t,typeSyntax:!0})}function C({aot:o,jit:t}){return l({aot:o,jit:t,moduleExports:!0,typeSyntax:!0,require:!0})}0&&(module.exports={generateCJSFileSchema,generateESMFileSchema,generateTSFileSchema});
|
|
32
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts", "../src/utils/generate-file-schema.ts"],
|
|
4
|
-
"sourcesContent": ["import { generateFileSchema } from './utils/generate-file-schema'\n\nexport function generateTSFileSchema({ aot, jit }: { aot?: boolean, jit?: boolean }) {\n return generateFileSchema({ aot, jit })\n}\n\nexport function generateESMFileSchema({ aot, jit }: { aot?: boolean, jit?: boolean }) {\n return generateFileSchema({ aot, jit, typeSyntax: true })\n}\n\nexport function generateCJSFileSchema({ aot, jit }: { aot?: boolean, jit?: boolean }) {\n return generateFileSchema({ aot, jit, moduleExports: true, typeSyntax: true, require: true })\n}", "export function generateFileSchema(\n {\n aot,\n jit,\n moduleExports,\n typeSyntax,\n require\n }: {\n aot?: boolean,\n jit?: boolean,\n moduleExports?: boolean,\n typeSyntax?: boolean,\n require?: boolean\n }\n) {\n const imports: Record<string, string[]> = {}\n const exports: Record<string, string> = {}\n const content: string[] = []\n const addImport = (key: string, value: string) => {\n if (key in imports) {\n if (typeof value === 'string') {\n imports[key].unshift(value)\n } else {\n imports[key].push(value)\n }\n } else {\n imports[key] = [value]\n }\n }\n\n // Config\n let config = `${moduleExports ? '' : 'export '}const config = {\n themes: {},\n colors: {},\n classes: {},\n values: {},\n semantics: {},\n breakpoints: {},\n selectors: {},\n mediaQueries: {}\n}`\n if (typeSyntax) {\n config = `/** @type {import('@master/css').Config} */\\n` + config\n } else if (!require) {\n addImport('@master/css', '{ Config }')\n config = config.replace(/ =/, ': Config$&')\n }\n content.push(config)\n exports['config'] = ''\n\n // JIT\n if (jit) {\n addImport('@master/css', 'MasterCSS')\n exports['css'] = 'new MasterCSS(config)'\n }\n\n // AOT\n if (aot) {\n let options = `${moduleExports ? '' : 'export '}const compilerOptions = {\n sources: [],\n classes: {\n // whitelist of class names for unpredictable dynamics\n fixed: [],\n // blacklist of class names to exclude accidentally captured\n ignored: [] // or RegExp[]\n }\n}`\n if (typeSyntax) {\n options = `/** @type {import('@master/css-compiler').Options} */\\n` + options\n } else if (!require) {\n addImport('@master/css-compiler', '{ Options }')\n options = options.replace(/ =/, ': Options$&')\n }\n content.push(options)\n exports['compilerOptions'] = ''\n }\n\n const importsEntries = Object.entries(imports)\n const exportEntries = Object.entries(exports)\n return (importsEntries.length\n ? importsEntries.map(([name, sources]) => (require ? `const ${sources.join(', ')} = require('${name}')` : `import ${sources.join(', ')} from '${name}'`)).join('\\n') + '\\n\\n'\n : '')\n + content.join('\\n\\n')\n + '\\n\\n'\n + (moduleExports\n ? `module.exports = {\\n ${exportEntries.map(([name, value]) => value ? name + ': ' + value : name).join(',\\n ')}\\n}`\n : exportEntries.filter(([, value]) => value).map(([name, value]) => `export const ${name} = ${value}`).join('\\n'))\n}"],
|
|
5
|
-
"mappings": "4ZAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,2BAAAE,EAAA,0BAAAC,EAAA,yBAAAC,IAAA,eAAAC,EAAAL,GCAO,SAASM,EACZ,CACI,IAAAC,EACA,IAAAC,EACA,cAAAC,EACA,WAAAC,EACA,QAAAC,CACJ,EAOF,CACE,IAAMC,EAAoC,CAAC,EACrCC,EAAkC,CAAC,EACnCC,EAAoB,CAAC,EACrBC,EAAY,CAACC,EAAaC,IAAkB,CAC1CD,KAAOJ,EACH,OAAOK,GAAU,SACjBL,EAAQI,CAAG,EAAE,QAAQC,CAAK,EAE1BL,EAAQI,CAAG,EAAE,KAAKC,CAAK,EAG3BL,EAAQI,CAAG,EAAI,CAACC,CAAK,CAE7B,EAGIC,EAAS,GAAGT,EAAgB,GAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GA0BrC,GAhBIC,EACAQ,EAAS;AAAA,EAAkDA,EACnDP,IACRI,EAAU,cAAe,YAAY,EACrCG,EAASA,EAAO,QAAQ,KAAM,YAAY,GAE9CJ,EAAQ,KAAKI,CAAM,EACnBL,EAAQ,OAAY,GAGhBL,IACAO,EAAU,cAAe,WAAW,EACpCF,EAAQ,IAAS,yBAIjBN,EAAK,CACL,IAAIY,EAAU,GAAGV,EAAgB,GAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,GASlCC,EACAS,EAAU;AAAA,EAA4DA,EAC9DR,IACRI,EAAU,uBAAwB,aAAa,EAC/CI,EAAUA,EAAQ,QAAQ,KAAM,aAAa,GAEjDL,EAAQ,KAAKK,CAAO,EACpBN,EAAQ,gBAAqB,EACjC,CAEA,IAAMO,EAAiB,OAAO,QAAQR,CAAO,EACvCS,EAAgB,OAAO,QAAQR,CAAO,EAC5C,OAAQO,EAAe,OACjBA,EAAe,IAAI,CAAC,CAACE,EAAMC,CAAO,IAAOZ,EAAU,SAASY,EAAQ,KAAK,IAAI,gBAAgBD,MAAW,UAAUC,EAAQ,KAAK,IAAI,WAAWD,IAAQ,EAAE,KAAK;AAAA,CAAI,EAAI;AAAA;AAAA,EACrK,IACAR,EAAQ,KAAK;AAAA;AAAA,CAAM,EACnB;AAAA;AAAA,GACCL,EACG;AAAA,MAA2BY,EAAc,IAAI,CAAC,CAACC,EAAML,CAAK,IAAMA,EAAQK,EAAO,KAAOL,EAAQK,CAAI,EAAE,KAAK;AAAA,KAAS;AAAA,GAClHD,EAAc,OAAO,CAAC,CAAC,CAAEJ,CAAK,IAAMA,CAAK,EAAE,IAAI,CAAC,CAACK,EAAML,CAAK,IAAM,gBAAgBK,OAAUL,GAAO,EAAE,KAAK;AAAA,CAAI,EAC5H,CDrFO,SAASO,EAAqB,CAAE,IAAAC,EAAK,IAAAC,CAAI,EAAqC,CACjF,OAAOC,EAAmB,CAAE,IAAAF,EAAK,IAAAC,CAAI,CAAC,CAC1C,CAEO,SAASE,EAAsB,CAAE,IAAAH,EAAK,IAAAC,CAAI,EAAqC,CAClF,OAAOC,EAAmB,CAAE,IAAAF,EAAK,IAAAC,EAAK,WAAY,EAAK,CAAC,CAC5D,CAEO,SAASG,EAAsB,CAAE,IAAAJ,EAAK,IAAAC,CAAI,EAAqC,CAClF,OAAOC,EAAmB,CAAE,IAAAF,EAAK,IAAAC,EAAK,cAAe,GAAM,WAAY,GAAM,QAAS,EAAK,CAAC,CAChG",
|
|
6
|
-
"names": ["src_exports", "__export", "generateCJSFileSchema", "generateESMFileSchema", "generateTSFileSchema", "__toCommonJS", "generateFileSchema", "aot", "jit", "moduleExports", "typeSyntax", "require", "imports", "exports", "content", "addImport", "key", "value", "config", "options", "importsEntries", "exportEntries", "name", "sources", "generateTSFileSchema", "aot", "jit", "generateFileSchema", "generateESMFileSchema", "generateCJSFileSchema"]
|
|
7
|
-
}
|