Skip to content

Commit 42ef5f4

Browse files
committed
chore(design-system): migrate build config to rslib
1 parent 113190d commit 42ef5f4

25 files changed

+1919
-1687
lines changed

apps/look-and-feel-stories-css/src/Checkbox.stories.ts

Whitespace-only changes.

client/apollo/css/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
"dist"
1515
],
1616
"scripts": {
17-
"prebuild": "rimraf dist",
18-
"build": "postcss \"src/**/*.scss\" --base src --dir dist --ext css --verbose --env production",
19-
"postbuild": "copyfiles --up 1 \"src/**/*.{scss,css}\" dist",
17+
"build": "rslib build",
2018
"stylelint": "stylelint \"src/**/*.{scss,css}\"",
2119
"stylelint:fix": "stylelint \"src/**/*.{scss,css}\" --fix"
2220
},
@@ -32,8 +30,8 @@
3230
"@axa-fr/postcss-config-design-system": "*",
3331
"@axa-fr/prettier-config-design-system": "*",
3432
"@axa-fr/stylelint-config-design-system": "*",
35-
"copyfiles": "^2.4.1",
36-
"rimraf": "^6.0.1"
33+
"@rsbuild/plugin-sass": "^1.3.1",
34+
"@rslib/core": "^0.7.1"
3735
},
3836
"repository": {
3937
"type": "git",

client/apollo/css/rslib.config.mjs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { pluginSass } from '@rsbuild/plugin-sass';
2+
import { defineConfig } from "@rslib/core";
3+
import { join } from "path";
4+
5+
export default defineConfig({
6+
plugins: [pluginSass()],
7+
lib: [
8+
{
9+
source: {
10+
entry: {
11+
index: ["./src/**"],
12+
},
13+
},
14+
output: {
15+
target: "web",
16+
distPath: {
17+
root: "dist",
18+
},
19+
copy: [
20+
{ from: '**/*.scss', context: join(__dirname, 'src') },
21+
],
22+
minify: {
23+
css: true,
24+
},
25+
sourceMap: {
26+
css: true,
27+
}
28+
},
29+
tools: {
30+
cssLoader: {
31+
url: {
32+
filter: (url) => {
33+
const filter = ['/files/', '@material-symbols/'];
34+
35+
return filter.includes(url);
36+
},
37+
}
38+
}
39+
},
40+
bundle: false,
41+
format: "esm",
42+
},
43+
],
44+
});

client/apollo/react/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@axa-fr/design-system-apollo-react",
33
"version": "0.1.0",
44
"description": "",
5+
"type": "module",
56
"main": "./dist/index.js",
67
"types": "./dist/index.d.ts",
78
"exports": {
@@ -28,8 +29,7 @@
2829
"dist"
2930
],
3031
"scripts": {
31-
"prebuild": "rimraf dist",
32-
"build": "tsc -p tsconfig.build.json",
32+
"build": "rslib build",
3333
"eslint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
3434
"eslint:fix": "eslint src --ext js,jsx,ts,tsx --fix",
3535
"prettier": "prettier \"src/**/*.!(js|jsx|ts|tsx|svg)\" --check --ignore-unknown",
@@ -73,6 +73,8 @@
7373
"@axa-fr/design-system-look-and-feel-css": "*",
7474
"@axa-fr/eslint-config-design-system": "*",
7575
"@axa-fr/prettier-config-design-system": "*",
76+
"@rsbuild/plugin-react": "^1.3.1",
77+
"@rslib/core": "^0.7.1",
7678
"@testing-library/dom": "^10.4.0",
7779
"@testing-library/jest-dom": "^6.6.3",
7880
"@testing-library/react": "^16.2.0",
@@ -82,11 +84,9 @@
8284
"@types/jest-axe": "^3.5.9",
8385
"@vitest/coverage-v8": "^3.0.7",
8486
"@vitest/ui": "^3.0.7",
85-
"copyfiles": "^2.4.1",
8687
"jest-axe": "^9.0.0",
8788
"jsdom": "^25.0.1",
8889
"react": "^19.0.0",
89-
"rimraf": "^6.0.1",
9090
"vitest": "^3.0.7"
9191
},
9292
"lint-staged": {

client/apollo/react/rslib.config.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { pluginReact } from "@rsbuild/plugin-react";
2+
import { defineConfig } from "@rslib/core";
3+
4+
export default defineConfig({
5+
plugins: [pluginReact()],
6+
lib: [
7+
{
8+
source: {
9+
tsconfigPath: "./tsconfig.build.json",
10+
entry: {
11+
index: ["./src/**", "!src/**/*.scss", "!src/**/*.test.*"],
12+
},
13+
},
14+
output: {
15+
target: "web",
16+
distPath: {
17+
root: "dist",
18+
},
19+
},
20+
redirect: {
21+
style: {
22+
extension: false,
23+
},
24+
asset: false,
25+
},
26+
bundle: false,
27+
dts: true,
28+
format: "esm",
29+
},
30+
],
31+
});

client/apollo/react/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
4040
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
4141
"types": [
42-
"vite/client",
42+
"@rslib/core/types",
4343
"@testing-library/jest-dom",
4444
"vitest/globals"
4545
] /* Specify type package names to be included without being referenced in a source file. */,

client/look-and-feel/css/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,16 @@
1717
"files"
1818
],
1919
"scripts": {
20-
"prebuild": "rimraf dist",
21-
"build": "postcss \"src/**/*.scss\" --base src --dir dist --ext css --verbose --env production",
22-
"postbuild": "copyfiles --up 1 \"src/**/*.{scss,css}\" dist",
20+
"build": "rslib build",
2321
"stylelint": "stylelint \"src/**/*.{scss,css}\"",
2422
"stylelint:fix": "stylelint \"src/**/*.{scss,css}\" --fix"
2523
},
2624
"devDependencies": {
2725
"@axa-fr/postcss-config-design-system": "*",
2826
"@axa-fr/prettier-config-design-system": "*",
2927
"@axa-fr/stylelint-config-design-system": "*",
30-
"copyfiles": "^2.4.1",
31-
"rimraf": "^6.0.1"
28+
"@rsbuild/plugin-sass": "^1.3.1",
29+
"@rslib/core": "^0.7.1"
3230
},
3331
"peerDependencies": {
3432
"@material-symbols/svg-400": ">= 0.19.0"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { pluginSass } from '@rsbuild/plugin-sass';
2+
import { defineConfig } from "@rslib/core";
3+
import { join } from "path";
4+
5+
export default defineConfig({
6+
plugins: [pluginSass()],
7+
lib: [
8+
{
9+
source: {
10+
entry: {
11+
index: ["./src/**"],
12+
},
13+
},
14+
output: {
15+
target: "web",
16+
distPath: {
17+
root: "dist",
18+
},
19+
copy: [
20+
{ from: '**/*.scss', context: join(__dirname, 'src') },
21+
],
22+
minify: {
23+
css: true,
24+
},
25+
sourceMap: {
26+
css: true,
27+
}
28+
},
29+
tools: {
30+
cssLoader: {
31+
url: {
32+
filter: (url) => {
33+
const filter = ['/files/', '@material-symbols/'];
34+
35+
return filter.includes(url);
36+
},
37+
}
38+
}
39+
},
40+
bundle: false,
41+
format: "esm",
42+
},
43+
],
44+
});

client/look-and-feel/react/package.json

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "@axa-fr/design-system-look-and-feel-react",
33
"version": "0.1.0",
44
"description": "",
5+
"type": "module",
56
"main": "./dist/index.js",
67
"types": "./dist/index.d.ts",
78
"exports": {
@@ -28,9 +29,7 @@
2829
"dist"
2930
],
3031
"scripts": {
31-
"prebuild": "rimraf dist",
32-
"build": "tsc -p tsconfig.build.json",
33-
"postbuild": "copyfiles --up 1 \"src/assets/svg/*.svg\" ./dist/",
32+
"build": "rslib build",
3433
"eslint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
3534
"eslint:fix": "eslint src --ext js,jsx,ts,tsx --fix",
3635
"prettier": "prettier \"src/**/*.!(js|jsx|ts|tsx|svg)\" --check --ignore-unknow",
@@ -69,10 +68,12 @@
6968
"dompurify": "^3.1.5"
7069
},
7170
"devDependencies": {
72-
"@axa-fr/design-system-look-and-feel-css": "*",
7371
"@axa-fr/design-system-apollo-react": "*",
72+
"@axa-fr/design-system-look-and-feel-css": "*",
7473
"@axa-fr/eslint-config-design-system": "*",
7574
"@axa-fr/prettier-config-design-system": "*",
75+
"@rsbuild/plugin-react": "^1.3.1",
76+
"@rslib/core": "^0.7.1",
7677
"@testing-library/dom": "^10.4.0",
7778
"@testing-library/jest-dom": "^6.6.3",
7879
"@testing-library/react": "^16.2.0",
@@ -82,11 +83,9 @@
8283
"@types/jest-axe": "^3.5.9",
8384
"@vitest/coverage-v8": "^3.0.7",
8485
"@vitest/ui": "^3.0.7",
85-
"copyfiles": "^2.4.1",
8686
"jest-axe": "^9.0.0",
8787
"jsdom": "^25.0.1",
8888
"react": "^19.0.0",
89-
"rimraf": "^6.0.1",
9089
"vitest": "^3.0.7"
9190
},
9291
"lint-staged": {
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { pluginReact } from "@rsbuild/plugin-react";
2+
import { defineConfig } from "@rslib/core";
3+
4+
export default defineConfig({
5+
plugins: [pluginReact()],
6+
lib: [
7+
{
8+
source: {
9+
tsconfigPath: "./tsconfig.build.json",
10+
entry: {
11+
index: ["./src/**", "!src/**/*.scss", "!src/**/*.test.*"],
12+
},
13+
},
14+
output: {
15+
target: "web",
16+
distPath: {
17+
root: "dist",
18+
},
19+
},
20+
redirect: {
21+
style: {
22+
extension: false,
23+
},
24+
},
25+
bundle: false,
26+
dts: true,
27+
format: "esm",
28+
},
29+
],
30+
});

client/look-and-feel/react/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
4141
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
4242
"types": [
43-
"vite/client",
43+
"@rslib/core/types",
4444
"@testing-library/jest-dom",
4545
"vitest/globals"
4646
] /* Specify type package names to be included without being referenced in a source file. */,

0 commit comments

Comments
 (0)