• TypeScript 72%
  • JavaScript 15%
  • CSS 10.4%
  • Shell 2%
  • Go 0.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Max Burri d7ba884e30
fix: embeddable editor styling (#19)
* fix: keep the embedded YAML preview at least window-tall

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs: explain how to test the embedded editor locally

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-03 08:31:37 +01:00
.devcontainer fix(devcontainer): set a version for go feature in devcontainer (#639) 2026-08-24 19:09:58 +02:00
.github feat: add swiss municipalities as possible organisations (#15) 2026-11-25 10:42:53 +01:00
.vscode chore: coding style setup (#530) 2025-10-27 16:49:03 +01:00
patches Force the use literal blocks when dumping the YAML. 2020-10-14 16:05:21 +02:00
public feat: implement cd bund 2026-11-24 11:09:13 +01:00
scripts ci: check upstream for new commits and add a sync script (#14) 2026-11-24 16:22:27 +01:00
src fix: embeddable editor styling (#19) 2026-12-03 08:31:37 +01:00
.browserslistrc build: replace babel-loader with swc-loader 2023-06-21 20:40:49 +09:00
.dockerignore fix: build the Docker image and update the doc (#315) 2024-02-08 11:59:08 +01:00
.env-example refactor: ♻️ migration to vite scaffold 2024-11-25 12:23:15 +01:00
.eslintignore build: move Wasm output to src/generated 2023-06-22 19:26:44 +09:00
.eslintrc.yml chore: coding style setup (#530) 2025-10-27 16:49:03 +01:00
.gitignore feat: add AGENTS.md to provide guidance for AI coding agents (#641) 2026-08-24 19:27:24 +02:00
.nvmrc chore: update to node 24 (#615) 2026-06-30 09:08:43 +02:00
.release-please-manifest.json chore: release 2.2.0 (#662) 2026-09-08 09:58:20 +02:00
.swcrc style: new JSX transform from React 17 2023-06-22 00:15:01 +09:00
AGENTS.md ci: restore the release process with release-please(#660) 2026-09-08 09:41:00 +02:00
AUTHORS.md chore: release 2.0.3 (#384) 2025-02-12 16:50:49 +01:00
CHANGELOG.md chore: release 2.2.0 (#662) 2026-09-08 09:58:20 +02:00
CLAUDE.md feat: add AGENTS.md to provide guidance for AI coding agents (#641) 2026-08-24 19:27:24 +02:00
CODEOWNERS feat: implement cd bund 2026-11-24 11:09:13 +01:00
CONTRIBUTING.md ci: restore the release process with release-please(#660) 2026-09-08 09:41:00 +02:00
docker-compose.yaml changes to docker to speedup dev 2024-06-24 16:27:16 +02:00
Dockerfile chore: update to node 24 (#615) 2026-06-30 09:08:43 +02:00
eslint.config.js refactor: ♻️ migration to vite scaffold 2024-11-25 12:23:15 +01:00
go.mod build(deps): bump github.com/italia/publiccode-parser-go/v5 from 5.2.3 to 5.3.0 in /src/wasm (#583) 2026-03-24 16:16:37 +01:00
go.work build(deps): bump github.com/italia/publiccode-parser-go/v5 from 5.2.3 to 5.3.0 in /src/wasm (#583) 2026-03-24 16:16:37 +01:00
go.work.sum build(deps): bump github.com/italia/publiccode-parser-go/v5 from 5.2.3 to 5.3.0 in /src/wasm (#583) 2026-03-24 16:16:37 +01:00
index.html chore: release 2.1.1 (#461) 2025-07-23 13:01:40 +02:00
LICENSE chore: rename LICENSE.md to LICENSE 2024-02-01 15:32:30 +01:00
mise.toml chore: add mise.toml 2026-11-26 07:48:45 +01:00
netlify.toml refactor: ♻️ migration to vite scaffold 2024-11-25 12:23:15 +01:00
package-lock.json feat: add organisation select 2026-11-24 11:09:50 +01:00
package.json feat: embeddable editor for the opensource.admin.ch catalog (#16) 2026-12-03 07:37:27 +01:00
publiccode.yml doc update publiccode.yml (#9) 2026-11-26 08:58:58 +01:00
README.md fix: embeddable editor styling (#19) 2026-12-03 08:31:37 +01:00
release-please-config.json ci: restore the release process with release-please(#660) 2026-09-08 09:41:00 +02:00
RELEASE.md ci: restore the release process with release-please(#660) 2026-09-08 09:41:00 +02:00
screenshot.png feat: implement cd bund 2026-11-24 11:09:13 +01:00
tsconfig.app.json refactor: ♻️ migration to vite scaffold 2024-11-25 12:23:15 +01:00
tsconfig.json refactor: ♻️ migration to vite scaffold 2024-11-25 12:23:15 +01:00
tsconfig.node.json feat: embeddable editor for the opensource.admin.ch catalog (#16) 2026-12-03 07:37:27 +01:00
vite.config.ts feat: implement cd bund 2026-11-24 11:09:13 +01:00
vite.embed.config.ts feat: embeddable editor for the opensource.admin.ch catalog (#16) 2026-12-03 07:37:27 +01:00

publiccode yml Editor

This project is a fork of italia/publiccode-editor, customized to align with the Design System of the Swiss Confederation 🇨🇭.

For details about the Swiss Design System, see:

The application is live at: https://swiss.github.io/publiccode-editor/

Branches

Branch Purpose
cd-bund Default branch. The Swiss editor: upstream publiccode-editor plus the adaptations for the Swiss Design System. All work happens here.
main Unmodified mirror of upstream italia/publiccode-editor main. Never commit to it.
gh-pages The built editor, generated by the deployment. Never commit to it.

Deployment

The editor is deployed to the gh-pages branch automatically by the deploy GitHub Action on every push to cd-bund.

Syncing with upstream (publiccode-editor)

This editor follows upstream publiccode-editor. Upstream changes are merged into cd-bund (not rebased), so the history of cd-bund is never rewritten and conflicts that were resolved once do not come back.

1. Notification

The Check upstream GitHub Action runs every Monday (and can be started manually from the Actions tab). If italia/publiccode-editor has commits that are not yet in cd-bund, it opens an issue labelled upstream-sync with the list of commits and a link to the changes. The issue is updated on every run and closed automatically once cd-bund is up to date.

The merge itself is not done by GitHub Actions: the built-in GITHUB_TOKEN is not allowed to push commits that change files in .github/workflows/, which upstream changes regularly. Doing it with a token that is allowed (a personal access token or a GitHub App) would tie the sync to a personal account or require an organization-owned app. The merge is therefore done locally with your own credentials.

2. Merge

Prerequisites: Git and Node.js/npm, a clean working tree and an up-to-date cd-bund.

git switch cd-bund
git pull
./scripts/sync-upstream.sh

The script:

  1. adds the upstream remote (https://github.com/italia/publiccode-editor.git) if it is missing and fetches upstream/main,
  2. creates a branch sync/upstream-<date>-<commit> from cd-bund and merges upstream/main into it,
  3. resolves the recurring conflicts automatically:
    • Fork-owned files (publiccode.yml, CODEOWNERS, .github/workflows/deploy.yml) always keep the cd-bund version (files deleted on cd-bund stay deleted). The list is KEEP_OURS at the top of the script. If upstream changed one of these files, the script prints a git diff command so you can check whether something should be ported by hand.
    • package.json is merged field by field: upstream wins for fields the fork did not change, the fork wins for fields it changed (repository, the added scripts, bootstrap-switzerland instead of bootstrap-italia, ...). version always follows upstream. Fields changed on both sides are listed for review.
    • package-lock.json is taken from upstream, with the package name and version set to ours, and then updated with npm install --package-lock-only because the fork's dependencies differ from upstream. This needs network access and moves bootstrap-switzerland#gh-pages to its latest commit.
  4. commits the merge (as chore:, so release-please ignores it) if nothing else conflicts. Nothing is pushed.

If other files conflict (typically components, styles or translations the fork adapted), the script stops and lists them. Resolve them, then:

git add <files>
git commit --no-edit

To abandon a sync instead: git merge --abort && git switch cd-bund && git branch -D sync/upstream-... (the script prints the exact command).

3. Check

Build, lint and test the result, then check the editor locally, especially the parts upstream changed. This needs Go in addition to Node.js (see Setup):

npm ci
npm run build
npm run lint
npm test
npm run dev

4. Publish

git switch cd-bund
git merge --ff-only sync/upstream-<date>-<commit>
git push origin cd-bund
git branch -d sync/upstream-<date>-<commit>

The push deploys the editor (see Deployment) and the upstream-sync issue is closed on the next run of the Check upstream workflow. If you prefer a review by someone else, push the sync branch and open a pull request into cd-bund instead (merge it with a merge commit, not squash or rebase, so the upstream history is kept).

Optionally update the main mirror as well (or use "Sync fork" on GitHub):

git push origin upstream/main:main

Adding fork-specific files

If you change a file in a way that should always win over upstream (for example another workflow), add it to KEEP_OURS in scripts/sync-upstream.sh. Everything else is merged normally, so keep the fork's changes to upstream files as small as possible to reduce conflicts.

Embedded editor (OSS catalog)

npm run build also creates dist/embed.js. The OSS catalog loads this file to show the editor on its /{lang}/editor page. To test it locally:

  1. In this repository, build and serve dist/:

    npm run build
    npx http-server dist -p 8080 --cors -c-1
    

    Keep it running. --cors lets the catalog load the editor from another port, and -c-1 turns off caching so a rebuild is picked up.

  2. In a second terminal, in the OSS catalog repository, start the catalog and point it to the editor:

    PUBLIC_EDITOR_URL=http://localhost:8080 pnpm scope:client dev
    
  3. Open http://localhost:4321/de/editor.

After a change in the editor, run npm run build again and reload the page with Ctrl+Shift+R. The server from step 1 can keep running.


Below is the original README for the Italian version.


Build Status Issues License Join the #publiccode channel Get invited

A web editor to generate and validate publiccode.yml files


Description

This app helps you create and validate a publiccode.yml file for your project. Simply fill out the form to generate a YAML file that meets the latest standards, which you can then download or copy to your project's root directory.

You can also use the app to check and correct an existing publiccode.yml file. Just upload the file to import it, and the app will validate and help fix any issues.

Setup

Manual

First clone the repository:

git clone https://github.com/italia/publiccode-editor.git

Navigate to the created directory, and run:

npm ci
npm run build:licenses
npm run build:wasm

In order to run the development server locally, you should run:

npm run dev

This will expose a webserver listening at http://localhost:8080.

Devcontainer

In order to develop in a container, you have to match the following criteria:

  • VSCode installed
  • Docker installed and running
  • VSCode Devcontainer extension installed (doc)

You can clone the repo, run VSCode in that folder and run in a container.

Otherwise, you could simply click on following button.

Open in Dev Containers

This repo will be cloned in a Container Volume.

For more details, check Devcontainer documentation out at the following links

Every configuration process, such as dependency installation or wasm configuration, is handled by Devcontainer.

In order to run the development server, you should run:

npm run dev

Static deploy

The editor is fully static and can be build with:

npm run build

and then serve the content of dist/ in production.

Docker

By running:

docker build -t publiccode-editor .

you can build a Docker image. Subsequently, by running:

docker run -p 8080:80 publiccode-editor

you can run the Docker container and see the results at http://localhost:8080.

Localization

To access the web-app in a specific language use the lang param like this: https://publiccode-editor-develop.vercel.app/?lang=en.

The languages that can be picked are:

  • "it" 🇮🇹
  • "en" 🇬🇧
  • "fr" 🇫🇷
  • "de" 🇩🇪
  • "nl" 🇳🇱

Contributing

We welcome contributions! If you encounter any issues with the app, please file an issue on GitHub.

For guidance on how to contribute effectively, check the CONTRIBUTING.md file in the root of the repository.

License

This project is covered by a GNU Affero General Public License v3.0 or later license.