Skip to content

Commit aac0d31

Browse files
committed
Bug fixes
1 parent ab061fa commit aac0d31

File tree

6 files changed

+25
-12
lines changed

6 files changed

+25
-12
lines changed

dist/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packageAdder.zip

286 Bytes
Binary file not shown.

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "acode.plugin.package.adder",
33
"name": "Add Package",
44
"main": "dist/main.js",
5-
"version": "1.0.2",
5+
"version": "1.0.3",
66
"readme": "readme.md",
77
"icon": "icon.png",
88
"files": [],

readme.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Add Package
2-
Plugin helps you to add any npm(css,js) packages in your project (same as codepen features).
2+
This Plugin helps you to add any npm(css,js) packages in your project (same as codepen features).
33

4-
## Use
4+
## Usage
55
For using search `Add Package` in command palette(`•••`) and it will open page with some top packages
6-
, you can select any packages and add to your project.
6+
, you can select any packages and add to your project. You can also search packages.
77

88
## Features
99
- Above 1 million packages are incuded
@@ -16,5 +16,15 @@ For using search `Add Package` in command palette(`•••`) and it will open
1616
* This plugin requires internet connection
1717
* for adding packages to your project make sure to first open the html file in editor then run plugin
1818

19+
Contribution are always welcome!
20+
21+
----
22+
1923
**Provide your feedbacks and suggestions and also report bugs(if found) on bellow link**
20-
> https://github.com/bajrangCoder/acode-plugin-packageAdder/issues
24+
> https://github.com/bajrangCoder/acode-plugin-packageAdder/issues
25+
26+
**Leave a star 🌟 on github, if this plugin helpfull to you**
27+
28+
----
29+
30+
**Thanks for using Add Package plugin**

src/main.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,19 @@ class AddPackage {
355355
let { location } = activeFile;
356356
let folderNme = 'modules';
357357
let importScript = '';
358-
let modulesFolderLoc = await fsOperation(location).createDirectory(folderNme);
358+
359+
if(!(await fsOperation(location+folderNme).exists())){
360+
await fsOperation(location).createDirectory(folderNme);
361+
}
362+
359363
for (let i=0;i<filesArray.length;i++) {
360364
let url = `https://cdnjs.cloudflare.com/ajax/libs/${this.libName.textContent}/${this.versionSelector.value}/${filesArray[i]}`;
361365
let fileData = await this.loadFileContent(url);
362366
let filename = filesArray[i].split('.');
363367
let fileType = filename.slice(-1)[0];
364-
let newFileNme = filesArray[i].replace(/^(js|css|esm|cjs|umd)\//, "");
368+
let newFileNme = filesArray[i].replace(/^(js|css|esm|cjs|umd|font|iconfont)\//, "");
365369
loader.create('Downloading',`Downloading selected files of library...\nFile: ${newFileNme}`);
366-
await fsOperation(modulesFolderLoc).createFile(newFileNme,fileData);
370+
await fsOperation(`${location}${folderNme}/`).createFile(newFileNme,fileData);
367371
switch (fileType) {
368372
case 'js':
369373
importScript += `<script src="/${folderNme}/${newFileNme}"></script>\n`;
@@ -393,7 +397,6 @@ class AddPackage {
393397
break;
394398
case 'Download Files':
395399
this.addThroughDownload(filesArray);
396-
//window.toast('It will come in future updates',4000);
397400
break;
398401
}
399402
}

src/style.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,9 @@
150150
display: flex;
151151
justify-content: space-between;
152152
flex-direction: row;
153-
margin-bottom: 10px;
153+
margin-bottom: 5px;
154154
width: 100%;
155-
position: fixed;
155+
position: absolute;
156156
bottom: 0;
157157
.backBtn{
158158
border: none;

0 commit comments

Comments
 (0)