@plumeria/compiler 18.3.4 → 18.3.6
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 +8 -6
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -884,10 +884,11 @@ function compileCSS(options) {
|
|
|
884
884
|
else if (propName === 'createTheme' &&
|
|
885
885
|
args.length >= 2 &&
|
|
886
886
|
utils_1.t.isObjectExpression(args[1].expression)) {
|
|
887
|
-
let selector = '';
|
|
888
887
|
const selectorExpr = args[0].expression;
|
|
889
|
-
|
|
890
|
-
|
|
888
|
+
const selector = (0, utils_1.resolveThemeSelector)(selectorExpr, ctx.mergedStaticTable, ctx.mergedCreateStaticHashTable, ctx.scannedTables.createStaticObjectTable);
|
|
889
|
+
if (!selector) {
|
|
890
|
+
throw new Error(`[plumeria] createTheme needs a selector it can read at build time. ` +
|
|
891
|
+
`Pass a string literal such as ".dark", or a name this file declares as one. (${path.basename(resourcePath)})`);
|
|
891
892
|
}
|
|
892
893
|
const obj = (0, utils_1.objectExpressionToObject)(args[1].expression, ctx.mergedStaticTable, ctx.mergedKeyframesTable, ctx.mergedViewTransitionTable, ctx.mergedCreateThemeHashTable, ctx.scannedTables.createThemeObjectTable, ctx.mergedCreateTable, ctx.mergedCreateStaticHashTable, ctx.scannedTables.createStaticObjectTable, ctx.mergedVariantsTable);
|
|
893
894
|
const hash = (0, utils_1.themeHashOf)(selector, obj);
|
|
@@ -959,10 +960,11 @@ function compileCSS(options) {
|
|
|
959
960
|
}
|
|
960
961
|
}
|
|
961
962
|
else if (pName === 'createTheme') {
|
|
962
|
-
let selector = '';
|
|
963
963
|
const selectorExpr = init.arguments[0].expression;
|
|
964
|
-
|
|
965
|
-
|
|
964
|
+
const selector = (0, utils_1.resolveThemeSelector)(selectorExpr, ctx.mergedStaticTable, ctx.mergedCreateStaticHashTable, ctx.scannedTables.createStaticObjectTable);
|
|
965
|
+
if (!selector) {
|
|
966
|
+
throw new Error(`[plumeria] createTheme needs a selector it can read at build time. ` +
|
|
967
|
+
`Pass a string literal such as ".dark", or a name this file declares as one. (${path.basename(resourcePath)})`);
|
|
966
968
|
}
|
|
967
969
|
const obj = (0, utils_1.objectExpressionToObject)(arg, ctx.mergedStaticTable, ctx.mergedKeyframesTable, ctx.mergedViewTransitionTable, ctx.mergedCreateThemeHashTable, ctx.scannedTables.createThemeObjectTable, ctx.mergedCreateTable, ctx.mergedCreateStaticHashTable, ctx.scannedTables.createStaticObjectTable, ctx.mergedVariantsTable);
|
|
968
970
|
const hash = (0, utils_1.themeHashOf)(selector, obj);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/compiler",
|
|
3
|
-
"version": "18.3.
|
|
3
|
+
"version": "18.3.6",
|
|
4
4
|
"description": "Internal SWC-based compiler that statically extracts CSS for Plumeria.",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dist/"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@plumeria/utils": "^18.3.
|
|
24
|
+
"@plumeria/utils": "^18.3.6"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@rust-gear/glob": "1.1.1",
|