Skip to content

Commit 92dcec5

Browse files
authored
Merge pull request #34 from lightning-js/release/v1.5.1
VS Code Release - v1.5.1
2 parents e667370 + e3d75fb commit 92dcec5

File tree

89 files changed

+10566
-4010
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+10566
-4010
lines changed

.eslintignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
out/**
77
*.vsix
88
*.zip
9+
dist/
10+
build/
11+
coverage/
912

1013
# Dependencies
1114
node_modules/**
@@ -35,3 +38,6 @@ vsc-extension-quickstart.md
3538

3639
# vscode test
3740
.vscode-test/**
41+
42+
# Test fixture files - these intentionally have import errors for testing
43+
test/fixtures/**

.eslintrc.json

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,40 @@
7575
},
7676
{
7777
"files": [
78-
"test/**/*.js"
78+
"vscode-extension/test/**/*.js"
7979
],
8080
"rules": {
8181
"no-unused-expressions": "off",
8282
"no-undef": "off"
8383
}
84+
},
85+
{
86+
"files": [
87+
"vscode-extension/test/fixtures/**/*.js"
88+
],
89+
"parserOptions": {
90+
"sourceType": "module"
91+
},
92+
"rules": {
93+
"no-unused-expressions": "off",
94+
"no-undef": "off",
95+
"no-unused-vars": "off",
96+
"import/no-unresolved": "off"
97+
}
98+
},
99+
{
100+
"files": [
101+
"vscode-extension/test/fixtures/**/*.blits"
102+
],
103+
"parserOptions": {
104+
"sourceType": "module"
105+
},
106+
"rules": {
107+
"no-unused-expressions": "off",
108+
"no-undef": "off",
109+
"no-unused-vars": "off",
110+
"import/no-unresolved": "off"
111+
}
84112
}
85113
]
86114
}

.github/workflows/release-extension.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
branches:
66
- main
7+
paths:
8+
- 'vscode-extension/**'
79

810
jobs:
911
package:
@@ -21,30 +23,35 @@ jobs:
2123
- name: Install Dependencies
2224
run: npm install
2325

26+
- name: Install monorepo dependencies
27+
run: npm install --workspaces
28+
2429
- name: Install vsce
2530
run: npm install -g @vscode/vsce
2631

27-
# Read package.json and set variables
32+
# Read package.json from vscode-extension folder and set variables
2833
- name: Read package.json
2934
run: |
30-
extension_name=$(node -p "require('./package.json').name")
31-
extension_version=$(node -p "require('./package.json').version")
35+
extension_name=$(node -p "require('./vscode-extension/package.json').name")
36+
extension_version=$(node -p "require('./vscode-extension/package.json').version")
3237
echo "EXTENSION_NAME=$extension_name" >> $GITHUB_ENV
3338
echo "EXTENSION_VERSION=$extension_version" >> $GITHUB_ENV
3439
3540
# fixme: run tests
36-
# - name: Run Tests
37-
# run: npm run test
41+
- name: Run Tests
42+
run: npm run test --workspace=vscode-extension
3843

3944
- name: Package Extension
40-
run: npx vsce package
45+
run: npm run vscode:package
4146

42-
# Rename the vsix file
47+
# Rename the vsix file (adjusting path for monorepo)
4348
- name: Rename VSIX
49+
working-directory: vscode-extension
4450
run: mv *.vsix ${{ env.EXTENSION_NAME }}.v${{ env.EXTENSION_VERSION }}.vsix
4551

4652
# Create GitHub Pre Release and Upload VSIX
4753
- name: Create GitHub Pre Release and Upload VSIX
54+
working-directory: vscode-extension
4855
run: |
4956
gh auth login --with-token <<< "${{ secrets.GITHUB_TOKEN }}"
5057
gh release create v${{ env.EXTENSION_VERSION }} ./${{ env.EXTENSION_NAME }}.v${{ env.EXTENSION_VERSION }}.vsix --prerelease -t "blits-vscode v${{ env.EXTENSION_VERSION }}" -n "Version ${{ env.EXTENSION_VERSION }} of ${{ env.EXTENSION_NAME }}"

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
node_modules
2-
/*.vsix
32
out
43
.DS_Store
54
backup
65
*.vsix
76
*.zip
87
.eslintcache
9-
.vscode-test/**
10-
src/parsers/testParser.js
11-
./test
12-
*.test.js
8+
.vscode-test

.vscode/launch.json

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,28 @@
33
// Hover to view descriptions of existing attributes.
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
{
6-
"version": "0.2.0",
7-
"configurations": [
8-
{
9-
"name": "Run Extension",
6+
"version": "0.2.0",
7+
"configurations": [
8+
{
9+
"name": "Run VSCode Extension",
1010
"type": "extensionHost",
1111
"request": "launch",
1212
"runtimeExecutable": "${execPath}",
13-
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
13+
"args": [
14+
"--disable-extensions",
15+
"--extensionDevelopmentPath=${workspaceFolder}/vscode-extension",
16+
],
1417
"preLaunchTask": "esbuild: watch",
15-
"outFiles": ["${workspaceFolder}/out/**/*.js"]
18+
"outFiles": ["${workspaceFolder}/vscode-extension/out/**/*.js"]
1619
},
1720
{
1821
"name": "Extension Tests",
1922
"type": "extensionHost",
2023
"request": "launch",
2124
"args": [
22-
"--extensionDevelopmentPath=${workspaceFolder}",
23-
"--extensionTestsPath=${workspaceFolder}/test/suite/index"
25+
"--extensionDevelopmentPath=${workspaceFolder}/vscode-extension",
26+
"--extensionTestsPath=${workspaceFolder}/vscode-extension/test/suite/index"
2427
]
25-
},
26-
{
27-
"type": "node",
28-
"request": "launch",
29-
"name": "Debug test-template-errors",
30-
"program": "${workspaceFolder}/test-template-errors.js"
3128
}
32-
]
29+
]
3330
}

.vscode/tasks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{
66
"label": "esbuild: watch",
77
"type": "shell",
8-
"command": "npm run esbuild-base -- --sourcemap --watch",
8+
"command": "npm run esbuild-watch --workspace=vscode-extension",
99
"isBackground": true,
1010
"problemMatcher": {
1111
"base": "$tsc-watch",

README.md

Lines changed: 18 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,28 @@
1-
# Lightning Blits VS Code extension
1+
# Blits Development Tools
22

3-
This is the official VSCode extension for the Lightning Blits framework.
3+
This repo contains official development tools for the [Lightning Blits](https://lightningjs.io/) framework, mainly the Lightning Blits VSCode extension and support packages for linting and formatting.
44

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.
5+
## Packages
66

7-
## Usage
7+
### [VSCode Extension](./vscode-extension)
88

9-
Once installed, the extension will automatically detect and provide **language support** for:
10-
- `.blits` files.
11-
- Blits templates inside JavaScript and TypeScript files in Blits apps.
9+
The official VSCode extension for Lightning Blits provides essential IDE features for developing Blits applications:
1210

13-
### **Commands & Shortcuts**
11+
- Template syntax highlighting for `.blits` files and template strings
12+
- Code completion for components and attributes
13+
- IntelliSense for Blits APIs
1414

15-
- **Toggle Comment** (`Ctrl + /` / `Cmd + /` on Mac): Comment/uncomment Blits template sections.
15+
### [ESLint Plugin](./eslint-plugin-blits)
1616

17-
## Features
17+
ESLint plugin for Blits framework applications:
18+
- Linting support for `.blits` files
19+
- Analysis for JS/TS template literals
20+
- Custom rules optimized for Blits development
1821

19-
### **1. Syntax Highlighting**
22+
### [Prettier Plugin](./prettier-plugin-blits)
2023

21-
- Full support for Blits template syntax inside JavaScript and TypeScript files.
22-
- Dedicated syntax highlighting for `.blits` files, including **script and template sections**.
24+
Prettier formatting plugin for Blits templates:
25+
- Consistent formatting for `.blits` files
26+
- Template string formatting in JS/TS files
27+
- Configurable formatting options
2328

24-
### **2. Code Completion (IntelliSense)**
25-
26-
- Auto-suggestions for Blits **component names, attributes, and built-in directives**.
27-
- Supports both built-in and custom components inside **template strings and `.blits` files**.
28-
- Provides **context-aware** suggestions based on cursor position.
29-
30-
### **3. Commenting Support**
31-
32-
- Enables **HTML-style commenting/uncommenting** for template sections.
33-
- Uses `<!-- -->` for templates and `//` for script sections.
34-
35-
### **4. Custom `.blits` File Support**
36-
37-
- Full **language support** for `.blits` files:
38-
- **Syntax highlighting**
39-
- **IntelliSense** for template and script sections
40-
- **Signature help** for component methods
41-
- **Hover information** for component props and attributes
42-
- **Error diagnostics** for template syntax
43-
44-
### **5. Code Snippets**
45-
46-
Enhance your coding efficiency with built-in snippets for Blits development. These snippets provide templates for common structures and patterns in Blits applications, helping you write code more quickly and consistently across JavaScript, TypeScript, and `.blits` files.
47-
48-
| Snippet Prefix | Description |
49-
|----------------|-------------|
50-
| `blits-file` | Creates a basic `.blits` file structure with template and script sections |
51-
| `blits-component` | Scaffolds a complete Blits component structure in JS/TS files |
52-
| `blits-input` | Adds customizable input handler methods with selectable key options |
53-
| `blits-input-block` | Inserts a complete input object with handlers for all common keys |
54-
| `blits-hooks` | Adds individual lifecycle hook methods with method selection |
55-
| `blits-hooks-block` | Inserts all major lifecycle hooks at once (init, ready, focus, unfocus, destroy) |
56-
| `blits-attribute-transition` | Creates attribute transition syntax for animations in template strings |
57-
58-
### **6. Code Formatting**
59-
60-
- Automatic formatting of **Blits template strings** inside JS/TS files.
61-
- Auto-formats **entire `.blits` files on save**.
62-
- Configurable **Prettier-based** formatting settings.
63-
64-
You can disable the auto-formatting feature by setting the `blits.autoFormat` configuration option to `false`.
65-
66-
#### Available Settings
67-
68-
The extension provides several configuration options to customize the formatting experience:
69-
70-
| Setting | Default | Description |
71-
|---------|---------|-------------|
72-
| `blits.format.printWidth` | `120` | The line length that the printer will wrap on |
73-
| `blits.format.tabWidth` | `2` | Indentation size |
74-
| `blits.format.useTabs` | `false` | When `true`, indents with tabs instead of spaces |
75-
| `blits.format.semi` | `false` | Print semicolons at the ends of statements |
76-
| `blits.format.singleQuote` | `true` | Use single quotes instead of double quotes |
77-
| `blits.format.quoteProps` | `as-needed` | Controls when to quote object properties:<br>• `as-needed`: Only when required<br>• `consistent`: If any property requires quotes<br>• `preserve`: Respects original formatting |
78-
| `blits.format.trailingComma` | `all` | Controls trailing commas:<br>• `all`: Add wherever possible<br>• `none`: Remove all trailing commas<br>• `es5`: Add except in function parameters |
79-
| `blits.format.bracketSpacing` | `true` | Print spaces between brackets in object literals |
80-
| `blits.format.bracketSameLine` | `false` | Put the `>` of a multi-line tag at the end of the last line |
81-
82-
#### Customizing Settings
83-
84-
To customize these settings:
85-
86-
1. Open VSCode settings (File > Preferences > Settings or `Ctrl+,` / `Cmd+,` on Mac)
87-
2. Search for `Blits` to find all relevant settings
88-
3. Modify as needed - changes will be applied immediately
89-
90-
You can also edit the `.vscode/settings.json` file directly to configure these options.
91-
92-
## Feedback & Contributions
93-
94-
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.
95-
96-
---
97-
98-
**Enhance your Blits development experience today! 🚀**

0 commit comments

Comments
 (0)