@seyuna/postcss 1.0.0-canary.24 → 1.0.0-canary.25
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 +7 -0
- package/dist/errors.d.ts +1 -1
- package/dist/errors.js +9 -4
- package/dist/plugin.js +16 -8
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/src/errors.ts +8 -4
- package/src/plugin.ts +16 -8
- package/src/types.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [1.0.0-canary.25](https://github.com/seyuna-corp/seyuna-postcss/compare/v1.0.0-canary.24...v1.0.0-canary.25) (2026-01-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* resolve deadlock by correctly passing Result object for warnings ([f7766a0](https://github.com/seyuna-corp/seyuna-postcss/commit/f7766a0f3914c19368aa2a73dfca4b2217a47072))
|
|
7
|
+
|
|
1
8
|
# [1.0.0-canary.24](https://github.com/seyuna-corp/seyuna-postcss/compare/v1.0.0-canary.23...v1.0.0-canary.24) (2026-01-10)
|
|
2
9
|
|
|
3
10
|
|
package/dist/errors.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export declare function reportError(message: string, node: any, context: PluginC
|
|
|
3
3
|
word?: string;
|
|
4
4
|
index?: number;
|
|
5
5
|
}): void;
|
|
6
|
-
export declare function reportWarning(message: string, node: any): void;
|
|
6
|
+
export declare function reportWarning(message: string, node: any, context?: PluginContext): void;
|
package/dist/errors.js
CHANGED
|
@@ -5,10 +5,15 @@ export function reportError(message, node, context, options = {}) {
|
|
|
5
5
|
throw node.error(formattedMessage, options);
|
|
6
6
|
}
|
|
7
7
|
else {
|
|
8
|
-
reportWarning(formattedMessage, node);
|
|
8
|
+
reportWarning(formattedMessage, node, context);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
-
export function reportWarning(message, node) {
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
export function reportWarning(message, node, context) {
|
|
12
|
+
if (context?.result) {
|
|
13
|
+
node.warn(context.result, `[Seyuna PostCSS] ${message}`);
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
// Fallback if no result is available (should not happen in main flow)
|
|
17
|
+
console.warn(`[Seyuna PostCSS Warning] ${message}`);
|
|
18
|
+
}
|
|
14
19
|
}
|
package/dist/plugin.js
CHANGED
|
@@ -9,17 +9,25 @@ export const dynamicFunctionsPlugin = (opts = {}) => {
|
|
|
9
9
|
return {
|
|
10
10
|
postcssPlugin: "postcss-dynamic-functions",
|
|
11
11
|
async Once() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
try {
|
|
13
|
+
const { config, options } = await loadConfigAsync(opts);
|
|
14
|
+
fnMap = { ...functions, ...opts.functions };
|
|
15
|
+
context = {
|
|
16
|
+
config,
|
|
17
|
+
options,
|
|
18
|
+
functions: fnMap,
|
|
19
|
+
result: undefined
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
throw e;
|
|
24
|
+
}
|
|
19
25
|
},
|
|
20
|
-
Declaration(decl) {
|
|
26
|
+
Declaration(decl, { result }) {
|
|
21
27
|
if (!context || !fnMap)
|
|
22
28
|
return;
|
|
29
|
+
// Update context with the current result object
|
|
30
|
+
context.result = result;
|
|
23
31
|
const newValue = processFunctions(decl.value, fnMap, decl, context);
|
|
24
32
|
if (newValue !== decl.value) {
|
|
25
33
|
decl.value = newValue;
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
package/src/errors.ts
CHANGED
|
@@ -13,11 +13,15 @@ export function reportError(
|
|
|
13
13
|
if (pluginOptions.strict) {
|
|
14
14
|
throw node.error(formattedMessage, options);
|
|
15
15
|
} else {
|
|
16
|
-
reportWarning(formattedMessage, node);
|
|
16
|
+
reportWarning(formattedMessage, node, context);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export function reportWarning(message: string, node: any) {
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
export function reportWarning(message: string, node: any, context?: PluginContext) {
|
|
21
|
+
if (context?.result) {
|
|
22
|
+
node.warn(context.result, `[Seyuna PostCSS] ${message}`);
|
|
23
|
+
} else {
|
|
24
|
+
// Fallback if no result is available (should not happen in main flow)
|
|
25
|
+
console.warn(`[Seyuna PostCSS Warning] ${message}`);
|
|
26
|
+
}
|
|
23
27
|
}
|
package/src/plugin.ts
CHANGED
|
@@ -15,18 +15,26 @@ export const dynamicFunctionsPlugin: any = (
|
|
|
15
15
|
postcssPlugin: "postcss-dynamic-functions",
|
|
16
16
|
|
|
17
17
|
async Once() {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
try {
|
|
19
|
+
const { config, options } = await loadConfigAsync(opts);
|
|
20
|
+
fnMap = { ...functions, ...(opts as any).functions };
|
|
21
|
+
context = {
|
|
22
|
+
config,
|
|
23
|
+
options,
|
|
24
|
+
functions: fnMap as FunctionMap,
|
|
25
|
+
result: undefined
|
|
26
|
+
};
|
|
27
|
+
} catch (e) {
|
|
28
|
+
throw e;
|
|
29
|
+
}
|
|
25
30
|
},
|
|
26
31
|
|
|
27
|
-
Declaration(decl: any) {
|
|
32
|
+
Declaration(decl: any, { result }: any) {
|
|
28
33
|
if (!context || !fnMap) return;
|
|
29
34
|
|
|
35
|
+
// Update context with the current result object
|
|
36
|
+
context.result = result;
|
|
37
|
+
|
|
30
38
|
const newValue = processFunctions(decl.value, fnMap, decl, context);
|
|
31
39
|
|
|
32
40
|
if (newValue !== decl.value) {
|