Comparing version 1.0.0-stone-4 to 1.0.0-stone-5
{ | ||
"name": "alga-css", | ||
"version": "1.0.0-stone-4", | ||
"version": "1.0.0-stone-5", | ||
"description": "Alga CSS is a scope-first CSS toolkit for quickly mix or compose CSS references and share CSS properties between components", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -24,3 +24,3 @@ const postcss = require('postcss') | ||
if(rnode.type === 'atrule' && rnode.name === 'import') { | ||
const param = rnode.params.trim() | ||
const param = rnode.params.replaceAll(/\'|\"|\`/g, '').trim() | ||
const paramFilePaths = param.split(/\/|\./) | ||
@@ -27,0 +27,0 @@ const paramFileName = paramFilePaths[Number(paramFilePaths.length) - 2] |
@@ -11,2 +11,3 @@ // Configs | ||
const extraction = require('./cores/extraction.js') | ||
const packages = require('./cores/package.js') | ||
@@ -33,3 +34,3 @@ function algacss(options) { | ||
}) | ||
const newComponent = component(options?.plugins, opts) | ||
const newComponent = packages(newPlugins, opts) | ||
config.components = Object.assign({}, config.components, newComponent) | ||
@@ -109,2 +110,4 @@ for(let keyComponent of Object.keys(newComponent)) { | ||
let newPackNodes = [] | ||
const filterPackNodes = [] | ||
for(let rule of config.inits) { | ||
@@ -118,3 +121,4 @@ let param = rule.params.trim() | ||
} | ||
if(config.components[param]) { | ||
if(!filterPackNodes.includes(param) && config.components[param]) { | ||
filterPackNodes.push(param) | ||
let newNodes = [] | ||
@@ -152,3 +156,3 @@ if(rule?.nodes) { | ||
} | ||
newNodes = [ | ||
newPackNodes.push([ | ||
...newNodes, | ||
@@ -161,6 +165,6 @@ ...declaration(config.components[param][name]['body'], config.components[param]['props'], config.components[param]['provide'], { | ||
...conditionDecls.flat() | ||
] | ||
root.append(newNodes) | ||
]) | ||
} | ||
} | ||
root.append(...newPackNodes.flat()) | ||
@@ -167,0 +171,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
84047
39
978
3