Skip to content

Commit 33fb35f

Browse files
Fix rjsf-team#4678 by using the lodashReplacer during the shadcn package build (rjsf-team#4685)
Fixed rjsf-team#4678 by using the lodashReplacer during the shadcn package build - In `@rjsf/shadcn` fixed the esm build to use lodash-es as follows: - Copied the `tsconfig.replacer.json` from `core` - Updated the `package.json` to compile the replacer as part of the esm build - Updated the `tsconfig.build.json` to add the `lodashReplacer` to the `tsc-alias` config - Updated the `CHANGELOG.md` accordingly
1 parent b5b9551 commit 33fb35f

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ should change the heading of the (upcoming) version to include a major version b
1616
1717
-->
1818

19+
# 6.0.0-beta.12
20+
21+
## @rjsf/shadcn
22+
23+
- Updated the building of `shadcn` to use the `lodashReplacer` with `tsc-alias` fixing [#4678](https://github.com/rjsf-team/react-jsonschema-form/issues/4678)
24+
1925
# 6.0.0-beta.11
2026

2127
## @rjsf/antd

packages/shadcn/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
},
4545
"scripts": {
4646
"build:css": "tsx build-css.ts",
47-
"build:ts": "tsc -b tsconfig.build.json && tsc-alias -p tsconfig.build.json",
47+
"compileReplacer": "tsc -p tsconfig.replacer.json && move-file lodashReplacer.js lodashReplacer.cjs",
48+
"build:ts": "npm run compileReplacer && rimraf ./lib && tsc -b tsconfig.build.json && tsc-alias -p tsconfig.build.json",
4849
"build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.js --sourcemap --packages=external --format=cjs",
4950
"build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/rjsf-shadcn.esm.js --sourcemap --packages=external --format=esm",
5051
"build:umd": "rollup dist/rjsf-shadcn.esm.js --format=umd --file=dist/rjsf-shadcn.umd.js --name=@rjsf/rjsf-shadcn",

packages/shadcn/tsconfig.build.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
],
1212
"tsc-alias": {
1313
"resolveFullPaths": true,
14-
"verbose": true
14+
"verbose": true,
15+
"replacers": {
16+
"lodash": {
17+
"enabled": true,
18+
"file": "lodashReplacer.cjs"
19+
}
20+
}
1521
}
1622
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"target": "es2017",
5+
"outDir": "./",
6+
"skipLibCheck": true,
7+
},
8+
"files": [
9+
"../../tsc-alias-replacer/lodashReplacer.ts"
10+
],
11+
"exclude": [
12+
"./src",
13+
"./test"
14+
]
15+
}

0 commit comments

Comments
 (0)