feat: add web project templates (HTML, PHP, JS)#66
Conversation
Quickly generate boilerplate project templates for HTML, PHP, and JavaScript.
Deleting of this files
|
Thanks for the review! You are completely right, it's still a work in progress. I will close this PR for now and work on the project creation logic locally. I'll submit a new PR once the templates are fully functional!" |
|
Thanks for the review! You are completely right, it's still a work in progress. I will close this PR for now and work on the project creation logic locally. I'll submit a new PR once the templates are fully functional!" |
I do an update of main.js
Second update of this file
Update of this file
|
I have already fixed the problem
…On Fri, Jul 3, 2026, 8:17 PM greptile-apps[bot] ***@***.***> wrote:
***@***.***[bot]* commented on this pull request.
------------------------------
In main.js
<#66 (comment)>
:
> + const currentFolder = acode.getFolder();
+ if (!currentFolder) {
+ acode.alert("Erreur", "Veuillez d'abord ouvrir un dossier dans Acode pour y créer le projet.");
+ return;
+ }
+
+ // 2. Définir les options du menu
+ const options = [
+ ["html", "Template Web HTML5 (index.html, style.css, script.js)"],
+ ["php", "Template PHP (index.php)"],
+ ["js", "Template JavaScript (index.js)"]
+ ];
+
+ // 3. Afficher le sélecteur natif d'Acode
+ const choice = await acode.select("Créer un modèle de projet", options);
[image: P1] <#m_4729534400283098455_> *Multiple non-existent acode API
calls — plugin will never run*
acode.getFolder() (line 11), acode.select() (line 25) and
acode.refreshFileList() (line 65) do not exist on the global acode
object. The correct pattern in Acode plugins is to require each utility
first:
- acode.getFolder() → obtain folders via acode.require('openFolder')
- acode.select(...) → const select = acode.require('select'); await
select(...)
- acode.refreshFileList() → acode.require('fileList') and trigger a
refresh event
Because acode.getFolder() is the very first call inside exec, every
invocation of the command will immediately throw TypeError:
acode.getFolder is not a function, before any template logic runs.
Additionally, acode.refreshFileList() on line 65 sits inside the try
block after files are written: when it throws, the catch handler fires
and the user sees the "Impossible de générer les fichiers" error dialog
even though the files were already created successfully.
------------------------------
In main.js
<#66 (comment)>
:
> + return;
+ }
+
+ // 2. Définir les options du menu
+ const options = [
+ ["html", "Template Web HTML5 (index.html, style.css, script.js)"],
+ ["php", "Template PHP (index.php)"],
+ ["js", "Template JavaScript (index.js)"]
+ ];
+
+ // 3. Afficher le sélecteur natif d'Acode
+ const choice = await acode.select("Créer un modèle de projet", options);
+ if (!choice) return; // L'utilisateur a annulé
+
+ try {
+ const fs = fsOperation(currentFolder.url);
[image: P1] <#m_4729534400283098455_> *fsOperation used as an undeclared
global*
fsOperation is called as a bare global (line 29), but in Acode's plugin
model it must be obtained via acode.require('fsOperation'). If the host
environment does not expose it as a window-level global (which is
version-dependent and not guaranteed without a minVersionCode guard),
this will throw ReferenceError: fsOperation is not defined and all
file-creation paths will fail.
—
Reply to this email directly, view it on GitHub
<#66?email_source=notifications&email_token=B2GIFHY7YEBI4NBKCML5C7L5DABDVA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINRSG43TEOBZGIZ2M4TFMFZW63VMON2GC5DFL5RWQYLOM5S2KZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#pullrequestreview-4627728923>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/B2GIFHYDKRFORHRW2QPZHE35DABDVAVCNFSNUABFKJSXA33TNF2G64TZHM2TCMRUGEZTQNZTHNEXG43VMU5TIOBQGU2TCNZUG42KC5QC>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
New update
|
New update
|
Thank you for keeping me in touch but i have already fixed the problem,
could you please take another look ?
…On Sat, Jul 4, 2026, 12:49 PM greptile-apps[bot] ***@***.***> wrote:
***@***.***[bot]* commented on this pull request.
------------------------------
In main.js
<#66 (comment)>
:
> + const openFolder = acode.require("openFolder");
+
+ const currentFolder = openFolder.target;
+ if (!currentFolder || !currentFolder.url) {
+ acode.alert("Erreur", "Veuillez d'abord ouvrir ou sélectionner un dossier dans le gestionnaire de fichiers d'Acode.");
+ return;
+ }
+
+ // 2. Récupérer le module select pour afficher le menu de choix
+ const select = acode.require("select");
+ const options = [
+ ["html", "Template Web HTML5 (index.html, style.css, script.js)"],
+ ["php", "Template PHP (index.php)"],
+ ["js", "Template JavaScript (index.js)"]
+ ];
+
+ const choice = await select("Créer un modèle de projet", options);
[image: P1] <#m_5801607598529989552_> *Uncaught errors outside try/catch
block*
acode.require("openFolder") and acode.require("select") are called
outside the try/catch block. If either module is unavailable and returns
null, the next line immediately throws a TypeError (e.g., Cannot read
properties of null (reading 'target')). Because the exec handler is async
and no outer handler wraps these calls, that error becomes a silent
unhandled promise rejection — the user sees no error dialog and the command
appears to do nothing.
—
Reply to this email directly, view it on GitHub
<#66?email_source=notifications&email_token=B2GIFH3FLBYNB54SP77ORM35DDVONA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINRSHE2TCNRXGEZ2M4TFMFZW63VMON2GC5DFL5RWQYLOM5S2KZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#pullrequestreview-4629516713>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/B2GIFH2PYXA67BQQ44BOHM35DDVONAVCNFSNUABFKJSXA33TNF2G64TZHM2TCMRUGEZTQNZTHNEXG43VMU5TIOBQGU2TCNZUG42KC5QC>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Ce plugin permet de générer rapidement des structures de dossiers et de fichiers de base pour les projets web (HTML, PHP, JavaScript). Cela permet de gagner du temps lors de la création d'un nouveau projet dans Acode.
Pourquoi ce changement ?
Faciliter le démarrage des nouveaux projets pour les utilisateurs.
Comment tester ?