From 69428fb54dfbbf4b215931bd63d648daca7182de Mon Sep 17 00:00:00 2001 From: Mayank Date: Sat, 8 Jun 2024 18:24:45 +0530 Subject: [PATCH 1/3] Add lite version of the library - Template users may have some other libraries that they want to provide a varient for --- .tkb | 20 +++++++++++++------- lib/README.md | 20 ++++++++++++++++++++ scripts/lite.js | 29 +++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 7 deletions(-) create mode 100644 scripts/lite.js diff --git a/.tkb b/.tkb index 3e28f617..464174cb 100644 --- a/.tkb +++ b/.tkb @@ -59,17 +59,22 @@ "T1TbmRqXHguxnJv1g_Ot6": { "id": "T1TbmRqXHguxnJv1g_Ot6", "description": "Explore GitHub codespace templates", - "columnId": "column-rHWkySHomUOsd93fyS05p" + "columnId": "column-done" }, "aCqTM5wgCQC3pY9TA7GtN": { "id": "aCqTM5wgCQC3pY9TA7GtN", "description": "Update r18-plugin to minify better - remove multiple jsx imports", - "columnId": "column-rHWkySHomUOsd93fyS05p" + "columnId": "column-done" }, "KOQ0LhYPWc6ydZDSbZMGe": { "id": "KOQ0LhYPWc6ydZDSbZMGe", "description": "Update manual workflow to craete new branch when published from a tag", - "columnId": "column-rHWkySHomUOsd93fyS05p" + "columnId": "column-done" + }, + "OUXfu0Fbgy4-8mdT_3xH8": { + "id": "OUXfu0Fbgy4-8mdT_3xH8", + "description": "Create lite version", + "columnId": "column-done" } }, "columns": [ @@ -79,10 +84,7 @@ "tasksIds": [ "5Br6CU2MKWj0R40obK9Nm", "-DCBBAzTvSWMDb8whog60", - "P92idHa6fbprwBOYEp5uu", - "T1TbmRqXHguxnJv1g_Ot6", - "aCqTM5wgCQC3pY9TA7GtN", - "KOQ0LhYPWc6ydZDSbZMGe" + "P92idHa6fbprwBOYEp5uu" ] }, { @@ -94,7 +96,11 @@ "id": "column-done", "title": "Done", "tasksIds": [ + "OUXfu0Fbgy4-8mdT_3xH8", "5FPnfgSKUpHBbORBRtgui", + "T1TbmRqXHguxnJv1g_Ot6", + "KOQ0LhYPWc6ydZDSbZMGe", + "aCqTM5wgCQC3pY9TA7GtN", "iXE3kCY0L1r_4TD-zRgVh", "rRkFSIcteEvuq6MRX2BN0", "mWXPi1Qzt9zNe6cKb8IZ3", diff --git a/lib/README.md b/lib/README.md index c772cbe5..1d5f6319 100644 --- a/lib/README.md +++ b/lib/README.md @@ -38,6 +38,26 @@ $ npm install react18-loaders $ yarn add react18-loaders ``` +## Want Lite Version? [![npm bundle size](https://img.shields.io/bundlephobia/minzip/react18-loaders-lite)](https://www.npmjs.com/package/react18-loaders-lite) [![Version](https://img.shields.io/npm/v/react18-loaders-lite.svg?colorB=green)](https://www.npmjs.com/package/react18-loaders-lite) [![Downloads](https://img.jsdelivr.com/img.shields.io/npm/dt/react18-loaders-lite.svg)](https://www.npmjs.com/package/react18-loaders-lite) + +```bash +$ pnpm add nextjs-themes-lite +``` + +**or** + +```bash +$ npm install nextjs-themes-lite +``` + +**or** + +```bash +$ yarn add nextjs-themes-lite +``` + +> You need `r18gs` as a peer-dependency + ### Import Styles You can import styles globally or within specific components. diff --git a/scripts/lite.js b/scripts/lite.js new file mode 100644 index 00000000..78f31c51 --- /dev/null +++ b/scripts/lite.js @@ -0,0 +1,29 @@ +"use strict"; + +const fs = require("node:fs"); +const path = require("node:path"); +const config = require("./rebrand.config.json"); + +const packageJson = require("../lib/package.json"); + +const ref = packageJson.name; +packageJson.peerDependencies.r18gs = `${packageJson.dependencies.r18gs.split(".")[0]}`; +delete packageJson.dependencies.r18gs; +if (Object.keys(packageJson.devDependencies).length === 0) delete packageJson.devDependencies; +packageJson.name = `${ref}-lite`; + +fs.writeFileSync( + path.resolve(__dirname, "../lib/package.json"), + JSON.stringify(packageJson, null, 2), +); + +const readMePath = path.resolve(__dirname, "../lib", "README.md"); + +let readMe = fs.readFileSync(readMePath, { encoding: "utf8" }); +const tmp = "!---"; +const { owner, repo } = config; +readMe = readMe.replace(new RegExp(`${owner}/${repo}`, "g"), tmp); +readMe = readMe.replace(new RegExp(ref, "g"), packageJson.name); +readMe = readMe.replace(new RegExp(tmp, "g"), `${owner}/${repo}`); +readMe = readMe.replace(/## Want Lite Version(.|\n|\r)*You need `r18gs` as a peer-dependency/m, ""); +fs.writeFileSync(readMePath, readMe); From 5579416795f5f49e56267e33a98486a2a6393cf5 Mon Sep 17 00:00:00 2001 From: Mayank Date: Sat, 8 Jun 2024 19:18:47 +0530 Subject: [PATCH 2/3] Updaet publish scripts --- .changeset/calm-foxes-confess.md | 5 +++++ scripts/manual-publish.js | 3 +++ scripts/publish.js | 3 +++ 3 files changed, 11 insertions(+) create mode 100644 .changeset/calm-foxes-confess.md diff --git a/.changeset/calm-foxes-confess.md b/.changeset/calm-foxes-confess.md new file mode 100644 index 00000000..7a1b3de7 --- /dev/null +++ b/.changeset/calm-foxes-confess.md @@ -0,0 +1,5 @@ +--- +"react18-loaders": patch +--- + +Publish lite version diff --git a/scripts/manual-publish.js b/scripts/manual-publish.js index 345c9806..d5095642 100644 --- a/scripts/manual-publish.js +++ b/scripts/manual-publish.js @@ -74,3 +74,6 @@ execSync(`cd lib && pnpm build && npm publish --provenance --access public --tag execSync( `gh release create ${NEW_VERSION} --generate-notes${isLatestRelease ? " --latest" : ""} -n "$(sed '1,/^## /d;/^## /,$d' CHANGELOG.md)" --title "Release v${NEW_VERSION}"`, ); + +execSync("node ./scripts/lite.js"); +execSync(`cd lib && pnpm build && npm publish --provenance --access public --tag ${tag}`); diff --git a/scripts/publish.js b/scripts/publish.js index 2048ec54..d071ae10 100644 --- a/scripts/publish.js +++ b/scripts/publish.js @@ -45,3 +45,6 @@ execSync("cd lib && pnpm build && npm publish --provenance --access public"); execSync( `gh release create ${VERSION} --generate-notes --latest -n "$(sed '1,/^## /d;/^## /,$d' CHANGELOG.md)" --title "Release v${VERSION}"`, ); + +execSync("node ./scripts/lite.js"); +execSync("cd lib && pnpm build && npm publish --provenance --access public"); From ce46ccd3b741db1e7ce3cd608e8e769a329d6487 Mon Sep 17 00:00:00 2001 From: Mayank Date: Sat, 8 Jun 2024 19:18:59 +0530 Subject: [PATCH 3/3] Apply changesets --- .changeset/calm-foxes-confess.md | 5 ----- lib/CHANGELOG.md | 6 ++++++ lib/package.json | 2 +- packages/shared/CHANGELOG.md | 7 +++++++ packages/shared/package.json | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) delete mode 100644 .changeset/calm-foxes-confess.md diff --git a/.changeset/calm-foxes-confess.md b/.changeset/calm-foxes-confess.md deleted file mode 100644 index 7a1b3de7..00000000 --- a/.changeset/calm-foxes-confess.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"react18-loaders": patch ---- - -Publish lite version diff --git a/lib/CHANGELOG.md b/lib/CHANGELOG.md index 13eecd62..d8189142 100644 --- a/lib/CHANGELOG.md +++ b/lib/CHANGELOG.md @@ -1,5 +1,11 @@ # react18-loaders +## 1.1.1 + +### Patch Changes + +- 5579416: Publish lite version + ## 1.1.0 ### Minor Changes diff --git a/lib/package.json b/lib/package.json index e3c432a0..88950ffd 100644 --- a/lib/package.json +++ b/lib/package.json @@ -2,7 +2,7 @@ "name": "react18-loaders", "author": "Mayank Kumar Chaudhari ", "private": false, - "version": "1.1.0", + "version": "1.1.1", "description": "A comprehensive library that unleashes the full potential of React 18 server components, providing customizable loading animation components alongside a fullscreen loader container. Designed to seamlessly integrate with React and Next.js.", "license": "MPL-2.0", "main": "./dist/index.js", diff --git a/packages/shared/CHANGELOG.md b/packages/shared/CHANGELOG.md index 55f411b6..8c8fa877 100644 --- a/packages/shared/CHANGELOG.md +++ b/packages/shared/CHANGELOG.md @@ -1,5 +1,12 @@ # @repo/shared +## 0.0.8 + +### Patch Changes + +- Updated dependencies [5579416] + - react18-loaders@1.1.1 + ## 0.0.7 ### Patch Changes diff --git a/packages/shared/package.json b/packages/shared/package.json index d5aea28c..9c2fd95e 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@repo/shared", - "version": "0.0.7", + "version": "0.0.8", "private": true, "sideEffects": false, "main": "./dist/index.js",