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
48 changes: 48 additions & 0 deletions .github/workflows/binding-publish-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish TypeScript bindings (placeholder, publishes nothing)

on:
workflow_dispatch:
inputs:
targets:
description: 'Comma-separated package-key:typescript targets, or all'
type: string
default: ''
dry_run:
description: 'Must stay true: the workflow is a placeholder and verifies and publishes nothing'
type: boolean
default: true

permissions:
contents: read

concurrency:
group: binding-publish-npm
cancel-in-progress: false

jobs:
publish:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-24.04
timeout-minutes: 15

steps:
- name: Reject real publication
if: ${{ !inputs.dry_run }}
run: |
echo "::error::npm publication is not implemented. Run with dry_run enabled; nothing was published."
exit 1
- name: Record that nothing was verified or published
env:
TARGETS: ${{ inputs.targets }}
DRY_RUN: ${{ inputs.dry_run }}
run: |
set -euo pipefail
{
echo "## Placeholder: nothing was verified or published"
echo
echo "npm publication is not implemented. This run did not verify, build, or publish any package."
echo
echo "- targets: \`${TARGETS:-<none>}\`"
echo "- dry_run: \`${DRY_RUN}\`"
} >> "$GITHUB_STEP_SUMMARY"
echo "::notice::Placeholder only. No package was verified or published."
30 changes: 30 additions & 0 deletions .github/workflows/extension-binding-normalizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
- "tooling/extension-bindings/IMPLEMENTATION.md"
- "tooling/extension-bindings/README.md"
- "tooling/extension-bindings/emitters/go/**"
- "tooling/extension-bindings/emitters/typescript/**"
- "tooling/extension-bindings/model/**"
- "tooling/extension-bindings/normalizer/**"
push:
Expand All @@ -18,6 +19,7 @@ on:
- "tooling/extension-bindings/IMPLEMENTATION.md"
- "tooling/extension-bindings/README.md"
- "tooling/extension-bindings/emitters/go/**"
- "tooling/extension-bindings/emitters/typescript/**"
- "tooling/extension-bindings/model/**"
- "tooling/extension-bindings/normalizer/**"
workflow_dispatch:
Expand Down Expand Up @@ -81,3 +83,31 @@ jobs:

- name: Vet Go emitter
run: go vet ./...

verify-typescript-emitter:
name: Verify TypeScript emitter
runs-on: ubuntu-latest
timeout-minutes: 15

defaults:
run:
working-directory: tooling/extension-bindings/emitters/typescript

steps:
- name: Check out repository
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false

- name: Set up Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 20.19.6
cache: npm
cache-dependency-path: tooling/extension-bindings/emitters/typescript/package-lock.json

- name: Install the pinned emitter dependencies
run: npm ci --ignore-scripts

- name: Test the TypeScript emitter and generated conformance packages
run: npm test
4 changes: 3 additions & 1 deletion tooling/extension-bindings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

`IMPLEMENTATION.md` is historical design guidance; the repository owner's
standing overrides govern generation and publication.
The shared Go resolver and normalizer feed native Go and Python emitters.
The shared Go resolver and normalizer feed native Go and Python emitters. A native TypeScript
emitter lives under `emitters/typescript/`.
The Go orchestrator exposes eight commands through Go's standard `flag` package.
GitHub Actions generates and commits Go and Python bindings to `main`, then a
separate manual workflow publishes verified Go module tags and release assets.
Expand Down Expand Up @@ -142,6 +143,7 @@ For local checks:
```sh
python3 -m unittest discover -s tooling/common -p 'test_*.py'
python3 -m unittest discover -s tooling/extension-bindings/ci -p 'test_*.py'
(cd tooling/extension-bindings/emitters/typescript && npm ci --ignore-scripts && npm test)
python3 tooling/common/build_extensions_site.py --output /tmp/extension-site
python3 tooling/extension-bindings/ci/publish.py configure --targets env-configuration:go
```
Expand Down
2 changes: 2 additions & 0 deletions tooling/extension-bindings/emitters/typescript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "printWidth": 100, "semi": true, "singleQuote": false, "trailingComma": "all" }
158 changes: 158 additions & 0 deletions tooling/extension-bindings/emitters/typescript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
$schema: https://json-schema.org/draft/2020-12/schema
$id: https://runtimeconditions.io/schemas/typescript-package-target/v1alpha1
title: Runtime Conditions TypeScript package target
type: object
additionalProperties: false
required:
- apiVersion
- kind
- packageKey
- rootExtension
- packageName
- version
- sourceDirectory
- minimumNodeVersion
- publicationMode
- repositoryUrl
properties:
apiVersion:
const: runtimeconditions.io/typescript-package-target/v1alpha1
kind:
const: RuntimeConditionsTypeScriptPackageTarget
packageKey:
type: string
pattern: '^[a-z0-9]+(?:-[a-z0-9]+)*$'
rootExtension:
type: string
minLength: 1
packageName:
description: The npm package name, which is also the module specifier consumers import.
type: string
maxLength: 214
pattern: '^(?:@[a-z0-9][a-z0-9-]*/)?[a-z0-9][a-z0-9-]*$'
version:
type: string
pattern: '^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-(?:alpha|beta|rc)\.(0|[1-9][0-9]*))?$'
sourceDirectory:
type: string
pattern: '^bindings/[a-z0-9]+(?:-[a-z0-9]+)*/typescript$'
minimumNodeVersion:
type: string
pattern: '^(?:2[0-9]|[3-9][0-9]|[1-9][0-9]{2,})\.(?:0|[1-9][0-9]*)$'
publicationMode:
enum: [github-tag, registry]
registryId:
type: string
minLength: 1
repositoryUrl:
type: string
pattern: '^https://[^\s]+$'
emitterSha256:
description: Required when emitting package resources; supplied by the tooling caller.
type: string
pattern: '^[0-9a-f]{64}$'
dependencies:
type: array
items:
type: object
additionalProperties: false
required: [extension, packageName, version]
properties:
extension:
type: string
minLength: 1
packageName:
type: string
maxLength: 214
pattern: '^(?:@[a-z0-9][a-z0-9-]*/)?[a-z0-9][a-z0-9-]*$'
version:
type: string
pattern: '^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-(?:alpha|beta|rc)\.(0|[1-9][0-9]*))?$'
versionRange:
description: >-
An npm version range for this dependency. When absent, the generated
package depends on `^<version>`.
type: string
minLength: 1
allOf:
- if:
properties:
publicationMode:
const: registry
then:
required: [registryId]
else:
not:
required: [registryId]
27 changes: 27 additions & 0 deletions tooling/extension-bindings/emitters/typescript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "@runtimeconditions/binding-emitter-typescript",
"version": "0.1.0",
"private": true,
"description": "Native TypeScript emitter for Runtime Conditions extension bindings",
"type": "module",
"engines": {
"node": ">=20.19.0"
},
"bin": {
"runtimeconditions-binding-emitter-typescript": "dist/src/main.js"
},
"scripts": {
"build": "tsc -p tsconfig.json",
"test": "npm run build && node --test dist/test/"
},
"dependencies": {
"ajv": "8.20.0",
"ajv-formats": "3.0.1",
"prettier": "3.9.10",
"typescript": "5.9.3",
"yaml": "2.9.1"
},
"devDependencies": {
"@types/node": "20.19.43"
}
}
Loading
Loading