@workleap/rslib-configs 1.1.3 → 1.1.4
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/CHANGELOG.md +6 -0
- package/dist/applyTransformers.js.map +1 -1
- package/dist/assertions.js.map +1 -1
- package/dist/build.js.map +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/storybook.js.map +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @workleap/rslib-configs
|
|
2
2
|
|
|
3
|
+
## 1.1.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#339](https://github.com/workleap/wl-web-configs/pull/339) [`4a85b91`](https://github.com/workleap/wl-web-configs/commit/4a85b9105a02f3fdad19beae1792a5cd096a2e47) Thanks [@patricklafrance](https://github.com/patricklafrance)! - Bumped dependency versions.
|
|
8
|
+
|
|
3
9
|
## 1.1.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyTransformers.js","sources":["
|
|
1
|
+
{"version":3,"file":"applyTransformers.js","sources":["../src/applyTransformers.ts"],"sourcesContent":["import type { RslibConfig } from \"@rslib/core\";\n\nexport interface RslibConfigTransformerContext {\n environment: \"dev\" | \"build\" | \"storybook\";\n}\n\nexport type RslibConfigTransformer = (config: RslibConfig, context: RslibConfigTransformerContext) => RslibConfig;\n\nexport function applyTransformers(config: RslibConfig, transformers: RslibConfigTransformer[], context: RslibConfigTransformerContext) {\n return transformers.reduce((acc, transformer) => transformer(acc, context), config);\n}\n"],"names":["applyTransformers","config","transformers","context","acc","transformer"],"mappings":";;AAQO,SAASA,kBAAkBC,MAAmB,EAAEC,YAAsC,EAAEC,OAAsC;IACjI,OAAOD,aAAa,MAAM,CAAC,CAACE,KAAKC,cAAgBA,YAAYD,KAAKD,UAAUF;AAChF"}
|
package/dist/assertions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assertions.js","sources":["
|
|
1
|
+
{"version":3,"file":"assertions.js","sources":["../src/assertions.ts"],"sourcesContent":["// Using \"unknown\" loses the typings.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === \"function\";\n}\n"],"names":["isFunction","value"],"mappings":";;AAAA,qCAAqC;AACrC,8DAA8D;AACvD,SAASA,WAAWC,KAAc;IACrC,OAAO,OAAOA,UAAU;AAC5B"}
|
package/dist/build.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sources":["
|
|
1
|
+
{"version":3,"file":"build.js","sources":["../src/build.ts"],"sourcesContent":["import type { DistPathConfig, RsbuildPlugins, SourceMap } from \"@rsbuild/core\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { defineConfig, type Dts, type RsbuildConfigEntry, type RsbuildConfigOutputTarget, type Syntax } from \"@rslib/core\";\nimport { applyTransformers, type RslibConfigTransformer } from \"./applyTransformers.ts\";\nimport { isFunction } from \"./assertions.ts\";\n\nexport type DefineBuildDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineBuildSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\n\nexport interface DefineBuildConfigOptions {\n entry?: RsbuildConfigEntry;\n syntax?: Syntax;\n bundle?: boolean;\n tsconfigPath?: string;\n dts?: Dts;\n target?: RsbuildConfigOutputTarget;\n distPath?: DistPathConfig;\n plugins?: RsbuildPlugins;\n sourceMap?: boolean | SourceMap;\n react?: true | DefineBuildDefineReactPluginConfigFunction;\n svgr?: true | DefineBuildSvgrPluginConfigFunction;\n transformers?: RslibConfigTransformer[];\n}\n\nexport function defineBuildConfig(options: DefineBuildConfigOptions = {}) {\n const {\n entry: entryValue,\n syntax = \"esnext\",\n bundle = false,\n tsconfigPath,\n dts = true,\n target = \"web\",\n distPath = {\n root: \"./dist\"\n },\n plugins = [],\n sourceMap = {\n js: \"source-map\",\n css: true\n },\n react = false,\n svgr = false,\n transformers = []\n } = options;\n\n if (!bundle && !tsconfigPath) {\n throw new Error(\"[rslib-configs] When the \\\"bundle\\\" option is \\\"false\\\", a \\\"tsconfigPath\\\" option must be provided. We recommend including a tsconfig.build.json file specifically for compiling the library project.\");\n }\n\n let entry = entryValue;\n\n if (!entry) {\n entry = {\n index: bundle ? [\"./src/index.ts\", \"./src/index.js\"] : \"./src/**\"\n };\n }\n\n const svgrDefaultOptions: PluginSvgrOptions = {\n svgrOptions: {\n exportType: \"named\"\n }\n };\n\n const config = defineConfig({\n mode: \"production\",\n lib: [{\n format: \"esm\",\n syntax,\n bundle,\n dts\n }],\n source: {\n entry,\n tsconfigPath\n },\n output: {\n target,\n distPath,\n cleanDistPath: true,\n minify: false,\n sourceMap\n },\n plugins: ([\n react && pluginReact(isFunction(react) ? react({}) : {}),\n svgr && pluginSvgr(isFunction(svgr) ? svgr(svgrDefaultOptions) : svgrDefaultOptions),\n ...plugins\n ] as RsbuildPlugins).filter(Boolean)\n });\n\n const transformedConfig = applyTransformers(config, transformers, {\n environment: \"build\"\n });\n\n return defineConfig(transformedConfig);\n}\n"],"names":["pluginReact","pluginSvgr","defineConfig","applyTransformers","isFunction","defineBuildConfig","options","entryValue","syntax","bundle","tsconfigPath","dts","target","distPath","plugins","sourceMap","react","svgr","transformers","Error","entry","svgrDefaultOptions","config","Boolean","transformedConfig"],"mappings":";;;;;;;;;;;;;;;;;AAC6E;AACH;AACiD;AACnC;AAC3C;AAoBtC,SAASK,kBAAkBC,UAAoC,CAAC,CAAC;IACpE,MAAM,EACF,OAAOC,UAAU,EACjBC,SAAS,QAAQ,EACjBC,SAAS,KAAK,EACdC,YAAY,EACZC,MAAM,IAAI,EACVC,SAAS,KAAK,EACdC,WAAW;QACP,MAAM;IACV,CAAC,EACDC,UAAU,EAAE,EACZC,YAAY;QACR,IAAI;QACJ,KAAK;IACT,CAAC,EACDC,QAAQ,KAAK,EACbC,OAAO,KAAK,EACZC,eAAe,EAAE,EACpB,GAAGZ;IAEJ,IAAI,CAACG,UAAU,CAACC,cAAc;QAC1B,MAAM,IAAIS,MAAM;IACpB;IAEA,IAAIC,QAAQb;IAEZ,IAAI,CAACa,OAAO;QACRA,QAAQ;YACJ,OAAOX,SAAS;gBAAC;gBAAkB;aAAiB,GAAG;QAC3D;IACJ;IAEA,MAAMY,qBAAwC;QAC1C,aAAa;YACT,YAAY;QAChB;IACJ;IAEA,MAAMC,SAASpB,YAAYA,CAAC;QACxB,MAAM;QACN,KAAK;YAAC;gBACF,QAAQ;gBACRM;gBACAC;gBACAE;YACJ;SAAE;QACF,QAAQ;YACJS;YACAV;QACJ;QACA,QAAQ;YACJE;YACAC;YACA,eAAe;YACf,QAAQ;YACRE;QACJ;QACA,SAAU;YACNC,SAAShB,WAAWA,CAACI,UAAUA,CAACY,SAASA,MAAM,CAAC,KAAK,CAAC;YACtDC,QAAQhB,UAAUA,CAACG,UAAUA,CAACa,QAAQA,KAAKI,sBAAsBA;eAC9DP;SACN,CAAoB,MAAM,CAACS;IAChC;IAEA,MAAMC,oBAAoBrB,iBAAiBA,CAACmB,QAAQJ,cAAc;QAC9D,aAAa;IACjB;IAEA,OAAOhB,YAAYA,CAACsB;AACxB"}
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.js","sources":["
|
|
1
|
+
{"version":3,"file":"dev.js","sources":["../src/dev.ts"],"sourcesContent":["import type { DistPathConfig, RsbuildPlugins, SourceMap } from \"@rsbuild/core\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { defineConfig, type Dts, type RsbuildConfigEntry, type RsbuildConfigOutputTarget, type Syntax } from \"@rslib/core\";\nimport { applyTransformers, type RslibConfigTransformer } from \"./applyTransformers.ts\";\nimport { isFunction } from \"./assertions.ts\";\n\nexport type DefineDevDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineDevSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\n\nexport interface DefineDevConfigOptions {\n entry?: RsbuildConfigEntry;\n syntax?: Syntax;\n bundle?: boolean;\n tsconfigPath?: string;\n dts?: Dts;\n target?: RsbuildConfigOutputTarget;\n distPath?: DistPathConfig;\n plugins?: RsbuildPlugins;\n sourceMap?: boolean | SourceMap;\n react?: true | DefineDevDefineReactPluginConfigFunction;\n svgr?: true | DefineDevSvgrPluginConfigFunction;\n transformers?: RslibConfigTransformer[];\n}\n\nexport function defineDevConfig(options: DefineDevConfigOptions = {}) {\n const {\n entry: entryValue,\n syntax = \"esnext\",\n bundle = false,\n tsconfigPath,\n dts = false,\n target = \"web\",\n distPath = {\n root: \"./dist\"\n },\n plugins = [],\n sourceMap = {\n js: \"cheap-module-source-map\",\n css: true\n },\n react = false,\n svgr = false,\n transformers = []\n } = options;\n\n if (!bundle && !tsconfigPath) {\n throw new Error(\"[rslib-configs] When the \\\"bundle\\\" option is \\\"false\\\", a \\\"tsconfigPath\\\" option must be provided. We recommend including a tsconfig.build.json file specifically for compiling the library project.\");\n }\n\n let entry = entryValue;\n\n if (!entry) {\n entry = {\n index: bundle ? [\"./src/index.ts\", \"./src/index.js\"] : \"./src/**\"\n };\n }\n\n const svgrDefaultOptions: PluginSvgrOptions = {\n svgrOptions: {\n exportType: \"named\"\n }\n };\n\n const config = defineConfig({\n mode: \"development\",\n lib: [{\n format: \"esm\",\n syntax,\n bundle,\n dts\n }],\n source: {\n entry,\n tsconfigPath\n },\n output: {\n target,\n distPath,\n cleanDistPath: true,\n minify: false,\n sourceMap\n },\n plugins: ([\n react && pluginReact(isFunction(react) ? react({}) : {}),\n svgr && pluginSvgr(isFunction(svgr) ? svgr(svgrDefaultOptions) : svgrDefaultOptions),\n ...plugins\n ] as RsbuildPlugins).filter(Boolean)\n });\n\n const transformedConfig = applyTransformers(config, transformers, {\n environment: \"dev\"\n });\n\n return defineConfig(transformedConfig);\n}\n"],"names":["pluginReact","pluginSvgr","defineConfig","applyTransformers","isFunction","defineDevConfig","options","entryValue","syntax","bundle","tsconfigPath","dts","target","distPath","plugins","sourceMap","react","svgr","transformers","Error","entry","svgrDefaultOptions","config","Boolean","transformedConfig"],"mappings":";;;;;;;;;;;;;;;;;AAC6E;AACH;AACiD;AACnC;AAC3C;AAoBtC,SAASK,gBAAgBC,UAAkC,CAAC,CAAC;IAChE,MAAM,EACF,OAAOC,UAAU,EACjBC,SAAS,QAAQ,EACjBC,SAAS,KAAK,EACdC,YAAY,EACZC,MAAM,KAAK,EACXC,SAAS,KAAK,EACdC,WAAW;QACP,MAAM;IACV,CAAC,EACDC,UAAU,EAAE,EACZC,YAAY;QACR,IAAI;QACJ,KAAK;IACT,CAAC,EACDC,QAAQ,KAAK,EACbC,OAAO,KAAK,EACZC,eAAe,EAAE,EACpB,GAAGZ;IAEJ,IAAI,CAACG,UAAU,CAACC,cAAc;QAC1B,MAAM,IAAIS,MAAM;IACpB;IAEA,IAAIC,QAAQb;IAEZ,IAAI,CAACa,OAAO;QACRA,QAAQ;YACJ,OAAOX,SAAS;gBAAC;gBAAkB;aAAiB,GAAG;QAC3D;IACJ;IAEA,MAAMY,qBAAwC;QAC1C,aAAa;YACT,YAAY;QAChB;IACJ;IAEA,MAAMC,SAASpB,YAAYA,CAAC;QACxB,MAAM;QACN,KAAK;YAAC;gBACF,QAAQ;gBACRM;gBACAC;gBACAE;YACJ;SAAE;QACF,QAAQ;YACJS;YACAV;QACJ;QACA,QAAQ;YACJE;YACAC;YACA,eAAe;YACf,QAAQ;YACRE;QACJ;QACA,SAAU;YACNC,SAAShB,WAAWA,CAACI,UAAUA,CAACY,SAASA,MAAM,CAAC,KAAK,CAAC;YACtDC,QAAQhB,UAAUA,CAACG,UAAUA,CAACa,QAAQA,KAAKI,sBAAsBA;eAC9DP;SACN,CAAoB,MAAM,CAACS;IAChC;IAEA,MAAMC,oBAAoBrB,iBAAiBA,CAACmB,QAAQJ,cAAc;QAC9D,aAAa;IACjB;IAEA,OAAOhB,YAAYA,CAACsB;AACxB"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["export type { RslibConfigTransformer, RslibConfigTransformerContext } from \"./applyTransformers.ts\";\nexport * from \"./build.ts\";\nexport * from \"./dev.ts\";\nexport * from \"./storybook.ts\";\n\n"],"names":[],"mappings":";;;;;AAC2B;AACF;AACM"}
|
package/dist/storybook.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook.js","sources":["
|
|
1
|
+
{"version":3,"file":"storybook.js","sources":["../src/storybook.ts"],"sourcesContent":["import type { RsbuildPlugins, SourceMap } from \"@rsbuild/core\";\nimport { pluginReact, type PluginReactOptions } from \"@rsbuild/plugin-react\";\nimport { pluginSvgr, type PluginSvgrOptions } from \"@rsbuild/plugin-svgr\";\nimport { defineConfig } from \"@rslib/core\";\nimport { applyTransformers, type RslibConfigTransformer } from \"./applyTransformers.ts\";\n\nexport type DefineStorybookDefineReactPluginConfigFunction = (defaultOptions: PluginReactOptions) => PluginReactOptions;\nexport type DefineStorybookSvgrPluginConfigFunction = (defaultOptions: PluginSvgrOptions) => PluginSvgrOptions;\n\nexport interface DefineStorybookConfigOptions {\n plugins?: RsbuildPlugins;\n sourceMap?: boolean | SourceMap;\n react?: false | DefineStorybookDefineReactPluginConfigFunction;\n svgr?: false | DefineStorybookSvgrPluginConfigFunction;\n transformers?: RslibConfigTransformer[];\n}\n\nfunction defaultDefineReactPluginConfig(options: PluginReactOptions) {\n return options;\n}\n\nfunction defineSvgrPluginConfig(options: PluginSvgrOptions) {\n return options;\n}\n\nexport function defineStorybookConfig(options: DefineStorybookConfigOptions = {}) {\n const {\n plugins = [],\n sourceMap = {\n js: \"cheap-module-source-map\",\n css: true\n },\n react = defaultDefineReactPluginConfig,\n svgr = defineSvgrPluginConfig,\n transformers = []\n } = options;\n\n const config = defineConfig({\n lib: [{\n dts: false\n }],\n output: {\n target: \"web\",\n // Setting the clean option to true breaks the Storybook integration.\n cleanDistPath: false,\n minify: false,\n sourceMap\n },\n plugins: [\n react && pluginReact(react({})),\n svgr && pluginSvgr(svgr({\n svgrOptions: {\n exportType: \"named\"\n }\n })),\n ...plugins\n ]\n });\n\n const transformedConfig = applyTransformers(config, transformers, {\n environment: \"storybook\"\n });\n\n return defineConfig(transformedConfig);\n}\n"],"names":["pluginReact","pluginSvgr","defineConfig","applyTransformers","defaultDefineReactPluginConfig","options","defineSvgrPluginConfig","defineStorybookConfig","plugins","sourceMap","react","svgr","transformers","config","transformedConfig"],"mappings":";;;;;;;;;;;;;;AAC6E;AACH;AAC/B;AAC6C;AAaxF,SAASI,+BAA+BC,OAA2B;IAC/D,OAAOA;AACX;AAEA,SAASC,uBAAuBD,OAA0B;IACtD,OAAOA;AACX;AAEO,SAASE,sBAAsBF,UAAwC,CAAC,CAAC;IAC5E,MAAM,EACFG,UAAU,EAAE,EACZC,YAAY;QACR,IAAI;QACJ,KAAK;IACT,CAAC,EACDC,QAAQN,8BAA8B,EACtCO,OAAOL,sBAAsB,EAC7BM,eAAe,EAAE,EACpB,GAAGP;IAEJ,MAAMQ,SAASX,YAAYA,CAAC;QACxB,KAAK;YAAC;gBACF,KAAK;YACT;SAAE;QACF,QAAQ;YACJ,QAAQ;YACR,qEAAqE;YACrE,eAAe;YACf,QAAQ;YACRO;QACJ;QACA,SAAS;YACLC,SAASV,WAAWA,CAACU,MAAM,CAAC;YAC5BC,QAAQV,UAAUA,CAACU,KAAK;gBACpB,aAAa;oBACT,YAAY;gBAChB;YACJ;eACGH;SACN;IACL;IAEA,MAAMM,oBAAoBX,iBAAiBA,CAACU,QAAQD,cAAc;QAC9D,aAAa;IACjB;IAEA,OAAOV,YAAYA,CAACY;AACxB"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@workleap/rslib-configs",
|
|
3
3
|
"author": "Workleap",
|
|
4
4
|
"description": "Workleap recommended Rslib configurations.",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.4",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -27,29 +27,29 @@
|
|
|
27
27
|
"CHANGELOG.md"
|
|
28
28
|
],
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@rsbuild/core": "^1.
|
|
31
|
-
"@rslib/core": "^0.
|
|
30
|
+
"@rsbuild/core": "^1.6.14",
|
|
31
|
+
"@rslib/core": "^0.18.4"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@rsbuild/plugin-react": "^1.4.
|
|
35
|
-
"@rsbuild/plugin-svgr": "^1.2.
|
|
34
|
+
"@rsbuild/plugin-react": "^1.4.2",
|
|
35
|
+
"@rsbuild/plugin-svgr": "^1.2.3"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@eslint/js": "9.
|
|
39
|
-
"@rsbuild/core": "1.
|
|
40
|
-
"@rslib/core": "0.
|
|
41
|
-
"@types/node": "
|
|
42
|
-
"@typescript-eslint/parser": "8.
|
|
43
|
-
"eslint": "9.
|
|
38
|
+
"@eslint/js": "9.39.1",
|
|
39
|
+
"@rsbuild/core": "1.6.14",
|
|
40
|
+
"@rslib/core": "0.18.4",
|
|
41
|
+
"@types/node": "25.0.0",
|
|
42
|
+
"@typescript-eslint/parser": "8.49.0",
|
|
43
|
+
"eslint": "9.39.1",
|
|
44
44
|
"typescript": "5.9.3",
|
|
45
|
-
"typescript-eslint": "8.
|
|
46
|
-
"vitest": "4.0.
|
|
47
|
-
"@workleap/eslint-configs": "
|
|
45
|
+
"typescript-eslint": "8.49.0",
|
|
46
|
+
"vitest": "4.0.15",
|
|
47
|
+
"@workleap/eslint-configs": "1.1.7",
|
|
48
48
|
"@workleap/typescript-configs": "3.0.7"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "rslib build -c rslib.config.ts",
|
|
52
|
-
"eslint": "eslint . --max-warnings
|
|
52
|
+
"eslint": "eslint . --max-warnings=0 --cache --cache-location node_modules/.cache/eslint",
|
|
53
53
|
"typecheck": "tsc",
|
|
54
54
|
"test": "vitest --config vitest.config.ts --no-watch"
|
|
55
55
|
}
|