@@ -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