Skip to content

Commit e55d7d2

Browse files
committed
Separate config from source
1 parent 067bdef commit e55d7d2

File tree

10 files changed

+26
-38
lines changed

10 files changed

+26
-38
lines changed

app/packages/config/index.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { property } from './lib/properties'
2+
import { values } from './lib/values'
3+
import { classes } from './lib/classes'
4+
5+
const config = {
6+
property,
7+
values,
8+
classes,
9+
attributify: true
10+
}
11+
12+
export { config, property, values, classes }
13+
export default { config, property, values, classes }
File renamed without changes.

app/src/styles/lib/color.js app/packages/config/lib/color.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,17 @@ export const color = {
1010
amber: '#f49c09',
1111
gold: '#ffd700',
1212
yellow: '#f1c230',
13-
1413
chartreuse: '#7fff00',
1514
lime: '#91e411',
1615
green: '#15e05f',
1716
emerald: '#13cb8e',
1817
teal: '#12c39f',
1918
aquamarine: '#7fffd4',
20-
2119
turquoise: '#40e0d0',
2220
cyan: '#21d2f1',
2321
sky: '#0ea5e9',
2422
blue: '#3d82f2',
2523
navy: '#0000a8',
26-
2724
indigo: '#6f72f7',
2825
violet: '#7844f0',
2926
purple: '#a855f7',
@@ -32,12 +29,10 @@ export const color = {
3229
fuchsia: '#d642ec',
3330
pink: '#f32d8f',
3431
rose: '#eb3756',
35-
3632
slate: '#636c7c',
3733
zinc: '#71757a',
3834
gray: '#696a6a',
3935
neutral: '#737373',
40-
4136
olive: '#e2e200',
4237
beige: '#f5f5dc',
4338
khaki: '#c3b091',
@@ -49,9 +44,6 @@ export const color = {
4944
}
5045

5146
export const colors = generateColors({
52-
option: {
53-
format: 'object2',
54-
output: 'rgb-only'
55-
},
47+
option: { format: 'object2', output: 'rgb-only' },
5648
color
5749
})

app/src/styles/lib/global.js app/packages/config/lib/global.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export const globalStyles = `
2+
(*): family-sans;
23
(body): fw-500 bg-neutral-50 text-neutral-950;
34
(.btn): [all]-unset h-40px d-inline-flex flex-parent-center px-12px [cursor]-pointer bg-neutral-900 hover:bg-neutral-800 tr-time-300ms text-neutral-50 br-8px fs-14px fw-500;
45
(.btn.btn-icon): box-40px p-0;
File renamed without changes.
File renamed without changes.

app/rollup.config.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import fs from 'node:fs'
2+
import path from 'node:path'
13
import resolve from '@rollup/plugin-node-resolve'
24
import commonjs from '@rollup/plugin-commonjs'
35
import terser from '@rollup/plugin-terser'
4-
import fs from 'node:fs'
5-
import path from 'node:path'
66

77
const packageJson = JSON.parse(fs.readFileSync(path.resolve('package.json'), 'utf-8'))
88

@@ -14,7 +14,7 @@ const banner = `/*!
1414
*
1515
* Built Date: ${new Date().toString()}
1616
*/`
17-
console.log(banner)
17+
1818
const terserConfig = {
1919
format: {
2020
comments: false,
@@ -27,31 +27,28 @@ const terserConfig = {
2727
}
2828

2929
const config = {
30-
input: './src/styles/lib/config.js',
30+
input: './packages/config/index.js',
3131
output: [
3232
{
3333
file: 'plugin/index.cjs',
3434
format: 'cjs',
3535
exports: 'named',
36-
banner,
37-
plugins: [terser(terserConfig)]
36+
banner
3837
},
3938
{
4039
file: 'plugin/index.umd.js',
4140
format: 'umd',
4241
name,
4342
banner,
44-
exports: 'named',
45-
plugins: [terser(terserConfig)]
43+
exports: 'named'
4644
},
4745
{
4846
file: 'plugin/index.esm.js',
4947
format: 'es',
50-
banner,
51-
plugins: [terser(terserConfig)]
48+
banner
5249
}
5350
],
54-
plugins: [resolve(), commonjs()]
51+
plugins: [resolve(), commonjs(), terser(terserConfig)]
5552
}
5653

5754
export default config
File renamed without changes.

app/src/styles/init.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { useLayoutEffect } from 'preact/hooks'
22
import { MakeTenoxUI } from '@tenoxui/core/full'
3-
import { globalStyles } from './lib/global'
4-
import { tenoxuiConfig as config } from './lib/config'
3+
import { globalStyles } from '@app/packages/config/lib/global'
4+
import { config } from '@app/packages/config'
55

66
export function init() {
77
useLayoutEffect(() => {
@@ -12,4 +12,4 @@ export function init() {
1212
}, [])
1313
}
1414

15-
export { tenoxuiConfig } from './lib/config'
15+
export { config } from '@app/packages/config'

app/src/styles/lib/config.js

-15
This file was deleted.

0 commit comments

Comments
 (0)