@cssxjs/loaders 0.2.16 → 0.2.18
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/CHANGELOG.md +12 -0
- package/package.json +2 -2
- package/stylusToCssLoader.js +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v0.2.18 (Mon Nov 24 2025)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- feat: check for @startupjs-ui/core presense and load styles from it ([@cray0000](https://github.com/cray0000))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Pavel Zhukov ([@cray0000](https://github.com/cray0000))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v0.2.16 (Sun Nov 09 2025)
|
|
2
14
|
|
|
3
15
|
#### 🚀 Enhancement
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cssxjs/loaders",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18",
|
|
4
4
|
"description": "Webpack-compatible loaders for CSSX styles in React Native and Web bundlers",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./callLoader": "./callLoader.js",
|
|
@@ -23,5 +23,5 @@
|
|
|
23
23
|
"@startupjs/css-to-react-native-transform": "^2.1.0-1",
|
|
24
24
|
"stylus": "0.64.0"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "d3031e5be896899e7dc72a69a1e4fd0731ba44c9"
|
|
27
27
|
}
|
package/stylusToCssLoader.js
CHANGED
|
@@ -9,6 +9,7 @@ patchStylusAddUnit()
|
|
|
9
9
|
|
|
10
10
|
const PROJECT_STYLES_PATH = join(process.cwd(), 'styles/index.styl')
|
|
11
11
|
let UI_STYLES_PATH
|
|
12
|
+
let UI_CORE_STYLES_PATH
|
|
12
13
|
|
|
13
14
|
function renderToCSS (src, filename, { platform } = {}) {
|
|
14
15
|
const compiler = stylus(src)
|
|
@@ -23,6 +24,10 @@ function renderToCSS (src, filename, { platform } = {}) {
|
|
|
23
24
|
compiler.import(UI_STYLES_PATH)
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
if (checkUiCoreStylesExist()) {
|
|
28
|
+
compiler.import(UI_CORE_STYLES_PATH)
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
// TODO: Make this a setting
|
|
27
32
|
if (checkProjectStylesExist()) {
|
|
28
33
|
compiler.import(PROJECT_STYLES_PATH)
|
|
@@ -59,6 +64,22 @@ function checkUiStylesExist () {
|
|
|
59
64
|
return uiStylesExist
|
|
60
65
|
}
|
|
61
66
|
|
|
67
|
+
// check if @startupjs-ui/core is being used to load styles file from it, cache result for 5 seconds
|
|
68
|
+
let uiCoreStylesExist
|
|
69
|
+
let uiCoreStylesLastChecked = 0
|
|
70
|
+
function checkUiCoreStylesExist () {
|
|
71
|
+
if (uiCoreStylesLastChecked + 5000 > Date.now()) return uiCoreStylesExist
|
|
72
|
+
uiCoreStylesLastChecked = Date.now()
|
|
73
|
+
try {
|
|
74
|
+
// TODO: make this configurable
|
|
75
|
+
UI_CORE_STYLES_PATH = join(require.resolve('@startupjs-ui/core'), '../styles/index.styl')
|
|
76
|
+
uiCoreStylesExist = existsSync(UI_CORE_STYLES_PATH)
|
|
77
|
+
} catch {
|
|
78
|
+
uiCoreStylesExist = false
|
|
79
|
+
}
|
|
80
|
+
return uiCoreStylesExist
|
|
81
|
+
}
|
|
82
|
+
|
|
62
83
|
// check if project styles file exist, cache result for 5 seconds
|
|
63
84
|
let projectStylesExist
|
|
64
85
|
let projectStylesLastChecked = 0
|