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
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Validate and package

on:
pull_request:
push:
branches: [main]
workflow_call:
inputs:
expected-version:
type: string
default: ""
release-tag:
type: string
default: ""
publish-ref:
type: string
default: ""

permissions:
contents: read

jobs:
package:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
cache: npm
package-manager-cache: false
- run: npm ci --ignore-scripts --no-audit --no-fund
- run: npm run check
env:
EXPECTED_VERSION: ${{ inputs.expected-version }}
RELEASE_TAG: ${{ inputs.release-tag }}
PUBLISH_REF: ${{ inputs.publish-ref }}
- run: npm run package
- run: sha256sum theme.vsix > theme.vsix.sha256
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: theme-vsix
path: |
theme.vsix
theme.vsix.sha256
if-no-files-found: error
retention-days: 14
75 changes: 75 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Publish theme

on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: Exact package.json version to publish
required: true
type: string
registry:
description: Registry to publish to
required: true
default: open-vsx
type: choice
options: [open-vsx, marketplace, both]

permissions:
contents: read

concurrency:
group: publish-theme
cancel-in-progress: false

jobs:
package:
if: github.event_name == 'workflow_dispatch' || !github.event.release.prerelease
uses: ./.github/workflows/ci.yml
with:
expected-version: ${{ inputs.version || '' }}
release-tag: ${{ github.event.release.tag_name || '' }}
publish-ref: ${{ github.ref }}

publish:
needs: package
runs-on: ubuntu-latest
timeout-minutes: 15
environment: publishing
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: .nvmrc
package-manager-cache: false
- run: npm ci --ignore-scripts --no-audit --no-fund
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: theme-vsix
- run: sha256sum --check theme.vsix.sha256
- name: Check Open VSX namespace ownership and credential
if: github.event_name == 'release' || inputs.registry != 'marketplace'
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
run: |
test -n "$OVSX_PAT" || { echo "::error::Set OVSX_PAT in the publishing environment."; exit 1; }
node --input-type=module -e '
const response = await fetch("https://open-vsx.org/api/linkedinlearning");
if (!response.ok) throw new Error(`Namespace lookup failed: ${response.status}`);
const namespace = await response.json();
if (namespace.verified !== true) throw new Error("Open VSX namespace ownership is not approved yet.");
'
- name: Publish to VS Code Marketplace using trusted publishing
if: github.event_name == 'release' || inputs.registry != 'open-vsx'
run: npm exec --no -- vsce publish --packagePath theme.vsix --oidc
- name: Publish the same VSIX to Open VSX
if: github.event_name == 'release' || inputs.registry != 'marketplace'
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
run: npm exec --no -- ovsx publish theme.vsix
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
24
4 changes: 0 additions & 4 deletions .vscodeignore

This file was deleted.

11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Credential-free validation and VSIX packaging for pull requests and `main`.
- Approval-gated publishing to Open VSX and the VS Code Marketplace, with passwordless Marketplace authentication.

### Fixed

- Removed an invalid configuration contribution; installing the extension leaves the user's selected theme unchanged.
- Excluded development files and source artwork from the extension package.
- Clarified that contrast varies instead of claiming universal WCAG AAA compliance.

## [1.0.1] - 2021-09-29

### Fixed
Expand Down
51 changes: 51 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Contributing

## Development

Use Node.js 24 (`nvm use` if you use nvm), then run:

```sh
npm ci --ignore-scripts
npm run check
npm run package
```

`npm run check` checks formatting, runs tests, and validates both themes and the exact package file list. Validation rejects malformed JSON, duplicate keys, and invalid color and token styles.

`npm run package` creates the installable `theme.vsix`. Only the themes, extension manifest, license, changelog, README, and listing images are included; contributor documentation, sample code, source artwork, workflows, tests, and development dependencies are excluded.

## Previewing themes

Press F5 in VS Code to open an Extension Development Host. Select each theme and use the files in `syntax-tests/` to inspect syntax highlighting.

Check both light and dark variants, including semantic highlighting, selections, focus indicators, and common editor UI states. Automated checks do not replace visual or accessibility testing.

## Continuous integration

Pull requests and pushes to `main` run **Validate and package** without publishing credentials. Successful runs upload a `theme-vsix` artifact containing the VSIX and its SHA-256 checksum.

GitHub Actions are pinned to commit SHAs, npm tools are locked in `package-lock.json`, and dependency lifecycle scripts are disabled. Update tool versions and action pins through reviewed pull requests.

## Releases

The **Publish theme** workflow packages once and waits for approval through the `publishing` GitHub environment. Both registries receive the same VSIX.

Publishing requires:

- Required reviewers configured on the `publishing` environment. Referencing an environment in workflow YAML does not itself enforce approval.
- [Marketplace Trusted Publishing](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#publish-with-github-actions-and-trusted-publishing) configured for the repository, workflow `publish.yml`, and environment `publishing`. Authentication uses OIDC rather than a stored Marketplace PAT.
- Verified ownership of the Open VSX namespace and a dedicated publishing token saved as the `OVSX_PAT` environment secret.

### Publishing a new version

1. Update `package.json` and `package-lock.json` together with `npm version <version> --no-git-tag-version`, update `CHANGELOG.md`, and open a pull request.
2. After CI and review pass, merge the changes. Tag the reviewed commit with `v` followed by the exact package version, then publish a stable GitHub release for that tag. Prereleases are not published by this workflow.
3. Inspect the packaged artifact and approve the waiting deployment. The workflow publishes to both registries without changing the version or creating commits.

### Publishing to one registry

To retry a failed publication or add an existing version to another registry, run **Publish theme** manually. Select the matching version tag, enter the exact package version, and select only the registry that does not already have that version.

Manual publishing also supports `main`, provided its package version is the intended release version. Publishing from other branches or mismatched tags is rejected. The selected commit must contain the publishing workflows.

Do not republish an existing version to a registry that already has it. Do not increment the version just to retry a failed upload.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Accessible light and dark variant theme for VS Code created to improve accessibility when displaying code in LinkedIn Learning courses and in GitHub Codespaces. The dark variant is the default theme used for LinkedIn Learning exercise files and Codespaces.

These themes feature higher color contrast than VS Code’s default Dark and Light themes, meeting AAA WCAG standards.
These themes are designed with readability in mind. Contrast varies by syntax token and UI element; they are not certified to meet WCAG AAA throughout.

## Install

Expand All @@ -13,3 +13,9 @@ These themes feature higher color contrast than VS Code’s default Dark and Lig
3. Then [select a theme](https://code.visualstudio.com/docs/getstarted/themes#_selecting-the-color-theme). The options are:
- `LinkedIn Learning Dark (Default)`
- `LinkedIn Learning Light`

Installing the extension does not change your selected theme automatically.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for development, theme previews, and release instructions.
Loading
Loading