Skip to content

Commit cf89060

Browse files
committed
feat(ts-plugin): rebrand webjs-plugin → @webjskit/ts-plugin, ready for npm
Matches the scope of the three published packages (@webjskit/core, @webjskit/server, @webjskit/cli). The ts-* naming suffix mirrors the tsserver-plugin convention (cf. ts-lit-plugin). * packages/webjs-plugin → packages/ts-plugin (directory + manifest renamed; name is now "@webjskit/ts-plugin"). * Drops `private: true`; adds publishConfig.access=public, repository, homepage, bugs, license, keywords. README.md included in `files`. * Updates all in-repo references: blog's tsconfig.json plugin entry, blog's devDependency, tests, docs page, AGENTS.md, README, Dockerfile COPY. Lockfile regenerated. * Website install snippet updated to `npx @webjskit/cli create my-app` (+ `npm install && npm run dev`) since all three core packages are published to npm now. All 572 unit tests pass.
1 parent b16fc68 commit cf89060

13 files changed

Lines changed: 66 additions & 52 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ Naming convention: derive the scope class from the file path. Slashes
631631

632632
Styles colocate with the markup as `const STYLES = css\`\`` and
633633
interpolate via `<style>${STYLES.text}</style>`. `ts-lit-plugin` /
634-
`webjs-plugin` highlights the CSS and resolves class go-to-definition.
634+
`@webjskit/ts-plugin` highlights the CSS and resolves class go-to-definition.
635635

636636
Example (page):
637637

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ COPY package.json package-lock.json ./
1919
COPY packages/cli/package.json ./packages/cli/
2020
COPY packages/core/package.json ./packages/core/
2121
COPY packages/server/package.json ./packages/server/
22-
COPY packages/webjs-plugin/package.json ./packages/webjs-plugin/
22+
COPY packages/ts-plugin/package.json ./packages/ts-plugin/
2323
COPY examples/blog/package.json ./examples/blog/
2424
COPY website/package.json ./website/
2525
COPY docs/package.json ./docs/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ Pre-1.0. 571 unit tests (91.6% line coverage), 33 puppeteer e2e tests,
163163
- **Core:** SSR with DSD (opt-in) + light-DOM hydration (default), fine-grained client renderer, `repeat()`, `Suspense()`, client router with `composedPath()` for shadow DOM, mixed-attribute interpolation, MutationObserver upgrade safety net
164164
- **Data:** server actions + superjson (Date/Map/Set/BigInt survive the wire), `expose()` for REST, `json()` + `richFetch()` for content-negotiated APIs, `cache()` for server-side query caching with TTL + `invalidate()`
165165
- **Server:** file router, per-segment middleware, `rateLimit()`, WebSockets + `broadcast()`, CSRF, compression, HTTP/2, 103 Early Hints, health probes, graceful shutdown, `Session` class with `SessionStorage` (cookie or store-backed), NextAuth-style `createAuth()` (Credentials, Google, GitHub)
166-
- **DX:** TypeScript with zero build, `AGENTS.md` contract, `CLAUDE.md`, live reload in dev, optional esbuild bundle for prod, `webjs-plugin` for tsserver — tag-name and CSS-class-name go-to-definition inside `html\`\`` templates.
166+
- **DX:** TypeScript with zero build, `AGENTS.md` contract, `CLAUDE.md`, live reload in dev, optional esbuild bundle for prod, `@webjskit/ts-plugin` for tsserver — tag-name and CSS-class-name go-to-definition inside `html\`\`` templates.
167167

168168
## License
169169

docs/app/docs/styling/page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export default function Post({ params }) {
199199
</tbody>
200200
</table>
201201
202-
<p>Every page wraps its output in <code>&lt;div class="page-&lt;route&gt;"&gt;</code>. Every layout wraps in <code>&lt;div class="layout-&lt;name&gt;"&gt;</code>. Components scope via their tag name. Styles colocate with the markup as <code>const STYLES = css\`…\`</code> and interpolate via <code>&lt;style&gt;\${STYLES.text}&lt;/style&gt;</code> — <code>ts-lit-plugin</code> / <code>webjs-plugin</code> highlights the CSS and resolves class go-to-definition inside those blocks.</p>
202+
<p>Every page wraps its output in <code>&lt;div class="page-&lt;route&gt;"&gt;</code>. Every layout wraps in <code>&lt;div class="layout-&lt;name&gt;"&gt;</code>. Components scope via their tag name. Styles colocate with the markup as <code>const STYLES = css\`…\`</code> and interpolate via <code>&lt;style&gt;\${STYLES.text}&lt;/style&gt;</code> — <code>ts-lit-plugin</code> / <code>@webjskit/ts-plugin</code> highlights the CSS and resolves class go-to-definition inside those blocks.</p>
203203
204204
<h3>Page scope</h3>
205205
<pre>// app/dashboard/page.ts

examples/blog/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@
2424
"prisma": "^5.22.0",
2525
"ts-lit-plugin": "^2.0.2",
2626
"typescript": "^6.0.3",
27-
"webjs-plugin": "0.1.0"
27+
"@webjskit/ts-plugin": "0.1.0"
2828
}
2929
}

examples/blog/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"jsx": "preserve",
1616
"plugins": [
1717
{ "name": "ts-lit-plugin", "strict": true },
18-
{ "name": "webjs-plugin" }
18+
{ "name": "@webjskit/ts-plugin" }
1919
]
2020
},
2121
"include": [

package-lock.json

Lines changed: 9 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# webjs-plugin
1+
# @webjskit/ts-plugin
22

33
A TypeScript language-service plugin for webjs. Gives editors that speak
44
`tsserver` (VS Code, Neovim via `nvim-lspconfig` / `typescript-tools.nvim`,
55
Zed, WebStorm) go-to-definition for custom element tag names used inside
6-
`html\`\`` tagged template literals.
6+
`` html`` `` tagged template literals.
77

88
```ts
99
import { Counter } from './counter.ts';
@@ -16,7 +16,7 @@ render(html`
1616

1717
## Why this exists
1818

19-
`ts-lit-plugin` — the standard tsserver plugin for `html\`\`` intelligence —
19+
`ts-lit-plugin` — the standard tsserver plugin for `` html`` `` intelligence —
2020
resolves tag names via the Lit ecosystem's conventions:
2121

2222
- `customElements.define('my-el', MyEl)` direct static calls
@@ -30,15 +30,15 @@ indirection the plugin can't statically trace.
3030

3131
This plugin fills the gap by recognising the `static tag` pattern
3232
directly. It runs *alongside* `ts-lit-plugin` (which still handles
33-
attribute completions, diagnostics, etc.) — webjs-plugin's only job is
33+
attribute completions, diagnostics, etc.) — this plugin's only job is
3434
tag → class resolution.
3535

3636
## Install
3737

3838
In your webjs app:
3939

4040
```sh
41-
npm i -D webjs-plugin
41+
npm i -D @webjskit/ts-plugin
4242
```
4343

4444
Add to `tsconfig.json`:
@@ -48,15 +48,15 @@ Add to `tsconfig.json`:
4848
"compilerOptions": {
4949
"plugins": [
5050
{ "name": "ts-lit-plugin", "strict": true },
51-
{ "name": "webjs-plugin" }
51+
{ "name": "@webjskit/ts-plugin" }
5252
]
5353
}
5454
}
5555
```
5656

5757
Plugin order matters — list `ts-lit-plugin` first so attribute
58-
intelligence comes from its registry; `webjs-plugin` contributes the
59-
definition when ts-lit-plugin's is empty.
58+
intelligence comes from its registry; `@webjskit/ts-plugin` contributes
59+
the definition when ts-lit-plugin's is empty.
6060

6161
After install, make your editor use the **workspace's** TypeScript
6262
(check `:LspInfo` in Neovim, or the TypeScript version indicator in
@@ -68,7 +68,7 @@ A class counts as a webjs component when:
6868

6969
- It's a `class` declaration (named or exported default).
7070
- It extends an identifier called `WebComponent` (or anything that resolves
71-
to `webjs`'s `WebComponent` base).
71+
to `@webjskit/core`'s `WebComponent` base).
7272
- It has a `static tag = '<tag-name>'` field with a string literal value
7373
containing a hyphen (HTML spec requirement).
7474

@@ -78,4 +78,4 @@ version. The map is rebuilt on file change.
7878

7979
## License
8080

81-
MIT.
81+
MIT

packages/ts-plugin/package.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "@webjskit/ts-plugin",
3+
"version": "0.1.0",
4+
"type": "commonjs",
5+
"description": "TypeScript language-service plugin for webjs — go-to-definition for custom-element tag names inside html`` tagged templates.",
6+
"main": "src/index.js",
7+
"peerDependencies": {
8+
"typescript": ">=5.0.0"
9+
},
10+
"files": [
11+
"src",
12+
"README.md"
13+
],
14+
"publishConfig": {
15+
"access": "public"
16+
},
17+
"repository": {
18+
"type": "git",
19+
"url": "git+https://github.com/vivek7405/webjs.git",
20+
"directory": "packages/ts-plugin"
21+
},
22+
"homepage": "https://github.com/vivek7405/webjs#readme",
23+
"bugs": "https://github.com/vivek7405/webjs/issues",
24+
"license": "MIT",
25+
"keywords": [
26+
"webjs",
27+
"webjskit",
28+
"typescript",
29+
"language-service",
30+
"tsserver-plugin",
31+
"web-components"
32+
]
33+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* webjs-plugin — a TypeScript language-service plugin that resolves
2+
* @webjskit/ts-plugin — a TypeScript language-service plugin that resolves
33
*
44
* 1. Custom-element tag names inside `html\`\`` tagged templates → the
55
* corresponding WebComponent class declaration.
@@ -54,7 +54,7 @@ function init(modules) {
5454
);
5555
} catch (e) {
5656
info.project.projectService.logger?.info?.(
57-
`webjs-plugin: getDefinitionAndBoundSpan threw: ${String(e)}`,
57+
`@webjskit/ts-plugin: getDefinitionAndBoundSpan threw: ${String(e)}`,
5858
);
5959
return upstream;
6060
}

0 commit comments

Comments
 (0)