Skip to content

Commit

Permalink
chore(deps): upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
sonofmagic committed Sep 21, 2023
1 parent c871ede commit 221f566
Show file tree
Hide file tree
Showing 14 changed files with 325 additions and 324 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"@changesets/cli": "^2.26.2",
"@tailwindcss-mangle/core": "workspace:*",
"@tailwindcss-mangle/shared": "workspace:*",
"@tsconfig/recommended": "^1.0.2",
"@tsconfig/recommended": "^1.0.3",
"@types/lodash-es": "^4.17.9",
"@types/node": "^20.6.1",
"@vitest/coverage-v8": "^0.34.4",
"@types/node": "^20.6.3",
"@vitest/coverage-v8": "^0.34.5",
"bumpp": "^9.2.0",
"cross-env": "^7.0.3",
"dedent": "^1.5.1",
Expand All @@ -38,15 +38,15 @@
"lodash-es": "^4.17.21",
"only-allow": "^1.1.1",
"prettier": "^3.0.3",
"rollup": "^3.29.1",
"rollup": "^3.29.2",
"tailwindcss-patch": "workspace:*",
"ts-node": "^10.9.1",
"tslib": "^2.6.2",
"tsup": "^7.2.0",
"typescript": "^5.2.2",
"unbuild": "^2.0.0",
"unplugin-tailwindcss-mangle": "workspace:*",
"vitest": "^0.34.4"
"vitest": "^0.34.5"
},
"engines": {
"node": ">=16.6.0"
Expand Down
6 changes: 3 additions & 3 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"dependencies": {
"@ast-core/escape": "^1.0.1",
"@babel/core": "^7.22.19",
"@babel/core": "^7.22.20",
"@babel/helper-plugin-utils": "^7.22.5",
"@babel/preset-typescript": "^7.22.15",
"@babel/types": "^7.22.19",
Expand All @@ -54,12 +54,12 @@
"magic-string": "^0.30.3",
"micromatch": "^4.0.5",
"parse5": "^7.1.2",
"postcss": "^8.4.29",
"postcss": "^8.4.30",
"postcss-selector-parser": "^6.0.13"
},
"devDependencies": {
"@parse5/tools": "^0.3.0",
"@types/babel__core": "^7.20.1",
"@types/babel__core": "^7.20.2",
"@types/micromatch": "^4.0.2",
"@vue/compiler-core": "^3.3.4",
"@vue/compiler-sfc": "^3.3.4"
Expand Down
3 changes: 2 additions & 1 deletion packages/tailwindcss-patch/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import cac from 'cac'
import { createPatch, getPatchOptions, TailwindcssPatcher, getConfig, initConfig, configName } from './core'
import { getConfig, initConfig, configName } from './config'
import { createPatch, getPatchOptions, TailwindcssPatcher } from './core'

function init() {
const cwd = process.cwd()
Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions packages/tailwindcss-patch/src/core/exposeContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import fs from 'node:fs'
import type { TailwindcssClassCache, TailwindcssRuntimeContext } from '@/types'
import { requireResolve } from '@/utils'

export function getTailwindcssEntry(basedir: string = process.cwd()) {
return requireResolve('tailwindcss')
export function getTailwindcssEntry(basedir?: string) {
return requireResolve('tailwindcss', {
basedir
})
}

export function getContexts(basedir?: string): TailwindcssRuntimeContext[] {
Expand Down
1 change: 0 additions & 1 deletion packages/tailwindcss-patch/src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export * from './exposeContext'
export * from './inspector'
export * from './runtime-patcher'
export * from './cache'
export * from './config'
4 changes: 2 additions & 2 deletions packages/tailwindcss-patch/src/core/tw-patcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { dirname } from 'node:path'
import { getClassCacheSet, getContexts, getTailwindcssEntry } from './exposeContext'
import { CacheManager, getCacheOptions } from './cache'
import { createPatch, getPatchOptions } from './runtime-patcher'
import { UserConfig } from './config'
import { processTailwindcss } from './postcss'
import { UserConfig } from '@/config'
import { ensureDir } from '@/utils'
import type { InternalCacheOptions, InternalPatchOptions, TailwindcssPatcherOptions, CacheStrategy } from '@/types'
export class TailwindcssPatcher {
Expand Down Expand Up @@ -67,7 +67,7 @@ export class TailwindcssPatcher {
return getContexts(basedir)
}

async extract(options: UserConfig['patch']) {
async extract(options?: UserConfig['patch']) {
const { output, tailwindcss } = options ?? {}
if (output && tailwindcss) {
const { removeUniversalSelector, filename, loose } = output
Expand Down
1 change: 1 addition & 0 deletions packages/tailwindcss-patch/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './core'
export * from './utils'
export * from './types'
export { defineConfig } from './config'
7 changes: 7 additions & 0 deletions packages/tailwindcss-patch/test/cache.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import fs from 'node:fs'
import { getCss } from './utils'
import { pkgName } from '@/constants'
import { TailwindcssPatcher, CacheManager } from '@/core'
import { getCacheOptions } from '@/core/cache'

describe('cache', () => {
let cm: CacheManager
Expand All @@ -12,6 +13,12 @@ describe('cache', () => {
it('getCacheOptions', () => {
expect(cm.getOptions).toBeDefined()
expect(cm.getOptions().dir).toBe(path.resolve(process.cwd(), './node_modules/.cache', pkgName))
expect(getCacheOptions(false)).toEqual({
enable: false
})
expect(getCacheOptions(true)).toEqual({
enable: true
})
})

it('mkCacheDirectory', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwindcss-patch/test/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { resolve } from 'node:path'
import { existsSync } from 'node:fs'
import { deleteAsync } from 'del'
import { fixturesRoot } from './utils'
import { initConfig, getConfig, getDefaultUserConfig, getDefaultMangleUserConfig } from '@/core/config'
import { initConfig, getConfig, getDefaultUserConfig, getDefaultMangleUserConfig } from '@/config'

describe('config', () => {
it('0.default', async () => {
Expand Down
17 changes: 17 additions & 0 deletions packages/tailwindcss-patch/test/exposeContext.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import path from 'node:path'
import { getTailwindcssEntry } from '@/core/exposeContext'
describe('exposeContext', () => {
it('getTailwindcssEntry', () => {
const dirname = __dirname
let p = getTailwindcssEntry()

expect(path.relative(dirname, p)).toBe('../node_modules/tailwindcss/lib/index.js')
let basedir = path.resolve(dirname, '../../../')
p = getTailwindcssEntry(basedir)
expect(path.relative(basedir, p)).toBe('node_modules/tailwindcss/lib/index.js')

basedir = path.resolve(dirname, '../../../apps/vite-react')
p = getTailwindcssEntry(basedir)
expect(path.relative(basedir, p)).toBe('node_modules/tailwindcss/lib/index.js')
})
})
6 changes: 6 additions & 0 deletions packages/tailwindcss-patch/test/tw-patcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,10 @@ describe('class', () => {

twPatcher.setCache(new Set())
})

it('extract', async () => {
const twPatcher = new TailwindcssPatcher()
const filename = await twPatcher.extract()
console.log(filename)
})
})
6 changes: 3 additions & 3 deletions packages/unplugin-tailwindcss-mangle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,20 @@
"@tailwindcss-mangle/core": "workspace:^",
"@tailwindcss-mangle/shared": "workspace:^",
"magic-string": "^0.30.3",
"unplugin": "^1.4.0"
"unplugin": "^1.5.0"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"devDependencies": {
"@types/babel__helper-plugin-utils": "^7.10.0",
"@types/babel__helper-plugin-utils": "^7.10.1",
"astro": "^2.10.12",
"css-loader": "^6.8.1",
"html-webpack-plugin": "^5.5.3",
"mini-css-extract-plugin": "^2.7.6",
"normalize-newline": "^4.1.0",
"postcss": "^8.4.29",
"postcss": "^8.4.30",
"postcss-loader": "^7.3.3",
"tailwindcss": "^3.3.3",
"tailwindcss-patch": "workspace:^",
Expand Down
Loading

0 comments on commit 221f566

Please sign in to comment.