From 6f81aade06ace725657f339af68b5d03aea3732f Mon Sep 17 00:00:00 2001 From: manacy-keyvalue <112211103+manacy-keyvalue@users.noreply.github.com> Date: Fri, 1 Dec 2023 15:38:25 +0530 Subject: [PATCH] Fix: Added support for SSR, Revised license and README (#15) --- LICENSE | 2 +- README.md | 96 ++++++++++++++--------------------------------- package-lock.json | 2 +- package.json | 2 +- webpack.config.js | 31 +++++++-------- 5 files changed, 48 insertions(+), 85 deletions(-) diff --git a/LICENSE b/LICENSE index da5eede..db0ea94 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 Francisco Hodge +Copyright (c) 2023 keyvalue software systems Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 3feae35..a83d92e 100644 --- a/README.md +++ b/README.md @@ -70,11 +70,6 @@ b. Rename the style key `Chart` to `Bar` within `styles` prop. Before ```jsx - const stylesOverride = { - Chart: (ratingId) => ({...styles}), - Count: (ratingId) => ({...styles}) - }; - ({...styles}), + Count: (ratingId) => ({...styles}) + }} /> ``` After ```jsx - const stylesOverride = { - Bar: (ratingId) => ({...styles}), - Count: (ratingId) => ({...styles}) - }; - ({...styles}), + Count: (ratingId) => ({...styles}) + }} /> ``` @@ -250,14 +246,6 @@ import RatingSummary from '@keyvaluesystems/react-star-rating-summary'; function App() { - const ratings = { - 1: 100, - 2: 200, - 3: 300, - 4: 400, - 5: 500 - }; - const countColors = { 1: 'red', 2: 'yellow', @@ -266,24 +254,28 @@ function App() { 5: 'white' }; - const stylesOverride = { - Average: { color: 'purple' }, - AverageStarIcon: { - width: '20px', - height: '20px' - }, - LabelStarIcon: () => ({ - width: '15px', - height: '15px' - }), - Label: (ratingId) => ({ fontSize: '12px' }), - Count: (ratingId) => ({color: countColors[ratingId]}) - }; - return ( ({ + width: '15px', + height: '15px' + }), + Label: (ratingId) => ({ fontSize: '12px' }), + Count: (ratingId) => ({color: countColors[ratingId]}) + }} /> ); } @@ -322,39 +314,9 @@ import RatingSummary from '@keyvaluesystems/react-star-rating-summary'; function App() { - const ratings = { - 1: 100, - 2: 200, - 3: 300, - 4: 400, - 5: 500 - }; - - const countColors = { - 1: 'red', - 2: 'yellow', - 3: 'blue', - 4: 'orange', - 5: 'white' - }; - - const stylesOverride = { - Average: { color: 'purple' }, - AverageStarIcon: { - width: '20px', - height: '20px' - }, - LabelStarIcon: () => ({ - width: '15px', - height: '15px' - }), - Label: (ratingId) => ({ fontSize: '12px' }), - Count: (ratingId) => ({color: countColors[ratingId]}) - }; - return ( */g, " ")} and project contributors. + Copyright (c) ${author.replace(/ *<[^)]*> */g, ' ')} and project contributors. This source code is licensed under the ${license} license found in the LICENSE file in the root directory of this source tree. `; module.exports = { - mode: "production", + mode: 'production', devtool: 'source-map', entry: './src/index.tsx', output: { filename: 'index.js', path: path.resolve(__dirname, 'build'), - library: "MyLibrary", + library: 'React Star Rating Summary', libraryTarget: 'umd', - clean: true + clean: true, + globalObject: 'this' }, externals: { react: 'react' @@ -42,7 +43,7 @@ module.exports = { minimizer: [ new TerserPlugin({ extractComments: false }), new CssMinimizerPlugin() - ], + ] }, module: { rules: [ @@ -78,6 +79,6 @@ module.exports = { new webpack.BannerPlugin(banner) ], resolve: { - extensions: ['.ts', '.js', '.tsx', '.json', ".css", ".scss"] + extensions: ['.ts', '.js', '.tsx', '.json', '.css', '.scss'] } };