Skip to content

Commit

Permalink
Fix generate notices script (#43)
Browse files Browse the repository at this point in the history
Github actions were failing ([PR](#40)) at the generate notices step because both `chat-core` and `chat-core-aws-connect` attempt to run the script in the same `temp/` folder, and deleting/overriding over each other.

This PR updates the generate-notices.sh script to use specific temp folder (`temp-{packageName}`) when generating build and notices.

Also removed top level LICENSE file. Each packages should provide their own in their respective folder already.

TEST=manual&auto

successfully ran `npm run build` in root directory

see [commit](785a297) below where all GH actions passed with a version bump for chat-core.
  • Loading branch information
yen-tt authored Jul 12, 2024
1 parent 1f4e3ac commit e3e9736
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 10,111 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
node_modules/
coverage/
temp/
temp*/
dist/
build/
.DS_Store
Expand Down
33 changes: 0 additions & 33 deletions LICENSE

This file was deleted.

18 changes: 12 additions & 6 deletions generate-notices.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@


PACKAGE_DIR=$(pwd)
PACKAGE_NAME=$(basename "$(pwd)")
REPO_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
echo "copying package $PACKAGE_DIR to $REPO_DIR/temp"
rm -rf "$REPO_DIR/temp"
cp -r $PACKAGE_DIR "$REPO_DIR/temp"
cd "$REPO_DIR/temp" && npm i --ignore-scripts
TEMP_DIR="$REPO_DIR/temp-$PACKAGE_NAME"

echo "copying package $PACKAGE_DIR to $TEMP_DIR"
rm -rf $TEMP_DIR
# TODO: omit exclude test folders when it's moved to the root of the repo
rsync -av --exclude=node_modules --exclude=test-browser-esm --exclude=test-node-cjs "$PACKAGE_DIR/" "$TEMP_DIR/"
cd $TEMP_DIR
rm -rf node_modules
npm i --ignore-scripts
generate-license-file --input package.json --output THIRD-PARTY-NOTICES --overwrite
cp "$REPO_DIR/temp/THIRD-PARTY-NOTICES" $PACKAGE_DIR
rm -rf "$REPO_DIR/temp"
cp "$TEMP_DIR/THIRD-PARTY-NOTICES" $PACKAGE_DIR
rm -rf $TEMP_DIR
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/chat-core/THIRD-PARTY-NOTICES
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The following NPM package may be included in this product:

- cross-fetch@3.1.5
- cross-fetch@3.1.8

This package contains the following license and notice below:

Expand Down Expand Up @@ -30,7 +30,7 @@ SOFTWARE.

The following NPM package may be included in this product:

- node-fetch@2.6.7
- node-fetch@2.7.0

This package contains the following license and notice below:

Expand Down
Loading

0 comments on commit e3e9736

Please sign in to comment.