Skip to content

Commit

Permalink
Merge pull request #56 from react18-tools/feat/lite-version
Browse files Browse the repository at this point in the history
Add lite version of the library
  • Loading branch information
mayank1513 authored Jun 8, 2024
2 parents 8fdc1d5 + ce46ccd commit cd656dd
Show file tree
Hide file tree
Showing 9 changed files with 83 additions and 9 deletions.
20 changes: 13 additions & 7 deletions .tkb
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand All @@ -79,10 +84,7 @@
"tasksIds": [
"5Br6CU2MKWj0R40obK9Nm",
"-DCBBAzTvSWMDb8whog60",
"P92idHa6fbprwBOYEp5uu",
"T1TbmRqXHguxnJv1g_Ot6",
"aCqTM5wgCQC3pY9TA7GtN",
"KOQ0LhYPWc6ydZDSbZMGe"
"P92idHa6fbprwBOYEp5uu"
]
},
{
Expand All @@ -94,7 +96,11 @@
"id": "column-done",
"title": "Done",
"tasksIds": [
"OUXfu0Fbgy4-8mdT_3xH8",
"5FPnfgSKUpHBbORBRtgui",
"T1TbmRqXHguxnJv1g_Ot6",
"KOQ0LhYPWc6ydZDSbZMGe",
"aCqTM5wgCQC3pY9TA7GtN",
"iXE3kCY0L1r_4TD-zRgVh",
"rRkFSIcteEvuq6MRX2BN0",
"mWXPi1Qzt9zNe6cKb8IZ3",
Expand Down
6 changes: 6 additions & 0 deletions lib/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# react18-loaders

## 1.1.1

### Patch Changes

- 5579416: Publish lite version

## 1.1.0

### Minor Changes
Expand Down
20 changes: 20 additions & 0 deletions lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "react18-loaders",
"author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>",
"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",
Expand Down
7 changes: 7 additions & 0 deletions packages/shared/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @repo/shared

## 0.0.8

### Patch Changes

- Updated dependencies [5579416]
- [email protected]

## 0.0.7

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@repo/shared",
"version": "0.0.7",
"version": "0.0.8",
"private": true,
"sideEffects": false,
"main": "./dist/index.js",
Expand Down
29 changes: 29 additions & 0 deletions scripts/lite.js
Original file line number Diff line number Diff line change
@@ -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);
3 changes: 3 additions & 0 deletions scripts/manual-publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
3 changes: 3 additions & 0 deletions scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");

0 comments on commit cd656dd

Please sign in to comment.