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);