Skip to content

Commit

Permalink
fix!: now it's know that the unocss things are modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Milfred committed Sep 23, 2024
1 parent 1da2f7a commit d17d5a0
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .playground/uno.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'unocss';
import presetCore from '../assets/js/unocss/preset-core.js';
import breakpoints from './assets/js/breakpoints.js';
import presetCore from '../assets/js/unocss/preset-core';
import breakpoints from './assets/js/breakpoints';

export default defineConfig({
presets: [presetCore({ breakpoints })],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { StringifiedUtil } from '@unocss/core'
import type { CssNode, Rule, Selector, SelectorList } from 'css-tree'
import type { TransformerDirectivesContext } from './types'
import type { TransformerDirectivesContext } from './types.mjs'
import { expandVariantGroup, notNull, regexScopePlaceholder } from '@unocss/core'
import { clone, generate, List, parse } from 'css-tree'
import { transformDirectives } from './transform'
import { transformDirectives } from './transform.mjs'

type Writeable<T> = { -readonly [P in keyof T]: T[P] }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { FunctionNode, StringNode } from 'css-tree'
import type { TransformerDirectivesContext } from './types'
import type { TransformerDirectivesContext } from './types.mjs'
import { transformThemeString } from '@unocss/rule-utils'

export function handleFunction({ code, uno, options }: TransformerDirectivesContext, node: FunctionNode) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { SourceCodeTransformer } from '@unocss/core'
import type { TransformerDirectivesOptions } from './types'
import type { TransformerDirectivesOptions } from './types.mjs'
import { cssIdRE } from '@unocss/core'
import { transformDirectives } from './transform'
import { transformDirectives } from './transform.mjs'

export * from './types'
export * from './types.mjs'

export default function transformerDirectives(options: TransformerDirectivesOptions = {}): SourceCodeTransformer {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Theme } from '@unocss/preset-mini'
import type { Atrule } from 'css-tree'
import type { TransformerDirectivesContext } from './types'
import type { TransformerDirectivesContext } from './types.mjs'

// eslint-disable-next-line regexp/no-misleading-capturing-group
const screenRuleRE = /(@screen [^{]+)(.+)/g
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { UnoGenerator } from '@unocss/core'
import type { CssNode, List, ListItem } from 'css-tree'
import type MagicString from 'magic-string'
import type { TransformerDirectivesContext, TransformerDirectivesOptions } from './types'
import type { TransformerDirectivesContext, TransformerDirectivesOptions } from './types.mjs'
import { toArray } from '@unocss/core'
import { hasThemeFn as hasThemeFunction } from '@unocss/rule-utils'
import { parse, walk } from 'css-tree'
import { handleApply } from './apply'
import { handleFunction } from './functions'
import { handleScreen } from './screen'
import { handleApply } from './apply.mjs'
import { handleFunction } from './functions.mjs'
import { handleScreen } from './screen.mjs'

export async function transformDirectives(
code: MagicString,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import presetWind from '@unocss/preset-wind';
import presetNoDefaultRem from './preset-no-default-rem';

import transformerVariantGroup from '@unocss/transformer-variant-group';
import transformerDirectives from './TransformerDirectives';
import transformerDirectives from './TransformerDirectives/index';

function presetCore(options = {}) {
// Assign to the default options
Expand Down
File renamed without changes.
8 changes: 2 additions & 6 deletions uno.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { defineConfig } from 'unocss';
import presetCore from './assets/js/unocss/preset-core.js';
import presetNoDefaultRem from './assets/js/unocss/preset-no-default-rem.js';
import transformerVariantGroup from '@unocss/transformer-variant-group';
import transformerDirectives from '@unocss/transformer-directives';
import presetCore from './assets/js/unocss/preset-core';

export default defineConfig({
presets: [presetCore(), presetNoDefaultRem()],
transformers: [transformerVariantGroup(), transformerDirectives()],
presets: [presetCore()],
});

0 comments on commit d17d5a0

Please sign in to comment.