@pikacss/integration 0.0.29 → 0.0.31
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.cjs +421 -400
- package/dist/index.d.cts +67 -64
- package/dist/index.d.mts +67 -64
- package/dist/index.mjs +391 -387
- package/package.json +4 -5
- package/dist/index.d.ts +0 -78
package/dist/index.d.cts
CHANGED
|
@@ -1,78 +1,81 @@
|
|
|
1
|
-
import { EngineConfig, Nullish
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Engine, EngineConfig, Nullish } from "@pikacss/core";
|
|
2
|
+
import { SourceMap } from "magic-string";
|
|
3
|
+
export * from "@pikacss/core";
|
|
4
4
|
|
|
5
|
+
//#region src/eventHook.d.ts
|
|
5
6
|
type EventHookListener<EventPayload> = (payload: EventPayload) => void | Promise<void>;
|
|
6
7
|
interface EventHook<EventPayload> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
listeners: Set<EventHookListener<EventPayload>>;
|
|
9
|
+
trigger: (payload: EventPayload) => void;
|
|
10
|
+
on: (listener: EventHookListener<EventPayload>) => () => void;
|
|
11
|
+
off: (listener: EventHookListener<EventPayload>) => void;
|
|
11
12
|
}
|
|
12
13
|
declare function createEventHook<EventPayload>(): EventHook<EventPayload>;
|
|
13
|
-
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/types.d.ts
|
|
14
16
|
interface UsageRecord {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
atomicStyleIds: string[];
|
|
18
|
+
params: Parameters<Engine['use']>;
|
|
17
19
|
}
|
|
18
20
|
interface FnUtils {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
isNormal: (fnName: string) => boolean;
|
|
22
|
+
isForceString: (fnName: string) => boolean;
|
|
23
|
+
isForceArray: (fnName: string) => boolean;
|
|
24
|
+
isForceInline: (fnName: string) => boolean;
|
|
25
|
+
isPreview: (fnName: string) => boolean;
|
|
26
|
+
RE: RegExp;
|
|
25
27
|
}
|
|
26
28
|
interface IntegrationContext {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
29
|
+
cwd: string;
|
|
30
|
+
currentPackageName: string;
|
|
31
|
+
fnName: string;
|
|
32
|
+
fnUtils: FnUtils;
|
|
33
|
+
transformedFormat: 'string' | 'array' | 'inline';
|
|
34
|
+
devCssFilepath: string;
|
|
35
|
+
tsCodegenFilepath: string | Nullish;
|
|
36
|
+
hasVue: boolean;
|
|
37
|
+
usages: Map<string, UsageRecord[]>;
|
|
38
|
+
hooks: {
|
|
39
|
+
styleUpdated: ReturnType<typeof createEventHook<void>>;
|
|
40
|
+
tsCodegenUpdated: ReturnType<typeof createEventHook<void>>;
|
|
41
|
+
};
|
|
42
|
+
loadConfig: () => Promise<{
|
|
43
|
+
config: EngineConfig;
|
|
44
|
+
file: null;
|
|
45
|
+
} | {
|
|
46
|
+
config: null;
|
|
47
|
+
file: null;
|
|
48
|
+
} | {
|
|
49
|
+
config: EngineConfig;
|
|
50
|
+
file: string;
|
|
51
|
+
}>;
|
|
52
|
+
init: () => Promise<any>;
|
|
53
|
+
isReady: boolean;
|
|
54
|
+
configSources: string[];
|
|
55
|
+
resolvedConfigPath: string | Nullish;
|
|
56
|
+
engine: Engine;
|
|
57
|
+
transform: (code: string, id: string) => Promise<{
|
|
58
|
+
code: string;
|
|
59
|
+
map: SourceMap;
|
|
60
|
+
} | Nullish>;
|
|
61
|
+
getCssContent: (isDev: boolean) => Promise<string | Nullish>;
|
|
62
|
+
getTsCodegenContent: () => Promise<string | Nullish>;
|
|
63
|
+
writeDevCssFile: () => Promise<void>;
|
|
64
|
+
writeTsCodegenFile: () => Promise<void>;
|
|
63
65
|
}
|
|
64
66
|
interface IntegrationContextOptions {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
cwd: string;
|
|
68
|
+
currentPackageName: string;
|
|
69
|
+
target: string[];
|
|
70
|
+
configOrPath: EngineConfig | string | Nullish;
|
|
71
|
+
fnName: string;
|
|
72
|
+
transformedFormat: 'string' | 'array' | 'inline';
|
|
73
|
+
tsCodegen: false | string;
|
|
74
|
+
devCss: string;
|
|
75
|
+
autoCreateConfig: boolean;
|
|
74
76
|
}
|
|
75
|
-
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/ctx.d.ts
|
|
76
79
|
declare function createCtx(options: IntegrationContextOptions): Promise<IntegrationContext>;
|
|
77
|
-
|
|
78
|
-
export {
|
|
80
|
+
//#endregion
|
|
81
|
+
export { FnUtils, IntegrationContext, IntegrationContextOptions, UsageRecord, createCtx };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,78 +1,81 @@
|
|
|
1
|
-
import { EngineConfig, Nullish
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Engine, EngineConfig, Nullish } from "@pikacss/core";
|
|
2
|
+
import { SourceMap } from "magic-string";
|
|
3
|
+
export * from "@pikacss/core";
|
|
4
4
|
|
|
5
|
+
//#region src/eventHook.d.ts
|
|
5
6
|
type EventHookListener<EventPayload> = (payload: EventPayload) => void | Promise<void>;
|
|
6
7
|
interface EventHook<EventPayload> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
listeners: Set<EventHookListener<EventPayload>>;
|
|
9
|
+
trigger: (payload: EventPayload) => void;
|
|
10
|
+
on: (listener: EventHookListener<EventPayload>) => () => void;
|
|
11
|
+
off: (listener: EventHookListener<EventPayload>) => void;
|
|
11
12
|
}
|
|
12
13
|
declare function createEventHook<EventPayload>(): EventHook<EventPayload>;
|
|
13
|
-
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/types.d.ts
|
|
14
16
|
interface UsageRecord {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
atomicStyleIds: string[];
|
|
18
|
+
params: Parameters<Engine['use']>;
|
|
17
19
|
}
|
|
18
20
|
interface FnUtils {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
isNormal: (fnName: string) => boolean;
|
|
22
|
+
isForceString: (fnName: string) => boolean;
|
|
23
|
+
isForceArray: (fnName: string) => boolean;
|
|
24
|
+
isForceInline: (fnName: string) => boolean;
|
|
25
|
+
isPreview: (fnName: string) => boolean;
|
|
26
|
+
RE: RegExp;
|
|
25
27
|
}
|
|
26
28
|
interface IntegrationContext {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
29
|
+
cwd: string;
|
|
30
|
+
currentPackageName: string;
|
|
31
|
+
fnName: string;
|
|
32
|
+
fnUtils: FnUtils;
|
|
33
|
+
transformedFormat: 'string' | 'array' | 'inline';
|
|
34
|
+
devCssFilepath: string;
|
|
35
|
+
tsCodegenFilepath: string | Nullish;
|
|
36
|
+
hasVue: boolean;
|
|
37
|
+
usages: Map<string, UsageRecord[]>;
|
|
38
|
+
hooks: {
|
|
39
|
+
styleUpdated: ReturnType<typeof createEventHook<void>>;
|
|
40
|
+
tsCodegenUpdated: ReturnType<typeof createEventHook<void>>;
|
|
41
|
+
};
|
|
42
|
+
loadConfig: () => Promise<{
|
|
43
|
+
config: EngineConfig;
|
|
44
|
+
file: null;
|
|
45
|
+
} | {
|
|
46
|
+
config: null;
|
|
47
|
+
file: null;
|
|
48
|
+
} | {
|
|
49
|
+
config: EngineConfig;
|
|
50
|
+
file: string;
|
|
51
|
+
}>;
|
|
52
|
+
init: () => Promise<any>;
|
|
53
|
+
isReady: boolean;
|
|
54
|
+
configSources: string[];
|
|
55
|
+
resolvedConfigPath: string | Nullish;
|
|
56
|
+
engine: Engine;
|
|
57
|
+
transform: (code: string, id: string) => Promise<{
|
|
58
|
+
code: string;
|
|
59
|
+
map: SourceMap;
|
|
60
|
+
} | Nullish>;
|
|
61
|
+
getCssContent: (isDev: boolean) => Promise<string | Nullish>;
|
|
62
|
+
getTsCodegenContent: () => Promise<string | Nullish>;
|
|
63
|
+
writeDevCssFile: () => Promise<void>;
|
|
64
|
+
writeTsCodegenFile: () => Promise<void>;
|
|
63
65
|
}
|
|
64
66
|
interface IntegrationContextOptions {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
67
|
+
cwd: string;
|
|
68
|
+
currentPackageName: string;
|
|
69
|
+
target: string[];
|
|
70
|
+
configOrPath: EngineConfig | string | Nullish;
|
|
71
|
+
fnName: string;
|
|
72
|
+
transformedFormat: 'string' | 'array' | 'inline';
|
|
73
|
+
tsCodegen: false | string;
|
|
74
|
+
devCss: string;
|
|
75
|
+
autoCreateConfig: boolean;
|
|
74
76
|
}
|
|
75
|
-
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/ctx.d.ts
|
|
76
79
|
declare function createCtx(options: IntegrationContextOptions): Promise<IntegrationContext>;
|
|
77
|
-
|
|
78
|
-
export {
|
|
80
|
+
//#endregion
|
|
81
|
+
export { FnUtils, IntegrationContext, IntegrationContextOptions, UsageRecord, createCtx };
|