Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 14 additions & 51 deletions esbuild.config.mjs
Original file line number Diff line number Diff line change
@@ -1,57 +1,20 @@
import * as esbuild from "esbuild";
import { exec } from "child_process";
import esbuild from "esbuild";
import { execSync } from "child_process";

const isServe = process.argv.includes("--serve");

// Function to pack the ZIP file
function packZip() {
exec("node ./pack-zip.js", (err, stdout, stderr) => {
if (err) {
console.error("Error packing zip:", err);
return;
}
console.log(stdout.trim());
});
}

// Custom plugin to pack ZIP after build or rebuild
const zipPlugin = {
name: "zip-plugin",
setup(build) {
build.onEnd(() => {
packZip();
});
},
};

// Base build configuration
let buildConfig = {
esbuild.build({
entryPoints: ["src/main.js"],
bundle: true,
outfile: "dist/main.js",
format: "iife",
platform: "browser",
minify: true,
logLevel: "info",
color: true,
outdir: "dist",
plugins: [zipPlugin],
};
sourcemap: false
}).then(() => {
console.log("Build completed. Creating plugin ZIP...");

// Main function to handle both serve and production builds
(async function () {
if (isServe) {
console.log("Starting development server...");

// Watch and Serve Mode
const ctx = await esbuild.context(buildConfig);

await ctx.watch();
const { host, port } = await ctx.serve({
servedir: ".",
port: 3000,
});
execSync("node pack-zip.js", {
stdio: "inherit"
});

} else {
console.log("Building for production...");
await esbuild.build(buildConfig);
console.log("Production build complete.");
}
})();
console.log("plugin.zip created successfully.");
}).catch(() => process.exit(1));
Comment thread
Degrace15 marked this conversation as resolved.
Binary file modified icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 9 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
{
"name": "acode-plugin",
"name": "acode-templates",
"version": "1.0.0",
"description": "Template for Acode plugin",
"description": "Templates plugin for Acode",
"main": "src/main.js",
"repository": "https://github.com/Acode-Foundation/acode-plugin.git",
"author": "Acode Foundation",
"license": "MIT",
"scripts": {
"build": "node esbuild.config.mjs"
},
"dependencies": {
"acode-plugin-types": "^1.11.7-patch.2",
"html-tag-js": "^2.4.15"
"acode-plugin-types": "^1.11.7-patch.2"
},
"devDependencies": {
"esbuild": "^0.25.8",
"jszip": "^3.10.1"
},
"scripts": {
"dev": "node esbuild.config.mjs --serve",
"build": "node esbuild.config.mjs"
},
"browserslist": "cover 100%,not android < 5"
"allowScripts": {
"[email protected]": true
}
}
35 changes: 24 additions & 11 deletions plugin.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
{
"$schema": "https://acode.app/schema/plugin/v0.1.0.json",
"id": "acode.plugin",
"name": "Plugin",
"main": "main.js",
"version": "1.0.0",
"repository": "https://github.com/Acode-Foundation/acode-plugin.git",
"id": "com.degrace.templates",
"name": "Templates",
"main": "dist/main.js",
"version": "1.1.0",
"readme": "readme.md",
"changelogs": "CHANGELOG.md",
"repository": "https://github.com/Degrace15/acode-templates",
"icon": "icon.png",
"minVersionCode": 290,
"license": "MIT",
"keywords": [],
"price": 0,
"permissions": [],
"keywords": [
"template",
"html",
"css",
"php",
"javascript",
"python",
"c",
"cpp",
"java",
"project-generator"
],
"author": {
"name": "",
"email": "",
"github": ""
}
"name": "Hacker2.0",
"email": "[email protected]",
"github": "Degrace15"
},
"description": "Create complete project templates for HTML, PHP, JavaScript, Python, C, C++, Java in Acode."
}
81 changes: 68 additions & 13 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,76 @@
# Acode plugin
# Templates

Read acode plugin [documentation](https://docs.acode.app/docs/) to develop plugin for acode editor.
A project template generator plugin for Acode.

## Usage
## 🚀 Features

Use this for debug build:
Templates helps you create complete project structures directly inside Acode.

```
npm run dev
```
## 📦 Available Templates

and this for production build:
- HTML5
- PHP
- JavaScript
- Python
- C
- C++
- Java

```
npm run build
```
## ✨ Features in 1.1.0

## How to parse/bundle scss file ?
- Create complete project templates
- Generate multiple files automatically
- Support for multiple programming languages
- Ready-to-use project structures
- Faster project creation in Acode

You'll need to install one sass esbuild plugin and then just add that in `esbuild.config.mjs` at line 34
## 📂 Examples

### HTML Project

Creates:

index.html style.css script.js


### PHP Project

Creates:

index.php config.php


### Python Project

Creates:

main.py requirements.txt


## ⚙️ Installation

1. Download the plugin ZIP file.
2. Open Acode.
3. Go to Plugins.
4. Install Templates.

## 🛠 Usage

1. Open a project folder in Acode.
2. Open the command palette.
3. Run:

Templates


4. Select your project type.

## 👨‍💻 Developer

Author: Hacker2.0

GitHub:
https://github.com/Degrace15

License:
MIT
Loading