From e157e6826c56259617d5d2f8e73faf9403000e73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20James=20G=2E=20Ermita=C3=B1o?= Date: Fri, 31 Jul 2026 12:58:27 +0200 Subject: [PATCH 01/11] chore: drop the .remember/ ignore rules now the tree is gone --- .gitignore | 4 +--- .vscodeignore | 1 - 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 607027c..091799c 100644 --- a/.gitignore +++ b/.gitignore @@ -19,9 +19,7 @@ Thumbs.db # Local-only working trees — kept on disk, never committed. # NOTE: qa/ is deliberately TRACKED in this repo, unlike the other three — never add it here. tools/ -# Agent session state. Self-ignored by .remember/.gitignore too; named here so the tree stays -# ignored even if that file is ever lost. -.remember/ +# Agent session state. .claude/ # Local media — masters and cards that never enter the tree diff --git a/.vscodeignore b/.vscodeignore index 64276b8..845a6a1 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -31,7 +31,6 @@ snippets/**/README.md # Self-ignored from git, so they never appear in `git status` — but vsce packages # from disk, not from git, and would otherwise ship them. Must stay named here. .claude/** -.remember/** # Demo media — the README loads these from GitHub, so the package stays lean. # .mov are the convert-to-gif masters. images/icon.png is the Marketplace icon From 3f348c5760610aa817da7d1b28aa226fd6f2e689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20James=20G=2E=20Ermita=C3=B1o?= Date: Fri, 31 Jul 2026 12:58:27 +0200 Subject: [PATCH 02/11] feat(nls): localize the display name and description for eight locales --- package.json | 4 ++-- package.nls.de.json | 4 ++++ package.nls.es.json | 4 ++++ package.nls.fr.json | 4 ++++ package.nls.ja.json | 4 ++++ package.nls.json | 4 ++++ package.nls.pt-br.json | 4 ++++ package.nls.ru.json | 4 ++++ package.nls.tr.json | 4 ++++ package.nls.zh-cn.json | 4 ++++ 10 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 package.nls.de.json create mode 100644 package.nls.es.json create mode 100644 package.nls.fr.json create mode 100644 package.nls.ja.json create mode 100644 package.nls.json create mode 100644 package.nls.pt-br.json create mode 100644 package.nls.ru.json create mode 100644 package.nls.tr.json create mode 100644 package.nls.zh-cn.json diff --git a/package.json b/package.json index f2652f6..8dd0769 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,8 @@ "name": "John James Ermitaño", "email": "jjgermitano@gmail.com" }, - "displayName": "NativeScript Snippets — Angular, Core, Vue, React, Svelte", - "description": "NativeScript UI snippets for every flavor — Angular (HTML), Core (XML), Vue, React, and Svelte. Component, layout, and gesture snippets generated from @nativescript/core types, so they stay accurate.", + "displayName": "%displayName%", + "description": "%description%", "version": "1.0.1", "icon": "images/icon.png", "categories": [ diff --git a/package.nls.de.json b/package.nls.de.json new file mode 100644 index 0000000..1f611f0 --- /dev/null +++ b/package.nls.de.json @@ -0,0 +1,4 @@ +{ + "displayName": "NativeScript-Snippets — Angular, Core, Vue, React, Svelte", + "description": "NativeScript-UI-Snippets für alle Varianten – Angular (HTML), Core (XML), Vue, React und Svelte. Komponenten-, Layout- und Gesten-Snippets werden aus den @nativescript/core-Typen generiert und bleiben dadurch stets korrekt." +} diff --git a/package.nls.es.json b/package.nls.es.json new file mode 100644 index 0000000..a16cdb7 --- /dev/null +++ b/package.nls.es.json @@ -0,0 +1,4 @@ +{ + "displayName": "Fragmentos de NativeScript: Angular, Core, Vue, React, Svelte", + "description": "Fragmentos de interfaz de NativeScript para todas las variantes: Angular (HTML), Core (XML), Vue, React y Svelte. Los fragmentos de componentes, diseños y gestos se generan a partir de los tipos de @nativescript/core, por lo que siempre son precisos." +} diff --git a/package.nls.fr.json b/package.nls.fr.json new file mode 100644 index 0000000..9015cb6 --- /dev/null +++ b/package.nls.fr.json @@ -0,0 +1,4 @@ +{ + "displayName": "Extraits NativeScript — Angular, Core, Vue, React, Svelte", + "description": "Extraits d'interface NativeScript pour toutes les variantes : Angular (HTML), Core (XML), Vue, React et Svelte. Les extraits de composants, de mises en page et de gestes sont générés à partir des types @nativescript/core, ils restent donc exacts." +} diff --git a/package.nls.ja.json b/package.nls.ja.json new file mode 100644 index 0000000..e9a9503 --- /dev/null +++ b/package.nls.ja.json @@ -0,0 +1,4 @@ +{ + "displayName": "NativeScript スニペット — Angular、Core、Vue、React、Svelte", + "description": "あらゆるフレーバーに対応した NativeScript UI スニペット — Angular (HTML)、Core (XML)、Vue、React、Svelte。コンポーネント、レイアウト、ジェスチャーのスニペットは @nativescript/core の型から生成されるため、常に正確です。" +} diff --git a/package.nls.json b/package.nls.json new file mode 100644 index 0000000..4e56db8 --- /dev/null +++ b/package.nls.json @@ -0,0 +1,4 @@ +{ + "displayName": "NativeScript Snippets — Angular, Core, Vue, React, Svelte", + "description": "NativeScript UI snippets for every flavor — Angular (HTML), Core (XML), Vue, React, and Svelte. Component, layout, and gesture snippets generated from @nativescript/core types, so they stay accurate." +} diff --git a/package.nls.pt-br.json b/package.nls.pt-br.json new file mode 100644 index 0000000..3b97450 --- /dev/null +++ b/package.nls.pt-br.json @@ -0,0 +1,4 @@ +{ + "displayName": "Snippets do NativeScript — Angular, Core, Vue, React, Svelte", + "description": "Snippets de interface do NativeScript para todos os sabores: Angular (HTML), Core (XML), Vue, React e Svelte. Snippets de componentes, layouts e gestos gerados a partir dos tipos do @nativescript/core, por isso permanecem sempre precisos." +} diff --git a/package.nls.ru.json b/package.nls.ru.json new file mode 100644 index 0000000..127dbb4 --- /dev/null +++ b/package.nls.ru.json @@ -0,0 +1,4 @@ +{ + "displayName": "Сниппеты NativeScript — Angular, Core, Vue, React, Svelte", + "description": "Сниппеты интерфейса NativeScript для всех вариантов — Angular (HTML), Core (XML), Vue, React и Svelte. Сниппеты компонентов, макетов и жестов создаются из типов @nativescript/core, поэтому всегда остаются точными." +} diff --git a/package.nls.tr.json b/package.nls.tr.json new file mode 100644 index 0000000..3afb593 --- /dev/null +++ b/package.nls.tr.json @@ -0,0 +1,4 @@ +{ + "displayName": "NativeScript Parçacıkları — Angular, Core, Vue, React, Svelte", + "description": "Her çeşit için NativeScript arayüz parçacıkları — Angular (HTML), Core (XML), Vue, React ve Svelte. Bileşen, düzen ve hareket parçacıkları @nativescript/core türlerinden üretilir, böylece her zaman doğru kalır." +} diff --git a/package.nls.zh-cn.json b/package.nls.zh-cn.json new file mode 100644 index 0000000..7b5736c --- /dev/null +++ b/package.nls.zh-cn.json @@ -0,0 +1,4 @@ +{ + "displayName": "NativeScript 代码片段 — Angular、Core、Vue、React、Svelte", + "description": "适用于所有风格的 NativeScript UI 代码片段 — Angular (HTML)、Core (XML)、Vue、React 和 Svelte。组件、布局和手势代码片段均从 @nativescript/core 类型生成,因此始终保持准确。" +} From 446784f185ba2993a3294a94919d7056b0bb20f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20James=20G=2E=20Ermita=C3=B1o?= Date: Fri, 31 Jul 2026 12:58:27 +0200 Subject: [PATCH 03/11] docs(readme): add the Open VSX and Sponsors badges and Open VSX links --- README.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cc1ded9..d5f8c72 100644 --- a/README.md +++ b/README.md @@ -4,15 +4,20 @@ [![installs][installs-badge]][package] [![downloads][downloads-badge]][package] [![rating][rating-badge]][package] -[![license][license-badge]][repo] +[![open vsx][ovsx-badge]][open-vsx] [![vscode][vscode-badge]][package] +[![license][license-badge]][repo] + +[![sponsor][sponsor-badge]][sponsors] [version-badge]: https://vsmarketplacebadges.dev/version-short/ElecTreeFrying.nativescript-angular-html-snippets.png [installs-badge]: https://vsmarketplacebadges.dev/installs-short/ElecTreeFrying.nativescript-angular-html-snippets.png [downloads-badge]: https://vsmarketplacebadges.dev/downloads-short/ElecTreeFrying.nativescript-angular-html-snippets.png [rating-badge]: https://vsmarketplacebadges.dev/rating-short/ElecTreeFrying.nativescript-angular-html-snippets.png -[license-badge]: https://img.shields.io/github/license/ElecTreeFrying/nativescript-snippets +[ovsx-badge]: https://img.shields.io/open-vsx/v/ElecTreeFrying/nativescript-angular-html-snippets [vscode-badge]: https://img.shields.io/badge/vscode-%3E%3D1.30.0-blue +[license-badge]: https://img.shields.io/github/license/ElecTreeFrying/nativescript-snippets +[sponsor-badge]: https://img.shields.io/badge/GitHub_Sponsors-ea4aaa?logo=githubsponsors&logoColor=white [package]: https://marketplace.visualstudio.com/items?itemName=ElecTreeFrying.nativescript-angular-html-snippets [repo]: https://github.com/ElecTreeFrying/nativescript-snippets @@ -202,6 +207,7 @@ Most prefixes work in every flavor; a few are flavor-specific: `ActionBarExtensi - **Marketplace:** Extensions view (Cmd/Ctrl+Shift+X) → search **NativeScript Snippets** by *WinterNova5* → **Install**. - **CLI:** `code --install-extension ElecTreeFrying.nativescript-angular-html-snippets` - **Direct:** [VS Code Marketplace listing][package] +- **Direct (Open VSX):** [Open VSX listing][open-vsx] - **Cursor / Windsurf / VSCodium / Gitpod:** Search **NativeScript Snippets** in the Extensions panel — served via [Open VSX][open-vsx]. [open-vsx]: https://open-vsx.org/extension/ElecTreeFrying/nativescript-angular-html-snippets @@ -211,7 +217,7 @@ Most prefixes work in every flavor; a few are flavor-specific: `ActionBarExtensi ## Compatibility - **VS Code:** 1.30.0 or later. -- **Registries:** Available on both the [VS Code Marketplace][package] and [Open VSX][open-vsx]. +- **Registries:** Available on both the [VS Code Marketplace][package] and [Open VSX][open-vsx] — published by **WinterNova5**, a verified Open VSX publisher. - **Compatible hosts:** Cursor, Windsurf, VSCodium, Gitpod, Code Server, and other forks that implement the VS Code API at the same engine version — installable directly from their Extensions panel via Open VSX. - **Web:** Runs on [vscode.dev](https://vscode.dev) and [github.dev](https://github.dev) — it's a pure declarative extension, so there's no native code to hold it back. - **Languages:** Angular (`html`), Core (`xml`), and React (`typescriptreact`/`javascriptreact`) work out of the box; Vue and Svelte require the **Vue (Volar)** / **Svelte** language extensions. @@ -274,9 +280,10 @@ See [SPEC.md][SPEC] for the snippet grammar and generation pipeline — behavior ## Related -- **[All extensions by WinterNova5][all]** on the VS Code Marketplace. +- **[All extensions by WinterNova5][all]** on the VS Code Marketplace — and on [Open VSX][all-ovsx]. [all]: https://marketplace.visualstudio.com/publishers/ElecTreeFrying +[all-ovsx]: https://open-vsx.org/namespace/ElecTreeFrying --- From 71341f430c6ce3ff27516946849801fdba6324c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20James=20G=2E=20Ermita=C3=B1o?= Date: Fri, 31 Jul 2026 12:58:27 +0200 Subject: [PATCH 04/11] docs: add a code of conduct, contributing guide, and security policy --- .github/CODE_OF_CONDUCT.md | 130 +++++++++++++++++++++++++++++++++++++ .github/CONTRIBUTING.md | 82 +++++++++++++++++++++++ .github/SECURITY.md | 66 +++++++++++++++++++ 3 files changed, 278 insertions(+) create mode 100644 .github/CODE_OF_CONDUCT.md create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/SECURITY.md diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..8a8686f --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,130 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +**electreefrying.git@gmail.com**. + +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][mozilla]. + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at +https://www.contributor-covenant.org/translations. + +[homepage]: https://www.contributor-covenant.org +[mozilla]: https://github.com/mozilla/diversity diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..5b16c2f --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,82 @@ +# Contributing + +Thanks for wanting to help. Bug reports and feature requests are very welcome — but +please read the next section before you open a pull request, because this repository +works differently from most snippet extensions. + +## ⚠️ The snippets are generated, and the generator is not in this repository + +Every file under `snippets/`, all of `reference.md`, and the README's `## Snippets` +section are **build artifacts**. They are produced from the `@nativescript/core` +TypeScript types by a generator under `tools/` — and `tools/` is deliberately not +committed, so a fresh clone does not contain it. + +Two consequences, and they are the whole reason this section is first: + +1. **Hand-editing a snippet file is futile.** The next generator run overwrites it + wholesale. A PR that edits `snippets/**/*.json`, `reference.md`, or the README's + `## Snippets` block cannot be merged as-is, no matter how correct the change is. +2. **You cannot regenerate them yourself.** `npm run generate`, `npm run validate`, + and `npm run check` all live in `tools/`, so they will not run from a clone. + +**So: to change a snippet, open an issue instead of a PR.** Describe the element, the +flavor(s), and what the expansion should be. That is genuinely the fastest path — the +change gets made in the generator's curated data and regenerated, which is the only +way it will survive. + +This is not a brush-off. Snippet issues are the most useful reports this project gets. + +## What you *can* edit directly + +These are hand-maintained and normal PRs are welcome: + +- `README.md` — **everything except** the `## Snippets` section +- [`SPEC.md`](../SPEC.md) — the user-facing contract +- [`SUPPORT.md`](../SUPPORT.md) +- `CHANGELOG.md`, `LICENSE.md` +- `package.json` — metadata, categories, keywords +- Anything under `.github/` + +## What CI checks + +There is no build and no test framework — the published artifact is `package.json` +plus declarative JSON, and no code executes at runtime. CI verifies the one thing it +can from a clone: that every file `contributes.snippets` points at exists and parses +as valid JSON. The deeper structural and fidelity gates live in `tools/` and run +locally before a release. + +## Testing a snippet by hand + +Press F5 to open an Extension Development Host, open a file of the matching +language, and type the prefix. + +| Flavor | Language ID(s) | +|---|---| +| Angular | `html` | +| Core | `xml` | +| Vue | `vue` | +| React | `typescriptreact`, `javascriptreact` | +| Svelte | `svelte` | + +All prefixes start with `ns-`. Per element there is `ns-` (bare tag), +`ns--prop` (properties as tab stops), and `ns--comp` (properties, events, +and a doc comment). + +If a snippet does not appear, the language ID is almost always the reason — check the +one in the status bar against the table above. + +## Code style + +- **LF line endings**, enforced by `.gitattributes`. Snippet JSON is LF with 2-space + indent; a CRLF re-save produces an enormous phantom diff. +- Do not bump `version` in `package.json` — releases own that. + +[`CLAUDE.md`](../CLAUDE.md) documents the generation pipeline in full, if you want the +complete picture. + +## Reporting bugs + +Use the issue templates. [`SUPPORT.md`](../SUPPORT.md) covers the known limitations — +including why gesture snippets behave differently in Vue than in Svelte. + +For **security** problems, do not open an issue — see [`SECURITY.md`](SECURITY.md). diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 0000000..31d88d4 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,66 @@ +# Security Policy + +## Supported versions + +Only the **latest published version** of NativeScript Snippets receives security +fixes. Older versions are never patched in place — a fix ships as a new release to +both registries: + +- [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=ElecTreeFrying.nativescript-angular-html-snippets) +- [Open VSX](https://open-vsx.org/extension/ElecTreeFrying/nativescript-angular-html-snippets) + +If you are reporting against an older version, please confirm the problem still +reproduces on the latest one first. + +## Reporting a vulnerability + +**Please do not open a public issue for a security problem.** A public report tells +everyone about the weakness before there is a fix available. + +Email **electreefrying.git@gmail.com** with: + +- what the problem is, and roughly how severe you think it is +- the extension version, your VS Code (or Cursor / VSCodium / Windsurf) version, and your OS +- steps to reproduce, or a proof of concept +- whether you would like to be credited in the release notes, and under what name + +You can expect an acknowledgement as soon as I can manage it — usually within a week. +If the report is confirmed, I will let you know the fix timeline and tell you when the +patched version is live on both registries. If I conclude it is not a vulnerability, +I will explain why rather than going quiet. + +This is a solo-maintained project, so please be patient with response times. There is +no bug bounty. + +## Scope + +The attack surface here is unusually small, and it is worth being explicit about why. +This extension **ships no executable code at all** — no `main`, no `activationEvents`, +no bundle. The published artifact is `package.json` plus declarative snippet JSON +under `snippets/`. Nothing runs; VS Code reads the snippet definitions and expands +them on request. There are no runtime dependencies, no network requests, and no +telemetry. + +**In scope:** + +- Snippet content that VS Code's snippet engine would treat as something other than + literal text — a variable, a command, or a shell transform smuggled through a + `${...}` construct +- A malformed snippet file that crashes or hangs the editor +- Anything in the published `package.json` that grants the extension more capability + than a snippets extension should have + +**Out of scope:** + +- Vulnerabilities in VS Code itself — report those to + [Microsoft](https://github.com/microsoft/vscode/security/policy) +- Snippets that expand to *wrong* or outdated NativeScript markup — ordinary bugs, + please open a normal issue +- The local generator under `tools/`. It is developer tooling, is not committed, and + is not part of any published release + +## Disclosure + +Please give me a reasonable window to ship a fix before disclosing publicly. Once the +patched version is live on both registries, you are welcome to write about it — and +I will credit you in the release notes if you would like. From ec674a30667905cb018862de410e80b8eb4a01b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20James=20G=2E=20Ermita=C3=B1o?= Date: Fri, 31 Jul 2026 12:58:27 +0200 Subject: [PATCH 05/11] ci: add a snippet-validation workflow and a weekly Dependabot config --- .github/dependabot.yml | 33 +++++++++++++++++++ .github/workflows/ci.yml | 69 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..0a78243 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,33 @@ +version: 2 + +updates: + # This extension ships no runtime dependency — the published artifact is + # package.json + snippets/. Everything in package.json is dev tooling for the + # local generator, @nativescript/core chief among it: a bump there is the + # upstream signal that the shipped snippets may be stale and want a + # regenerate + re-verify pass locally. + - package-ecosystem: npm + directory: / + schedule: + interval: weekly + day: monday + open-pull-requests-limit: 5 + commit-message: + prefix: chore + include: scope + # Wait a week before proposing a freshly published version. Malicious or + # broken npm releases are typically caught and yanked inside that window. + cooldown: + default-days: 7 + + # The actions pinned in .github/workflows/ + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + day: monday + open-pull-requests-limit: 3 + commit-message: + prefix: chore + cooldown: + default-days: 7 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..342aa74 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,69 @@ +name: CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + snippets: + name: Validate shipped snippets + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + # NOTE: `npm run generate` / `validate` / `check` cannot run here. + # All three live in tools/, which is gitignored and therefore absent from + # a fresh clone — CI only ever sees the shipped artifacts. So this job + # checks what a clone actually has: that every snippet file the manifest + # points at exists and parses. It deliberately does NOT re-implement + # tools/validate.js (content fidelity) — that stays the local gate. + # + # No `npm ci`: this check needs no dependencies, which is the point. + - name: Every contributed snippet file exists and is valid JSON + run: | + node -e " + const fs = require('fs'); + const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8')); + const entries = pkg.contributes.snippets; + const seen = new Set(); + let failed = 0; + + for (const s of entries) { + if (!fs.existsSync(s.path)) { + console.error('MISSING ' + s.path + ' (language: ' + s.language + ')'); + failed++; + continue; + } + if (seen.has(s.path)) { continue; } + seen.add(s.path); + try { + JSON.parse(fs.readFileSync(s.path, 'utf8')); + } catch (e) { + console.error('BAD JSON ' + s.path + ' — ' + e.message); + failed++; + } + } + + console.log('contributes.snippets entries : ' + entries.length); + console.log('distinct files parsed OK : ' + seen.size); + if (failed) { + console.error('FAILED: ' + failed + ' problem(s)'); + process.exit(1); + } + console.log('All shipped snippet files resolve and parse.'); + " From 70e2b44859b161d87da05b6b9c863991b4c241f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20James=20G=2E=20Ermita=C3=B1o?= Date: Fri, 31 Jul 2026 13:47:56 +0200 Subject: [PATCH 06/11] docs(nls): document the hand-maintained localization files --- .vscodeignore | 4 ++-- CLAUDE.md | 4 +++- SPEC.md | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.vscodeignore b/.vscodeignore index 845a6a1..95f0bb6 100644 --- a/.vscodeignore +++ b/.vscodeignore @@ -3,8 +3,8 @@ .vscode-test/** .github/** -# Dependencies & build output — this extension has no runtime bundle; -# the .vsix ships package.json + snippets/ + README/CHANGELOG/LICENSE + images/icon.png +# Dependencies & build output — this extension has no runtime bundle; the .vsix ships +# package.json + package.nls*.json + snippets/ + README/CHANGELOG/LICENSE + images/icon.png node_modules/** # Source & build tooling — snippets/ are generated artifacts, tools/ is the generator diff --git a/CLAUDE.md b/CLAUDE.md index b1acef5..3eb92e4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -8,7 +8,7 @@ Do NOT append a `Co-Authored-By: Claude …` trailer (or any other AI attributio ## What this is -A **generated, multi-flavor VS Code snippets extension** for NativeScript. It ships **no runtime/activation code** (no `extension.ts`, no `main`, no `activationEvents`) — the published artifact is `package.json` + the snippet JSON under `snippets/`. But it is **not** hand-authored: every snippet is derived from `@nativescript/core` v9 TypeScript types by a build-time generator under `tools/`. There is a build step (the generator) even though there is no runtime. The `tools/` generator is **local-only (gitignored)** — not committed or distributed, so a fresh clone has the shipped `snippets/` + docs but not the build tooling. +A **generated, multi-flavor VS Code snippets extension** for NativeScript. It ships **no runtime/activation code** (no `extension.ts`, no `main`, no `activationEvents`) — the published artifact is `package.json` + the `package.nls*.json` display-string files + the snippet JSON under `snippets/`. But it is **not** hand-authored: every snippet is derived from `@nativescript/core` v9 TypeScript types by a build-time generator under `tools/`. There is a build step (the generator) even though there is no runtime. The `tools/` generator is **local-only (gitignored)** — not committed or distributed, so a fresh clone has the shipped `snippets/` + docs but not the build tooling. The same `ns-*` prefixes are contributed to five flavors, each scoped to its language(s) via `contributes.snippets`: @@ -67,6 +67,8 @@ These are silently overwritten on the next `npm run generate`: The rest of the README, plus `SPEC.md`, `SUPPORT.md`, `CLAUDE.md`, `CHANGELOG.md`, and `LICENSE.md`, are hand-maintained. +**So are the `package.nls*.json` files** — the manifest's `%displayName%`/`%description%` placeholders resolve from `package.nls.json` (English base + per-key fallback) and the locale files `package.nls.{zh-cn,es,fr,pt-br,ru,de,ja,tr}.json`. They are the one shipped surface `npm run generate` does **not** own: edit them directly (all nine ship in the VSIX; the Marketplace listing shows the English base). Snippet prefixes, bodies, and `description` fields stay English — they are generated, and prefixes are typed identifiers, not display text. + ## Prefix & variant grammar All prefixes start with `ns-`. Per element: diff --git a/SPEC.md b/SPEC.md index d638356..c7c832c 100644 --- a/SPEC.md +++ b/SPEC.md @@ -22,7 +22,7 @@ The formal specification of the snippet system: the prefix grammar, the variant ## 1. Overview -This extension contributes VS Code snippets for NativeScript UI to five framework flavors. It has **no runtime code** — the shipped artifact is `package.json` plus the snippet JSON under `snippets/`. All snippet content and documentation is **generated** at build time from `@nativescript/core` TypeScript types by the pipeline under `tools/`; the JSON files are build artifacts, not source. +This extension contributes VS Code snippets for NativeScript UI to five framework flavors. It has **no runtime code** — the shipped artifact is `package.json`, the `package.nls*.json` display-string files, and the snippet JSON under `snippets/`. All snippet content and documentation is **generated** at build time from `@nativescript/core` TypeScript types by the pipeline under `tools/`; the JSON files are build artifacts, not source. The system's two invariants: @@ -131,7 +131,7 @@ The following are **generated** and must never be hand-edited — the next `npm - **`reference.md`** — rewritten wholesale by `gen-docs.js`. - **README `## Snippets` section** — `gen-docs.js` replaces everything between the `## Snippets` heading and the next `## ` heading. Editors must keep that heading and a following `## ` heading; the block between is generator-owned. -Everything else (the rest of `README.md`, this `SPEC.md`, `SUPPORT.md`, `CLAUDE.md`, `CHANGELOG.md`, `LICENSE.md`) is hand-maintained. +Everything else (the rest of `README.md`, this `SPEC.md`, `SUPPORT.md`, `CLAUDE.md`, `CHANGELOG.md`, `LICENSE.md`, and the `package.nls*.json` localization files) is hand-maintained. ## 10. Validation rules @@ -165,6 +165,8 @@ Only Angular and Core ship `settings-icon.json` (iOS icons are an `ActionItem` c Svelte's `gestures.json` is mapped to **two** languages — `svelte` (the markup between elements) **and** `svelte-start-tag` (the region *inside* an element's opening tag, which the Svelte grammar scopes as its own language). This is what lets gesture fragments like `on:tap={…}` expand inside a tag, not only between elements. No other flavor needs it: Vue's `