Skip to content

Commit aeaaa9f

Browse files
authored
Merge pull request #227 from pajoma/develop
release: merge develop into main
2 parents 28270e6 + 9a4d1a1 commit aeaaa9f

218 files changed

Lines changed: 21014 additions & 11708 deletions

File tree

Some content is hidden

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

.eslintrc.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/CONTRIBUTING.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
# Contributing to VSCode-Journal
2+
Thank you so much for your interest in contributing! All types of contributions are encouraged and valued.
3+
4+
## About the Project
5+
I have been writing notes every day for over 10 years and still use this extension all the time. In the beginning only with Notepad and other text editors. When the first version of Visual Studio Code came out, I saw an opportunity to get to know Typescript better and started developing this extension. That's why I mainly focus on ideas and extensions that help me in my daily work.
6+
7+
The source code reflects this journey. A bit bumpy at the beginning (and still today for sure, all this javascript stuff makes me doubt myself often enough), but it got a bit better with the years.
8+
9+
## How to contribute
10+
11+
There are several ways to contribute.
12+
13+
* If you find any issues, weird behaviour or plain error, don't hesitate to [open an issue](https://github.com/pajoma/vscode-journal/issues/new). I try to react timely, but don't count on it.
14+
* [Start a discussion](https://github.com/pajoma/vscode-journal/discussions/new) if you have question or feature requests. Or see if there are any other unanswered questions you might be able to answer.
15+
* Leave a review on the [marketplace](https://marketplace.visualstudio.com/items?itemName=pajoma.vscode-journal&ssr=false#review-details) and keep me motivated ;)
16+
* Let me buy a beer by [sponsoring](https://github.com/sponsors/pajoma) my work here
17+
18+
If you plan to contribute with updates to the source, follow these steps
19+
20+
* Outline your idea in the discussions.
21+
* Talk to me on [Gitter](https://gitter.im/dictyo) for further questions.
22+
* Create a fork, do your thing, and create a pull request. Please write tests if possible.
23+
24+
## Prerequisites
25+
26+
* [Node.js](https://nodejs.org/) v20 or later (includes npm)
27+
* [Visual Studio Code](https://code.visualstudio.com/) v1.118 or later
28+
29+
## Building the Extension
30+
31+
1. **Clone the repository** and install dependencies:
32+
33+
```bash
34+
git clone https://github.com/pajoma/vscode-journal.git
35+
cd vscode-journal
36+
npm install
37+
```
38+
39+
2. **Compile the extension** (bundles `src/extension.ts``dist/extension.js` via esbuild):
40+
41+
```bash
42+
npm run compile
43+
```
44+
45+
3. **Watch mode** — recompiles automatically on file changes:
46+
47+
```bash
48+
npm run watch
49+
```
50+
51+
4. **Production build** (minified, no source maps):
52+
53+
```bash
54+
npm run package
55+
```
56+
57+
5. **Lint** the source code:
58+
59+
```bash
60+
npm run lint
61+
```
62+
63+
## Running the Extension in VS Code
64+
65+
Open the project folder in VS Code. The recommended workflow:
66+
67+
1. Press **F5** (or select **Run → Start Debugging**).
68+
This launches the **"Run Extension"** configuration, which:
69+
- Runs `npm run watch` as a pre-launch task (auto-rebuilds on changes)
70+
- Opens a new VS Code window (Extension Development Host) with the extension loaded
71+
- Uses `test/ws_manual/` as the workspace folder
72+
73+
2. To run **without a workspace**, select the **"Run Extension without Workspace"** launch configuration from the debug dropdown.
74+
75+
3. Make changes to the source code — esbuild will rebuild automatically. Reload the Extension Development Host window (`Ctrl+R` / `Cmd+R`) to pick up changes.
76+
77+
## Running Tests
78+
79+
Tests are executed inside a VS Code Extension Host using [`@vscode/test-cli`](https://github.com/nicolo-ribaudo/vscode-test-cli).
80+
81+
* **From the terminal** (runs the full pretest + test pipeline):
82+
83+
```bash
84+
npm test
85+
```
86+
87+
This will compile tests (`tsc``out/`), compile the extension (`esbuild``dist/`), lint, and then run the test suite.
88+
89+
* **From VS Code**: select the **"Extension Tests"** launch configuration and press **F5**. This compiles both the extension and tests in watch mode, then runs the tests in the Extension Development Host.
90+
91+
* **Compile tests only** (without running them):
92+
93+
```bash
94+
npm run compile-tests
95+
```
96+
97+
## Project Structure
98+
99+
```
100+
src/
101+
├── extension.ts # Extension entry point (activate/deactivate)
102+
├── ext/ # VS Code integration (config, startup, dialogues)
103+
├── actions/ # Business logic (reader, writer, inject, parser)
104+
├── model/ # Data types and interfaces
105+
├── provider/ # Commands, code actions, features
106+
├── util/ # Utilities (controller, logger, dates, paths, strings)
107+
└── test/ # Test suites
108+
```
109+
110+
Key build files:
111+
- `esbuild.mjs` — Build script (replaces webpack)
112+
- `eslint.config.mjs` — ESLint flat config
113+
- `.vscode-test.mjs` — Test runner configuration
114+
- `tsconfig.json` — TypeScript compiler options
115+
116+
## Code of conduct
117+
118+
Just be decent.

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- develop
9+
pull_request:
10+
11+
jobs:
12+
lint-build-test:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 20
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
node-version: ["20", "22"]
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Node.js ${{ matrix.node-version }}
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: npm
29+
30+
- name: Install dependencies
31+
run: npm install
32+
33+
- name: Lint
34+
run: npm run lint
35+
36+
- name: Build extension
37+
run: npm run compile
38+
39+
- name: Build tests
40+
run: npm run compile-tests
41+
42+
- name: Run extension tests
43+
run: xvfb-run -a npm test

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 20
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: "20"
24+
cache: npm
25+
26+
- name: Install dependencies
27+
run: npm install
28+
29+
- name: Build extension
30+
run: npm run compile
31+
32+
- name: Build tests
33+
run: npm run compile-tests
34+
35+
- name: Run extension tests
36+
run: xvfb-run -a npm test
37+
38+
- name: Read version
39+
id: package-version
40+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
41+
42+
- name: Package extension
43+
run: npx @vscode/vsce package
44+
45+
- name: Create GitHub Release
46+
uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2
47+
with:
48+
tag_name: v${{ steps.package-version.outputs.version }}
49+
name: vscode-journal v${{ steps.package-version.outputs.version }}
50+
files: "*.vsix"
51+
generate_release_notes: true

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ src/*.js
99
*.log
1010
*.old
1111
test/workspace
12+
test/test
13+
.vscode-test
14+
15+
# Maintainer-local Claude Code memory; shared guidance lives in AGENTS.md
16+
CLAUDE.md

.vscode-test.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from '@vscode/test-cli';
2+
3+
export default defineConfig({
4+
files: 'out/test/suite/**/*.test.js',
5+
workspaceFolder: './test/ws_unittests',
6+
mocha: {
7+
ui: 'tdd',
8+
timeout: 20000,
9+
},
10+
});

.vscode/extensions.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// See http://go.microsoft.com/fwlink/?LinkId=827846
33
// for the documentation about the extensions.json format
44
"recommendations": [
5-
"dbaeumer.vscode-eslint",
6-
"eamodio.tsl-problem-matcher"
5+
"dbaeumer.vscode-eslint"
76
]
8-
}
7+
}

.vscode/launch.json

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,34 @@
1010
"type": "extensionHost",
1111
"request": "launch",
1212
"args": [
13-
"--extensionDevelopmentPath=${workspaceFolder}",
13+
"--extensionDevelopmentPath=${workspaceFolder}",
1414
"${workspaceFolder}/test/ws_manual/"
1515
],
1616
"outFiles": [
1717
"${workspaceFolder}/dist/**/*.js"
1818
],
1919
"preLaunchTask": "${defaultBuildTask}"
2020
},
21+
{
22+
"name": "Run Extension without Workspace",
23+
"type": "extensionHost",
24+
"request": "launch",
25+
"args": [
26+
"--extensionDevelopmentPath=${workspaceFolder}",
27+
"${workspaceFolder}/test/ws_empty/"
28+
],
29+
"outFiles": [
30+
"${workspaceFolder}/dist/**/*.js"
31+
],
32+
"preLaunchTask": "${defaultBuildTask}"
33+
},
2134
{
2235
"name": "Extension Tests",
2336
"type": "extensionHost",
2437
"request": "launch",
2538
"args": [
2639
"--extensionDevelopmentPath=${workspaceFolder}",
27-
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index",
40+
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index",
2841
"${workspaceFolder}/test/ws_unittests/"
2942
],
3043
"outFiles": [
@@ -34,4 +47,4 @@
3447
"preLaunchTask": "tasks: watch-tests"
3548
}
3649
]
37-
}
50+
}

.vscode/tasks.json

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,22 @@
44
"version": "2.0.0",
55
"tasks": [
66
{
7+
"label": "watch",
78
"type": "npm",
89
"script": "watch",
9-
"problemMatcher": [
10-
"$ts-webpack-watch",
11-
"$tslint-webpack-watch"
12-
],
10+
"problemMatcher": {
11+
"owner": "typescript",
12+
"fileLocation": "absolute",
13+
"pattern": {
14+
"regexp": "^✘ \\[ERROR\\] (.+)$",
15+
"message": 1
16+
},
17+
"background": {
18+
"activeOnStart": true,
19+
"beginsPattern": "^\\[watch\\] build started$",
20+
"endsPattern": "^\\[watch\\] build finished$"
21+
}
22+
},
1323
"isBackground": true,
1424
"presentation": {
1525
"reveal": "never",
@@ -21,6 +31,7 @@
2131
}
2232
},
2333
{
34+
"label": "watch-tests",
2435
"type": "npm",
2536
"script": "watch-tests",
2637
"problemMatcher": "$tsc-watch",
@@ -34,18 +45,25 @@
3445
{
3546
"label": "tasks: watch-tests",
3647
"dependsOn": [
37-
"npm: watch",
38-
"npm: watch-tests"
48+
"watch",
49+
"watch-tests"
3950
],
4051
"problemMatcher": []
4152
},
4253
{
54+
"label": "compile",
55+
"type": "npm",
56+
"script": "compile",
57+
"group": "build",
58+
"problemMatcher": []
59+
},
60+
{
61+
"label": "compile-tests",
4362
"type": "npm",
4463
"script": "compile-tests",
4564
"group": "build",
4665
"problemMatcher": [],
47-
"label": "npm: compile-tests",
48-
"detail": "tsc -p . --outDir out"
66+
"detail": "tsc -p . --outDir out"
4967
}
5068
]
5169
}

.vscodeignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ node_modules/**
55
src/**
66
.gitignore
77
.yarnrc
8-
webpack.config.js
8+
esbuild.mjs
9+
eslint.config.mjs
10+
.vscode-test.mjs
911
vsc-extension-quickstart.md
1012
**/tsconfig.json
11-
**/.eslintrc.json
1213
**/*.map
1314
**/*.ts
1415
test/**
16+
docs/**
17+
.github/**

0 commit comments

Comments
 (0)