-
Notifications
You must be signed in to change notification settings - Fork 142
Update Templates plugin to v1.1.0 #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Degrace15
wants to merge
2
commits into
Acode-Foundation:main
Choose a base branch
from
Degrace15:templates-v1.1.0
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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)); | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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." | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.