valaxy 0.3.1 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/README.md +4 -0
  2. package/dist/chunk-32YG63VM.js +83 -0
  3. package/dist/chunk-QIXBXHEK.js +1 -0
  4. package/dist/chunk-REH4P5X4.mjs +83 -0
  5. package/dist/chunk-T3K5KZOK.mjs +1 -0
  6. package/dist/{config-408070e9.d.ts → config-97204b79.d.ts} +4 -1
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.js +1 -1
  9. package/dist/index.mjs +1 -1
  10. package/dist/node/cli.js +10 -10
  11. package/dist/node/cli.mjs +10 -10
  12. package/dist/node/index.d.ts +1 -1
  13. package/dist/node/index.js +1 -1
  14. package/dist/node/index.mjs +1 -1
  15. package/package.json +37 -36
  16. package/src/client/components/ValaxyToc.vue +50 -4
  17. package/src/client/locales/en.yml +9 -9
  18. package/src/client/locales/zh-CN.yml +9 -9
  19. package/src/client/pages/index.vue +5 -0
  20. package/src/client/styles/palette.scss +1 -1
  21. package/src/node/cli.ts +2 -1
  22. package/src/node/markdown/check.ts +14 -0
  23. package/src/node/markdown/index.ts +12 -7
  24. package/src/node/markdown/{markdown-it-container.ts → markdown-it/container.ts} +0 -0
  25. package/src/node/markdown/{headings.ts → markdown-it/headings.ts} +4 -3
  26. package/src/node/markdown/{highlightLines.ts → markdown-it/highlightLines.ts} +0 -0
  27. package/src/node/markdown/{markdown-it-katex.ts → markdown-it/katex.ts} +0 -0
  28. package/src/node/markdown/{parseHeader.ts → markdown-it/parseHeader.ts} +0 -0
  29. package/src/node/plugins/extendConfig.ts +0 -8
  30. package/src/node/plugins/markdown.ts +17 -20
  31. package/src/node/plugins/preset.ts +7 -14
  32. package/src/node/plugins/unocss.ts +1 -0
  33. package/src/node/rss.ts +4 -4
  34. package/src/node/utils/cli.ts +8 -8
  35. package/src/node/vite.ts +1 -2
  36. package/tsup.config.ts +1 -1
  37. package/dist/chunk-F4NM2FOU.mjs +0 -88
  38. package/dist/chunk-PQWGL22E.js +0 -88
  39. package/dist/chunk-R2IXLA5A.mjs +0 -1
  40. package/dist/chunk-WNLPZSAR.js +0 -1
@@ -3,7 +3,7 @@ import path from 'path'
3
3
  import os from 'os'
4
4
  // import equal from 'fast-deep-equal'
5
5
 
6
- import chalk from 'chalk'
6
+ import { blue, bold, cyan, dim, gray, green, underline } from 'kolorist'
7
7
  import consola from 'consola'
8
8
  import type { InlineConfig, ViteDevServer } from 'vite'
9
9
  import { createServer } from '../server'
@@ -15,26 +15,26 @@ let server: ViteDevServer | undefined
15
15
 
16
16
  export function printInfo(options: ResolvedValaxyOptions, port?: number, remote?: string | boolean) {
17
17
  console.log()
18
- console.log(` ${chalk.bold('🌌 Valaxy')} ${chalk.blue(`v${version}`)}`)
18
+ console.log(` ${bold('🌌 Valaxy')} ${blue(`v${version}`)}`)
19
19
  console.log()
20
- console.log(`${chalk.dim(' 🪐 theme ')} > ${(options.theme ? chalk.green(options.theme) : chalk.gray('none'))}`)
21
- console.log(` ${chalk.dim('📁')} ${chalk.dim(path.resolve(options.userRoot))}`)
20
+ console.log(`${dim(' 🪐 theme ')} > ${(options.theme ? green(options.theme) : gray('none'))}`)
21
+ console.log(` ${dim('📁')} ${dim(path.resolve(options.userRoot))}`)
22
22
  if (port) {
23
23
  console.log()
24
- console.log(`${chalk.dim(' Preview ')} > ${chalk.cyan(`http://localhost:${chalk.bold(port)}/`)}`)
24
+ console.log(`${dim(' Preview ')} > ${cyan(`http://localhost:${bold(port)}/`)}`)
25
25
 
26
26
  if (remote) {
27
27
  Object.values(os.networkInterfaces())
28
28
  .forEach(v => (v || [])
29
29
  .filter(details => details.family === 'IPv4' && !details.address.includes('127.0.0.1'))
30
30
  .forEach(({ address }) => {
31
- console.log(`${chalk.dim(' Network ')} > ${chalk.blue(`http://${address}:${chalk.bold(port)}/`)}`)
31
+ console.log(`${dim(' Network ')} > ${blue(`http://${address}:${bold(port)}/`)}`)
32
32
  }),
33
33
  )
34
34
  }
35
35
 
36
36
  console.log()
37
- console.log(`${chalk.dim(' shortcuts ')} > ${chalk.underline('r')}${chalk.dim('estart | ')}${chalk.underline('o')}${chalk.dim('pen | ')}${chalk.underline('e')}${chalk.dim('dit')}`)
37
+ console.log(`${dim(' shortcuts ')} > ${underline('r')}${dim('estart | ')}${underline('o')}${dim('pen | ')}${underline('e')}${dim('dit')}`)
38
38
  }
39
39
  console.log()
40
40
  }
@@ -56,7 +56,7 @@ export async function initServer(options: ResolvedValaxyOptions, viteConfig: Inl
56
56
 
57
57
  if (iconChanged) {
58
58
  consola.info('Find new icon, reload server...')
59
- consola.info(`If you do not want to reload it, write icon name in ${chalk.green('config.unocss.safelist')}.`)
59
+ consola.info(`If you do not want to reload it, write icon name in ${green('config.unocss.safelist')}.`)
60
60
  consola.info('For example: ["i-ri-cloud-line"]')
61
61
  console.log()
62
62
  reload = true
package/src/node/vite.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { join } from 'path'
2
2
  import type { InlineConfig } from 'vite'
3
- import { searchForWorkspaceRoot } from 'vite'
4
3
  import type { ResolvedValaxyOptions, ValaxyServerOptions } from './options'
5
4
 
6
5
  import { ViteValaxyPlugins } from './plugins/preset'
@@ -37,7 +36,7 @@ export async function createViteConfig(options: ResolvedValaxyOptions, serverOpt
37
36
  // not need to search workspace root
38
37
  options.clientRoot,
39
38
  options.themeRoot,
40
- searchForWorkspaceRoot(options.userRoot),
39
+ options.userRoot,
41
40
  ],
42
41
  },
43
42
  },
package/tsup.config.ts CHANGED
@@ -3,9 +3,9 @@ import { defineConfig } from 'tsup'
3
3
  export default defineConfig((options) => {
4
4
  return {
5
5
  entry: [
6
+ 'src/index.ts',
6
7
  'src/node/index.ts',
7
8
  'src/node/cli.ts',
8
- 'src/index.ts',
9
9
  ],
10
10
  // https://tsup.egoist.sh/#code-splitting
11
11
  // Code splitting currently only works with the esm output format, and it's enabled by default. If you want code splitting for cjs output format as well, try using --splitting flag which is an experimental feature to get rid of the limitation in esbuild.