Skip to content

Commit 54cf45a

Browse files
committed
v0.1: feat: Security Enhancement
1 parent 9ce26ef commit 54cf45a

15 files changed

Lines changed: 664 additions & 266 deletions

File tree

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ vsc-extension-quickstart.md
1212
**/*.map
1313
**/*.ts
1414
**/.vscode-test.*
15+
.github/**
1516
assets/*
1617
!assets/icon.webp

CHANGELOG.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# Change Log
22

3+
## [0.1.0] - 2025-09-16
4+
### Added
5+
- Webview preview with live validation and non-selectable line numbers gutter
6+
- Replace/Skip/Cancel prompt when target items already exist (uses Trash for Replace)
7+
- Support for JSON file leaves as string file types (e.g., "route": "ts")
8+
- Safer, remote-ready filesystem via `vscode.workspace.fs`
9+
- Tree symbol constants for consistent, readable Unicode output (├──, └──, │)
10+
11+
### Changed
12+
- Plain Text parser is now strict: requires connectors, enforces single root directory, consistent indentation, and ignores the first line as header
13+
- Plain Text creation asks confirmation before proceeding if input is invalid
14+
- Formatter outputs readable tree; JSON output reflects new file-leaf format
15+
- Webview UI modernized (two-column layout, status badge, copy preview, clear input)
16+
17+
### Fixed
18+
- Various encoding issues in tree drawing by using Unicode consistently
19+
- Type-safe configuration access and better error handling
20+
321
### Added
422
- v0.2 Added Banner and Extension Icon
523
- v0.3 Added Major Support `Create Folder Structure`
@@ -10,4 +28,4 @@
1028
- Updated Preview Mode
1129
- v0.6 Added ignorePatterns in vscode settings
1230

13-
## [Unreleased]
31+
## [Unreleased]

README.md

Lines changed: 123 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -1,171 +1,166 @@
11
<img src="./assets/banner.webp" alt="Folder Structure Pro" style="width: 100%; height: 250px; border: 4px solid rgba(255, 255, 255, 0.9); border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);">
22

33
<p align="center">
4-
<a href="https://marketplace.visualstudio.com/items?itemName=iamshreydxv.copy-folder-structure?cacheSeconds=3600">
5-
<img src="https://img.shields.io/visual-studio-marketplace/v/iamshreydxv.copy-folder-structure?cacheSeconds=3600" alt="Marketplace Version"/>
4+
<a href="https://marketplace.visualstudio.com/items?itemName=iamshreydxv.copy-folder-structure">
5+
<img src="https://img.shields.io/visual-studio-marketplace/v/iamshreydxv.copy-folder-structure" alt="Marketplace Version"/>
66
</a>
7-
<a href="https://img.shields.io/visual-studio-marketplace/d/iamshreydxv.copy-folder-structure?cacheSeconds=3600">
8-
<img src="https://img.shields.io/visual-studio-marketplace/d/iamshreydxv.copy-folder-structure?cacheSeconds=3600" alt="Downloads"/>
7+
<a href="https://marketplace.visualstudio.com/items?itemName=iamshreydxv.copy-folder-structure">
8+
<img src="https://img.shields.io/visual-studio-marketplace/d/iamshreydxv.copy-folder-structure" alt="Downloads"/>
99
</a>
10-
<a href="https://marketplace.visualstudio.com/items?itemName=iamshreydxv.copy-folder-structure?cacheSeconds=3600">
11-
<img src="https://img.shields.io/visual-studio-marketplace/r/iamshreydxv.copy-folder-structure?cacheSeconds=3600" alt="Ratings"/>
10+
<a href="https://marketplace.visualstudio.com/items?itemName=iamshreydxv.copy-folder-structure">
11+
<img src="https://img.shields.io/visual-studio-marketplace/r/iamshreydxv.copy-folder-structure" alt="Ratings"/>
1212
</a>
1313
</p>
1414

1515
## Table of Contents
16-
- [Features](#features)
17-
- [🚀 Quick Start](#quick-start)
18-
- [📖 Detailed Usage](#detailed-usage)
16+
- [Features](#features)
17+
- [Quick Start](#quick-start)
18+
- [Detailed Usage](#detailed-usage)
1919
- [Copy Folder Structure](#copy-folder-structure)
2020
- [Create Folder Structure](#create-folder-structure)
2121
- [Copy File Name](#copy-file-name)
22-
- [⚙️ Settings](#settings)
23-
- [📸 Preview](#preview)
22+
- [Settings](#settings)
23+
- [Preview](#preview)
2424
- [Setting](#settings-1)
2525
- [Context Menu](#context-menu)
2626
- [Copy File Name](#copy-file-name-2)
2727
- [Create Folder Structure](#create-folder-structure-2)
2828
- [Common Usage](#common-usage)
29-
- **[Usage With Git Ingest](#with-git-ingest)**
30-
- [🔍 How It Works](#how-it-works)
31-
- [❓ Troubleshooting](#troubleshooting)
32-
- [📄 License](#license)
33-
- [📬 Contact](#contact)
34-
35-
## ✨ Features
36-
- **Copy Folder Structure** 📋
37-
- **Two Output Formats**:
38-
- 🌳 **Plain Text Format** (GitIgnest-style tree structure) (default)
39-
- 📝 **JSON Format**
40-
- Right-click menu integration
41-
- Smart `.gitignore` handling
42-
43-
- **Create Folder Structure** 🏗️
44-
- Support for both JSON and Plain Text formats
45-
- Interactive UI with examples
46-
- Input validation
47-
48-
- **Copy File Name** 📎
49-
- Quick file name copying
50-
- Error handling and feedback
51-
52-
## 🚀 Quick Start
29+
- [With Git Ingest](#with-git-ingest)
30+
- [Copy Folder Structure Output](#copy-folder-structure-output)
31+
- [How It Works](#how-it-works)
32+
- [Troubleshooting](#troubleshooting)
33+
- [License](#license)
34+
- [Contact](#contact)
35+
36+
## Features
37+
- Copy Folder Structure
38+
- Two output formats:
39+
- Plain Text (GitIngest-style tree)
40+
- JSON
41+
- Context menu integration
42+
- Respects .gitignore
43+
44+
- Create Folder Structure
45+
- JSON and Plain Text inputs
46+
- Modern UI with live preview, validation, and line numbers
47+
- Replace/Skip existing items prompt (Replace sends to Trash)
48+
49+
- Copy File Name
50+
- Quick file name copying to clipboard
51+
52+
## Quick Start
5353
1. Install the extension
5454
2. Right-click any folder in Explorer
55-
3. Choose "Copy Folder Structure" or "Create Project Using Folder Structure"
55+
3. Choose "Copy Folder Structure" or "Create Folder Structure"
5656

57-
## 📖 Detailed Usage
57+
## Detailed Usage
5858

5959
### Copy Folder Structure
60-
1. **Right-click** a folder in Explorer
61-
2. Select **Copy Folder Structure**
60+
1. Right-click a folder in Explorer
61+
2. Select Copy Folder Structure
6262
3. Structure is copied in your preferred format (JSON/Plain Text)
6363

6464
### Create Folder Structure
65-
1. **Right-click** in Explorer or use Command Palette
66-
2. Choose **Create Folder Structure**
67-
3. Enter target directory
65+
1. Right-click in Explorer or use Command Palette
66+
2. Choose Create Folder Structure
67+
3. Select the target directory
6868
4. Select format and paste structure
69-
5. Click Submit
69+
5. Click Create
7070

7171
### Copy File Name
72-
- Right-click any file
73-
- Select **Copy File Name**
72+
- Right-click any file → Copy File Name
7473

75-
## Usage:
74+
## Settings
75+
- outputFormat: JSON Format | Plain Text Format
76+
- ignorePatterns: patterns to ignore when copying
77+
- respectGitignore: whether to honor .gitignore
7678

77-
### Copy Folder Structure:
78-
1. **Right-click a folder** in **Explorer** and select **Copy Folder Structure**.
79-
2. Alternatively, open the **Command Palette** (`Ctrl+Shift+P`) and search for **Copy Folder Structure**.
79+
## Preview
8080

81-
### Create Folder Structure:
82-
1. **Right-click a folder** in **Explorer** and select **Create Project Using Folder Structure**.
83-
- Alternatively, open the Command Palette (`Ctrl+Shift+P`) and search for **Create Project Using Folder Structure**.
84-
2. Enter the target directory path where the structure should be created.
85-
3. Choose the input format (`JSON` or `Plain Text`).
86-
4. Provide the folder structure input (e.g., from **Copy Folder Structure**) in the UI editor and click **Submit**.
87-
88-
### Copy File Name:
89-
1. **Right-click a file** in **Explorer** and select **Copy File Name**.
90-
2. Alternatively, open the **Command Palette** (`Ctrl+Shift+P`) and search for **Copy File Name**.
91-
92-
## Settings:
93-
- **outputFormat**: Choose between:
94-
- `JSON Format`
95-
- `Plain Text Format`
96-
- **ignorePatterns**:
97-
- Add the folders you usually ignore here
98-
- Modify this setting in **Settings** (`Ctrl+,`) under `folderStructure`.
99-
100-
## Preview:
101-
102-
### Settings:
81+
### Settings
10382
<img src="./assets/cfs_settings.webp" alt="Settings" style="height: 250px; border: 4px solid rgba(255, 255, 255, 0.9); border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);">
10483

105-
### Context Menu:
84+
### Context Menu
10685
<img src="./assets/cfs_explorer_context.webp" alt="Explorer Context" style="height: 300px; border: 4px solid rgba(255, 255, 255, 0.9); border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);">
10786

108-
### Copy File Name:
87+
### Copy File Name
10988
<img src="./assets/copy_file_name.gif" alt="Copy File Name Example" style="height: 300px; border: 4px solid rgba(255, 255, 255, 0.9); border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);">
11089

111-
### Create Folder Structure:
90+
### Create Folder Structure
11291

113-
##### Common Usage:
92+
#### Common Usage
11493
<img src="./assets/common_usage.gif" alt="Common Usage" style="width: 100%; border: 4px solid rgba(255, 255, 255, 0.9); border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);">
11594

116-
##### With Git Ingest:
95+
#### With Git Ingest
11796
<img src="./assets/usage_with_gitIngest.gif" alt="Usage With Git Ingest" style="width: 100%; border: 4px solid rgba(255, 255, 255, 0.9); border-radius: 8px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);">
11897

119-
### Copy Folder Structure Output:
120-
- **JSON Format**:
121-
```json
122-
{
123-
"app": {
124-
"index.js": null,
125-
"hello.js": null
126-
},
127-
"test": {
128-
"test.ts": null
98+
## Copy Folder Structure Output
99+
100+
- JSON (files as type strings):
101+
```json
102+
{
103+
"app": {
104+
"api": {
105+
"analyze-typography": {
106+
"route": "ts"
129107
}
130-
}
131-
```
132-
- **Plain Text Format** (GitIgnest-style, LLM-friendly):
133-
```
134-
Directory structure:
135-
└── project/
136-
├── app/
137-
│ ├── index.js
138-
│ └── hello.js
139-
└── test/
140-
└── test.ts
141-
```
142-
143-
## How It Works:
144-
### Copy Folder Structure:
145-
1. Scans the folder structure, respecting `.gitignore` files.
146-
2. Excludes files like `node_modules` and hidden files by default.
147-
3. Copies the structure to the clipboard in the selected format:
148-
- JSON: Standard hierarchical object representation
149-
- Plain Text: GitIgnest-style format that's easily readable by both humans and LLMs
150-
151-
### Create Folder Structure:
152-
1. Reads user input from the provided webview.
153-
2. Validates and parses the input (`JSON` or `Plain Text`).
154-
3. Generates folders and files in the specified target directory.
155-
156-
### Copy File Name:
157-
1. Right-click a file in the **Explorer**.
158-
2. Copies the file name to the clipboard.
159-
3. Supports only **local files** and provides feedback on success or error (e.g., file inaccessible, permission denied).
160-
161-
## Troubleshooting:
162-
- **No Option in Context Menu**: Reload VS Code (`Ctrl+Shift+P` → `Reload Window`).
163-
- **Clipboard Not Working**: Check system permissions.
164-
- **Input Error (Create)**: Ensure the input follows the required JSON or Plain Text format.
165-
- **Copy File Name Not Working**: Ensure a valid, accessible file is selected.
166-
167-
## License:
168-
This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
169-
170-
## Contact:
171-
For questions or feedback, open an issue on the [GitHub repository](https://github.com/ShreyPurohit/copy-folder-structure-vscode/issues).
108+
},
109+
"favicon": "ico",
110+
"globals": "css",
111+
"layout": "tsx",
112+
"page": "tsx"
113+
}
114+
}
115+
```
116+
117+
- Plain Text (GitIngest-style, human-friendly):
118+
```
119+
Directory structure:
120+
└── app/
121+
├── api/
122+
│ └── analyze-typography/
123+
│ └── route.ts
124+
├── favicon.ico
125+
├── globals.css
126+
├── layout.tsx
127+
└── page.tsx
128+
```
129+
130+
Plain Text rules:
131+
- First line is ignored as a header (may contain any text)
132+
- Every line must use connectors (├── or └──; ASCII |-- or `-- also supported)
133+
- Exactly one root directory (level 0) and it must end with `/`
134+
- Indentation must increase by exactly one level
135+
- The UI shows invalid line numbers; if invalid, Create asks for confirmation before proceeding
136+
137+
## How It Works
138+
### Copy Folder Structure
139+
1. Scans the folder while respecting .gitignore
140+
2. Excludes node_modules and hidden files by default
141+
3. Copies in the selected format:
142+
- JSON: hierarchical object; files are type strings (e.g., "index": "ts")
143+
- Plain Text: GitIngest-style tree
144+
145+
### Create Folder Structure
146+
1. Reads input from the webview
147+
2. Validates and parses (JSON or Plain Text)
148+
3. Prompts to Replace/Skip if target items exist; Replace sends to Trash
149+
4. Generates folders and files (no overwrite by default)
150+
151+
### Copy File Name
152+
1. Right-click a file in Explorer
153+
2. Copies the file name to clipboard
154+
155+
## Troubleshooting
156+
- No Option in Context Menu: Reload VS Code (Ctrl+Shift+P → Reload Window)
157+
- Clipboard Not Working: Check system permissions
158+
- Input Error (Create): Ensure input follows JSON or Plain Text format
159+
- Copy File Name Not Working: Ensure a valid local file is selected
160+
161+
## License
162+
MIT — see [LICENSE](./LICENSE)
163+
164+
## Contact
165+
Open an issue on the [GitHub repository](https://github.com/ShreyPurohit/folder-structure-pro-vscode/issues)
166+

package.json

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Folder Structure Pro",
44
"description": "Easily copy or create folder structures in JSON or plain text, with .gitignore and hidden file support, and quickly copy file names with a single click.",
55
"publisher": "iamshreydxv",
6-
"version": "0.0.6",
6+
"version": "0.1.0",
77
"engines": {
88
"vscode": "^1.54.0"
99
},
@@ -13,6 +13,14 @@
1313
],
1414
"main": "./dist/extension.js",
1515
"activationEvents": [],
16+
"extensionKind": ["ui", "workspace"],
17+
"capabilities": {
18+
"virtualWorkspaces": true
19+
},
20+
"galleryBanner": {
21+
"color": "#0b1620",
22+
"theme": "dark"
23+
},
1624
"contributes": {
1725
"commands": [
1826
{
@@ -118,21 +126,21 @@
118126
],
119127
"keywords": [
120128
"folder structure",
121-
"copy folder",
129+
"copy folder structure",
130+
"create folder structure",
122131
"copy file name",
123132
"git ingest",
124-
"create project",
125-
"json format",
126-
"plain text format",
133+
"project scaffolding",
134+
"json",
135+
"plain text",
136+
"tree",
127137
"gitignore",
128-
"project creation",
129-
"vs code extension",
130-
"copy file name",
131-
"file name clipboard",
132-
"file management",
133-
"file organization",
138+
"clipboard",
134139
"explorer context menu",
135-
"vscode productivity"
140+
"productivity",
141+
"developer tools",
142+
"workspace fs",
143+
"remote"
136144
],
137145
"repository": {
138146
"type": "git",
@@ -143,4 +151,4 @@
143151
"url": "https://github.com/ShreyPurohit/folder-structure-pro-vscode/issues"
144152
},
145153
"homepage": "https://github.com/ShreyPurohit/folder-structure-pro-vscode#readme"
146-
}
154+
}

0 commit comments

Comments
 (0)