Skip to content

Commit 5c3a602

Browse files
committed
first commit
1 parent b1cd056 commit 5c3a602

26 files changed

Lines changed: 7635 additions & 441 deletions

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"@babel/plugin-transform-runtime"
1717
]
1818
],
19-
"compact": true
19+
"compact": false
2020
}

.vscode/pack-zip.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
const path = require('path');
2+
const fs = require('fs');
3+
const jszip = require('jszip');
4+
5+
const iconFile = path.join(__dirname, '../icon.png');
6+
const pluginJSON = path.join(__dirname, '../plugin.json');
7+
const distFolder = path.join(__dirname, '../dist');
8+
let readmeDotMd = path.join(__dirname, '../readme.md');
9+
10+
if (!fs.existsSync(readmeDotMd)) {
11+
readmeDotMd = path.join(__dirname, '../README.md');
12+
}
13+
14+
// create zip file of dist folder
15+
16+
const zip = new jszip();
17+
18+
zip.file('icon.png', fs.readFileSync(iconFile));
19+
zip.file('plugin.json', fs.readFileSync(pluginJSON));
20+
zip.file('readme.md', fs.readFileSync(readmeDotMd));
21+
22+
loadFile('', distFolder);
23+
24+
zip
25+
.generateNodeStream({ type: 'nodebuffer', streamFiles: true })
26+
.pipe(fs.createWriteStream(path.join(__dirname, '../dist.zip')))
27+
.on('finish', () => {
28+
console.log('dist.zip written.');
29+
});
30+
31+
function loadFile(root, folder) {
32+
const distFiles = fs.readdirSync(folder);
33+
distFiles.forEach((file) => {
34+
35+
const stat = fs.statSync(path.join(folder, file));
36+
37+
if (stat.isDirectory()) {
38+
zip.folder(file);
39+
loadFile(path.join(root, file), path.join(folder, file));
40+
return;
41+
}
42+
43+
if (!/LICENSE.txt/.test(file)) {
44+
zip.file(path.join(root, file), fs.readFileSync(path.join(folder, file)));
45+
}
46+
});
47+
}

dist.zip

249 KB
Binary file not shown.

dist/main.js

Lines changed: 2 additions & 172 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/main.js.LICENSE.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*!
2+
* mime-db
3+
* Copyright(c) 2014 Jonathan Ong
4+
* Copyright(c) 2015-2022 Douglas Christopher Wilson
5+
* MIT Licensed
6+
*/
7+
8+
/*!
9+
* mime-types
10+
* Copyright(c) 2014 Jonathan Ong
11+
* Copyright(c) 2015 Douglas Christopher Wilson
12+
* MIT Licensed
13+
*/
14+
15+
/*! https://mths.be/utf8js v2.1.2 by @mathias */
16+
17+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
18+
19+
/**
20+
* @file
21+
* @copyright 2013 Michael Aufreiter (Development Seed) and 2016 Yahoo Inc.
22+
* @license Licensed under {@link https://spdx.org/licenses/BSD-3-Clause-Clear.html BSD-3-Clause-Clear}.
23+
* Github.js is freely distributable.
24+
*/
25+
26+
/**
27+
* @file
28+
* @copyright 2016 Matt Smith (Development Seed)
29+
* @license Licensed under {@link https://spdx.org/licenses/BSD-3-Clause-Clear.html BSD-3-Clause-Clear}.
30+
* Github.js is freely distributable.
31+
*/
32+
33+
/**
34+
* @file
35+
* @copyright 2016 Yahoo Inc.
36+
* @license Licensed under {@link https://spdx.org/licenses/BSD-3-Clause-Clear.html BSD-3-Clause-Clear}.
37+
* Github.js is freely distributable.
38+
*/

icon.png

-51.5 KB
Loading

package.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
11
{
2-
"name": "acode-plugin",
2+
"name": "acode-plugin-github",
33
"version": "1.0.2",
4-
"description": "Template for Acode plugin",
4+
"description": "Github plugin for acode editor",
55
"main": "dist/main.js",
6-
"repository": "https://github.com/deadlyjack/acode-plugin.git",
6+
"repository": "https://github.com/deadlyjack/acode-plugin-github.git",
77
"author": "Ajit <me@ajitkumar.dev>",
88
"license": "MIT",
99
"dependencies": {
10-
"html-tag-js": "^1.1.22"
10+
"github-api": "^3.4.0",
11+
"html-tag-js": "^1.1.22",
12+
"mime-types": "^2.1.35"
1113
},
1214
"devDependencies": {
1315
"@babel/cli": "^7.18.10",
1416
"@babel/core": "^7.18.13",
1517
"@babel/plugin-transform-runtime": "^7.19.6",
1618
"@babel/preset-env": "^7.18.10",
1719
"babel-loader": "^9.1.0",
20+
"jszip": "^3.10.1",
1821
"live-server": "^1.2.2",
22+
"path-browserify": "^1.0.1",
1923
"webpack": "^5.74.0",
2024
"webpack-cli": "^5.0.0"
2125
},
@@ -31,4 +35,4 @@
3135
"terser": ">=5.14.2 ",
3236
"glob-parent": ">=5.1.2"
3337
}
34-
}
38+
}

plugin.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
2-
"id": "acode.plugin",
3-
"name": "Plugin",
2+
"id": "acode.plugin.github",
3+
"name": "Github",
44
"main": "dist/main.js",
5-
"version": "1.0.0",
5+
"version": "1.0.2",
66
"readme": "readme.md",
77
"icon": "icon.png",
88
"files": [],
99
"author": {
10-
"name": "",
11-
"email": "",
12-
"github": ""
10+
"name": "Ajit Kumar",
11+
"email": "me@ajitkumar.dev",
12+
"github": "deadlyjack"
1313
}
1414
}

0 commit comments

Comments
 (0)