@rslib/core 0.11.0 → 0.11.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.
@@ -1,73 +1,67 @@
1
- declare type ColorFn = (input: string | number | null | undefined) => string;
2
-
3
- declare let createLogger: (options?: Options) => Logger;
4
-
5
- declare let LOG_TYPES: {
6
- error: {
7
- label: string;
8
- level: "error";
9
- color: ColorFn;
10
- };
11
- warn: {
12
- label: string;
13
- level: "warn";
14
- color: ColorFn;
15
- };
16
- info: {
17
- label: string;
18
- level: "info";
19
- color: ColorFn;
20
- };
21
- start: {
22
- label: string;
23
- level: "info";
24
- color: ColorFn;
25
- };
26
- ready: {
27
- label: string;
28
- level: "info";
29
- color: ColorFn;
30
- };
31
- success: {
32
- label: string;
33
- level: "info";
34
- color: ColorFn;
35
- };
36
- log: {
37
- level: "info";
38
- };
39
- debug: {
40
- label: string;
41
- level: "verbose";
42
- color: ColorFn;
43
- };
44
- };
45
-
46
- declare type LogFunction = (message?: LogMessage, ...args: any[]) => void;
47
-
48
- declare type Logger = Record<LogMethods, LogFunction> & {
49
- greet: (message: string) => void;
50
- level: LogLevel;
51
- override: (customLogger: Partial<Record<LogMethods, LogFunction>>) => void;
52
- };
53
-
54
- declare let logger: Logger;
55
-
56
- declare type LogLevel = 'silent' | 'error' | 'warn' | 'info' | 'log' | 'verbose';
57
-
58
- declare type LogMessage = unknown;
59
-
60
- declare type LogMethods = keyof typeof LOG_TYPES;
61
-
62
- declare interface LogType {
63
- label?: string;
64
- level: LogLevel;
65
- color?: ColorFn;
66
- }
67
-
68
- declare interface Options {
69
- level?: LogLevel;
1
+ type ColorFn = (input: string | number | null | undefined) => string;
2
+
3
+ declare let LOG_TYPES: {
4
+ error: {
5
+ label: string;
6
+ level: "error";
7
+ color: ColorFn;
8
+ };
9
+ warn: {
10
+ label: string;
11
+ level: "warn";
12
+ color: ColorFn;
13
+ };
14
+ info: {
15
+ label: string;
16
+ level: "info";
17
+ color: ColorFn;
18
+ };
19
+ start: {
20
+ label: string;
21
+ level: "info";
22
+ color: ColorFn;
23
+ };
24
+ ready: {
25
+ label: string;
26
+ level: "info";
27
+ color: ColorFn;
28
+ };
29
+ success: {
30
+ label: string;
31
+ level: "info";
32
+ color: ColorFn;
33
+ };
34
+ log: {
35
+ level: "info";
36
+ };
37
+ debug: {
38
+ label: string;
39
+ level: "verbose";
40
+ color: ColorFn;
41
+ };
42
+ };
43
+
44
+ type LogLevel = 'silent' | 'error' | 'warn' | 'info' | 'log' | 'verbose';
45
+ type LogMessage = unknown;
46
+ interface LogType {
47
+ label?: string;
48
+ level: LogLevel;
49
+ color?: ColorFn;
50
+ }
51
+ type LogFunction = (message?: LogMessage, ...args: any[]) => void;
52
+ interface Options {
53
+ level?: LogLevel;
70
54
  }
55
+ type LogMethods = keyof typeof LOG_TYPES;
56
+ type Logger = Record<LogMethods, LogFunction> & {
57
+ greet: (message: string) => void;
58
+ level: LogLevel;
59
+ override: (customLogger: Partial<Record<LogMethods, LogFunction>>) => void;
60
+ };
61
+
62
+ declare let createLogger: (options?: Options) => Logger;
63
+
64
+ declare let logger: Logger;
71
65
 
72
66
  export { createLogger, logger };
73
67
  export type { LogFunction, LogLevel, LogMessage, LogType, Logger, Options };
@@ -99,6 +99,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
99
99
  if ('TEAMCITY_VERSION' in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
100
100
  if ('truecolor' === env.COLORTERM) return 3;
101
101
  if ('xterm-kitty' === env.TERM) return 3;
102
+ if ('xterm-ghostty' === env.TERM) return 3;
102
103
  if ('TERM_PROGRAM' in env) {
103
104
  const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
104
105
  switch(env.TERM_PROGRAM){
@@ -1 +1 @@
1
- {"name":"rslog","version":"1.2.9","license":"MIT","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"rslog","version":"1.2.11","license":"MIT","types":"index.d.ts","type":"commonjs"}
package/dist/index.js CHANGED
@@ -1692,8 +1692,7 @@ const composeFormatConfig = ({ format, bundle = true, umdName, pkgJson })=>{
1692
1692
  type: 'modern-module'
1693
1693
  },
1694
1694
  chunkLoading: 'import',
1695
- workerChunkLoading: 'import',
1696
- wasmLoading: 'fetch'
1695
+ workerChunkLoading: 'import'
1697
1696
  },
1698
1697
  experiments: {
1699
1698
  outputModule: true
@@ -1722,8 +1721,7 @@ const composeFormatConfig = ({ format, bundle = true, umdName, pkgJson })=>{
1722
1721
  type: 'commonjs-static'
1723
1722
  },
1724
1723
  chunkLoading: 'require',
1725
- workerChunkLoading: 'async-node',
1726
- wasmLoading: 'async-node'
1724
+ workerChunkLoading: 'async-node'
1727
1725
  },
1728
1726
  plugins
1729
1727
  }
@@ -1764,6 +1762,15 @@ const composeFormatConfig = ({ format, bundle = true, umdName, pkgJson })=>{
1764
1762
  {
1765
1763
  if (false === bundle) throw new Error('When using "iife" format, "bundle" must be set to "true". Since the default value for "bundle" is "true", so you can either explicitly set it to "true" or remove the field entirely.');
1766
1764
  const config = {
1765
+ output: {
1766
+ minify: {
1767
+ jsOptions: {
1768
+ minimizerOptions: {
1769
+ module: true
1770
+ }
1771
+ }
1772
+ }
1773
+ },
1767
1774
  tools: {
1768
1775
  rspack: {
1769
1776
  module: {
@@ -2172,6 +2179,7 @@ const composeDtsConfig = async (libConfig, format, dtsExtension)=>{
2172
2179
  abortOnError: dts?.abortOnError,
2173
2180
  dtsExtension: dts?.autoExtension ? dtsExtension : '.d.ts',
2174
2181
  autoExternal: getAutoExternalDefaultValue(format, autoExternal),
2182
+ alias: dts?.alias,
2175
2183
  banner: banner?.dts,
2176
2184
  footer: footer?.dts,
2177
2185
  redirect: redirect?.dts
@@ -2996,7 +3004,7 @@ const applyCommonOptions = (cli)=>{
2996
3004
  function runCli() {
2997
3005
  const cli = dist('rslib');
2998
3006
  cli.help();
2999
- cli.version("0.11.0");
3007
+ cli.version("0.11.2");
3000
3008
  applyCommonOptions(cli);
3001
3009
  const buildCommand = cli.command('build', 'build the library for production');
3002
3010
  const inspectCommand = cli.command('inspect', 'inspect the Rsbuild / Rspack configs of Rslib projects');
@@ -3067,8 +3075,8 @@ function prepareCli() {
3067
3075
  initNodeEnv();
3068
3076
  const { npm_execpath } = process.env;
3069
3077
  if (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) console.log();
3070
- logger.greet(` Rslib v0.11.0\n`);
3078
+ logger.greet(` Rslib v0.11.2\n`);
3071
3079
  }
3072
- const src_version = "0.11.0";
3080
+ const src_version = "0.11.2";
3073
3081
  var __webpack_exports__rspack = __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__.rspack;
3074
3082
  export { build, defineConfig, inspect, loadConfig, logger, prepareCli, __WEBPACK_EXTERNAL_MODULE__rsbuild_core_1b356efc__ as rsbuild, runCli, startMFDevServer, composeCreateRsbuildConfig as unstable_composeCreateRsbuildConfig, src_version as version, __webpack_exports__rspack as rspack };
@@ -52,6 +52,12 @@ export type Dts = {
52
52
  * @see {@link https://rslib.rs/config/lib/dts#dtsautoextension}
53
53
  */
54
54
  autoExtension?: boolean;
55
+ /**
56
+ * Set the alias for declaration files, similar to the `compilerOptions.paths` option in `tsconfig.json`.
57
+ * @defaultValue `{}`
58
+ * @see {@link https://rslib.rs/config/lib/dts#dtsalias}
59
+ */
60
+ alias?: Record<string, string>;
55
61
  } | boolean;
56
62
  export type AutoExternal = boolean | {
57
63
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rslib/core",
3
- "version": "0.11.0",
3
+ "version": "0.11.2",
4
4
  "description": "The Rsbuild-based library development tool.",
5
5
  "homepage": "https://rslib.rs",
6
6
  "bugs": {
@@ -36,24 +36,24 @@
36
36
  "types.d.ts"
37
37
  ],
38
38
  "dependencies": {
39
- "@rsbuild/core": "~1.4.8",
39
+ "@rsbuild/core": "~1.4.14",
40
40
  "tinyglobby": "^0.2.14",
41
- "rsbuild-plugin-dts": "0.11.0"
41
+ "rsbuild-plugin-dts": "0.11.2"
42
42
  },
43
43
  "devDependencies": {
44
- "@module-federation/rsbuild-plugin": "^0.17.0",
44
+ "@module-federation/rsbuild-plugin": "^0.17.1",
45
45
  "@types/fs-extra": "^11.0.4",
46
46
  "cac": "^6.7.14",
47
47
  "chokidar": "^4.0.3",
48
48
  "fs-extra": "^11.3.0",
49
- "memfs": "^4.17.2",
49
+ "memfs": "^4.36.0",
50
50
  "picocolors": "1.1.1",
51
- "prebundle": "1.3.4",
52
- "rsbuild-plugin-publint": "^0.3.2",
53
- "rslib": "npm:@rslib/core@0.10.6",
54
- "rslog": "^1.2.9",
51
+ "prebundle": "1.4.1",
52
+ "rsbuild-plugin-publint": "^0.3.3",
53
+ "rslib": "npm:@rslib/core@0.11.1",
54
+ "rslog": "^1.2.11",
55
55
  "tsconfck": "3.1.6",
56
- "typescript": "^5.8.3",
56
+ "typescript": "^5.9.2",
57
57
  "@rslib/tsconfig": "0.0.1"
58
58
  },
59
59
  "peerDependencies": {
@@ -73,7 +73,6 @@
73
73
  },
74
74
  "publishConfig": {
75
75
  "access": "public",
76
- "provenance": true,
77
76
  "registry": "https://registry.npmjs.org/"
78
77
  },
79
78
  "scripts": {