Skip to content

Commit cae4936

Browse files
committed
Update use sidebar
0 parents  commit cae4936

24 files changed

Lines changed: 6624 additions & 0 deletions

.acode/pack-zip.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
const JSZip = require('jszip');
4+
5+
const plugin = require('../plugin.json');
6+
7+
async function createZip() {
8+
const zip = new JSZip();
9+
10+
const addFile = (filePath, zipPath) => {
11+
if (fs.existsSync(filePath)) {
12+
const content = fs.readFileSync(filePath);
13+
zip.file(zipPath, content);
14+
}
15+
};
16+
17+
addFile('dist/main.js', 'main.js');
18+
addFile('plugin.json', 'plugin.json');
19+
addFile('icon.png', 'icon.png');
20+
addFile('readme.md', 'readme.md');
21+
22+
if (fs.existsSync('dist/assets')) {
23+
const assets = fs.readdirSync('dist/assets');
24+
assets.forEach(asset => {
25+
addFile(`dist/assets/${asset}`, `assets/${asset}`);
26+
});
27+
}
28+
29+
const content = await zip.generateAsync({ type: 'nodebuffer' });
30+
fs.writeFileSync(`${plugin.name}.zip`, content);
31+
32+
console.log(`Plugin packed: ${plugin.name}.zip`);
33+
}
34+
35+
createZip().catch(console.error);

.github/FUNDING.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# These are supported funding model platforms
2+
3+
github: RenzMc
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/general.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: General
3+
about: feel free to ask anything or not
4+
title: "[GENERAL]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
---
11+
name: " General Issue"
12+
about: "Use this template for general issues, questions, suggestions, or content corrections."
13+
title: "[General] "
14+
labels: ["general", "discussion"]
15+
assignees: []
16+
---
17+
18+
## Description
19+
_Describe the issue, idea, or content you want to discuss._
20+
21+
Example:
22+
- Typo found in documentation.
23+
- Suggestion to add more explanation in the API section.
24+
- General question about usage.
25+
26+
---
27+
28+
## Details
29+
- **Topic/Title**:
30+
- **Location (file/page)**:
31+
- **Screenshots/References (optional)**:
32+
33+
---
34+
35+
## Checklist
36+
Before submitting, please confirm:
37+
- [ ] I have checked if this issue already exists.
38+
- [ ] I have clearly described the issue/idea.
39+
- [ ] I have included relevant details (if necessary).

.github/workflows/main.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Build Acode Plugin
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
workflow_dispatch: {}
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout repository
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '20'
22+
cache: 'npm'
23+
24+
- name: Install dependencies
25+
shell: bash
26+
run: |
27+
npm install
28+
29+
- name: Run build script (show stdout/stderr)
30+
shell: bash
31+
run: |
32+
echo "== RUNNING BUILD =="
33+
node -v
34+
npm -v
35+
set -o pipefail
36+
npm run build 2>&1 | tee build-output.log || true
37+
echo "=== BUILD OUTPUT (last 200 lines) ==="
38+
tail -n 200 build-output.log || true
39+
40+
- name: Debug - show workspace recursively
41+
shell: bash
42+
run: |
43+
echo "Working dir: $(pwd)"
44+
echo "Top-level files:"
45+
ls -la
46+
echo "Find zip files (if any):"
47+
find . -type f -name "*.zip" -print -exec ls -lh {} \; || true
48+
49+
- name: Prepare artifacts
50+
shell: bash
51+
run: |
52+
mkdir -p .artifacts
53+
54+
# Kalau AI.zip sudah ada di repo, pakai itu
55+
if [ -f "AI.zip" ]; then
56+
cp AI.zip .artifacts/
57+
echo "✅ Copied AI.zip to artifacts"
58+
else
59+
echo "❌ AI.zip not found, creating from dist"
60+
if [ -d "dist" ]; then
61+
# Bikin zip clean → isi dist/* langsung di root zip
62+
if [ -f "README.md" ]; then
63+
zip -r .artifacts/AI.zip dist/* plugin.json icon.png README.md
64+
elif [ -f "readme.md" ]; then
65+
zip -r .artifacts/AI.zip dist/* plugin.json icon.png readme.md
66+
else
67+
zip -r .artifacts/AI.zip dist/* plugin.json icon.png
68+
fi
69+
else
70+
echo "❌ No dist folder found"
71+
exit 1
72+
fi
73+
fi
74+
75+
echo "=== Final artifacts check ==="
76+
ls -la .artifacts/
77+
file .artifacts/AI.zip
78+
echo "File exists check:"
79+
test -f .artifacts/AI.zip && echo "✅ AI.zip exists" || echo "❌ AI.zip missing"
80+
81+
- name: Upload plugin artifact
82+
uses: actions/upload-artifact@v4
83+
with:
84+
name: acode-plugin-ai
85+
path: .artifacts/AI.zip
86+
if-no-files-found: error

build.mjs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import * as esbuild from "esbuild";
2+
import { sassPlugin } from "esbuild-sass-plugin";
3+
import { exec } from "child_process";
4+
5+
(async () => {
6+
await esbuild.build({
7+
entryPoints: ["src/main.js"],
8+
bundle: true,
9+
minify: true,
10+
logLevel: "info",
11+
color: true,
12+
outdir: "dist",
13+
plugins: [
14+
sassPlugin({
15+
type: "css-text",
16+
}),
17+
],
18+
});
19+
20+
exec("node .acode/pack-zip.js", (err, stdout, stderr) => {
21+
if (err) return console.error(err);
22+
console.log(stdout);
23+
});
24+
})();

0 commit comments

Comments
 (0)