@deot/dev-builder 1.1.2 → 2.0.0

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,9 +5,35 @@
5
5
  - 优先执行`scripts`下的`build`和`build:types`,如果声明`build`,打包由用户管理,`build:types`,类型编译由用户管理
6
6
  - 可被打包的文件匹配:`src/index.*.(j|t|s?cs)s`
7
7
 
8
- ## 其它
8
+ ## 自定义配置
9
9
 
10
- - 目前依赖`rollup`打包,后续考虑读取`rollup.config.js`
11
- - 如果改成`vite`打包,则考虑读取配置`vite.config.js`
10
+ 提供环境变量`BUILD_OPTIONS`
12
11
 
13
- 打包输出文件`index.[format].js` + `index.d.ts`
12
+ ```ts
13
+ interface BUILD_OPTIONS {
14
+ packageFolderName?: string;
15
+ workspace?: string;
16
+ watch: boolean;
17
+ coverage: boolean;
18
+ }
19
+ ```
20
+
21
+ 根目录创建`build.config.ts`, 可以选择`configShared`合并或单独基于`BUILD_OPTIONS`配置
22
+ > 也可以是`z.build.config.ts`, 前缀主要是置底
23
+
24
+ ```ts
25
+ import { mergeConfig, defineConfig } from 'vite';
26
+ import configShared from '@deot/dev-builder/shared.config';
27
+
28
+ export default mergeConfig(
29
+ configShared,
30
+ defineConfig({
31
+ // custom config
32
+ plugins: [
33
+ vue(),
34
+ react()
35
+ ]
36
+ })
37
+ );
38
+ ```
39
+ 取`build.config.ts`, 是为了方便从`build`转其他测试工具时,可以不改变文件名
@@ -0,0 +1,76 @@
1
+ // this the shared base config for all packages.
2
+ {
3
+ "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
4
+ "compiler": {
5
+ "overrideTsconfig": {
6
+ "compilerOptions": {
7
+ "paths": null
8
+ }
9
+ }
10
+ },
11
+ "apiReport": {
12
+ "enabled": true,
13
+ "reportFolder": "<projectFolder>/temp/"
14
+ },
15
+
16
+ "docModel": {
17
+ "enabled": true
18
+ },
19
+
20
+ "dtsRollup": {
21
+ "enabled": true,
22
+ "untrimmedFilePath": ""
23
+ },
24
+
25
+ "tsdocMetadata": {
26
+ "enabled": false
27
+ },
28
+
29
+ "messages": {
30
+ "compilerMessageReporting": {
31
+ "default": {
32
+ "logLevel": "warning"
33
+ }
34
+ },
35
+
36
+ "extractorMessageReporting": {
37
+ "default": {
38
+ "logLevel": "warning",
39
+ "addToApiReportFile": true
40
+ },
41
+
42
+ "ae-missing-release-tag": {
43
+ "logLevel": "none"
44
+ },
45
+ "ae-wrong-input-file-type": {
46
+ "logLevel": "none"
47
+ }
48
+ },
49
+
50
+ "tsdocMessageReporting": {
51
+ "default": {
52
+ "logLevel": "warning"
53
+ },
54
+
55
+ "tsdoc-undefined-tag": {
56
+ "logLevel": "none"
57
+ },
58
+
59
+ "tsdoc-escape-greater-than": {
60
+ "logLevel": "none"
61
+ },
62
+
63
+ "tsdoc-malformed-inline-tag": {
64
+ "logLevel": "none"
65
+ },
66
+
67
+ "tsdoc-escape-right-brace": {
68
+ "logLevel": "none"
69
+ },
70
+
71
+ "tsdoc-unnecessary-backslash": {
72
+ "logLevel": "none"
73
+ }
74
+ }
75
+ }
76
+ }
package/dist/index.cjs.js CHANGED
@@ -1,291 +1,282 @@
1
1
  'use strict';
2
2
 
3
- var devShared = require('@deot/dev-shared');
4
- var path = require('node:path');
5
- var node_module = require('node:module');
6
- var fs = require('fs-extra');
7
- var chalk = require('chalk');
8
- var ora = require('ora');
9
- var typescript = require('@rollup/plugin-typescript');
10
- var pluginNodeResolve = require('@rollup/plugin-node-resolve');
11
- var commonjs = require('@rollup/plugin-commonjs');
12
- var replace = require('@rollup/plugin-replace');
13
- var rollup = require('rollup');
14
- var sass = require('sass');
15
- var postcss = require('postcss');
16
- var atImport = require('postcss-import');
17
- var atUrl = require('postcss-url');
18
- var flexBugs = require('postcss-flexbugs-fixes');
19
- var cssnano = require('cssnano');
20
- var autoprefixer = require('autoprefixer');
21
- var apiExtractor = require('@microsoft/api-extractor');
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const devShared = require('@deot/dev-shared');
6
+ const path = require('node:path');
7
+ const node_module = require('node:module');
8
+ const fs = require('fs-extra');
9
+ const chalk = require('chalk');
10
+ const ora = require('ora');
11
+ const node_url = require('node:url');
12
+ const vite = require('vite');
13
+ const sass = require('sass');
14
+ const postcss = require('postcss');
15
+ const atImport = require('postcss-import');
16
+ const atUrl = require('postcss-url');
17
+ const flexBugs = require('postcss-flexbugs-fixes');
18
+ const cssnano = require('cssnano');
19
+ const autoprefixer = require('autoprefixer');
20
+ const apiExtractor = require('@microsoft/api-extractor');
22
21
 
23
22
  function _interopNamespaceDefault(e) {
24
- var n = Object.create(null);
25
- if (e) {
26
- Object.keys(e).forEach(function (k) {
27
- if (k !== 'default') {
28
- var d = Object.getOwnPropertyDescriptor(e, k);
29
- Object.defineProperty(n, k, d.get ? d : {
30
- enumerable: true,
31
- get: function () { return e[k]; }
32
- });
33
- }
34
- });
35
- }
36
- n.default = e;
37
- return Object.freeze(n);
23
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: 'Module' } });
24
+ if (e) {
25
+ for (const k in e) {
26
+ if (k !== 'default') {
27
+ const d = Object.getOwnPropertyDescriptor(e, k);
28
+ Object.defineProperty(n, k, d.get ? d : {
29
+ enumerable: true,
30
+ get: () => e[k]
31
+ });
32
+ }
33
+ }
34
+ }
35
+ n.default = e;
36
+ return Object.freeze(n);
38
37
  }
39
38
 
40
- var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
39
+ const path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
41
40
 
41
+ const dirname$1 = path__namespace.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs.js', document.baseURI).href))));
42
42
  const run$3 = async (options) => {
43
- const { packageName, packageFolderName, packageDir, commandOptions, packageOptions } = options || {};
44
- const { workspace } = devShared.Locals.impl();
45
- const srcDir = path__namespace.resolve(packageDir, './src');
46
- let files = fs.existsSync(srcDir)
47
- ? fs
48
- .readdirSync(srcDir)
49
- .filter((i) => /^index(.*)\.(t|j)s$/.test(i))
50
- : [];
51
- const scripts = files.map((file) => {
52
- let filepath = path__namespace.resolve(srcDir, file);
53
- return {
54
- file,
55
- input: filepath,
56
- output: [
57
- {
58
- file: path__namespace.resolve(packageDir, './dist', file.replace(/(\.(j|t)s)$/, '.es.js')),
59
- format: 'es',
60
- exports: 'named',
61
- sourcemap: false
62
- },
63
- {
64
- file: path__namespace.resolve(packageDir, './dist', file.replace(/(\.(j|t)s)$/, '.iife.js')),
65
- format: 'iife',
66
- name: packageName,
67
- },
68
- {
69
- file: path__namespace.resolve(packageDir, './dist', file.replace(/(\.(j|t)s)$/, '.cjs.js')),
70
- format: 'cjs'
71
- }
72
- ].filter(i => {
73
- return commandOptions.scriptFormats.includes(i.format);
74
- })
75
- };
76
- });
77
- const external = Object
78
- .keys({
79
- ...packageOptions.dependencies,
80
- ...packageOptions.peerDependencies
81
- })
82
- .map(i => new RegExp(`^${i}$`));
83
- const source = workspace ? `${workspace}/${packageFolderName}/**/*` : 'src/**/*';
84
- const shims = workspace ? `${workspace}/shims.d.ts` : 'shims.d.ts';
85
- const outDir = workspace ? `${workspace}/${packageFolderName}/dist` : 'dist';
86
- const stats = [];
87
- await scripts
88
- .reduce((preProcess, current) => {
89
- preProcess = preProcess
90
- .then(() => rollup.rollup({
91
- input: current.input,
92
- external: [
93
- /^node:/,
94
- /^[a-zA-Z@]/,
95
- ...external
96
- ],
97
- plugins: [
98
- typescript({
99
- include: [source, shims],
100
- exclude: ['dist'],
101
- compilerOptions: {
102
- rootDir: '.',
103
- outDir,
104
- declaration: /^index.ts$/.test(current.file)
105
- }
106
- }),
107
- commonjs({ extensions: ['.js', '.ts'] }),
108
- pluginNodeResolve.nodeResolve(),
109
- replace({
110
- '1.1.1': `'${packageOptions.version}'`,
111
- false: 'false',
112
- true: true
113
- })
114
- ]
115
- }))
116
- .then((builder) => Promise.all(current.output.map(builder.write)))
117
- .then(() => Promise.all(current.output.map((i) => fs.stat(i.file))))
118
- .then((stats$) => {
119
- stats$.forEach((stat, index) => {
120
- stats.push({
121
- file: current.file,
122
- format: current.output[index].format,
123
- size: stat.size
124
- });
125
- });
126
- });
127
- return preProcess;
128
- }, Promise.resolve());
43
+ const locals = devShared.Locals.impl();
44
+ const { cwd } = locals;
45
+ const { packageName, packageDir, packageOptions } = options || {};
46
+ const stats = [];
47
+ const srcDir = path__namespace.resolve(packageDir, "./src");
48
+ const outDir = path__namespace.resolve(packageDir, "./dist");
49
+ let files = fs.existsSync(srcDir) ? fs.readdirSync(srcDir).filter((i) => /^index(.*)\.(t|j)s$/.test(i)) : [];
50
+ if (!files.length)
129
51
  return stats;
52
+ process.env.BUILD_OPTIONS = encodeURIComponent(JSON.stringify({
53
+ files,
54
+ packageName,
55
+ packageDir,
56
+ packageOptions
57
+ }));
58
+ let options$ = {};
59
+ if (fs.existsSync(`${cwd}/build.config.ts`)) {
60
+ options$.configFile = path__namespace.relative(cwd, path__namespace.resolve(cwd, "./build.config.ts"));
61
+ } else if (fs.existsSync(`${cwd}/z.build.config.ts`)) {
62
+ options$.configFile = path__namespace.relative(cwd, path__namespace.resolve(cwd, "./z.build.config.ts"));
63
+ } else {
64
+ options$.configFile = path__namespace.relative(cwd, path__namespace.resolve(dirname$1, "../shared.config.ts"));
65
+ }
66
+ await vite.build(options$);
67
+ let outputs = fs.readdirSync(outDir).filter((i) => /^index(.*)(?!=\.d)\.js$/.test(i));
68
+ outputs.forEach((file) => {
69
+ let stat = fs.statSync(path__namespace.resolve(outDir, file));
70
+ stats.push({
71
+ file: file.replace(/^(.*)(\..*\.js)/, "$1.ts"),
72
+ format: file.replace(/.*\.(.*)\.js/, "$1"),
73
+ size: stat.size
74
+ });
75
+ });
76
+ return stats;
130
77
  };
131
78
 
132
79
  const run$2 = async (options) => {
133
- const { packageDir } = options || {};
134
- const srcDir = path__namespace.resolve(packageDir, './src');
135
- const styles = fs.readdirSync(srcDir).filter((i) => /^index(.*)\.s?css$/.test(i));
136
- const stats = [];
137
- await styles
138
- .reduce((preProcess, file) => {
139
- preProcess = preProcess
140
- .then(() => {
141
- let filepath = path__namespace.resolve(srcDir, file);
142
- const data = sass.compile(filepath, { style: 'compressed' });
143
- return postcss()
144
- .use(atImport())
145
- .use(atUrl())
146
- .use(flexBugs())
147
- .use(cssnano())
148
- .use(autoprefixer({ remove: false }))
149
- .process(data.css, { from: filepath });
150
- })
151
- .then((source) => {
152
- let output = path__namespace.resolve(packageDir, `./dist/${file.replace(/\.scss$/g, '.css')}`);
153
- fs.outputFileSync(output, source.css);
154
- return fs.stat(output);
155
- })
156
- .then((stat) => {
157
- stats.push({
158
- file,
159
- size: stat.size
160
- });
80
+ const { packageDir } = options || {};
81
+ const srcDir = path__namespace.resolve(packageDir, "./src");
82
+ const styles = fs.existsSync(srcDir) ? fs.readdirSync(srcDir).filter((i) => /^index(.*)\.s?css$/.test(i)) : [];
83
+ const stats = [];
84
+ await styles.reduce(
85
+ (preProcess, file) => {
86
+ preProcess = preProcess.then(() => {
87
+ let filepath = path__namespace.resolve(srcDir, file);
88
+ const data = sass.compile(filepath, { style: "compressed" });
89
+ return postcss().use(atImport()).use(atUrl()).use(flexBugs()).use(cssnano()).use(autoprefixer({ remove: false })).process(data.css, { from: filepath });
90
+ }).then((source) => {
91
+ let output = path__namespace.resolve(packageDir, `./dist/${file.replace(/\.scss$/g, ".css")}`);
92
+ fs.outputFileSync(output, source.css);
93
+ return fs.stat(output);
94
+ }).then((stat) => {
95
+ stats.push({
96
+ file,
97
+ size: stat.size
161
98
  });
162
- return preProcess;
163
- }, Promise.resolve());
164
- return stats;
99
+ });
100
+ return preProcess;
101
+ },
102
+ Promise.resolve()
103
+ );
104
+ return stats;
165
105
  };
166
106
 
107
+ const dirname = path__namespace.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs.js', document.baseURI).href))));
167
108
  const run$1 = async (options) => {
168
- const { workspace } = devShared.Locals.impl();
169
- const { packageDir, packageOptions } = options;
170
- if (workspace && packageOptions?.scripts?.['build:types']) {
171
- await devShared.Shell.spawn(`npm`, ['run', 'build:types'], {
172
- cwd: packageDir
173
- });
174
- return;
109
+ const { workspace } = devShared.Locals.impl();
110
+ const { packageDir, packageFolderName, packageOptions, commandOptions } = options;
111
+ const done = () => {
112
+ const stats = [];
113
+ let fullpath = `${packageDir}/dist/index.d.ts`;
114
+ if (fs.existsSync(fullpath)) {
115
+ let stat = fs.statSync(fullpath);
116
+ stats.push({
117
+ file: "index.d.ts",
118
+ size: stat.size
119
+ });
175
120
  }
176
- const config = path__namespace.resolve(packageDir, `api-extractor.json`);
177
- if (fs.existsSync(config)) {
178
- const result = apiExtractor.Extractor.invoke(apiExtractor.ExtractorConfig.loadFileAndPrepare(config), {
179
- localBuild: true,
180
- showVerboseMessages: false
181
- });
182
- if (!result.succeeded) {
183
- devShared.Logger.error(`API Extractor completed with ${result.errorCount} errors and ${result.warningCount} warnings`);
184
- process.exitCode = 1;
121
+ return stats;
122
+ };
123
+ if (!commandOptions.dts) {
124
+ return done();
125
+ }
126
+ if (workspace && packageOptions?.scripts?.["build:types"]) {
127
+ await devShared.Shell.spawn(`npm`, ["run", "build:types"], {
128
+ cwd: packageDir
129
+ });
130
+ return done();
131
+ }
132
+ let tempDir = `${packageDir}/dist/temp`;
133
+ let rootDir = path__namespace.relative(tempDir, process.cwd());
134
+ fs.outputFileSync(`${tempDir}/tsconfig.json`, JSON.stringify({
135
+ extends: `${rootDir}/tsconfig.json`,
136
+ compilerOptions: {
137
+ declaration: true,
138
+ emitDeclarationOnly: true,
139
+ rootDir,
140
+ outDir: "."
141
+ },
142
+ include: [
143
+ path__namespace.relative(tempDir, path__namespace.resolve(packageDir, `src/*`))
144
+ ]
145
+ }, null, " "));
146
+ await devShared.Shell.spawn("tsc", ["-p", `${tempDir}/tsconfig.json`]);
147
+ const configPath = `${tempDir}/api-extractor.json`;
148
+ fs.outputFileSync(configPath, JSON.stringify({
149
+ extends: path__namespace.relative(tempDir, path__namespace.resolve(dirname, "../api-extractor.shared.json")),
150
+ mainEntryPointFilePath: `.${workspace ? "/packages/" : ""}${packageFolderName}/src/index.d.ts`,
151
+ // workspace、时以temp/packages/*/src结构,否则APIExtractor会报错
152
+ dtsRollup: {
153
+ publicTrimmedFilePath: "../index.d.ts"
154
+ }
155
+ }, null, " "));
156
+ const result = apiExtractor.Extractor.invoke(
157
+ apiExtractor.ExtractorConfig.loadFileAndPrepare(configPath),
158
+ {
159
+ localBuild: true,
160
+ showVerboseMessages: false,
161
+ // 去掉版本提示
162
+ messageCallback: (message) => {
163
+ if (message.messageId === "console-compiler-version-notice" || message.messageId === "console-preamble") {
164
+ message.handled = true;
185
165
  }
166
+ }
186
167
  }
187
- await fs.remove(`${packageDir}/dist/${workspace || 'src'}`);
168
+ );
169
+ if (!result.succeeded) {
170
+ devShared.Logger.error(
171
+ `API Extractor completed with ${result.errorCount} errors and ${result.warningCount} warnings`
172
+ );
173
+ process.exitCode = 1;
174
+ }
175
+ await fs.remove(`${packageDir}/dist/temp`);
176
+ return done();
188
177
  };
189
178
 
190
179
  const require$ = node_module.createRequire(process.cwd());
191
180
  class Build {
192
- packageDir;
193
- packageFolderName;
194
- packageSourceDir;
195
- packageName;
196
- packageOptions;
197
- commandOptions;
198
- constructor(packageFolderName, commandOptions) {
199
- const { workspace, packageDir, packageName, packageFolderName: packageFolderName$ } = devShared.Locals.impl();
200
- this.packageFolderName = packageFolderName || '';
201
- this.packageDir = path__namespace.resolve(packageDir, workspace ? `./${packageFolderName}` : '');
202
- this.packageSourceDir = path__namespace.resolve(packageDir, './src');
203
- this.packageName = packageFolderName === packageFolderName$
204
- ? packageName
205
- : `${packageName}-${packageFolderName}`;
206
- this.packageOptions = require$(`${this.packageDir}/package.json`);
207
- this.commandOptions = commandOptions;
181
+ packageDir;
182
+ packageFolderName;
183
+ packageSourceDir;
184
+ packageName;
185
+ packageOptions;
186
+ commandOptions;
187
+ constructor(packageFolderName, commandOptions) {
188
+ const { workspace, packageDir, packageName, packageFolderName: packageFolderName$ } = devShared.Locals.impl();
189
+ this.packageFolderName = packageFolderName || "";
190
+ this.packageDir = path__namespace.resolve(packageDir, workspace ? `./${packageFolderName}` : "");
191
+ this.packageSourceDir = path__namespace.resolve(packageDir, "./src");
192
+ this.packageName = packageFolderName === packageFolderName$ ? packageName : `${packageName}-${packageFolderName}`;
193
+ this.packageOptions = require$(`${this.packageDir}/package.json`);
194
+ this.commandOptions = commandOptions;
195
+ }
196
+ async process() {
197
+ let start = Date.now();
198
+ const { cwd, workspace } = devShared.Locals.impl();
199
+ const { packageOptions, packageName, packageDir } = this;
200
+ if (workspace && packageOptions?.scripts?.build && packageDir !== cwd) {
201
+ await devShared.Shell.spawn(`npm`, ["run", "build"], {
202
+ cwd: packageDir
203
+ });
204
+ return;
208
205
  }
209
- async process() {
210
- const { cwd, workspace } = devShared.Locals.impl();
211
- const { packageOptions, packageName, packageDir } = this;
212
- if (workspace
213
- && packageOptions?.scripts?.build
214
- && packageDir !== cwd) {
215
- await devShared.Shell.spawn(`npm`, ['run', 'build'], {
216
- cwd: packageDir
217
- });
218
- return;
219
- }
220
- const srcDir = path__namespace.resolve(packageDir, './src');
221
- let files = fs.existsSync(srcDir)
222
- ? fs
223
- .readdirSync(srcDir)
224
- .filter((i) => /^index(.*)\.(ts|js|s?css)$/.test(i))
225
- : [];
226
- if (!files.length)
227
- return;
228
- const spinner = ora(`${packageName} Build ...`);
229
- try {
230
- spinner.start();
231
- await fs.emptyDir(`${packageDir}/dist`);
232
- const styleStats = await run$2(this);
233
- const scriptStats = await run$3(this);
234
- run$1(this);
235
- spinner.stop();
236
- devShared.Logger.log(`${chalk.cyan(`${packageName}`)}: ${chalk.green('Success')}`);
237
- scriptStats.forEach((stat) => {
238
- devShared.Logger.log(`${chalk.magenta(stat.file)}: ${chalk.green(stat.format.toUpperCase())} - ${devShared.Utils.formatBytes(stat.size)}`);
239
- });
240
- styleStats.forEach((stat) => {
241
- devShared.Logger.log(`${chalk.magenta(stat.file)}: ${devShared.Utils.formatBytes(stat.size)}`);
242
- });
243
- }
244
- catch (e) {
245
- devShared.Logger.log('Error!', e);
246
- throw e;
247
- }
206
+ const srcDir = path__namespace.resolve(packageDir, "./src");
207
+ let files = fs.existsSync(srcDir) ? fs.readdirSync(srcDir).filter((i) => /^index(.*)\.(ts|js|s?css)$/.test(i)) : [];
208
+ if (!files.length)
209
+ return;
210
+ const spinner = ora(`${packageName} Build ...`);
211
+ try {
212
+ spinner.start();
213
+ await fs.emptyDir(`${packageDir}/dist`);
214
+ const scriptStats = await run$3(this);
215
+ const scriptDuration = Date.now() - start;
216
+ const styleStats = await run$2(this);
217
+ const styleDuration = Date.now() - start - scriptDuration;
218
+ const typeStats = await run$1(this);
219
+ const typeDuration = Date.now() - start - styleDuration - scriptDuration;
220
+ spinner.stop();
221
+ let message = "";
222
+ message += `${chalk.cyan(`${packageName}`)}: ${chalk.green("Success")} ${chalk.blue(`${Date.now() - start}ms`)}(`;
223
+ message += styleStats.length ? `css: ${chalk.yellow(styleDuration)}ms; ` : "";
224
+ message += scriptStats.length ? `js: ${chalk.yellow(scriptDuration)}ms${typeStats.length ? "; " : ""}` : "";
225
+ message += typeStats.length ? `dts: ${chalk.yellow(typeDuration)}ms` : "";
226
+ message += ")";
227
+ devShared.Logger.log(message);
228
+ scriptStats.concat(styleStats).concat(typeStats).forEach((stat) => {
229
+ let message$ = "";
230
+ message$ += `${chalk.magenta(stat.file)}: `;
231
+ message$ += stat.format ? `${chalk.green(stat.format.toUpperCase())} - ` : "";
232
+ message$ += `${devShared.Utils.formatBytes(stat.size)}`;
233
+ devShared.Logger.log(message$);
234
+ });
235
+ } catch (e) {
236
+ devShared.Logger.log("Error!", e);
237
+ throw e;
248
238
  }
239
+ }
249
240
  }
250
241
  const build = (options, commandOptions) => {
251
- return new Build(options, commandOptions);
242
+ return new Build(options, commandOptions);
252
243
  };
253
244
 
254
245
  const run = (options) => devShared.Utils.autoCatch(async () => {
255
- options = {
256
- scriptFormats: 'es,cjs',
257
- ...options
258
- };
259
- const locals = devShared.Locals.impl();
260
- if (typeof options.dryRun === 'undefined') {
261
- options.dryRun = process.env.NODE_ENV === 'UNIT';
262
- }
263
- const { normalizePackageFolderNames } = devShared.Locals.impl();
264
- let packageFolderName = devShared.Locals.getPackageFolderName(options.packageName || '*');
265
- let inputs = [];
266
- if (locals.workspace && packageFolderName === '*') {
267
- inputs = normalizePackageFolderNames;
268
- }
269
- else {
270
- inputs = [packageFolderName];
271
- }
272
- if (options.dryRun)
273
- return devShared.Shell.spawn(`echo ${inputs.join(' ')}`);
274
- await inputs
275
- .reduce((preProcess, packageFolderName$) => {
276
- preProcess = preProcess.then(() => build(packageFolderName$, options).process());
277
- return preProcess;
278
- }, Promise.resolve());
246
+ options = {
247
+ scriptFormats: "es,cjs",
248
+ ...options
249
+ };
250
+ const locals = devShared.Locals.impl();
251
+ if (typeof options.dryRun === "undefined") {
252
+ options.dryRun = process.env.NODE_ENV === "UNIT";
253
+ }
254
+ const { normalizePackageFolderNames } = devShared.Locals.impl();
255
+ let packageFolderName = devShared.Locals.getPackageFolderName(options.packageName || "*");
256
+ let inputs = [];
257
+ if (locals.workspace && packageFolderName === "*") {
258
+ inputs = normalizePackageFolderNames;
259
+ } else {
260
+ inputs = [packageFolderName];
261
+ }
262
+ if (options.dryRun)
263
+ return devShared.Shell.spawn(`echo ${inputs.join(" ")}`);
264
+ await inputs.reduce(
265
+ (preProcess, packageFolderName$) => {
266
+ preProcess = preProcess.then(() => build(packageFolderName$, options).process());
267
+ return preProcess;
268
+ },
269
+ Promise.resolve()
270
+ );
279
271
  }, {
280
- onError: (e) => {
281
- if (typeof e === 'number' && e === 1) {
282
- devShared.Logger.error('编译未通过');
283
- }
284
- else {
285
- devShared.Logger.error(e);
286
- }
287
- process.exit(1);
272
+ onError: (e) => {
273
+ if (typeof e === "number" && e === 1) {
274
+ devShared.Logger.error("编译未通过");
275
+ } else {
276
+ devShared.Logger.error(e);
288
277
  }
278
+ process.exit(1);
279
+ }
289
280
  });
290
281
 
291
282
  exports.run = run;
package/dist/index.es.js CHANGED
@@ -4,11 +4,8 @@ import { createRequire } from 'node:module';
4
4
  import fs from 'fs-extra';
5
5
  import chalk from 'chalk';
6
6
  import ora from 'ora';
7
- import typescript from '@rollup/plugin-typescript';
8
- import { nodeResolve } from '@rollup/plugin-node-resolve';
9
- import commonjs from '@rollup/plugin-commonjs';
10
- import replace from '@rollup/plugin-replace';
11
- import { rollup } from 'rollup';
7
+ import { fileURLToPath } from 'node:url';
8
+ import { build as build$1 } from 'vite';
12
9
  import sass from 'sass';
13
10
  import postcss from 'postcss';
14
11
  import atImport from 'postcss-import';
@@ -18,253 +15,245 @@ import cssnano from 'cssnano';
18
15
  import autoprefixer from 'autoprefixer';
19
16
  import { Extractor, ExtractorConfig } from '@microsoft/api-extractor';
20
17
 
18
+ const dirname$1 = path.dirname(fileURLToPath(import.meta.url));
21
19
  const run$3 = async (options) => {
22
- const { packageName, packageFolderName, packageDir, commandOptions, packageOptions } = options || {};
23
- const { workspace } = Locals.impl();
24
- const srcDir = path.resolve(packageDir, './src');
25
- let files = fs.existsSync(srcDir)
26
- ? fs
27
- .readdirSync(srcDir)
28
- .filter((i) => /^index(.*)\.(t|j)s$/.test(i))
29
- : [];
30
- const scripts = files.map((file) => {
31
- let filepath = path.resolve(srcDir, file);
32
- return {
33
- file,
34
- input: filepath,
35
- output: [
36
- {
37
- file: path.resolve(packageDir, './dist', file.replace(/(\.(j|t)s)$/, '.es.js')),
38
- format: 'es',
39
- exports: 'named',
40
- sourcemap: false
41
- },
42
- {
43
- file: path.resolve(packageDir, './dist', file.replace(/(\.(j|t)s)$/, '.iife.js')),
44
- format: 'iife',
45
- name: packageName,
46
- },
47
- {
48
- file: path.resolve(packageDir, './dist', file.replace(/(\.(j|t)s)$/, '.cjs.js')),
49
- format: 'cjs'
50
- }
51
- ].filter(i => {
52
- return commandOptions.scriptFormats.includes(i.format);
53
- })
54
- };
55
- });
56
- const external = Object
57
- .keys({
58
- ...packageOptions.dependencies,
59
- ...packageOptions.peerDependencies
60
- })
61
- .map(i => new RegExp(`^${i}$`));
62
- const source = workspace ? `${workspace}/${packageFolderName}/**/*` : 'src/**/*';
63
- const shims = workspace ? `${workspace}/shims.d.ts` : 'shims.d.ts';
64
- const outDir = workspace ? `${workspace}/${packageFolderName}/dist` : 'dist';
65
- const stats = [];
66
- await scripts
67
- .reduce((preProcess, current) => {
68
- preProcess = preProcess
69
- .then(() => rollup({
70
- input: current.input,
71
- external: [
72
- /^node:/,
73
- /^[a-zA-Z@]/,
74
- ...external
75
- ],
76
- plugins: [
77
- typescript({
78
- include: [source, shims],
79
- exclude: ['dist'],
80
- compilerOptions: {
81
- rootDir: '.',
82
- outDir,
83
- declaration: /^index.ts$/.test(current.file)
84
- }
85
- }),
86
- commonjs({ extensions: ['.js', '.ts'] }),
87
- nodeResolve(),
88
- replace({
89
- '1.1.1': `'${packageOptions.version}'`,
90
- false: 'false',
91
- true: true
92
- })
93
- ]
94
- }))
95
- .then((builder) => Promise.all(current.output.map(builder.write)))
96
- .then(() => Promise.all(current.output.map((i) => fs.stat(i.file))))
97
- .then((stats$) => {
98
- stats$.forEach((stat, index) => {
99
- stats.push({
100
- file: current.file,
101
- format: current.output[index].format,
102
- size: stat.size
103
- });
104
- });
105
- });
106
- return preProcess;
107
- }, Promise.resolve());
20
+ const locals = Locals.impl();
21
+ const { cwd } = locals;
22
+ const { packageName, packageDir, packageOptions } = options || {};
23
+ const stats = [];
24
+ const srcDir = path.resolve(packageDir, "./src");
25
+ const outDir = path.resolve(packageDir, "./dist");
26
+ let files = fs.existsSync(srcDir) ? fs.readdirSync(srcDir).filter((i) => /^index(.*)\.(t|j)s$/.test(i)) : [];
27
+ if (!files.length)
108
28
  return stats;
29
+ process.env.BUILD_OPTIONS = encodeURIComponent(JSON.stringify({
30
+ files,
31
+ packageName,
32
+ packageDir,
33
+ packageOptions
34
+ }));
35
+ let options$ = {};
36
+ if (fs.existsSync(`${cwd}/build.config.ts`)) {
37
+ options$.configFile = path.relative(cwd, path.resolve(cwd, "./build.config.ts"));
38
+ } else if (fs.existsSync(`${cwd}/z.build.config.ts`)) {
39
+ options$.configFile = path.relative(cwd, path.resolve(cwd, "./z.build.config.ts"));
40
+ } else {
41
+ options$.configFile = path.relative(cwd, path.resolve(dirname$1, "../shared.config.ts"));
42
+ }
43
+ await build$1(options$);
44
+ let outputs = fs.readdirSync(outDir).filter((i) => /^index(.*)(?!=\.d)\.js$/.test(i));
45
+ outputs.forEach((file) => {
46
+ let stat = fs.statSync(path.resolve(outDir, file));
47
+ stats.push({
48
+ file: file.replace(/^(.*)(\..*\.js)/, "$1.ts"),
49
+ format: file.replace(/.*\.(.*)\.js/, "$1"),
50
+ size: stat.size
51
+ });
52
+ });
53
+ return stats;
109
54
  };
110
55
 
111
56
  const run$2 = async (options) => {
112
- const { packageDir } = options || {};
113
- const srcDir = path.resolve(packageDir, './src');
114
- const styles = fs.readdirSync(srcDir).filter((i) => /^index(.*)\.s?css$/.test(i));
115
- const stats = [];
116
- await styles
117
- .reduce((preProcess, file) => {
118
- preProcess = preProcess
119
- .then(() => {
120
- let filepath = path.resolve(srcDir, file);
121
- const data = sass.compile(filepath, { style: 'compressed' });
122
- return postcss()
123
- .use(atImport())
124
- .use(atUrl())
125
- .use(flexBugs())
126
- .use(cssnano())
127
- .use(autoprefixer({ remove: false }))
128
- .process(data.css, { from: filepath });
129
- })
130
- .then((source) => {
131
- let output = path.resolve(packageDir, `./dist/${file.replace(/\.scss$/g, '.css')}`);
132
- fs.outputFileSync(output, source.css);
133
- return fs.stat(output);
134
- })
135
- .then((stat) => {
136
- stats.push({
137
- file,
138
- size: stat.size
139
- });
57
+ const { packageDir } = options || {};
58
+ const srcDir = path.resolve(packageDir, "./src");
59
+ const styles = fs.existsSync(srcDir) ? fs.readdirSync(srcDir).filter((i) => /^index(.*)\.s?css$/.test(i)) : [];
60
+ const stats = [];
61
+ await styles.reduce(
62
+ (preProcess, file) => {
63
+ preProcess = preProcess.then(() => {
64
+ let filepath = path.resolve(srcDir, file);
65
+ const data = sass.compile(filepath, { style: "compressed" });
66
+ return postcss().use(atImport()).use(atUrl()).use(flexBugs()).use(cssnano()).use(autoprefixer({ remove: false })).process(data.css, { from: filepath });
67
+ }).then((source) => {
68
+ let output = path.resolve(packageDir, `./dist/${file.replace(/\.scss$/g, ".css")}`);
69
+ fs.outputFileSync(output, source.css);
70
+ return fs.stat(output);
71
+ }).then((stat) => {
72
+ stats.push({
73
+ file,
74
+ size: stat.size
140
75
  });
141
- return preProcess;
142
- }, Promise.resolve());
143
- return stats;
76
+ });
77
+ return preProcess;
78
+ },
79
+ Promise.resolve()
80
+ );
81
+ return stats;
144
82
  };
145
83
 
84
+ const dirname = path.dirname(fileURLToPath(import.meta.url));
146
85
  const run$1 = async (options) => {
147
- const { workspace } = Locals.impl();
148
- const { packageDir, packageOptions } = options;
149
- if (workspace && packageOptions?.scripts?.['build:types']) {
150
- await Shell.spawn(`npm`, ['run', 'build:types'], {
151
- cwd: packageDir
152
- });
153
- return;
86
+ const { workspace } = Locals.impl();
87
+ const { packageDir, packageFolderName, packageOptions, commandOptions } = options;
88
+ const done = () => {
89
+ const stats = [];
90
+ let fullpath = `${packageDir}/dist/index.d.ts`;
91
+ if (fs.existsSync(fullpath)) {
92
+ let stat = fs.statSync(fullpath);
93
+ stats.push({
94
+ file: "index.d.ts",
95
+ size: stat.size
96
+ });
154
97
  }
155
- const config = path.resolve(packageDir, `api-extractor.json`);
156
- if (fs.existsSync(config)) {
157
- const result = Extractor.invoke(ExtractorConfig.loadFileAndPrepare(config), {
158
- localBuild: true,
159
- showVerboseMessages: false
160
- });
161
- if (!result.succeeded) {
162
- Logger.error(`API Extractor completed with ${result.errorCount} errors and ${result.warningCount} warnings`);
163
- process.exitCode = 1;
98
+ return stats;
99
+ };
100
+ if (!commandOptions.dts) {
101
+ return done();
102
+ }
103
+ if (workspace && packageOptions?.scripts?.["build:types"]) {
104
+ await Shell.spawn(`npm`, ["run", "build:types"], {
105
+ cwd: packageDir
106
+ });
107
+ return done();
108
+ }
109
+ let tempDir = `${packageDir}/dist/temp`;
110
+ let rootDir = path.relative(tempDir, process.cwd());
111
+ fs.outputFileSync(`${tempDir}/tsconfig.json`, JSON.stringify({
112
+ extends: `${rootDir}/tsconfig.json`,
113
+ compilerOptions: {
114
+ declaration: true,
115
+ emitDeclarationOnly: true,
116
+ rootDir,
117
+ outDir: "."
118
+ },
119
+ include: [
120
+ path.relative(tempDir, path.resolve(packageDir, `src/*`))
121
+ ]
122
+ }, null, " "));
123
+ await Shell.spawn("tsc", ["-p", `${tempDir}/tsconfig.json`]);
124
+ const configPath = `${tempDir}/api-extractor.json`;
125
+ fs.outputFileSync(configPath, JSON.stringify({
126
+ extends: path.relative(tempDir, path.resolve(dirname, "../api-extractor.shared.json")),
127
+ mainEntryPointFilePath: `.${workspace ? "/packages/" : ""}${packageFolderName}/src/index.d.ts`,
128
+ // workspace、时以temp/packages/*/src结构,否则APIExtractor会报错
129
+ dtsRollup: {
130
+ publicTrimmedFilePath: "../index.d.ts"
131
+ }
132
+ }, null, " "));
133
+ const result = Extractor.invoke(
134
+ ExtractorConfig.loadFileAndPrepare(configPath),
135
+ {
136
+ localBuild: true,
137
+ showVerboseMessages: false,
138
+ // 去掉版本提示
139
+ messageCallback: (message) => {
140
+ if (message.messageId === "console-compiler-version-notice" || message.messageId === "console-preamble") {
141
+ message.handled = true;
164
142
  }
143
+ }
165
144
  }
166
- await fs.remove(`${packageDir}/dist/${workspace || 'src'}`);
145
+ );
146
+ if (!result.succeeded) {
147
+ Logger.error(
148
+ `API Extractor completed with ${result.errorCount} errors and ${result.warningCount} warnings`
149
+ );
150
+ process.exitCode = 1;
151
+ }
152
+ await fs.remove(`${packageDir}/dist/temp`);
153
+ return done();
167
154
  };
168
155
 
169
156
  const require$ = createRequire(process.cwd());
170
157
  class Build {
171
- packageDir;
172
- packageFolderName;
173
- packageSourceDir;
174
- packageName;
175
- packageOptions;
176
- commandOptions;
177
- constructor(packageFolderName, commandOptions) {
178
- const { workspace, packageDir, packageName, packageFolderName: packageFolderName$ } = Locals.impl();
179
- this.packageFolderName = packageFolderName || '';
180
- this.packageDir = path.resolve(packageDir, workspace ? `./${packageFolderName}` : '');
181
- this.packageSourceDir = path.resolve(packageDir, './src');
182
- this.packageName = packageFolderName === packageFolderName$
183
- ? packageName
184
- : `${packageName}-${packageFolderName}`;
185
- this.packageOptions = require$(`${this.packageDir}/package.json`);
186
- this.commandOptions = commandOptions;
158
+ packageDir;
159
+ packageFolderName;
160
+ packageSourceDir;
161
+ packageName;
162
+ packageOptions;
163
+ commandOptions;
164
+ constructor(packageFolderName, commandOptions) {
165
+ const { workspace, packageDir, packageName, packageFolderName: packageFolderName$ } = Locals.impl();
166
+ this.packageFolderName = packageFolderName || "";
167
+ this.packageDir = path.resolve(packageDir, workspace ? `./${packageFolderName}` : "");
168
+ this.packageSourceDir = path.resolve(packageDir, "./src");
169
+ this.packageName = packageFolderName === packageFolderName$ ? packageName : `${packageName}-${packageFolderName}`;
170
+ this.packageOptions = require$(`${this.packageDir}/package.json`);
171
+ this.commandOptions = commandOptions;
172
+ }
173
+ async process() {
174
+ let start = Date.now();
175
+ const { cwd, workspace } = Locals.impl();
176
+ const { packageOptions, packageName, packageDir } = this;
177
+ if (workspace && packageOptions?.scripts?.build && packageDir !== cwd) {
178
+ await Shell.spawn(`npm`, ["run", "build"], {
179
+ cwd: packageDir
180
+ });
181
+ return;
187
182
  }
188
- async process() {
189
- const { cwd, workspace } = Locals.impl();
190
- const { packageOptions, packageName, packageDir } = this;
191
- if (workspace
192
- && packageOptions?.scripts?.build
193
- && packageDir !== cwd) {
194
- await Shell.spawn(`npm`, ['run', 'build'], {
195
- cwd: packageDir
196
- });
197
- return;
198
- }
199
- const srcDir = path.resolve(packageDir, './src');
200
- let files = fs.existsSync(srcDir)
201
- ? fs
202
- .readdirSync(srcDir)
203
- .filter((i) => /^index(.*)\.(ts|js|s?css)$/.test(i))
204
- : [];
205
- if (!files.length)
206
- return;
207
- const spinner = ora(`${packageName} Build ...`);
208
- try {
209
- spinner.start();
210
- await fs.emptyDir(`${packageDir}/dist`);
211
- const styleStats = await run$2(this);
212
- const scriptStats = await run$3(this);
213
- run$1(this);
214
- spinner.stop();
215
- Logger.log(`${chalk.cyan(`${packageName}`)}: ${chalk.green('Success')}`);
216
- scriptStats.forEach((stat) => {
217
- Logger.log(`${chalk.magenta(stat.file)}: ${chalk.green(stat.format.toUpperCase())} - ${Utils.formatBytes(stat.size)}`);
218
- });
219
- styleStats.forEach((stat) => {
220
- Logger.log(`${chalk.magenta(stat.file)}: ${Utils.formatBytes(stat.size)}`);
221
- });
222
- }
223
- catch (e) {
224
- Logger.log('Error!', e);
225
- throw e;
226
- }
183
+ const srcDir = path.resolve(packageDir, "./src");
184
+ let files = fs.existsSync(srcDir) ? fs.readdirSync(srcDir).filter((i) => /^index(.*)\.(ts|js|s?css)$/.test(i)) : [];
185
+ if (!files.length)
186
+ return;
187
+ const spinner = ora(`${packageName} Build ...`);
188
+ try {
189
+ spinner.start();
190
+ await fs.emptyDir(`${packageDir}/dist`);
191
+ const scriptStats = await run$3(this);
192
+ const scriptDuration = Date.now() - start;
193
+ const styleStats = await run$2(this);
194
+ const styleDuration = Date.now() - start - scriptDuration;
195
+ const typeStats = await run$1(this);
196
+ const typeDuration = Date.now() - start - styleDuration - scriptDuration;
197
+ spinner.stop();
198
+ let message = "";
199
+ message += `${chalk.cyan(`${packageName}`)}: ${chalk.green("Success")} ${chalk.blue(`${Date.now() - start}ms`)}(`;
200
+ message += styleStats.length ? `css: ${chalk.yellow(styleDuration)}ms; ` : "";
201
+ message += scriptStats.length ? `js: ${chalk.yellow(scriptDuration)}ms${typeStats.length ? "; " : ""}` : "";
202
+ message += typeStats.length ? `dts: ${chalk.yellow(typeDuration)}ms` : "";
203
+ message += ")";
204
+ Logger.log(message);
205
+ scriptStats.concat(styleStats).concat(typeStats).forEach((stat) => {
206
+ let message$ = "";
207
+ message$ += `${chalk.magenta(stat.file)}: `;
208
+ message$ += stat.format ? `${chalk.green(stat.format.toUpperCase())} - ` : "";
209
+ message$ += `${Utils.formatBytes(stat.size)}`;
210
+ Logger.log(message$);
211
+ });
212
+ } catch (e) {
213
+ Logger.log("Error!", e);
214
+ throw e;
227
215
  }
216
+ }
228
217
  }
229
218
  const build = (options, commandOptions) => {
230
- return new Build(options, commandOptions);
219
+ return new Build(options, commandOptions);
231
220
  };
232
221
 
233
222
  const run = (options) => Utils.autoCatch(async () => {
234
- options = {
235
- scriptFormats: 'es,cjs',
236
- ...options
237
- };
238
- const locals = Locals.impl();
239
- if (typeof options.dryRun === 'undefined') {
240
- options.dryRun = process.env.NODE_ENV === 'UNIT';
241
- }
242
- const { normalizePackageFolderNames } = Locals.impl();
243
- let packageFolderName = Locals.getPackageFolderName(options.packageName || '*');
244
- let inputs = [];
245
- if (locals.workspace && packageFolderName === '*') {
246
- inputs = normalizePackageFolderNames;
247
- }
248
- else {
249
- inputs = [packageFolderName];
250
- }
251
- if (options.dryRun)
252
- return Shell.spawn(`echo ${inputs.join(' ')}`);
253
- await inputs
254
- .reduce((preProcess, packageFolderName$) => {
255
- preProcess = preProcess.then(() => build(packageFolderName$, options).process());
256
- return preProcess;
257
- }, Promise.resolve());
223
+ options = {
224
+ scriptFormats: "es,cjs",
225
+ ...options
226
+ };
227
+ const locals = Locals.impl();
228
+ if (typeof options.dryRun === "undefined") {
229
+ options.dryRun = process.env.NODE_ENV === "UNIT";
230
+ }
231
+ const { normalizePackageFolderNames } = Locals.impl();
232
+ let packageFolderName = Locals.getPackageFolderName(options.packageName || "*");
233
+ let inputs = [];
234
+ if (locals.workspace && packageFolderName === "*") {
235
+ inputs = normalizePackageFolderNames;
236
+ } else {
237
+ inputs = [packageFolderName];
238
+ }
239
+ if (options.dryRun)
240
+ return Shell.spawn(`echo ${inputs.join(" ")}`);
241
+ await inputs.reduce(
242
+ (preProcess, packageFolderName$) => {
243
+ preProcess = preProcess.then(() => build(packageFolderName$, options).process());
244
+ return preProcess;
245
+ },
246
+ Promise.resolve()
247
+ );
258
248
  }, {
259
- onError: (e) => {
260
- if (typeof e === 'number' && e === 1) {
261
- Logger.error('编译未通过');
262
- }
263
- else {
264
- Logger.error(e);
265
- }
266
- process.exit(1);
249
+ onError: (e) => {
250
+ if (typeof e === "number" && e === 1) {
251
+ Logger.error("编译未通过");
252
+ } else {
253
+ Logger.error(e);
267
254
  }
255
+ process.exit(1);
256
+ }
268
257
  });
269
258
 
270
259
  export { run };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@deot/dev-builder",
3
- "version": "1.1.2",
3
+ "version": "2.0.0",
4
4
  "main": "dist/index.es.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "module",
8
8
  "files": [
9
- "dist"
9
+ "dist",
10
+ "api-extractor.shared.json"
10
11
  ],
11
12
  "license": "MIT",
12
13
  "publishConfig": {
@@ -21,25 +22,21 @@
21
22
  }
22
23
  },
23
24
  "dependencies": {
24
- "@deot/dev-shared": "^1.1.1",
25
- "@microsoft/api-extractor": "^7.34.4",
26
- "@rollup/plugin-commonjs": "^24.1.0",
27
- "@rollup/plugin-node-resolve": "^15.0.2",
28
- "@rollup/plugin-replace": "^5.0.2",
29
- "@rollup/plugin-typescript": "^11.1.0",
25
+ "@deot/dev-shared": "^2.0.0",
26
+ "@microsoft/api-extractor": "^7.35.1",
30
27
  "autoprefixer": "^10.4.14",
31
28
  "chalk": "^5.2.0",
32
29
  "cssnano": "^5.1.15",
33
30
  "fs-extra": "^11.1.1",
34
31
  "ora": "^6.1.2",
35
- "postcss": "^8.4.21",
32
+ "postcss": "^8.4.24",
36
33
  "postcss-flexbugs-fixes": "^5.0.2",
37
34
  "postcss-import": "^15.1.0",
38
35
  "postcss-url": "^10.1.3",
39
- "rollup": "^3.20.5",
40
- "sass": "^1.60.0"
36
+ "sass": "^1.62.1",
37
+ "vite": "^4.3.9"
41
38
  },
42
39
  "devDependencies": {
43
- "typescript": "^5.0.4"
40
+ "typescript": "^5.1.3"
44
41
  }
45
42
  }