Skip to content

Commit

Permalink
chore: update npm deps and fix import paths (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastián García authored May 31, 2024
1 parent 5ccfe82 commit 555f9e3
Show file tree
Hide file tree
Showing 18 changed files with 135 additions and 44 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
"cSpell.words": [
"changelogithub",
"corepack",
"openlabs"
"openlabs",
"openui",
"tailwindcss"
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"postinstall": "esno ./.github/prepare.ts && pnpm --filter @openlabs/theme build"
},
"devDependencies": {
"@antfu/eslint-config": "^2.8.3",
"@antfu/eslint-config": "^2.19.1",
"@types/node": "^20.11.28",
"eslint": "^8.57.0",
"eslint-plugin-format": "^0.1.0",
Expand Down
22 changes: 15 additions & 7 deletions packages/theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"name": "@openlabs/theme",
"version": "0.1.0",
"description": "Open UI. OpenLand's official framework design system 🎨",
"author": "Open Land",
"author": "Open Labs",
"publishConfig": {
"access": "public"
},
"license": "MIT",
"homepage": "https://github.com/open-land/ui#readme",
"homepage": "https://github.com/OpenLabs-dev/openui#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/open-land/ui.git"
"url": "git+https://github.com/OpenLabs-dev/openui.git"
},
"bugs": {
"url": "https://github.com/open-land/ui/issues"
"url": "https://github.com/OpenLabs-dev/openui/issues"
},
"keywords": [
"ui",
Expand All @@ -32,7 +32,7 @@
},
"scripts": {
"compile": "tsup --watch",
"build": "tsup",
"build": "tsup --dts",
"clean": "rm -rf .turbo node_modules dist"
},
"peerDependencies": {
Expand All @@ -44,14 +44,22 @@
"color": "^4.2.3",
"deepmerge": "^4.3.1",
"flat": "^5.0.2",
"lodash": "^4.17.21",
"lodash.foreach": "^4.5.0",
"lodash.get": "^4.4.2",
"lodash.kebabcase": "^4.1.1",
"lodash.mapkeys": "^4.6.0",
"lodash.omit": "^4.5.0",
"tailwind-merge": "^2.2.2"
},
"devDependencies": {
"@openlabs/tsconfig": "workspace:*",
"@types/color": "^3.0.6",
"@types/flat": "^5.0.5",
"@types/lodash": "^4.17.0",
"@types/lodash.foreach": "^4.5.9",
"@types/lodash.get": "^4.4.9",
"@types/lodash.kebabcase": "^4.1.9",
"@types/lodash.mapkeys": "^4.6.9",
"@types/lodash.omit": "^4.5.9",
"tailwindcss": "3.4.1",
"tsup": "8.0.2",
"typescript": "5.4.2"
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LayoutTheme } from '../../interfaces/theme'
import type { LayoutTheme } from './interfaces/theme'

export const defatulTheme: LayoutTheme = {
fontSize: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { BaseColors } from '../../interfaces/utils'
import type { BaseColors } from '../interfaces/utils'

export const colors: BaseColors = {
light: {
Expand Down
19 changes: 8 additions & 11 deletions packages/theme/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
// ! Colors Generate
// ! [`openui`](https://github.com/open-ss-lab/ui).
// !
// ! This loop generate color scheme
// ! Inspired by [`nextui`](https://github.com/nextui-org/nextui)

import Color from 'color'
import { kebabCase, mapKeys } from 'lodash'
import kebabCase from 'lodash.kebabcase'
import mapKeys from 'lodash.mapkeys'
import type { ConfigTheme } from './interfaces/theme'
import type { DefaultThemeType, Resolved } from './interfaces/utils'
import { flattenThemeObject } from './utils/functions'
Expand All @@ -13,11 +20,6 @@ export function config(themes: ConfigTheme = {}, defaultTheme: DefaultThemeType,
colors: {},
}

// ! Colors Generate
// ! [`openui`](https://github.com/open-ss-lab/ui).
// !
// ! This loop generate color scheme
// ! Inspired by [`nextui`](https://github.com/nextui-org/nextui)
for (const [themeName, { extend, layout, colors }] of Object.entries(themes)) {
let selector = `.${themeName},[data-theme="${themeName}"]`
const scheme = themeName === 'light' || themeName === 'dark' ? themeName : extend
Expand Down Expand Up @@ -69,11 +71,6 @@ export function config(themes: ConfigTheme = {}, defaultTheme: DefaultThemeType,
}
}

// ! Layout Generate
// ! [`openui`](https://github.com/open-ss-lab/ui).
// !
// ! This loop generate layout standard
// ! Inspired by [`nextui`](https://github.com/nextui-org/nextui)
for (const [key, value] of Object.entries(flatLayout)) {
if (!value)
return
Expand Down
4 changes: 2 additions & 2 deletions packages/theme/src/create-plugin.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import plugin from 'tailwindcss/plugin.js'
import type { DefaultThemeType } from './interfaces/utils'
import type { ConfigThemes } from './tailwind'
import type { ConfigThemes } from './tailwindcss'
import { config } from './config'
import { animations, baseStyles, tailwind, utilities } from './styles'
import { animations, baseStyles, tailwind, utilities } from './theme'

export function definePlugin(themes: ConfigThemes = {}, defaultTheme: DefaultThemeType, prefix: string) {
const resolved = config(themes, defaultTheme, prefix)
Expand Down
4 changes: 2 additions & 2 deletions packages/theme/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from './tailwind'
export * from './tailwindcss'
export * from './components'
export * from './styles'
export * from './theme'

export { cn } from './cn'
export type { ClassValue } from 'clsx'
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/src/interfaces/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ConfigThemes } from '../tailwind'
import type { ConfigThemes } from '../tailwindcss'
import type { LayoutTheme } from './theme'
import type { DefaultThemeType } from './utils'

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import type plugin from 'tailwindcss/plugin.js'
import deepMerge from 'deepmerge'
import { forEach, get, omit } from 'lodash'
import get from 'lodash.get'
import omit from 'lodash.omit'
import forEach from 'lodash.foreach'
import type { OpenUIPluginConfig } from './interfaces/config'
import type { ConfigTheme } from './interfaces/theme'
import {
darkTheme,
defatulTheme,
lightTheme,
colors as semanticColors,
} from './styles'
} from './theme'
import { definePlugin } from './create-plugin'
import { isBaseTheme } from './utils/functions'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export * from './colors'
export * from './layouts'
export * from './base'
export * from './utilities'
export * from './animations'
export * from './ripple'
File renamed without changes.
4 changes: 1 addition & 3 deletions packages/theme/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { defineConfig } from 'tsup'

export default defineConfig(options => ({
name: 'theme',
entryPoints: ['src/index.ts'],
entryPoints: ['./src/index.ts'],
format: ['cjs', 'esm'],
dts: true,
sourcemap: true,
clean: true,
target: 'es2019',
...options,
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"description": "Open UI. OpenLand's official framework design system 🎨",
"author": "Open Lab",
"license": "MIT",
"homepage": "https://github.com/open-land/openui#readme",
"homepage": "https://github.com/OpenLabs-dev/openui#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/open-land/openui.git"
"url": "git+https://github.com/OpenLabs-dev/openui.git"
},
"bugs": {
"url": "https://github.com/open-land/openui/issues"
"url": "https://github.com/OpenLabs-dev/openui/issues"
},
"keywords": [
"ui",
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineConfig } from 'tsup'

export default defineConfig(options => ({
name: 'react',
entryPoints: ['./index.ts'],
format: ['cjs', 'esm'],
name: 'react',
clean: true,
target: 'es2019',
...options,
Expand Down
98 changes: 91 additions & 7 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 555f9e3

Please sign in to comment.