@tailwindcss-mangle/core 2.2.2 → 2.3.0

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.d.cts CHANGED
@@ -3,9 +3,9 @@ import { MangleUserConfig } from '@tailwindcss-mangle/config';
3
3
  import { ClassGenerator } from '@tailwindcss-mangle/shared';
4
4
  export { ClassGenerator } from '@tailwindcss-mangle/shared';
5
5
  import postcss from 'postcss';
6
+ import * as MagicString from 'magic-string';
7
+ import MagicString__default from 'magic-string';
6
8
  import { StringLiteral, TemplateElement } from '@babel/types';
7
- import { BabelFileResult } from '@babel/core';
8
- import MagicString from 'magic-string';
9
9
 
10
10
  interface InitConfigOptions {
11
11
  cwd?: string;
@@ -16,7 +16,7 @@ declare class Context {
16
16
  options: MangleUserConfig;
17
17
  private includeMatcher;
18
18
  private excludeMatcher;
19
- private replaceMap;
19
+ replaceMap: Map<string, string>;
20
20
  classSet: Set<string>;
21
21
  classGenerator: ClassGenerator;
22
22
  preserveFunctionSet: Set<string>;
@@ -33,7 +33,7 @@ declare class Context {
33
33
  getReplaceMap(): Map<string, string>;
34
34
  addToUsedBy(key: string, file: string): void;
35
35
  loadClassSet(classList: string[]): void;
36
- initConfig(opts?: InitConfigOptions): Promise<_tailwindcss_mangle_config.UserConfig | null>;
36
+ initConfig(opts?: InitConfigOptions): Promise<_tailwindcss_mangle_config.UserConfig>;
37
37
  }
38
38
 
39
39
  interface IClassGeneratorContextItem {
@@ -50,40 +50,39 @@ interface IClassGeneratorOptions {
50
50
  classPrefix?: string;
51
51
  }
52
52
  interface IHandlerOptions {
53
- replaceMap: Map<string, string>;
54
53
  ctx: Context;
55
54
  }
56
55
  interface IHtmlHandlerOptions extends IHandlerOptions {
56
+ isVue?: boolean;
57
57
  }
58
58
  interface IJsHandlerOptions extends IHandlerOptions {
59
59
  splitQuote?: boolean;
60
60
  minified?: boolean;
61
61
  }
62
+ interface IVueHandlerOptions extends IHandlerOptions {
63
+ }
62
64
  interface ICssHandlerOptions extends IHandlerOptions {
63
65
  ignoreVueScoped?: boolean;
64
66
  file?: string;
65
67
  }
68
+ interface IPreProcessJsOptions extends IHandlerOptions {
69
+ code: string | MagicString__default;
70
+ id: string;
71
+ }
66
72
 
67
73
  declare function cssHandler(rawSource: string, options: ICssHandlerOptions): postcss.LazyResult<postcss.Root>;
68
74
 
69
- declare function htmlHandler(rawSource: string, options: IHtmlHandlerOptions): string;
75
+ declare function htmlHandler(raw: string | MagicString__default, options: IHtmlHandlerOptions): string;
70
76
 
71
- interface IPreProcessJsOptions {
72
- code: string | MagicString;
73
- replaceMap: Map<string, string>;
74
- id: string;
75
- ctx: Context;
76
- }
77
77
  declare function preProcessJs(options: IPreProcessJsOptions): string;
78
- interface IPreProcessRawCodeOptions {
79
- code: string | MagicString;
80
- replaceMap: Map<string, string>;
81
- id: string;
82
- ctx: Context;
83
- }
84
- declare function preProcessRawCode(options: IPreProcessRawCodeOptions): string;
78
+ declare function preProcessRawCode(options: IPreProcessJsOptions): string;
79
+
80
+ declare function handleValue(raw: string, node: StringLiteral | TemplateElement, options: IJsHandlerOptions, ms: MagicString__default, offset: number, escape: boolean): string;
81
+ declare function jsHandler(rawSource: string | MagicString__default, options: IJsHandlerOptions): {
82
+ code: string;
83
+ readonly map: MagicString.SourceMap;
84
+ };
85
85
 
86
- declare function handleValue(raw: string, node: StringLiteral | TemplateElement, options: IJsHandlerOptions): string;
87
- declare function jsHandler(rawSource: string, options: IJsHandlerOptions): BabelFileResult;
86
+ declare function vueHandler(raw: string | MagicString__default, options: IVueHandlerOptions): string;
88
87
 
89
- export { Context, type IClassGeneratorContextItem, type IClassGeneratorOptions, type ICssHandlerOptions, type IHandlerOptions, type IHtmlHandlerOptions, type IJsHandlerOptions, cssHandler, handleValue, htmlHandler, jsHandler, preProcessJs, preProcessRawCode };
88
+ export { Context, type IClassGeneratorContextItem, type IClassGeneratorOptions, type ICssHandlerOptions, type IHandlerOptions, type IHtmlHandlerOptions, type IJsHandlerOptions, type IPreProcessJsOptions, type IVueHandlerOptions, cssHandler, handleValue, htmlHandler, jsHandler, preProcessJs, preProcessRawCode, vueHandler };
package/dist/index.d.mts CHANGED
@@ -3,9 +3,9 @@ import { MangleUserConfig } from '@tailwindcss-mangle/config';
3
3
  import { ClassGenerator } from '@tailwindcss-mangle/shared';
4
4
  export { ClassGenerator } from '@tailwindcss-mangle/shared';
5
5
  import postcss from 'postcss';
6
+ import * as MagicString from 'magic-string';
7
+ import MagicString__default from 'magic-string';
6
8
  import { StringLiteral, TemplateElement } from '@babel/types';
7
- import { BabelFileResult } from '@babel/core';
8
- import MagicString from 'magic-string';
9
9
 
10
10
  interface InitConfigOptions {
11
11
  cwd?: string;
@@ -16,7 +16,7 @@ declare class Context {
16
16
  options: MangleUserConfig;
17
17
  private includeMatcher;
18
18
  private excludeMatcher;
19
- private replaceMap;
19
+ replaceMap: Map<string, string>;
20
20
  classSet: Set<string>;
21
21
  classGenerator: ClassGenerator;
22
22
  preserveFunctionSet: Set<string>;
@@ -33,7 +33,7 @@ declare class Context {
33
33
  getReplaceMap(): Map<string, string>;
34
34
  addToUsedBy(key: string, file: string): void;
35
35
  loadClassSet(classList: string[]): void;
36
- initConfig(opts?: InitConfigOptions): Promise<_tailwindcss_mangle_config.UserConfig | null>;
36
+ initConfig(opts?: InitConfigOptions): Promise<_tailwindcss_mangle_config.UserConfig>;
37
37
  }
38
38
 
39
39
  interface IClassGeneratorContextItem {
@@ -50,40 +50,39 @@ interface IClassGeneratorOptions {
50
50
  classPrefix?: string;
51
51
  }
52
52
  interface IHandlerOptions {
53
- replaceMap: Map<string, string>;
54
53
  ctx: Context;
55
54
  }
56
55
  interface IHtmlHandlerOptions extends IHandlerOptions {
56
+ isVue?: boolean;
57
57
  }
58
58
  interface IJsHandlerOptions extends IHandlerOptions {
59
59
  splitQuote?: boolean;
60
60
  minified?: boolean;
61
61
  }
62
+ interface IVueHandlerOptions extends IHandlerOptions {
63
+ }
62
64
  interface ICssHandlerOptions extends IHandlerOptions {
63
65
  ignoreVueScoped?: boolean;
64
66
  file?: string;
65
67
  }
68
+ interface IPreProcessJsOptions extends IHandlerOptions {
69
+ code: string | MagicString__default;
70
+ id: string;
71
+ }
66
72
 
67
73
  declare function cssHandler(rawSource: string, options: ICssHandlerOptions): postcss.LazyResult<postcss.Root>;
68
74
 
69
- declare function htmlHandler(rawSource: string, options: IHtmlHandlerOptions): string;
75
+ declare function htmlHandler(raw: string | MagicString__default, options: IHtmlHandlerOptions): string;
70
76
 
71
- interface IPreProcessJsOptions {
72
- code: string | MagicString;
73
- replaceMap: Map<string, string>;
74
- id: string;
75
- ctx: Context;
76
- }
77
77
  declare function preProcessJs(options: IPreProcessJsOptions): string;
78
- interface IPreProcessRawCodeOptions {
79
- code: string | MagicString;
80
- replaceMap: Map<string, string>;
81
- id: string;
82
- ctx: Context;
83
- }
84
- declare function preProcessRawCode(options: IPreProcessRawCodeOptions): string;
78
+ declare function preProcessRawCode(options: IPreProcessJsOptions): string;
79
+
80
+ declare function handleValue(raw: string, node: StringLiteral | TemplateElement, options: IJsHandlerOptions, ms: MagicString__default, offset: number, escape: boolean): string;
81
+ declare function jsHandler(rawSource: string | MagicString__default, options: IJsHandlerOptions): {
82
+ code: string;
83
+ readonly map: MagicString.SourceMap;
84
+ };
85
85
 
86
- declare function handleValue(raw: string, node: StringLiteral | TemplateElement, options: IJsHandlerOptions): string;
87
- declare function jsHandler(rawSource: string, options: IJsHandlerOptions): BabelFileResult;
86
+ declare function vueHandler(raw: string | MagicString__default, options: IVueHandlerOptions): string;
88
87
 
89
- export { Context, type IClassGeneratorContextItem, type IClassGeneratorOptions, type ICssHandlerOptions, type IHandlerOptions, type IHtmlHandlerOptions, type IJsHandlerOptions, cssHandler, handleValue, htmlHandler, jsHandler, preProcessJs, preProcessRawCode };
88
+ export { Context, type IClassGeneratorContextItem, type IClassGeneratorOptions, type ICssHandlerOptions, type IHandlerOptions, type IHtmlHandlerOptions, type IJsHandlerOptions, type IPreProcessJsOptions, type IVueHandlerOptions, cssHandler, handleValue, htmlHandler, jsHandler, preProcessJs, preProcessRawCode, vueHandler };
package/dist/index.d.ts CHANGED
@@ -3,9 +3,9 @@ import { MangleUserConfig } from '@tailwindcss-mangle/config';
3
3
  import { ClassGenerator } from '@tailwindcss-mangle/shared';
4
4
  export { ClassGenerator } from '@tailwindcss-mangle/shared';
5
5
  import postcss from 'postcss';
6
+ import * as MagicString from 'magic-string';
7
+ import MagicString__default from 'magic-string';
6
8
  import { StringLiteral, TemplateElement } from '@babel/types';
7
- import { BabelFileResult } from '@babel/core';
8
- import MagicString from 'magic-string';
9
9
 
10
10
  interface InitConfigOptions {
11
11
  cwd?: string;
@@ -16,7 +16,7 @@ declare class Context {
16
16
  options: MangleUserConfig;
17
17
  private includeMatcher;
18
18
  private excludeMatcher;
19
- private replaceMap;
19
+ replaceMap: Map<string, string>;
20
20
  classSet: Set<string>;
21
21
  classGenerator: ClassGenerator;
22
22
  preserveFunctionSet: Set<string>;
@@ -33,7 +33,7 @@ declare class Context {
33
33
  getReplaceMap(): Map<string, string>;
34
34
  addToUsedBy(key: string, file: string): void;
35
35
  loadClassSet(classList: string[]): void;
36
- initConfig(opts?: InitConfigOptions): Promise<_tailwindcss_mangle_config.UserConfig | null>;
36
+ initConfig(opts?: InitConfigOptions): Promise<_tailwindcss_mangle_config.UserConfig>;
37
37
  }
38
38
 
39
39
  interface IClassGeneratorContextItem {
@@ -50,40 +50,39 @@ interface IClassGeneratorOptions {
50
50
  classPrefix?: string;
51
51
  }
52
52
  interface IHandlerOptions {
53
- replaceMap: Map<string, string>;
54
53
  ctx: Context;
55
54
  }
56
55
  interface IHtmlHandlerOptions extends IHandlerOptions {
56
+ isVue?: boolean;
57
57
  }
58
58
  interface IJsHandlerOptions extends IHandlerOptions {
59
59
  splitQuote?: boolean;
60
60
  minified?: boolean;
61
61
  }
62
+ interface IVueHandlerOptions extends IHandlerOptions {
63
+ }
62
64
  interface ICssHandlerOptions extends IHandlerOptions {
63
65
  ignoreVueScoped?: boolean;
64
66
  file?: string;
65
67
  }
68
+ interface IPreProcessJsOptions extends IHandlerOptions {
69
+ code: string | MagicString__default;
70
+ id: string;
71
+ }
66
72
 
67
73
  declare function cssHandler(rawSource: string, options: ICssHandlerOptions): postcss.LazyResult<postcss.Root>;
68
74
 
69
- declare function htmlHandler(rawSource: string, options: IHtmlHandlerOptions): string;
75
+ declare function htmlHandler(raw: string | MagicString__default, options: IHtmlHandlerOptions): string;
70
76
 
71
- interface IPreProcessJsOptions {
72
- code: string | MagicString;
73
- replaceMap: Map<string, string>;
74
- id: string;
75
- ctx: Context;
76
- }
77
77
  declare function preProcessJs(options: IPreProcessJsOptions): string;
78
- interface IPreProcessRawCodeOptions {
79
- code: string | MagicString;
80
- replaceMap: Map<string, string>;
81
- id: string;
82
- ctx: Context;
83
- }
84
- declare function preProcessRawCode(options: IPreProcessRawCodeOptions): string;
78
+ declare function preProcessRawCode(options: IPreProcessJsOptions): string;
79
+
80
+ declare function handleValue(raw: string, node: StringLiteral | TemplateElement, options: IJsHandlerOptions, ms: MagicString__default, offset: number, escape: boolean): string;
81
+ declare function jsHandler(rawSource: string | MagicString__default, options: IJsHandlerOptions): {
82
+ code: string;
83
+ readonly map: MagicString.SourceMap;
84
+ };
85
85
 
86
- declare function handleValue(raw: string, node: StringLiteral | TemplateElement, options: IJsHandlerOptions): string;
87
- declare function jsHandler(rawSource: string, options: IJsHandlerOptions): BabelFileResult;
86
+ declare function vueHandler(raw: string | MagicString__default, options: IVueHandlerOptions): string;
88
87
 
89
- export { Context, type IClassGeneratorContextItem, type IClassGeneratorOptions, type ICssHandlerOptions, type IHandlerOptions, type IHtmlHandlerOptions, type IJsHandlerOptions, cssHandler, handleValue, htmlHandler, jsHandler, preProcessJs, preProcessRawCode };
88
+ export { Context, type IClassGeneratorContextItem, type IClassGeneratorOptions, type ICssHandlerOptions, type IHandlerOptions, type IHtmlHandlerOptions, type IJsHandlerOptions, type IPreProcessJsOptions, type IVueHandlerOptions, cssHandler, handleValue, htmlHandler, jsHandler, preProcessJs, preProcessRawCode, vueHandler };