@seyuna/postcss 1.0.0-canary.17 → 1.0.0-canary.19
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 +14 -0
- package/dist/at-rules/color-scheme.d.ts +1 -1
- package/dist/at-rules/color.d.ts +1 -1
- package/dist/at-rules/container.d.ts +1 -1
- package/dist/at-rules/index.d.ts +1 -1
- package/dist/config.d.ts +2 -14
- package/dist/errors.d.ts +1 -1
- package/dist/functions/color.d.ts +1 -1
- package/dist/functions/index.d.ts +1 -1
- package/dist/functions/theme.d.ts +1 -1
- package/dist/helpers.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/parser.d.ts +2 -2
- package/dist/plugin.d.ts +2 -2
- package/dist/types.d.ts +59 -1
- package/dist/types.js +2 -0
- package/package.json +1 -1
- package/src/at-rules/color-scheme.ts +1 -1
- package/src/at-rules/color.ts +1 -1
- package/src/at-rules/container.ts +1 -1
- package/src/at-rules/index.ts +1 -1
- package/src/config.ts +3 -15
- package/src/errors.ts +1 -1
- package/src/functions/color.ts +1 -1
- package/src/functions/index.ts +1 -1
- package/src/functions/theme.ts +1 -1
- package/src/helpers.ts +1 -1
- package/src/parser.ts +3 -2
- package/src/plugin.ts +4 -3
- package/src/types.ts +72 -1
- package/test-import.mjs +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [1.0.0-canary.19](https://github.com/seyuna-corp/seyuna-postcss/compare/v1.0.0-canary.18...v1.0.0-canary.19) (2026-01-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* define types locally to avoid @seyuna/cli polyfill side-effects ([acdbcc9](https://github.com/seyuna-corp/seyuna-postcss/commit/acdbcc977fd2a501302d675ff7ffd2c307e25a95))
|
|
7
|
+
|
|
8
|
+
# [1.0.0-canary.18](https://github.com/seyuna-corp/seyuna-postcss/compare/v1.0.0-canary.17...v1.0.0-canary.18) (2026-01-10)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* break circular dependency between config.ts and parser.ts ([88ae984](https://github.com/seyuna-corp/seyuna-postcss/commit/88ae9848ed2eb4d4ca5fb6340cbe5aa1c986f1b8))
|
|
14
|
+
|
|
1
15
|
# [1.0.0-canary.17](https://github.com/seyuna-corp/seyuna-postcss/compare/v1.0.0-canary.16...v1.0.0-canary.17) (2026-01-10)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AtRule } from "postcss";
|
|
2
|
-
import { PluginContext } from "../
|
|
2
|
+
import { PluginContext } from "../types.js";
|
|
3
3
|
export declare const light: (atRule: AtRule, context: PluginContext) => void;
|
|
4
4
|
export declare const dark: (atRule: AtRule, context: PluginContext) => void;
|
package/dist/at-rules/color.d.ts
CHANGED
package/dist/at-rules/index.d.ts
CHANGED
package/dist/config.d.ts
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import { SeyunaConfig } from './types.js';
|
|
2
|
-
|
|
3
|
-
export interface PluginOptions {
|
|
4
|
-
configPath?: string;
|
|
5
|
-
modeAttribute?: string;
|
|
6
|
-
strict?: boolean;
|
|
7
|
-
config?: SeyunaConfig;
|
|
8
|
-
functions?: FunctionMap;
|
|
9
|
-
}
|
|
10
|
-
export interface PluginContext {
|
|
11
|
-
config: SeyunaConfig;
|
|
12
|
-
options: Required<PluginOptions>;
|
|
13
|
-
functions: FunctionMap;
|
|
14
|
-
}
|
|
1
|
+
import { SeyunaConfig, PluginOptions } from './types.js';
|
|
2
|
+
export type { PluginOptions, PluginContext, FunctionMap } from './types.js';
|
|
15
3
|
export declare function loadConfig(options?: PluginOptions): {
|
|
16
4
|
config: SeyunaConfig;
|
|
17
5
|
options: Required<PluginOptions>;
|
package/dist/errors.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginContext } from "../
|
|
1
|
+
import { PluginContext } from "../types.js";
|
|
2
2
|
export declare function sc(context: PluginContext, name: string, alpha?: string, lightness?: string, chroma?: string): string;
|
|
3
3
|
export declare function fc(context: PluginContext, name: string, alpha?: string, lightness?: string, chroma?: string): string;
|
|
4
4
|
export declare function alpha(context: PluginContext, color: string, value: string): string;
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Rule, ChildNode, AtRule } from "postcss";
|
|
2
|
-
import { PluginContext } from
|
|
2
|
+
import { PluginContext } from './types.js';
|
|
3
3
|
/**
|
|
4
4
|
* Helper: clone nodes and replace {name} placeholders safely
|
|
5
5
|
* Returns only valid Rules or Declarations (never raw AtRules)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const plugin: import("postcss").PluginCreator<import("./
|
|
1
|
+
declare const plugin: import("postcss").PluginCreator<import("./types.js").PluginOptions> & {
|
|
2
2
|
postcss: boolean;
|
|
3
3
|
functions: Record<string, import("./functions/index.js").FnHandler>;
|
|
4
4
|
};
|
package/dist/parser.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Node } from 'postcss';
|
|
2
|
-
import { PluginContext } from './
|
|
3
|
-
export type FunctionMap
|
|
2
|
+
import { PluginContext, FunctionMap } from './types.js';
|
|
3
|
+
export type { FunctionMap } from './types.js';
|
|
4
4
|
export declare function processFunctions(value: string, fnMap: FunctionMap, node: Node, context: PluginContext): string;
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PluginCreator } from "postcss";
|
|
2
|
-
import { PluginOptions
|
|
3
|
-
export declare const dynamicFunctionsPlugin: PluginCreator<
|
|
2
|
+
import { PluginOptions } from "./types.js";
|
|
3
|
+
export declare const dynamicFunctionsPlugin: PluginCreator<PluginOptions>;
|
package/dist/types.d.ts
CHANGED
|
@@ -1 +1,59 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Represents a color in the Oklch color space.
|
|
3
|
+
*/
|
|
4
|
+
export interface Color {
|
|
5
|
+
lightness: number;
|
|
6
|
+
chroma: number;
|
|
7
|
+
hue: number;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A set of colors for a specific theme mode.
|
|
11
|
+
*/
|
|
12
|
+
export interface Palette {
|
|
13
|
+
chroma: number;
|
|
14
|
+
lightness: number;
|
|
15
|
+
background: Color;
|
|
16
|
+
text: Color;
|
|
17
|
+
colors: Record<string, Color>;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The complete theme specification.
|
|
21
|
+
*/
|
|
22
|
+
export interface Theme {
|
|
23
|
+
hues: Record<string, number>;
|
|
24
|
+
colors: Record<string, Color>;
|
|
25
|
+
light: Palette;
|
|
26
|
+
dark: Palette;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Supported color appearance modes.
|
|
30
|
+
*/
|
|
31
|
+
export type Mode = "system" | "light" | "dark";
|
|
32
|
+
/**
|
|
33
|
+
* UI Engine Configuration.
|
|
34
|
+
*/
|
|
35
|
+
export interface UI {
|
|
36
|
+
theme: Theme;
|
|
37
|
+
mode: Mode;
|
|
38
|
+
output_dir?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Root configuration structure for a Seyuna project.
|
|
42
|
+
*/
|
|
43
|
+
export interface SeyunaConfig {
|
|
44
|
+
license?: string;
|
|
45
|
+
ui?: UI;
|
|
46
|
+
}
|
|
47
|
+
export type FunctionMap = Record<string, (context: PluginContext, ...args: string[]) => string>;
|
|
48
|
+
export interface PluginOptions {
|
|
49
|
+
configPath?: string;
|
|
50
|
+
modeAttribute?: string;
|
|
51
|
+
strict?: boolean;
|
|
52
|
+
config?: SeyunaConfig;
|
|
53
|
+
functions?: FunctionMap;
|
|
54
|
+
}
|
|
55
|
+
export interface PluginContext {
|
|
56
|
+
config: SeyunaConfig;
|
|
57
|
+
options: Required<PluginOptions>;
|
|
58
|
+
functions: FunctionMap;
|
|
59
|
+
}
|
package/dist/types.js
CHANGED
package/package.json
CHANGED
package/src/at-rules/color.ts
CHANGED
package/src/at-rules/index.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { AtRule } from "postcss";
|
|
|
2
2
|
import { eachStandardColor, eachFixedColor } from "./color.js";
|
|
3
3
|
import container from "./container.js";
|
|
4
4
|
import { light, dark } from "./color-scheme.js";
|
|
5
|
-
import { PluginContext } from "../
|
|
5
|
+
import { PluginContext } from "../types.js";
|
|
6
6
|
|
|
7
7
|
// Each handler has a name (matches the at-rule) and the function
|
|
8
8
|
export interface AtRuleHandler {
|
package/src/config.ts
CHANGED
|
@@ -1,21 +1,9 @@
|
|
|
1
1
|
import fs from 'fs';
|
|
2
2
|
import path from 'path';
|
|
3
|
-
import { SeyunaConfig } from './types.js';
|
|
4
|
-
import { FunctionMap } from './parser.js';
|
|
3
|
+
import { SeyunaConfig, PluginOptions, PluginContext, FunctionMap } from './types.js';
|
|
5
4
|
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
modeAttribute?: string;
|
|
9
|
-
strict?: boolean;
|
|
10
|
-
config?: SeyunaConfig;
|
|
11
|
-
functions?: FunctionMap;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface PluginContext {
|
|
15
|
-
config: SeyunaConfig;
|
|
16
|
-
options: Required<PluginOptions>;
|
|
17
|
-
functions: FunctionMap;
|
|
18
|
-
}
|
|
5
|
+
// Re-export types for backwards compatibility
|
|
6
|
+
export type { PluginOptions, PluginContext, FunctionMap } from './types.js';
|
|
19
7
|
|
|
20
8
|
const DEFAULT_OPTIONS: Required<PluginOptions> = {
|
|
21
9
|
configPath: 'seyuna.json',
|
package/src/errors.ts
CHANGED
package/src/functions/color.ts
CHANGED
package/src/functions/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { sc, fc, alpha, lighten, darken, contrast } from "./color.js";
|
|
2
2
|
import { theme } from "./theme.js";
|
|
3
|
-
import { PluginContext } from "../
|
|
3
|
+
import { PluginContext } from "../types.js";
|
|
4
4
|
|
|
5
5
|
export type FnHandler = (context: PluginContext, ...args: string[]) => string;
|
|
6
6
|
|
package/src/functions/theme.ts
CHANGED
package/src/helpers.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Rule, ChildNode, Declaration, AtRule } from "postcss";
|
|
2
2
|
import { processFunctions } from "./parser.js";
|
|
3
|
-
import { PluginContext } from
|
|
3
|
+
import { PluginContext } from './types.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Helper: clone nodes and replace {name} placeholders safely
|
package/src/parser.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import valueParser from 'postcss-value-parser';
|
|
2
2
|
import { Node } from 'postcss';
|
|
3
|
-
import { PluginContext } from './
|
|
3
|
+
import { PluginContext, FunctionMap } from './types.js';
|
|
4
4
|
import { reportError } from './errors.js';
|
|
5
5
|
|
|
6
|
-
export
|
|
6
|
+
// Re-export FunctionMap for backwards compatibility
|
|
7
|
+
export type { FunctionMap } from './types.js';
|
|
7
8
|
|
|
8
9
|
export function processFunctions(
|
|
9
10
|
value: string,
|
package/src/plugin.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { PluginCreator } from "postcss";
|
|
2
2
|
import { functions } from "./functions/index.js";
|
|
3
3
|
import { atRuleHandlers } from "./at-rules/index.js";
|
|
4
|
-
import { loadConfig
|
|
5
|
-
import {
|
|
4
|
+
import { loadConfig } from "./config.js";
|
|
5
|
+
import { PluginOptions, PluginContext, FunctionMap } from "./types.js";
|
|
6
|
+
import { processFunctions } from "./parser.js";
|
|
6
7
|
|
|
7
|
-
export const dynamicFunctionsPlugin: PluginCreator<
|
|
8
|
+
export const dynamicFunctionsPlugin: PluginCreator<PluginOptions> = (
|
|
8
9
|
opts = {}
|
|
9
10
|
) => {
|
|
10
11
|
const { config, options } = loadConfig(opts);
|
package/src/types.ts
CHANGED
|
@@ -1 +1,72 @@
|
|
|
1
|
-
|
|
1
|
+
// Local type definitions to avoid @seyuna/cli runtime import
|
|
2
|
+
// The @seyuna/cli package imports Deno polyfills that conflict with Vite/Astro
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Represents a color in the Oklch color space.
|
|
6
|
+
*/
|
|
7
|
+
export interface Color {
|
|
8
|
+
lightness: number;
|
|
9
|
+
chroma: number;
|
|
10
|
+
hue: number;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A set of colors for a specific theme mode.
|
|
15
|
+
*/
|
|
16
|
+
export interface Palette {
|
|
17
|
+
chroma: number;
|
|
18
|
+
lightness: number;
|
|
19
|
+
background: Color;
|
|
20
|
+
text: Color;
|
|
21
|
+
colors: Record<string, Color>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The complete theme specification.
|
|
26
|
+
*/
|
|
27
|
+
export interface Theme {
|
|
28
|
+
hues: Record<string, number>;
|
|
29
|
+
colors: Record<string, Color>;
|
|
30
|
+
light: Palette;
|
|
31
|
+
dark: Palette;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Supported color appearance modes.
|
|
36
|
+
*/
|
|
37
|
+
export type Mode = "system" | "light" | "dark";
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* UI Engine Configuration.
|
|
41
|
+
*/
|
|
42
|
+
export interface UI {
|
|
43
|
+
theme: Theme;
|
|
44
|
+
mode: Mode;
|
|
45
|
+
output_dir?: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Root configuration structure for a Seyuna project.
|
|
50
|
+
*/
|
|
51
|
+
export interface SeyunaConfig {
|
|
52
|
+
license?: string;
|
|
53
|
+
ui?: UI;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Shared types to avoid circular dependencies between config.ts and parser.ts
|
|
57
|
+
|
|
58
|
+
export type FunctionMap = Record<string, (context: PluginContext, ...args: string[]) => string>;
|
|
59
|
+
|
|
60
|
+
export interface PluginOptions {
|
|
61
|
+
configPath?: string;
|
|
62
|
+
modeAttribute?: string;
|
|
63
|
+
strict?: boolean;
|
|
64
|
+
config?: SeyunaConfig;
|
|
65
|
+
functions?: FunctionMap;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface PluginContext {
|
|
69
|
+
config: SeyunaConfig;
|
|
70
|
+
options: Required<PluginOptions>;
|
|
71
|
+
functions: FunctionMap;
|
|
72
|
+
}
|
package/test-import.mjs
DELETED