Skip to content

Commit 676cf94

Browse files
committed
feat: use shared utils instead
1 parent a7cceaa commit 676cf94

File tree

12 files changed

+15
-277
lines changed

12 files changed

+15
-277
lines changed

packages/core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
"@babel/types": "^7.21.5",
3333
"parse5": "^7.1.2",
3434
"postcss": "^8.4.23",
35-
"postcss-selector-parser": "^6.0.12"
35+
"postcss-selector-parser": "^6.0.12",
36+
"tailwindcss-mangle-shared": "workspace:^"
3637
},
3738
"devDependencies": {
3839
"@parse5/tools": "^0.1.0",

packages/core/src/classGenerator.ts

Lines changed: 0 additions & 110 deletions
This file was deleted.

packages/core/src/html/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { parse, serialize } from 'parse5'
22
import { traverse } from '@parse5/tools'
33
import { IHtmlHandlerOptions } from '../types'
4-
import { splitCode } from '../split'
5-
import { makeRegex } from '../regex'
4+
import { makeRegex, splitCode } from '../shared'
5+
66
export function htmlHandler(rawSource: string, options: IHtmlHandlerOptions) {
77
const { runtimeSet, classGenerator } = options
88
const fragment = parse(rawSource)

packages/core/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export * from './css'
22
export * from './html'
33
export * from './js'
4-
export { default as ClassGenerator } from './classGenerator'
4+
export { ClassGenerator } from './shared'
55
export * from './types'

packages/core/src/js/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import type { StringLiteral, TemplateElement, CallExpression } from '@babel/type
22
import * as t from '@babel/types'
33
import { transformSync, type BabelFileResult, type NodePath } from '@babel/core'
44
import type { IJsHandlerOptions } from '../types'
5-
import { makeRegex } from '../regex'
6-
import { splitCode } from '../split'
5+
import { makeRegex, splitCode } from '../shared'
76

87
export function handleValue(str: string, node: StringLiteral | TemplateElement, options: IJsHandlerOptions) {
98
const { runtimeSet: set, classGenerator: clsGen, splitQuote = true } = options

packages/core/src/regex.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/core/src/shared.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from 'tailwindcss-mangle-shared'

packages/core/src/split.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/core/src/types.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ClassGenerator from './classGenerator'
1+
import { ClassGenerator } from './shared'
22

33
export interface IClassGeneratorContextItem {
44
name: string
@@ -15,12 +15,6 @@ export interface IClassGeneratorOptions {
1515
classPrefix?: string
1616
}
1717

18-
export interface IClassGenerator {
19-
newClassMap: Record<string, IClassGeneratorContextItem>
20-
newClassSize: number
21-
context: Record<string, any>
22-
}
23-
2418
export interface IHandlerOptions {
2519
runtimeSet: Set<string>
2620
classGenerator: ClassGenerator

packages/core/src/utils.ts

Lines changed: 0 additions & 123 deletions
This file was deleted.

0 commit comments

Comments
 (0)