@globalbrain/sefirot 4.4.1 → 4.4.2

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 (2) hide show
  1. package/config/vite.js +20 -6
  2. package/package.json +2 -1
package/config/vite.js CHANGED
@@ -12,6 +12,7 @@
12
12
  */
13
13
 
14
14
  import { fileURLToPath } from 'node:url'
15
+ import MagicString from 'magic-string'
15
16
  import icons from 'unplugin-icons/vite'
16
17
  import { mergeConfig } from 'vite'
17
18
 
@@ -23,18 +24,27 @@ export const baseConfig = {
23
24
  enforce: 'pre',
24
25
  name: 'sefirot:patch-linkify-it',
25
26
  transform(code, id) {
26
- if (id.includes('markdown-it')) {
27
- return code.replace(
28
- 'const text_separators = "[><\uFF5C]"',
29
- 'const text_separators = "[><\uFF00-\uFFEF]"' // https://www.fileformat.info/info/unicode/block/halfwidth_and_fullwidth_forms/index.htm
30
- )
27
+ if (id.includes('linkify-it/lib/re.mjs')) {
28
+ const s = new MagicString(code)
29
+
30
+ const search = 'const text_separators = \'[><\\uff5c]\''
31
+ const replace = 'const text_separators = \'[><\\uff00-\\uffef]\''
32
+
33
+ const index = code.indexOf(search)
34
+ if (index !== -1) {
35
+ s.overwrite(index, index + search.length, replace)
36
+ }
37
+
38
+ return { code: s.toString(), map: s.generateMap({ source: id }) }
31
39
  }
32
40
  }
33
41
  }
34
42
  ],
35
43
 
36
44
  resolve: {
37
- alias: { 'sefirot/': fileURLToPath(new URL('../lib/', import.meta.url)) },
45
+ alias: {
46
+ 'sefirot/': fileURLToPath(new URL('../lib/', import.meta.url))
47
+ },
38
48
 
39
49
  dedupe: [
40
50
  '@sentry/browser',
@@ -69,6 +79,10 @@ export const baseConfig = {
69
79
  'dayjs/plugin/relativeTime',
70
80
  'dayjs/plugin/timezone',
71
81
  'dayjs/plugin/utc',
82
+ 'markdown-it > argparse',
83
+ 'markdown-it > entities'
84
+ ],
85
+ exclude: [
72
86
  'markdown-it'
73
87
  ]
74
88
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
3
  "type": "module",
4
- "version": "4.4.1",
4
+ "version": "4.4.2",
5
5
  "packageManager": "pnpm@9.9.0",
6
6
  "description": "Vue Components for Global Brain Design System.",
7
7
  "author": "Kia Ishii <ka.ishii@globalbrains.com>",
@@ -73,6 +73,7 @@
73
73
  "@types/file-saver": "^2.0.7",
74
74
  "@types/qs": "^6.9.15",
75
75
  "file-saver": "^2.0.5",
76
+ "magic-string": "^0.30.11",
76
77
  "ofetch": "^1.3.4",
77
78
  "qs": "^6.13.0",
78
79
  "unplugin-icons": "^0.19.2"