@wyw-in-js/processor-utils 0.4.1 → 0.5.1

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.
@@ -15,6 +15,7 @@ export default function getClassNameAndSlug(displayName, idx, options, context)
15
15
  const slugVars = {
16
16
  hash: slug,
17
17
  title: displayName,
18
+ index: idx,
18
19
  file: relativeFilename,
19
20
  ext,
20
21
  name: basename(relativeFilename, ext),
@@ -1 +1 @@
1
- {"version":3,"file":"getClassNameAndSlug.js","names":["basename","dirname","extname","relative","sep","posix","logger","slugify","buildSlug","toValidCSSIdentifier","getClassNameAndSlug","displayName","idx","options","context","relativeFilename","root","filename","replace","slug","charAt","toLowerCase","ext","slugVars","hash","title","file","name","dir","split","pop","className","classNameSlug","Error","extend"],"sources":["../../src/utils/getClassNameAndSlug.ts"],"sourcesContent":["import { basename, dirname, extname, relative, sep, posix } from 'path';\n\nimport type { ClassNameSlugVars } from '@wyw-in-js/shared';\nimport { logger, slugify } from '@wyw-in-js/shared';\n\nimport { buildSlug } from './buildSlug';\nimport { toValidCSSIdentifier } from './toValidCSSIdentifier';\nimport type { IFileContext, IOptions } from './types';\n\nexport default function getClassNameAndSlug(\n displayName: string,\n idx: number,\n options: IOptions,\n context: IFileContext\n): { className: string; slug: string } {\n const relativeFilename = (\n context.root && context.filename\n ? relative(context.root, context.filename)\n : context.filename ?? 'unknown'\n ).replace(/\\\\/g, posix.sep);\n\n // Custom properties need to start with a letter, so we prefix the slug\n // Also use append the index of the class to the filename for uniqueness in the file\n const slug = toValidCSSIdentifier(\n `${displayName.charAt(0).toLowerCase()}${slugify(\n `${relativeFilename}:${idx}`\n )}`\n );\n\n // Collect some useful replacement patterns from the filename\n // Available variables for the square brackets used in `classNameSlug` options\n const ext = extname(relativeFilename);\n const slugVars: ClassNameSlugVars = {\n hash: slug,\n title: displayName,\n file: relativeFilename,\n ext,\n name: basename(relativeFilename, ext),\n dir: dirname(relativeFilename).split(sep).pop() as string,\n };\n\n let className = options.displayName\n ? `${toValidCSSIdentifier(displayName!)}_${slug!}`\n : slug!;\n\n // The className can be defined by the user either as fn or a string\n if (typeof options.classNameSlug === 'function') {\n try {\n className = toValidCSSIdentifier(\n options.classNameSlug(slug, displayName, slugVars)\n );\n } catch {\n throw new Error('classNameSlug option must return a string');\n }\n }\n\n if (typeof options.classNameSlug === 'string') {\n className = toValidCSSIdentifier(\n buildSlug(options.classNameSlug, slugVars)\n );\n }\n\n logger.extend('template-parse:generated-meta')(\n `slug: ${slug}, displayName: ${displayName}, className: ${className}`\n );\n\n return { className, slug };\n}\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,OAAO,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,MAAM;AAGvE,SAASC,MAAM,EAAEC,OAAO,QAAQ,mBAAmB;AAEnD,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,oBAAoB,QAAQ,wBAAwB;AAG7D,eAAe,SAASC,mBAAmBA,CACzCC,WAAmB,EACnBC,GAAW,EACXC,OAAiB,EACjBC,OAAqB,EACgB;EACrC,MAAMC,gBAAgB,GAAG,CACvBD,OAAO,CAACE,IAAI,IAAIF,OAAO,CAACG,QAAQ,GAC5Bd,QAAQ,CAACW,OAAO,CAACE,IAAI,EAAEF,OAAO,CAACG,QAAQ,CAAC,GACxCH,OAAO,CAACG,QAAQ,IAAI,SAAS,EACjCC,OAAO,CAAC,KAAK,EAAEb,KAAK,CAACD,GAAG,CAAC;;EAE3B;EACA;EACA,MAAMe,IAAI,GAAGV,oBAAoB,CAC9B,GAAEE,WAAW,CAACS,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAE,GAAEd,OAAO,CAC7C,GAAEQ,gBAAiB,IAAGH,GAAI,EAC7B,CAAE,EACJ,CAAC;;EAED;EACA;EACA,MAAMU,GAAG,GAAGpB,OAAO,CAACa,gBAAgB,CAAC;EACrC,MAAMQ,QAA2B,GAAG;IAClCC,IAAI,EAAEL,IAAI;IACVM,KAAK,EAAEd,WAAW;IAClBe,IAAI,EAAEX,gBAAgB;IACtBO,GAAG;IACHK,IAAI,EAAE3B,QAAQ,CAACe,gBAAgB,EAAEO,GAAG,CAAC;IACrCM,GAAG,EAAE3B,OAAO,CAACc,gBAAgB,CAAC,CAACc,KAAK,CAACzB,GAAG,CAAC,CAAC0B,GAAG,CAAC;EAChD,CAAC;EAED,IAAIC,SAAS,GAAGlB,OAAO,CAACF,WAAW,GAC9B,GAAEF,oBAAoB,CAACE,WAAY,CAAE,IAAGQ,IAAM,EAAC,GAChDA,IAAK;;EAET;EACA,IAAI,OAAON,OAAO,CAACmB,aAAa,KAAK,UAAU,EAAE;IAC/C,IAAI;MACFD,SAAS,GAAGtB,oBAAoB,CAC9BI,OAAO,CAACmB,aAAa,CAACb,IAAI,EAAER,WAAW,EAAEY,QAAQ,CACnD,CAAC;IACH,CAAC,CAAC,MAAM;MACN,MAAM,IAAIU,KAAK,CAAC,2CAA2C,CAAC;IAC9D;EACF;EAEA,IAAI,OAAOpB,OAAO,CAACmB,aAAa,KAAK,QAAQ,EAAE;IAC7CD,SAAS,GAAGtB,oBAAoB,CAC9BD,SAAS,CAACK,OAAO,CAACmB,aAAa,EAAET,QAAQ,CAC3C,CAAC;EACH;EAEAjB,MAAM,CAAC4B,MAAM,CAAC,+BAA+B,CAAC,CAC3C,SAAQf,IAAK,kBAAiBR,WAAY,gBAAeoB,SAAU,EACtE,CAAC;EAED,OAAO;IAAEA,SAAS;IAAEZ;EAAK,CAAC;AAC5B"}
1
+ {"version":3,"file":"getClassNameAndSlug.js","names":["basename","dirname","extname","relative","sep","posix","logger","slugify","buildSlug","toValidCSSIdentifier","getClassNameAndSlug","displayName","idx","options","context","relativeFilename","root","filename","replace","slug","charAt","toLowerCase","ext","slugVars","hash","title","index","file","name","dir","split","pop","className","classNameSlug","Error","extend"],"sources":["../../src/utils/getClassNameAndSlug.ts"],"sourcesContent":["import { basename, dirname, extname, relative, sep, posix } from 'path';\n\nimport type { ClassNameSlugVars } from '@wyw-in-js/shared';\nimport { logger, slugify } from '@wyw-in-js/shared';\n\nimport { buildSlug } from './buildSlug';\nimport { toValidCSSIdentifier } from './toValidCSSIdentifier';\nimport type { IFileContext, IOptions } from './types';\n\nexport default function getClassNameAndSlug(\n displayName: string,\n idx: number,\n options: IOptions,\n context: IFileContext\n): { className: string; slug: string } {\n const relativeFilename = (\n context.root && context.filename\n ? relative(context.root, context.filename)\n : context.filename ?? 'unknown'\n ).replace(/\\\\/g, posix.sep);\n\n // Custom properties need to start with a letter, so we prefix the slug\n // Also use append the index of the class to the filename for uniqueness in the file\n const slug = toValidCSSIdentifier(\n `${displayName.charAt(0).toLowerCase()}${slugify(\n `${relativeFilename}:${idx}`\n )}`\n );\n\n // Collect some useful replacement patterns from the filename\n // Available variables for the square brackets used in `classNameSlug` options\n const ext = extname(relativeFilename);\n const slugVars: ClassNameSlugVars = {\n hash: slug,\n title: displayName,\n index: idx,\n file: relativeFilename,\n ext,\n name: basename(relativeFilename, ext),\n dir: dirname(relativeFilename).split(sep).pop() as string,\n };\n\n let className = options.displayName\n ? `${toValidCSSIdentifier(displayName!)}_${slug!}`\n : slug!;\n\n // The className can be defined by the user either as fn or a string\n if (typeof options.classNameSlug === 'function') {\n try {\n className = toValidCSSIdentifier(\n options.classNameSlug(slug, displayName, slugVars)\n );\n } catch {\n throw new Error('classNameSlug option must return a string');\n }\n }\n\n if (typeof options.classNameSlug === 'string') {\n className = toValidCSSIdentifier(\n buildSlug(options.classNameSlug, slugVars)\n );\n }\n\n logger.extend('template-parse:generated-meta')(\n `slug: ${slug}, displayName: ${displayName}, className: ${className}`\n );\n\n return { className, slug };\n}\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,OAAO,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,GAAG,EAAEC,KAAK,QAAQ,MAAM;AAGvE,SAASC,MAAM,EAAEC,OAAO,QAAQ,mBAAmB;AAEnD,SAASC,SAAS,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EAAER,WAAW,EAAEY,QAAQ,CACnD,CAAC;IACH,CAAC,CAAC,MAAM;MACN,MAAM,IAAIW,KAAK,CAAC,2CAA2C,CAAC;IAC9D;EACF;EAEA,IAAI,OAAOrB,OAAO,CAACoB,aAAa,KAAK,QAAQ,EAAE;IAC7CD,SAAS,GAAGvB,oBAAoB,CAC9BD,SAAS,CAACK,OAAO,CAACoB,aAAa,EAAEV,QAAQ,CAC3C,CAAC;EACH;EAEAjB,MAAM,CAAC6B,MAAM,CAAC,+BAA+B,CAAC,CAC3C,SAAQhB,IAAK,kBAAiBR,WAAY,gBAAeqB,SAAU,EACtE,CAAC;EAED,OAAO;IAAEA,SAAS;IAAEb;EAAK,CAAC;AAC5B"}
@@ -22,6 +22,7 @@ function getClassNameAndSlug(displayName, idx, options, context) {
22
22
  const slugVars = {
23
23
  hash: slug,
24
24
  title: displayName,
25
+ index: idx,
25
26
  file: relativeFilename,
26
27
  ext,
27
28
  name: (0, _path.basename)(relativeFilename, ext),
@@ -1 +1 @@
1
- {"version":3,"file":"getClassNameAndSlug.js","names":["_path","require","_shared","_buildSlug","_toValidCSSIdentifier","getClassNameAndSlug","displayName","idx","options","context","_context$filename","relativeFilename","root","filename","relative","replace","posix","sep","slug","toValidCSSIdentifier","charAt","toLowerCase","slugify","ext","extname","slugVars","hash","title","file","name","basename","dir","dirname","split","pop","className","classNameSlug","Error","buildSlug","logger","extend"],"sources":["../../src/utils/getClassNameAndSlug.ts"],"sourcesContent":["import { basename, dirname, extname, relative, sep, posix } from 'path';\n\nimport type { ClassNameSlugVars } from '@wyw-in-js/shared';\nimport { logger, slugify } from '@wyw-in-js/shared';\n\nimport { buildSlug } from './buildSlug';\nimport { toValidCSSIdentifier } from './toValidCSSIdentifier';\nimport type { IFileContext, IOptions } from './types';\n\nexport default function getClassNameAndSlug(\n displayName: string,\n idx: number,\n options: IOptions,\n context: IFileContext\n): { className: string; slug: string } {\n const relativeFilename = (\n context.root && context.filename\n ? relative(context.root, context.filename)\n : context.filename ?? 'unknown'\n ).replace(/\\\\/g, posix.sep);\n\n // Custom properties need to start with a letter, so we prefix the slug\n // Also use append the index of the class to the filename for uniqueness in the file\n const slug = toValidCSSIdentifier(\n `${displayName.charAt(0).toLowerCase()}${slugify(\n `${relativeFilename}:${idx}`\n )}`\n );\n\n // Collect some useful replacement patterns from the filename\n // Available variables for the square brackets used in `classNameSlug` options\n const ext = extname(relativeFilename);\n const slugVars: ClassNameSlugVars = {\n hash: slug,\n title: displayName,\n file: relativeFilename,\n ext,\n name: basename(relativeFilename, ext),\n dir: dirname(relativeFilename).split(sep).pop() as string,\n };\n\n let className = options.displayName\n ? `${toValidCSSIdentifier(displayName!)}_${slug!}`\n : slug!;\n\n // The className can be defined by the user either as fn or a string\n if (typeof options.classNameSlug === 'function') {\n try {\n className = toValidCSSIdentifier(\n options.classNameSlug(slug, displayName, slugVars)\n );\n } catch {\n throw new Error('classNameSlug option must return a string');\n }\n }\n\n if (typeof options.classNameSlug === 'string') {\n className = toValidCSSIdentifier(\n buildSlug(options.classNameSlug, slugVars)\n );\n }\n\n logger.extend('template-parse:generated-meta')(\n `slug: ${slug}, displayName: ${displayName}, className: ${className}`\n );\n\n return { className, slug };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AAGe,SAASI,mBAAmBA,CACzCC,WAAmB,EACnBC,GAAW,EACXC,OAAiB,EACjBC,OAAqB,EACgB;EAAA,IAAAC,iBAAA;EACrC,MAAMC,gBAAgB,GAAG,CACvBF,OAAO,CAACG,IAAI,IAAIH,OAAO,CAACI,QAAQ,GAC5B,IAAAC,cAAQ,EAACL,OAAO,CAACG,IAAI,EAAEH,OAAO,CAACI,QAAQ,CAAC,IAAAH,iBAAA,GACxCD,OAAO,CAACI,QAAQ,cAAAH,iBAAA,cAAAA,iBAAA,GAAI,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EAc,cAAM,CAACC,MAAM,CAAC,+BAA+B,CAAC,CAC3C,SAAQtB,IAAK,kBAAiBZ,WAAY,gBAAe6B,SAAU,EACtE,CAAC;EAED,OAAO;IAAEA,SAAS;IAAEjB;EAAK,CAAC;AAC5B"}
1
+ {"version":3,"file":"getClassNameAndSlug.js","names":["_path","require","_shared","_buildSlug","_toValidCSSIdentifier","getClassNameAndSlug","displayName","idx","options","context","_context$filename","relativeFilename","root","filename","relative","replace","posix","sep","slug","toValidCSSIdentifier","charAt","toLowerCase","slugify","ext","extname","slugVars","hash","title","index","file","name","basename","dir","dirname","split","pop","className","classNameSlug","Error","buildSlug","logger","extend"],"sources":["../../src/utils/getClassNameAndSlug.ts"],"sourcesContent":["import { basename, dirname, extname, relative, sep, posix } from 'path';\n\nimport type { ClassNameSlugVars } from '@wyw-in-js/shared';\nimport { logger, slugify } from '@wyw-in-js/shared';\n\nimport { buildSlug } from './buildSlug';\nimport { toValidCSSIdentifier } from './toValidCSSIdentifier';\nimport type { IFileContext, IOptions } from './types';\n\nexport default function getClassNameAndSlug(\n displayName: string,\n idx: number,\n options: IOptions,\n context: IFileContext\n): { className: string; slug: string } {\n const relativeFilename = (\n context.root && context.filename\n ? relative(context.root, context.filename)\n : context.filename ?? 'unknown'\n ).replace(/\\\\/g, posix.sep);\n\n // Custom properties need to start with a letter, so we prefix the slug\n // Also use append the index of the class to the filename for uniqueness in the file\n const slug = toValidCSSIdentifier(\n `${displayName.charAt(0).toLowerCase()}${slugify(\n `${relativeFilename}:${idx}`\n )}`\n );\n\n // Collect some useful replacement patterns from the filename\n // Available variables for the square brackets used in `classNameSlug` options\n const ext = extname(relativeFilename);\n const slugVars: ClassNameSlugVars = {\n hash: slug,\n title: displayName,\n index: idx,\n file: relativeFilename,\n ext,\n name: basename(relativeFilename, ext),\n dir: dirname(relativeFilename).split(sep).pop() as string,\n };\n\n let className = options.displayName\n ? `${toValidCSSIdentifier(displayName!)}_${slug!}`\n : slug!;\n\n // The className can be defined by the user either as fn or a string\n if (typeof options.classNameSlug === 'function') {\n try {\n className = toValidCSSIdentifier(\n options.classNameSlug(slug, displayName, slugVars)\n );\n } catch {\n throw new Error('classNameSlug option must return a string');\n }\n }\n\n if (typeof options.classNameSlug === 'string') {\n className = toValidCSSIdentifier(\n buildSlug(options.classNameSlug, slugVars)\n );\n }\n\n logger.extend('template-parse:generated-meta')(\n `slug: ${slug}, displayName: ${displayName}, className: ${className}`\n );\n\n return { className, slug };\n}\n"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AAGe,SAASI,mBAAmBA,CACzCC,WAAmB,EACnBC,GAAW,EACXC,OAAiB,EACjBC,OAAqB,EACgB;EAAA,IAAAC,iBAAA;EACrC,MAAMC,gBAAgB,GAAG,CACvBF,OAAO,CAACG,IAAI,IAAIH,OAAO,CAACI,QAAQ,GAC5B,IAAAC,cAAQ,EAACL,OAAO,CAACG,IAAI,EAAEH,OAAO,CAACI,QAAQ,CAAC,IAAAH,iBAAA,GACxCD,OAAO,CAACI,QAAQ,cAAAH,iBAAA,cAAAA,iBAAA,GAAI,SAAS,EACjCK,OAAO,CAAC,KAAK,EAAEC,WAAK,CAACC,GAAG,CAAC;;EAE3B;EACA;EACA,MAAMC,IAAI,GAAG,IAAAC,0CAAoB,EAC9B,GAAEb,WAAW,CAACc,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAE,GAAE,IAAAC,eAAO,EAC7C,GAAEX,gBAAiB,IAAGJ,GAAI,EAC7B,CAAE,EACJ,CAAC;;EAED;EACA;EACA,MAAMgB,GAAG,GAAG,IAAAC,aAAO,EAACb,gBAAgB,CAAC;EACrC,MAAMc,QAA2B,GAAG;IAClCC,IAAI,EAAER,IAAI;IACVS,KAAK,EAAErB,WAAW;IAClBsB,KAAK,EAAErB,GAAG;IACVsB,IAAI,EAAElB,gBAAgB;IACtBY,GAAG;IACHO,IAAI,EAAE,IAAAC,cAAQ,EAACpB,gBAAgB,EAAEY,GAAG,CAAC;IACrCS,GAAG,EAAE,IAAAC,aAAO,EAACtB,gBAAgB,CAAC,CAACuB,KAAK,CAACjB,SAAG,CAAC,CAACkB,GAAG,CAAC;EAChD,CAAC;EAED,IAAIC,SAAS,GAAG5B,OAAO,CAACF,WAAW,GAC9B,GAAE,IAAAa,0CAAoB,EAACb,WAAY,CAAE,IAAGY,IAAM,EAAC,GAChDA,IAAK;;EAET;EACA,IAAI,OAAOV,OAAO,CAAC6B,aAAa,KAAK,UAAU,EAAE;IAC/C,IAAI;MACFD,SAAS,GAAG,IAAAjB,0CAAoB,EAC9BX,OAAO,CAAC6B,aAAa,CAACnB,IAAI,EAAEZ,WAAW,EAAEmB,QAAQ,CACnD,CAAC;IACH,CAAC,CAAC,MAAM;MACN,MAAM,IAAIa,KAAK,CAAC,2CAA2C,CAAC;IAC9D;EACF;EAEA,IAAI,OAAO9B,OAAO,CAAC6B,aAAa,KAAK,QAAQ,EAAE;IAC7CD,SAAS,GAAG,IAAAjB,0CAAoB,EAC9B,IAAAoB,oBAAS,EAAC/B,OAAO,CAAC6B,aAAa,EAAEZ,QAAQ,CAC3C,CAAC;EACH;EAEAe,cAAM,CAACC,MAAM,CAAC,+BAA+B,CAAC,CAC3C,SAAQvB,IAAK,kBAAiBZ,WAAY,gBAAe8B,SAAU,EACtE,CAAC;EAED,OAAO;IAAEA,SAAS;IAAElB;EAAK,CAAC;AAC5B"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@wyw-in-js/processor-utils",
3
- "version": "0.4.1",
3
+ "version": "0.5.1",
4
4
  "dependencies": {
5
5
  "@babel/generator": "^7.23.5",
6
- "@wyw-in-js/shared": "0.4.1"
6
+ "@wyw-in-js/shared": "0.5.1"
7
7
  },
8
8
  "devDependencies": {
9
9
  "@babel/types": "^7.23.5",
@@ -11,10 +11,10 @@
11
11
  "@types/babel__generator": "^7.6.7",
12
12
  "@types/node": "^16.18.55",
13
13
  "typescript": "^5.2.2",
14
- "@wyw-in-js/babel-config": "0.4.1",
15
- "@wyw-in-js/eslint-config": "0.4.1",
16
- "@wyw-in-js/jest-preset": "0.4.1",
17
- "@wyw-in-js/ts-config": "0.4.1"
14
+ "@wyw-in-js/babel-config": "0.5.1",
15
+ "@wyw-in-js/eslint-config": "0.5.1",
16
+ "@wyw-in-js/jest-preset": "0.5.1",
17
+ "@wyw-in-js/ts-config": "0.5.1"
18
18
  },
19
19
  "engines": {
20
20
  "node": ">=16.0.0"
@@ -17,6 +17,7 @@ function getClassNameAndSlug(displayName, idx, options, context) {
17
17
  const slugVars = {
18
18
  hash: slug,
19
19
  title: displayName,
20
+ index: idx,
20
21
  file: relativeFilename,
21
22
  ext,
22
23
  name: (0, path_1.basename)(relativeFilename, ext),