Skip to content

Commit

Permalink
refa: upgrade build tools
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Oct 27, 2024
1 parent 855422a commit 656625d
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 29 deletions.
18 changes: 9 additions & 9 deletions packages/client/app/styles/index.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@use 'sass:color';
@import './layout.scss';
@import './element.scss';
@import './hc.scss';
@use './layout.scss';
@use './element.scss';
@use './hc.scss';

$black: #000000;
$white: #ffffff;
Expand Down Expand Up @@ -42,9 +42,9 @@ $white: #ffffff;

@mixin apply-color($name, $base) {
--k-color-#{$name}: #{$base};
--k-color-#{$name}-shade: #{mix($base, $black, 90%)};
--k-color-#{$name}-tint: #{mix($base, $white, 80%)};
--k-color-#{$name}-fade: #{fade-out($base, 0.9)};
--k-color-#{$name}-shade: #{color.mix($base, $black, 90%)};
--k-color-#{$name}-tint: #{color.mix($base, $white, 80%)};
--k-color-#{$name}-fade: #{color.adjust($base, $alpha: -0.9)};
}

@include apply-color(primary, #409eff);
Expand Down Expand Up @@ -89,9 +89,9 @@ html.dark, .theme-root.dark {

@mixin apply-color($name, $base) {
--k-color-#{$name}: #{$base};
--k-color-#{$name}-shade: #{mix($base, $black, 80%)};
--k-color-#{$name}-tint: #{mix($base, $white, 90%)};
--k-color-#{$name}-fade: #{fade-out($base, 0.9)};
--k-color-#{$name}-shade: #{color.mix($base, $black, 80%)};
--k-color-#{$name}-tint: #{color.mix($base, $white, 90%)};
--k-color-#{$name}-fade: #{color.adjust($base, $alpha: -0.9)};
}

@include apply-color(primary, #7459ff);
Expand Down
22 changes: 11 additions & 11 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,21 @@
"dependencies": {
"@koishijs/components": "1.5.13",
"@maikolib/vite-plugin-yaml": "^1.0.1",
"@satorijs/protocol": "^1.4.1",
"@vitejs/plugin-vue": "^4.6.2",
"@vueuse/core": "^10.9.0",
"@satorijs/protocol": "^1.4.2",
"@vitejs/plugin-vue": "^5.1.4",
"@vueuse/core": "^11.1.0",
"cac": "^6.7.14",
"cordis": "^3.17.3",
"cosmokit": "^1.6.2",
"element-plus": "2.7.3",
"cordis": "^3.18.1",
"cosmokit": "^1.6.3",
"element-plus": "2.7.7",
"marked-vue": "^1.3.0",
"ns-require": "^1.1.4",
"sass": "^1.72.0",
"unocss": "^0.58.6",
"vite": "^4.5.3",
"vue": "^3.4.21",
"sass": "^1.80.4",
"unocss": "^0.63.6",
"vite": "^5.4.10",
"vue": "^3.5.12",
"vue-i18n": "^9.10.2",
"vue-router": "^4.3.0"
"vue-router": "^4.4.5"
},
"yakumo": {
"client": "./scripts/client.ts"
Expand Down
7 changes: 7 additions & 0 deletions packages/client/scripts/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ export async function build(root: string, config: vite.UserConfig = {}, isClient
yaml(),
...config.plugins || [],
],
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
},
},
},
resolve: {
alias: {
'vue': root + '/vue.js',
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ cli.command('build [root]')

cli.parse()

if (!cli.matchedCommand) {
if (!cli.matchedCommand && !cli.options.help) {
cli.outputHelp()
}
24 changes: 18 additions & 6 deletions packages/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { RollupOutput } from 'rollup'
import { existsSync, promises as fs } from 'fs'
import { resolve } from 'path'
import { Context } from 'yakumo'
import * as unocss from 'unocss/vite'
import * as mini from 'unocss/preset-mini'
import vue from '@vitejs/plugin-vue'
import yaml from '@maikolib/vite-plugin-yaml'

Expand Down Expand Up @@ -55,14 +53,21 @@ export async function build(root: string, config: vite.UserConfig = {}) {
plugins: [
vue(),
yaml(),
unocss.default({
(await import('unocss/vite')).default({
presets: [
mini.default({
(await import('unocss/preset-mini')).default({
preflight: false,
}),
],
}),
],
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
},
},
},
resolve: {
alias: {
'vue-i18n': '@koishijs/client',
Expand Down Expand Up @@ -105,14 +110,21 @@ export async function createServer(baseDir: string, config?: vite.InlineConfig)
plugins: [
vue(),
yaml(),
unocss.default({
(await import('unocss/vite')).default({
presets: [
mini.default({
(await import('unocss/preset-mini')).default({
preflight: false,
}),
],
}),
],
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
},
},
},
resolve: {
dedupe: ['vue', 'vue-demi', 'vue-router', 'element-plus', '@vueuse/core', '@popperjs/core', 'marked', 'xss'],
alias: {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"@satorijs/element": "^3.1.7",
"cosmokit": "^1.6.2",
"schemastery-vue": "^7.3.4"
"cosmokit": "^1.6.3",
"schemastery-vue": "^7.3.6"
}
}

0 comments on commit 656625d

Please sign in to comment.