acorn-example-package icon indicating copy to clipboard operation
acorn-example-package copied to clipboard

Feat: Add script to replace keyword placeholders with user input

Open KIKOmanasijev opened this issue 1 year ago • 4 comments

This PR adds a PHP script that automates the process of replacing the dummy Class Names, Namespaces, File names and etc, with real user entered data.

KIKOmanasijev avatar May 26 '24 15:05 KIKOmanasijev

I'd like to get rid of all the curl/endpoint stuff as well as any over the top "automation" where possible.

The Filament team's take in their plugin skeleton might be a good place to draw some inspiration on simplifying things: https://github.com/filamentphp/plugin-skeleton/blob/main/configure.php

Log1x avatar May 26 '24 23:05 Log1x

Thanks for the comments @Log1x 🙇‍♂️.

The code styling in composer.json is corrected, and I've simplified the configure.php. Let me know what you think now.

KIKOmanasijev avatar May 27 '24 07:05 KIKOmanasijev

Was playing with a script setup for replacing base example package details , but it seems this Laravel / Filament kind of way is much better. Hope we get this merged soon. Did a test running php ./configure.php using the code at https://github.com/imagewize/sage-native-block/pull/2 and again.. seems to run well. But some parts good be improved. README.md showed

composer require vendor-name/sage-native-block-package

so vendor-name not replaced for some reason. And title in README

# Acorn SageNativeBlock Package

would be better when it would have been three words.

Furthermore I had to make some tweaks:

  • resources/views/example.blade.php did not get renamed https://github.com/imagewize/sage-native-block/pull/3
  • Namespace mismatch so adjusted composer.json https://github.com/imagewize/sage-native-block/pull/4
  • Console file needed renaming https://github.com/imagewize/sage-native-block/pull/5

But beyond that I do not see issues yet. But will have to test some more.

Here the script for reference: https://gist.github.com/jasperf/7fb70fd696d39666475581f62cf7cc43

jasperf avatar Apr 18 '25 04:04 jasperf

Nice work @KIKOmanasijev and @jasperf !

@Log1x any plans on merging this or are there any pending things to be done?

trajche avatar Aug 23 '25 12:08 trajche