@master/css-cli 2.0.0-beta.105 → 2.0.0-beta.107

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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
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 O={};h(O,{generateCJSFileSchema:()=>F,generateESMFileSchema:()=>C,generateTSFileSchema:()=>y});module.exports=$(O);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 = {
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
2
  themes: {},
3
3
  colors: {},
4
4
  classes: {},
@@ -8,7 +8,7 @@ var g=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var S=Object.g
8
8
  selectors: {},
9
9
  mediaQueries: {}
10
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 options = {
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
12
  sources: [],
13
13
  classes: {
14
14
  // whitelist of class names for unpredictable dynamics
@@ -17,7 +17,7 @@ var g=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var S=Object.g
17
17
  ignored: [] // or RegExp[]
18
18
  }
19
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.options=""}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(`
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
21
  `)+`
22
22
 
23
23
  `:"")+m.join(`
@@ -28,5 +28,5 @@ var g=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var S=Object.g
28
28
  ${b.map(([e,n])=>n?e+": "+n:e).join(`,
29
29
  `)}
30
30
  }`:b.filter(([,e])=>e).map(([e,n])=>`export const ${e} = ${n}`).join(`
31
- `))}function y({aot:o,jit:t}){return l({aot:o,jit:t})}function C({aot:o,jit:t}){return l({aot:o,jit:t,typeSyntax:!0})}function F({aot:o,jit:t}){return l({aot:o,jit:t,moduleExports:!0,typeSyntax:!0,require:!0})}0&&(module.exports={generateCJSFileSchema,generateESMFileSchema,generateTSFileSchema});
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
32
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
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 options = {\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['options'] = ''\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,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DrFO,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",
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,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O,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
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
7
  }
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@master/css-cli","scripts":{"build":"esbuild src/index.ts src/bin/index.ts --bundle --outdir=dist --format=cjs --minify --sourcemap --platform=node --external:chokidar --external:commander --external:fs-extra --external:@master/css-compiler","dev":"npm run build -- --watch","lint":"eslint ./src","test":"jest"},"license":"MIT","description":"The CLI of Master CSS","author":"Aoyue Design LLC.","funding":"https://docs.master.co/css/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/cli"},"keywords":["css","cli","mastercss"],"main":"./dist/index.cjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"files":["dist"],"bin":{"mcss":"./dist/bin/index.js","mastercss":"./dist/bin/index.js"},"publishConfig":{"access":"public"},"dependencies":{"chokidar":"^3.5.3","commander":"^10.0.0","fast-glob":"^3.2.12","fs-extra":"^11.1.0"},"version":"2.0.0-beta.105"}
1
+ {"name":"@master/css-cli","scripts":{"build":"esbuild src/index.ts src/bin/index.ts --bundle --outdir=dist --format=cjs --minify --sourcemap --platform=node --external:chokidar --external:commander --external:fs-extra --external:@master/css-compiler","dev":"npm run build -- --watch","lint":"eslint ./src","test":"jest"},"license":"MIT","description":"The CLI of Master CSS","author":"Aoyue Design LLC.","funding":"https://docs.master.co/css/donate","homepage":"https://css.master.co","bugs":{"url":"https://github.com/master-co/css/issues"},"repository":{"type":"git","url":"https://github.com/master-co/css.git","directory":"packages/cli"},"keywords":["css","cli","mastercss"],"main":"./dist/index.cjs","jsnext:main":"./dist/index.mjs","esnext":"./dist/index.mjs","module":"./dist/index.mjs","types":"./dist/index.d.ts","exports":{".":{"require":"./dist/index.cjs","import":"./dist/index.mjs","types":"./dist/index.d.ts"}},"files":["dist"],"bin":{"mcss":"./dist/bin/index.js","mastercss":"./dist/bin/index.js"},"publishConfig":{"access":"public"},"dependencies":{"chokidar":"^3.5.3","commander":"^10.0.0","fast-glob":"^3.2.12","fs-extra":"^11.1.0"},"version":"2.0.0-beta.107"}