Skip to content

Commit 24d6ea8

Browse files
committed
chore: tidy root — move PLAN/CONTRIBUTING, drop per-locale i18n
- Move PLAN.md -> docs/PLAN.md (internal modernization roadmap, fits with the rest of docs/). - Move CONTRIBUTING.md -> .github/CONTRIBUTING.md (GitHub auto-links it from PR templates). - Remove per-locale package.nls.<loc>.json and l10n/bundle.l10n.<loc>.json. Audience is English-speaking; vscode falls back to package.nls.json / bundle.l10n.json for any locale. History preserves the translations if internationalization is ever revived. - Update README link, AGENTS.md i18n section and PLAN.md path references, .vscodeignore.
1 parent ed0030b commit 24d6ea8

25 files changed

Lines changed: 10 additions & 278 deletions
File renamed without changes.

.vscodeignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ vsc-extension-quickstart.md
1414
**/*.ts
1515
test/**
1616
docs/**
17-
PLAN.md
17+
.github/**

AGENTS.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ CI (`.github/workflows/ci.yml`) runs lint → compile → compile-tests → `xvf
4040

4141
Entry: `src/extension.ts``Startup(config).run(context)` (in `src/ext/startup.ts`) which initializes the `Ctrl` service locator and registers commands, code actions, and optional syntax highlighting.
4242

43-
**Service locator pattern.** `Ctrl` (`src/util/controller.ts`) owns one instance each of `Configuration`, `Parser`, `Writer`, `Reader`, `Inject`, `Dialogues`, and `Logger`. Every command/provider receives `Ctrl` in its constructor and reaches services through it. PLAN.md Phase 2.1 marks this for replacement with proper DI — new code should be written so it can accept narrower interfaces later, not lean harder on `Ctrl`.
43+
**Service locator pattern.** `Ctrl` (`src/util/controller.ts`) owns one instance each of `Configuration`, `Parser`, `Writer`, `Reader`, `Inject`, `Dialogues`, and `Logger`. Every command/provider receives `Ctrl` in its constructor and reaches services through it. `docs/PLAN.md` Phase 2.1 marks this for replacement with proper DI — new code should be written so it can accept narrower interfaces later, not lean harder on `Ctrl`.
4444

45-
**Namespace barrel imports.** `src/index.ts` re-exports submodules as `J.Extension`, `J.Actions`, `J.Model`, `J.Util`, `J.Provider`. Existing code does `import * as J from '..'` and references `J.Util.Ctrl`, `J.Actions.Writer`, etc. PLAN.md Phase 2.3 marks this for replacement with named imports — prefer named imports in new files.
45+
**Namespace barrel imports.** `src/index.ts` re-exports submodules as `J.Extension`, `J.Actions`, `J.Model`, `J.Util`, `J.Provider`. Existing code does `import * as J from '..'` and references `J.Util.Ctrl`, `J.Actions.Writer`, etc. `docs/PLAN.md` Phase 2.3 marks this for replacement with named imports — prefer named imports in new files.
4646

4747
**Module responsibilities** (need multiple files to grasp):
4848

49-
- `src/ext/` — VS Code surface integration. `Configuration` (`conf.ts`) reads `journal.*` settings and resolves templates/scopes. `Dialogues` drives QuickPick/InputBox. `Startup` wires everything. i18n uses `vscode.l10n` — manifest strings in `package.nls*.json` at the repo root, runtime strings in `l10n/bundle.l10n*.json` (regenerated via `npm run l10n:export`).
49+
- `src/ext/` — VS Code surface integration. `Configuration` (`conf.ts`) reads `journal.*` settings and resolves templates/scopes. `Dialogues` drives QuickPick/InputBox. `Startup` wires everything. i18n uses `vscode.l10n` — manifest strings in `package.nls.json` (English-only); runtime strings in `l10n/bundle.l10n.json`. Per-locale `package.nls.<loc>.json` and `l10n/bundle.l10n.<loc>.json` were removed in 1.1.0 (audience is English-speaking; vscode falls back to the default bundle for any locale).
5050
- `src/actions/` — Core domain logic, no direct command bindings.
5151
- `Parser` — turns user input/URIs into structured `Input` (date, note, memo, task, weekly).
5252
- `Reader` — loads entries/notes from the configured base directory using `vscode.workspace.fs`.
@@ -62,13 +62,13 @@ Entry: `src/extension.ts` → `Startup(config).run(context)` (in `src/ext/startu
6262

6363
**Smart-input flow.** User triggers `journal.day` (`Ctrl+Shift+J`) → `Dialogues` shows InputBox → `MatchInput.parseInput()` classifies the text (date expression, weekday, "memo:", "task:", "note ...", week reference) → command dispatches to `Reader`/`Writer`/`Inject`. The default path/file patterns (`${base}/${year}/${month}/${day}` for notes, `${base}/${year}/${month}/${day}.${ext}` for entries) come from `journal.patterns` in `package.json`.
6464

65-
**Filesystem.** Always go through `vscode.workspace.fs` (the extension declares `extensionKind: ["workspace"]` so it runs on the remote host for Remote SSH/Codespaces). Avoid raw `fs` / `fs.promises` in new code — PLAN.md Phase 1.3 finished migrating the old `fs` call sites; do not reintroduce them.
65+
**Filesystem.** Always go through `vscode.workspace.fs` (the extension declares `extensionKind: ["workspace"]` so it runs on the remote host for Remote SSH/Codespaces). Avoid raw `fs` / `fs.promises` in new code — `docs/PLAN.md` Phase 1.3 finished migrating the old `fs` call sites; do not reintroduce them.
6666

6767
**Templates.** All user-facing inserted content comes from `journal.templates` (array of `{name, template, after?}`). Lookup happens via `Configuration.getInlineTemplate(name, fallback)`. Default template names: `memo`, `task`, `entry`, `time`, `note`, `files`, `weekly`. Issue #167 was a name-mismatch bug (`week` vs `weekly`) — when adding a new template type, register the name consistently in `package.json` defaults and the consumer.
6868

6969
## Notes for changes
7070

71-
- `PLAN.md` is the active modernization roadmap. Phases 0 and 1 are complete; Phase 2+ is open. Match the direction in the plan (DI, named imports, native `async`/`await` instead of `new Promise()` wrappers, `vscode.workspace.fs`, replacing moment with `Intl`/`date-fns`).
71+
- `docs/PLAN.md` is the active modernization roadmap. Phases 0 and 1 are complete; Phase 2+ is open. Match the direction in the plan (DI, named imports, native `async`/`await` instead of `new Promise()` wrappers, `vscode.workspace.fs`, replacing moment with `Intl`/`date-fns`).
7272
- ESLint flat config (`eslint.config.mjs`) enforces `curly`, `eqeqeq`, `no-throw-literal`, `semi`. Import naming must be `camelCase` or `PascalCase`.
7373
- `tsconfig.json` runs `strict`, `noImplicitReturns`, `noFallthroughCasesInSwitch`. The bundle goes through esbuild, but tests are compiled via `tsc` — both must succeed for `npm test`.
7474
- `docs/` contains user-facing feature docs (entries, notes, memos, tasks, scopes, settings, codeactions) and `docs/analysis/` holds the analysis that produced `PLAN.md`.
@@ -90,10 +90,10 @@ Entry: `src/extension.ts` → `Startup(config).run(context)` (in `src/ext/startu
9090
- `getDateFromURIAndConfig` (`src/util/paths.ts`) — parses a `Date` from a journal entry file path. Anchor detection for navigation features.
9191
- `vscode.Uri.joinPath` for composing FS URIs. `vscode.workspace.fs.readDirectory` returns `[name, FileType][]`.
9292

93-
## i18n quirks
93+
## i18n
9494

95-
- `package.nls.json` (English/default) carries BOTH command titles AND configuration descriptions. Locale files `package.nls.<loc>.json` carry ONLY command titles — config descriptions are not localized via NLS keys today.
96-
- Runtime strings live in `l10n/bundle.l10n.<loc>.json` for all eleven locales. Add new keys to all 11 when introducing user-facing toast / prompt strings.
95+
- English-only. `package.nls.json` carries command titles and configuration descriptions consumed by the VS Code manifest. Runtime user-facing strings (toasts, prompts) go in `l10n/bundle.l10n.json` and are looked up via `vscode.l10n.t()`.
96+
- Per-locale `package.nls.<loc>.json` and `l10n/bundle.l10n.<loc>.json` files were removed in 1.1.0. If the project ever needs to re-internationalize, restore both sets from git history (`git log --diff-filter=D --name-only -- package.nls.*.json l10n/bundle.l10n.*.json`).
9797

9898
## Spec/plan workflow
9999

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Press `Ctrl+Shift+J` to open the journal's smart input and start typing right aw
3838
The notes are stored in a folder on your desktop using the following structure (taking ZIM Desktop wiki as inspiration: `year/month/day.md`, the notes files for October 22th would be `../2016/10/22.md`. Detailed notes (e.g. meeting notes) are placed in the subfolder `../2016/10/22/some-meeting-notes.md`.
3939

4040
## Contributing
41-
I am always looking for feedback, new ideas and your help. Check the [contribution guidelines](./CONTRIBUTING.md)
41+
I am always looking for feedback, new ideas and your help. Check the [contribution guidelines](./.github/CONTRIBUTING.md)
4242

4343
## Suggested extensions
4444
vscode-journal is mainly responsible for organizing your notes and journal entries, it does not come with any user interface (besides the smart input). If you prefer tree like views for your notes and tasks, have a look at the following extensions by Gruntfuggly and Kortina
File renamed without changes.

l10n/bundle.l10n.ar.json

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

l10n/bundle.l10n.de.json

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

l10n/bundle.l10n.es.json

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

l10n/bundle.l10n.fr.json

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

l10n/bundle.l10n.it.json

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

0 commit comments

Comments
 (0)