@vuepress/utils 2.0.0-rc.3 → 2.0.0-rc.31

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.
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## Documentation
7
7
 
8
- https://v2.vuepress.vuejs.org
8
+ https://vuepress.vuejs.org
9
9
 
10
10
  ## License
11
11
 
package/dist/index.d.ts CHANGED
@@ -1,37 +1,41 @@
1
- export { default as debug } from 'debug';
2
- export { default as fs } from 'fs-extra';
3
- export { globby } from 'globby';
4
- export { default as hash } from 'hash-sum';
5
- import { Ora } from 'ora';
6
- export { default as ora } from 'ora';
7
- export { default as colors } from 'picocolors';
8
- export { default as path } from 'upath';
9
- import { HeadConfig, HeadAttrsConfig } from '@vuepress/shared';
10
-
1
+ import debug from "debug";
2
+ import fs from "fs-extra";
3
+ import hash from "hash-sum";
4
+ import ora, { Ora } from "ora";
5
+ import colors from "picocolors";
6
+ import picomatch from "picomatch";
7
+ import * as tinyglobby from "tinyglobby";
8
+ import path from "upath";
9
+ import { HeadAttrsConfig, HeadConfig } from "@vuepress/shared";
10
+ //#region src/console/formatMs.d.ts
11
11
  /**
12
12
  * Format millisecond
13
13
  */
14
14
  declare const formatMs: (ms: number) => string;
15
-
16
- declare const info: (...args: any[]) => void;
17
- declare const tip: (...args: any[]) => void;
18
- declare const success: (...args: any[]) => void;
19
- declare const warn: (...args: any[]) => void;
20
- declare const error: (...args: any[]) => void;
21
- declare const createError: (message?: string | undefined) => Error;
15
+ //#endregion
16
+ //#region src/console/logger.d.ts
17
+ declare const info: (...args: unknown[]) => void;
18
+ declare const tip: (...args: unknown[]) => void;
19
+ declare const success: (...args: unknown[]) => void;
20
+ declare const warn: (...args: unknown[]) => void;
21
+ declare const error: (...args: unknown[]) => void;
22
+ declare const createError: (message?: string) => Error;
22
23
  declare const logger: {
23
- info: (...args: any[]) => void;
24
- tip: (...args: any[]) => void;
25
- success: (...args: any[]) => void;
26
- warn: (...args: any[]) => void;
27
- error: (...args: any[]) => void;
28
- createError: (message?: string | undefined) => Error;
24
+ info: (...args: unknown[]) => void;
25
+ tip: (...args: unknown[]) => void;
26
+ success: (...args: unknown[]) => void;
27
+ warn: (...args: unknown[]) => void;
28
+ error: (...args: unknown[]) => void;
29
+ createError: (message?: string) => Error;
29
30
  };
30
-
31
+ //#endregion
32
+ //#region src/console/withSpinner.d.ts
31
33
  declare const withSpinner: (msg: string) => <T>(target: (spinner?: Ora) => Promise<T>) => Promise<T>;
32
-
34
+ //#endregion
35
+ //#region src/module/getDirname.d.ts
33
36
  declare const getDirname: (importMetaUrl: string) => string;
34
-
37
+ //#endregion
38
+ //#region src/module/importFile.d.ts
35
39
  /**
36
40
  * A helper for dynamically importing a file path
37
41
  *
@@ -42,82 +46,93 @@ declare const importFile: <T>(filePath: string) => Promise<T>;
42
46
  * A wrapper of `importFile` and returns the default export
43
47
  */
44
48
  declare const importFileDefault: <T>(filePath: string) => Promise<T>;
45
-
49
+ //#endregion
50
+ //#region src/module/isChildPath.d.ts
46
51
  /**
47
52
  * Check if `child` is a sub path of `parent` or not. Return `true` if
48
53
  * they are the same path
49
54
  */
50
55
  declare const isChildPath: (child: string, parent: string) => boolean;
51
-
56
+ //#endregion
57
+ //#region src/module/sanitizeFileName.d.ts
52
58
  declare const sanitizeFileName: (name: string) => string;
53
-
59
+ //#endregion
60
+ //#region src/module/transformPathToFileName.d.ts
61
+ /**
62
+ * Transforms a path to a file name, replacing slashes with underscores
63
+ */
64
+ declare const transformPathToFileName: (rawPath: string) => string;
65
+ //#endregion
66
+ //#region src/ssr/renderHead.d.ts
54
67
  /**
55
68
  * Render head config to string
56
69
  */
57
- declare const renderHead: ([tag, attrs, innerHTML,]: HeadConfig) => string;
58
-
70
+ declare const renderHead: ([tag, attrs, innerHTML]: HeadConfig) => string;
71
+ //#endregion
72
+ //#region src/ssr/renderHeadAttrs.d.ts
59
73
  /**
60
74
  * Render head attrs config to string
61
75
  */
62
76
  declare const renderHeadAttrs: (attrs: HeadAttrsConfig) => string;
63
-
77
+ //#endregion
78
+ //#region src/ssr/templateRenderer.d.ts
64
79
  /**
65
80
  * HTML outlets of the template renderer
66
81
  */
67
- declare const TEMPLATE_RENDERER_OUTLETS: {
68
- CONTENT: string;
69
- HEAD: string;
70
- LANG: string;
71
- PREFETCH: string;
72
- PRELOAD: string;
73
- SCRIPTS: string;
74
- STYLES: string;
75
- VERSION: string;
76
- };
82
+ declare enum TemplateRendererOutlet {
83
+ Content = "<!--vuepress-ssr-content-->",
84
+ Head = "<!--vuepress-ssr-head-->",
85
+ Lang = "{{ lang }}",
86
+ Prefetch = "<!--vuepress-ssr-prefetch-->",
87
+ Preload = "<!--vuepress-ssr-preload-->",
88
+ Scripts = "<!--vuepress-ssr-scripts-->",
89
+ Styles = "<!--vuepress-ssr-styles-->",
90
+ Version = "{{ version }}"
91
+ }
77
92
  /**
78
93
  * Context type of the template renderer
79
94
  */
80
95
  interface TemplateRendererContext {
81
- /**
82
- * The rendered page content. Typically to be put inside `<div id="app"></div>`
83
- */
84
- content: string;
85
- /**
86
- * The rendered page head. Typically to be put inside `<head></head>`
87
- */
88
- head: string;
89
- /**
90
- * The language of the page. Typically to be put inside `<html lang="{{ lang }}">`
91
- */
92
- lang: string;
93
- /**
94
- * The rendered prefetch links. Typically to be put inside `<head></head>`
95
- */
96
- prefetch: string;
97
- /**
98
- * The rendered preload links. Typically to be put inside `<head></head>`
99
- */
100
- preload: string;
101
- /**
102
- * The rendered scripts. Typically to be put before `</body>`
103
- */
104
- scripts: string;
105
- /**
106
- * The rendered styles. Typically to be put inside `<head></head>`
107
- */
108
- styles: string;
109
- /**
110
- * The version of VuePress
111
- */
112
- version: string;
96
+ /**
97
+ * The rendered page content. Typically to be put inside `<div id="app"></div>`
98
+ */
99
+ content: string;
100
+ /**
101
+ * The rendered page head. Typically to be put inside `<head></head>`
102
+ */
103
+ head: string;
104
+ /**
105
+ * The language of the page. Typically to be put inside `<html lang="{{ lang }}">`
106
+ */
107
+ lang: string;
108
+ /**
109
+ * The rendered prefetch links. Typically to be put inside `<head></head>`
110
+ */
111
+ prefetch: string;
112
+ /**
113
+ * The rendered preload links. Typically to be put inside `<head></head>`
114
+ */
115
+ preload: string;
116
+ /**
117
+ * The rendered scripts. Typically to be put before `</body>`
118
+ */
119
+ scripts: string;
120
+ /**
121
+ * The rendered styles. Typically to be put inside `<head></head>`
122
+ */
123
+ styles: string;
124
+ /**
125
+ * The version of VuePress
126
+ */
127
+ version: string;
113
128
  }
114
129
  /**
115
130
  * Type of the template renderer function
116
131
  */
117
- type TemplateRenderer = (template: string, context: TemplateRendererContext) => string | Promise<string>;
132
+ type TemplateRenderer = (template: string, context: TemplateRendererContext) => Promise<string> | string;
118
133
  /**
119
134
  * The default template renderer implementation
120
135
  */
121
136
  declare const templateRenderer: TemplateRenderer;
122
-
123
- export { TEMPLATE_RENDERER_OUTLETS, type TemplateRenderer, type TemplateRendererContext, createError, error, formatMs, getDirname, importFile, importFileDefault, info, isChildPath, logger, renderHead, renderHeadAttrs, sanitizeFileName, success, templateRenderer, tip, warn, withSpinner };
137
+ //#endregion
138
+ export { TemplateRenderer, TemplateRendererContext, TemplateRendererOutlet, colors, createError, debug, error, formatMs, fs, getDirname, hash, importFile, importFileDefault, info, isChildPath, logger, ora, path, picomatch, renderHead, renderHeadAttrs, sanitizeFileName, success, templateRenderer, tinyglobby, tip, transformPathToFileName, warn, withSpinner };
package/dist/index.js CHANGED
@@ -1,153 +1,143 @@
1
- // src/index.ts
2
1
  import debug from "debug";
3
2
  import fs from "fs-extra";
4
- import { globby } from "globby";
5
3
  import hash from "hash-sum";
6
- import ora2 from "ora";
7
- import colors2 from "picocolors";
8
- import path3 from "upath";
9
-
10
- // src/console/formatMs.ts
11
- var formatMs = (ms) => {
12
- if (ms < 1e3)
13
- return `${ms}ms`;
14
- return `${(ms / 1e3).toFixed(2)}s`;
4
+ import ora, { default as ora$1 } from "ora";
5
+ import colors, { default as colors$1 } from "picocolors";
6
+ import picomatch from "picomatch";
7
+ import * as tinyglobby from "tinyglobby";
8
+ import path, { default as path$1 } from "upath";
9
+ import process from "node:process";
10
+ import { fileURLToPath, pathToFileURL } from "node:url";
11
+ //#region src/console/formatMs.ts
12
+ /**
13
+ * Format millisecond
14
+ */
15
+ const formatMs = (ms) => {
16
+ if (ms < 1e3) return `${ms}ms`;
17
+ return `${(ms / 1e3).toFixed(2)}s`;
15
18
  };
16
-
17
- // src/console/logger.ts
18
- import colors from "picocolors";
19
- var info = (...args) => {
20
- console.log(colors.cyan("info"), ...args);
19
+ //#endregion
20
+ //#region src/console/logger.ts
21
+ const info = (...args) => {
22
+ console.log(colors$1.cyan("info"), ...args);
21
23
  };
22
- var tip = (...args) => {
23
- console.log(colors.blue("tip"), ...args);
24
+ const tip = (...args) => {
25
+ console.log(colors$1.blue("tip"), ...args);
24
26
  };
25
- var success = (...args) => {
26
- console.log(colors.green("success"), ...args);
27
+ const success = (...args) => {
28
+ console.log(colors$1.green("success"), ...args);
27
29
  };
28
- var warn = (...args) => {
29
- console.warn(colors.yellow("warning"), ...args);
30
+ const warn = (...args) => {
31
+ console.warn(colors$1.yellow("warning"), ...args);
30
32
  };
31
- var error = (...args) => {
32
- console.error(colors.red("error"), ...args);
33
+ const error = (...args) => {
34
+ console.error(colors$1.red("error"), ...args);
33
35
  };
34
- var createError = (message) => {
35
- error(message);
36
- return new Error(message);
36
+ const createError = (message) => {
37
+ error(message);
38
+ return new Error(message);
37
39
  };
38
- var logger = {
39
- info,
40
- tip,
41
- success,
42
- warn,
43
- error,
44
- createError
40
+ const logger = {
41
+ info,
42
+ tip,
43
+ success,
44
+ warn,
45
+ error,
46
+ createError
45
47
  };
46
-
47
- // src/console/withSpinner.ts
48
- import process from "process";
49
- import ora from "ora";
50
- var withSpinner = (msg) => async (target) => {
51
- if (process.env.DEBUG) {
52
- return target();
53
- }
54
- const start = Date.now();
55
- const spinner = ora();
56
- try {
57
- spinner.start(msg);
58
- const result = await target(spinner);
59
- spinner.succeed(`${msg} - done in ${formatMs(Date.now() - start)}`);
60
- return result;
61
- } catch (e) {
62
- spinner.fail(`${msg} - failed in ${formatMs(Date.now() - start)}`);
63
- throw e;
64
- }
48
+ //#endregion
49
+ //#region src/console/withSpinner.ts
50
+ const withSpinner = (msg) => async (target) => {
51
+ if (process.env.DEBUG) return target();
52
+ const start = Date.now();
53
+ const spinner = ora$1();
54
+ try {
55
+ spinner.start(msg);
56
+ const result = await target(spinner);
57
+ spinner.succeed(`${msg} - done in ${formatMs(Date.now() - start)}`);
58
+ return result;
59
+ } catch (e) {
60
+ spinner.fail(`${msg} - failed in ${formatMs(Date.now() - start)}`);
61
+ throw e;
62
+ }
65
63
  };
66
-
67
- // src/module/getDirname.ts
68
- import { fileURLToPath } from "url";
69
- import path from "upath";
70
- var getDirname = (importMetaUrl) => path.dirname(fileURLToPath(importMetaUrl));
71
-
72
- // src/module/importFile.ts
73
- import { pathToFileURL } from "url";
74
- var importFile = (filePath) => import(pathToFileURL(filePath).toString());
75
- var importFileDefault = (filePath) => importFile(filePath).then((m) => m.default);
76
-
77
- // src/module/isChildPath.ts
78
- import path2 from "upath";
79
- var isChildPath = (child, parent) => {
80
- const childPath = path2.normalize(child);
81
- const parentPath = path2.normalize(parent);
82
- if (!path2.win32.isAbsolute(childPath) || !path2.win32.isAbsolute(parentPath)) {
83
- return false;
84
- }
85
- const relativePath = path2.relative(parentPath, childPath);
86
- return relativePath === "" || !relativePath.startsWith("..");
64
+ //#endregion
65
+ //#region src/module/getDirname.ts
66
+ const getDirname = (importMetaUrl) => path$1.dirname(fileURLToPath(importMetaUrl));
67
+ //#endregion
68
+ //#region src/module/importFile.ts
69
+ /**
70
+ * A helper for dynamically importing a file path
71
+ *
72
+ * We need to use `pathToFileURL` to transform file path wo compat with windows
73
+ */
74
+ const importFile = async (filePath) => import(pathToFileURL(filePath).toString());
75
+ /**
76
+ * A wrapper of `importFile` and returns the default export
77
+ */
78
+ const importFileDefault = async (filePath) => importFile(filePath).then((m) => m.default);
79
+ //#endregion
80
+ //#region src/module/isChildPath.ts
81
+ /**
82
+ * Check if `child` is a sub path of `parent` or not. Return `true` if
83
+ * they are the same path
84
+ */
85
+ const isChildPath = (child, parent) => {
86
+ const childPath = path$1.normalize(child);
87
+ const parentPath = path$1.normalize(parent);
88
+ if (!path$1.win32.isAbsolute(childPath) || !path$1.win32.isAbsolute(parentPath)) return false;
89
+ const relativePath = path$1.relative(parentPath, childPath);
90
+ return relativePath === "" || !relativePath.startsWith("..");
87
91
  };
88
-
89
- // src/module/sanitizeFileName.ts
90
- var INVALID_CHAR_REGEX = /[\x00-\x1F\x7F<>*#"{}|^[\]`;?:&=+$,]/g;
91
- var DRIVE_LETTER_REGEX = /^[a-z]:/i;
92
- var sanitizeFileName = (name) => {
93
- const driveLetter = DRIVE_LETTER_REGEX.exec(name)?.[0] || "";
94
- return driveLetter + name.substring(driveLetter.length).replace(INVALID_CHAR_REGEX, "_").replace(/^_+/, "");
92
+ //#endregion
93
+ //#region src/module/sanitizeFileName.ts
94
+ const INVALID_CHAR_REGEX = /[\u0000-\u001F"#$%&*+,:;<=>?[\]^`{|}\u007F]/g;
95
+ const DRIVE_LETTER_REGEX = /^[a-z]:/i;
96
+ const sanitizeFileName = (name) => {
97
+ const driveLetter = DRIVE_LETTER_REGEX.exec(name)?.[0] || "";
98
+ return driveLetter + name.slice(driveLetter.length).replace(INVALID_CHAR_REGEX, "_").replace(/^_+/, "");
95
99
  };
96
-
97
- // src/ssr/renderHeadAttrs.ts
98
- var renderHeadAttrs = (attrs) => Object.entries(attrs).filter((item) => item[1] !== false).map(
99
- ([key, value]) => value === true ? ` ${key}` : ` ${key}="${attrs[key]}"`
100
- ).join("");
101
-
102
- // src/ssr/renderHead.ts
103
- var renderHead = ([
104
- tag,
105
- attrs,
106
- innerHTML = ""
107
- ]) => {
108
- const openTag = `<${tag}${renderHeadAttrs(attrs)}>`;
109
- if (tag === "link" || tag === "meta" || tag === "base") {
110
- return openTag;
111
- }
112
- return `${openTag}${innerHTML}</${tag}>`;
113
- };
114
-
115
- // src/ssr/templateRenderer.ts
116
- var TEMPLATE_RENDERER_OUTLETS = {
117
- CONTENT: "<!--vuepress-ssr-content-->",
118
- HEAD: "<!--vuepress-ssr-head-->",
119
- LANG: "{{ lang }}",
120
- PREFETCH: "<!--vuepress-ssr-prefetch-->",
121
- PRELOAD: "<!--vuepress-ssr-preload-->",
122
- SCRIPTS: "<!--vuepress-ssr-scripts-->",
123
- STYLES: "<!--vuepress-ssr-styles-->",
124
- VERSION: "{{ version }}"
125
- };
126
- var templateRenderer = (template, { content, head, lang, prefetch, preload, scripts, styles, version }) => template.replace(TEMPLATE_RENDERER_OUTLETS.CONTENT, () => content).replace(TEMPLATE_RENDERER_OUTLETS.HEAD, head).replace(TEMPLATE_RENDERER_OUTLETS.LANG, lang).replace(TEMPLATE_RENDERER_OUTLETS.PREFETCH, prefetch).replace(TEMPLATE_RENDERER_OUTLETS.PRELOAD, preload).replace(TEMPLATE_RENDERER_OUTLETS.SCRIPTS, scripts).replace(TEMPLATE_RENDERER_OUTLETS.STYLES, styles).replace(TEMPLATE_RENDERER_OUTLETS.VERSION, version);
127
- export {
128
- TEMPLATE_RENDERER_OUTLETS,
129
- colors2 as colors,
130
- createError,
131
- debug,
132
- error,
133
- formatMs,
134
- fs,
135
- getDirname,
136
- globby,
137
- hash,
138
- importFile,
139
- importFileDefault,
140
- info,
141
- isChildPath,
142
- logger,
143
- ora2 as ora,
144
- path3 as path,
145
- renderHead,
146
- renderHeadAttrs,
147
- sanitizeFileName,
148
- success,
149
- templateRenderer,
150
- tip,
151
- warn,
152
- withSpinner
100
+ //#endregion
101
+ //#region src/module/transformPathToFileName.ts
102
+ /**
103
+ * Transforms a path to a file name, replacing slashes with underscores
104
+ */
105
+ const transformPathToFileName = (rawPath) => sanitizeFileName(rawPath.replace(/\//g, "_"));
106
+ //#endregion
107
+ //#region src/ssr/renderHeadAttrs.ts
108
+ /**
109
+ * Render head attrs config to string
110
+ */
111
+ const renderHeadAttrs = (attrs) => Object.entries(attrs).filter((item) => item[1] !== false).map(([key, value]) => value === true ? ` ${key}` : ` ${key}="${attrs[key]}"`).join("");
112
+ //#endregion
113
+ //#region src/ssr/renderHead.ts
114
+ /**
115
+ * Render head config to string
116
+ */
117
+ const renderHead = ([tag, attrs, innerHTML = ""]) => {
118
+ const openTag = `<${tag}${renderHeadAttrs(attrs)}>`;
119
+ if (tag === "link" || tag === "meta" || tag === "base") return openTag;
120
+ return `${openTag}${innerHTML}</${tag}>`;
153
121
  };
122
+ //#endregion
123
+ //#region src/ssr/templateRenderer.ts
124
+ /**
125
+ * HTML outlets of the template renderer
126
+ */
127
+ let TemplateRendererOutlet = /* @__PURE__ */ function(TemplateRendererOutlet) {
128
+ TemplateRendererOutlet["Content"] = "<!--vuepress-ssr-content-->";
129
+ TemplateRendererOutlet["Head"] = "<!--vuepress-ssr-head-->";
130
+ TemplateRendererOutlet["Lang"] = "{{ lang }}";
131
+ TemplateRendererOutlet["Prefetch"] = "<!--vuepress-ssr-prefetch-->";
132
+ TemplateRendererOutlet["Preload"] = "<!--vuepress-ssr-preload-->";
133
+ TemplateRendererOutlet["Scripts"] = "<!--vuepress-ssr-scripts-->";
134
+ TemplateRendererOutlet["Styles"] = "<!--vuepress-ssr-styles-->";
135
+ TemplateRendererOutlet["Version"] = "{{ version }}";
136
+ return TemplateRendererOutlet;
137
+ }({});
138
+ /**
139
+ * The default template renderer implementation
140
+ */
141
+ const templateRenderer = (template, { content, head, lang, prefetch, preload, scripts, styles, version }) => template.replace("<!--vuepress-ssr-content-->", () => content).replace("<!--vuepress-ssr-head-->", head).replace("{{ lang }}", lang).replace("<!--vuepress-ssr-prefetch-->", prefetch).replace("<!--vuepress-ssr-preload-->", preload).replace("<!--vuepress-ssr-scripts-->", scripts).replace("<!--vuepress-ssr-styles-->", styles).replace("{{ version }}", version);
142
+ //#endregion
143
+ export { TemplateRendererOutlet, colors, createError, debug, error, formatMs, fs, getDirname, hash, importFile, importFileDefault, info, isChildPath, logger, ora, path, picomatch, renderHead, renderHeadAttrs, sanitizeFileName, success, templateRenderer, tinyglobby, tip, transformPathToFileName, warn, withSpinner };
package/package.json CHANGED
@@ -1,63 +1,60 @@
1
1
  {
2
2
  "name": "@vuepress/utils",
3
- "version": "2.0.0-rc.3",
3
+ "version": "2.0.0-rc.31",
4
4
  "description": "Utils package of VuePress",
5
5
  "keywords": [
6
- "vuepress",
7
- "utils"
6
+ "utils",
7
+ "vuepress"
8
8
  ],
9
9
  "homepage": "https://github.com/vuepress",
10
10
  "bugs": {
11
11
  "url": "https://github.com/vuepress/core/issues"
12
12
  },
13
+ "license": "MIT",
14
+ "author": "meteorlxy",
13
15
  "repository": {
14
16
  "type": "git",
15
17
  "url": "git+https://github.com/vuepress/core.git"
16
18
  },
17
- "license": "MIT",
18
- "author": "meteorlxy",
19
+ "files": [
20
+ "dist"
21
+ ],
19
22
  "type": "module",
23
+ "main": "./dist/index.js",
24
+ "module": "./dist/index.js",
25
+ "types": "./dist/index.d.ts",
20
26
  "exports": {
21
27
  ".": "./dist/index.js",
22
28
  "./package.json": "./package.json"
23
29
  },
24
- "main": "./dist/index.js",
25
- "types": "./dist/index.d.ts",
26
- "files": [
27
- "dist"
28
- ],
30
+ "publishConfig": {
31
+ "access": "public"
32
+ },
29
33
  "dependencies": {
30
- "@types/debug": "^4.1.12",
34
+ "@types/debug": "^4.1.13",
31
35
  "@types/fs-extra": "^11.0.4",
32
36
  "@types/hash-sum": "^1.0.2",
33
- "debug": "^4.3.4",
34
- "fs-extra": "^11.2.0",
35
- "globby": "^14.0.0",
37
+ "@types/picomatch": "^4.0.3",
38
+ "debug": "^4.4.3",
39
+ "fs-extra": "^11.3.6",
36
40
  "hash-sum": "^2.0.0",
37
- "ora": "^8.0.1",
38
- "picocolors": "^1.0.0",
39
- "upath": "^2.0.1",
40
- "@vuepress/shared": "2.0.0-rc.3"
41
- },
42
- "publishConfig": {
43
- "access": "public"
41
+ "ora": "^9.4.1",
42
+ "picocolors": "^1.1.1",
43
+ "picomatch": "^4.0.5",
44
+ "tinyglobby": "^0.2.17",
45
+ "upath": "^3.0.8",
46
+ "@vuepress/shared": "2.0.0-rc.31"
44
47
  },
45
- "tsup": {
46
- "clean": true,
47
- "dts": "./src/index.ts",
48
- "entry": [
49
- "./src/index.ts"
50
- ],
51
- "format": [
52
- "esm"
53
- ],
54
- "outDir": "./dist",
55
- "sourcemap": false,
56
- "target": "es2022",
48
+ "tsdown": {
49
+ "dts": true,
50
+ "entry": "./src/index.ts",
51
+ "fixedExtension": false,
52
+ "format": "esm",
53
+ "target": "es2023",
57
54
  "tsconfig": "../../tsconfig.dts.json"
58
55
  },
59
56
  "scripts": {
60
- "build": "tsup",
57
+ "build": "tsdown",
61
58
  "clean": "rimraf dist"
62
59
  }
63
60
  }