Skip to content

Commit

Permalink
Merge branch 'main' into folder-pseudo-wildcard
Browse files Browse the repository at this point in the history
  • Loading branch information
PKief committed Apr 23, 2024
2 parents 89e411e + 834e5ae commit fc09ba8
Show file tree
Hide file tree
Showing 20 changed files with 240 additions and 397 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.svg]
insert_final_newline = false
2 changes: 1 addition & 1 deletion .eslintrc.json
Expand Up @@ -44,7 +44,7 @@
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
"endOfLine": "lf"
}
]
}
Expand Down
6 changes: 6 additions & 0 deletions .gitattributes
@@ -0,0 +1,6 @@
# Normalize EOL for all files that Git considers text files
* text=auto eol=lf

# Explicit binary files for older Git versions (<2.10)
*.png binary
*.gif binary
2 changes: 1 addition & 1 deletion .prettierrc
Expand Up @@ -3,5 +3,5 @@
"tabWidth": 2,
"semi": true,
"singleQuote": true,
"endOfLine": "auto"
"endOfLine": "lf"
}
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -132,6 +132,31 @@ Here's an example of how the SVG icon 'sample.svg' is assigned to file names and

This will apply an icon for the files 'sample.js', 'sample.ts' and 'sample.html' as well as for files that end with 'sample' like 'another-file.sample'.

##### Apply patterns

It is also possible to use patterns for file names and extensions. This is useful when you want to assign an icon to a group of files that have a common pattern. Here's an example:

```ts
{
name: 'sample',
patterns: {
sample: ['ecmascript'],
}
}
```

In case of this example the generated file names are "sample.js", "sample.mjs", "sample.cjs",
sample.ts", "sample.mts" and "sample.cts". The pattern is defined in the [patterns.ts](src/icons/patterns/utils.ts) file.

Allowed patterns are right now:

| Pattern | File extensions |
| ------------- | ---------------------------------------------------------------------------------------------------------- |
| ecmascript | `js`, `mjs`, `cjs`, `ts`, `mts`, `cts` |
| configuration | `json`, `jsonc`, `json5`, `yaml`, `yml`, `toml` |
| nodeEcosystem | Combination of ecmascript and configuration patterns |
| cosmiconfig | Similar to nodeEcosystem but in form of `.${fileName}rc`, `.config/${fileName}rc` and `${fileName}.config` |

#### Folder icons

Here's an example of how a folder icon can be assigned to folder icons:
Expand Down
4 changes: 1 addition & 3 deletions icons/c.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions icons/cpp.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 1 addition & 7 deletions icons/csharp.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion icons/h.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 1 addition & 5 deletions icons/hpp.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions icons/objective-c.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 1 addition & 4 deletions icons/objective-cpp.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fc09ba8

Please sign in to comment.