@lipemat/js-boilerplate 10.14.4 → 10.14.5
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.
|
@@ -17,7 +17,11 @@ let counters = [-1];
|
|
|
17
17
|
* @since 4.6.0
|
|
18
18
|
*/
|
|
19
19
|
function usingShortCssClasses() {
|
|
20
|
-
|
|
20
|
+
const short = (0, package_config_1.getPackageConfig)().shortCssClasses;
|
|
21
|
+
if ('object' === typeof short) {
|
|
22
|
+
return Boolean(short.js);
|
|
23
|
+
}
|
|
24
|
+
return Boolean(short);
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
27
|
* Reset all counters.
|
|
@@ -28,10 +32,10 @@ function resetCounters() {
|
|
|
28
32
|
counters = [-1];
|
|
29
33
|
}
|
|
30
34
|
/**
|
|
31
|
-
* Get the next class
|
|
35
|
+
* Get the next class in the sequence based on:
|
|
32
36
|
* 1. Single character from SHORT_ALPHABET (prevent conflicts with JS boilerplate).
|
|
33
37
|
* 2. Incremented character from the `ALPHABET`.
|
|
34
|
-
* 1. Used once
|
|
38
|
+
* 1. Used once requires 2+ characters.
|
|
35
39
|
* 2. Grows to 3+ characters as needed.
|
|
36
40
|
*
|
|
37
41
|
* @return {string}
|
|
@@ -39,7 +43,7 @@ function resetCounters() {
|
|
|
39
43
|
function getNextClass() {
|
|
40
44
|
const last = counters.length - 1;
|
|
41
45
|
let totalLetters = exports.ALPHABET.length - 1;
|
|
42
|
-
//
|
|
46
|
+
// The first level uses the SHORT_ALPHABET.
|
|
43
47
|
if (0 === last) {
|
|
44
48
|
totalLetters = exports.SHORT_ALPHABET.length - 1;
|
|
45
49
|
}
|
|
@@ -56,7 +60,7 @@ function getNextClass() {
|
|
|
56
60
|
/**
|
|
57
61
|
* When we run out of characters on the current level:
|
|
58
62
|
* 1. Increment the parent level.
|
|
59
|
-
* 2. Reset current level and all child levels back to 0.
|
|
63
|
+
* 2. Reset the current level and all child levels back to 0.
|
|
60
64
|
*
|
|
61
65
|
* If we are out of characters on the parent level or have
|
|
62
66
|
* no parent level:
|
|
@@ -68,7 +72,7 @@ function incrementParent() {
|
|
|
68
72
|
let parent = counters.length - 2;
|
|
69
73
|
let totalLetters = exports.ALPHABET.length - 1;
|
|
70
74
|
while (counters[parent] !== undefined) {
|
|
71
|
-
//
|
|
75
|
+
// The first level uses the SHORT_ALPHABET.
|
|
72
76
|
if (0 === parent) {
|
|
73
77
|
totalLetters = exports.SHORT_ALPHABET.length - 1;
|
|
74
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"css-classnames.js","sourceRoot":"","sources":["css-classnames.ts"],"names":[],"mappings":";;;AAsBA,
|
|
1
|
+
{"version":3,"file":"css-classnames.js","sourceRoot":"","sources":["css-classnames.ts"],"names":[],"mappings":";;;AAsBA,oDAMC;AAOD,sCAEC;AAWD,oCAkBC;AAlED,qDAAkD;AAIrC,QAAA,cAAc,GAAG,4BAA4B,CAAC;AAC9C,QAAA,QAAQ,GAAG,gEAAgE,CAAC;AAEzF,MAAM,OAAO,GAIT,EAAE,CAAC;AAEP,IAAI,QAAQ,GAAG,CAAE,CAAC,CAAC,CAAE,CAAC;AAEtB;;;;;;GAMG;AACH,SAAgB,oBAAoB;IACnC,MAAM,KAAK,GAAG,IAAA,iCAAgB,GAAE,CAAC,eAAe,CAAC;IACjD,IAAK,QAAQ,KAAK,OAAO,KAAK,EAAG,CAAC;QACjC,OAAO,OAAO,CAAE,KAAK,CAAC,EAAE,CAAE,CAAA;IAC3B,CAAC;IACD,OAAO,OAAO,CAAE,KAAK,CAAE,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,SAAgB,aAAa;IAC5B,QAAQ,GAAG,CAAE,CAAC,CAAC,CAAE,CAAC;AACnB,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,YAAY;IAC3B,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;IACjC,IAAI,YAAY,GAAG,gB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CAAC;YACD,OAAO;QACR,CAAC;QACD,MAAM,EAAE,CAAC;IACV,CAAC;IAED,iDAAiD;IACjD,QAAQ,CAAC,OAAO,CAAE,CAAE,CAAC,EAAE,CAAC,EAAG,EAAE,CAAC,QAAQ,CAAE,CAAC,CAAE,GAAG,CAAC,CAAE,CAAC;IAClD,QAAQ,CAAC,IAAI,CAAE,CAAC,CAAE,CAAC;AACpB,CAAC;AAID;;;;;;;;;;GAUG;AACI,MAAM,aAAa,GAAG,CAAE,EAAC,YAAY,EAA+C,EAAE,CAAsB,EAAE,SAA8B,EAA8B,EAAE;IAClL,OAAO,CAAE,YAAY,CAAE,KAAK,EAAE,CAAC;IAC/B,OAAO,CAAE,YAAY,CAAE,CAAE,SAAS,CAAE,KAAK,YAAY,EAAE,CAAC;IACxD,OAAO,OAAO,CAAE,YAAY,CAAE,CAAE,SAAS,CAAE,CAAC;AAC7C,CAAC,CAAC;AAJW,QAAA,aAAa,iBAIxB"}
|
|
@@ -21,7 +21,11 @@ let counters = [ -1 ];
|
|
|
21
21
|
* @since 4.6.0
|
|
22
22
|
*/
|
|
23
23
|
export function usingShortCssClasses(): boolean {
|
|
24
|
-
|
|
24
|
+
const short = getPackageConfig().shortCssClasses;
|
|
25
|
+
if ( 'object' === typeof short ) {
|
|
26
|
+
return Boolean( short.js )
|
|
27
|
+
}
|
|
28
|
+
return Boolean( short );
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
/**
|
|
@@ -34,10 +38,10 @@ export function resetCounters(): void {
|
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
/**
|
|
37
|
-
* Get the next class
|
|
41
|
+
* Get the next class in the sequence based on:
|
|
38
42
|
* 1. Single character from SHORT_ALPHABET (prevent conflicts with JS boilerplate).
|
|
39
43
|
* 2. Incremented character from the `ALPHABET`.
|
|
40
|
-
* 1. Used once
|
|
44
|
+
* 1. Used once requires 2+ characters.
|
|
41
45
|
* 2. Grows to 3+ characters as needed.
|
|
42
46
|
*
|
|
43
47
|
* @return {string}
|
|
@@ -46,7 +50,7 @@ export function getNextClass(): string {
|
|
|
46
50
|
const last = counters.length - 1;
|
|
47
51
|
let totalLetters = ALPHABET.length - 1;
|
|
48
52
|
|
|
49
|
-
//
|
|
53
|
+
// The first level uses the SHORT_ALPHABET.
|
|
50
54
|
if ( 0 === last ) {
|
|
51
55
|
totalLetters = SHORT_ALPHABET.length - 1;
|
|
52
56
|
}
|
|
@@ -66,7 +70,7 @@ export function getNextClass(): string {
|
|
|
66
70
|
/**
|
|
67
71
|
* When we run out of characters on the current level:
|
|
68
72
|
* 1. Increment the parent level.
|
|
69
|
-
* 2. Reset current level and all child levels back to 0.
|
|
73
|
+
* 2. Reset the current level and all child levels back to 0.
|
|
70
74
|
*
|
|
71
75
|
* If we are out of characters on the parent level or have
|
|
72
76
|
* no parent level:
|
|
@@ -79,7 +83,7 @@ function incrementParent() {
|
|
|
79
83
|
let totalLetters = ALPHABET.length - 1;
|
|
80
84
|
|
|
81
85
|
while ( counters[ parent ] !== undefined ) {
|
|
82
|
-
//
|
|
86
|
+
// The first level uses the SHORT_ALPHABET.
|
|
83
87
|
if ( 0 === parent ) {
|
|
84
88
|
totalLetters = SHORT_ALPHABET.length - 1;
|
|
85
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-config.js","sourceRoot":"","sources":["package-config.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"package-config.js","sourceRoot":"","sources":["package-config.ts"],"names":[],"mappings":";;AAyFA,4CAEC;AA3FD,+BAA6B;AAC7B,qCAAqC;AAiDrC,MAAM,gBAAgB,GAAG,IAAA,sBAAY,EAAE,OAAO,CAAC,GAAG,EAAE,CAAE,CAAC;AACvD;;;;;;;;;;GAUG;AACH,MAAM,QAAQ,GAA2B;IACxC,WAAW,EAAE,KAAK;IAClB,UAAU,EAAE,KAAK;IACjB,MAAM,EAAE,IAAI;IACZ,gBAAgB,EAAE,gBAAgB;IAClC,eAAe,EAAE,KAAK;IACtB,GAAG,EAAE,kBAAkB;CACvB,CAAA;AAED,IAAI,aAAa,GAAkB,OAAO,CAAE,IAAA,cAAO,EAAE,gBAAgB,EAAE,cAAc,CAAE,CAAE,CAAC;AAC1F,aAAa,GAAG,EAAC,GAAG,QAAQ,EAAE,GAAG,aAAa,EAAC,CAAC;AAChD,aAAa,CAAC,gBAAgB,GAAG,aAAa,CAAC,MAAM,KAAK,EAAE,CAAC,CAAC,CAAC,IAAA,cAAO,EAAE,aAAa,CAAC,MAAM,CAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC;AAElH,IAAI,CAAC;IACJ,MAAM,WAAW,GAAG,OAAO,CAAE,IAAA,cAAO,EAAE,gBAAgB,EAAE,qBAAqB,CAAE,CAAE,CAAC;IAClF,aAAa,GAAG,EAAC,GAAG,aAAa,EAAE,GAAG,WAAW,EAAC,CAAC;AACpD,CAAC;AAAC,MAAM,CAAC;AACT,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,gBAAgB;IAC/B,OAAO,aAAa,CAAC;AACtB,CAAC;AACD,aAAa,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;AAElD,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC;AACtC,MAAM,CAAC,OAAO,GAAG,aAAa,CAAC"}
|
|
@@ -20,7 +20,10 @@ export interface PackageConfig {
|
|
|
20
20
|
packageManager?: string;
|
|
21
21
|
resolutions?: Dependencies;
|
|
22
22
|
scripts: Partial<Scripts>;
|
|
23
|
-
shortCssClasses: boolean
|
|
23
|
+
shortCssClasses: boolean | {
|
|
24
|
+
js: boolean;
|
|
25
|
+
pcss: boolean;
|
|
26
|
+
};
|
|
24
27
|
url: string;
|
|
25
28
|
version?: string;
|
|
26
29
|
workingDirectory: string;
|
|
@@ -73,7 +76,7 @@ packageConfig.workingDirectory = packageConfig.jsPath !== '' ? resolve( packageC
|
|
|
73
76
|
try {
|
|
74
77
|
const localConfig = require( resolve( workingDirectory, './local-config.json' ) );
|
|
75
78
|
packageConfig = {...packageConfig, ...localConfig};
|
|
76
|
-
} catch
|
|
79
|
+
} catch {
|
|
77
80
|
}
|
|
78
81
|
|
|
79
82
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lipemat/js-boilerplate",
|
|
3
|
-
"version": "10.14.
|
|
3
|
+
"version": "10.14.5",
|
|
4
4
|
"description": "Dependencies and scripts for a no config JavaScript app",
|
|
5
5
|
"author": "Mat Lipe",
|
|
6
6
|
"license": "MIT",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"react-refresh": "^0.17.0",
|
|
85
85
|
"style-loader": "^3.3.1",
|
|
86
86
|
"ts-node": "^10.9.1",
|
|
87
|
-
"typescript": "
|
|
87
|
+
"typescript": "^5.9.3",
|
|
88
88
|
"webpack": "^5.101.0",
|
|
89
89
|
"webpack-assets-manifest": "^6.2.1",
|
|
90
90
|
"webpack-cli": "^6.0.1",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"webpack-subresource-integrity": "^5.1.0"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
|
-
"@lipemat/eslint-config": "^
|
|
95
|
+
"@lipemat/eslint-config": "^5.1.3",
|
|
96
96
|
"@types/jest": "^29.5.3",
|
|
97
97
|
"@types/minimist": "^1",
|
|
98
98
|
"@types/react": "^18.2.64",
|