-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: addresses issue and test for the issue succeeds #51
Merged
DaveMBush
merged 1 commit into
main
from
dmb/missing-import-key-in-packagejson-exports-for-esm-compatibility/38
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "eslint-rxjs-test", | ||
"private": true, | ||
"type": "module", | ||
"dependencies": { | ||
"@smarttools/eslint-plugin-rxjs": "link:../dist/packages/eslint-plugin-rxjs" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import eslintPluginRxjs from '@smarttools/eslint-plugin-rxjs'; | ||
|
||
console.log(eslintPluginRxjs); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"type": "module" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
# Exit on any error | ||
set -e | ||
|
||
# Get the directory where the script is located | ||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
ROOT_DIR="$SCRIPT_DIR/../.." | ||
|
||
# Define source and destination paths relative to root | ||
SRC_DIR="$ROOT_DIR/dist/packages/eslint-plugin-rxjs" | ||
DEST_DIR="$ROOT_DIR/node_modules/@smarttools/eslint-plugin-rxjs" | ||
|
||
# Check if source directory exists | ||
if [ ! -d "$SRC_DIR" ]; then | ||
echo "Error: Source directory $SRC_DIR does not exist" | ||
exit 1 | ||
fi | ||
|
||
# Create destination parent directory if it doesn't exist | ||
mkdir -p "$(dirname "$DEST_DIR")" | ||
|
||
# Remove destination directory if it exists | ||
if [ -d "$DEST_DIR" ]; then | ||
rm -rf "$DEST_DIR" | ||
fi | ||
|
||
# Copy the directory | ||
if cp -r "$SRC_DIR" "$DEST_DIR"; then | ||
echo "✓ Successfully copied $SRC_DIR to $DEST_DIR" | ||
else | ||
echo "✗ Failed to copy directory" | ||
exit 1 | ||
fi | ||
|
||
# Run the index.js file | ||
echo "Running index.js..." | ||
if node "$SCRIPT_DIR/index.js"; then | ||
echo "✓ Tests completed successfully" | ||
exit 0 | ||
else | ||
echo "✗ Tests failed" | ||
exit 1 | ||
fi | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Critical: Entry point file
index.cjs
is missingThe package configuration points to
index.cjs
for both CommonJS and ESM imports, but this file doesn't exist in the package. This will cause the package to fail in both CommonJS and ESM environments.index.cjs
in the package root🔗 Analysis chain
Verify ESM compatibility with .cjs extension
While adding the "import" condition is a step towards ESM support, pointing it to a .cjs file might cause issues in strict ESM environments. Consider:
Let's verify ESM compatibility:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 941
Script:
Length of output: 1356
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that file is created as part of the build process and is not expected here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaveMBush Understood, thank you for the clarification. I'll note this for future reviews.
✏️ Learnings added
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!