Skip to content

Commit 4b5b77a

Browse files
committed
update rebrand config
1 parent ef09be2 commit 4b5b77a

File tree

2 files changed

+55
-6
lines changed

2 files changed

+55
-6
lines changed

package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,8 @@
3030
"typedoc-plugin-rename-defaults": "^0.7.2",
3131
"typedoc-plugin-zod": "^1.3.1"
3232
},
33-
"pnpm": {
34-
"overrides": {
35-
"esbuild": "0.24.0"
36-
}
37-
},
3833
"packageManager": "pnpm@9.15.2",
3934
"engines": {
4035
"node": ">=18"
4136
}
42-
}
37+
}

scripts/rebrand.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,60 @@ const rebrandFn = async () => {
121121
'git add . && git commit -m "Cleaned up 💖 <a href="https://mayank-chaudhari.vercel.app" target="_blank">Mayank Kumar Chaudhari</a> [skip ci]"',
122122
);
123123

124+
/**
125+
* feats: Rebrander, Docs
126+
*/
127+
const { feats } = await prompt({
128+
type: "multiselect",
129+
name: "feats",
130+
message: "Select the features to remove - will help clean up and lighten the build ci/cd",
131+
initial: ["Rebrander", "Docs"],
132+
choices: [
133+
{
134+
name: "Rebrander",
135+
message:
136+
"After rebranding is done, usually it is not required to run rebranding scripts again unless you change your package and repo names.",
137+
},
138+
{
139+
name: "Docs",
140+
message: "Some libraries do not require docs generated by typedoc.",
141+
},
142+
],
143+
});
144+
145+
const rootPackageJSON = require("../package.json");
146+
147+
if (feats.includes("Rebrander")) {
148+
delete rootPackageJSON.scripts.rebrand;
149+
delete rootPackageJSON.devDependencies.enquirer;
150+
}
151+
152+
if (feats.includes("Docs")) {
153+
delete rootPackageJSON.scripts.doc;
154+
delete rootPackageJSON.devDependencies["typedoc"];
155+
delete rootPackageJSON.devDependencies["typedoc-plugin-missing-exports"];
156+
delete rootPackageJSON.devDependencies["typedoc-plugin-rename-defaults"];
157+
delete rootPackageJSON.devDependencies["typedoc-plugin-inline-sources"];
158+
delete rootPackageJSON.devDependencies["typedoc-plugin-mdn-links"];
159+
delete rootPackageJSON.devDependencies["typedoc-plugin-extras"];
160+
delete rootPackageJSON.devDependencies["typedoc-plugin-zod"];
161+
}
162+
163+
const rootDir = process.cwd();
164+
try {
165+
fs.writeFileSync(
166+
path.resolve(rootDir, "package.json"),
167+
JSON.stringify(rootPackageJSON, null, 2),
168+
);
169+
} catch (e) {
170+
console.error(e);
171+
}
172+
173+
if (feats.length)
174+
execSync(
175+
'git add . && git commit -m "Cleaned up features 💖 <a href="https://mayank-chaudhari.vercel.app" target="_blank">Mayank Kumar Chaudhari</a> [skip ci]"',
176+
);
177+
124178
console.log("\x1b[32m", "90% of rebranding completed!");
125179
console.log("\x1b[36m%s", ".");
126180
console.log("\x1b[36m%s", ".");

0 commit comments

Comments
 (0)