@lls/vitescripts 1.1.19 → 2.0.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/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
const llsCssModuleMacroPlugin = async (
|
|
2
|
-
const { buildThemeIsFreeMode, buildThemeIsDarkMode, buildThemeIsNotDarkMode } = await import('@lls/lls-kit')
|
|
1
|
+
const llsCssModuleMacroPlugin = async ({ themeIsFreeMode, themeIsDarkMode, themeIsNotDarkMode }) => {
|
|
3
2
|
const cssMacroTheme = {
|
|
4
|
-
themeIsFreeMode
|
|
5
|
-
themeIsDarkMode
|
|
6
|
-
themeIsNotDarkMode
|
|
7
|
-
...themes
|
|
3
|
+
themeIsFreeMode,
|
|
4
|
+
themeIsDarkMode,
|
|
5
|
+
themeIsNotDarkMode
|
|
8
6
|
}
|
|
9
7
|
return {
|
|
10
8
|
enforce: 'pre',
|
|
@@ -14,7 +12,13 @@ const llsCssModuleMacroPlugin = async (cname, themes = {}) => {
|
|
|
14
12
|
}
|
|
15
13
|
return src
|
|
16
14
|
.replace(/\${getTruePx\((.*?)\)}/g, 'calc(var(--size-index, 1) * $1 * 1px)')
|
|
17
|
-
.replace(/\${(themeIsFreeMode|themeIsDarkMode|themeIsNotDarkMode)}/g, (__, cap) =>
|
|
15
|
+
.replace(/\${(themeIsFreeMode|themeIsDarkMode|themeIsNotDarkMode)}/g, (__, cap) => {
|
|
16
|
+
const back = cssMacroTheme[cap]
|
|
17
|
+
if (!back) {
|
|
18
|
+
throw new Error('llsCssModuleMacroPlugin::missing definition for '+ cap)
|
|
19
|
+
}
|
|
20
|
+
return back
|
|
21
|
+
})
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
}
|
|
@@ -8,7 +8,9 @@ const pwd = process.cwd()
|
|
|
8
8
|
* @returns a plugin to pass to vite and aliases for sideRefreshed packages
|
|
9
9
|
*/
|
|
10
10
|
const llsSideRefreshMetaPlugin = ({ viewer: iViewer, superkit: iSuperkit, kit: iKit, utils: iUtils, core: iCore, code: iCode }, { client, publicDir='ladleassets' } = {}) => {
|
|
11
|
+
let active = false
|
|
11
12
|
if ([iViewer, iSuperkit, iKit, iUtils, iCore, iCode].some(x => x)) {
|
|
13
|
+
active = true
|
|
12
14
|
// eslint-disable-next-line no-console
|
|
13
15
|
console.log('sideResfresh: ', [
|
|
14
16
|
iViewer && 'viewer',
|
|
@@ -104,7 +106,7 @@ const llsSideRefreshMetaPlugin = ({ viewer: iViewer, superkit: iSuperkit, kit: i
|
|
|
104
106
|
...core.alias,
|
|
105
107
|
...code.alias
|
|
106
108
|
}
|
|
107
|
-
return { plugin, alias }
|
|
109
|
+
return { plugin, alias, active }
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
export default llsSideRefreshMetaPlugin
|