Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/package/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Check the npm package
description: Build @githubnext/projections and check it as it would be published, including a scaffolded custom renderer
description: Build @githubnext/projections-sdk and check it as it would be published, including a scaffolded custom renderer
inputs:
workspace:
description: Workspace path relative to the repository checkout
Expand Down
4 changes: 2 additions & 2 deletions .github/ci-rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"include": ["packages/cli"]
},
"sdk": {
"description": "The SDK, @githubnext/projections",
"description": "The SDK, @githubnext/projections-sdk",
"include": ["packages/sdk"]
},
"inspector": {
Expand Down Expand Up @@ -255,7 +255,7 @@
]
},
"package": {
"description": "@githubnext/projections as published, with a scaffolded renderer the CLI checks in the Inspector: the SDK, Rust, or the CLI and what it serves",
"description": "@githubnext/projections-sdk as published, with a scaffolded renderer the CLI checks in the Inspector: the SDK, Rust, or the CLI and what it serves",
"when": {
"any": [
{
Expand Down
2 changes: 1 addition & 1 deletion .github/projections/agent-tools/extract.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// so a reworded description is no change here. Deterministic for a revision: it reads only files.
import {readFileSync} from 'node:fs'
import path from 'node:path'
import {request, result} from '@githubnext/projections/extractor'
import {request, result} from '@githubnext/projections-sdk/extractor'
import {appTools, canvasActions, catalogTools, paths, vscodeTools} from './surfaces.mjs'
import {keyLines} from './rust-literals.mjs'
import {parameterDifferences, parameterRow, surfaceRow, toolRow} from './rows.mjs'
Expand Down
4 changes: 2 additions & 2 deletions .github/projections/self-authoring-api/extract.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
// - The comparator rules language (`rules.mjs`): the standard library, macros and types CEL expressions use.
// - The CLI's commands and arguments (`cli.mjs`), from the generated CLI reference.
//
// The TypeScript SDK (`@githubnext/projections`) is its own projection, self-authoring-sdk, drawn from the built-in
// The TypeScript SDK (`@githubnext/projections-sdk`) is its own projection, self-authoring-sdk, drawn from the built-in
// typescript-public-api extractor.
//
// Inputs (definition `inputs`), paths relative to the project:
Expand All @@ -20,7 +20,7 @@
// files, and output is sorted.
import {readFileSync} from 'node:fs'
import path from 'node:path'
import {request, result} from '@githubnext/projections/extractor'
import {request, result} from '@githubnext/projections-sdk/extractor'
import {cliDeclarations} from './cli.mjs'
import {rulesDeclarations} from './rules.mjs'
import {schemaDeclarations} from './schemas.mjs'
Expand Down
2 changes: 1 addition & 1 deletion .github/projections/self-authoring-sdk.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "self-authoring-sdk",
"title": "Authoring SDK",
"description": "The public TypeScript API of @githubnext/projections, the package renderer and extractor authors import: the renderer SDK and its React hooks, the renderer kit, the Vite build, the document types and the extractor helpers, by entry point. Changes are classified by TypeScript's compatibility rules.",
"description": "The public TypeScript API of @githubnext/projections-sdk, the package renderer and extractor authors import: the renderer SDK and its React hooks, the renderer kit, the Vite build, the document types and the extractor helpers, by entry point. Changes are classified by TypeScript's compatibility rules.",
"extractor": "typescript-public-api",
"comparator": "packages/comparators/api-compatibility/api-compatibility.comparator.yaml",
"renderer": "api",
Expand Down
2 changes: 1 addition & 1 deletion .github/projections/self-topology/extract.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
//
// Deterministic for a revision and toolchain: files are listed the way Git does, output is sorted, and nothing reads
// the clock, the network or randomness. `cargo metadata --no-deps --offline` reads only manifests.
import {request, result} from '@githubnext/projections/extractor'
import {request, result} from '@githubnext/projections-sdk/extractor'
import {unitFacts} from './facts.mjs'
import {releaseChannels} from './releases.mjs'
import {byText, listFiles, reader, sortedUnique} from './files.mjs'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ jobs:
shard: ${{ matrix.shard }}
grep-invert: ${{ matrix.grepInvert }}
sharded: ${{ matrix.except }}
# @githubnext/projections, the one npm package, as it would be published (docs/contracts/packages.md).
# @githubnext/projections-sdk, the one npm package, as it would be published (docs/contracts/packages.md).
package:
needs: changes
if: needs.changes.outputs.package == 'true'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Publish npm package
# A dist post-announce job (post-announce-jobs in dist-workspace.toml): once a release is announced, publishes
# @githubnext/projections (packages/sdk/) to npm at the release's version, with provenance. The package's version is the
# @githubnext/projections-sdk (packages/sdk/) to npm at the release's version, with provenance. The package's version is the
# CLI's: a release whose tag, Cargo.toml and packages/sdk/package.json disagree publishes nothing. Run it by hand to publish
# a release again; a version already on npm is left as it is.
#
Expand Down Expand Up @@ -116,8 +116,8 @@ jobs:
exit 1
fi
registry=https://registry.npmjs.org/
if npm view "@githubnext/projections@$VERSION" version --registry "$registry" > /dev/null 2>&1; then
echo "::notice title=Already published::@githubnext/projections@$VERSION is already on npm; versions are immutable."
if npm view "@githubnext/projections-sdk@$VERSION" version --registry "$registry" > /dev/null 2>&1; then
echo "::notice title=Already published::@githubnext/projections-sdk@$VERSION is already on npm; versions are immutable."
exit 0
fi
# A prerelease such as 0.3.0-beta.1 is published under the next tag, so latest stays the latest stable.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-proof.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: Release proof
# .sha256. Beside it, the VS Code extension is packaged with that executable
# inside, installed by VS Code's own CLI, and published as
# projections-vscode-<version>-<target>.vsix (not on the Marketplace), with its
# .sha256. The package job packs @githubnext/projections, which renderers depend
# .sha256. The package job packs @githubnext/projections-sdk, which renderers depend
# on by the release asset's URL until npm publishing is approved
# (docs/contracts/packages.md), and proves it with the release's Linux executable;
# it too is attached with its .sha256. dist hosts and announces the release only
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ private repositories, machine-specific paths, or credentials.
Anything that ships, or that shipped code depends on, lives under `packages/`.
That includes the CLI, Engine, schemas, comparators, extractors, renderers, the
host (`packages/host/core`, its VS Code UI `packages/host/vscode-ui`, and the
Inspector `packages/host/inspector`), `@githubnext/projections`
Inspector `packages/host/inspector`), `@githubnext/projections-sdk`
(`packages/sdk`), the VS Code extension, the GitHub Action's scripts, and the
agent integrations.

Expand Down Expand Up @@ -304,7 +304,7 @@ packages/
comparators/ the default comparator, the comparator rules interpreter and its sandboxed runtime, and the API compatibility and runtime policy rules
extractors/ one Rust crate per built-in extractor, with shared support, the catalog and helpers
renderers/ one package per built-in renderer (sandboxed frame bundles) and renderers/sdk for authors
sdk/ @githubnext/projections, the one package renderer and extractor authors install
sdk/ @githubnext/projections-sdk, the one package renderer and extractor authors install
host/core/ the browser host: renderer frames, playback, selection, in-browser comparison, table and text views
host/vscode-ui/ the host's optional VS Code UI (VSCode Elements, codicons, VS Code's theme variables)
host/inspector/ the Inspector UI, a mountable package (its assets are embedded in the CLI)
Expand Down Expand Up @@ -529,9 +529,9 @@ The versioned [contracts](docs/contracts.md) define our wire formats. Their JSON
Schemas only evolve additively within a major version, and each release
publishes them to their own host (see
[schema publishing](docs/maintainers/schema-publishing.md)). Our single npm
package, `@githubnext/projections` (`packages/sdk/`), bundles the renderer SDK,
kit, testing, and schemas workspaces for renderer authors; every other workspace
stays private (see [Packages](docs/contracts/packages.md) and
package, `@githubnext/projections-sdk` (`packages/sdk/`), bundles the renderer
SDK, kit, testing, and schemas workspaces for renderer authors; every other
workspace stays private (see [Packages](docs/contracts/packages.md) and
[npm publishing](docs/maintainers/npm-publishing.md)). Whenever you change its
exports, run `npm run build` and `npm run check:pack --workspace packages/sdk`.

Expand Down
2 changes: 1 addition & 1 deletion changelog.d/303-kit.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
section: kit
---

- **`Entity`, `Relationship` and `Extraction` from the kit** (#303). `@githubnext/projections/kit` now exports these document types, which its functions take, so renderers built on the kit no longer need to import them from `@githubnext/projections/schemas`.
- **`Entity`, `Relationship` and `Extraction` from the kit** (#303). `@githubnext/projections-sdk/kit` now exports these document types, which its functions take, so renderers built on the kit no longer need to import them from `@githubnext/projections-sdk/schemas`.
5 changes: 5 additions & 0 deletions changelog.d/394-authoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
section: authoring
---

- **Extractors import `@githubnext/projections-sdk/extractor`** (#394). The package formerly named `@githubnext/projections` has been renamed `@githubnext/projections-sdk`, and the CLI now gives custom extractors run with `node` the extractor helpers under the new specifier. The former specifier, `@githubnext/projections/extractor`, still resolves to the same module, so extractors committed before the rename keep working, including when a comparison runs one from an older revision. Update imports in new and edited extractors to the new name; an extractor that installs the package itself must also rename the dependency in its `package.json`. The package was never published to npm under its former name.
5 changes: 5 additions & 0 deletions changelog.d/394.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
section: renderer-authors
---

- **The renderer package is now `@githubnext/projections-sdk`** (#394). The package formerly named `@githubnext/projections` has been renamed, because the bare name suggested that it installs Projections itself; the CLI is not distributed through npm. Its subpaths are unchanged. In each custom renderer, rename the dependency in `package.json` to `@githubnext/projections-sdk` and point it at the release asset, which is now `githubnext-projections-sdk-<version>.tgz` (for example `https://github.com/githubnext/projections/releases/download/v<version>/githubnext-projections-sdk-<version>.tgz`). Then replace `@githubnext/projections/` with `@githubnext/projections-sdk/` in every import, including `vite.config.ts` and Playwright specs, and run `npm install`. A renderer installed from a source checkout now depends on `dist/dogfood/githubnext-projections-sdk.tgz`. The package was never published to npm under its former name, so no npm release needs to be replaced.
2 changes: 1 addition & 1 deletion changelog.d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The release notes list sections in this order:
| `intro` | (none) | Opening paragraphs under the version heading, usually written at release time |
| `security` | Security in _version_ | Security fixes and what users need to do |
| `behaviour-changes` | Behaviour changes in _version_ | Anything that might make a passing check, command or workflow fail or act differently, and what to adjust |
| `renderer-authors` | For renderer authors in _version_ | Required or optional changes for custom renderers using `@githubnext/projections` |
| `renderer-authors` | For renderer authors in _version_ | Required or optional changes for custom renderers using `@githubnext/projections-sdk` |
| `highlights` | Highlights | The release's biggest features |
| `built-ins` | New built-ins | New built-in extractors, renderers, comparators and themes |
| `viewer` | Viewer and hosts | The viewer, the Inspector, VS Code and the Copilot canvas |
Expand Down
6 changes: 3 additions & 3 deletions dist-workspace.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ publish-prereleases = true
plan-jobs = ["./release-inputs"]
github-build-setup = "../release-build-setup.yml"
# Each native executable is proved on its own platform and published under its gh
# precompiled-extension name; @githubnext/projections is packed, proved and attached
# as githubnext-projections-<version>.tgz, which renderers depend on by URL.
# precompiled-extension name; @githubnext/projections-sdk is packed, proved and attached
# as githubnext-projections-sdk-<version>.tgz, which renderers depend on by URL.
global-artifacts-jobs = ["./release-proof"]
# Once every artifact is proved, the release waits for a person to approve the `release` environment, which
# attests the assets; dist announces only then (release-approval.yml, docs/maintainers/releasing.md).
publish-jobs = ["./release-approval"]
# Once the release is announced, its JSON Schemas are published to the schemas host
# (publish-schemas.yml, docs/maintainers/schema-publishing.md) and @githubnext/projections to npm
# (publish-schemas.yml, docs/maintainers/schema-publishing.md) and @githubnext/projections-sdk to npm
# (publish-npm.yml, docs/maintainers/npm-publishing.md; inert until npm publishing is approved), and a stable
# release moves its major version tag, v0, which `uses: githubnext/projections@v0` follows (move-major-tag.yml).
post-announce-jobs = ["./publish-schemas", "./publish-npm", "./move-major-tag"]
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ the same tasks: [explore](agents/explore.md), [install](agents/install.md),
[renderer SDK API](reference/renderer-sdk.md),
[renderer messages](reference/renderer-messages.md), and
[theme tokens](reference/theme-tokens.md). All of these ship in
[`@githubnext/projections`](../packages/sdk/README.md).
[`@githubnext/projections-sdk`](../packages/sdk/README.md).
- **Embedding** lets you host Projections inside your own application. Start
with
[embedding Projections](guides/embedding.md#embedding-projections-in-your-own-app)
Expand Down
16 changes: 8 additions & 8 deletions docs/agents/create-projection.md
Original file line number Diff line number Diff line change
Expand Up @@ -482,15 +482,15 @@ result(entities={"service:payments": {"kind": "service", "label": "Payments"}},
```

**In JavaScript or TypeScript, don't either.** For an extractor it runs with
`node`, Projections provides `@githubnext/projections/extractor` (nothing to
install; install the `@githubnext/projections` package only for its types):
`node`, Projections provides `@githubnext/projections-sdk/extractor` (nothing to
install; install the `@githubnext/projections-sdk` package only for its types):
the same `request`, with camelCase accessors (`request.root`,
`request.checkout`, `request.inputs`, `request.files()`), and
`result({entities, relationships})`, with `schema`, `metadata`, `volatile` and
`missingInputs`:

```js
import {request, result} from '@githubnext/projections/extractor'
import {request, result} from '@githubnext/projections-sdk/extractor'

result({entities: {'service:payments': {kind: 'service', label: 'Payments'}}})
```
Expand Down Expand Up @@ -568,7 +568,7 @@ In other languages, write the JSON above.
a model upgrade should count, the pinned model ID (`model`, verbatim). Never
seeds, timestamps or credentials. Equal bases make a rewording unchanged;
a moved part makes the item modified, saying which part. In JavaScript,
`basis()` and `generations()` from `@githubnext/projections/extractor` hash
`basis()` and `generations()` from `@githubnext/projections-sdk/extractor` hash
the basis and reuse the generation store's text for an equal one, so reruns
are identical. Such an extractor needs `execution.network`, its credential
variables in `execution.environment`, `--trust`, and `environmental`
Expand Down Expand Up @@ -613,9 +613,9 @@ view, with a notice.
### Custom renderer

A custom renderer is web development: an npm package in `<id>/renderer/`
written in TypeScript and React with one dependency, `@githubnext/projections`.
written in TypeScript and React with one dependency, `@githubnext/projections-sdk`.
Build on the renderer kit (the shell, comparison model, step timeline, layout
and status components the built-in renderers use): `@githubnext/projections/kit`
and status components the built-in renderers use): `@githubnext/projections-sdk/kit`
is its framework-free half, `/kit/react` its React components and hooks, and
`/kit/react.css` their styles. Use it rather than your own markup and CSS: the
kit already meets the checks the host holds every renderer to. The starter has
Expand All @@ -637,12 +637,12 @@ token, and name the token to use. `/renderer` is the host protocol client
underneath it (`/renderer/react` its React hooks), `/vite` the build,
`/testing` the checks and `/schemas` the document types. It needs Node and npm,
like any front end. (npm 11 may warn that esbuild's install script isn't covered by
`allowScripts`; the build doesn't need it.) `@githubnext/projections` isn't on
`allowScripts`; the build doesn't need it.) `@githubnext/projections-sdk` isn't on
npm yet: `package.json` depends on the tarball attached to the CLI's GitHub
release, by URL, at `projections --version`; keep the two at one version
(`projections doctor` warns when they differ). If `npm install` can't download
it, the person can build it from a Git submodule
([Install @githubnext/projections](https://github.com/githubnext/projections/blob/main/docs/guides/develop-a-renderer.md#install-githubnextprojections));
([Install @githubnext/projections-sdk](https://github.com/githubnext/projections/blob/main/docs/guides/develop-a-renderer.md#install-githubnextprojections-sdk));
never replace it with a `file:` link to a package directory.

**Declare what it does first**, in `vite.config.ts`: `rendererConfig({view:
Expand Down
11 changes: 6 additions & 5 deletions docs/contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,11 @@ details. CI verifies that every `$id` and `$ref` points to the schemas host and
that the published set is complete.

TypeScript types for every document are available publicly from
`@githubnext/projections/schemas` (see [Packages](contracts/packages.md)). These
are the static types of the TypeBox definitions that generate the schemas, while
the source definitions and generated `packages/schemas/<name>/v<version>.json`
files stay in this repository's internal `packages/schemas/` workspace.
`@githubnext/projections-sdk/schemas` (see [Packages](contracts/packages.md)).
These are the static types of the TypeBox definitions that generate the schemas,
while the source definitions and generated
`packages/schemas/<name>/v<version>.json` files stay in this repository's
internal `packages/schemas/` workspace.

Editors backed by [SchemaStore](https://www.schemastore.org) match schemas by
file path. Once the URLs are public, a catalog entry for projection definitions
Expand Down Expand Up @@ -203,7 +204,7 @@ Viewers render code spans in monospace and the surrounding prose in the body
font (via the renderer kit's `Prose` component and the host's table and text
views). Plain-text attributes like tooltips and accessible labels strip the
backtick markers using `plainProse`, while plain-text outputs like the CLI's
text view keep them. `@githubnext/projections/schemas` exports `proseSpans`,
text view keep them. `@githubnext/projections-sdk/schemas` exports `proseSpans`,
`plainProse`, and `codeSpan` (which escapes a string into a single span).

## Trust
Expand Down
Loading
Loading