@rslib/core 0.20.1 → 0.20.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.
@@ -64,14 +64,29 @@ interface LogType {
64
64
  level: LogLevel;
65
65
  color?: ColorFn;
66
66
  }
67
- type LogFunction = (message?: LogMessage, ...args: any[]) => void;
67
+ type LogFunction = (message?: LogMessage, ...args: unknown[]) => void;
68
68
  interface Options {
69
+ /**
70
+ * Controls which log levels are emitted.
71
+ * @default 'info'
72
+ */
69
73
  level?: LogLevel;
74
+ /**
75
+ * Prepends a fixed prefix to every log message.
76
+ * @default undefined
77
+ */
78
+ prefix?: string;
79
+ /**
80
+ * Overrides the console used by this logger instance.
81
+ * @default globalThis.console
82
+ */
83
+ console?: Pick<Console, 'log' | 'warn' | 'error'>;
70
84
  }
71
85
  type LogMethods = keyof typeof LOG_TYPES;
72
86
  type Logger = Record<LogMethods, LogFunction> & {
73
87
  greet: (message: string) => void;
74
88
  level: LogLevel;
89
+ readonly options: Options;
75
90
  override: (customLogger: Partial<Record<LogMethods, LogFunction>>) => void;
76
91
  };
77
92
 
@@ -1 +1 @@
1
- {"name":"rslog","version":"2.0.1","license":"MIT","types":"index.d.ts","type":"module"}
1
+ {"name":"rslog","version":"2.1.1","license":"MIT","types":"index.d.ts","type":"module"}
package/dist/chokidar.js CHANGED
@@ -2,9 +2,10 @@
2
2
  import { EventEmitter } from "node:events";
3
3
  import { stat as external_node_fs_stat, unwatchFile, watch, watchFile } from "node:fs";
4
4
  import { lstat, open as promises_open, readdir, realpath as promises_realpath, stat as promises_stat } from "node:fs/promises";
5
- import { basename as external_node_path_basename, dirname as external_node_path_dirname, extname, isAbsolute, join, normalize, relative as external_node_path_relative, resolve as external_node_path_resolve, sep } from "node:path";
5
+ import { join, relative as external_node_path_relative, resolve as external_node_path_resolve, sep } from "node:path";
6
6
  import { Readable } from "node:stream";
7
7
  import { type as external_node_os_type } from "node:os";
8
+ import * as __rspack_external_node_path_c5b9b54f from "node:path";
8
9
  const EntryTypes = {
9
10
  FILE_TYPE: 'files',
10
11
  DIR_TYPE: 'directories',
@@ -530,7 +531,7 @@ const binaryExtensions = new Set([
530
531
  'zip',
531
532
  'zipx'
532
533
  ]);
533
- const isBinaryPath = (filePath)=>binaryExtensions.has(extname(filePath).slice(1).toLowerCase());
534
+ const isBinaryPath = (filePath)=>binaryExtensions.has(__rspack_external_node_path_c5b9b54f.extname(filePath).slice(1).toLowerCase());
534
535
  const foreach = (val, fn)=>{
535
536
  if (val instanceof Set) val.forEach(fn);
536
537
  else fn(val);
@@ -560,7 +561,7 @@ function createFsWatchInstance(path, options, listener, errHandler, emitRaw) {
560
561
  emitRaw(rawEvent, evPath, {
561
562
  watchedPath: path
562
563
  });
563
- if (evPath && path !== evPath) fsWatchBroadcast(external_node_path_resolve(path, evPath), KEY_LISTENERS, join(path, evPath));
564
+ if (evPath && path !== evPath) fsWatchBroadcast(__rspack_external_node_path_c5b9b54f.resolve(path, evPath), KEY_LISTENERS, __rspack_external_node_path_c5b9b54f.join(path, evPath));
564
565
  };
565
566
  try {
566
567
  return watch(path, {
@@ -675,11 +676,11 @@ class NodeFsHandler {
675
676
  }
676
677
  _watchWithNodeFs(path, listener) {
677
678
  const opts = this.fsw.options;
678
- const directory = external_node_path_dirname(path);
679
- const basename = external_node_path_basename(path);
679
+ const directory = __rspack_external_node_path_c5b9b54f.dirname(path);
680
+ const basename = __rspack_external_node_path_c5b9b54f.basename(path);
680
681
  const parent = this.fsw._getWatchedDir(directory);
681
682
  parent.add(basename);
682
- const absolutePath = external_node_path_resolve(path);
683
+ const absolutePath = __rspack_external_node_path_c5b9b54f.resolve(path);
683
684
  const options = {
684
685
  persistent: opts.persistent
685
686
  };
@@ -701,8 +702,8 @@ class NodeFsHandler {
701
702
  }
702
703
  _handleFile(file, stats, initialAdd) {
703
704
  if (this.fsw.closed) return;
704
- const dirname = external_node_path_dirname(file);
705
- const basename = external_node_path_basename(file);
705
+ const dirname = __rspack_external_node_path_c5b9b54f.dirname(file);
706
+ const basename = __rspack_external_node_path_c5b9b54f.basename(file);
706
707
  const parent = this.fsw._getWatchedDir(dirname);
707
708
  let prevStats = stats;
708
709
  if (parent.has(basename)) return;
@@ -769,7 +770,7 @@ class NodeFsHandler {
769
770
  this.fsw._symlinkPaths.set(full, true);
770
771
  }
771
772
  _handleRead(directory, initialAdd, wh, target, dir, depth, throttler) {
772
- directory = join(directory, '');
773
+ directory = __rspack_external_node_path_c5b9b54f.join(directory, '');
773
774
  const throttleKey = target ? `${directory}:${target}` : directory;
774
775
  throttler = this.fsw._throttle('readdir', throttleKey, 1000);
775
776
  if (!throttler) return;
@@ -786,7 +787,7 @@ class NodeFsHandler {
786
787
  return;
787
788
  }
788
789
  const item = entry.path;
789
- let path = join(directory, item);
790
+ let path = __rspack_external_node_path_c5b9b54f.join(directory, item);
790
791
  current.add(item);
791
792
  if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path, item)) return;
792
793
  if (this.fsw.closed) {
@@ -795,7 +796,7 @@ class NodeFsHandler {
795
796
  }
796
797
  if (item === target || !target && !previous.has(item)) {
797
798
  this.fsw._incrReadyCount();
798
- path = join(dir, external_node_path_relative(dir, path));
799
+ path = __rspack_external_node_path_c5b9b54f.join(dir, __rspack_external_node_path_c5b9b54f.relative(dir, path));
799
800
  this._addToNodeFs(path, initialAdd, wh, depth + 1);
800
801
  }
801
802
  }).on(EV.ERROR, this._boundHandleError);
@@ -817,10 +818,10 @@ class NodeFsHandler {
817
818
  });
818
819
  }
819
820
  async _handleDir(dir, stats, initialAdd, depth, target, wh, realpath) {
820
- const parentDir = this.fsw._getWatchedDir(external_node_path_dirname(dir));
821
- const tracked = parentDir.has(external_node_path_basename(dir));
821
+ const parentDir = this.fsw._getWatchedDir(__rspack_external_node_path_c5b9b54f.dirname(dir));
822
+ const tracked = parentDir.has(__rspack_external_node_path_c5b9b54f.basename(dir));
822
823
  if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) this.fsw._emit(EV.ADD_DIR, dir, stats);
823
- parentDir.add(external_node_path_basename(dir));
824
+ parentDir.add(__rspack_external_node_path_c5b9b54f.basename(dir));
824
825
  this.fsw._getWatchedDir(dir);
825
826
  let throttler;
826
827
  let closer;
@@ -858,7 +859,7 @@ class NodeFsHandler {
858
859
  const follow = this.fsw.options.followSymlinks;
859
860
  let closer;
860
861
  if (stats.isDirectory()) {
861
- const absPath = external_node_path_resolve(path);
862
+ const absPath = __rspack_external_node_path_c5b9b54f.resolve(path);
862
863
  const targetPath = follow ? await promises_realpath(path) : path;
863
864
  if (this.fsw.closed) return;
864
865
  closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
@@ -867,12 +868,12 @@ class NodeFsHandler {
867
868
  } else if (stats.isSymbolicLink()) {
868
869
  const targetPath = follow ? await promises_realpath(path) : path;
869
870
  if (this.fsw.closed) return;
870
- const parent = external_node_path_dirname(wh.watchPath);
871
+ const parent = __rspack_external_node_path_c5b9b54f.dirname(wh.watchPath);
871
872
  this.fsw._getWatchedDir(parent).add(wh.watchPath);
872
873
  this.fsw._emit(EV.ADD, wh.watchPath, stats);
873
874
  closer = await this._handleDir(parent, stats, initialAdd, depth, path, wh, targetPath);
874
875
  if (this.fsw.closed) return;
875
- if (void 0 !== targetPath) this.fsw._symlinkPaths.set(external_node_path_resolve(path), targetPath);
876
+ if (void 0 !== targetPath) this.fsw._symlinkPaths.set(__rspack_external_node_path_c5b9b54f.resolve(path), targetPath);
876
877
  } else closer = this._handleFile(wh.watchPath, stats, initialAdd);
877
878
  ready();
878
879
  if (closer) this.fsw._addPathCloser(path, closer);
@@ -907,9 +908,9 @@ function createPattern(matcher) {
907
908
  if ('object' == typeof matcher && null !== matcher) return (string)=>{
908
909
  if (matcher.path === string) return true;
909
910
  if (matcher.recursive) {
910
- const relative = external_node_path_relative(matcher.path, string);
911
+ const relative = __rspack_external_node_path_c5b9b54f.relative(matcher.path, string);
911
912
  if (!relative) return false;
912
- return !relative.startsWith('..') && !isAbsolute(relative);
913
+ return !relative.startsWith('..') && !__rspack_external_node_path_c5b9b54f.isAbsolute(relative);
913
914
  }
914
915
  return false;
915
916
  };
@@ -917,7 +918,7 @@ function createPattern(matcher) {
917
918
  }
918
919
  function normalizePath(path) {
919
920
  if ('string' != typeof path) throw new Error('string expected');
920
- path = normalize(path);
921
+ path = __rspack_external_node_path_c5b9b54f.normalize(path);
921
922
  path = path.replace(/\\/g, '/');
922
923
  let prepend = false;
923
924
  if (path.startsWith('//')) prepend = true;
@@ -953,14 +954,14 @@ const toUnix = (string)=>{
953
954
  if (prepend) str = SLASH + str;
954
955
  return str;
955
956
  };
956
- const normalizePathToUnix = (path)=>toUnix(normalize(toUnix(path)));
957
+ const normalizePathToUnix = (path)=>toUnix(__rspack_external_node_path_c5b9b54f.normalize(toUnix(path)));
957
958
  const normalizeIgnored = (cwd = '')=>(path)=>{
958
- if ('string' == typeof path) return normalizePathToUnix(isAbsolute(path) ? path : join(cwd, path));
959
+ if ('string' == typeof path) return normalizePathToUnix(__rspack_external_node_path_c5b9b54f.isAbsolute(path) ? path : __rspack_external_node_path_c5b9b54f.join(cwd, path));
959
960
  return path;
960
961
  };
961
962
  const getAbsolutePath = (path, cwd)=>{
962
- if (isAbsolute(path)) return path;
963
- return join(cwd, path);
963
+ if (__rspack_external_node_path_c5b9b54f.isAbsolute(path)) return path;
964
+ return __rspack_external_node_path_c5b9b54f.join(cwd, path);
964
965
  };
965
966
  const EMPTY_SET = Object.freeze(new Set());
966
967
  class DirEntry {
@@ -986,7 +987,7 @@ class DirEntry {
986
987
  try {
987
988
  await readdir(dir);
988
989
  } catch (err) {
989
- if (this._removeWatcher) this._removeWatcher(external_node_path_dirname(dir), external_node_path_basename(dir));
990
+ if (this._removeWatcher) this._removeWatcher(__rspack_external_node_path_c5b9b54f.dirname(dir), __rspack_external_node_path_c5b9b54f.basename(dir));
990
991
  }
991
992
  }
992
993
  has(item) {
@@ -1024,7 +1025,7 @@ class WatchHelper {
1024
1025
  const watchPath = path;
1025
1026
  this.path = path = path.replace(REPLACER_RE, '');
1026
1027
  this.watchPath = watchPath;
1027
- this.fullWatchPath = external_node_path_resolve(watchPath);
1028
+ this.fullWatchPath = __rspack_external_node_path_c5b9b54f.resolve(watchPath);
1028
1029
  this.dirParts = [];
1029
1030
  this.dirParts.forEach((parts)=>{
1030
1031
  if (parts.length > 1) parts.pop();
@@ -1033,7 +1034,7 @@ class WatchHelper {
1033
1034
  this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
1034
1035
  }
1035
1036
  entryPath(entry) {
1036
- return join(this.watchPath, external_node_path_relative(this.watchPath, entry.fullPath));
1037
+ return __rspack_external_node_path_c5b9b54f.join(this.watchPath, __rspack_external_node_path_c5b9b54f.relative(this.watchPath, entry.fullPath));
1037
1038
  }
1038
1039
  filterPath(entry) {
1039
1040
  const { stats } = entry;
@@ -1158,7 +1159,7 @@ class FSWatcher extends EventEmitter {
1158
1159
  })).then((results)=>{
1159
1160
  if (this.closed) return;
1160
1161
  results.forEach((item)=>{
1161
- if (item) this.add(external_node_path_dirname(item), external_node_path_basename(_origAdd || item));
1162
+ if (item) this.add(__rspack_external_node_path_c5b9b54f.dirname(item), __rspack_external_node_path_c5b9b54f.basename(_origAdd || item));
1162
1163
  });
1163
1164
  });
1164
1165
  return this;
@@ -1168,9 +1169,9 @@ class FSWatcher extends EventEmitter {
1168
1169
  const paths = unifyPaths(paths_);
1169
1170
  const { cwd } = this.options;
1170
1171
  paths.forEach((path)=>{
1171
- if (!isAbsolute(path) && !this._closers.has(path)) {
1172
- if (cwd) path = join(cwd, path);
1173
- path = external_node_path_resolve(path);
1172
+ if (!__rspack_external_node_path_c5b9b54f.isAbsolute(path) && !this._closers.has(path)) {
1173
+ if (cwd) path = __rspack_external_node_path_c5b9b54f.join(cwd, path);
1174
+ path = __rspack_external_node_path_c5b9b54f.resolve(path);
1174
1175
  }
1175
1176
  this._closePath(path);
1176
1177
  this._addIgnoredPath(path);
@@ -1207,7 +1208,7 @@ class FSWatcher extends EventEmitter {
1207
1208
  getWatched() {
1208
1209
  const watchList = {};
1209
1210
  this._watched.forEach((entry, dir)=>{
1210
- const key = this.options.cwd ? external_node_path_relative(this.options.cwd, dir) : dir;
1211
+ const key = this.options.cwd ? __rspack_external_node_path_c5b9b54f.relative(this.options.cwd, dir) : dir;
1211
1212
  const index = key || ONE_DOT;
1212
1213
  watchList[index] = entry.getChildren().sort();
1213
1214
  });
@@ -1220,8 +1221,8 @@ class FSWatcher extends EventEmitter {
1220
1221
  async _emit(event, path, stats) {
1221
1222
  if (this.closed) return;
1222
1223
  const opts = this.options;
1223
- if (isWindows) path = normalize(path);
1224
- if (opts.cwd) path = external_node_path_relative(opts.cwd, path);
1224
+ if (isWindows) path = __rspack_external_node_path_c5b9b54f.normalize(path);
1225
+ if (opts.cwd) path = __rspack_external_node_path_c5b9b54f.relative(opts.cwd, path);
1225
1226
  const args = [
1226
1227
  path
1227
1228
  ];
@@ -1272,7 +1273,7 @@ class FSWatcher extends EventEmitter {
1272
1273
  if (isThrottled) return this;
1273
1274
  }
1274
1275
  if (opts.alwaysStat && void 0 === stats && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
1275
- const fullPath = opts.cwd ? join(opts.cwd, path) : path;
1276
+ const fullPath = opts.cwd ? __rspack_external_node_path_c5b9b54f.join(opts.cwd, path) : path;
1276
1277
  let stats;
1277
1278
  try {
1278
1279
  stats = await promises_stat(fullPath);
@@ -1324,7 +1325,7 @@ class FSWatcher extends EventEmitter {
1324
1325
  const pollInterval = awf.pollInterval;
1325
1326
  let timeoutHandler;
1326
1327
  let fullPath = path;
1327
- if (this.options.cwd && !isAbsolute(path)) fullPath = join(this.options.cwd, path);
1328
+ if (this.options.cwd && !__rspack_external_node_path_c5b9b54f.isAbsolute(path)) fullPath = __rspack_external_node_path_c5b9b54f.join(this.options.cwd, path);
1328
1329
  const now = new Date();
1329
1330
  const writes = this._pendingWrites;
1330
1331
  function awaitWriteFinishFn(prevStat) {
@@ -1379,7 +1380,7 @@ class FSWatcher extends EventEmitter {
1379
1380
  return new WatchHelper(path, this.options.followSymlinks, this);
1380
1381
  }
1381
1382
  _getWatchedDir(directory) {
1382
- const dir = external_node_path_resolve(directory);
1383
+ const dir = __rspack_external_node_path_c5b9b54f.resolve(directory);
1383
1384
  if (!this._watched.has(dir)) this._watched.set(dir, new DirEntry(dir, this._boundRemove));
1384
1385
  return this._watched.get(dir);
1385
1386
  }
@@ -1388,8 +1389,8 @@ class FSWatcher extends EventEmitter {
1388
1389
  return Boolean(256 & Number(stats.mode));
1389
1390
  }
1390
1391
  _remove(directory, item, isDirectory) {
1391
- const path = join(directory, item);
1392
- const fullPath = external_node_path_resolve(path);
1392
+ const path = __rspack_external_node_path_c5b9b54f.join(directory, item);
1393
+ const fullPath = __rspack_external_node_path_c5b9b54f.resolve(path);
1393
1394
  isDirectory = null != isDirectory ? isDirectory : this._watched.has(path) || this._watched.has(fullPath);
1394
1395
  if (!this._throttle('remove', path, 100)) return;
1395
1396
  if (!isDirectory && 1 === this._watched.size) this.add(directory, item, true);
@@ -1401,7 +1402,7 @@ class FSWatcher extends EventEmitter {
1401
1402
  parent.remove(item);
1402
1403
  if (this._symlinkPaths.has(fullPath)) this._symlinkPaths.delete(fullPath);
1403
1404
  let relPath = path;
1404
- if (this.options.cwd) relPath = external_node_path_relative(this.options.cwd, path);
1405
+ if (this.options.cwd) relPath = __rspack_external_node_path_c5b9b54f.relative(this.options.cwd, path);
1405
1406
  if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
1406
1407
  const event = this._pendingWrites.get(relPath).cancelWait();
1407
1408
  if (event === EVENTS.ADD) return;
@@ -1414,8 +1415,8 @@ class FSWatcher extends EventEmitter {
1414
1415
  }
1415
1416
  _closePath(path) {
1416
1417
  this._closeFile(path);
1417
- const dir = external_node_path_dirname(path);
1418
- this._getWatchedDir(dir).remove(external_node_path_basename(path));
1418
+ const dir = __rspack_external_node_path_c5b9b54f.dirname(path);
1419
+ this._getWatchedDir(dir).remove(__rspack_external_node_path_c5b9b54f.basename(path));
1419
1420
  }
1420
1421
  _closeFile(path) {
1421
1422
  const closers = this._closers.get(path);
package/dist/index.js CHANGED
@@ -230,12 +230,13 @@ const normalizeErrorMessage = (err)=>{
230
230
  return err.message;
231
231
  };
232
232
  let createLogger = (options = {})=>{
233
- let maxLevel = options.level || 'info';
233
+ const { level = 'info', prefix, console: console1 = globalThis.console } = options;
234
+ let maxLevel = level;
234
235
  let log = (type, message, ...args)=>{
235
236
  let logType = LOG_TYPES[type];
236
237
  const { level } = logType;
237
238
  if (LOG_LEVEL[level] > LOG_LEVEL[maxLevel]) return;
238
- if (null == message) return console.log();
239
+ if (null == message) return console1.log();
239
240
  let label = '';
240
241
  let text = '';
241
242
  if ('label' in logType) {
@@ -253,8 +254,9 @@ let createLogger = (options = {})=>{
253
254
  let lines = message.split('\n');
254
255
  text = lines.map((line)=>isErrorStackMessage(line) ? color.gray(line) : line).join('\n');
255
256
  } else text = `${message}`;
257
+ if (prefix) text = `${prefix} ${text}`;
256
258
  const method = 'error' === level || 'warn' === level ? level : 'log';
257
- console[method](label.length ? `${label} ${text}` : text, ...args);
259
+ console1[method](label.length ? `${label} ${text}` : text, ...args);
258
260
  };
259
261
  let logger = {
260
262
  greet: (message)=>log('log', gradient(message))
@@ -268,6 +270,11 @@ let createLogger = (options = {})=>{
268
270
  maxLevel = val;
269
271
  }
270
272
  });
273
+ Object.defineProperty(logger, 'options', {
274
+ get: ()=>({
275
+ ...options
276
+ })
277
+ });
271
278
  logger.override = (customLogger)=>{
272
279
  Object.assign(logger, customLogger);
273
280
  };
@@ -931,7 +938,7 @@ const readPackageJson = (rootPath)=>{
931
938
  if (!node_fs.existsSync(pkgJsonPath)) return void src_logger.warn(`The \`package.json\` file does not exist in the ${rootPath} directory`);
932
939
  try {
933
940
  return JSON.parse(node_fs.readFileSync(pkgJsonPath, 'utf8'));
934
- } catch (_err) {
941
+ } catch {
935
942
  src_logger.warn(`Failed to parse ${pkgJsonPath}, it might not be valid JSON`);
936
943
  return;
937
944
  }
@@ -1001,14 +1008,14 @@ const setNodeEnv = (env)=>{
1001
1008
  };
1002
1009
  function getWatchFilesForRestart(rslib) {
1003
1010
  const meta = rslib.getRslibConfig()._privateMeta;
1004
- if (!meta) return;
1011
+ if (!meta) return [];
1005
1012
  return [
1006
1013
  meta.configFilePath,
1007
1014
  ...meta.envFilePaths || []
1008
1015
  ].filter(Boolean);
1009
1016
  }
1010
1017
  async function watchFilesForRestart(files, restart) {
1011
- if (!files || !files.length) return;
1018
+ if (!files.length) return;
1012
1019
  const { default: chokidar } = await import("./chokidar.js");
1013
1020
  const watcher = chokidar.watch(files, {
1014
1021
  ignoreInitial: true,
@@ -2966,7 +2973,7 @@ const composeBundlelessExternalConfig = (jsExtension, redirect, cssModulesAuto,
2966
2973
  path: void 0,
2967
2974
  isResolved: true
2968
2975
  };
2969
- } catch (_e) {
2976
+ } catch {
2970
2977
  src_logger.debug(`Failed to resolve module ${color.green(`"${request}"`)} from ${color.green(issuer)}. If it's an npm package, consider adding it to dependencies or peerDependencies in package.json to make it externalized.`);
2971
2978
  return {
2972
2979
  path: request,
@@ -3529,7 +3536,7 @@ const applyCommonOptions = (cli)=>{
3529
3536
  };
3530
3537
  function setupCommands() {
3531
3538
  const cli = cac('rslib');
3532
- cli.version("0.20.1");
3539
+ cli.version("0.20.2");
3533
3540
  applyCommonOptions(cli);
3534
3541
  const buildDescription = `build the library for production ${color.dim('(default if no command is given)')}`;
3535
3542
  const buildCommand = cli.command('', buildDescription).alias('build');
@@ -3616,7 +3623,7 @@ function setupCommands() {
3616
3623
  }
3617
3624
  function initNodeEnv() {
3618
3625
  if (!process.env.NODE_ENV) {
3619
- const command = process.argv[2] ?? '';
3626
+ const command = process.argv[2] ?? 'build';
3620
3627
  process.env.NODE_ENV = [
3621
3628
  'build',
3622
3629
  'inspect'
@@ -3629,7 +3636,7 @@ function showGreeting() {
3629
3636
  const isBun = npm_execpath?.includes('.bun');
3630
3637
  const isNodeRun = Boolean(NODE_RUN_SCRIPT_NAME);
3631
3638
  const prefix = isNpx || isBun || isNodeRun ? '\n' : '';
3632
- src_logger.greet(`${prefix}Rslib v0.20.1\n`);
3639
+ src_logger.greet(`${prefix}Rslib v0.20.2\n`);
3633
3640
  }
3634
3641
  function setupLogLevel() {
3635
3642
  const logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
@@ -3683,6 +3690,6 @@ function mergeRslibConfig(...originalConfigs) {
3683
3690
  if (void 0 !== mergedLib) mergedConfig.lib = mergedLib;
3684
3691
  return mergedConfig;
3685
3692
  }
3686
- const src_version = "0.20.1";
3693
+ const src_version = "0.20.2";
3687
3694
  var rspack_0 = __rspack_external__rsbuild_core_1b356efc.rspack;
3688
3695
  export { __rspack_external__rsbuild_core_1b356efc as rsbuild, createRslib, loadConfig_defineConfig as defineConfig, loadConfig_loadConfig as loadConfig, loadEnv, mergeRslibConfig, rspack_0 as rspack, runCLI, src_version as version };
@@ -1,8 +1,8 @@
1
- import { __webpack_require__ } from "./rslib-runtime.js";
2
1
  import fs_0, * as __rspack_external_fs from "fs";
3
2
  import path_0, { basename, dirname, normalize, posix, relative as external_path_relative, resolve, sep } from "path";
4
3
  import { fileURLToPath } from "url";
5
4
  import { createRequire } from "module";
5
+ import { __webpack_require__ } from "./rslib-runtime.js";
6
6
  __webpack_require__.add({
7
7
  "../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/index.js" (module, __unused_rspack_exports, __webpack_require__) {
8
8
  const pico = __webpack_require__("../../node_modules/.pnpm/picomatch@4.0.3/node_modules/picomatch/lib/picomatch.js");
@@ -1,6 +1,6 @@
1
1
  import type { RslibInstance } from './types';
2
- export declare function getWatchFilesForRestart(rslib: RslibInstance): string[] | undefined;
3
- export declare function watchFilesForRestart(files: string[] | undefined, restart: () => Promise<void>): Promise<void>;
2
+ export declare function getWatchFilesForRestart(rslib: RslibInstance): string[];
3
+ export declare function watchFilesForRestart(files: string[], restart: () => Promise<void>): Promise<void>;
4
4
  type Cleaner = () => Promise<unknown> | unknown;
5
5
  /**
6
6
  * Add a cleaner to handle side effects
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslib/core",
3
- "version": "0.20.1",
3
+ "version": "0.20.2",
4
4
  "description": "The Rsbuild-based library development tool.",
5
5
  "homepage": "https://rslib.rs",
6
6
  "bugs": {
@@ -36,11 +36,11 @@
36
36
  "types.d.ts"
37
37
  ],
38
38
  "dependencies": {
39
- "@rsbuild/core": "2.0.0-beta.10",
40
- "rsbuild-plugin-dts": "0.20.1"
39
+ "@rsbuild/core": "2.0.0-beta.11",
40
+ "rsbuild-plugin-dts": "0.20.2"
41
41
  },
42
42
  "devDependencies": {
43
- "@module-federation/rsbuild-plugin": "^2.2.3",
43
+ "@module-federation/rsbuild-plugin": "^2.3.0",
44
44
  "@types/fs-extra": "^11.0.4",
45
45
  "cac": "^7.0.0",
46
46
  "chokidar": "^5.0.0",
@@ -49,8 +49,8 @@
49
49
  "path-serializer": "0.6.0",
50
50
  "prebundle": "1.6.4",
51
51
  "rsbuild-plugin-publint": "^0.3.4",
52
- "rslib": "npm:@rslib/core@0.20.0",
53
- "rslog": "^2.0.1",
52
+ "rslib": "npm:@rslib/core@0.20.1",
53
+ "rslog": "^2.1.1",
54
54
  "tinyglobby": "^0.2.15",
55
55
  "tsconfck": "3.1.6",
56
56
  "typescript": "^6.0.2",
@@ -76,8 +76,8 @@
76
76
  "registry": "https://registry.npmjs.org/"
77
77
  },
78
78
  "scripts": {
79
- "build": "rslib build",
80
- "dev": "rslib build --watch",
79
+ "build": "rslib",
80
+ "dev": "rslib --watch",
81
81
  "prebundle": "prebundle",
82
82
  "test": "rstest",
83
83
  "type-check": "tsc --noEmit && tsc --noEmit -p tests"