Skip to content

Commit 4e73b66

Browse files
committed
build: single ESM build with .js extensions, removed mjs dual-build
- Removed dual CJS/ESM build (lib/mjs/ directory) - Single ESM build with automatic .js extension injection via sed - Updated tsconfig.json to fix TypeScript 6.0 deprecation warnings - Removed mjs references from documentation - Version bumped to 2.9.0-beta.4
1 parent 8ebd3af commit 4e73b66

7 files changed

Lines changed: 19 additions & 27 deletions

File tree

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ $ npm install efx-forms
1313
Peer dependencies - library depends on:
1414
> react effector effector-react lodash
1515
16-
#### mjs build included
17-
1816
## Main Components
1917

2018
### Form / Field

docs-site/docs/contributing.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,17 @@ npm install
2323

2424
### Build
2525

26-
Build the library (CJS + ESM):
26+
Build the library:
2727

2828
```bash
2929
npm run build
3030
```
3131

3232
This command:
3333
1. Cleans the `lib/` directory
34-
2. Compiles TypeScript
35-
3. Runs `npmize` to create the ESM build in `lib/mjs/`
34+
2. Compiles TypeScript to ESM
35+
3. Adds `.js` extensions to relative imports for ESM compatibility
36+
4. Copies package metadata to `lib/`
3637

3738
## Running Tests
3839

docs-site/docs/installation.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,7 @@ Once installed, you can import EFX-Forms components in your React components:
4141
import { Form, Field } from 'efx-forms';
4242
```
4343

44-
## Build Variants
45-
46-
EFX-Forms ships with both CommonJS and ES Modules builds:
47-
48-
- **CommonJS**: Default import from `'efx-forms'`
49-
- **ESM**: Available in the `lib/mjs/` directory for modern bundlers
50-
51-
No additional configuration is needed - your bundler will automatically pick the appropriate build.
44+
ESM build with `.js` extensions is automatically generated for compatibility with modern bundlers.
5245

5346
## Next Steps
5447

npmize

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
shopt -s extglob
44

5-
mkdir -p lib/mjs
6-
cp -r lib/!(mjs) lib/mjs
5+
#mkdir -p lib/mjs
6+
#cp -r lib/!(mjs) lib/mjs
77

88
cp package.json lib
99
cp README.md lib
@@ -12,8 +12,8 @@ cp LICENSE lib
1212
npx json -f lib/package.json -I -e "delete this.devDependencies"
1313
npx json -f lib/package.json -I -e "delete this.scripts"
1414

15-
cat >lib/mjs/package.json <<!EOF
16-
{
17-
"type": "module"
18-
}
19-
!EOF
15+
#cat >lib/mjs/package.json <<!EOF
16+
#{
17+
# "type": "module"
18+
#}
19+
#!EOF

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"peerDependencies": {
5151
"effector": ">=23.0.0 <24.0.0",
5252
"effector-react": ">=23.0.0 <24.0.0",
53-
"lodash": "^4.17.0",
53+
"lodash": "^4.18.1",
5454
"react": ">=16.8.0 <20.0.0"
5555
}
5656
}

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
"forceConsistentCasingInFileNames": true,
99
"jsx": "react-jsx",
1010
"lib": ["es6", "dom", "es2016", "es2017", "esnext"],
11-
"moduleResolution": "node",
11+
"moduleResolution": "bundler",
1212
"noImplicitAny": false,
1313
"pretty": true,
1414
"rootDir": "src",
1515
"skipLibCheck": true,
1616
"strict": true,
1717
"outDir": "lib",
1818
"module": "esnext",
19-
"target": "es5"
19+
"target": "es2015"
2020
},
2121
"include": ["src/**/*.ts", "src/**/*.tsx"],
2222
"exclude": ["node_modules", "lib", "src/tests/**/*"]

0 commit comments

Comments
 (0)