Skip to content

Commit 82b278f

Browse files
authored
Merge pull request #30 from lightning-js/release/1.3.0
Release - v1.3.0
2 parents 656db94 + 76b5c9a commit 82b278f

36 files changed

+2222
-1442
lines changed

.eslintignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# VSCode
2+
.vscode/**
3+
.vscode-test/**
4+
5+
# Build outputs
6+
out/**
7+
*.vsix
8+
*.zip
9+
10+
# Dependencies
11+
node_modules/**
12+
13+
# Git and CI
14+
.git/**
15+
.github/**
16+
17+
# Misc
18+
.DS_Store
19+
backup/**
20+
21+
# Config files
22+
.eslintcache
23+
.gitignore
24+
.vscodeignore
25+
*.map
26+
jsconfig.json
27+
.eslintrc.json
28+
29+
# Documentation
30+
*.md
31+
vsc-extension-quickstart.md
32+
33+
# workers
34+
.github/**
35+
36+
# vscode test
37+
.vscode-test/**

.eslintrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@
7272
"never"
7373
]
7474
}
75+
},
76+
{
77+
"files": [
78+
"test/**/*.js"
79+
],
80+
"rules": {
81+
"no-unused-expressions": "off",
82+
"no-undef": "off"
83+
}
7584
}
7685
]
7786
}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ out
55
backup
66
*.vsix
77
*.zip
8-
test/
8+
.eslintcache
9+
.vscode-test/**

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ vsc-extension-quickstart.md
1111
backup
1212
*.vsix
1313
*.zip
14+
.vscode-test/**

README.md

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,50 @@
22

33
This is the official VSCode extension for the Lightning Blits framework.
44

5-
It provides syntax highlighting, code completion, error checking, and other features to make working with Blits easier.
5+
Blits is a **lightweight, high-performance frontend framework** for **Lightning 3 applications**. This VSCode extension enhances the development experience by providing **rich language support** for Blits templates, components, and the `.blits` file format.
66

77
## Features
88

9-
### Syntax Highlighting
9+
### **1. Syntax Highlighting**
10+
- Full support for Blits template syntax inside JavaScript and TypeScript files.
11+
- Dedicated syntax highlighting for `.blits` files, including **script and template sections**.
1012

11-
This extension enables syntax highlighting for the template in your Blits components.
13+
### **2. Code Completion (IntelliSense)**
14+
- Auto-suggestions for Blits **component names, attributes, and built-in directives**.
15+
- Supports both built-in and custom components inside **template strings and `.blits` files**.
16+
- Provides **context-aware** suggestions based on cursor position.
1217

13-
### Code Completion
18+
### **3. Commenting Support**
19+
- Enables **HTML-style commenting/uncommenting** for template sections.
20+
- Uses `<!-- -->` for templates and `//` for script sections.
1421

15-
The extension offers context-aware IntelliSense for the Blits framework, focusing specifically on component properties and names within template definitions. For code outside of these templates, the extension defers to VSCode's built-in IntelliSense.
22+
### **4. Custom `.blits` File Support**
23+
- Full **language support** for `.blits` files:
24+
- **Syntax highlighting**
25+
- **IntelliSense** for template and script sections
26+
- **Signature help** for component methods
27+
- **Hover information** for component props and attributes
28+
- **Error diagnostics** for template syntax
1629

17-
The code completion feature is designed to avoid suggesting duplicate component properties, providing a cleaner and more efficient coding experience.
30+
### **5. Code Formatting**
31+
- Automatic formatting of **Blits template strings** inside JS/TS files.
32+
- Auto-formats **entire `.blits` files on save**.
33+
- Configurable **Prettier-based** formatting settings.
1834

19-
### Commenting
20-
21-
The extension introduces an enhanced commenting feature for the XML-style templates within Blits components. Integrated seamlessly with the standard VSCode commenting shortcuts, this feature activates when the cursor is positioned within a Blits template or when a block of code within a template is selected. It enables rapid toggling of HTML-style comments (`<!--` and `-->`) without the need for manual insertion.
22-
23-
### Format-on-Save
24-
25-
The extension includes an auto-format feature for the template definitions in Blits components. This feature enhances the development experience by automatically formatting the templates upon saving the file.
26-
27-
When you save a Blits component file (.js or .ts), the extension automatically formats the template sections within the file. This ensures that your templates are consistently styled and easy to read. The formatting applies only to the template parts of your file, leaving the rest of your JavaScript or TypeScript code unchanged.
28-
29-
You can disable this feature by setting the `blits.autoFormat` configuration option to `false`.
35+
You can disable the auto-formatting feature by setting the `blits.autoFormat` configuration option to `false`.
3036

3137
The extension provides several configuration options to customize the auto-formatting feature. These settings allow you to tailor the formatting to your coding style and preferences.
3238

3339
#### Available Settings
3440

3541
###### Print Width (`blits.format.printWidth`): 120
36-
The line length that the printer will wrap on.
42+
The line length that the printer will wrap on.
3743

3844
###### Tab Width (`blits.format.tabWidth`): 2
3945
Indentation size.
4046

4147
###### Indent with Tabs (`blits.format.useTabs`): `false`
42-
When `true`, indents with tabs instead of spaces.
48+
When `true`, indents with tabs instead of spaces.
4349

4450
###### Print Semicolons (`blits.format.semi`): `false`
4551
Print semicolons at the ends of statements.
@@ -48,13 +54,13 @@ Print semicolons at the ends of statements.
4854
Use single quotes instead of double quotes.
4955

5056
###### Quoting Props (`blits.format.quoteProps`): `as-needed`
51-
When `as-needed`, adds quotes around object properties where required.
52-
When `consistent`, adds quotes around object properties where required, but only if your file contains a mix of quoted and unquoted properties.
53-
When `preserve`, keeps object properties unquoted.
57+
When `as-needed`, adds quotes around object properties where required.
58+
When `consistent`, adds quotes around object properties where required, but only if your file contains a mix of quoted and unquoted properties.
59+
When `preserve`, keeps object properties unquoted.
5460

5561
###### Trailing Comma (`blits.format.trailingComma`): `all`
56-
When `all`, adds trailing commas wherever possible.
57-
When `none`, removes trailing commas.
62+
When `all`, adds trailing commas wherever possible.
63+
When `none`, removes trailing commas.
5864
When `es5`, adds trailing commas wherever possible, but avoids adding trailing commas to function parameters.
5965

6066
###### Bracket Spacing (`blits.format.bracketSpacing`): `true`
@@ -70,3 +76,19 @@ To customize these settings, you can either modify the `.vscode/settings.json` f
7076
- Open your VSCode settings (either user or workspace settings).
7177
- Search for `Blits` to find all the relevant settings for the Blits extension.
7278
- Modify the settings as needed. Changes will be applied immediately.
79+
80+
81+
## Usage
82+
Once installed, the extension will automatically detect and provide **language support** for:
83+
- `.blits` files.
84+
- Blits templates inside JavaScript and TypeScript files in Blits apps.
85+
86+
### **Commands & Shortcuts**
87+
- **Toggle Comment** (`Ctrl + /` / `Cmd + /` on Mac): Comment/uncomment Blits template sections.
88+
89+
## Feedback & Contributions
90+
This extension is **open-source**. If you encounter issues or have feature requests, please visit the [GitHub Repository](https://github.com/lightning-js/blits-vscode-extension) and submit an issue or contribute to the codebase.
91+
92+
---
93+
94+
**Enhance your Blits development experience today! 🚀**

jsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"resolveJsonModule": true,
66
"module": "commonjs",
77
"target": "ES2020",
8-
"checkJs": false,
8+
"checkJs": true,
99
"lib": [
1010
"ES2020"
1111
]

package-lock.json

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

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"publisher": "lightningjs",
44
"displayName": "Lightning Blits",
55
"description": "Template syntax highlighting and code completion for the Lightning Blits framework",
6-
"version": "1.2.1",
6+
"version": "1.3.0",
77
"repository": {
88
"type": "git",
99
"url": "https://github.com/lightning-js/blits-vscode-extension.git"
@@ -203,6 +203,7 @@
203203
"dependencies": {
204204
"@babel/traverse": "^7.23.2",
205205
"fs-extra": "^11.1.1",
206+
"lodash": "^4.17.21",
206207
"prettier": "^2.8.8",
207208
"typescript": "^5.6.2"
208209
},

src/blitsFile/config/compilerOptions.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,6 @@ function updateCompilerOptions() {
159159
tsCompilerOptions = mergeCompilerOptions(baseCompilerOptions, tsSpecificOptions, tsUserConfig)
160160
jsCompilerOptions = mergeCompilerOptions(baseCompilerOptions, jsSpecificOptions, jsUserConfig)
161161

162-
log('Updated TypeScript Compiler Options:')
163-
console.log(tsCompilerOptions)
164-
165-
log('Updated JavaScript Compiler Options:')
166-
console.log(jsCompilerOptions)
167-
168162
notifyCompilerOptionsChanged()
169163
}
170164

src/blitsFile/virtualDocuments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function deleteVirtualFilesByUri(uri) {
5151
}
5252

5353
function getAllVirtualFiles() {
54-
return new Map(Array.from(virtualFiles.entries()).map(([key, value]) => [value.fileName, value]))
54+
return new Map(Array.from(virtualFiles.entries()).map(([, value]) => [value.fileName, value]))
5555
}
5656

5757
module.exports = {

0 commit comments

Comments
 (0)