Skip to content

Commit

Permalink
First release
Browse files Browse the repository at this point in the history
  • Loading branch information
Etsi0 committed Mar 17, 2024
0 parents commit add6633
Show file tree
Hide file tree
Showing 25 changed files with 5,443 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/naming-convention": [
"warn",
{
"selector": "import",
"format": [ "camelCase", "PascalCase" ]
}
],
"@typescript-eslint/semi": "warn",
"curly": "warn",
"eqeqeq": "warn",
"no-throw-literal": "warn",
"semi": "off"
},
"ignorePatterns": [
"out",
"dist",
"**/*.d.ts"
]
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
out
dist
node_modules
.vscode-test/
*.vsix
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"jsxSingleQuote": true,
"printWidth": 100,
"singleQuote": true,
"tabWidth": 4,
"useTabs": true
}
5 changes: 5 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'out/test/**/*.test.js',
});
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher", "ms-vscode.extension-test-runner"]
}
21 changes: 21 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// A launch configuration that compiles the extension and then opens it inside a new window
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
{
"version": "0.2.0",
"configurations": [
{
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"out": false, // set this to true to hide the "out" folder with the compiled JS files
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
},
"search.exclude": {
"out": true, // set this to false to include "out" folder in search results
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"cSpell.words": [
"extention"
]
}
40 changes: 40 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "watch",
"problemMatcher": "$ts-webpack-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "watch-tests",
"problemMatcher": "$tsc-watch",
"isBackground": true,
"presentation": {
"reveal": "never",
"group": "watchers"
},
"group": "build"
},
{
"label": "tasks: watch-tests",
"dependsOn": [
"npm: watch",
"npm: watch-tests"
],
"problemMatcher": []
}
]
}
19 changes: 19 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.vscode/**
.vscode-test/**
out/**
node_modules/**
src/**

**/tsconfig.json
**/.eslintrc.json
**/*.map
**/*.js.map
**/*.ts
**/.vscode-test.*

webpack.config.js
vsc-extension-quickstart.md
codeStandard.md

.gitignore
.yarnrc
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Change Log

Check out the release notes at https://github.com/Etsi0/class-collapse/releases
88 changes: 88 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<div align="center">
<img width="384" alt="icon of extension" src="./public/img/icon.svg">
</div>

<h1 align="center" style="border:none;">Class Collapse</h1>

## TLDR

**Class Collapse** enhances your coding experience by mimicking VS Code's collapsing feature. This tool becomes essential when dealing with frameworks such as **Tailwind CSS**, known for their extensive usage of utility classes that can often make your code less readable. **Class Collapse** uses regex (can be customized inside settings) to make your coding experience cleaner by collapsing segments of your code, making it significantly easier to read and navigate.

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/G2G3VPRNX)

## Features

To toggle the **Class Collapse** extension, open the Command Palette with `Shift+Ctrl+P`, search for `Class Collapse: Toggle Collapsing`, or use the shortcut `Alt+Ctrl+Shift+C`. This key combination is chosen to avoid overriding any default bindings and avoid accidental activations or deactivations, with C also representing **C**lass **C**ollapse.

### How to open a collapse

Opening a collapse is as easy as clicking or selecting the collapse, making them only expanded when needed.
![Gif that selects code to show how to looks when collapses gets expanded](./public/gif/openCollapses.gif)

### Customization

This extension is **highly customizable**, allowing you to make it feel and look exactly how you want it; if something is missing and you want me to add it, please create an issue on my GitHub repo and I will consider your request.

Inspired by [Inline fold](https://github.com/moalamri/vscode-inline-fold), which has stopped receiving updates; more information on why is available on their GitHub repo

## Extension Settings

### Example:

```jsonc
{
"classCollapseToggle": true,
"disableInDiffEditor": true,

"regex": "(class|className)(?:=|:|:\\s)((['\"])([\\s\\S]*?)\\3|{\\s*((['\"`])([\\s\\S]*?)\\6|(?!['\"`])([\\s\\S]*?))\\s*})",
"regexFlags": "g",
"regexGroups": [4, 7, 8],

"openCollapseOnLineSelected": true,
"collapsedText": "...",
"collapsedTextColor": "#C3E88DFF",
"openCollapseOpacity": 1,

// https://code.visualstudio.com/docs/languages/identifiers#_known-language-identifiers
"supportedLanguages": [
"astro",
"html",
"javascriptreact",
"javascript",
"markdown",
"php",
"svelte",
"typescript",
"typescriptreact",
"vue",
"vue-html"
]
}
```

### Available Settings:

- `classCollapseToggle` - Enables or disables collapsing (includes Diff Editor)
- `disableInDiffEditor` - Enables or disables collapsing in Diff Editor

- `regex` - Regex to match
- `regexFlags` - Regex flags
- `regexGroups` - Which regex groups you wish to collapse

- `openCollapseOnLineSelected` - If you wish to be able to open the collapse by pressing on the same line as the collapse is on, set it to `true`; otherwise, set it to `false` and press inside the collapse instead.
- `collapsedText` - Text to show when collapsed
- `collapsedTextColor` - Color of the collapsed text in hex (alpha value is optional)
- `openCollapseOpacity` - The opacity of expanded collapses
- `supportedLanguages` - Supported languages

## Known Issues

Create an issue on the extension's [GitHub page](https://github.com/Etsi0/class-collapse). If you have any troubles

## Release Notes

Check out the release notes at https://github.com/Etsi0/class-collapse/releases

## Contributors

![Everyone that has contributed to this project](https://contrib.rocks/image?repo=Etsi0/class-collapse)
64 changes: 64 additions & 0 deletions codeStandard.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# All of these code standards should be applied at all times.

## table

1. [Naming](#Functions-and-Classes)

- 1. [Functions and Classes](#Functions-and-Classes)
- 2. [Variables](#Variables)

2. [Commenting and Documentation](#Commenting-and-Documentation)

- 1. [Comments](#Comments)
- 2. [Documentation](#Documentation)

3. [Code Structure and Organization](#Code-Structure-and-Organization)

- 1. [Consistent Indentation](#Consistent-Indentation)
- 2. [File and Directory Structure](#File-and-Directory-Structure)

4. [Avoiding Magic Numbers and Strings](#Avoiding-Magic-Numbers-and-Strings)
5. [Code Reusability](#Code-Reusability)

## Naming

### Functions and classes

Use `PascalCase`

### Variables

Use `camelCase`

## Commenting and Documentation

### Comments

Use comments to explain the "why" and not the "what".

### Documentation

Use JSDoc to document classes and functions if they return a value

## Code Structure and Organization

### Consistent Indentation

Use `Indent using Tabs` with a tab size of `4`. if you do not have [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) installer already, install it now. Installing [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) ensures that the code remains consistent.

### File and Directory Structure

Place your code in "src" and images, svg and other files in "public".

## Avoiding Magic Numbers and Strings

## Code Reusability

Strive for DRY (Don't Repeat Yourself) principles by abstracting reusable code into classes, functions or variables.

## Tools

- [Better Comments](https://marketplace.visualstudio.com/items?itemName=aaron-bond.better-comments)
- [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker)
- [GitLens — Git supercharged](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
Loading

0 comments on commit add6633

Please sign in to comment.